Guest User

Untitled

a guest
Aug 7th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.33 KB | None | 0 0
  1. Index: rEFIt_UEFI/Platform/AcpiPatcher.c
  2. ===================================================================
  3. --- rEFIt_UEFI/Platform/AcpiPatcher.c   (revision 5028)
  4. +++ rEFIt_UEFI/Platform/AcpiPatcher.c   (working copy)
  5. @@ -2138,13 +2138,15 @@
  6.      //determine first ID of CPU. This must be 0 for Mac and for good Hack
  7.      // but = 1 for stupid ASUS
  8.      //
  9. -    if (ProcLocalApic->Type == 0) {
  10. +    if (ProcLocalApic->Type == EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC) {
  11.        ApicCPUBase = ProcLocalApic->AcpiProcessorId; //we want first instance
  12.      }
  13.  
  14. -    while ((ProcLocalApic->Type == 0) && (ProcLocalApic->Length == 8)) {
  15. -      ProcLocalApic++;
  16. -      ApicCPUNum++;
  17. +    while ((ProcLocalApic->Type == EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC) && (ProcLocalApic->Length == 8)) {
  18. +      if (ProcLocalApic->Flags & EFI_ACPI_4_0_LOCAL_APIC_ENABLED) {
  19. +        ProcLocalApic++;
  20. +        ApicCPUNum++;
  21. +      }
  22.        if (ApicCPUNum > 16) {
  23.          DBG("Out of control with CPU numbers\n");
  24.          break;
  25. @@ -2177,17 +2179,21 @@
  26.          Index = 0;
  27.          while (*SubTable != EFI_ACPI_4_0_LOCAL_APIC_NMI) {
  28.            DBG("Found subtable in MADT: type=%d\n", *SubTable);
  29. +
  30.            if (*SubTable == EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC) {
  31.              ProcLocalApic = (EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE *)SubTable;
  32. -            if (Index == 0) {
  33. -              DBG("ProcLocalApic: old=%d\n", ProcLocalApic->AcpiProcessorId);
  34. -              ProcLocalApic->AcpiProcessorId = 0;
  35. -              DBG("ProcLocalApic: new=%d\n", ProcLocalApic->AcpiProcessorId);
  36. -            } else {
  37. -              DBG("ProcLocalApic: %d\n", ProcLocalApic->AcpiProcessorId);
  38. +            if (ProcLocalApic->Flags & EFI_ACPI_4_0_LOCAL_APIC_ENABLED) {
  39. +              if (Index == 0 && ProcLocalApic->AcpiProcessorId > 1) {
  40. +                DBG("ProcLocalApic changed: %d to %d\n", ProcLocalApic->AcpiProcessorId, 0);
  41. +                ProcLocalApic->AcpiProcessorId = 0;
  42. +                ApicCPUBase = 0;
  43. +              } else {
  44. +                DBG("ProcLocalApic: %d\n", ProcLocalApic->AcpiProcessorId);
  45. +              }
  46. +              Index++;
  47.              }
  48. -            Index++;
  49.            }
  50. +
  51.            bufferLen = (UINTN)SubTable[1];
  52.            SubTable += bufferLen;
  53.            if (((UINTN)SubTable - (UINTN)BufferPtr) >= ApicTable->Length) {
Advertisement
Add Comment
Please, Sign In to add comment