From fe833dd2c33818a1f92f87ea26b17e6b85d3976e Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 1 Dec 2007 23:05:01 -0800 Subject: X86: First crack at far returns. This is grossly approximate. --HG-- extra : convert_revision : 23da0338af1f7663ae5ddf2289fb45dd32f37c42 --- src/arch/x86/isa/microops/regop.isa | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'src/arch/x86/isa/microops/regop.isa') 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; ''' }}; -- cgit v1.2.3