merge in changes from default branch experimental_memory_mapper_v2

Fri, 18 Jan 2013 22:52:43 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Fri, 18 Jan 2013 22:52:43 +0000
branch
experimental_memory_mapper_v2
changeset 132
8a7dc9b5b1db
parent 128
3246b74d96bc
parent 131
21c770fcee50
child 133
84ed5ec1d1e0

merge in changes from default branch

src/memory.c file | annotate | diff | revisions
src/wd2010.c file | annotate | diff | revisions
     1.1 diff -r 3246b74d96bc -r 8a7dc9b5b1db TODO
     1.2 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 +++ b/TODO	Fri Jan 18 22:52:43 2013 +0000
     1.4 @@ -0,0 +1,6 @@
     1.5 +TODO -- things to check
     1.6 +
     1.7 +* Realtime clock
     1.8 +* WD2010 command handler logic
     1.9 +* Disabling page write protect logic allows userspace to run up but HDD won't mount
    1.10 +* DMA Page Fault issues (see wd2010.c and test code)
     2.1 diff -r 3246b74d96bc -r 8a7dc9b5b1db src/memory.c
     2.2 --- a/src/memory.c	Fri Jan 18 17:03:48 2013 +0000
     2.3 +++ b/src/memory.c	Fri Jan 18 22:52:43 2013 +0000
     2.4 @@ -11,7 +11,8 @@
     2.5  // The value which will be returned if the CPU attempts to read from empty memory
     2.6  // TODO (FIXME?) - need to figure out if R/W ops wrap around. This seems to appease the UNIX kernel and P4TEST.
     2.7  #define EMPTY 0xFFFFFFFFUL
     2.8 -// #define EMPTY 0x55555555UL
     2.9 +//#define EMPTY 0x55555555UL
    2.10 +//#define EMPTY 0x00000000UL
    2.11  
    2.12  /******************
    2.13   * Memory mapping
    2.14 @@ -742,10 +743,8 @@
    2.15  		uint32_t newAddr = MAP_ADDR(address);
    2.16  
    2.17  		if (newAddr <= 0x1fffff) {
    2.18 -			if (newAddr >= state.base_ram_size)
    2.19 -				return EMPTY & 0xffffffff;
    2.20 -			else
    2.21 -				return RD32(state.base_ram, newAddr, state.base_ram_size - 1);
    2.22 +			// Base memory wraps around
    2.23 +			return RD32(state.base_ram, newAddr, state.base_ram_size - 1);
    2.24  		} else {
    2.25  			if ((newAddr <= (state.exp_ram_size + 0x200000 - 1)) && (newAddr >= 0x200000))
    2.26  				return RD32(state.exp_ram, newAddr - 0x200000, state.exp_ram_size - 1);
    2.27 @@ -795,10 +794,8 @@
    2.28  		uint32_t newAddr = MAP_ADDR(address);
    2.29  
    2.30  		if (newAddr <= 0x1fffff) {
    2.31 -			if (newAddr >= state.base_ram_size)
    2.32 -				return EMPTY & 0xffff;
    2.33 -			else
    2.34 -				return RD16(state.base_ram, newAddr, state.base_ram_size - 1);
    2.35 +			// Base memory wraps around
    2.36 +			return RD16(state.base_ram, newAddr, state.base_ram_size - 1);
    2.37  		} else {
    2.38  			if ((newAddr <= (state.exp_ram_size + 0x200000 - 1)) && (newAddr >= 0x200000))
    2.39  				return RD16(state.exp_ram, newAddr - 0x200000, state.exp_ram_size - 1);
    2.40 @@ -848,10 +845,8 @@
    2.41  		uint32_t newAddr = MAP_ADDR(address);
    2.42  
    2.43  		if (newAddr <= 0x1fffff) {
    2.44 -			if (newAddr >= state.base_ram_size)
    2.45 -				return EMPTY & 0xff;
    2.46 -			else
    2.47 -				return RD8(state.base_ram, newAddr, state.base_ram_size - 1);
    2.48 +			// Base memory wraps around
    2.49 +			return RD8(state.base_ram, newAddr, state.base_ram_size - 1);
    2.50  		} else {
    2.51  			if ((newAddr <= (state.exp_ram_size + 0x200000 - 1)) && (newAddr >= 0x200000))
    2.52  				return RD8(state.exp_ram, newAddr - 0x200000, state.exp_ram_size - 1);
     3.1 diff -r 3246b74d96bc -r 8a7dc9b5b1db src/wd2010.c