diff --git a/src/asm/Makefile b/src/asm/Makefile index 7e0956d..c3fdfa5 100644 --- a/src/asm/Makefile +++ b/src/asm/Makefile @@ -10,7 +10,7 @@ OBJCOPY=mips-elf-objcopy OBJDUMP=mips-elf-objdump ROMGEN=romgen -CFLAGS := -march=$(TARGET) -L. -T link/link.ld -Wl,--gc-sections -G 0 +CFLAGS := -march=$(TARGET) -L. -T link/link.ld -Wl,--gc-sections -G 0 -O0 CFLAGS += -fno-exceptions -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -nostartfiles LIBS := -lsys -lc diff --git a/src/asm/testbench.c b/src/asm/testbench.c index 6c2bf93..9fa4cdb 100644 --- a/src/asm/testbench.c +++ b/src/asm/testbench.c @@ -1,6 +1,5 @@ #include #include -#include #include "libsys/utils.h" #define NO_ERROR 0x00000000 @@ -82,10 +81,9 @@ void PrintCPUinfo(void) int Test10_LoadStore() { - int *buf, i, result, data, err; + int buf[32*sizeof(int)], i, result, data, err; volatile int *pPtr; - buf = (int*)malloc(32*sizeof(int)); while(1) { err = TEST10_ERROR; @@ -197,7 +195,7 @@ int Test10_LoadStore() err = NO_ERROR; break; } - free(buf); + return err; } @@ -269,18 +267,10 @@ int Test12_MulDiv() int main (void) { int result, i, j, cnt; - volatile char *pUART_baud = (char*)0x80000009; volatile int *pReg = (int*)0x80000000; - volatile int *pReg_usec = (int*)0x80000010; - volatile int *pReg_sec = (int*)0x80000014; - time_t clock; - struct tm *pDate; -// *pUART_baud = 0x35/4; - PrintCPUinfo(); cnt = 0; -// *pReg_sec = 0x12345678; while (1) { *pReg = cnt & 0x3FFFFFFF; @@ -302,14 +292,6 @@ int main (void) print_word(cnt++); sputs(": Passed\r\n"); - clock = time(NULL); - pDate = gmtime(&clock); - print_byte(pDate->tm_hour); - sputs(":"); - print_byte(pDate->tm_min); - sputs(":"); - print_byte(pDate->tm_sec); - sputs("\r\n"); } *pReg = 0x40000000 | cnt; sputs("Failed with error ");