]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/parisc/kernel/syscall.S
Merge branch 'linus' into release
[linux-2.6-omap-h63xx.git] / arch / parisc / kernel / syscall.S
index 56f6231cb863e97ca9c74781ccaea83e1fc063aa..59fc1a43ec3ef094ae514694e549ab6b518aa05a 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/unistd.h>
 #include <asm/errno.h>
+#include <asm/page.h>
 #include <asm/psw.h>
 #include <asm/thread_info.h>
 #include <asm/assembly.h>
@@ -38,7 +39,7 @@
         * pointers.
         */
 
-       .align ASM_PAGE_SIZE
+       .align PAGE_SIZE
 ENTRY(linux_gateway_page)
 
         /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */
@@ -364,17 +365,51 @@ tracesys_sigexit:
 
 
        /*********************************************************
-               Light-weight-syscall code
+               32/64-bit Light-Weight-Syscall ABI
 
-               r20 - lws number
-               r26,r25,r24,r23,r22 - Input registers
-               r28 - Function return register
-               r21 - Error code.
+               * - Indicates a hint for userspace inline asm
+               implementations.
 
-               Scracth: Any of the above that aren't being
-               currently used, including r1. 
+               Syscall number (caller-saves)
+               - %r20
+               * In asm clobber.
 
-               Return pointer: r31 (Not usable)
+               Argument registers (caller-saves)
+               - %r26, %r25, %r24, %r23, %r22
+               * In asm input.
+
+               Return registers (caller-saves)
+               - %r28 (return), %r21 (errno)
+               * In asm output.
+
+               Caller-saves registers
+               - %r1, %r27, %r29
+               - %r2 (return pointer)
+               - %r31 (ble link register)
+               * In asm clobber.
+
+               Callee-saves registers
+               - %r3-%r18
+               - %r30 (stack pointer)
+               * Not in asm clobber.
+
+               If userspace is 32-bit:
+               Callee-saves registers
+               - %r19 (32-bit PIC register)
+
+               Differences from 32-bit calling convention:
+               - Syscall number in %r20
+               - Additional argument register %r22 (arg4)
+               - Callee-saves %r19.
+
+               If userspace is 64-bit:
+               Callee-saves registers
+               - %r27 (64-bit PIC register)
+
+               Differences from 64-bit calling convention:
+               - Syscall number in %r20
+               - Additional argument register %r22 (arg4)
+               - Callee-saves %r27.
 
                Error codes returned by entry path:
 
@@ -472,7 +507,8 @@ lws_compare_and_swap64:
        b,n     lws_compare_and_swap
 #else
        /* If we are not a 64-bit kernel, then we don't
-        * implement having 64-bit input registers
+        * have 64-bit input registers, and calling
+        * the 64-bit LWS CAS returns ENOSYS.
         */
        b,n     lws_exit_nosys
 #endif
@@ -597,7 +633,7 @@ cas_action:
 
 
        /* Make sure nothing else is placed on this page */
-       .align ASM_PAGE_SIZE
+       .align PAGE_SIZE
 END(linux_gateway_page)
 ENTRY(end_linux_gateway_page)
 
@@ -608,7 +644,7 @@ ENTRY(end_linux_gateway_page)
 
        .section .rodata,"a"
 
-       .align ASM_PAGE_SIZE
+       .align PAGE_SIZE
        /* Light-weight-syscall table */
        /* Start of lws table. */
 ENTRY(lws_table)
@@ -617,13 +653,13 @@ ENTRY(lws_table)
 END(lws_table)
        /* End of lws table */
 
-       .align ASM_PAGE_SIZE
+       .align PAGE_SIZE
 ENTRY(sys_call_table)
 #include "syscall_table.S"
 END(sys_call_table)
 
 #ifdef CONFIG_64BIT
-       .align ASM_PAGE_SIZE
+       .align PAGE_SIZE
 ENTRY(sys_call_table64)
 #define SYSCALL_TABLE_64BIT
 #include "syscall_table.S"
@@ -634,12 +670,15 @@ END(sys_call_table64)
        /*
                All light-weight-syscall atomic operations 
                will use this set of locks 
+
+               NOTE: The lws_lock_start symbol must be
+               at least 16-byte aligned for safe use
+               with ldcw.
        */
        .section .data
-       .align 4096
+       .align  PAGE_SIZE
 ENTRY(lws_lock_start)
        /* lws locks */
-       .align 16
        .rept 16
        /* Keep locks aligned at 16-bytes */
        .word 1