asmlinkage long sys_spu_create(const char __user *name, unsigned int flags, mode_t mode, int neighbor_fd) { long ret; struct file *neighbor; int fput_needed; struct spufs_calls *calls; calls = spufs_calls_get(); if (!calls) return -ENOSYS; if (flags & SPU_CREATE_AFFINITY_SPU) { ret = -EBADF; neighbor = fget_light(neighbor_fd, &fput_needed); if (neighbor) { ret = calls->create_thread(name, flags, mode, neighbor); fput_light(neighbor, fput_needed); } } else ret = calls->create_thread(name, flags, mode, NULL); spufs_calls_put(calls); return ret; }
void notify_spus_active(void) { struct spufs_calls *calls; calls = spufs_calls_get(); if (!calls) return; calls->notify_spus_active(); spufs_calls_put(calls); return; }
int elf_coredump_extra_notes_write(struct coredump_params *cprm) { struct spufs_calls *calls; int ret; calls = spufs_calls_get(); if (!calls) return 0; ret = calls->coredump_extra_notes_write(cprm); spufs_calls_put(calls); return ret; }
int elf_coredump_extra_notes_size(void) { struct spufs_calls *calls; int ret; calls = spufs_calls_get(); if (!calls) return 0; ret = calls->coredump_extra_notes_size(); spufs_calls_put(calls); return ret; }
int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset) { struct spufs_calls *calls; int ret; calls = spufs_calls_get(); if (!calls) return 0; ret = calls->coredump_extra_notes_write(file, foffset); spufs_calls_put(calls); return ret; }
asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) { long ret; struct fd arg; struct spufs_calls *calls; calls = spufs_calls_get(); if (!calls) return -ENOSYS; ret = -EBADF; arg = fdget(fd); if (arg.file) { ret = calls->spu_run(arg.file, unpc, ustatus); fdput(arg); } spufs_calls_put(calls); return ret; }
asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) { long ret; struct file *filp; int fput_needed; struct spufs_calls *calls; calls = spufs_calls_get(); if (!calls) return -ENOSYS; ret = -EBADF; filp = fget_light(fd, &fput_needed); if (filp) { ret = calls->spu_run(filp, unpc, ustatus); fput_light(filp, fput_needed); } spufs_calls_put(calls); return ret; }
SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags, umode_t, mode, int, neighbor_fd) { long ret; struct spufs_calls *calls; calls = spufs_calls_get(); if (!calls) return -ENOSYS; if (flags & SPU_CREATE_AFFINITY_SPU) { struct fd neighbor = fdget(neighbor_fd); ret = -EBADF; if (neighbor.file) { ret = calls->create_thread(name, flags, mode, neighbor.file); fdput(neighbor); } } else ret = calls->create_thread(name, flags, mode, NULL); spufs_calls_put(calls); return ret; }