A few more fixes for compilation with current SDCC compiler

This commit is contained in:
Gregory Nutt 2017-10-01 07:43:59 -06:00
parent ccabac3eb6
commit b436e3a2c8
13 changed files with 28 additions and 41 deletions

View File

@ -1,7 +1,7 @@
/************************************************************************************
* arch/z80/src/common/up_arch.h
*
* Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009, 2013, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -43,7 +43,7 @@
#include <nuttx/config.h>
#include <arch/board/board.h>
#include "chip/chip.h"
#include "chip.h"
/************************************************************************************
* Pre-processor Definitions

View File

@ -49,7 +49,7 @@
#include <nuttx/board.h>
#include <nuttx/usb/usbdev_trace.h>
#include "chip/chip.h"
#include "chip.h"
#include "up_arch.h"
#include "sched/sched.h"
#include "up_internal.h"

View File

@ -49,7 +49,7 @@
# include <nuttx/fs/fs.h>
#endif
#include "chip/chip.h"
#include "chip.h"
#include "task/task.h"
#include "sched/sched.h"
#include "group/group.h"

View File

@ -63,8 +63,8 @@
#include <stdbool.h>
#include <arch/irq.h>
#include "chip/chip.h"
#include "chip/switch.h"
#include "chip.h"
#include "switch.h"
/****************************************************************************
* Pre-processor Definitions

View File

@ -45,7 +45,7 @@
#include <nuttx/arch.h>
#include <nuttx/sched.h>
#include "chip/chip.h"
#include "chip.h"
#include "chip/switch.h"
#include "sched/sched.h"
#include "group/group.h"

View File

@ -47,7 +47,7 @@
#include <nuttx/arch.h>
#include <nuttx/sched.h>
#include "chip/chip.h"
#include "chip.h"
#include "chip/switch.h"
#include "sched/sched.h"
#include "group/group.h"

View File

@ -45,7 +45,7 @@
#include <nuttx/arch.h>
#include <nuttx/sched.h>
#include "chip/chip.h"
#include "chip.h"
#include "chip/switch.h"
#include "sched/sched.h"
#include "group/group.h"

View File

@ -1,8 +1,7 @@
/************************************************************************************
* arch/z80/src/z80/switch.h
* arch/z80/src/chip/switch.h
*
* Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2011-2012, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -154,10 +153,6 @@ int z80_saveusercontext(FAR chipreg_t *regs);
void z80_restoreusercontext(FAR chipreg_t *regs);
/* Defined in z80_sigsetup.c */
void z80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs);
/* Defined in z80_registerdump.c */
void z80_registerdump(void);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/z80/z80_schedulesigaction.c
*
* Copyright (C) 2007-2010, 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2010, 2015, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -45,6 +45,7 @@
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/sched.h>
#include "chip/switch.h"
#include "sched/sched.h"
@ -52,14 +53,6 @@
#ifndef CONFIG_DISABLE_SIGNALS
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
@ -68,7 +61,8 @@
* Name: z80_sigsetup
****************************************************************************/
static void z80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs)
static void z80_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.
@ -80,8 +74,8 @@ static void z80_sigsetup(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver, FAR ch
/* Then set up to vector to the trampoline with interrupts disabled */
regs[XCPT_PC] = (chipreg_t)up_sigdeliver;
regs[XCPT_I] = 0;
regs[XCPT_PC] = (chipreg_t)up_sigdeliver;
regs[XCPT_I] = 0;
}
/****************************************************************************

View File

@ -219,15 +219,21 @@ compatible with this build. First start with the usual steps
cd sdcc
./configure
Note if you do not have the gputils packet installed, newer version of the
SDCC configure will fail. You will have to either install the gputils
package or if you don't need PIC14 or PIC16 support:
./configure --disable-pic14-port --disable-pic16-port
But before making, we need to apply a patch to the SDCC 2.6.0 source
so that the z80 assembler can handle long symbol names
so that the z80 assembler can handle long symbol names. This is not
needed with later versions.
Apply sdcc-2.6.0-asz80-symlen.patch
cd sdcc/device/lib
Then make the SDCC binaries
cd sdcc
make
and install SDCC:

View File

@ -31,9 +31,9 @@ CONFIG_START_MONTH=2
CONFIG_START_YEAR=2007
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_UART_RXBUFSIZE=0
CONFIG_UART_RXBUFSIZE=32
CONFIG_UART_SERIAL_CONSOLE=y
CONFIG_UART_TXBUFSIZE=0
CONFIG_UART_TXBUFSIZE=32
CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_WDOG_INTRESERVE=0

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/z80sim/src/z80_serial.c
*
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2012, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -57,14 +57,6 @@
#ifdef USE_SERIALDRIVER
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

View File

@ -66,7 +66,7 @@ double difftime(time_t time1, time_t time0)
#else
float difftime(time_t time1, time_t time0)
{
if (time1 >= time2)
if (time1 >= time0)
{
/* Result will be positive (even though bit 31 may be set on very large
* differences!)