diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-10-29 11:26:44 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-10-29 11:26:44 +0300 |
commit | c4fcc92183c55db868d0d6ae53e6009fb2e53ee5 (patch) | |
tree | ad5ef50aa07465e11f779c4482e20e6071182e9c /arch/i686/include/sys/cpuid.h | |
parent | makefile: add libk target (diff) | |
download | kernel-c4fcc92183c55db868d0d6ae53e6009fb2e53ee5.tar.xz |
makefile: add i686/arch.a target
Diffstat (limited to 'arch/i686/include/sys/cpuid.h')
-rw-r--r-- | arch/i686/include/sys/cpuid.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/arch/i686/include/sys/cpuid.h b/arch/i686/include/sys/cpuid.h deleted file mode 100644 index f2ffe37..0000000 --- a/arch/i686/include/sys/cpuid.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include <cpuid.h> - -struct CPUVersion { - unsigned int stepping : 4; - unsigned int model : 4; - unsigned int family : 4; - unsigned int type : 2; - unsigned int __unused_1 : 2; - unsigned int model_ex : 4; - unsigned int family_ex : 8; - unsigned int __unused_2 : 4; -} __attribute__((packed, aligned(__alignof__(unsigned int)))); -_Static_assert(sizeof(struct CPUVersion) == sizeof(unsigned int)); - -unsigned int -family(const struct CPUVersion v) -{ - if (v.family == 0x0f) return v.family + v.family_ex; - else - return v.family; -} - -unsigned int -model(const struct CPUVersion v) -{ - switch (v.family) { - case 0x06: - case 0x0f: - return ((unsigned int)v.model_ex << 4) | v.model; - default: - return v.model; - } -} |