一. machine_desc结构体

    1.1. 内核提供了一个重要的结构体struct machine_desc ,这个结构体在内核移植中起到相当重要的作用,内核通过machine_desc结构体来控制系统体系架构相关部分的初始化

    2.1. 静态映射表与machine_desc关系。

        2.1.1. kernel/arch/arm/mach-s5pv210/mach-smdkc110.c 这个文件是由三星在移植内核时提供的一个很重要的文件,这个文件中的函数都是与硬件相关的。mach-smdkc110.c文件中的smdkc110_map_io函数就是静态映射表建立过程调用的一个函数开机时调用映射表建立函数:

/*
 * Set of macros to define architecture features.  This is built into
 * a table by the linker.
 */
#define MACHINE_START(_type,_name)            \
static const struct machine_desc __mach_desc_##_type    \
 __used                            \
 __attribute__((__section__(".arch.info.init"))) = {    \
    .nr        = MACH_TYPE_##_type,        \
    .name        = _name,

#define MACHINE_END                \
};

MACHINE_START(SMDKV210, "SMDKV210")
    /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
    .phys_io    = S3C_PA_UART & 0xfff00000,
    .io_pg_offst    = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
    .boot_params    = S5P_PA_SDRAM + 0x100,
    .init_irq    = s5pv210_init_irq,
    .map_io        = smdkv210_map_io,
    .init_machine    = smdkv210_machine_init,
#ifdef CONFIG_S5P_HIGH_RES_TIMERS
    .timer        = &s5p_systimer,
#else
    .timer        = &s3c24xx_timer,
#endif
View Code

相关文章:

  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-12-04
  • 2021-11-05
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-11-13
  • 2021-07-09
相关资源
相似解决方案