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

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

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2011 Texas Instruments Incorporated
  3  * Author: Mark Salter <msalter@redhat.com>
  4  *
  5  * This program is free software; you can redistribute it and/or modify
  6  * it under the terms of the GNU General Public License as published by
  7  * the Free Software Foundation; either version 2 of the License, or
  8  * (at your option) any later version.
  9  */
 10 
 11 #ifndef __ASM_C6X_SYSCALL_H
 12 #define __ASM_C6X_SYSCALL_H
 13 
 14 #include <linux/err.h>
 15 #include <linux/sched.h>
 16 
 17 static inline int syscall_get_nr(struct task_struct *task,
 18                                  struct pt_regs *regs)
 19 {
 20         return regs->b0;
 21 }
 22 
 23 static inline void syscall_rollback(struct task_struct *task,
 24                                     struct pt_regs *regs)
 25 {
 26         /* do nothing */
 27 }
 28 
 29 static inline long syscall_get_error(struct task_struct *task,
 30                                      struct pt_regs *regs)
 31 {
 32         return IS_ERR_VALUE(regs->a4) ? regs->a4 : 0;
 33 }
 34 
 35 static inline long syscall_get_return_value(struct task_struct *task,
 36                                             struct pt_regs *regs)
 37 {
 38         return regs->a4;
 39 }
 40 
 41 static inline void syscall_set_return_value(struct task_struct *task,
 42                                             struct pt_regs *regs,
 43                                             int error, long val)
 44 {
 45         regs->a4 = error ?: val;
 46 }
 47 
 48 static inline void syscall_get_arguments(struct task_struct *task,
 49                                          struct pt_regs *regs, unsigned int i,
 50                                          unsigned int n, unsigned long *args)
 51 {
 52         switch (i) {
 53         case 0:
 54                 if (!n--)
 55                         break;
 56                 *args++ = regs->a4;
 57         case 1:
 58                 if (!n--)
 59                         break;
 60                 *args++ = regs->b4;
 61         case 2:
 62                 if (!n--)
 63                         break;
 64                 *args++ = regs->a6;
 65         case 3:
 66                 if (!n--)
 67                         break;
 68                 *args++ = regs->b6;
 69         case 4:
 70                 if (!n--)
 71                         break;
 72                 *args++ = regs->a8;
 73         case 5:
 74                 if (!n--)
 75                         break;
 76                 *args++ = regs->b8;
 77         case 6:
 78                 if (!n--)
 79                         break;
 80         default:
 81                 BUG();
 82         }
 83 }
 84 
 85 static inline void syscall_set_arguments(struct task_struct *task,
 86                                          struct pt_regs *regs,
 87                                          unsigned int i, unsigned int n,
 88                                          const unsigned long *args)
 89 {
 90         switch (i) {
 91         case 0:
 92                 if (!n--)
 93                         break;
 94                 regs->a4 = *args++;
 95         case 1:
 96                 if (!n--)
 97                         break;
 98                 regs->b4 = *args++;
 99         case 2:
100                 if (!n--)
101                         break;
102                 regs->a6 = *args++;
103         case 3:
104                 if (!n--)
105                         break;
106                 regs->b6 = *args++;
107         case 4:
108                 if (!n--)
109                         break;
110                 regs->a8 = *args++;
111         case 5:
112                 if (!n--)
113                         break;
114                 regs->a9 = *args++;
115         case 6:
116                 if (!n)
117                         break;
118         default:
119                 BUG();
120         }
121 }
122 
123 #endif /* __ASM_C6X_SYSCALLS_H */
124 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp