lm32: port umon_apps/fatfs
authorMichael Walle <michael@walle.cc>
Sat, 15 May 2010 14:12:41 +0000 (16:12 +0200)
committerMichael Walle <michael@walle.cc>
Sat, 15 May 2010 14:12:41 +0000 (16:12 +0200)
umon_apps/fatfs/crt0_lm32.S [new file with mode: 0644]
umon_apps/fatfs/makefile

diff --git a/umon_apps/fatfs/crt0_lm32.S b/umon_apps/fatfs/crt0_lm32.S
new file mode 100644 (file)
index 0000000..d93674c
--- /dev/null
@@ -0,0 +1,14 @@
+#include "cfg.h"
+
+    .extern AppStack
+       .extern Cstart
+       .global start
+
+    /* Set stack pointer to end of AppStack and jump to Cstart:
+        */
+start:
+       mvhi sp, hi(AppStack + APPSTACKSIZE - 4)
+       ori sp, sp, lo(AppStack + APPSTACKSIZE -4)
+
+jump_to_c:
+    bi Cstart
index b53d0fe..1fb3977 100644 (file)
@@ -88,6 +88,12 @@ CPU                  := -D CPU_IS_68K=1
 LIBGCC         = /usr/lib/gcc-lib/m68k-elf/3.2/m5200/libgcc.a -L /usr/m68k-elf/lib/m5200
 endif
 
+ifeq ($(ARCH),LM32)
+TOOL_PREFIX    := lm32-elf
+CFLAGS         := -Wall -fno-builtin -mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled -msign-extend-enabled -g -c -I. -I $(FATFS)/
+CRT0           := crt0_lm32.o
+CPU                    := -D CPU_IS_LM32=1
+endif
 OBJS=$(CRT0) main.o monlib.o diskio.o ff.o sample.o cc932.o
 
 OPTIONS=cc932.o cc936.o cc949.o cc950.o ccsbcs.o syncobj.o
@@ -164,6 +170,9 @@ crt0_ppc.o: crt0_ppc.S
 crt0_sh2.o: crt0_sh2.S
        $(CC) $(CFLAGS) -o $@ crt0_sh2.S
 
+crt0_lm32.o: crt0_lm32.S
+       $(CC) $(CFLAGS) -o $@ crt0_lm32.S
+
 main.o: main.c 
        $(CC) $(CFLAGS) -D MONCOMPTR=$(MONCOMPTR) -o $@ main.c