arch/powerpc/platforms/cell/spu_syscalls.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/cell/spu_syscalls.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/cell/spu_syscalls.c- Extension
.c- Size
- 2932 bytes
- Lines
- 142
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: syscall or user/kernel boundary
- Status
- core implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/file.hlinux/fs.hlinux/module.hlinux/syscalls.hlinux/rcupdate.hlinux/binfmts.hasm/spu.h
Detected Declarations
syscall spu_createsyscall spu_runfunction spufs_calls_putfunction spufs_calls_putfunction elf_coredump_extra_notes_sizefunction elf_coredump_extra_notes_writefunction notify_spus_activefunction register_spu_syscallsfunction unregister_spu_syscallsexport register_spu_syscallsexport unregister_spu_syscalls
Annotated Snippet
SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
umode_t, mode, int, neighbor_fd)
{
CLASS(spufs_calls, calls)();
if (!calls)
return -ENOSYS;
if (flags & SPU_CREATE_AFFINITY_SPU) {
CLASS(fd, neighbor)(neighbor_fd);
if (fd_empty(neighbor))
return -EBADF;
return calls->create_thread(name, flags, mode, fd_file(neighbor));
} else {
return calls->create_thread(name, flags, mode, NULL);
}
}
SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, __u32 __user *, ustatus)
{
CLASS(spufs_calls, calls)();
if (!calls)
return -ENOSYS;
CLASS(fd, arg)(fd);
if (fd_empty(arg))
return -EBADF;
return calls->spu_run(fd_file(arg), unpc, ustatus);
}
#ifdef CONFIG_COREDUMP
int elf_coredump_extra_notes_size(void)
{
CLASS(spufs_calls, calls)();
if (!calls)
return 0;
return calls->coredump_extra_notes_size();
}
int elf_coredump_extra_notes_write(struct coredump_params *cprm)
{
CLASS(spufs_calls, calls)();
if (!calls)
return 0;
return calls->coredump_extra_notes_write(cprm);
}
#endif
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 register_spu_syscalls(struct spufs_calls *calls)
{
if (spufs_calls)
return -EBUSY;
rcu_assign_pointer(spufs_calls, calls);
return 0;
}
EXPORT_SYMBOL_GPL(register_spu_syscalls);
void unregister_spu_syscalls(struct spufs_calls *calls)
{
BUG_ON(spufs_calls->owner != calls->owner);
RCU_INIT_POINTER(spufs_calls, NULL);
synchronize_rcu();
}
EXPORT_SYMBOL_GPL(unregister_spu_syscalls);
Annotation
- Immediate include surface: `linux/file.h`, `linux/fs.h`, `linux/module.h`, `linux/syscalls.h`, `linux/rcupdate.h`, `linux/binfmts.h`, `asm/spu.h`.
- Detected declarations: `syscall spu_create`, `syscall spu_run`, `function spufs_calls_put`, `function spufs_calls_put`, `function elf_coredump_extra_notes_size`, `function elf_coredump_extra_notes_write`, `function notify_spus_active`, `function register_spu_syscalls`, `function unregister_spu_syscalls`, `export register_spu_syscalls`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: core implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.