Split includes.

All code needs uvm32_sys.h, but uvm32_common_custom.h is optional (and has defs needed for demos)
This commit is contained in:
Toby Jaffey 2025-12-12 15:56:47 +00:00
parent ef948e9797
commit 147a9f2198
5 changed files with 13 additions and 3 deletions

View file

@ -6,7 +6,7 @@ fn main() {
println!("cargo:rustc-link-arg-bin=rust-hello=-T../common/linker.ld"); println!("cargo:rustc-link-arg-bin=rust-hello=-T../common/linker.ld");
let bindings = bindgen::Builder::default() let bindings = bindgen::Builder::default()
.header("../../common/uvm32_sys.h") .header("uvm32_headers.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate() .generate()
.expect("Unable to generate bindings"); .expect("Unable to generate bindings");

View file

@ -0,0 +1,2 @@
#include "../../common/uvm32_sys.h"
#include "../../common/uvm32_common_custom.h"

View file

@ -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 // syscalls for exposed host functions, start at 0
#define UVM32_SYSCALL_PUTC 0x00000000 #define UVM32_SYSCALL_PUTC 0x00000000

View file

@ -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 // System provided UVM32_SYSCALLs, start at 0x10000000
#define UVM32_SYSCALL_HALT 0x1000000 #define UVM32_SYSCALL_HALT 0x1000000
#define UVM32_SYSCALL_YIELD 0x1000001 #define UVM32_SYSCALL_YIELD 0x1000001
#define UVM32_SYSCALL_STACKPROTECT 0x1000002 #define UVM32_SYSCALL_STACKPROTECT 0x1000002
// Address of External RAM, when offered by host
#define UVM32_EXTRAM_BASE 0x10000000 #define UVM32_EXTRAM_BASE 0x10000000
#include "uvm32_common_custom.h" #endif

Binary file not shown.