diff options
-rw-r--r-- | examples/zero_stream/src/main.zig | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/examples/zero_stream/src/main.zig b/examples/zero_stream/src/main.zig index 1536157..8e529cb 100644 --- a/examples/zero_stream/src/main.zig +++ b/examples/zero_stream/src/main.zig @@ -9,15 +9,6 @@ const Result = extern struct { status: usize, }; -// The buffer has to be a global variable -// because a stack buffer would be mapped to different physical memory addresses -// in the driver thread compared to the main thread due to paging -// (because each thread has its own stack). -// This will be fixed in a future kernel version because the same root cause -// also prevents a distinct driver process from accessing the memory -// (its attempt to modify the buffer would raise a page fault). -var buf = [8]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; - export fn _start() void { main(); } @@ -73,6 +64,7 @@ pub fn main() void { : "a7" ); + var buf = [8]u8{ 1, 2, 3, 4, 5, 6, 7, 8 }; asm volatile ( \\ li a7, 100009 \\ ecall |