mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-05 08:26:28 +00:00
Switch to construct and copy.
This commit is contained in:
@@ -22,14 +22,9 @@ struct DescriptorTablePointer {
|
||||
};
|
||||
|
||||
struct Descriptor {
|
||||
void set_segment(const uint16_t segment) {
|
||||
base_ = uint32_t(segment) << 4;
|
||||
limit_ = 0xffff;
|
||||
Descriptor() = default;
|
||||
|
||||
present_ = true;
|
||||
}
|
||||
|
||||
void set(const uint16_t descriptor[4]) {
|
||||
Descriptor(const uint16_t descriptor[4]) noexcept {
|
||||
base_ = uint32_t(descriptor[1] | ((descriptor[2] & 0xff) << 16));
|
||||
limit_ = descriptor[0];
|
||||
|
||||
@@ -54,6 +49,13 @@ struct Descriptor {
|
||||
}
|
||||
}
|
||||
|
||||
void set_segment(const uint16_t segment) {
|
||||
base_ = uint32_t(segment) << 4;
|
||||
limit_ = 0xffff;
|
||||
|
||||
present_ = true;
|
||||
}
|
||||
|
||||
uint32_t to_linear(const uint32_t address) const {
|
||||
return base_ + address;
|
||||
}
|
||||
|
@@ -962,7 +962,7 @@ using namespace PCCompatible;
|
||||
|
||||
namespace {
|
||||
#ifndef NDEBUG
|
||||
static constexpr bool ForceAT = false;//true;
|
||||
static constexpr bool ForceAT = true;
|
||||
#else
|
||||
static constexpr bool ForceAT = false;
|
||||
#endif
|
||||
|
@@ -69,6 +69,8 @@ public:
|
||||
memory_.template access<uint16_t, AccessType::Read>(table_address + 6, table_end)
|
||||
};
|
||||
|
||||
const Descriptor incoming(entry);
|
||||
|
||||
// TODO: is this descriptor privilege within reach?
|
||||
// TODO: is this an empty descriptor*? If so: exception!
|
||||
// (* other than the 0 descriptor, which can be loaded to DS or ES)
|
||||
@@ -80,7 +82,7 @@ public:
|
||||
// CS: any sort of code
|
||||
// }
|
||||
|
||||
descriptors[segment].set(entry);
|
||||
descriptors[segment] = incoming;
|
||||
// TODO: set descriptor accessed bit in memory if it's a segment.
|
||||
} break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user