Deleted Added
sdiff udiff text old ( 12484:be3fa5e27fb5 ) new ( 12588:c007da6c777a )
full compact
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 uint64_t base = desc.baseLow + (desc.baseHigh << 24);
67 bool honorBase = !longmode || seg == SEGMENT_REG_FS ||
68 seg == SEGMENT_REG_GS ||
69 seg == SEGMENT_REG_TSL ||
70 seg == SYS_SEGMENT_REG_TR;
71 uint64_t limit = desc.limitLow | (desc.limitHigh << 16);
72 if (desc.g)
73 limit = (limit << 12) | mask(12);
74
75 SegAttr attr = 0;
76
77 attr.dpl = desc.dpl;
78 attr.unusable = 0;
79 attr.defaultSize = desc.d;
80 attr.longMode = desc.l;
81 attr.avl = desc.avl;

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

96 attr.writable = desc.type.w;
97 }
98 } else {
99 attr.readable = 1;
100 attr.writable = 1;
101 attr.expandDown = 0;
102 }
103
104 tc->setMiscReg(MISCREG_SEG_BASE(seg), base);
105 tc->setMiscReg(MISCREG_SEG_EFF_BASE(seg), honorBase ? base : 0);
106 tc->setMiscReg(MISCREG_SEG_LIMIT(seg), limit);
107 tc->setMiscReg(MISCREG_SEG_ATTR(seg), (MiscReg)attr);
108}
109
110void
111X86System::initState()
112{
113 System::initState();
114

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

154 initDesc.type.c = 0; // conforming
155 initDesc.type.r = 1; // readable
156 initDesc.dpl = 0; // privilege
157 initDesc.p = 1; // present
158 initDesc.l = 1; // longmode - 64 bit
159 initDesc.d = 0; // operand size
160 initDesc.g = 1; // granularity
161 initDesc.s = 1; // system segment
162 initDesc.limitHigh = 0xF;
163 initDesc.limitLow = 0xFFFF;
164 initDesc.baseHigh = 0x0;
165 initDesc.baseLow = 0x0;
166
167 // 64 bit code segment
168 SegDescriptor csDesc = initDesc;
169 csDesc.type.codeOrData = 1;
170 csDesc.dpl = 0;
171 // Because we're dealing with a pointer and I don't think it's
172 // guaranteed that there isn't anything in a nonvirtual class between
173 // it's beginning in memory and it's actual data, we'll use an

--- 208 unchanged lines hidden ---