regop.isa (5900:6776001c9b92) regop.isa (5901:76fc2c3e10d2)
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 1178 unchanged lines hidden (view full) ---

1187 code = '''
1188 SegDescriptor desc = SrcReg1;
1189 SegSelector selector = SrcReg2;
1190 if (selector.si || selector.ti) {
1191 SegAttr attr = 0;
1192 attr.dpl = desc.dpl;
1193 attr.defaultSize = desc.d;
1194 if (!desc.s) {
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 1178 unchanged lines hidden (view full) ---

1187 code = '''
1188 SegDescriptor desc = SrcReg1;
1189 SegSelector selector = SrcReg2;
1190 if (selector.si || selector.ti) {
1191 SegAttr attr = 0;
1192 attr.dpl = desc.dpl;
1193 attr.defaultSize = desc.d;
1194 if (!desc.s) {
1195 SegBaseDest = SegBaseDest;
1196 SegLimitDest = SegLimitDest;
1197 SegAttrDest = SegAttrDest;
1198 panic("System segment encountered.\\n");
1195 // The expand down bit happens to be set for gates.
1196 if (desc.type.e) {
1197 panic("Gate descriptor encountered.\\n");
1198 }
1199 attr.readable = 1;
1200 attr.writable = 1;
1199 } else {
1200 if (!desc.p)
1201 panic("Segment not present.\\n");
1202 if (desc.type.codeOrData) {
1203 attr.readable = desc.type.r;
1204 attr.longMode = desc.l;
1205 } else {
1206 attr.expandDown = desc.type.e;
1207 attr.readable = 1;
1208 attr.writable = desc.type.w;
1209 }
1201 } else {
1202 if (!desc.p)
1203 panic("Segment not present.\\n");
1204 if (desc.type.codeOrData) {
1205 attr.readable = desc.type.r;
1206 attr.longMode = desc.l;
1207 } else {
1208 attr.expandDown = desc.type.e;
1209 attr.readable = 1;
1210 attr.writable = desc.type.w;
1211 }
1210 Addr base = desc.baseLow | (desc.baseHigh << 24);
1211 Addr limit = desc.limitLow | (desc.limitHigh << 16);
1212 if (desc.g)
1213 limit = (limit << 12) | mask(12);
1214 SegBaseDest = base;
1215 SegLimitDest = limit;
1216 SegAttrDest = attr;
1217 }
1212 }
1213 Addr base = desc.baseLow | (desc.baseHigh << 24);
1214 Addr limit = desc.limitLow | (desc.limitHigh << 16);
1215 if (desc.g)
1216 limit = (limit << 12) | mask(12);
1217 SegBaseDest = base;
1218 SegLimitDest = limit;
1219 SegAttrDest = attr;
1218 } else {
1219 SegBaseDest = SegBaseDest;
1220 SegLimitDest = SegLimitDest;
1221 SegAttrDest = SegAttrDest;
1222 }
1223 '''
1224}};
1220 } else {
1221 SegBaseDest = SegBaseDest;
1222 SegLimitDest = SegLimitDest;
1223 SegAttrDest = SegAttrDest;
1224 }
1225 '''
1226}};