]> err.no Git - linux-2.6/blobdiff - arch/parisc/kernel/real2.S
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6] / arch / parisc / kernel / real2.S
index 8dd5defb731618689bce14b383c87e616c4f1ccd..47fbdae6efd5c54a4a49ae0ae799118c711250b4 100644 (file)
@@ -7,8 +7,12 @@
  * Copyright (C) 2000 Hewlett Packard (Paul Bame bame@puffin.external.hp.com)
  *
  */
-#include <asm/assembly.h>
+
 #include <asm/psw.h>
+#include <asm/assembly.h>
+
+#include <linux/linkage.h>
+#include <linux/init.h>
 
        .section        .bss
        .export real_stack
@@ -20,7 +24,7 @@ real32_stack:
 real64_stack:
        .block  8192
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
 #  define REG_SZ 8
 #else
 #  define REG_SZ 4
@@ -36,9 +40,7 @@ save_cr_end:
 /************************ 32-bit real-mode calls ***********************/
 /* This can be called in both narrow and wide kernels */
 
-       .text
-
-       .export real32_call_asm
+       __HEAD
 
        /* unsigned long real32_call_asm(unsigned int *sp,
         *              unsigned int *arg0p,
@@ -48,9 +50,9 @@ save_cr_end:
         *      iodc_fn is the IODC function to call
         */
 
-real32_call_asm:
+ENTRY(real32_call_asm)
        STREG   %rp, -RP_OFFSET(%sp)    /* save RP */
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        callee_save
        ldo     2*REG_SZ(%sp), %sp      /* room for a couple more saves */
        STREG   %r27, -1*REG_SZ(%sp)
@@ -77,7 +79,7 @@ real32_call_asm:
        b,l     save_control_regs,%r2           /* modifies r1, r2, r28 */
        nop
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        rsm     PSW_SM_W, %r0           /* go narrow */
 #endif
 
@@ -85,7 +87,7 @@ real32_call_asm:
        bv      0(%r31)
        nop
 ric_ret:
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        ssm     PSW_SM_W, %r0           /* go wide */
 #endif
        /* restore CRs before going virtual in case we page fault */
@@ -97,7 +99,7 @@ ric_ret:
 
        tovirt_r1 %sp
        LDREG   -REG_SZ(%sp), %sp       /* restore SP */
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
        LDREG   -1*REG_SZ(%sp), %r27
        LDREG   -2*REG_SZ(%sp), %r29
        ldo     -2*REG_SZ(%sp), %sp
@@ -106,12 +108,13 @@ ric_ret:
        LDREG   -RP_OFFSET(%sp), %rp    /* restore RP */
        bv      0(%rp)
        nop
+ENDPROC(real32_call_asm)
 
 
 #  define PUSH_CR(r, where) mfctl r, %r1 ! STREG,ma %r1, REG_SZ(where)
 #  define POP_CR(r, where) LDREG,mb -REG_SZ(where), %r1 ! mtctl %r1, r
 
-       .text
+       __HEAD
 save_control_regs:
        load32  PA(save_cr_space), %r28
        PUSH_CR(%cr24, %r28)
@@ -143,24 +146,21 @@ restore_control_regs:
 /* rfi_virt2real() and rfi_real2virt() could perhaps be adapted for
  * more general-purpose use by the several places which need RFIs
  */
+       __HEAD
        .align 128
-       .text
 rfi_virt2real:
        /* switch to real mode... */
-       ssm             0,0             /* See "relied upon translation" */
-       nop                             /* PA 2.0 Arch. F-5 */
-       nop
-       nop
+       rsm             PSW_SM_I,%r0
+       load32          PA(rfi_v2r_1), %r1
        nop
        nop
        nop
        nop
        nop
        
-       rsm             (PSW_SM_Q|PSW_SM_I),%r0  /* disable Q & I bits to load iia queue */
+       rsm             PSW_SM_Q,%r0  /* disable Q & I bits to load iia queue */
        mtctl           %r0, %cr17      /* Clear IIASQ tail */
        mtctl           %r0, %cr17      /* Clear IIASQ head */
-       load32          PA(rfi_v2r_1), %r1
        mtctl           %r1, %cr18      /* IIAOQ head */
        ldo             4(%r1), %r1
        mtctl           %r1, %cr18      /* IIAOQ tail */
@@ -181,13 +181,11 @@ rfi_v2r_1:
        bv      0(%r2)
        nop
 
-       .text
+       __HEAD
        .align 128
 rfi_real2virt:
-       ssm             0,0             /* See "relied upon translation" */
-       nop                             /* PA 2.0 Arch. F-5 */
-       nop
-       nop
+       rsm             PSW_SM_I,%r0
+       load32          (rfi_r2v_1), %r1
        nop
        nop
        nop
@@ -197,7 +195,6 @@ rfi_real2virt:
        rsm             PSW_SM_Q,%r0    /* disable Q bit to load iia queue */
        mtctl           %r0, %cr17      /* Clear IIASQ tail */
        mtctl           %r0, %cr17      /* Clear IIASQ head */
-       load32          (rfi_r2v_1), %r1
        mtctl           %r1, %cr18      /* IIAOQ head */
        ldo             4(%r1), %r1
        mtctl           %r1, %cr18      /* IIAOQ tail */
@@ -218,12 +215,11 @@ rfi_r2v_1:
        bv      0(%r2)
        nop
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
 
 /************************ 64-bit real-mode calls ***********************/
 /* This is only usable in wide kernels right now and will probably stay so */
-       .text
-       .export real64_call_asm
+       __HEAD
        /* unsigned long real64_call_asm(unsigned long *sp,
         *              unsigned long *arg0p,
         *              unsigned long fn)
@@ -231,7 +227,7 @@ rfi_r2v_1:
         *      arg0p points to where saved arg values may be found
         *      iodc_fn is the IODC function to call
         */
-real64_call_asm:
+ENTRY(real64_call_asm)
        std     %rp, -0x10(%sp)         /* save RP */
        std     %sp, -8(%arg0)          /* save SP on real-mode stack */
        copy    %arg0, %sp              /* adopt the real-mode SP */
@@ -277,28 +273,21 @@ r64_ret:
        ldd     -0x10(%sp), %rp         /* restore RP */
        bv      0(%rp)
        nop
+ENDPROC(real64_call_asm)
 
 #endif
 
-       .export pc_in_user_space
-       .text
-       /* Doesn't belong here but I couldn't find a nicer spot. */
-       /* Should never get called, only used by profile stuff in time.c */
-pc_in_user_space:
-       bv,n    0(%rp)
-       nop
-
-
-       .export __canonicalize_funcptr_for_compare
-       .text
+       __HEAD
        /* http://lists.parisc-linux.org/hypermail/parisc-linux/10916.html
        **      GCC 3.3 and later has a new function in libgcc.a for
        **      comparing function pointers.
        */
-__canonicalize_funcptr_for_compare:
-#ifdef __LP64__
+ENTRY(__canonicalize_funcptr_for_compare)
+#ifdef CONFIG_64BIT
        bve (%r2)
 #else
        bv %r0(%r2)
 #endif
        copy %r26,%r28
+ENDPROC(__canonicalize_funcptr_for_compare)
+