From 4884ee51d9beda7fba8907a6e2511ef239d10824 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 2 Aug 2024 17:26:24 +0800 Subject: [PATCH] reserve the top-most word of RAM as a "gutter" for filtered DMA it's much easier to gutter a blocked AXI transaction, than to squash it. So we reserve a region of memory as a gutter for blocked transactions. --- loader/src/asm.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/src/asm.rs b/loader/src/asm.rs index dbd23e24f..d91f863e3 100644 --- a/loader/src/asm.rs +++ b/loader/src/asm.rs @@ -29,6 +29,8 @@ pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) { // Place the stack pointer at the end of RAM "mv sp, {ram_top}", + // subtract four from sp to make room for a DMA "gutter" + "addi sp, sp, -4", // Install a machine mode trap handler "la t0, abort",