1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * Copyright (c) 2018 TU Dresden 4 * All rights reserved. 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 49 unchanged lines hidden (view full) --- 58 rsdp(p->acpi_description_table_pointer) 59{ 60} 61 62void 63X86ISA::installSegDesc(ThreadContext *tc, SegmentRegIndex seg, 64 SegDescriptor desc, bool longmode) 65{ |
66 bool honorBase = !longmode || seg == SEGMENT_REG_FS || 67 seg == SEGMENT_REG_GS || 68 seg == SEGMENT_REG_TSL || 69 seg == SYS_SEGMENT_REG_TR; |
70 71 SegAttr attr = 0; 72 73 attr.dpl = desc.dpl; 74 attr.unusable = 0; 75 attr.defaultSize = desc.d; 76 attr.longMode = desc.l; 77 attr.avl = desc.avl; --- 14 unchanged lines hidden (view full) --- 92 attr.writable = desc.type.w; 93 } 94 } else { 95 attr.readable = 1; 96 attr.writable = 1; 97 attr.expandDown = 0; 98 } 99 |
100 tc->setMiscReg(MISCREG_SEG_BASE(seg), desc.base); 101 tc->setMiscReg(MISCREG_SEG_EFF_BASE(seg), honorBase ? desc.base : 0); 102 tc->setMiscReg(MISCREG_SEG_LIMIT(seg), desc.limit); |
103 tc->setMiscReg(MISCREG_SEG_ATTR(seg), (MiscReg)attr); 104} 105 106void 107X86System::initState() 108{ 109 System::initState(); 110 --- 39 unchanged lines hidden (view full) --- 150 initDesc.type.c = 0; // conforming 151 initDesc.type.r = 1; // readable 152 initDesc.dpl = 0; // privilege 153 initDesc.p = 1; // present 154 initDesc.l = 1; // longmode - 64 bit 155 initDesc.d = 0; // operand size 156 initDesc.g = 1; // granularity 157 initDesc.s = 1; // system segment |
158 initDesc.limit = 0xFFFFFFFF; 159 initDesc.base = 0; |
160 161 // 64 bit code segment 162 SegDescriptor csDesc = initDesc; 163 csDesc.type.codeOrData = 1; 164 csDesc.dpl = 0; 165 // Because we're dealing with a pointer and I don't think it's 166 // guaranteed that there isn't anything in a nonvirtual class between 167 // it's beginning in memory and it's actual data, we'll use an --- 208 unchanged lines hidden --- |