feat: introduced tasking, added paging (no vm), moved malloc, added
syscalls, other stuff
This commit is contained in:
@@ -5,10 +5,76 @@
|
||||
#ifndef NEW_KERNEL_CPUIDX_H
|
||||
#define NEW_KERNEL_CPUIDX_H
|
||||
|
||||
#include <cpuid.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
enum {
|
||||
typedef struct {
|
||||
bool sse3: 1;
|
||||
bool pclmul: 1;
|
||||
bool dtes64: 1;
|
||||
bool monitor: 1;
|
||||
bool ds_cpl: 1;
|
||||
bool vmx: 1;
|
||||
bool smx: 1;
|
||||
bool est: 1;
|
||||
bool tm2: 1;
|
||||
bool ssse3: 1;
|
||||
bool cid: 1;
|
||||
bool reserved: 1;
|
||||
bool fma: 1;
|
||||
bool cx16: 1;
|
||||
bool etprd: 1;
|
||||
bool pdcm: 1;
|
||||
bool pcide: 1;
|
||||
bool dca: 1;
|
||||
bool sse4_1: 1;
|
||||
bool sse4_2: 1;
|
||||
bool x2APIC: 1;
|
||||
bool movbe: 1;
|
||||
bool popcnt: 1;
|
||||
bool reserved2: 1;
|
||||
bool aes: 1;
|
||||
bool xsave: 1;
|
||||
bool osxsave: 1;
|
||||
bool avx: 1;
|
||||
} cpu_features_ecx ;
|
||||
|
||||
typedef struct {
|
||||
bool fpu: 1;
|
||||
bool vme: 1;
|
||||
bool de: 1;
|
||||
bool pse: 1;
|
||||
bool tsc: 1;
|
||||
bool msr: 1;
|
||||
bool pae: 1;
|
||||
bool mce: 1;
|
||||
bool cx8: 1;
|
||||
bool apic: 1;
|
||||
bool reserved: 1;
|
||||
bool sep: 1;
|
||||
bool mtrr: 1;
|
||||
bool pge: 1;
|
||||
bool mca: 1;
|
||||
bool cmov: 1;
|
||||
bool pat: 1;
|
||||
bool pse36: 1;
|
||||
bool psn: 1;
|
||||
bool clf: 1;
|
||||
bool reserved2: 1;
|
||||
bool dtes: 1;
|
||||
bool acpi: 1;
|
||||
bool mmx: 1;
|
||||
bool fxsr: 1;
|
||||
bool sse: 1;
|
||||
bool sse2: 1;
|
||||
bool ss: 1;
|
||||
bool htt: 1;
|
||||
bool tm1: 1;
|
||||
bool ia64: 1;
|
||||
bool pbe: 1;
|
||||
|
||||
} cpu_features_edx ;
|
||||
|
||||
enum cpu_features {
|
||||
CPUID_FEAT_ECX_SSE3 = 1 << 0,
|
||||
CPUID_FEAT_ECX_PCLMUL = 1 << 1,
|
||||
CPUID_FEAT_ECX_DTES64 = 1 << 2,
|
||||
@@ -68,16 +134,6 @@ enum {
|
||||
CPUID_FEAT_EDX_PBE = 1 << 31
|
||||
};
|
||||
|
||||
static inline void cpuid(int code, uint32_t *a, uint32_t *d) {
|
||||
asm volatile("cpuid":"=a"(*a), "=d"(*d):"a"(code):"ecx", "ebx");
|
||||
}
|
||||
|
||||
/** issue a complete request, storing general registers output as a string
|
||||
*/
|
||||
static inline int cpuid_string(int code, uint32_t where[4]) {
|
||||
asm volatile("cpuid":"=a"(*where), "=b"(*(where + 1)),
|
||||
"=c"(*(where + 2)), "=d"(*(where + 3)):"a"(code));
|
||||
return (int) where[0];
|
||||
}
|
||||
void cpuidx_print_info();
|
||||
|
||||
#endif //NEW_KERNEL_CPUIDX_H
|
||||
|
||||
Reference in New Issue
Block a user