Linux Kernel Architecture

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

Appendix A: Architecture Specifics


The symbolic names of the registers and their positions within the array are defined by means of pre-
processor constants:


include/asm-arm/ptrace.h
#define ARM_cpsr uregs[16]
#define ARM_pc uregs[15]
#define ARM_lr uregs[14]
#define ARM_sp uregs[13]
#define ARM_ip uregs[12]
#define ARM_fp uregs[11]
#define ARM_r10 uregs[10]
#define ARM_r9 uregs[9]
#define ARM_r8 uregs[8]
#define ARM_r7 uregs[7]
#define ARM_r6 uregs[6]
#define ARM_r5 uregs[5]
#define ARM_r4 uregs[4]
#define ARM_r3 uregs[3]
#define ARM_r2 uregs[2]
#define ARM_r1 uregs[1]
#define ARM_r0 uregs[0]
#define ARM_ORIG_r0 uregs[17]

It is not necessary to save any floating-point registers because ARM processors provide only software
support for floating-point operations:


include/asm-arm/processor.h
struct thread_struct {
/* fault info */
unsigned long address;
unsigned long trap_no;
unsigned long error_code;
/* debugging */
struct debug_info debug;
};

However, machine instructions (in the form of their opcode) can be saved together with a memory
address for debugging purposes, as shown here:


include/asm-arm/processor.h
union debug_insn {
u32 arm;
u16 thumb;
};

struct debug_entry {
u32 address;
union debug_insn insn;
};

struct debug_info {
int nsaved;
struct debug_entry bp[2];
};
Free download pdf