一、数据结构
- struct processor 处理器硬件操作函数结构
extern struct processor { /* MISC * get data abort address/flags */ void (*_data_abort)(unsigned long pc); /* * Retrieve prefetch fault address */ unsigned long (*_prefetch_abort)(unsigned long lr); /* * Set up any processor specifics */ void (*_proc_init)(void);//处理器初始化函数指针 /* * Disable any processor specifics,禁止处理器某些函数指针 */ void (*_proc_fin)(void); /* * Special stuff for a reset,软件复位操作函数指针 */ void (*reset)(unsigned long addr) __attribute__((noreturn)); /* * Idle the processor,使处理器进入空闲节能状态,等待激活状态 */ int (*_do_idle)(void); /* * Processor architecture specific */ /* * clean a virtual address range from the * D-cache without flushing the cache.,清空指定虚拟地址处的数据cache块,但不刷新 */ void (*dcache_clean_area)(void *addr, int size);
/* * Set the page table,在pgd_phys地址上重建页表,用于任务切换时保存重装旧线程状态*/
void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm); /* * Set a possibly extended PTE. Non-extended PTEs should * ignore 'ext'. */ void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext); } processor
|
2. struct proc_info_list处理器信息列表结构,对于每种具体的arm处理器的信息,可以通过查表,知道处理器型号,ID号,屏蔽字,MMU标志字,体系架构名,cpu名字。
struct proc_info_list { unsigned int cpu_val;处理器架构的ID unsigned int cpu_mask;处理器架构ID号对应屏蔽字 unsigned long __cpu_mm_mmu_flags; /* used by head.S,是内存管理单元的第一级描述符控制字段,预先设定为分段方式管理内存*/ unsigned long __cpu_io_mmu_flags; /* used by head.S */ unsigned long __cpu_flush; /* used by head.S ,这里存放这个跳转到具体架构设置函数的指令*/ const char *arch_name;/*体系架构名字字段*/ const char *elf_name; unsigned int elf_hwcap; const char *cpu_name; struct processor *proc; struct cpu_tlb_fns *tlb; struct cpu_user_fns *user; struct cpu_cache_fns *cache; }
|
阅读(1044) | 评论(0) | 转发(1) |