summaryrefslogtreecommitdiff
path: root/x86.h
diff options
context:
space:
mode:
authorkolya <kolya>2008-09-24 01:48:31 +0000
committerkolya <kolya>2008-09-24 01:48:31 +0000
commitc7317d4dc74bcb1d0e939c6b06a724fce1510a4e (patch)
treedb061a7ee7430ee83da28632822bb93773dd0553 /x86.h
parentadcd16c3f7588b4a28d37495f05e94278c9e3a1e (diff)
downloadxv6-labs-c7317d4dc74bcb1d0e939c6b06a724fce1510a4e.tar.gz
xv6-labs-c7317d4dc74bcb1d0e939c6b06a724fce1510a4e.tar.bz2
xv6-labs-c7317d4dc74bcb1d0e939c6b06a724fce1510a4e.zip
always save and restore %fs, %gs to ensure old segment entries are never
accessible to user from the hidden CPU segment registers.
Diffstat (limited to 'x86.h')
-rw-r--r--x86.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/x86.h b/x86.h
index 1f2c881..8db4dc9 100644
--- a/x86.h
+++ b/x86.h
@@ -135,21 +135,25 @@ struct trapframe {
uint eax;
// rest of trap frame
- ushort es;
+ ushort gs;
ushort padding1;
- ushort ds;
+ ushort fs;
ushort padding2;
+ ushort es;
+ ushort padding3;
+ ushort ds;
+ ushort padding4;
uint trapno;
// below here defined by x86 hardware
uint err;
uint eip;
ushort cs;
- ushort padding3;
+ ushort padding5;
uint eflags;
// below here only when crossing rings, such as from user to kernel
uint esp;
ushort ss;
- ushort padding4;
+ ushort padding6;
};