arch/sparc/include/uapi/asm/ptrace.h

Source file repositories/reference/linux-study-clean/arch/sparc/include/uapi/asm/ptrace.h

File Facts

System
Linux kernel
Corpus path
arch/sparc/include/uapi/asm/ptrace.h
Extension
.h
Size
8234 bytes
Lines
354
Domain
Architecture Layer
Bucket
arch/sparc
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct pt_regs {
	unsigned long u_regs[16]; /* globals and ins */
	unsigned long tstate;
	unsigned long tpc;
	unsigned long tnpc;
	unsigned int y;

	/* We encode a magic number, PT_REGS_MAGIC, along
	 * with the %tt (trap type) register value at trap
	 * entry time.  The magic number allows us to identify
	 * accurately a trap stack frame in the stack
	 * unwinder, and the %tt value allows us to test
	 * things like "in a system call" etc. for an arbitray
	 * process.
	 *
	 * The PT_REGS_MAGIC is chosen such that it can be
	 * loaded completely using just a sethi instruction.
	 */
	unsigned int magic;
};

struct pt_regs32 {
	unsigned int psr;
	unsigned int pc;
	unsigned int npc;
	unsigned int y;
	unsigned int u_regs[16]; /* globals and ins */
};

/* A V9 register window */
struct reg_window {
	unsigned long locals[8];
	unsigned long ins[8];
};

/* A 32-bit register window. */
struct reg_window32 {
	unsigned int locals[8];
	unsigned int ins[8];
};

/* A V9 Sparc stack frame */
struct sparc_stackf {
	unsigned long locals[8];
        unsigned long ins[6];
	struct sparc_stackf *fp;
	unsigned long callers_pc;
	char *structptr;
	unsigned long xargs[6];
	unsigned long xxargs[1];
};

/* A 32-bit Sparc stack frame */
struct sparc_stackf32 {
	unsigned int locals[8];
        unsigned int ins[6];
	unsigned int fp;
	unsigned int callers_pc;
	unsigned int structptr;
	unsigned int xargs[6];
	unsigned int xxargs[1];
};

struct sparc_trapf {
	unsigned long locals[8];
	unsigned long ins[8];
	unsigned long _unused;
	struct pt_regs *regs;
};
#endif /* (!__ASSEMBLER__) */
#else
/* 32 bit sparc */

#include <asm/psr.h>

/* This struct defines the way the registers are stored on the
 * stack during a system call and basically all traps.
 */
#ifndef __ASSEMBLER__

#include <linux/types.h>

struct pt_regs {
	unsigned long psr;
	unsigned long pc;
	unsigned long npc;
	unsigned long y;
	unsigned long u_regs[16]; /* globals and ins */
};

Annotation

Implementation Notes