diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2010-09-22 12:58:08 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2010-09-22 12:58:08 +0100 |
commit | f770d350012df2f7e3a9418a7c2f9bcb39f824b4 (patch) | |
tree | 2b98364b4283ae8794c2f10f045ab645edeeda31 | |
parent | 9a7806e41fcb2482d54b2902455567867fcad06d (diff) |
Add a simple test image for ARM, and make the makefile only build the right one for the architecture.
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | test_arm.s | 16 |
2 files changed, 24 insertions, 2 deletions
@@ -4,7 +4,7 @@ ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) PROG=risu SRCS=risu.c comms.c risu_$(ARCH).c HDRS=risu.h -BINS=test_i386.bin +BINS=test_$(ARCH).bin OBJS=$(SRCS:.c=.o) @@ -16,8 +16,14 @@ $(PROG): $(OBJS) %.o: %.c $(HDRS) $(CC) -g -Wall -Werror -o $@ -c $< -%.bin: %.s +%_i386.bin: %_i386.s nasm -f bin -o $@ $< +%_arm.bin: %_arm.elf + objcopy -O binary $< $@ + +%_arm.elf: %_arm.s + as -o $@ $< + clean: rm -f $(PROG) $(OBJS) $(BINS) diff --git a/test_arm.s b/test_arm.s new file mode 100644 index 0000000..4fdcb3d --- /dev/null +++ b/test_arm.s @@ -0,0 +1,16 @@ +/* magic instruction to force ARM mode whether we were in ARM or Thumb before */ +.int 0xe0004778 +/* Initialise the gp regs */ +add r0, pc, #4 +ldmia r0, {r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r14} +b next +.int 0,1,2,3,4,5,6,7,8,9,10,11,12,14 +next: +/* do compare. + * The space 0xE7F___F_ is guaranteed to always UNDEF + * and not to be allocated for insns in future architecture + * revisions. + */ +.int 0xe7fe5af0 +/* exit test */ +.int 0xe7fe5af1 |