Lines Matching +full:30 +full:- +full:bit
2 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
12 How does the Linux gateway page on PA-RISC work?
13 ------------------------------------------------
14 The Linux gateway page on PA-RISC is "special".
27 executed atomically (because the kernel can't be pre-empted) and they may
33 #include <asm/asm-offsets.h>
66 ldo -1(\reg1), \reg1
102 /* Light-weight-syscall entry must always be located at 0xb0 */
138 /* Store W bit on entry to the syscall in case it's a wide userland
142 /* sp must be aligned on 4, so deposit the W bit setting into
192 LDREGM -FRAME_SIZE(%r30), %r2 /* get users sp back */
194 extrd,u %r2,63,1,%r19 /* W hidden in bottom bit */
196 xor %r19,%r2,%r2 /* clear bottom bit */
225 ldo -16(%r30),%r29 /* Reference param save area */
226 copy %r19,%r2 /* W bit back to r2 */
230 stw %r22, -52(%r30) /* 5th argument */
231 stw %r21, -56(%r30) /* 6th argument */
242 nearby since the gateway page is mapped execute-only. */
285 ldo -ENOSYS(%r0),%r28 /* set errno */
294 * bit is still clear on syscalls, and the D bit is set if this
296 * bit on syscall_return_rfi to determine which registers to
298 * C bit set, a non-straced syscall entry results in C and D clear
349 /* do_syscall_trace_enter either returned the syscallno, or -1L,
351 * task->thread.regs.gr[20] above.
364 ldo -16(%r30),%r29 /* Reference param save area */
366 stw %r22, -52(%r30) /* 5th argument */
367 stw %r21, -56(%r30) /* 6th argument */
370 cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */
375 nearby since the gateway page is mapped execute-only. */
379 extrd,u %r19,63,1,%r2 /* W hidden in bottom bit */
406 ldo -ENOSYS(%r0),%r28 /* set errno */
414 ldo -16(%r30),%r29 /* Reference param save area */
434 ldo -16(%r30),%r29 /* Reference param save area */
444 32/64-bit Light-Weight-Syscall ABI
446 * - Indicates a hint for userspace inline asm
449 Syscall number (caller-saves)
450 - %r20
453 Argument registers (caller-saves)
454 - %r26, %r25, %r24, %r23, %r22
457 Return registers (caller-saves)
458 - %r28 (return), %r21 (errno)
461 Caller-saves registers
462 - %r1, %r27, %r29
463 - %r2 (return pointer)
464 - %r31 (ble link register)
467 Callee-saves registers
468 - %r3-%r18
469 - %r30 (stack pointer)
472 If userspace is 32-bit:
473 Callee-saves registers
474 - %r19 (32-bit PIC register)
476 Differences from 32-bit calling convention:
477 - Syscall number in %r20
478 - Additional argument register %r22 (arg4)
479 - Callee-saves %r19.
481 If userspace is 64-bit:
482 Callee-saves registers
483 - %r27 (64-bit PIC register)
485 Differences from 64-bit calling convention:
486 - Syscall number in %r20
487 - Additional argument register %r22 (arg4)
488 - Callee-saves %r27.
492 ENOSYS - r20 was an invalid LWS number.
500 /* sp must be aligned on 4, so deposit the W bit setting into
504 /* Clip LWS number to a 32-bit value for 32-bit processes */
532 ldo -EAGAIN(%r0), %r21
541 ldo -EAGAIN(%r0),%r21
546 ldo -EFAULT(%r0),%r21
549 ldo -ENOSYS(%r0),%r21
554 /* decide whether to reset the wide mode bit
556 * For a syscall, the W bit is stored in the lowest bit
560 /* now reset the lowest bit of sp if it was set */
568 Implementing 32bit CAS as an atomic operation:
570 %r26 - Address to examine
571 %r25 - Old value to check (old)
572 %r24 - New value to set (new)
573 %r28 - Return prev through this register.
574 %r21 - Kernel error code
577 EAGAIN - CAS is busy, ldcw failed, try again.
578 EFAULT - Read or write failed.
581 r28 == 1 - CAS is busy. lock contended.
582 r28 == 2 - CAS is busy. ldcw failed.
583 r28 == 3 - CAS is busy. page fault.
594 /* If we are not a 64-bit kernel, then we don't
595 * have 64-bit input registers, and calling
596 * the 64-bit LWS CAS returns ENOSYS.
607 /* Clip all the input registers for 32-bit processes */
618 /* Calculate 8-bit hash index from virtual address */
626 255, multiplied by 16 (keep it 16-byte aligned)
666 ASM_EXCEPTIONTABLE_ENTRY(1b-linux_gateway_page, 5b-linux_gateway_page)
667 ASM_EXCEPTIONTABLE_ENTRY(2b-linux_gateway_page, 5b-linux_gateway_page)
671 ASM_EXCEPTIONTABLE_ENTRY(3b-linux_gateway_page, 6b-linux_gateway_page)
672 ASM_EXCEPTIONTABLE_ENTRY(4b-linux_gateway_page, 6b-linux_gateway_page)
680 %r26 - Address to examine
681 %r25 - Pointer to the value to check (old)
682 %r24 - Pointer to the value to set (new)
683 %r23 - Size of the variable (0/1/2/3 for 8/16/32/64 bit)
684 %r28 - Return non-zero on failure
685 %r21 - Kernel error code
688 EAGAIN - CAS is busy, ldcw failed, try again.
689 EFAULT - Read or write failed.
692 r28 == 1 - CAS is busy. lock contended.
693 r28 == 2 - CAS is busy. ldcw failed.
694 r28 == 3 - CAS is busy. page fault.
696 Scratch: r20, r22, r28, r29, r1, fr4 (32bit for 64bit CAS only)
705 /* Clip the input registers for 32-bit processes. We don't
723 /* 8-bit load */
733 /* 16-bit load */
743 /* 32-bit load */
753 /* 64-bit load */
758 /* Load old value into r22/r23 - high/low */
772 /* Calculate 8-bit hash index from virtual address */
780 255, multiplied by 16 (keep it 16-byte aligned)
815 /* Set %r28 as non-zero for now */
818 /* 8-bit CAS */
828 /* 16-bit CAS */
838 /* 32-bit CAS */
848 /* 64-bit CAS */
872 30: b,n lws_fault
873 ASM_EXCEPTIONTABLE_ENTRY(1b-linux_gateway_page, 30b-linux_gateway_page)
874 ASM_EXCEPTIONTABLE_ENTRY(2b-linux_gateway_page, 30b-linux_gateway_page)
875 ASM_EXCEPTIONTABLE_ENTRY(3b-linux_gateway_page, 30b-linux_gateway_page)
876 ASM_EXCEPTIONTABLE_ENTRY(4b-linux_gateway_page, 30b-linux_gateway_page)
877 ASM_EXCEPTIONTABLE_ENTRY(5b-linux_gateway_page, 30b-linux_gateway_page)
878 ASM_EXCEPTIONTABLE_ENTRY(6b-linux_gateway_page, 30b-linux_gateway_page)
879 ASM_EXCEPTIONTABLE_ENTRY(7b-linux_gateway_page, 30b-linux_gateway_page)
880 ASM_EXCEPTIONTABLE_ENTRY(8b-linux_gateway_page, 30b-linux_gateway_page)
882 ASM_EXCEPTIONTABLE_ENTRY(9b-linux_gateway_page, 30b-linux_gateway_page)
885 ASM_EXCEPTIONTABLE_ENTRY(10b-linux_gateway_page, 30b-linux_gateway_page)
886 ASM_EXCEPTIONTABLE_ENTRY(11b-linux_gateway_page, 30b-linux_gateway_page)
890 ASM_EXCEPTIONTABLE_ENTRY(12b-linux_gateway_page, 31b-linux_gateway_page)
891 ASM_EXCEPTIONTABLE_ENTRY(13b-linux_gateway_page, 31b-linux_gateway_page)
892 ASM_EXCEPTIONTABLE_ENTRY(14b-linux_gateway_page, 31b-linux_gateway_page)
893 ASM_EXCEPTIONTABLE_ENTRY(15b-linux_gateway_page, 31b-linux_gateway_page)
894 ASM_EXCEPTIONTABLE_ENTRY(16b-linux_gateway_page, 31b-linux_gateway_page)
895 ASM_EXCEPTIONTABLE_ENTRY(17b-linux_gateway_page, 31b-linux_gateway_page)
896 ASM_EXCEPTIONTABLE_ENTRY(18b-linux_gateway_page, 31b-linux_gateway_page)
897 ASM_EXCEPTIONTABLE_ENTRY(19b-linux_gateway_page, 31b-linux_gateway_page)
899 ASM_EXCEPTIONTABLE_ENTRY(20b-linux_gateway_page, 31b-linux_gateway_page)
906 %r26 - Exchange address
907 %r25 - Size of the variable (0/1/2/3 for 8/16/32/64 bit)
908 %r24 - Address of new value
909 %r23 - Address of old value
910 %r28 - Return non-zero on failure
911 %r21 - Kernel error code
914 EAGAIN - CAS is busy, ldcw failed, try again.
915 EFAULT - Read or write failed.
918 r28 == 1 - CAS is busy. lock contended.
919 r28 == 2 - CAS is busy. ldcw failed.
920 r28 == 3 - CAS is busy. page fault.
931 /* Clip the input registers for 32-bit processes. We don't
952 /* 8-bit exchange */
962 /* 16-bit exchange */
972 /* 32-bit exchange */
982 /* 64-bit exchange */
1002 /* Calculate 8-bit hash index from virtual address */
1010 255, multiplied by 16 (keep it 16-byte aligned)
1038 /* Set %r28 as non-zero for now */
1041 /* 8-bit exchange */
1051 /* 16-bit exchange */
1061 /* 32-bit exchange */
1071 /* 64-bit exchange */
1087 30: b,n lws_fault
1088 ASM_EXCEPTIONTABLE_ENTRY(1b-linux_gateway_page, 30b-linux_gateway_page)
1089 ASM_EXCEPTIONTABLE_ENTRY(2b-linux_gateway_page, 30b-linux_gateway_page)
1090 ASM_EXCEPTIONTABLE_ENTRY(3b-linux_gateway_page, 30b-linux_gateway_page)
1091 ASM_EXCEPTIONTABLE_ENTRY(4b-linux_gateway_page, 30b-linux_gateway_page)
1092 ASM_EXCEPTIONTABLE_ENTRY(5b-linux_gateway_page, 30b-linux_gateway_page)
1093 ASM_EXCEPTIONTABLE_ENTRY(6b-linux_gateway_page, 30b-linux_gateway_page)
1094 ASM_EXCEPTIONTABLE_ENTRY(7b-linux_gateway_page, 30b-linux_gateway_page)
1095 ASM_EXCEPTIONTABLE_ENTRY(8b-linux_gateway_page, 30b-linux_gateway_page)
1097 ASM_EXCEPTIONTABLE_ENTRY(9b-linux_gateway_page, 30b-linux_gateway_page)
1098 ASM_EXCEPTIONTABLE_ENTRY(10b-linux_gateway_page, 30b-linux_gateway_page)
1101 ASM_EXCEPTIONTABLE_ENTRY(11b-linux_gateway_page, 30b-linux_gateway_page)
1102 ASM_EXCEPTIONTABLE_ENTRY(12b-linux_gateway_page, 30b-linux_gateway_page)
1106 ASM_EXCEPTIONTABLE_ENTRY(14b-linux_gateway_page, 31b-linux_gateway_page)
1107 ASM_EXCEPTIONTABLE_ENTRY(15b-linux_gateway_page, 31b-linux_gateway_page)
1108 ASM_EXCEPTIONTABLE_ENTRY(16b-linux_gateway_page, 31b-linux_gateway_page)
1109 ASM_EXCEPTIONTABLE_ENTRY(17b-linux_gateway_page, 31b-linux_gateway_page)
1110 ASM_EXCEPTIONTABLE_ENTRY(18b-linux_gateway_page, 31b-linux_gateway_page)
1111 ASM_EXCEPTIONTABLE_ENTRY(19b-linux_gateway_page, 31b-linux_gateway_page)
1112 ASM_EXCEPTIONTABLE_ENTRY(20b-linux_gateway_page, 31b-linux_gateway_page)
1113 ASM_EXCEPTIONTABLE_ENTRY(21b-linux_gateway_page, 31b-linux_gateway_page)
1114 ASM_EXCEPTIONTABLE_ENTRY(22b-linux_gateway_page, 31b-linux_gateway_page)
1115 ASM_EXCEPTIONTABLE_ENTRY(23b-linux_gateway_page, 31b-linux_gateway_page)
1116 ASM_EXCEPTIONTABLE_ENTRY(24b-linux_gateway_page, 31b-linux_gateway_page)
1117 ASM_EXCEPTIONTABLE_ENTRY(25b-linux_gateway_page, 31b-linux_gateway_page)
1118 ASM_EXCEPTIONTABLE_ENTRY(26b-linux_gateway_page, 31b-linux_gateway_page)
1119 ASM_EXCEPTIONTABLE_ENTRY(27b-linux_gateway_page, 31b-linux_gateway_page)
1120 ASM_EXCEPTIONTABLE_ENTRY(28b-linux_gateway_page, 31b-linux_gateway_page)
1121 ASM_EXCEPTIONTABLE_ENTRY(29b-linux_gateway_page, 31b-linux_gateway_page)
1126 %r26 - Address to store
1127 %r25 - Size of the variable (0/1/2/3 for 8/16/32/64 bit)
1128 %r24 - Address of value to store
1129 %r28 - Return non-zero on failure
1130 %r21 - Kernel error code
1133 EAGAIN - CAS is busy, ldcw failed, try again.
1134 EFAULT - Read or write failed.
1137 r28 == 1 - CAS is busy. lock contended.
1138 r28 == 2 - CAS is busy. ldcw failed.
1139 r28 == 3 - CAS is busy. page fault.
1150 /* Clip the input registers for 32-bit processes. We don't
1168 /* 8-bit store */
1174 /* 16-bit store */
1180 /* 32-bit store */
1186 /* 64-bit store */
1201 /* Calculate 8-bit hash index from virtual address */
1209 255, multiplied by 16 (keep it 16-byte aligned)
1237 /* Set %r28 as non-zero for now */
1240 /* 8-bit store */
1246 /* 16-bit store */
1252 /* 32-bit store */
1258 /* 64-bit store */
1270 30: b,n lws_fault
1271 ASM_EXCEPTIONTABLE_ENTRY(1b-linux_gateway_page, 30b-linux_gateway_page)
1272 ASM_EXCEPTIONTABLE_ENTRY(2b-linux_gateway_page, 30b-linux_gateway_page)
1273 ASM_EXCEPTIONTABLE_ENTRY(3b-linux_gateway_page, 30b-linux_gateway_page)
1274 ASM_EXCEPTIONTABLE_ENTRY(4b-linux_gateway_page, 30b-linux_gateway_page)
1276 ASM_EXCEPTIONTABLE_ENTRY(5b-linux_gateway_page, 30b-linux_gateway_page)
1279 ASM_EXCEPTIONTABLE_ENTRY(6b-linux_gateway_page, 30b-linux_gateway_page)
1280 ASM_EXCEPTIONTABLE_ENTRY(7b-linux_gateway_page, 30b-linux_gateway_page)
1284 ASM_EXCEPTIONTABLE_ENTRY(9b-linux_gateway_page, 31b-linux_gateway_page)
1285 ASM_EXCEPTIONTABLE_ENTRY(10b-linux_gateway_page, 31b-linux_gateway_page)
1286 ASM_EXCEPTIONTABLE_ENTRY(11b-linux_gateway_page, 31b-linux_gateway_page)
1287 ASM_EXCEPTIONTABLE_ENTRY(12b-linux_gateway_page, 31b-linux_gateway_page)
1288 ASM_EXCEPTIONTABLE_ENTRY(13b-linux_gateway_page, 31b-linux_gateway_page)
1289 ASM_EXCEPTIONTABLE_ENTRY(14b-linux_gateway_page, 31b-linux_gateway_page)
1290 ASM_EXCEPTIONTABLE_ENTRY(15b-linux_gateway_page, 31b-linux_gateway_page)
1291 ASM_EXCEPTIONTABLE_ENTRY(16b-linux_gateway_page, 31b-linux_gateway_page)
1301 #define LWS_ENTRY(_name_) ASM_ULONG_INSN (lws_##_name_ - linux_gateway_page)
1306 /* Light-weight-syscall table */
1309 LWS_ENTRY(compare_and_swap32) /* 0 - ELF32 Atomic 32bit CAS */
1310 LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic 32bit CAS */
1311 LWS_ENTRY(compare_and_swap_2) /* 2 - Atomic 64bit CAS */
1312 LWS_ENTRY(atomic_xchg) /* 3 - Atomic Exchange */
1313 LWS_ENTRY(atomic_store) /* 4 - Atomic Store */
1326 #include <asm/syscall_table_32.h> /* 32-bit syscalls */
1334 #include <asm/syscall_table_64.h> /* 64-bit syscalls */
1339 All light-weight-syscall atomic operations
1343 at least 16-byte aligned for safe use
1351 /* Keep locks aligned at 16-bytes */