forked from PX4/NuttX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
patacongo
committed
Sep 13, 2012
1 parent
3e7c5c1
commit 3fcb8d9
Showing
35 changed files
with
282 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* | ||
* 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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
* | ||
* 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 @@ void irqrestore(irqstate_t flags) __naked | |
push af ; Restore stack | ||
push hl ; | ||
ret ; and return | ||
_endasm; | ||
ENDASM; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/************************************************************ | ||
* board/board.h | ||
* configs/xtrs/include/board.h | ||
* | ||
* Copyright (C) 2008 Gregory Nutt. All rights reserved. | ||
* Author: Gregory Nutt <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
############################################################################ | ||
# configs/xtrs/Make.defs | ||
# configs/xtrs/nsh/Make.defs | ||
# | ||
# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. | ||
# Author: Gregory Nutt <[email protected]> | ||
|
@@ -36,27 +36,38 @@ | |
include ${TOPDIR}/.config | ||
include ${TOPDIR}/tools/Config.mk | ||
|
||
ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") | ||
CROSSDEV = | ||
CC = sdcc | ||
CPP = sdcpp | ||
AR = sdcclib -a | ||
|
||
ifeq ($(CONFIG_SDCC_OLD),y) | ||
|
||
LD = link-z80 | ||
AS = as-z80 | ||
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent | ||
|
||
else | ||
|
||
LD = sdldz80 | ||
AS = sdasz80 | ||
ARCHCPUFLAGS = -mz80 | ||
|
||
endif | ||
|
||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) | ||
ARCHOPTIMIZATION = --debug | ||
else | ||
ARCHOPTIMIZATION = | ||
endif | ||
|
||
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent | ||
ARCHPICFLAGS = | ||
ARCHWARNINGS = | ||
ARCHPICFLAGS = | ||
ARCHWARNINGS = | ||
ARCHDEFINES = | ||
ARCHINCLUDES = -I. -I$(TOPDIR)/include | ||
|
||
CROSSDEV = | ||
CC = sdcc | ||
CPP = sdcpp | ||
LD = link-z80 | ||
AS = as-z80 | ||
AR = sdcclib -a | ||
ARCHINCLUDES = -I. -I$(TOPDIR)/include | ||
|
||
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ | ||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) | ||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) | ||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) | ||
ASFLAGS = -x -a -l -o -s | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
############################################################################ | ||
# sim/xtrs/nsh/defconfig | ||
# configs/xtrs/nsh/defconfig | ||
# | ||
# Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. | ||
# Author: Gregory Nutt <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
# xtrs/setenv.sh | ||
# configs/xtrs/nsh/setenv.sh | ||
# | ||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. | ||
# Author: Gregory Nutt <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
############################################################################ | ||
# configs/xtrs/Make.defs | ||
# configs/xtrs/ostest/Make.defs | ||
# | ||
# Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved. | ||
# Author: Gregory Nutt <[email protected]> | ||
|
@@ -36,27 +36,38 @@ | |
include ${TOPDIR}/.config | ||
include ${TOPDIR}/tools/Config.mk | ||
|
||
ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") | ||
CROSSDEV = | ||
CC = sdcc | ||
CPP = sdcpp | ||
AR = sdcclib -a | ||
|
||
ifeq ($(CONFIG_SDCC_OLD),y) | ||
|
||
LD = link-z80 | ||
AS = as-z80 | ||
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent | ||
|
||
else | ||
|
||
LD = sdldz80 | ||
AS = sdasz80 | ||
ARCHCPUFLAGS = -mz80 | ||
|
||
endif | ||
|
||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) | ||
ARCHOPTIMIZATION = --debug | ||
else | ||
ARCHOPTIMIZATION = | ||
endif | ||
|
||
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent | ||
ARCHPICFLAGS = | ||
ARCHWARNINGS = | ||
ARCHPICFLAGS = | ||
ARCHWARNINGS = | ||
ARCHDEFINES = | ||
ARCHINCLUDES = -I. -I$(TOPDIR)/include | ||
|
||
CROSSDEV = | ||
CC = sdcc | ||
CPP = sdcpp | ||
LD = link-z80 | ||
AS = as-z80 | ||
AR = sdcclib -a | ||
ARCHINCLUDES = -I. -I$(TOPDIR)/include | ||
|
||
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ | ||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) | ||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) | ||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) | ||
ASFLAGS = -x -a -l -o -s | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
# xtrs/setenv.sh | ||
# configs/xtrs/ostest/setenv.sh | ||
# | ||
# Copyright (C) 2008 Gregory Nutt. All rights reserved. | ||
# Author: Gregory Nutt <[email protected]> | ||
|
Oops, something went wrong.