mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
Add system for memory mapping a block of memory from the host.
This commit is contained in:
parent
8802b4c268
commit
b55c2bc88a
9 changed files with 253 additions and 1 deletions
31
test/extram/rom/rom.c
Normal file
31
test/extram/rom/rom.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "uvm32_target.h"
|
||||
#include "../shared.h"
|
||||
|
||||
void main(void) {
|
||||
switch(syscall(SYSCALL_PICKTEST, 0, 0)) {
|
||||
case TEST1: {
|
||||
uint32_t *p = (uint32_t *)UVM32_EXTRAM_BASE;
|
||||
|
||||
// read memory and print via syscall
|
||||
printdec(*p);
|
||||
// modify memory
|
||||
*p = *p * 2;
|
||||
} break;
|
||||
case TEST2: {
|
||||
uint32_t *p = (uint32_t *)UVM32_EXTRAM_BASE;
|
||||
printdec(p[32]); // past the end
|
||||
} break;
|
||||
case TEST3: {
|
||||
uint32_t *p = (uint32_t *)UVM32_EXTRAM_BASE;
|
||||
p[32] = 1234; // past the end
|
||||
} break;
|
||||
case TEST4: {
|
||||
uint32_t *p = (uint32_t *)UVM32_EXTRAM_BASE;
|
||||
p[0] = 1234; // good write
|
||||
yield(0);
|
||||
} break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue