aboutsummaryrefslogtreecommitdiff
path: root/src/lib/paging.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/paging.zig')
-rw-r--r--src/lib/paging.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/paging.zig b/src/lib/paging.zig
index 84bc7dc..b6dbfe3 100644
--- a/src/lib/paging.zig
+++ b/src/lib/paging.zig
@@ -7,7 +7,7 @@
const std = @import("std");
const hwinfo = @import("hwinfo.zig");
-const instructions = @import("instructions.zig");
+const riscv = @import("riscv.zig");
// Defined by linker script.
pub const text_start = @extern(*anyopaque, .{ .name = "_text_start" });
@@ -582,7 +582,7 @@ pub fn free(memory: anytype) void {
pub fn zeroedAlloc(n: usize) AllocError![]align(page_size) u8 {
const ret = try alloc(n);
- const satp = instructions.satp.read();
+ const satp = riscv.satp.read();
if (satp.mode != .bare) {
const page_table: *Table = @ptrFromInt(satp.ppn << 12);
const start = @intFromPtr(ret.ptr);
@@ -590,7 +590,7 @@ pub fn zeroedAlloc(n: usize) AllocError![]align(page_size) u8 {
try page_table.identityMapRange(start, end, EntryFlags.readWrite);
}
- // Write zeroes in batches of 64-bit to reduce the amount of store instructions.
+ // Write zeroes in batches of 64-bit to reduce the amount of store riscv.
// The remainder / remaining bytes don't need to be accounted for
// because page_size (4096) is divisible by 8.
@@ -605,7 +605,7 @@ pub fn zeroedAlloc(n: usize) AllocError![]align(page_size) u8 {
}
pub fn setUserMemoryAccess(enable: bool) void {
- var sstatus = instructions.sstatus.read();
+ var sstatus = riscv.sstatus.read();
sstatus.supervisor_user_memory_access = @bitCast(enable);
- instructions.sstatus.write(sstatus);
+ riscv.sstatus.write(sstatus);
}