arch/openrisc/include/asm/ptrace.h
Source file repositories/reference/linux-study-clean/arch/openrisc/include/asm/ptrace.h
File Facts
- System
- Linux kernel
- Corpus path
arch/openrisc/include/asm/ptrace.h- Extension
.h- Size
- 4852 bytes
- Lines
- 191
- Domain
- Architecture Layer
- Bucket
- arch/openrisc
- 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
asm/spr_defs.huapi/asm/ptrace.hlinux/compiler.h
Detected Declarations
struct pt_regsfunction instruction_pointerfunction instruction_pointer_setfunction kernel_stack_pointerfunction regs_return_valuefunction regs_get_register
Annotated Snippet
struct pt_regs {
union {
struct {
/* Named registers */
long sr; /* Stored in place of r0 */
long sp; /* r1 */
long gpr2;
long gpr3;
long gpr4;
long gpr5;
long gpr6;
long gpr7;
long gpr8;
long gpr9;
long gpr10;
long gpr11;
long gpr12;
long gpr13;
long gpr14;
long gpr15;
long gpr16;
long gpr17;
long gpr18;
long gpr19;
long gpr20;
long gpr21;
long gpr22;
long gpr23;
long gpr24;
long gpr25;
long gpr26;
long gpr27;
long gpr28;
long gpr29;
long gpr30;
long gpr31;
};
struct {
/* Old style */
long offset[2];
long gprs[30];
};
struct {
/* New style */
long gpr[32];
};
};
long pc;
/* For restarting system calls:
* Set to syscall number for syscall exceptions,
* -1 for all other exceptions.
*/
long orig_gpr11; /* For restarting system calls */
long dummy; /* Cheap alignment fix */
long dummy2; /* Cheap alignment fix */
};
/* TODO: Rename this to REDZONE because that's what it is */
#define STACK_FRAME_OVERHEAD 128 /* size of minimum stack frame */
#define MAX_REG_OFFSET offsetof(struct pt_regs, orig_gpr11)
/* Helpers for working with the instruction pointer */
static inline unsigned long instruction_pointer(struct pt_regs *regs)
{
return (unsigned long)regs->pc;
}
static inline void instruction_pointer_set(struct pt_regs *regs,
unsigned long val)
{
regs->pc = val;
}
#define user_mode(regs) (((regs)->sr & SPR_SR_SM) == 0)
#define user_stack_pointer(regs) ((unsigned long)(regs)->sp)
#define profile_pc(regs) instruction_pointer(regs)
/* Valid only for Kernel mode traps. */
static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
{
return (unsigned long)regs->sp;
}
static inline long regs_return_value(struct pt_regs *regs)
{
return regs->gpr[11];
}
extern int regs_query_register_offset(const char *name);
extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
Annotation
- Immediate include surface: `asm/spr_defs.h`, `uapi/asm/ptrace.h`, `linux/compiler.h`.
- Detected declarations: `struct pt_regs`, `function instruction_pointer`, `function instruction_pointer_set`, `function kernel_stack_pointer`, `function regs_return_value`, `function regs_get_register`.
- Atlas domain: Architecture Layer / arch/openrisc.
- 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.