io(placeholder): add naive io structure
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
20
include/io.hh
Normal file
20
include/io.hh
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays)
|
||||
|
||||
namespace matar {
|
||||
class IoRegisters {
|
||||
public:
|
||||
uint8_t read(uint32_t) const;
|
||||
void write(uint32_t, uint8_t);
|
||||
|
||||
private:
|
||||
struct {
|
||||
bool post_boot_flag = false;
|
||||
bool interrupt_master_enabler = false;
|
||||
} system;
|
||||
};
|
||||
}
|
||||
|
||||
// NOLINTEND(cppcoreguidelines-avoid-c-arrays)
|
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "header.hh"
|
||||
#include "io.hh"
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@@ -51,6 +52,7 @@ class Memory {
|
||||
|
||||
#undef MEMORY_REGION
|
||||
|
||||
IoRegisters io;
|
||||
std::unordered_map<uint32_t, uint8_t> invalid_mem;
|
||||
std::vector<uint8_t> rom;
|
||||
Header header;
|
||||
|
Reference in New Issue
Block a user