blob: 767ac2c20d16a1eb28c9a7ec9a6ecea140740a15 [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
Hidetoshi Setofe77efb2008-01-07 10:11:57 +09006 * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <linux/threads.h>
9
10#include <asm/asmmacro.h>
11#include <asm/processor.h>
Russ Andersonb1b901c2005-04-06 00:07:00 -070012#include <asm/ptrace.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14GLOBAL_ENTRY(mca_handler_bhhook)
Hidetoshi Seto20305e52005-09-16 13:44:56 +090015 invala // clear RSE ?
Hidetoshi Seto20305e52005-09-16 13:44:56 +090016 cover
17 ;;
18 clrrrb
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 ;;
Russ Andersond2a28ad2006-03-24 09:49:52 -080020 alloc r16=ar.pfs,0,2,3,0 // make a new frame
Hidetoshi Seto20305e52005-09-16 13:44:56 +090021 mov ar.rsc=0
Hidetoshi Seto20305e52005-09-16 13:44:56 +090022 mov r13=IA64_KR(CURRENT) // current task pointer
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090024 mov r2=r13
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090026 addl r22=IA64_RBS_OFFSET,r2
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090028 mov ar.bspstore=r22
Hidetoshi Seto20305e52005-09-16 13:44:56 +090029 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2
Russ Andersonb1b901c2005-04-06 00:07:00 -070030 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090031 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
Russ Andersonb1b901c2005-04-06 00:07:00 -070032 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090033 st1 [r2]=r0 // clear current->thread.on_ustack flag
34 mov loc0=r16
35 movl loc1=mca_handler_bh // recovery C function
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090037 mov out0=r8 // poisoned address
Russ Andersond2a28ad2006-03-24 09:49:52 -080038 mov out1=r9 // iip
39 mov out2=r10 // psr
Hidetoshi Seto20305e52005-09-16 13:44:56 +090040 mov b6=loc1
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090042 mov loc1=rp
Tony Luck83ce6ef2007-06-28 16:05:34 -070043 ssm psr.ic
44 ;;
45 srlz.i
46 ;;
47 ssm psr.i
Hidetoshi Seto20305e52005-09-16 13:44:56 +090048 br.call.sptk.many rp=b6 // does not return ...
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090050 mov ar.pfs=loc0
51 mov rp=loc1
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090053 mov r8=r0
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 br.ret.sptk.many rp
Linus Torvalds1da177e2005-04-16 15:20:36 -070055END(mca_handler_bhhook)