diff options
| author | Carlos Maiolino <[email protected]> | 2025-07-10 22:18:39 +0200 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-07-10 22:18:39 +0200 |
| commit | 8c6fc0c15415b32080a848bbde640e104098cf13 (patch) | |
| tree | 04a21bd28f9dc82c8e216390d6208ed93b9bcd11 /riscv/riscv-probe/examples/memory | |
Initial drop
Add some riscv code
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'riscv/riscv-probe/examples/memory')
| -rw-r--r-- | riscv/riscv-probe/examples/memory/main.c | 17 | ||||
| -rw-r--r-- | riscv/riscv-probe/examples/memory/rules.mk | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/riscv/riscv-probe/examples/memory/main.c b/riscv/riscv-probe/examples/memory/main.c new file mode 100644 index 0000000..01c5d0b --- /dev/null +++ b/riscv/riscv-probe/examples/memory/main.c @@ -0,0 +1,17 @@ +#include "femto.h" +#ifdef __riscv +#include "arch/riscv/encoding.h" +#include "arch/riscv/machine.h" +#endif + +extern char _memory_start; + +int main(int argc, char **argv) +{ +#ifdef __riscv + memory_info_t info = memory_probe(); + printf("memory_start=0x%lx - 0x%lx\n", info.start, info.end); +#else + puts("architecture-not-supported"); +#endif +} diff --git a/riscv/riscv-probe/examples/memory/rules.mk b/riscv/riscv-probe/examples/memory/rules.mk new file mode 100644 index 0000000..1d0ad8c --- /dev/null +++ b/riscv/riscv-probe/examples/memory/rules.mk @@ -0,0 +1 @@ +memory_objs = main.o |
