Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ((KrnIsSuper()) || ((ssp = SuperState()) != NULL))
- {
- /* Obtain/set the critical IRQs and Vectors */
- for (i = 0; i < X86_CPU_EXCEPT_COUNT; i++)
- {
- if (!core_SetIDTGate((apicidt_t *)apic->cores[cpuNum].cpu_IDT, i, (uintptr_t)IntrDefaultGates[i], TRUE))
- {
- krnPanic(NULL, "Failed to set CPU Exception Vector\n"
- "Vector #$%02X\n", i);
- }
- }
- for (i = APIC_EXCEPT_IPI_NOP; i < APIC_EXCEPT_TOP; i++)
- {
- if (i == APIC_EXCEPT_SYSCALL)
- continue;
- if (!core_SetIDTGate((apicidt_t *)apic->cores[cpuNum].cpu_IDT, APIC_CPU_EXCEPT_TO_VECTOR(i), (uintptr_t)IntrDefaultGates[APIC_CPU_EXCEPT_TO_VECTOR(i)], TRUE))
- {
- krnPanic(NULL, "Failed to set APIC Exception Vector\n"
- "Vector #$%02X\n", i);
- }
- }
- D(bug("[Kernel:APIC-IA32.%03u] %s: APIC Exception Vectors configured\n", cpuNum, __func__));
- if (cpuNum == 0)
- {
- KrnAddExceptionHandler(APIC_EXCEPT_ERROR, core_APICErrorHandle, NULL, NULL);
- D(bug("[Kernel:APIC-IA32.%03u] %s: APIC Error Exception handler (exception #$%02X) installed\n", cpuNum, __func__, APIC_EXCEPT_ERROR));
- for (i = APIC_EXCEPT_IPI_NOP; i <= APIC_EXCEPT_IPI_CAUSE; i++)
- {
- KrnAddExceptionHandler(i, core_IPIHandle, (void *)((intptr_t)i - APIC_EXCEPT_IPI_NOP), KernelBase);
- }
- D(bug("[Kernel:APIC-IA32.%03u] %s: APIC IPI Vectors configured\n", cpuNum, __func__));
- }
- if (ssp)
- UserState(ssp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement