summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/arch/z80/src/Makefile.zdsii28
-rw-r--r--nuttx/arch/z80/src/common/up_allocateheap.c27
-rw-r--r--nuttx/arch/z80/src/common/up_assert.c1
3 files changed, 30 insertions, 26 deletions
diff --git a/nuttx/arch/z80/src/Makefile.zdsii b/nuttx/arch/z80/src/Makefile.zdsii
index afb1b07a1..199293ef3 100644
--- a/nuttx/arch/z80/src/Makefile.zdsii
+++ b/nuttx/arch/z80/src/Makefile.zdsii
@@ -77,30 +77,12 @@ $(AOBJS) $(HEAD_AOBJ): %$(OBJEXT): %$(ASMEXT)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, `cygpath -w $<`, $@)
-up_mem.h:
- @echo "#ifndef __UP_MEM_H" >up_mem.h
- @echo "#define __UP_MEM_H" >>up_mem.h
- @echo "" >>up_mem.h
- @echo "#include <nuttx/config.h>" >>up_mem.h
- @echo "" >>up_mem.h
- @echo "#ifndef CONFIG_HEAP1_BASE" >>up_mem.h
- @echo " extern far unsigned long far_heapbot;" >>up_mem.h
- @echo "# define CONFIG_HEAP1_BASE ((uint16)&far_heapbot)" >>up_mem.h
- @echo "#endif" >>up_mem.h
- @echo "" >>up_mem.h
- @echo "#ifndef CONFIG_HEAP1_END" >>up_mem.h
- @echo " extern far unsigned long far_heaptop;" >>up_mem.h
- @echo "# define CONFIG_HEAP1_END ((uint16)&far_heaptop)" >>up_mem.h
- @echo "#endif" >>up_mem.h
- @echo "" >>up_mem.h
- @echo "#endif /* __UP_MEM_H */" >>up_mem.h
-
-libarch$(LIBEXT): up_mem.h $(OBJS)
+libarch$(LIBEXT): $(OBJS)
@( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
-board/libboard$(LIBEXT): up_mem.h
+board/libboard$(LIBEXT):
@$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT)
nuttx.linkcmd: $(LINKCMDTEMPLATE)
@@ -116,11 +98,11 @@ nuttx.linkcmd: $(LINKCMDTEMPLATE)
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/csioLDD$(LIBEXT)}\", \\" >>nuttx.linkcmd
@echo " \"${shell cygpath -w $(ZDSSTDLIBDIR)/zsldevinitdummy.lib$(LIBEXT)}\" \\" >>nuttx.linkcmd
-nuttx$(EXEEXT): up_mem.h $(HEAD_AOBJ) board/libboard$(LIBEXT) nuttx.linkcmd
+nuttx$(EXEEXT): $(HEAD_AOBJ) board/libboard$(LIBEXT) nuttx.linkcmd
@echo "LD: nuttx.hex"
@$(LD) $(LDFLAGS)
-.depend: Makefile up_mem.h chip/Make.defs $(DEPSRCS)
+.depend: Makefile chip/Make.defs $(DEPSRCS)
@if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
fi
@@ -134,7 +116,7 @@ clean:
$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
fi
@rm -f libarch$(LIBEXT) *~ .*.swp
- @rm -f nuttx.linkcmd up_mem.h *.asm *.tmp *.map
+ @rm -f nuttx.linkcmd *.asm *.tmp *.map
$(call CLEAN)
distclean: clean
diff --git a/nuttx/arch/z80/src/common/up_allocateheap.c b/nuttx/arch/z80/src/common/up_allocateheap.c
index 4b21b575c..270e3e0d9 100644
--- a/nuttx/arch/z80/src/common/up_allocateheap.c
+++ b/nuttx/arch/z80/src/common/up_allocateheap.c
@@ -46,12 +46,35 @@
#include "up_arch.h"
#include "up_internal.h"
-#include "up_mem.h"
+
+/* For the SDCC toolchain, the arch/z80/src/Makefile will parse the map file
+ * to determin how much memory is available for the heap. This parsed data
+ * is provided via the auto-generated file up_mem.h
+ */
+
+#ifdef SDCC
+# include "up_mem.h"
+#endif
/****************************************************************************
- * Private Definitions
+ * Definitions
****************************************************************************/
+/* For the ZiLOG ZDS-II toolchain(s), the heap will be set using linker-
+ * defined values.
+ */
+
+#ifdef __ZILOG__
+# ifndef CONFIG_HEAP1_BASE
+ extern far unsigned long far_heapbot;
+# define CONFIG_HEAP1_BASE ((uint16)&far_heapbot)
+# endif
+# ifndef CONFIG_HEAP1_END
+ extern far unsigned long far_heaptop;
+# define CONFIG_HEAP1_END ((uint16)&far_heaptop)
+# endif
+#endif
+
/****************************************************************************
* Private Data
****************************************************************************/
diff --git a/nuttx/arch/z80/src/common/up_assert.c b/nuttx/arch/z80/src/common/up_assert.c
index b409df425..d7243e716 100644
--- a/nuttx/arch/z80/src/common/up_assert.c
+++ b/nuttx/arch/z80/src/common/up_assert.c
@@ -51,7 +51,6 @@
#include "up_arch.h"
#include "os_internal.h"
#include "up_internal.h"
-#include "up_mem.h"
/****************************************************************************
* Definitions