Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/lib/sysdep/arch/x86_x64/apic.cpp
/* Copyright (C) 2011 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | |||||
bool AreApicIdsReliable() | bool AreApicIdsReliable() | ||||
{ | { | ||||
ModuleInit(&apicInitState, InitApicIds); | ModuleInit(&apicInitState, InitApicIds); | ||||
if(apicInitState < 0) | if(apicInitState < 0) | ||||
return false; | return false; | ||||
return true; | return true; | ||||
} | } | ||||
bool IsProcessorKnown(ApicId apicId) | |||||
{ | |||||
ModuleInit(&apicInitState, InitApicIds); | |||||
const ApicId* pos = std::find(processorApicIds, processorApicIds+numIds, apicId); | |||||
return pos != processorApicIds+numIds; | |||||
} | |||||
static size_t IndexFromApicId(const ApicId* apicIds, ApicId apicId) | static size_t IndexFromApicId(const ApicId* apicIds, ApicId apicId) | ||||
{ | { | ||||
ModuleInit(&apicInitState, InitApicIds); | ModuleInit(&apicInitState, InitApicIds); | ||||
const ApicId* pos = std::find(apicIds, apicIds+numIds, apicId); | const ApicId* pos = std::find(apicIds, apicIds+numIds, apicId); | ||||
if(pos == apicIds+numIds) | if(pos == apicIds+numIds) | ||||
{ | { | ||||
Show All 35 Lines |
Wildfire Games · Phabricator