summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/microops/regop.isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-12-01 23:05:01 -0800
committerGabe Black <gblack@eecs.umich.edu>2007-12-01 23:05:01 -0800
commitfe833dd2c33818a1f92f87ea26b17e6b85d3976e (patch)
treed87babd2357acd86c2617460f704b911d8480945 /src/arch/x86/isa/microops/regop.isa
parentdc6f96017135da7f3beae5055195de3cf8e47c6c (diff)
downloadgem5-fe833dd2c33818a1f92f87ea26b17e6b85d3976e.tar.xz
X86: First crack at far returns. This is grossly approximate.
--HG-- extra : convert_revision : 23da0338af1f7663ae5ddf2289fb45dd32f37c42
Diffstat (limited to 'src/arch/x86/isa/microops/regop.isa')
-rw-r--r--src/arch/x86/isa/microops/regop.isa34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/arch/x86/isa/microops/regop.isa b/src/arch/x86/isa/microops/regop.isa
index 7f72fcf1d..de9f76e73 100644
--- a/src/arch/x86/isa/microops/regop.isa
+++ b/src/arch/x86/isa/microops/regop.isa
@@ -1010,27 +1010,31 @@ let {{
code = '''
SegDescriptor desc = SrcReg1;
SegAttr attr = 0;
- Addr base = 0, limit = 0;
attr.dpl = desc.dpl;
attr.defaultSize = desc.d;
- if (!desc.p)
- panic("Segment not present.\\n");
- if (!desc.s)
+ if (!desc.s) {
+ SegBaseDest = SegBaseDest;
+ SegLimitDest = SegLimitDest;
+ SegAttrDest = SegAttrDest;
panic("System segment encountered.\\n");
- if (desc.type.codeOrData) {
- panic("Code segment encountered with c = %d, r = %d, a = %d.\\n",
- desc.type.c, desc.type.r, desc.type.a);
} else {
- attr.expandDown = desc.type.e;
- attr.readable = 1;
- attr.writable = desc.type.w;
- base = desc.baseLow | (desc.baseHigh << 24);
- limit = desc.limitLow | (desc.limitHigh << 16);
+ if (!desc.p)
+ panic("Segment not present.\\n");
+ if (desc.type.codeOrData) {
+ attr.readable = desc.type.r;
+ attr.longMode = desc.l;
+ } else {
+ attr.expandDown = desc.type.e;
+ attr.readable = 1;
+ attr.writable = desc.type.w;
+ }
+ Addr base = desc.baseLow | (desc.baseHigh << 24);
+ Addr limit = desc.limitLow | (desc.limitHigh << 16);
if (desc.g)
limit = (limit << 12) | mask(12);
+ SegBaseDest = base;
+ SegLimitDest = limit;
+ SegAttrDest = attr;
}
- SegBaseDest = base;
- SegLimitDest = limit;
- SegAttrDest = attr;
'''
}};