Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
2 | * File: mca_drv_asm.S | ||||
3 | * Purpose: Assembly portion of Generic MCA handling | ||||
4 | * | ||||
5 | * Copyright (C) 2004 FUJITSU LIMITED | ||||
Hidetoshi Seto | fe77efb | 2008-01-07 10:11:57 +0900 | [diff] [blame] | 6 | * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #include <linux/threads.h> |
9 | |||||
10 | #include <asm/asmmacro.h> | ||||
11 | #include <asm/processor.h> | ||||
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 12 | #include <asm/ptrace.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
14 | GLOBAL_ENTRY(mca_handler_bhhook) | ||||
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 15 | invala // clear RSE ? |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 16 | cover |
17 | ;; | ||||
18 | clrrrb | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | ;; |
Russ Anderson | d2a28ad | 2006-03-24 09:49:52 -0800 | [diff] [blame] | 20 | alloc r16=ar.pfs,0,2,3,0 // make a new frame |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 21 | mov ar.rsc=0 |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 22 | mov r13=IA64_KR(CURRENT) // current task pointer |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 24 | mov r2=r13 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 26 | addl r22=IA64_RBS_OFFSET,r2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 28 | mov ar.bspstore=r22 |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 29 | addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 |
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 30 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 31 | adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 |
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 32 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 33 | st1 [r2]=r0 // clear current->thread.on_ustack flag |
34 | mov loc0=r16 | ||||
35 | movl loc1=mca_handler_bh // recovery C function | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 37 | mov out0=r8 // poisoned address |
Russ Anderson | d2a28ad | 2006-03-24 09:49:52 -0800 | [diff] [blame] | 38 | mov out1=r9 // iip |
39 | mov out2=r10 // psr | ||||
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 40 | mov b6=loc1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 42 | mov loc1=rp |
Tony Luck | 83ce6ef | 2007-06-28 16:05:34 -0700 | [diff] [blame] | 43 | ssm psr.ic |
44 | ;; | ||||
45 | srlz.i | ||||
46 | ;; | ||||
47 | ssm psr.i | ||||
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 48 | br.call.sptk.many rp=b6 // does not return ... |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 50 | mov ar.pfs=loc0 |
51 | mov rp=loc1 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 53 | mov r8=r0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | br.ret.sptk.many rp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | END(mca_handler_bhhook) |