Browse Source

Fix some warnings and fix some simulator builds

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4688 7fd9a85b-ad96-42d3-883c-3090e2eb8679
sbg
patacongo 13 years ago
parent
commit
882448de92
  1. 2
      NxWidgets/UnitTests/README.txt
  2. 22
      nuttx/arch/sim/src/up_setjmp.S
  3. 9
      nuttx/configs/sim/README.txt
  4. 21
      nuttx/configs/sim/nx11/Make.defs
  5. 21
      nuttx/configs/sim/nxwm/Make.defs
  6. 21
      nuttx/configs/sim/touchscreen/Make.defs
  7. 4
      nuttx/drivers/mmcsd/mmcsd_spi.c
  8. 4
      nuttx/drivers/mtd/rammtd.c
  9. 4
      nuttx/drivers/mtd/ramtron.c
  10. 6
      nuttx/fs/fat/fs_fat32.c
  11. 4
      nuttx/fs/fs_fcntl.c
  12. 27
      nuttx/libxx/README.txt
  13. 2
      nuttx/sched/prctl.c
  14. 5
      nuttx/sched/pthread_exit.c
  15. 4
      nuttx/sched/sem_open.c
  16. 11
      nuttx/sched/sig_deliver.c
  17. 11
      nuttx/sched/wd_start.c

2
NxWidgets/UnitTests/README.txt

@ -35,7 +35,7 @@ Installing and Building the Unit Tests @@ -35,7 +35,7 @@ Installing and Building the Unit Tests
for the STM3210E-EVAL available. However, the unit test can be run on
other configurations (see steps d and e below).
NOTE: The special configuratin sim/nxwm is recommended for unit-leveling
NOTE: Another special configuration, sim/nxwm, is recommended for unit-leveling
testing of NxWM because the configuration is more complex in that case.
We will assume the sim/nsh2 configuration in this discussion. The

22
nuttx/arch/sim/src/up_setjmp.S

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
/**************************************************************************
* up_setjmp.S
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2007, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -104,11 +104,11 @@ SYMBOL(up_setjmp): @@ -104,11 +104,11 @@ SYMBOL(up_setjmp):
/* Save the framepointer */
movl %ebp, (JB_EBP)(%eax)
movl %ebp, (JB_EBP)(%eax)
/* And return 0 */
xorl %eax, %eax
xorl %eax, %eax
ret
#ifndef __CYGWIN__
.size SYMBOL(up_setjmp), . - SYMBOL(up_setjmp)
@ -123,19 +123,19 @@ SYMBOL(up_longjmp): @@ -123,19 +123,19 @@ SYMBOL(up_longjmp):
/* Save the return address now. */
movl (JB_PC)(%ecx), %edx
movl (JB_PC)(%ecx), %edx
/* Restore registers. */
movl (JB_EBX)(%ecx), %ebx
movl (JB_ESI)(%ecx), %esi
movl (JB_EDI)(%ecx), %edi
movl (JB_EBP)(%ecx), %ebp
movl (JB_SP)(%ecx), %esp
movl (JB_EBX)(%ecx), %ebx
movl (JB_ESI)(%ecx), %esi
movl (JB_EDI)(%ecx), %edi
movl (JB_EBP)(%ecx), %ebp
movl (JB_SP)(%ecx), %esp
/* Jump to saved PC. */
jmp *%edx
jmp *%edx
#ifndef __CYGWIN__
.size SYMBOL(up_longjmp), . - SYMBOL(up_longjmp)
#endif

9
nuttx/configs/sim/README.txt

@ -10,6 +10,7 @@ Contents @@ -10,6 +10,7 @@ Contents
o Debugging
o Issues
- 64-bit Issues
- Compiler differences
- Stack Size Issues
- Buffered I/O Issues
- Networking Issues
@ -107,6 +108,14 @@ are included in the LDFLAGS. See the patch @@ -107,6 +108,14 @@ are included in the LDFLAGS. See the patch
0001-Quick-hacks-to-build-sim-nsh-ostest-on-x86_64-as-32-.patch that can be found at
http://tech.groups.yahoo.com/group/nuttx/files.
Compiler differences
--------------------
operator new
Problem: "'operator new' takes size_t ('...') as first parameter"
Workaround: Add -fpermissive to the compilation flags
Stack Size Issues
-----------------
When you run the NuttX simulation, it uses stacks allocated by NuttX from the

21
nuttx/configs/sim/nx11/Make.defs

