yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_SPARC_SYSDEP_H |
| 2 | #define _LINUX_SPARC_SYSDEP_H 1 |
| 3 | |
| 4 | #include <common/sysdep.h> |
| 5 | |
| 6 | #undef ENTRY |
| 7 | #undef END |
| 8 | |
| 9 | #ifdef __ASSEMBLER__ |
| 10 | |
| 11 | #define LOADSYSCALL(x) mov __NR_##x, %g1 |
| 12 | |
| 13 | #define ENTRY(name) \ |
| 14 | .align 4; \ |
| 15 | .global C_SYMBOL_NAME(name); \ |
| 16 | .type name, @function; \ |
| 17 | C_LABEL(name) \ |
| 18 | cfi_startproc; |
| 19 | |
| 20 | #define END(name) \ |
| 21 | cfi_endproc; \ |
| 22 | .size name, . - name |
| 23 | |
| 24 | #define LOC(name) .L##name |
| 25 | |
| 26 | /* If the offset to __syscall_error fits into a signed 22-bit |
| 27 | * immediate branch offset, the linker will relax the call into |
| 28 | * a normal branch. |
| 29 | */ |
| 30 | #undef PSEUDO |
| 31 | #undef PSEUDO_END |
| 32 | #undef PSEUDO_NOERRNO |
| 33 | #undef PSEUDO_ERRVAL |
| 34 | |
| 35 | #define PSEUDO(name, syscall_name, args) \ |
| 36 | .text; \ |
| 37 | .globl __syscall_error; \ |
| 38 | ENTRY(name); \ |
| 39 | LOADSYSCALL(syscall_name); \ |
| 40 | ta 0x10; \ |
| 41 | bcc 1f; \ |
| 42 | mov %o7, %g1; \ |
| 43 | call __syscall_error; \ |
| 44 | mov %g1, %o7; \ |
| 45 | 1: |
| 46 | |
| 47 | #define PSEUDO_NOERRNO(name, syscall_name, args)\ |
| 48 | .text; \ |
| 49 | ENTRY(name); \ |
| 50 | LOADSYSCALL(syscall_name); \ |
| 51 | ta 0x10; |
| 52 | |
| 53 | #define PSEUDO_ERRVAL(name, syscall_name, args) \ |
| 54 | .text; \ |
| 55 | ENTRY(name); \ |
| 56 | LOADSYSCALL(syscall_name); \ |
| 57 | ta 0x10; |
| 58 | |
| 59 | #define PSEUDO_END(name) \ |
| 60 | END(name) |
| 61 | |
| 62 | |
| 63 | #endif /* __ASSEMBLER__ */ |
| 64 | |
| 65 | /* Pointer mangling is not yet supported for SPARC. */ |
| 66 | #define PTR_MANGLE(var) (void) (var) |
| 67 | #define PTR_DEMANGLE(var) (void) (var) |
| 68 | |
| 69 | #endif |