dslinux/user/rtest Makefile rtest.c
amadeus
dslinux_amadeus at user.in-berlin.de
Sat Aug 19 22:14:09 CEST 2006
Update of /cvsroot/dslinux/dslinux/user/rtest
In directory antilope:/tmp/cvs-serv31946/user/rtest
Added Files:
Makefile rtest.c
Log Message:
add RAM test program
--- NEW FILE: Makefile ---
# uClinux Makefile for rtest
# ==========================
# name of the executable
EXEC = rtest
# object files needed for executable
OBJS = rtest.o
# includes
INCS =
# libraries to link with
# LDLIBS +=
# declare these targets as phony, so make will not try to look
# for files named like them:
.PHONY: all romfs clean
# 'all' is a phony target. It is called when the build process
# enters this directory and wants to build the program.
all: $(EXEC)
# This is the rule that build the mad player.
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
# The romfs target is also phony. It is used to copy your app
# into the DSLinux filesystem image.
romfs:
$(ROMFSINST) /bin/$(EXEC)
# clean is another phony target that removes every file generated
# during the build.
clean:
rm -f $(EXEC) *.elf *.gdb *.o
--- NEW FILE: rtest.c ---
#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
#define TESTADR ((volatile unsigned char *) 0x08000000)
#define TESTLEN 0x1000000;
int main(int argc, char **argv)
{
volatile unsigned char *p;
int i;
printf("RTEST RAM TEST Program\n");
p = TESTADR;
i = TESTLEN;
for ( ;i;i--) {
*p++ = (unsigned char) i;
}
printf("Write done\n");
p = TESTADR;
i = TESTLEN;
for ( ;i;i--) {
if (*p == (unsigned char)i)
;
else {
printf("Error: Adr %X, expect %X, got %X\n", (unsigned int) p, i & 0xFF, (int)*p);
}
p++;
}
printf("Read done\n");
return 0;
}
More information about the dslinux-commit
mailing list