Linux Kernel Architecture

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

Appendix A: Architecture Specifics


The thread data strucure holds not only debug (dbrandibr) and floating-point registers (fph), but,
additionally, kernel also stores information required for IA-32 emulation if this option is available in the
kernel configuration, as shown here:

include/asm-ia64/processor.h
struct thread_struct {
u32 flags; / various thread flags (see IA64THREAD) /
/
writing on_ustack is performance-critical, so it’s worth spending 8 bits on it... /
__u8 on_ustack; /
executing on user-stacks? */
u8 pad[3];
u64 ksp; / kernel stack pointer /
u64 map_base; / base address for get_unmapped_area() /
__u64 task_size; / limit for task size /
__u64 rbs_bot; / the base address for the RBS /
int last_fph_cpu; / CPU that may hold the contents of f32-f127 /


#ifdef CONFIG_IA32_SUPPORT
u64 eflag; / IA32 EFLAGS reg /
u64 fsr; / IA32 floating pt status reg /
u64 fcr; / IA32 floating pt control reg /
u64 fir; / IA32 fp except. instr. reg /
u64 fdr; / IA32 fp except. data reg /
u64 old_k1; / old value of ar.k1 /
u64 old_iob; / old IOBase value /
struct partial_page_list ppl; / partial page list for 4K page size issue /
/
cached TLS descriptors. /
struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
#endif /
CONFIG_IA32_SUPPORT */
#ifdef CONFIG_PERFMON
__u64 pmcs[IA64_NUM_PMC_REGS];
u64 pmds[IA64_NUM_PMD_REGS];
void pfm_context; / pointer to detailed PMU context /
unsigned long pfm_needs_checking; /
when >0, pending perfmon work on kernel exit /
#endif
__u64 dbr[IA64_NUM_DBG_REGS];
__u64 ibr[IA64_NUM_DBG_REGS];
struct ia64_fpreg fph[96]; /
saved/loaded on demand */
};


IA-64 also features aperformance monitoringsubsystem. Additional registers must be saved if the kernel
is configured to interoperate with this subsystem.

A.7.3 ARM


ARM systems come in two versions because the processor is designed with 26-bit and 32-bit word
lengths. Because all of the more recent systems operate with 32 bits, only the corresponding definitions
for this machine type are included in this appendix.

The following definition of thept_regsstructure consists simply of an array to hold the values of all
registers manipulated in kernel mode:

include/asm-arm/ptrace.h
struct pt_regs {
long uregs[18];
};
Free download pdf