diff --git a/board-qemu/config b/board-qemu/config index f1940914..07ed2fa5 100644 --- a/board-qemu/config +++ b/board-qemu/config @@ -1,7 +1,7 @@ BOARD=qemu TARG=ppc64 export FLAG="-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C " -export CPUARCH=ppcp7 -export CPUARCHDEF=-DCPU_PPCP7 +export CPUARCH=ppc970 +export CPUARCHDEF=-DCPU_PPC970 #export SNK_BIOSEMU_APPS=1 FLASH_SIZE=8388608 diff --git a/include/ppc970/cache.h b/include/ppc970/cache.h index 500182ea..7d85c069 100644 --- a/include/ppc970/cache.h +++ b/include/ppc970/cache.h @@ -88,8 +88,9 @@ cache_inhibited_access(uint64_t, 64) { \ t *s1 = (s), *d1 = (d); \ register t tmp; \ - while (size > 0) { \ - tmp = *s1++; SET_CI; *d1++ = tmp; CLR_CI; size -= sizeof(t); \ + register t tmp_size = size; \ + while (tmp_size > 0) { \ + tmp = *s1++; SET_CI; *d1++ = tmp; CLR_CI; tmp_size -= sizeof(t); \ } \ } diff --git a/include/ppc970/cpu.h b/include/ppc970/cpu.h index 0e66dff3..c06087e4 100644 --- a/include/ppc970/cpu.h +++ b/include/ppc970/cpu.h @@ -108,6 +108,9 @@ static inline void flush_cache(void* r, long n) asm volatile(EXPAND(FLUSH_CACHE(%0, %1)) : "+r"(r), "+r"(n) :: "memory", "cc", "r0", "ctr"); } +#define SET_CI set_ci() +#define CLR_CI clr_ci() + #endif /* __ASSEMBLER__ */ #endif diff --git a/lib/libhvcall/rfill.c b/lib/libhvcall/rfill.c index 377fb892..9424ed16 100644 --- a/lib/libhvcall/rfill.c +++ b/lib/libhvcall/rfill.c @@ -15,7 +15,10 @@ #include #include -typedef unsigned long type_u; +typedef unsigned char type_c; // 1 byte +typedef unsigned short type_w; // 2 bytes +typedef unsigned int type_l; // 4 bytes +typedef unsigned long type_u; // cell size /** * fast_rfill is the implementation of the FAST_RFILL macro with h-calls. diff --git a/make.rules b/make.rules index 885eea3f..8c5319ec 100644 --- a/make.rules +++ b/make.rules @@ -16,7 +16,7 @@ # CROSS is the prefix of your cross-compiler. # You can override this variable in your environment (export CROSS=...). -ARCH := $(shell uname -p) +ARCH := $(shell uname -m) # Auto-detect ppc64 ifeq (ppc64,$(findstring ppc64,$(ARCH))) @@ -26,7 +26,7 @@ ifeq (ppc64,$(findstring ppc64,$(ARCH))) endif CROSS ?= else -CROSS ?= powerpc64-linux- +CROSS ?= powerpc64-unknown-linux-gnu- endif CELLSIZE ?= 64