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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/cell/spu_callbacks.c

Version: ~ [ linux-4.18 ] ~ [ linux-4.17.14 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.62 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.119 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.147 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.118 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.57 ] ~ [ 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-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.27.62 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~ [ linux-next-20180810 ] ~ [ linux-next-20180813 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * System call callback functions for SPUs
  3  */
  4 
  5 #undef DEBUG
  6 
  7 #include <linux/kallsyms.h>
  8 #include <linux/export.h>
  9 #include <linux/syscalls.h>
 10 
 11 #include <asm/spu.h>
 12 #include <asm/syscalls.h>
 13 #include <asm/unistd.h>
 14 
 15 /*
 16  * This table defines the system calls that an SPU can call.
 17  * It is currently a subset of the 64 bit powerpc system calls,
 18  * with the exact semantics.
 19  *
 20  * The reasons for disabling some of the system calls are:
 21  * 1. They interact with the way SPU syscalls are handled
 22  *    and we can't let them execute ever:
 23  *      restart_syscall, exit, for, execve, ptrace, ...
 24  * 2. They are deprecated and replaced by other means:
 25  *      uselib, pciconfig_*, sysfs, ...
 26  * 3. They are somewhat interacting with the system in a way
 27  *    we don't want an SPU to:
 28  *      reboot, init_module, mount, kexec_load
 29  * 4. They are optional and we can't rely on them being
 30  *    linked into the kernel. Unfortunately, the cond_syscall
 31  *    helper does not work here as it does not add the necessary
 32  *    opd symbols:
 33  *      mbind, mq_open, ipc, ...
 34  */
 35 
 36 static void *spu_syscall_table[] = {
 37 #define SYSCALL(func)           sys_ni_syscall,
 38 #define COMPAT_SYS(func)        sys_ni_syscall,
 39 #define PPC_SYS(func)           sys_ni_syscall,
 40 #define OLDSYS(func)            sys_ni_syscall,
 41 #define SYS32ONLY(func)         sys_ni_syscall,
 42 #define PPC64ONLY(func)         sys_ni_syscall,
 43 #define SYSX(f, f3264, f32)     sys_ni_syscall,
 44 
 45 #define SYSCALL_SPU(func)       sys_##func,
 46 #define COMPAT_SYS_SPU(func)    sys_##func,
 47 #define COMPAT_SPU_NEW(func)    sys_##func,
 48 #define SYSX_SPU(f, f3264, f32) f,
 49 
 50 #include <asm/systbl.h>
 51 };
 52 
 53 long spu_sys_callback(struct spu_syscall_block *s)
 54 {
 55         long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
 56 
 57         if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
 58                 pr_debug("%s: invalid syscall #%lld", __func__, s->nr_ret);
 59                 return -ENOSYS;
 60         }
 61 
 62         syscall = spu_syscall_table[s->nr_ret];
 63 
 64         pr_debug("SPU-syscall "
 65                  "%pSR:syscall%lld(%llx, %llx, %llx, %llx, %llx, %llx)\n",
 66                  syscall,
 67                  s->nr_ret,
 68                  s->parm[0], s->parm[1], s->parm[2],
 69                  s->parm[3], s->parm[4], s->parm[5]);
 70 
 71         return syscall(s->parm[0], s->parm[1], s->parm[2],
 72                        s->parm[3], s->parm[4], s->parm[5]);
 73 }
 74 EXPORT_SYMBOL_GPL(spu_sys_callback);
 75 

~ [ 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