Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. if ((KrnIsSuper()) || ((ssp = SuperState()) != NULL))
  2. {
  3. /* Obtain/set the critical IRQs and Vectors */
  4. for (i = 0; i < X86_CPU_EXCEPT_COUNT; i++)
  5. {
  6. if (!core_SetIDTGate((apicidt_t *)apic->cores[cpuNum].cpu_IDT, i, (uintptr_t)IntrDefaultGates[i], TRUE))
  7. {
  8. krnPanic(NULL, "Failed to set CPU Exception Vector\n"
  9. "Vector #$%02X\n", i);
  10. }
  11. }
  12. for (i = APIC_EXCEPT_IPI_NOP; i < APIC_EXCEPT_TOP; i++)
  13. {
  14. if (i == APIC_EXCEPT_SYSCALL)
  15. continue;
  16. 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))
  17. {
  18. krnPanic(NULL, "Failed to set APIC Exception Vector\n"
  19. "Vector #$%02X\n", i);
  20. }
  21. }
  22. D(bug("[Kernel:APIC-IA32.%03u] %s: APIC Exception Vectors configured\n", cpuNum, __func__));
  23.  
  24. if (cpuNum == 0)
  25. {
  26. KrnAddExceptionHandler(APIC_EXCEPT_ERROR, core_APICErrorHandle, NULL, NULL);
  27.  
  28. D(bug("[Kernel:APIC-IA32.%03u] %s: APIC Error Exception handler (exception #$%02X) installed\n", cpuNum, __func__, APIC_EXCEPT_ERROR));
  29.  
  30. for (i = APIC_EXCEPT_IPI_NOP; i <= APIC_EXCEPT_IPI_CAUSE; i++)
  31. {
  32. KrnAddExceptionHandler(i, core_IPIHandle, (void *)((intptr_t)i - APIC_EXCEPT_IPI_NOP), KernelBase);
  33. }
  34. D(bug("[Kernel:APIC-IA32.%03u] %s: APIC IPI Vectors configured\n", cpuNum, __func__));
  35. }
  36.  
  37. if (ssp)
  38. UserState(ssp);
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement