1
2
3
4
5#include <linux/smp.h>
6#include <linux/init.h>
7#include <linux/interrupt.h>
8#include <asm/acpi.h>
9#include <asm/arch_hooks.h>
10#include <asm/e820.h>
11#include <asm/setup.h>
12
13#ifdef CONFIG_HOTPLUG_CPU
14#define DEFAULT_SEND_IPI (1)
15#else
16#define DEFAULT_SEND_IPI (0)
17#endif
18
19int no_broadcast=DEFAULT_SEND_IPI;
20
21
22
23
24
25
26
27
28
29
30void __init pre_intr_init_hook(void)
31{
32 init_ISA_irqs();
33}
34
35
36
37
38static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
39
40
41
42
43
44
45
46
47
48
49void __init intr_init_hook(void)
50{
51#ifdef CONFIG_X86_LOCAL_APIC
52 apic_intr_init();
53#endif
54
55 if (!acpi_ioapic)
56 setup_irq(2, &irq2);
57}
58
59
60
61
62
63
64
65
66
67void __init pre_setup_arch_hook(void)
68{
69}
70
71
72
73
74
75
76
77
78void __init trap_init_hook(void)
79{
80}
81
82static struct irqaction irq0 = {
83 .handler = timer_interrupt,
84 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
85 .mask = CPU_MASK_NONE,
86 .name = "timer"
87};
88
89
90
91
92
93
94
95
96void __init time_init_hook(void)
97{
98 irq0.mask = cpumask_of_cpu(0);
99 setup_irq(0, &irq0);
100}
101
102#ifdef CONFIG_MCA
103
104
105
106
107
108
109
110
111void mca_nmi_hook(void)
112{
113
114
115
116
117
118 printk("NMI generated from unknown source!\n");
119}
120#endif
121
122static __init int no_ipi_broadcast(char *str)
123{
124 get_option(&str, &no_broadcast);
125 printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
126 "IPI Broadcast");
127 return 1;
128}
129
130__setup("no_ipi_broadcast", no_ipi_broadcast);
131
132static int __init print_ipi_mode(void)
133{
134 printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" :
135 "Shortcut");
136 return 0;
137}
138
139late_initcall(print_ipi_mode);
140
141
142
143
144
145
146
147
148
149char * __init machine_specific_memory_setup(void)
150{
151 char *who;
152
153
154 who = "BIOS-e820";
155
156
157
158
159
160
161
162 sanitize_e820_map(E820_MAP, &E820_MAP_NR);
163 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
164 unsigned long mem_size;
165
166
167 if (ALT_MEM_K < EXT_MEM_K) {
168 mem_size = EXT_MEM_K;
169 who = "BIOS-88";
170 } else {
171 mem_size = ALT_MEM_K;
172 who = "BIOS-e801";
173 }
174
175 e820.nr_map = 0;
176 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
177 add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
178 }
179 return who;
180}
181