From 62c264975f01030d26d5da3dcc4cc4acdfbeddca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Fri, 10 May 2013 13:16:00 +0000 Subject: [PATCH] modified entry point for XHDI routines --- BaS_gcc/Makefile | 3 ++- BaS_gcc/bas.lk.in | 1 + BaS_gcc/include/xhdi_sd.h | 2 +- BaS_gcc/sources/xhdi_sd.c | 4 ++-- BaS_gcc/sources/xhdi_vec.S | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 BaS_gcc/sources/xhdi_vec.S diff --git a/BaS_gcc/Makefile b/BaS_gcc/Makefile index 727b9ff..f31b873 100644 --- a/BaS_gcc/Makefile +++ b/BaS_gcc/Makefile @@ -81,7 +81,8 @@ ASRCS= \ $(SRCDIR)/mmu.S \ $(SRCDIR)/exceptions.S \ $(SRCDIR)/supervisor.S \ - $(SRCDIR)/illegal_instruction.S + $(SRCDIR)/illegal_instruction.S \ + $(SRCDIR)/xhdi_vec.S COBJS=$(patsubst $(SRCDIR)/%.o,$(OBJDIR)/%.o,$(patsubst %.c,%.o,$(CSRCS))) AOBJS=$(patsubst $(SRCDIR)/%.o,$(OBJDIR)/%.o,$(patsubst %.S,%.o,$(ASRCS))) diff --git a/BaS_gcc/bas.lk.in b/BaS_gcc/bas.lk.in index 667f3b8..bcb33ae 100644 --- a/BaS_gcc/bas.lk.in +++ b/BaS_gcc/bas.lk.in @@ -46,6 +46,7 @@ SECTIONS objs/illegal_instruction.o(.text) objs/xhdi_sd.o(.text) objs/xhdi_interface.o(text) + objs/xhdi_vec.o(text) *(.data) *(.bss) diff --git a/BaS_gcc/include/xhdi_sd.h b/BaS_gcc/include/xhdi_sd.h index d05190d..e93c2d8 100644 --- a/BaS_gcc/include/xhdi_sd.h +++ b/BaS_gcc/include/xhdi_sd.h @@ -89,7 +89,7 @@ struct XHDICALL_args uint16_t opcode; }; -extern unsigned long xhdi_call(struct XHDICALL_args stack); +extern unsigned long xhdi_call(struct XHDICALL_args *stack); extern xhdi_call_fun xhdi_sd_install(xhdi_call_fun old_vector) __attribute__((__interrupt__)); diff --git a/BaS_gcc/sources/xhdi_sd.c b/BaS_gcc/sources/xhdi_sd.c index 0f5f99d..f4220f3 100644 --- a/BaS_gcc/sources/xhdi_sd.c +++ b/BaS_gcc/sources/xhdi_sd.c @@ -29,10 +29,10 @@ #define DRIVER_VERSION 0x130 - static BPB sd_bpb[4]; /* space for four partitions on SD card */ static xhdi_call_fun old_vector = NULL; +extern xhdi_call_fun xhdi_vec; __attribute__((__interrupt__)) xhdi_call_fun xhdi_sd_install(xhdi_call_fun ov) { @@ -43,7 +43,7 @@ __attribute__((__interrupt__)) xhdi_call_fun xhdi_sd_install(xhdi_call_fun ov) "move.l %[xhdi_call],d1\n\t" "move.l d1,(sp)\n\t" /* FIXME: dirty overwrite of saved register on stack with return value */ : /* output */ - : [xhdi_call]"g"(xhdi_call) + : [xhdi_call]"g"(xhdi_vec) : "d1","memory"); *_drvbits |= (uint32_t) 1 << ('S' - 'A'); diff --git a/BaS_gcc/sources/xhdi_vec.S b/BaS_gcc/sources/xhdi_vec.S new file mode 100644 index 0000000..9dd2f7f --- /dev/null +++ b/BaS_gcc/sources/xhdi_vec.S @@ -0,0 +1,15 @@ +// +// XHDI entry point +// + .extern _xhdi_call + .globl _xhdi_vec + +_xhdi_vec: + lea -12(sp),sp + movem.l d1/a0-a1,(sp) + pea 16(sp) + jsr _xhdi_call + addq.l #4,sp + movem.l (sp),d1/a0-a1 + lea 12(sp),sp + rts