1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-01 13:58:20 +00:00

Temporarily avoid use of Writeable.

This commit is contained in:
Thomas Harte 2023-11-05 21:47:52 -05:00
parent 009915f4de
commit 797c9fe129
2 changed files with 4 additions and 3 deletions

View File

@ -46,7 +46,8 @@ class Writeable {
private:
IntT &target_;
};
template <typename IntT> struct ReturnType<IntT, AccessType::Write> { using type = Writeable<IntT>; };
//template <typename IntT> struct ReturnType<IntT, AccessType::Write> { using type = Writeable<IntT>; };
template <typename IntT> struct ReturnType<IntT, AccessType::Write> { using type = IntT &; };
// Read-modify-writes: return a reference.
template <typename IntT> struct ReturnType<IntT, AccessType::ReadModifyWrite> { using type = IntT &; };

View File

@ -273,7 +273,7 @@ struct Memory {
// Entry point used by the flow controller so that it can mark up locations at which the flags were written,
// so that defined-flag-only masks can be applied while verifying RAM contents.
template <typename IntT, AccessType type>
typename ReturnType<IntT, type>::type &access(InstructionSet::x86::Source segment, uint16_t offset, Tag tag) {
typename InstructionSet::x86::ReturnType<IntT, type>::type &access(InstructionSet::x86::Source segment, uint16_t offset, Tag tag) {
const uint32_t physical_address = address(segment, offset);
return access<IntT, type>(physical_address, tag);
}
@ -281,7 +281,7 @@ struct Memory {
// An additional entry point for the flow controller; on the original 8086 interrupt vectors aren't relative
// to a selector, they're just at an absolute location.
template <typename IntT, AccessType type>
typename ReturnType<IntT, type>::type &access(uint32_t address, Tag tag) {
typename InstructionSet::x86::ReturnType<IntT, type>::type &access(uint32_t address, Tag tag) {
if constexpr (type == AccessType::PreauthorisedRead) {
if(!test_preauthorisation(address)) {
printf("Non preauthorised access\n");