| 111 | } |
| 112 | |
| 113 | void Initialize(){ |
| 114 | cpus[0] = new CPU; // Initialize CPU 0 |
| 115 | cpus[0]->id = 0; |
| 116 | cpus[0]->gdt = (void*)GDT64Pointer64.base; |
| 117 | cpus[0]->gdtPtr = GDT64Pointer64; |
| 118 | cpus[0]->currentThread = nullptr; |
| 119 | cpus[0]->runQueueLock = 0; |
| 120 | cpus[0]->runQueue = new FastList<thread_t*>(); |
| 121 | SetCPULocal(cpus[0]); |
| 122 | |
| 123 | if(HAL::disableSMP) { |
| 124 | TSS::InitializeTSS(&cpus[0]->tss, cpus[0]->gdt); |
| 125 | ACPI::processorCount = 1; |
| 126 | processorCount = 1; |
| 127 | return; |
| 128 | } |
| 129 | |
| 130 | processorCount = ACPI::processorCount; |
| 131 | |
| 132 | PrepareTrampoline(); |
| 133 | |
| 134 | for(int i = 0; i < processorCount; i++){ |
| 135 | if(ACPI::processors[i] != 0) |
| 136 | InitializeCPU(ACPI::processors[i]); |
| 137 | } |
| 138 | |
| 139 | TSS::InitializeTSS(&cpus[0]->tss, cpus[0]->gdt); |
| 140 | |
| 141 | Log::Info("[SMP] %u processors initialized!", processorCount); |
| 142 | } |
| 143 | } |
nothing calls this directly
no test coverage detected