~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sparc/include/asm/syscall.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/sparc/include/asm/syscall.h (Architecture sparc) and /arch/i386/include/asm-i386/syscall.h (Architecture i386)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 #ifndef __ASM_SPARC_SYSCALL_H                     
  3 #define __ASM_SPARC_SYSCALL_H                     
  4                                                   
  5 #include <uapi/linux/audit.h>                     
  6 #include <linux/kernel.h>                         
  7 #include <linux/compat.h>                         
  8 #include <linux/sched.h>                          
  9 #include <asm/ptrace.h>                           
 10 #include <asm/thread_info.h>                      
 11                                                   
 12 /*                                                
 13  * The syscall table always contains 32 bit po    
 14  * address of the function to be called is (wa    
 15  * type here is what we want [need] for both 3    
 16  */                                               
 17 extern const unsigned int sys_call_table[];       
 18                                                   
 19 /* The system call number is given by the user    
 20 static inline long syscall_get_nr(struct task_    
 21                                   struct pt_re    
 22 {                                                 
 23         int syscall_p = pt_regs_is_syscall(reg    
 24                                                   
 25         return (syscall_p ? regs->u_regs[UREG_    
 26 }                                                 
 27                                                   
 28 static inline void syscall_rollback(struct tas    
 29                                     struct pt_    
 30 {                                                 
 31         /* XXX This needs some thought.  On Sp    
 32          * XXX save away the original %o0 valu    
 33          * XXX Instead we hold it in register     
 34          * XXX level trap frame and pass this     
 35          * XXX dispatch code which is the only    
 36          * XXX ever was needed.                   
 37          */                                       
 38 }                                                 
 39                                                   
 40 #ifdef CONFIG_SPARC32                             
 41 static inline bool syscall_has_error(struct pt    
 42 {                                                 
 43         return (regs->psr & PSR_C) ? true : fa    
 44 }                                                 
 45 static inline void syscall_set_error(struct pt    
 46 {                                                 
 47         regs->psr |= PSR_C;                       
 48 }                                                 
 49 static inline void syscall_clear_error(struct     
 50 {                                                 
 51         regs->psr &= ~PSR_C;                      
 52 }                                                 
 53 #else                                             
 54 static inline bool syscall_has_error(struct pt    
 55 {                                                 
 56         return (regs->tstate & (TSTATE_XCARRY     
 57 }                                                 
 58 static inline void syscall_set_error(struct pt    
 59 {                                                 
 60         regs->tstate |= (TSTATE_XCARRY | TSTAT    
 61 }                                                 
 62 static inline void syscall_clear_error(struct     
 63 {                                                 
 64         regs->tstate &= ~(TSTATE_XCARRY | TSTA    
 65 }                                                 
 66 #endif                                            
 67                                                   
 68 static inline long syscall_get_error(struct ta    
 69                                      struct pt    
 70 {                                                 
 71         long val = regs->u_regs[UREG_I0];         
 72                                                   
 73         return (syscall_has_error(regs) ? -val    
 74 }                                                 
 75                                                   
 76 static inline long syscall_get_return_value(st    
 77                                             st    
 78 {                                                 
 79         long val = regs->u_regs[UREG_I0];         
 80                                                   
 81         return val;                               
 82 }                                                 
 83                                                   
 84 static inline void syscall_set_return_value(st    
 85                                             st    
 86                                             in    
 87 {                                                 
 88         if (error) {                              
 89                 syscall_set_error(regs);          
 90                 regs->u_regs[UREG_I0] = -error    
 91         } else {                                  
 92                 syscall_clear_error(regs);        
 93                 regs->u_regs[UREG_I0] = val;      
 94         }                                         
 95 }                                                 
 96                                                   
 97 static inline void syscall_get_arguments(struc    
 98                                          struc    
 99                                          unsig    
100 {                                                 
101         int zero_extend = 0;                      
102         unsigned int j;                           
103         unsigned int n = 6;                       
104                                                   
105 #ifdef CONFIG_SPARC64                             
106         if (test_tsk_thread_flag(task, TIF_32B    
107                 zero_extend = 1;                  
108 #endif                                            
109                                                   
110         for (j = 0; j < n; j++) {                 
111                 unsigned long val = regs->u_re    
112                                                   
113                 if (zero_extend)                  
114                         args[j] = (u32) val;      
115                 else                              
116                         args[j] = val;            
117         }                                         
118 }                                                 
119                                                   
120 static inline int syscall_get_arch(struct task    
121 {                                                 
122 #if defined(CONFIG_SPARC64) && defined(CONFIG_    
123         return test_tsk_thread_flag(task, TIF_    
124                 ? AUDIT_ARCH_SPARC : AUDIT_ARC    
125 #elif defined(CONFIG_SPARC64)                     
126         return AUDIT_ARCH_SPARC64;                
127 #else                                             
128         return AUDIT_ARCH_SPARC;                  
129 #endif                                            
130 }                                                 
131                                                   
132 #endif /* __ASM_SPARC_SYSCALL_H */                
133                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php