Skip to content

Commit

Permalink
Add GetExceptionBase() to the CPU interface
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Apr 28, 2024
1 parent a0381ba commit 88d3f9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/lunatic/cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct CPU {
virtual void Reset() = 0;
virtual auto IRQLine() -> bool& = 0;
virtual auto WaitForIRQ() -> bool& = 0;
virtual auto GetExceptionBase() const -> u32 = 0;
virtual void SetExceptionBase(u32 exception_base) = 0;
virtual void ClearICache() = 0;
virtual void ClearICacheRange(u32 address_lo, u32 address_hi) = 0;
Expand Down
4 changes: 4 additions & 0 deletions src/jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ struct JIT final : CPU {
return wait_for_irq;
}

auto GetExceptionBase() const -> u32 {
return exception_base;
}

void SetExceptionBase(u32 new_exception_base) override {
if (new_exception_base != this->exception_base) {
// this is expected to happen rarely, so we just invalidate all blocks that may cause an exception.
Expand Down

0 comments on commit 88d3f9d

Please sign in to comment.