arch/x86/include/asm/ptrace.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/ptrace.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/ptrace.h- Extension
.h- Size
- 12313 bytes
- Lines
- 474
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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/segment.hasm/page_types.huapi/asm/ptrace.hasm/paravirt-base.hasm/proto.h
Detected Declarations
struct pt_regsstruct fred_csstruct fred_ssstruct pt_regsstruct cpuinfo_x86struct task_structstruct user_descfunction regs_return_valuefunction regs_set_return_valuefunction user_modefunction v8086_modefunction user_64bit_modefunction any_64bit_modefunction ip_within_syscall_gapfunction kernel_stack_pointerfunction instruction_pointerfunction instruction_pointer_setfunction frame_pointerfunction user_stack_pointerfunction user_stack_pointer_setfunction regs_irqs_disabledfunction regs_get_registerfunction regs_within_kernel_stackfunction regs_get_kernel_stack_nth_addrfunction regs_get_kernel_stack_nthfunction regs_get_kernel_argument
Annotated Snippet
struct pt_regs {
/*
* NB: 32-bit x86 CPUs are inconsistent as what happens in the
* following cases (where %seg represents a segment register):
*
* - pushl %seg: some do a 16-bit write and leave the high
* bits alone
* - movl %seg, [mem]: some do a 16-bit write despite the movl
* - IDT entry: some (e.g. 486) will leave the high bits of CS
* and (if applicable) SS undefined.
*
* Fortunately, x86-32 doesn't read the high bits on POP or IRET,
* so we can just treat all of the segment registers as 16-bit
* values.
*/
unsigned long bx;
unsigned long cx;
unsigned long dx;
unsigned long si;
unsigned long di;
unsigned long bp;
unsigned long ax;
unsigned short ds;
unsigned short __dsh;
unsigned short es;
unsigned short __esh;
unsigned short fs;
unsigned short __fsh;
/*
* On interrupt, gs and __gsh store the vector number. They never
* store gs any more.
*/
unsigned short gs;
unsigned short __gsh;
/* On interrupt, this is the error code. */
unsigned long orig_ax;
unsigned long ip;
unsigned short cs;
unsigned short __csh;
unsigned long flags;
unsigned long sp;
unsigned short ss;
unsigned short __ssh;
};
#else /* __i386__ */
struct fred_cs {
/* CS selector */
u64 cs : 16,
/* Stack level at event time */
sl : 2,
/* IBT in WAIT_FOR_ENDBRANCH state */
wfe : 1,
: 45;
};
struct fred_ss {
/* SS selector */
u64 ss : 16,
/* STI state */
sti : 1,
/* Set if syscall, sysenter or INT n */
swevent : 1,
/* Event is NMI type */
nmi : 1,
: 13,
/* Event vector */
vector : 8,
: 8,
/* Event type */
type : 4,
: 4,
/* Event was incident to enclave execution */
enclave : 1,
/* CPU was in 64-bit mode */
l : 1,
/*
* Nested exception during FRED delivery, not set
* for #DF.
*/
nested : 1,
: 1,
/*
* The length of the instruction causing the event.
* Only set for INTO, INT1, INT3, INT n, SYSCALL
* and SYSENTER. 0 otherwise.
*/
insnlen : 4;
};
Annotation
- Immediate include surface: `asm/segment.h`, `asm/page_types.h`, `uapi/asm/ptrace.h`, `asm/paravirt-base.h`, `asm/proto.h`.
- Detected declarations: `struct pt_regs`, `struct fred_cs`, `struct fred_ss`, `struct pt_regs`, `struct cpuinfo_x86`, `struct task_struct`, `struct user_desc`, `function regs_return_value`, `function regs_set_return_value`, `function user_mode`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.