mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 02:55:15 +00:00
Kernel: Add MAX_CPU_COUNT global constant
Instead of just hard-coding the x86 Processor array to size 64, we now use a named constant that you can also reference elsewhere. :^)
This commit is contained in:
parent
9b3db63e14
commit
94b514b981
|
@ -35,6 +35,8 @@ struct [[gnu::aligned(16)]] FPUState
|
|||
// FIXME: Remove this once we support SMP in aarch64
|
||||
extern Processor* g_current_processor;
|
||||
|
||||
constexpr size_t MAX_CPU_COUNT = 1;
|
||||
|
||||
class Processor {
|
||||
void* m_processor_specific_data[static_cast<size_t>(ProcessorSpecificDataID::__Count)];
|
||||
|
||||
|
|
|
@ -61,7 +61,9 @@ struct [[gnu::aligned(64), gnu::packed]] FPUState
|
|||
class Processor;
|
||||
// Note: We only support 64 processors at most at the moment,
|
||||
// so allocate 64 slots of inline capacity in the container.
|
||||
using ProcessorContainer = Array<Processor*, 64>;
|
||||
|
||||
constexpr size_t MAX_CPU_COUNT = 64;
|
||||
using ProcessorContainer = Array<Processor*, MAX_CPU_COUNT>;
|
||||
|
||||
class Processor {
|
||||
friend class ProcessorInfo;
|
||||
|
|
Loading…
Reference in a new issue