Use std::span for CPU register-state

Following the trend of #33: `std::span` provides some useful utility
functions like `size_bytes()` and `as_bytes()` and serves as a better
non-owning "chunk of data"-type over just passing around an
`std::array&`.
This commit is contained in:
Wunkolo 2023-06-16 07:24:34 -07:00
parent c6f5d19983
commit fde93381a5
5 changed files with 38 additions and 32 deletions

View file

@ -2,10 +2,12 @@
#include <array>
#include <cassert>
#include <limits>
#include <span>
#include <string>
#include <vector>
#include "kernel_types.hpp"
#include "helpers.hpp"
#include "kernel_types.hpp"
#include "logger.hpp"
#include "memory.hpp"
#include "resource_limits.hpp"
@ -14,7 +16,7 @@
class CPU;
class Kernel {
std::array<u32, 16>& regs;
std::span<u32, 16> regs;
CPU& cpu;
Memory& mem;