summaryrefslogtreecommitdiff
path: root/mmu.h
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2010-08-31 19:21:52 -0400
committerRobert Morris <[email protected]>2010-08-31 19:21:52 -0400
commit23c3e52c2fb5f1709bf5053a8e93161931b56bf9 (patch)
treecb51f605a35de8980efce5dcab3e5df9757c022a /mmu.h
parent3597d5dc704c192a85b9902f7264fe9025aad277 (diff)
parent5048762c7e27789a014cc1e74e1002e749c924ce (diff)
downloadxv6-labs-23c3e52c2fb5f1709bf5053a8e93161931b56bf9.tar.gz
xv6-labs-23c3e52c2fb5f1709bf5053a8e93161931b56bf9.tar.bz2
xv6-labs-23c3e52c2fb5f1709bf5053a8e93161931b56bf9.zip
Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6
Diffstat (limited to 'mmu.h')
-rw-r--r--mmu.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/mmu.h b/mmu.h
index db40f25..475eae8 100644
--- a/mmu.h
+++ b/mmu.h
@@ -24,6 +24,20 @@
#define FL_VIP 0x00100000 // Virtual Interrupt Pending
#define FL_ID 0x00200000 // ID flag
+// Control Register flags
+#define CR0_PE 0x00000001 // Protection Enable
+#define CR0_MP 0x00000002 // Monitor coProcessor
+#define CR0_EM 0x00000004 // Emulation
+#define CR0_TS 0x00000008 // Task Switched
+#define CR0_ET 0x00000010 // Extension Type
+#define CR0_NE 0x00000020 // Numeric Errror
+#define CR0_WP 0x00010000 // Write Protect
+#define CR0_AM 0x00040000 // Alignment Mask
+#define CR0_NW 0x20000000 // Not Writethrough
+#define CR0_CD 0x40000000 // Cache Disable
+#define CR0_PG 0x80000000 // Paging
+
+//PAGEBREAK!
// Segment Descriptor
struct segdesc {
uint lim_15_0 : 16; // Low bits of segment limit
@@ -46,7 +60,6 @@ struct segdesc {
{ ((lim) >> 12) & 0xffff, (uint)(base) & 0xffff, \
((uint)(base) >> 16) & 0xff, type, 1, dpl, 1, \
(uint)(lim) >> 28, 0, 0, 1, 1, (uint)(base) >> 24 }
-
#define SEG16(type, base, lim, dpl) (struct segdesc) \
{ (lim) & 0xffff, (uint)(base) & 0xffff, \
((uint)(base) >> 16) & 0xff, type, 1, dpl, 1, \
@@ -62,8 +75,6 @@ struct segdesc {
#define STA_R 0x2 // Readable (executable segments)
#define STA_A 0x1 // Accessed
-//
-
// System segment type bits
#define STS_T16A 0x1 // Available 16-bit TSS
#define STS_LDT 0x2 // Local Descriptor Table
@@ -78,7 +89,6 @@ struct segdesc {
#define STS_IG32 0xE // 32-bit Interrupt Gate
#define STS_TG32 0xF // 32-bit Trap Gate
-
// A linear address 'la' has a three-part structure as follows:
//
// +--------10------+-------10-------+---------12----------+
@@ -130,21 +140,6 @@ struct segdesc {
typedef uint pte_t;
-// Control Register flags
-#define CR0_PE 0x00000001 // Protection Enable
-#define CR0_MP 0x00000002 // Monitor coProcessor
-#define CR0_EM 0x00000004 // Emulation
-#define CR0_TS 0x00000008 // Task Switched
-#define CR0_ET 0x00000010 // Extension Type
-#define CR0_NE 0x00000020 // Numeric Errror
-#define CR0_WP 0x00010000 // Write Protect
-#define CR0_AM 0x00040000 // Alignment Mask
-#define CR0_NW 0x20000000 // Not Writethrough
-#define CR0_CD 0x40000000 // Cache Disable
-#define CR0_PG 0x80000000 // Paging
-
-
-// PAGEBREAK: 40
// Task state segment format
struct taskstate {
uint link; // Old ts selector