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 | ||||
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 Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 13 | #include <asm/ptrace.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
15 | GLOBAL_ENTRY(mca_handler_bhhook) | ||||
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 16 | invala // clear RSE ? |
17 | ;; | ||||
18 | cover | ||||
19 | ;; | ||||
20 | clrrrb | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 22 | alloc r16=ar.pfs,0,2,1,0 // make a new frame |
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 ar.rsc=0 |
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 25 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 26 | mov r13=IA64_KR(CURRENT) // current task pointer |
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 r2=r13 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 30 | addl r22=IA64_RBS_OFFSET,r2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 32 | mov ar.bspstore=r22 |
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 33 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 34 | addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 |
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 35 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 36 | adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 |
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 37 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 38 | st1 [r2]=r0 // clear current->thread.on_ustack flag |
39 | mov loc0=r16 | ||||
40 | movl loc1=mca_handler_bh // recovery C function | ||||
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 out0=r8 // poisoned address |
43 | mov b6=loc1 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 45 | mov loc1=rp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 47 | ssm psr.i |
Russ Anderson | b1b901c | 2005-04-06 00:07:00 -0700 | [diff] [blame] | 48 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 49 | br.call.sptk.many rp=b6 // does not return ... |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 51 | mov ar.pfs=loc0 |
52 | mov rp=loc1 | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | ;; |
Hidetoshi Seto | 20305e5 | 2005-09-16 13:44:56 +0900 | [diff] [blame] | 54 | mov r8=r0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | br.ret.sptk.many rp |
56 | ;; | ||||
57 | END(mca_handler_bhhook) |