Fixes for z80 compilation with SDCC toolchain. There are still a few header file and linker issues

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5149 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-09-13 22:04:47 +00:00
parent 3a262416d6
commit e75fbadb33
3 changed files with 35 additions and 13 deletions

View File

@ -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) | \

View File

@ -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 <gnutt@nuttx.org>
*
* 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;
}

View File

@ -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 <gnutt@nuttx.org>
*
* 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;
}