summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-02-25 10:17:08 -0800
committerGabe Black <gblack@eecs.umich.edu>2009-02-25 10:17:08 -0800
commit08f3a126d540a88474a654720ecc7ceab9e0c246 (patch)
treebf0e95f46919e414c3265cf53bb5c6e148c9ac47 /src/arch
parent2f31643db52927d5c2e06d14e21846f1137d915a (diff)
downloadgem5-08f3a126d540a88474a654720ecc7ceab9e0c246.tar.xz
X86: Fix segment limit checking.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/isa/microops/regop.isa24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/arch/x86/isa/microops/regop.isa b/src/arch/x86/isa/microops/regop.isa
index 0d569d403..f21621e30 100644
--- a/src/arch/x86/isa/microops/regop.isa
+++ b/src/arch/x86/isa/microops/regop.isa
@@ -1192,10 +1192,12 @@ let {{
attr.dpl = desc.dpl;
attr.defaultSize = desc.d;
if (!desc.s) {
- SegBaseDest = SegBaseDest;
- SegLimitDest = SegLimitDest;
- SegAttrDest = SegAttrDest;
- panic("System segment encountered.\\n");
+ // The expand down bit happens to be set for gates.
+ if (desc.type.e) {
+ panic("Gate descriptor encountered.\\n");
+ }
+ attr.readable = 1;
+ attr.writable = 1;
} else {
if (!desc.p)
panic("Segment not present.\\n");
@@ -1207,14 +1209,14 @@ let {{
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;
}
+ 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;
} else {
SegBaseDest = SegBaseDest;
SegLimitDest = SegLimitDest;