x86_init.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #ifndef _ASM_X86_PLATFORM_H
  2. #define _ASM_X86_PLATFORM_H
  3. #include <asm/pgtable_types.h>
  4. #include <asm/bootparam.h>
  5. struct mpc_bus;
  6. struct mpc_cpu;
  7. struct mpc_table;
  8. /**
  9. * struct x86_init_mpparse - platform specific mpparse ops
  10. * @mpc_record: platform specific mpc record accounting
  11. * @setup_ioapic_ids: platform specific ioapic id override
  12. * @mpc_apic_id: platform specific mpc apic id assignment
  13. * @smp_read_mpc_oem: platform specific oem mpc table setup
  14. * @mpc_oem_pci_bus: platform specific pci bus setup (default NULL)
  15. * @mpc_oem_bus_info: platform specific mpc bus info
  16. * @find_smp_config: find the smp configuration
  17. * @get_smp_config: get the smp configuration
  18. */
  19. struct x86_init_mpparse {
  20. void (*mpc_record)(unsigned int mode);
  21. void (*setup_ioapic_ids)(void);
  22. int (*mpc_apic_id)(struct mpc_cpu *m);
  23. void (*smp_read_mpc_oem)(struct mpc_table *mpc);
  24. void (*mpc_oem_pci_bus)(struct mpc_bus *m);
  25. void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
  26. void (*find_smp_config)(unsigned int reserve);
  27. void (*get_smp_config)(unsigned int early);
  28. };
  29. /**
  30. * struct x86_init_resources - platform specific resource related ops
  31. * @probe_roms: probe BIOS roms
  32. * @reserve_resources: reserve the standard resources for the
  33. * platform
  34. * @memory_setup: platform specific memory setup
  35. *
  36. */
  37. struct x86_init_resources {
  38. void (*probe_roms)(void);
  39. void (*reserve_resources)(void);
  40. char *(*memory_setup)(void);
  41. };
  42. /**
  43. * struct x86_init_irqs - platform specific interrupt setup
  44. * @pre_vector_init: init code to run before interrupt vectors
  45. * are set up.
  46. * @intr_init: interrupt init code
  47. * @trap_init: platform specific trap setup
  48. */
  49. struct x86_init_irqs {
  50. void (*pre_vector_init)(void);
  51. void (*intr_init)(void);
  52. void (*trap_init)(void);
  53. };
  54. /**
  55. * struct x86_init_oem - oem platform specific customizing functions
  56. * @arch_setup: platform specific architecure setup
  57. * @banner: print a platform specific banner
  58. */
  59. struct x86_init_oem {
  60. void (*arch_setup)(void);
  61. void (*banner)(void);
  62. };
  63. /**
  64. * struct x86_init_paging - platform specific paging functions
  65. * @pagetable_setup_start: platform specific pre paging_init() call
  66. * @pagetable_setup_done: platform specific post paging_init() call
  67. */
  68. struct x86_init_paging {
  69. void (*pagetable_setup_start)(pgd_t *base);
  70. void (*pagetable_setup_done)(pgd_t *base);
  71. };
  72. /**
  73. * struct x86_init_timers - platform specific timer setup
  74. * @setup_perpcu_clockev: set up the per cpu clock event device for the
  75. * boot cpu
  76. * @tsc_pre_init: platform function called before TSC init
  77. * @timer_init: initialize the platform timer (default PIT/HPET)
  78. */
  79. struct x86_init_timers {
  80. void (*setup_percpu_clockev)(void);
  81. void (*tsc_pre_init)(void);
  82. void (*timer_init)(void);
  83. };
  84. /**
  85. * struct x86_init_ops - functions for platform specific setup
  86. *
  87. */
  88. struct x86_init_ops {
  89. struct x86_init_resources resources;
  90. struct x86_init_mpparse mpparse;
  91. struct x86_init_irqs irqs;
  92. struct x86_init_oem oem;
  93. struct x86_init_paging paging;
  94. struct x86_init_timers timers;
  95. };
  96. /**
  97. * struct x86_cpuinit_ops - platform specific cpu hotplug setups
  98. * @setup_percpu_clockev: set up the per cpu clock event device
  99. */
  100. struct x86_cpuinit_ops {
  101. void (*setup_percpu_clockev)(void);
  102. };
  103. /**
  104. * struct x86_platform_ops - platform specific runtime functions
  105. * @calibrate_tsc: calibrate TSC
  106. * @get_wallclock: get time from HW clock like RTC etc.
  107. * @set_wallclock: set time back to HW clock
  108. */
  109. struct x86_platform_ops {
  110. unsigned long (*calibrate_tsc)(void);
  111. unsigned long (*get_wallclock)(void);
  112. int (*set_wallclock)(unsigned long nowtime);
  113. };
  114. extern struct x86_init_ops x86_init;
  115. extern struct x86_cpuinit_ops x86_cpuinit;
  116. extern struct x86_platform_ops x86_platform;
  117. extern void x86_init_noop(void);
  118. extern void x86_init_uint_noop(unsigned int unused);
  119. #endif