diff --git a/arch/z80/src/Makefile.sdcc b/arch/z80/src/Makefile.sdcc index d5ff3b79306..522c8d6f908 100644 --- a/arch/z80/src/Makefile.sdcc +++ b/arch/z80/src/Makefile.sdcc @@ -94,7 +94,7 @@ $(AOBJS) $(HEAD_OBJ): %$(OBJEXT): %$(ASMEXT) $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -# This is a kludge to work around some conflicting symbols in libsdcc.liXqueb +# This is a kludge to work around some conflicting symbols in libsdcc.lib $(SDCCLIBDIR)/myz80.lib: $(SDCCLIBDIR)/$(SDCCLIB) @cat $(SDCCLIBDIR)/$(SDCCLIB) | \ diff --git a/arch/z80/src/z80/z80_io.c b/arch/z80/src/z80/z80_io.c index cddaa6831f1..bdd55bc6b80 100644 --- a/arch/z80/src/z80/z80_io.c +++ b/arch/z80/src/z80/z80_io.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z80/z80_io.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,9 +44,23 @@ #include "up_internal.h" /**************************************************************************** - * Private Definitions + * Pre-processor Definitions ****************************************************************************/ +#undef ASM +#undef ENDASM +#undef NAKED + +#ifdef CONFIG_SDCC_OLD +# define ASM _asm +# define ENDASM _endasm +# define NAKED +#else +# define ASM __asm +# define ENDASM __endasm +# define NAKED __naked +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -69,11 +83,11 @@ void outp(char p, char c) { - _asm + ASM ld c, 4(ix) ; port ld a, 5(ix) ; value out (c), a - _endasm; + ENDASM; } @@ -85,10 +99,10 @@ void outp(char p, char c) * ****************************************************************************/ -char inp(char p) +char inp(char p) NAKED { - _asm + ASM ld c, 4(ix) ;port in l, (c) - _endasm; + ENDASM; } diff --git a/arch/z80/src/z80/z80_irq.c b/arch/z80/src/z80/z80_irq.c index 08b426235d6..87ea7063ac5 100644 --- a/arch/z80/src/z80/z80_irq.c +++ b/arch/z80/src/z80/z80_irq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z80/z80_irq.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,14 @@ * Private Definitions ****************************************************************************/ +#ifdef CONFIG_SDCC_OLD +# define ASM _asm +# define ENDASM _endasm +#else +# define ASM __asm +# define ENDASM __endasm +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -80,13 +88,13 @@ volatile chipreg_t *current_regs; irqstate_t irqsave(void) __naked { - _asm + ASM ld a, i ; AF Parity bit holds interrupt state di ; Interrupts are disabled push af ; Return AF in HL pop hl ; ret ; - _endasm; + ENDASM; } /**************************************************************************** @@ -99,7 +107,7 @@ irqstate_t irqsave(void) __naked void irqrestore(irqstate_t flags) __naked { - _asm + ASM di ; Assume disabled pop hl ; HL = return address pop af ; AF Parity bit holds interrupt state @@ -109,5 +117,5 @@ statedisable: push af ; Restore stack push hl ; ret ; and return - _endasm; + ENDASM; }