forked from Imagelibrary/seL4
x86: Fix cpuid family/model composition
Fixes a bug where previously MODEL_ID() was defined as:
`#define MODEL_ID(x) ( ((x & 0xf0000) >> 16) + (x & 0xf0) )`
This was incorrect because (1) it didn't take into account the conditional
nature of the extended_model_ID, and (2) it's actually shifting the
extended_model_ID into the low bits and keeping the model_ID in the high bits,
when it should be the other way around.
This patch also introduces a foundation for more sane testing of CPU vendor,
family, model and brand_ID.
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#define USED __attribute__((used))
|
||||
#define FASTCALL __attribute__((fastcall))
|
||||
#define UNREACHABLE() __builtin_unreachable()
|
||||
#define MAY_ALIAS __attribute__((may_alias))
|
||||
|
||||
#define OFFSETOF(type, member) \
|
||||
__builtin_offsetof(type, member)
|
||||
|
||||
Reference in New Issue
Block a user