@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT =
ifeq ($(CONFIG_SIM_M32),y)
ARCHCPUFLAGS += -m32
ARCHCPUFLAGSXX += -m32
endif
CROSSDEV =
CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
@ -79,8 +84,20 @@ else @@ -79,8 +84,20 @@ else
EXEEXT =
endif
ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD)
CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC)
LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDLINKFLAGS += -g
CCLINKFLAGS += -g
LDFLAGS += -g
endif
ifeq ($(CONFIG_SIM_M32),y)
LDLINKFLAGS += -melf_i386
CCLINKFLAGS += -m32
LDFLAGS += -m32
endif
define PREPROCESS

21
nuttx/configs/sim/nxwm/Make.defs

@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT =
ifeq ($(CONFIG_SIM_M32),y)
ARCHCPUFLAGS += -m32
ARCHCPUFLAGSXX += -m32
endif
CROSSDEV =
CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
@ -79,8 +84,20 @@ else @@ -79,8 +84,20 @@ else
EXEEXT =
endif
ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD)
CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC)
LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDLINKFLAGS += -g
CCLINKFLAGS += -g
LDFLAGS += -g
endif
ifeq ($(CONFIG_SIM_M32),y)
LDLINKFLAGS += -melf_i386
CCLINKFLAGS += -m32
LDFLAGS += -m32
endif
define PREPROCESS

21
nuttx/configs/sim/touchscreen/Make.defs

@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT =
ifeq ($(CONFIG_SIM_M32),y)
ARCHCPUFLAGS += -m32
ARCHCPUFLAGSXX += -m32
endif
CROSSDEV =
CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
@ -79,8 +84,20 @@ else @@ -79,8 +84,20 @@ else
EXEEXT =
endif
ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD)
CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC)
LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDLINKFLAGS += -g
CCLINKFLAGS += -g
LDFLAGS += -g
endif
ifeq ($(CONFIG_SIM_M32),y)
LDLINKFLAGS += -melf_i386
CCLINKFLAGS += -m32
LDFLAGS += -m32
endif
define PREPROCESS

4
nuttx/drivers/mmcsd/mmcsd_spi.c

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
/****************************************************************************
* drivers/mmcsd/mmcsd_spi.c
*
* Copyright (C) 2008-2010, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2008-2010, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

4
nuttx/drivers/mtd/rammtd.c

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
/****************************************************************************
* drivers/mtd/rammtd.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

4
nuttx/drivers/mtd/ramtron.c

@ -3,9 +3,9 @@ @@ -3,9 +3,9 @@
* Driver for SPI-based RAMTRON NVRAM Devices FM25V10 and others (not tested)
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
* Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
* Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved.
* Author: Uros Platise <uros.platise@isotel.eu>
* Gregory Nutt <spudmonkey@racsa.co.cr>
* Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

6
nuttx/fs/fat/fs_fat32.c

@ -377,7 +377,6 @@ errout_with_semaphore: @@ -377,7 +377,6 @@ errout_with_semaphore:
static int fat_close(FAR struct file *filep)
{
struct inode *inode;
struct fat_mountpt_s *fs;
struct fat_file_s *ff;
int ret = OK;
@ -389,9 +388,6 @@ static int fat_close(FAR struct file *filep) @@ -389,9 +388,6 @@ static int fat_close(FAR struct file *filep)
ff = filep->f_priv;
inode = filep->f_inode;
fs = inode->i_private;
DEBUGASSERT(fs != NULL);
/* Do not check if the mount is healthy. We must support closing of
* the file even when there is healthy mount.
@ -1107,7 +1103,6 @@ static int fat_ioctl(FAR struct file *filep, int cmd, unsigned long arg) @@ -1107,7 +1103,6 @@ static int fat_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
struct inode *inode;
struct fat_mountpt_s *fs;
struct fat_file_s *ff;
int ret;
/* Sanity checks */
@ -1116,7 +1111,6 @@ static int fat_ioctl(FAR struct file *filep, int cmd, unsigned long arg) @@ -1116,7 +1111,6 @@ static int fat_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
/* Recover our private data from the struct file instance */
ff = filep->f_priv;
inode = filep->f_inode;
fs = inode->i_private;

4
nuttx/fs/fs_fcntl.c

