arch/powerpc/platforms/cell/spufs/coredump.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/cell/spufs/coredump.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/cell/spufs/coredump.c- Extension
.c- Size
- 3822 bytes
- Lines
- 184
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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 uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/elf.hlinux/file.hlinux/fdtable.hlinux/fs.hlinux/gfp.hlinux/list.hlinux/syscalls.hlinux/coredump.hlinux/binfmts.hlinux/uaccess.hspufs.h
Detected Declarations
function spufs_ctx_note_sizefunction match_contextfunction spufs_coredump_extra_notes_sizefunction spufs_arch_write_notefunction spufs_coredump_extra_notes_write
Annotated Snippet
if (rc) {
put_spu_context(ctx);
break;
}
rc = spufs_ctx_note_size(ctx, fd);
spu_release_saved(ctx);
if (rc < 0) {
put_spu_context(ctx);
break;
}
size += rc;
/* start searching the next fd next time */
fd++;
put_spu_context(ctx);
}
return size;
}
static int spufs_arch_write_note(struct spu_context *ctx, int i,
struct coredump_params *cprm, int dfd)
{
size_t sz = spufs_coredump_read[i].size;
char fullname[80];
struct elf_note en;
int ret;
sprintf(fullname, "SPU/%d/%s", dfd, spufs_coredump_read[i].name);
en.n_namesz = strlen(fullname) + 1;
en.n_descsz = sz;
en.n_type = NT_SPU;
if (!dump_emit(cprm, &en, sizeof(en)))
return -EIO;
if (!dump_emit(cprm, fullname, en.n_namesz))
return -EIO;
if (!dump_align(cprm, 4))
return -EIO;
if (spufs_coredump_read[i].dump) {
ret = spufs_coredump_read[i].dump(ctx, cprm);
if (ret < 0)
return ret;
} else {
char buf[32];
ret = snprintf(buf, sizeof(buf), "0x%.16llx",
spufs_coredump_read[i].get(ctx));
if (ret >= sizeof(buf))
return sizeof(buf);
/* count trailing the NULL: */
if (!dump_emit(cprm, buf, ret + 1))
return -EIO;
}
dump_skip_to(cprm, roundup(cprm->pos - ret + sz, 4));
return 0;
}
int spufs_coredump_extra_notes_write(struct coredump_params *cprm)
{
struct spu_context *ctx;
int fd, j, rc;
fd = 0;
while ((ctx = coredump_next_context(&fd)) != NULL) {
rc = spu_acquire_saved(ctx);
if (rc)
return rc;
for (j = 0; spufs_coredump_read[j].name != NULL; j++) {
rc = spufs_arch_write_note(ctx, j, cprm, fd);
if (rc) {
spu_release_saved(ctx);
return rc;
}
}
spu_release_saved(ctx);
/* start searching the next fd next time */
fd++;
}
return 0;
}
Annotation
- Immediate include surface: `linux/elf.h`, `linux/file.h`, `linux/fdtable.h`, `linux/fs.h`, `linux/gfp.h`, `linux/list.h`, `linux/syscalls.h`, `linux/coredump.h`.
- Detected declarations: `function spufs_ctx_note_size`, `function match_context`, `function spufs_coredump_extra_notes_size`, `function spufs_arch_write_note`, `function spufs_coredump_extra_notes_write`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
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.