/arch/i386/mach-default/setup.c

https://bitbucket.org/evzijst/gittest · C · 106 lines · 37 code · 11 blank · 58 comment · 1 complexity · 5cf0ed075446c442e9f64291f3e490ce MD5 · raw file

  1. /*
  2. * Machine specific setup for generic
  3. */
  4. #include <linux/config.h>
  5. #include <linux/smp.h>
  6. #include <linux/init.h>
  7. #include <linux/irq.h>
  8. #include <linux/interrupt.h>
  9. #include <asm/acpi.h>
  10. #include <asm/arch_hooks.h>
  11. /**
  12. * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
  13. *
  14. * Description:
  15. * Perform any necessary interrupt initialisation prior to setting up
  16. * the "ordinary" interrupt call gates. For legacy reasons, the ISA
  17. * interrupts should be initialised here if the machine emulates a PC
  18. * in any way.
  19. **/
  20. void __init pre_intr_init_hook(void)
  21. {
  22. init_ISA_irqs();
  23. }
  24. /*
  25. * IRQ2 is cascade interrupt to second interrupt controller
  26. */
  27. static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
  28. /**
  29. * intr_init_hook - post gate setup interrupt initialisation
  30. *
  31. * Description:
  32. * Fill in any interrupts that may have been left out by the general
  33. * init_IRQ() routine. interrupts having to do with the machine rather
  34. * than the devices on the I/O bus (like APIC interrupts in intel MP
  35. * systems) are started here.
  36. **/
  37. void __init intr_init_hook(void)
  38. {
  39. #ifdef CONFIG_X86_LOCAL_APIC
  40. apic_intr_init();
  41. #endif
  42. if (!acpi_ioapic)
  43. setup_irq(2, &irq2);
  44. }
  45. /**
  46. * pre_setup_arch_hook - hook called prior to any setup_arch() execution
  47. *
  48. * Description:
  49. * generally used to activate any machine specific identification
  50. * routines that may be needed before setup_arch() runs. On VISWS
  51. * this is used to get the board revision and type.
  52. **/
  53. void __init pre_setup_arch_hook(void)
  54. {
  55. }
  56. /**
  57. * trap_init_hook - initialise system specific traps
  58. *
  59. * Description:
  60. * Called as the final act of trap_init(). Used in VISWS to initialise
  61. * the various board specific APIC traps.
  62. **/
  63. void __init trap_init_hook(void)
  64. {
  65. }
  66. static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
  67. /**
  68. * time_init_hook - do any specific initialisations for the system timer.
  69. *
  70. * Description:
  71. * Must plug the system timer interrupt source at HZ into the IRQ listed
  72. * in irq_vectors.h:TIMER_IRQ
  73. **/
  74. void __init time_init_hook(void)
  75. {
  76. setup_irq(0, &irq0);
  77. }
  78. #ifdef CONFIG_MCA
  79. /**
  80. * mca_nmi_hook - hook into MCA specific NMI chain
  81. *
  82. * Description:
  83. * The MCA (Microchannel Arcitecture) has an NMI chain for NMI sources
  84. * along the MCA bus. Use this to hook into that chain if you will need
  85. * it.
  86. **/
  87. void __init mca_nmi_hook(void)
  88. {
  89. /* If I recall correctly, there's a whole bunch of other things that
  90. * we can do to check for NMI problems, but that's all I know about
  91. * at the moment.
  92. */
  93. printk("NMI generated from unknown source!\n");
  94. }
  95. #endif