@ -59,7 +59,7 @@ static inline int file_vfcntl(int fildes, int cmd, va_list ap) @@ -59,7 +59,7 @@ static inline int file_vfcntl(int fildes, int cmd, va_list ap)
FAR struct filelist *list;
FAR struct file *this_file;
int err = 0;
int ret = 0;
int ret = OK;
/* Get the thread-specific file list */
@ -202,7 +202,7 @@ errout: @@ -202,7 +202,7 @@ errout:
errno = err;
return ERROR;
}
return OK;
return ret;
}
#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */

27
nuttx/libxx/README.txt

@ -7,11 +7,30 @@ embedded world, that is probably all that is necessary. If you @@ -7,11 +7,30 @@ embedded world, that is probably all that is necessary. If you
have a need for more extensive C++ support, the following libraries
are recommended:
- libstdc++ (part of GCC)
- STLport http://www.stlport.org/
- uClibc++ http://cxx.uclibc.org/
- libstdc++ (part of GCC)
- STLport http://www.stlport.org/
- uClibc++ http://cxx.uclibc.org/
At present, only the following are supported here:
- void *operator new(std::size_t nbytes);
- void operator delete(void* ptr);
- void operator delete(void* ptr);
- void operator delete[](void *ptr);
- void __cxa_pure_virtual(void);
- int __aeabi_atexit(void* object, void (*destroyer)(void*), void *dso_handle);
operator new
------------
This operator should take a type of size_t. But size_t has an unknown underlying
type. In the nuttx sys/types.h header file, size_t is typed as uint32_t
(which is determined by architecture-specific logic). But the C++
compiler may believe that size_t is of a different type resulting in
compilation errors in the operator. Using the underlying integer type
instead of size_t seems to resolve the compilation issues. Need to
REVISIT this.
Once some C++ compilers, this will cause an error:
Problem: "'operator new' takes size_t ('...') as first parameter"
Workaround: Add -fpermissive to the compilation flags

2
nuttx/sched/prctl.c

@ -140,7 +140,7 @@ int prctl(int option, ...) @@ -140,7 +140,7 @@ int prctl(int option, ...)
/* The returned value will be null-terminated, truncating if necessary */
strncpy(name, tcb->name, CONFIG_TASK_NAME_SIZE-1);
name[CONFIG_TASK_NAME_SIZE-1];
name[CONFIG_TASK_NAME_SIZE-1] = '\0';
}
}
break;

5
nuttx/sched/pthread_exit.c

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
/************************************************************************
* sched/pthread_exit.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
@ -39,6 +39,7 @@ @@ -39,6 +39,7 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
@ -92,7 +93,7 @@ @@ -92,7 +93,7 @@
void pthread_exit(FAR void *exit_value)
{
int error_code = (int)exit_value;
int error_code = (int)((intptr_t)exit_value);
int status;
sdbg("exit_value=%p\n", exit_value);

4
nuttx/sched/sem_open.c

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
/****************************************************************************
* sched/sem_open.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

11
nuttx/sched/sig_deliver.c

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
/****************************************************************************
* sched/sig_deliver.c
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -86,7 +86,6 @@ @@ -86,7 +86,6 @@
void sig_deliver(FAR _TCB *stcb)
{
pid_t rpid;
FAR sigq_t *sigq;
FAR sigq_t *next;
sigset_t savesigprocmask;
@ -129,12 +128,6 @@ void sig_deliver(FAR _TCB *stcb) @@ -129,12 +128,6 @@ void sig_deliver(FAR _TCB *stcb)
savesigprocmask = stcb->sigprocmask;
stcb->sigprocmask = savesigprocmask | sigq->mask | SIGNO2SET(sigq->info.si_signo);
/* The current tasks process.ID. We'll need this later to see if
* the signal handler caused a context switch.
*/
rpid = getpid();
/* Deliver the signal */
(*sigq->action.sighandler)(sigq->info.si_signo, &sigq->info, NULL);

11
nuttx/sched/wd_start.c

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
/****************************************************************************
* sched/wd_start.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -294,7 +294,6 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) @@ -294,7 +294,6 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
void wd_timer(void)
{
pid_t pid;
FAR wdog_t *wdog;
/* Check if there are any active watchdogs to process */
@ -333,12 +332,6 @@ void wd_timer(void) @@ -333,12 +332,6 @@ void wd_timer(void)
wdog->active = false;
/* Get the current task's process ID. We'll need this later to
* see if the watchdog function caused a context switch.
*/
pid = getpid();
/* Execute the watchdog function */
up_setpicbase(wdog->picbase);

Loading…
Cancel
Save