compile -mshort for xhdi_interface() _only_ (fixed Makefile)

This commit is contained in:
Markus Fröschle
2013-05-02 05:10:19 +00:00
parent 1e3221a84e
commit 167f902a84
3 changed files with 7 additions and 8 deletions

View File

@@ -139,8 +139,8 @@ $(LIBBAS): $(OBJS)
$(AR) rv $@ $(OBJS)
$(RANLIB) $@
# compile xhdi_sd.c with -mshort to adhere to TOS argument passing conventions
$(OBJDIR)/xhdi_sd.o: CFLAGS += -mshort
# compile xhdi_interface.c with -mshort to adhere to TOS argument passing conventions
$(OBJDIR)/xhdi_interface.o: CFLAGS += -mshort
# compile init_fpga with -mbitfield for testing purposes
#$(OBJDIR)/init_fpga.o: CFLAGS += -mbitfield

View File

@@ -315,8 +315,7 @@ uint32_t xhdi_call(int xhdi_fun, ...)
break;
default:
;
break;
}
xprintf("unknown XHDI function %d\r\n");
return EINVFN;

View File

@@ -17,17 +17,17 @@ static xhdi_call_fun old_vector = NULL;
__attribute__((__interrupt__)) xhdi_call_fun xhdi_sd_install(xhdi_call_fun ov)
{
old_vector = ov;
long *_drvbits = 0x4c2;
uint32_t *_drvbits = (uint32_t *) 0x4c2;
/* THIS does not work: return (xhdi_call_fun) &xhdi_call; */
__asm__ __volatile__ (
"move.l %[xhdi_call],d1\n\t"
"move.l d1,(sp)\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)
: "d1","memory");
*_drvbits |= (1 << ('O' - 'A'));
*_drvbits |= (1 << ('S' - 'A'));
return (xhdi_call_fun) xhdi_call;
}
@@ -71,7 +71,7 @@ uint32_t xhdi_eject(UINT16_T major, UINT16_T minor, UINT16_T do_eject, UINT16_T
uint32_t xhdi_drivemap(void)
{
long map = (1 << ('O' - 'A'));
uint32_t map = (1 << ('S' - 'A'));
return map;
}