/*1* Linux/PA-RISC Project (http://www.parisc-linux.org/)2*3* Copyright (C) 2004 Randolph Chung <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2, or (at your option)8* any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18*19* Fixup routines for kernel exception handling.20*/21#include <asm/asm-offsets.h>22#include <asm/assembly.h>23#include <asm/errno.h>24#include <linux/linkage.h>2526#ifdef CONFIG_SMP27.macro get_fault_ip t1 t228addil LT%__per_cpu_offset,%r2729LDREG RT%__per_cpu_offset(%r1),\t130/* t2 = smp_processor_id() */31mfctl 30,\t232ldw TI_CPU(\t2),\t233#ifdef CONFIG_64BIT34extrd,u \t2,63,32,\t235#endif36/* t2 = &__per_cpu_offset[smp_processor_id()]; */37LDREGX \t2(\t1),\t238addil LT%exception_data,%r2739LDREG RT%exception_data(%r1),\t140/* t1 = &__get_cpu_var(exception_data) */41add,l \t1,\t2,\t142/* t1 = t1->fault_ip */43LDREG EXCDATA_IP(\t1), \t144.endm45#else46.macro get_fault_ip t1 t247/* t1 = &__get_cpu_var(exception_data) */48addil LT%exception_data,%r2749LDREG RT%exception_data(%r1),\t250/* t1 = t2->fault_ip */51LDREG EXCDATA_IP(\t2), \t152.endm53#endif5455.level LEVEL5657.text58.section .fixup, "ax"5960/* get_user() fixups, store -EFAULT in r8, and 0 in r9 */61ENTRY(fixup_get_user_skip_1)62get_fault_ip %r1,%r863ldo 4(%r1), %r164ldi -EFAULT, %r865bv %r0(%r1)66copy %r0, %r967ENDPROC(fixup_get_user_skip_1)6869ENTRY(fixup_get_user_skip_2)70get_fault_ip %r1,%r871ldo 8(%r1), %r172ldi -EFAULT, %r873bv %r0(%r1)74copy %r0, %r975ENDPROC(fixup_get_user_skip_2)7677/* put_user() fixups, store -EFAULT in r8 */78ENTRY(fixup_put_user_skip_1)79get_fault_ip %r1,%r880ldo 4(%r1), %r181bv %r0(%r1)82ldi -EFAULT, %r883ENDPROC(fixup_put_user_skip_1)8485ENTRY(fixup_put_user_skip_2)86get_fault_ip %r1,%r887ldo 8(%r1), %r188bv %r0(%r1)89ldi -EFAULT, %r890ENDPROC(fixup_put_user_skip_2)91929394