blob: 3f298ee4d00cbd828a0f53a69ded4cd18363428d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * File: mca_drv_asm.S
3 * Purpose: Assembly portion of Generic MCA handling
4 *
5 * Copyright (C) 2004 FUJITSU LIMITED
6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
7 */
8#include <linux/config.h>
9#include <linux/threads.h>
10
11#include <asm/asmmacro.h>
12#include <asm/processor.h>
Russ Andersonb1b901c2005-04-06 00:07:00 -070013#include <asm/ptrace.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15GLOBAL_ENTRY(mca_handler_bhhook)
Hidetoshi Seto20305e52005-09-16 13:44:56 +090016 invala // clear RSE ?
17 ;;
18 cover
19 ;;
20 clrrrb
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090022 alloc r16=ar.pfs,0,2,1,0 // make a new frame
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090024 mov ar.rsc=0
Russ Andersonb1b901c2005-04-06 00:07:00 -070025 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090026 mov r13=IA64_KR(CURRENT) // current task pointer
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090028 mov r2=r13
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090030 addl r22=IA64_RBS_OFFSET,r2
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090032 mov ar.bspstore=r22
Russ Andersonb1b901c2005-04-06 00:07:00 -070033 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090034 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2
Russ Andersonb1b901c2005-04-06 00:07:00 -070035 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090036 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
Russ Andersonb1b901c2005-04-06 00:07:00 -070037 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090038 st1 [r2]=r0 // clear current->thread.on_ustack flag
39 mov loc0=r16
40 movl loc1=mca_handler_bh // recovery C function
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090042 mov out0=r8 // poisoned address
43 mov b6=loc1
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090045 mov loc1=rp
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090047 ssm psr.i
Russ Andersonb1b901c2005-04-06 00:07:00 -070048 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090049 br.call.sptk.many rp=b6 // does not return ...
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090051 mov ar.pfs=loc0
52 mov rp=loc1
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090054 mov r8=r0
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 br.ret.sptk.many rp
56 ;;
57END(mca_handler_bhhook)