blob: 4428f57bee73565b34b3e043ad5391e31cd783e6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * File: mca_drv_asm.S
4 * Purpose: Assembly portion of Generic MCA handling
5 *
6 * Copyright (C) 2004 FUJITSU LIMITED
Hidetoshi Setofe77efb2008-01-07 10:11:57 +09007 * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#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 ?
Hidetoshi Seto20305e52005-09-16 13:44:56 +090017 cover
18 ;;
19 clrrrb
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 ;;
Russ Andersond2a28ad2006-03-24 09:49:52 -080021 alloc r16=ar.pfs,0,2,3,0 // make a new frame
Hidetoshi Seto20305e52005-09-16 13:44:56 +090022 mov ar.rsc=0
Hidetoshi Seto20305e52005-09-16 13:44:56 +090023 mov r13=IA64_KR(CURRENT) // current task pointer
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090025 mov r2=r13
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090027 addl r22=IA64_RBS_OFFSET,r2
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090029 mov ar.bspstore=r22
Hidetoshi Seto20305e52005-09-16 13:44:56 +090030 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2
Russ Andersonb1b901c2005-04-06 00:07:00 -070031 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090032 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
Russ Andersonb1b901c2005-04-06 00:07:00 -070033 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090034 st1 [r2]=r0 // clear current->thread.on_ustack flag
35 mov loc0=r16
36 movl loc1=mca_handler_bh // recovery C function
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090038 mov out0=r8 // poisoned address
Russ Andersond2a28ad2006-03-24 09:49:52 -080039 mov out1=r9 // iip
40 mov out2=r10 // psr
Hidetoshi Seto20305e52005-09-16 13:44:56 +090041 mov b6=loc1
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 ;;
Hidetoshi Seto20305e52005-09-16 13:44:56 +090043 mov loc1=rp
Tony Luck83ce6ef2007-06-28 16:05:34 -070044 ssm psr.ic
45 ;;
46 srlz.i
47 ;;
48 ssm psr.i
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070056END(mca_handler_bhhook)