Search
lxdream.org :: lxdream/src/aica/armmem.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/armmem.c
changeset 998:1754a8c6a9cf
prev968:6fb1481859a4
next1067:d3c00ffccfcd
author nkeynes
date Tue Mar 24 11:15:57 2009 +0000 (13 years ago)
permissions -rw-r--r--
last change Add preliminary implementation of the GDB remote debugging server - attaches to
either or both the SH4 and ARM
file annotate diff log raw
1.1 --- a/src/aica/armmem.c Thu Jan 15 11:23:20 2009 +0000
1.2 +++ b/src/aica/armmem.c Tue Mar 24 11:15:57 2009 +0000
1.3 @@ -264,3 +264,27 @@
1.4 {
1.5 arm_write_byte( addr, val );
1.6 }
1.7 +
1.8 +size_t arm_read_phys( unsigned char *buf, uint32_t addr, size_t length ) {
1.9 + if( addr < sizeof(aica_main_ram) ) {
1.10 + if( addr+length > sizeof(aica_main_ram) ) {
1.11 + length = sizeof(aica_main_ram) - addr;
1.12 + }
1.13 + memcpy( buf, &aica_main_ram[addr], length );
1.14 + return length;
1.15 + } else {
1.16 + return 0;
1.17 + }
1.18 +}
1.19 +
1.20 +size_t arm_write_phys( uint32_t addr, unsigned char *buf, size_t length ) {
1.21 + if( addr < sizeof(aica_main_ram) ) {
1.22 + if( addr+length > sizeof(aica_main_ram) ) {
1.23 + length = sizeof(aica_main_ram) - addr;
1.24 + }
1.25 + memcpy( &aica_main_ram[addr], buf, length );
1.26 + return length;
1.27 + } else {
1.28 + return 0;
1.29 + }
1.30 +}
1.31 \ No newline at end of file
.