- removed malloc

git-svn-id: http://moon:8086/svn/mips@166 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2021-04-09 07:31:59 +00:00
parent bd71606a4d
commit 98021f3df4
2 changed files with 3 additions and 21 deletions
+1 -1
View File
@@ -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
+2 -20
View File
@@ -1,6 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#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 ");