AuroraRuntime/Include/Aurora/HWInfo/CpuBitId.hpp
Reece 672915cd55 [*] Improve CpuId awareness through affinity
[*] Clean up OSThread
[*] Tweak HWInfo/CpuInfo
2022-03-16 18:15:57 +00:00

59 lines
1.5 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: CpuBitId.hpp
Date: 2022-1-24
Author: Reece
***/
#pragma once
namespace Aurora::HWInfo
{
struct CpuBitId
{
AuUInt64 lower {};
AuUInt64 upper {};
#if defined(_AU_MASSIVE_CPUID)
AuUInt64 upper2 {};
AuUInt64 upper3 {};
#endif
inline CpuBitId();
inline ~CpuBitId();
inline CpuBitId(AuUInt8 id);
inline bool HasValue() const;
inline void Add(const CpuBitId &id);
inline CpuBitId Not() const;
inline CpuBitId And(const CpuBitId &id) const;
inline CpuBitId Xor(const CpuBitId &id) const;
inline CpuBitId Or(const CpuBitId &id) const;
inline bool CpuBitScanForward(AuUInt8 &index, AuUInt8 offset) const;
inline AuUInt8 CpuBitCount() const;
inline bool TestCpuIdx(AuUInt8 idx) const;
inline void Clear();
inline void SetBit(AuUInt8 idx);
inline void ClearBit(AuUInt8 idx);
inline bool TestBit(AuUInt8 idx) const;
inline AuString ToString() const;
inline CpuBitId &operator=(const CpuBitId &id);
inline operator bool() const;
#if defined(AURORA_IS_MODERNNT_DERIVED)
inline AuList<unsigned long> ToCpuSets() const;
inline void ToMsWin7GroupAffinity(void *ptr) const;
#endif
};
}
#include "CpuBitId.inl"
#if defined(AURORA_IS_MODERNNT_DERIVED)
#include "CpuBitId.NT.inl"
#endif