2022-10-05 02:15:40 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/hle/kernel/physical_core.h"
|
|
|
|
#include "core/hle/kernel/svc.h"
|
|
|
|
|
|
|
|
namespace Kernel::Svc {
|
|
|
|
|
|
|
|
/// Get which CPU core is executing the current thread
|
2023-02-05 20:22:02 +01:00
|
|
|
int32_t GetCurrentProcessorNumber(Core::System& system) {
|
2022-10-05 02:15:40 +02:00
|
|
|
LOG_TRACE(Kernel_SVC, "called");
|
2023-02-05 20:22:02 +01:00
|
|
|
return static_cast<int32_t>(system.CurrentPhysicalCore().CoreIndex());
|
2022-10-05 02:15:40 +02:00
|
|
|
}
|
|
|
|
|
2023-02-05 20:22:02 +01:00
|
|
|
int32_t GetCurrentProcessorNumber64(Core::System& system) {
|
|
|
|
return GetCurrentProcessorNumber(system);
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t GetCurrentProcessorNumber64From32(Core::System& system) {
|
2022-10-05 02:15:40 +02:00
|
|
|
return GetCurrentProcessorNumber(system);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Kernel::Svc
|