diff options
| author | Bobby <[email protected]> | 2026-03-30 15:02:42 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-30 15:02:42 +0530 |
| commit | 2324951126b542aeecfd8dd12b381265cce1566c (patch) | |
| tree | a580fe97a13788fbe3b104e3a9553f551c2bff11 /mirai/memory/convert | |
| parent | 3c2c5c419cae1b7f2d60e8a3dc6e2e8c157b5a2f (diff) | |
| download | akiba-main.tar.xz akiba-main.zip | |
Diffstat (limited to 'mirai/memory/convert')
| -rw-r--r-- | mirai/memory/convert/convert.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mirai/memory/convert/convert.zig b/mirai/memory/convert/convert.zig new file mode 100644 index 0000000..0e504e1 --- /dev/null +++ b/mirai/memory/convert/convert.zig @@ -0,0 +1,12 @@ +//! Physical-Virtual Address Conversion + +const common = @import("../../../common/common.zig"); +const layout = common.constants.memory.layout; + +pub fn phys_to_virt(phys: u64) u64 { + return phys + layout.physmap_base; +} + +pub fn virt_to_phys(virt: u64) u64 { + return virt - layout.physmap_base; +} |
