Skip to content

Commit 6859638

Browse files
committed
3rd: update cpu_io
Signed-off-by: Niu Zhihong <zhihong@nzhnb.com>
1 parent 02c7728 commit 6859638

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/arch/x86_64/arch_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ BasicInfo::BasicInfo(int, const char **) {
140140

141141
fdt_addr = 0;
142142

143-
core_count = cpu_io::GetCpuTopologyInfo().logical_processors;
143+
core_count = cpu_io::cpuid::GetLogicalProcessorCount();
144144
}
145145

146146
auto ArchInit(int, const char **) -> int {

src/driver/apic/apic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bool Apic::InitCurrentCpuLocalApic() {
3131
if (result) {
3232
klog::Info(
3333
"Local APIC initialized successfully for CPU with APIC ID 0x%x\n",
34-
cpu_io::GetApicInfo().apic_id);
34+
cpu_io::GetCurrentCoreId());
3535
} else {
3636
klog::Err("Failed to initialize Local APIC for current CPU\n");
3737
}
@@ -144,7 +144,7 @@ void Apic::StartupAllAps(uint64_t ap_code_addr, size_t ap_code_size,
144144
// 跳过当前的 BSP (Bootstrap Processor)
145145
for (size_t apic_id = 0; apic_id < cpu_count_; apic_id++) {
146146
// 跳过当前 BSP
147-
if (static_cast<uint32_t>(apic_id) == cpu_io::GetApicInfo().apic_id) {
147+
if (static_cast<uint32_t>(apic_id) == cpu_io::GetCurrentCoreId()) {
148148
continue;
149149
}
150150
StartupAp(static_cast<uint32_t>(apic_id), ap_code_addr, ap_code_size,

src/driver/apic/local_apic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void LocalApic::PrintInfo() const {
382382
}
383383

384384
bool LocalApic::CheckX2ApicSupport() const {
385-
return cpu_io::GetApicInfo().has_x2apic;
385+
return cpu_io::cpuid::HasX2Apic();
386386
}
387387

388388
bool LocalApic::EnableXApic() const {

0 commit comments

Comments
 (0)