Clean up some variouis compiler problems using SDCC to compiler Z180.

This commit is contained in:
Gregory Nutt 2019-06-03 18:16:23 -06:00
parent 7ab149d8e9
commit 622c272ea3
11 changed files with 94 additions and 41 deletions

View File

@ -47,21 +47,5 @@
#include <nuttx/irq.h>
#include <arch/chip/irq.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#endif /* __ARCH_Z80_INCLUDE_IRQ_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/include/z180/limits.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -73,6 +73,10 @@
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295UL
#define LLONG_MIN (-LLONG_MAX - 1)
#define LLONG_MAX 9223372036854775807LL
#define ULLONG_MAX 18446744073709551615ULL
/* A pointer is 2 bytes */
#define PTR_MIN (-PTR_MAX - 1)

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/include/z180/types.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -80,6 +80,10 @@ typedef unsigned int _uint16_t;
typedef signed long _int32_t;
typedef unsigned long _uint32_t;
typedef signed long long _int64_t;
typedef unsigned long long _uint64_t;
#define __INT64_DEFINED
/* A pointer is 2 bytes */
typedef signed int _intptr_t;

View File

@ -47,6 +47,8 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <arch/irq.h>
#include "chip/switch.h"
#include "up_internal.h"

View File

@ -44,9 +44,10 @@
#include <errno.h>
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/mm/gran.h>
#include <nuttx/irq.h>
#include <arch/irq.h>
#include <arch/io.h>
#include "up_internal.h"
@ -273,7 +274,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
/* Now allocate the physical memory to back up the address environment */
alloc = (uintptr_t)gran_alloc(npages);
alloc = (uintptr_t)gran_alloc(g_physhandle, npages);
if (alloc == NULL)
{
serr("ERROR: Failed to allocate %d pages\n", npages);
@ -522,7 +523,7 @@ int up_addrenv_coherent(FAR const group_addrenv_t *addrenv)
****************************************************************************/
int up_addrenv_clone(FAR const group_addrenv_t *src,
FAR group_addrenv_t *dest);
FAR group_addrenv_t *dest)
{
DEBUGASSERT(src && dest);
@ -582,7 +583,7 @@ int up_addrenv_attach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
*
****************************************************************************/
int up_addrenv_detach(FAR struct task_group_s *group, FAR struct tcb_s *tcb);
int up_addrenv_detach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
{
/* There is nothing that needs to be done */

View File

@ -44,9 +44,12 @@
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/sched.h>
#include <nuttx/irq.h>
#include "chip/switch.h"
#include <arch/irq.h>
#include "switch.h"
#include "sched/sched.h"
#include "up_internal.h"
@ -58,7 +61,8 @@
* Name: z180_sigsetup
****************************************************************************/
static void z180_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs)
static void z180_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver,
FAR chipreg_t *regs)
{
/* Save the return address and interrupt state. These will be restored by
* the signal trampoline after the signals have been delivered.

View File

@ -137,17 +137,32 @@ that connects to the P112 via the Z85230 ESCC channel A.
Status
======
2014-8-22: After some time idling away, I tried rebuilding with Windows 8, the latest MinGW
and the latest SDCC. I fixed a few things but there a still a few issues. The last "show
stopper" before I gave up for now was during building dependencies:
2014-8-22: After some time idling away, I tried rebuilding with Windows 8,
the latest MinGW and the latest SDCC. I fixed a few things but there a
still a few issues. The last "show stopper" before I gave up for now was
during building dependencies:
ASlink-Error-<cannot open> : "bin/mm_initialize.rel"
ASlink-Error-<cannot open> : "bin/mm_initialize.rel"
Clearly there is something wrong with the command line options given to SDCC because it is
trying to compile and link when we really only want dependencies. I did not spend very much
time trying to solve the problem; I assume that it is not too difficult.
Clearly there is something wrong with the command line options given to
SDCC because it is trying to compile and link when we really only want
dependencies. I did not spend very much time trying to solve the problem;
I assume that it is not too difficult.
2014-9-15: There has been a lot of change to the address environment APIs with the inegration
of address environments on the Cortex-A. It is likely that there is some breakage due to
incompatibilities with the Z180's mini-MMU.
2014-9-15: There has been a lot of change to the address environment APIs
with the integration of address environments on the Cortex-A. It is
likely that there is some breakage due to incompatibilities with the
Z180's mini-MMU.
Known compilation problems with SDCC:
Known compilation problems:
CC: stdlib/lib_strtof.c
stdlib/lib_strtof.c:62:6: warning: #warning "Size of exponent is unknown"
stdlib/lib_strtof.c:76: error 122: dividing by ZERO
stdlib/lib_strtof.c:102: error 122: dividing by ZERO
stdlib/lib_strtof.c:76: error 122: dividing by ZERO
Workaround: Remove lib_strtof.c from libs/libc/stdlib/Make.defs

View File

@ -1,2 +1,16 @@
/.depend
/Make.dep
/.depend
/up_mem.h
/*.sym
/*.asm
/*.rel
/*.lst
/*.adb
/*.rst
/*.lib
/*.lnk
/*.map
/*.mem
/*.ihx
/*.hex

View File

@ -232,3 +232,5 @@ Known compilation problems:
Workaround: Remove lib_strtof.c from libs/libc/stdlib/Make.defs
In arch/z80/src/z180: error 26: '_cbr' not a structure/union member

View File

@ -140,7 +140,9 @@
* representable finite floating-point number, emax.
*/
#define FLT_MAX_EXP 128
#ifndef FLT_MAX_EXP /* May be defined in system header */
# define FLT_MAX_EXP 128
#endif
#ifdef CONFIG_HAVE_DOUBLE
# define DBL_MAX_EXP 1024
@ -158,7 +160,9 @@
* representable finite floating-point numbers.
*/
#define FLT_MAX_10_EXP 38 /* 37 */
#ifndef FLT_MAX_10_EXP /* May be defined in system header */
# define FLT_MAX_10_EXP 38 /* 37 */
#endif
#ifdef CONFIG_HAVE_DOUBLE
# define DBL_MAX_10_EXP 308 /* 37 */
@ -174,7 +178,9 @@
/* Maximum representable finite floating-point number. */
#define FLT_MAX 3.40282347e+38F /* 1E+37 */
#ifndef FLT_MAX_EXP /* May be defined in system header */
# define FLT_MAX 3.40282347e+38F /* 1E+37 */
#endif
#ifdef CONFIG_HAVE_DOUBLE
# define DBL_MAX 1.7976931348623157e+308 /* 1E+37 */
@ -192,7 +198,9 @@
* representable in the given floating-point type, b1-p.
*/
#define FLT_EPSILON 1.1920929e-07F /* 1E-5 */
#ifndef FLT_EPSILON /* May be defined in system header */
# define FLT_EPSILON 1.1920929e-07F /* 1E-5 */
#endif
#ifdef CONFIG_HAVE_DOUBLE
# define DBL_EPSILON 2.2204460492503131e-16 /* 1E-9 */
@ -208,10 +216,12 @@
/* Minimum normalized positive floating-point number, bemin -1. */
#define FLT_MIN 1.17549435e-38F /* 1E-37 */
#ifndef FLT_EPSILON /* May be defined in system header */
# define FLT_MIN 1.17549435e-38F /* 1E-37 */
#endif
#ifdef CONFIG_HAVE_DOUBLE
#define DBL_MIN 2.2250738585072014e-308 /* 1E-37 */
# define DBL_MIN 2.2250738585072014e-308 /* 1E-37 */
#else
# define DBL_MIN FLT_MIN
#endif

View File

@ -73,6 +73,7 @@
void psignal(int signum, FAR const char *message)
{
#if CONFIG_NFILE_STREAMS > 0
/* For now, just a brainless write to stderr (fd == 2). C buffered I/O is
* used!
*/
@ -85,6 +86,18 @@ void psignal(int signum, FAR const char *message)
{
(void)fprintf(stderr, "%s\n", strsignal(signum));
}
#else
/* No stderr! Write to whatever alternative console is available */
if (message != NULL)
{
(void)printf("%s: %s\n", message, strsignal(signum));
}
else
{
(void)printf("%s\n", strsignal(signum));
}
#endif
}
/****************************************************************************