Library call for cpu features; make kernel and vm use this to query cpu

features (specifically: 4MB pages and TLB global bit).  Only enable
these features in CR4 if available. 4MB pages to be used in the near
future.
This commit is contained in:
Ben Gras
2009-05-15 17:07:36 +00:00
parent d0b6e76bfb
commit bdab3c4cfb
10 changed files with 134 additions and 13 deletions

View File

@@ -0,0 +1,10 @@
#ifndef _MINIX_CPUFEATURE_H
#define _MINIX_CPUFEATURE_H 1
#define _CPUF_I386_PSE 1 /* Page Size Extension */
#define _CPUF_I386_PGE 2 /* Page Global Enable */
_PROTOTYPE(int _cpufeature, (int featureno));
#endif

View File

@@ -15,6 +15,7 @@ _PROTOTYPE(void std_err, (char *_s));
_PROTOTYPE(void prints, (const char *_s, ...));
_PROTOTYPE(int fsversion, (char *_dev, char *_prog));
_PROTOTYPE(int getprocessor, (void));
_PROTOTYPE(int _cpuid, (u32_t eax_in, u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx));
_PROTOTYPE(int load_mtab, (char *_prog_name));
_PROTOTYPE(int rewrite_mtab, (char *_prog_name));
_PROTOTYPE(int get_mtab_entry, (char *_s1, char *_s2, char *_s3, char *_s4));

View File

@@ -58,3 +58,7 @@ sys/vm_i386.h
*/
#define I386_VM_PFE_W 0x02 /* Caused by write (otherwise read) */
#define I386_VM_PFE_U 0x04 /* CPU in user mode (otherwise supervisor) */
/* CPUID flags */
#define CPUID1_EDX_PSE (1L << 3) /* Page Size Extension */
#define CPUID1_EDX_PGE (1L << 13) /* Page Global (bit) Enable */