From 147a9f219883c662d976ee89def8065cec0ba88c Mon Sep 17 00:00:00 2001 From: Toby Jaffey Date: Fri, 12 Dec 2025 15:56:47 +0000 Subject: [PATCH] Split includes. All code needs uvm32_sys.h, but uvm32_common_custom.h is optional (and has defs needed for demos) --- apps/rust-hello/build.rs | 2 +- apps/rust-hello/uvm32_headers.h | 2 ++ common/uvm32_common_custom.h | 3 ++- common/uvm32_sys.h | 9 ++++++++- precompiled/self.bin | Bin 5780 -> 5844 bytes 5 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 apps/rust-hello/uvm32_headers.h diff --git a/apps/rust-hello/build.rs b/apps/rust-hello/build.rs index 7883f81..4e50d21 100644 --- a/apps/rust-hello/build.rs +++ b/apps/rust-hello/build.rs @@ -6,7 +6,7 @@ fn main() { println!("cargo:rustc-link-arg-bin=rust-hello=-T../common/linker.ld"); let bindings = bindgen::Builder::default() - .header("../../common/uvm32_sys.h") + .header("uvm32_headers.h") .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate() .expect("Unable to generate bindings"); diff --git a/apps/rust-hello/uvm32_headers.h b/apps/rust-hello/uvm32_headers.h new file mode 100644 index 0000000..ed6218e --- /dev/null +++ b/apps/rust-hello/uvm32_headers.h @@ -0,0 +1,2 @@ +#include "../../common/uvm32_sys.h" +#include "../../common/uvm32_common_custom.h" diff --git a/common/uvm32_common_custom.h b/common/uvm32_common_custom.h index 82bb6f4..6739938 100644 --- a/common/uvm32_common_custom.h +++ b/common/uvm32_common_custom.h @@ -1,4 +1,5 @@ -// Definitions needed by both host and target +// Syscall definitions needed by both host and target for sample apps +// These are not required when building a custom host target code with uvm32 // syscalls for exposed host functions, start at 0 #define UVM32_SYSCALL_PUTC 0x00000000 diff --git a/common/uvm32_sys.h b/common/uvm32_sys.h index 0829864..7caa737 100644 --- a/common/uvm32_sys.h +++ b/common/uvm32_sys.h @@ -1,8 +1,15 @@ +#ifndef UVM32_SYS_H +#define UVM32_SYS_H 1 + +// Common definitions used by both uvm32.c and any code running inside VM + // System provided UVM32_SYSCALLs, start at 0x10000000 #define UVM32_SYSCALL_HALT 0x1000000 #define UVM32_SYSCALL_YIELD 0x1000001 #define UVM32_SYSCALL_STACKPROTECT 0x1000002 +// Address of External RAM, when offered by host #define UVM32_EXTRAM_BASE 0x10000000 -#include "uvm32_common_custom.h" +#endif + diff --git a/precompiled/self.bin b/precompiled/self.bin index d5be60a4d6e56e40f1e960be7550a5d5866dacfe..69db4b1d7f5ac432664644e82db998f594289c7a 100755 GIT binary patch delta 1189 zcmZ{kUr1AN6vxl+Uhj5Y*SSB5Qi7u^T46S@QYdOs#L6CwA}WlHMrC8=L-Z2iF8F6Y z1Z794hrk|8q~%zNc2IPVUb|q5VKLT`d(#W10O!W-#O>^JLi1Q@51fg z@o|S*TtwtnlxtmTeg4%%5gFV*vb(FXLK-^S)wX|+p|e87D$#W!YEA`yxh?P&fuw_C zo_v+7=U$wZWonU+V%uJ%cZq1Nl~OgauavNol&ByIwfwZiE#uVs_=r8!rr28hEOxe9 zDRgZ@ato1R#Y1|vlk|#Vnosr2$=F*x!@>;#y2nEL77O8?blHG_STW5kO)S@_KS=g> zYBMEj#(iV-PmS`D;<0Z&-P7ks!V*+E$V`A3!xUpSoVhuX&L)O7sg$r_>W&UA-ac+l zvAk0J?nI_Jm0Ut|ekvVuB|kw5C5p+=`>YX;jYjUt)l$zKd*vP1^b<)ob0#aRQ#|lB*f`>|Aq}hoaF(n zMx5hWZLetL@&a9)XFt{eM+!EJAa@p&i3{A1NQmFTzR2IPUW#k>&r;!ZGV@>gWk*;_ zrn$*kDZ+f$xm_w-;6Z1tXyQfZPH~0HUFGoxS6W2VG8tMP8KuAvsz4p^ILIggi-lyU z*tddGe3UG8Ilec?_vQEvIeu`}kNztdLEu(C8DBuQNeXrvkPRY0&`!o6=mj3vDpRl@ z;H(!s2WIXd_A#JpWH>+x@PImS7&L;1pjV5M@eIZQ7zC4G8cY=+0fl{F2=;C4ufQT` z0%KqjWW|_*OiVG^yR)#@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