diff options
author | MerryMage <MerryMage@users.noreply.github.com> | 2016-01-30 19:41:04 +0100 |
---|---|---|
committer | MerryMage <MerryMage@users.noreply.github.com> | 2016-01-30 19:41:04 +0100 |
commit | 2b9331334884349dc38cb9a447018dca0e5b0d9d (patch) | |
tree | 2ee280a21014808f190d7362a41ccd25e93dd2f4 /src/core/mmio.h | |
parent | Merge pull request #1360 from lioncash/var (diff) | |
download | yuzu-2b9331334884349dc38cb9a447018dca0e5b0d9d.tar yuzu-2b9331334884349dc38cb9a447018dca0e5b0d9d.tar.gz yuzu-2b9331334884349dc38cb9a447018dca0e5b0d9d.tar.bz2 yuzu-2b9331334884349dc38cb9a447018dca0e5b0d9d.tar.lz yuzu-2b9331334884349dc38cb9a447018dca0e5b0d9d.tar.xz yuzu-2b9331334884349dc38cb9a447018dca0e5b0d9d.tar.zst yuzu-2b9331334884349dc38cb9a447018dca0e5b0d9d.zip |
Diffstat (limited to 'src/core/mmio.h')
-rw-r--r-- | src/core/mmio.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/core/mmio.h b/src/core/mmio.h new file mode 100644 index 000000000..06b555e98 --- /dev/null +++ b/src/core/mmio.h @@ -0,0 +1,34 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <memory> + +#include "common/common_types.h" + +namespace Memory { + +/** + * Represents a device with memory mapped IO. + * A device may be mapped to multiple regions of memory. + */ +class MMIORegion { +public: + virtual ~MMIORegion() = default; + + virtual u8 Read8(VAddr addr) = 0; + virtual u16 Read16(VAddr addr) = 0; + virtual u32 Read32(VAddr addr) = 0; + virtual u64 Read64(VAddr addr) = 0; + + virtual void Write8(VAddr addr, u8 data) = 0; + virtual void Write16(VAddr addr, u16 data) = 0; + virtual void Write32(VAddr addr, u32 data) = 0; + virtual void Write64(VAddr addr, u64 data) = 0; +}; + +using MMIORegionPointer = std::shared_ptr<MMIORegion>; + +}; |