Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer runapp01.tex V1 - 09/04/2008 6:08pm Page 1130

Appendix A: Architecture Specifics


system calls. The C or assembler code of the kernel need not save all registers listed inpt_regsbecause
some of them are automatically placed on the stack by PAL code routines. Those that need be are the
following:

include/asm-alpha/ptrace.h
struct pt_regs {
unsigned long r0;
unsigned long r1;
unsigned long r2;
unsigned long r3;
unsigned long r4;
unsigned long r5;
unsigned long r6;
unsigned long r7;
unsigned long r8;
unsigned long r19;
unsigned long r20;
unsigned long r21;
unsigned long r22;
unsigned long r23;
unsigned long r24;
unsigned long r25;
unsigned long r26;
unsigned long r27;
unsigned long r28;
unsigned long hae;
/* JRP - These are the values provided to a0-a2 by PALcode */
unsigned long trap_a0;
unsigned long trap_a1;
unsigned long trap_a2;
/* These are saved by PAL-code: */
unsigned long ps;
unsigned long pc;
unsigned long gp;
unsigned long r16;
unsigned long r17;
unsigned long r18;
};

This architecture likewise makes use of an emptythread_structstructure:

include/asm-alpha/processor.h
/* This is dead. Everything has been moved to thread_info. */
struct thread_struct { };

The contents of floating-point registersf0tof31are not held inthread_info, but instead are held on
the stack using the following structure (a few integer registers are saved as well as the floating-point
registers; normally, the former are not needed by the kernel):

include/asm-alpha/ptrace.h
struct switch_stack {
unsigned long r9;
unsigned long r10;
unsigned long r11;
Free download pdf