Go to the source code of this file.
◆ LAPIC_Broadcast()
int LAPIC_Broadcast |
( |
int |
vector | ) |
|
Definition at line 143 of file lapic.c.
144{
145 int i = 0;
147
150
151 if (i > 1000000) {
152 kprintf(
"IPI not delivered?\n");
153 return -1;
154 }
155 }
156
157 return 0;
158}
static INLINE void pause()
int kprintf(const char *fmt,...)
#define LAPIC_ICR_EXCSELF
#define LAPIC_ICR_DELIVERY_PENDING
uint32_t LAPIC_Read(uint16_t reg)
void LAPIC_Write(uint16_t reg, uint32_t val)
◆ LAPIC_BroadcastNMI()
int LAPIC_BroadcastNMI |
( |
int |
vector | ) |
|
Definition at line 161 of file lapic.c.
162{
163 int i = 0;
165
168
169 if (i > 1000000) {
170 kprintf(
"IPI not delivered?\n");
171 return -1;
172 }
173 }
174
175 return 0;
176}
◆ LAPIC_CPU()
Definition at line 93 of file lapic.c.
94{
97 else
98 return 0;
99}
◆ LAPIC_Init()
Definition at line 179 of file lapic.c.
180{
185
188 Panic(
"APIC is required!\n");
189
190
194 }
195
196
199
200
202
204
206
209
210
212
213
215
216
220 } else {
223 }
224
225
226 if (lvts >= 4) {
228 }
229
230
231 if (lvts >= 5) {
233 }
234
235
236 if (lvts >= 6) {
238 }
239
241
242
245
249 {
250
251 }
252
254
256}
static INLINE uint64_t rdmsr(uint32_t addr)
static INLINE void outb(uint16_t port, uint8_t data)
static INLINE void wrmsr(uint32_t addr, uint64_t val)
static INLINE void cpuid(uint32_t info, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
#define LAPIC_LVT_THERMAL
#define LAPIC_VERSION_LVTMASK
#define LAPIC_LVT_FLAG_MASKED
#define IA32_APIC_BASE_MSR
#define LAPIC_VERSION_LVTSHIFT
void LAPIC_Periodic(uint64_t rate)
#define LAPIC_LVT_FLAG_NMI
#define LAPIC_LVT_FLAG_EXTINT
#define IA32_APIC_BASE_MSR_ENABLE
#define LAPIC_ICR_INCSELF
void Panic(const char *str)
◆ LAPIC_Periodic()
Definition at line 108 of file lapic.c.
109{
113}
#define LAPIC_LVT_TIMER_PERIODIC
◆ LAPIC_SendEOI()
◆ LAPIC_StartAP()
Definition at line 116 of file lapic.c.
117{
118
122 cmosStartup[0] = 0;
123 cmosStartup[1] =
addr >> 4;
124
125
128
131
132
133
136
139
140}
#define LAPIC_ICR_STARTUP