Reverted nuttx merge, back to master

This commit is contained in:
Lorenz Meier
2012-12-28 13:10:06 +01:00
parent 45a4bcb6ef
commit 8b8330a015
378 changed files with 30204 additions and 4660 deletions
-59
View File
@@ -40,9 +40,6 @@
// Included Files
//***************************************************************************
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <math.h>
//***************************************************************************
@@ -51,33 +48,6 @@
namespace std
{
#if CONFIG_HAVE_FLOAT
using ::acosf;
using ::asinf;
using ::atanf;
using ::atan2f;
using ::ceilf;
using ::cosf;
using ::coshf;
using ::expf;
using ::fabsf;
using ::floorf;
using ::fmodf;
using ::frexpf;
using ::ldexpf;
using ::logf;
using ::log10f;
using ::log2f;
using ::modff;
using ::powf;
using ::sinf;
using ::sinhf;
using ::sqrtf;
using ::tanf;
using ::tanhf;
#endif
#if CONFIG_HAVE_DOUBLE
using ::acos;
using ::asin;
using ::atan;
@@ -93,7 +63,6 @@ namespace std
using ::ldexp;
using ::log;
using ::log10;
using ::log2;
using ::modf;
using ::pow;
using ::sin;
@@ -101,34 +70,6 @@ namespace std
using ::sqrt;
using ::tan;
using ::tanh;
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
using ::acosl;
using ::asinl;
using ::atanl;
using ::atan2l;
using ::ceill;
using ::cosl;
using ::coshl;
using ::expl;
using ::fabsl;
using ::floorl;
using ::fmodl;
using ::frexpl;
using ::ldexpl;
using ::logl;
using ::log10l;
using ::log2l;
using ::modfl;
using ::powl;
using ::sinl;
using ::sinhl;
using ::sqrtl;
using ::tanl;
using ::tanhl;
#endif
}
#endif // __INCLUDE_CXX_CMATH
-9
View File
@@ -46,13 +46,4 @@
// Namespace
//***************************************************************************
//***************************************************************************
// Namespace
//***************************************************************************
namespace std
{
using ::_Bool8;
}
#endif // __INCLUDE_CXX_CSTDBOOL
+1 -11
View File
@@ -52,8 +52,6 @@ namespace std
using ::FILE;
using ::fpos_t;
using ::size_t;
using ::clearerr;
using ::fclose;
using ::fflush;
using ::feof;
@@ -71,24 +69,16 @@ namespace std
using ::ftell;
using ::fwrite;
using ::gets;
using ::ungetc;
using ::printf;
using ::puts;
using ::rename;
using ::sprintf;
using ::asprintf;
using ::snprintf;
using ::sscanf;
using ::perror;
using ::ungetc;
using ::vprintf;
using ::vfprintf;
using ::vsprintf;
using ::avsprintf;
using ::vsnprintf;
using ::vsscanf;
using ::fdopen;
using ::statfs;
}
-9
View File
@@ -52,10 +52,6 @@
#define IF_NAMESIZE 6 /* Newer naming standard */
#define IFHWADDRLEN 6
#define IFF_RUNNING (1 << 0)
#define IF_FLAG_IFUP (1 << 0)
#define IF_FLAG_IFDOWN (2 << 0)
/*******************************************************************************************
* Public Type Definitions
*******************************************************************************************/
@@ -76,7 +72,6 @@ struct lifreq
struct sockaddr lifru_hwaddr; /* MAC address */
int lifru_count; /* Number of devices */
int lifru_mtu; /* MTU size */
uint8_t lifru_flags; /* Interface flags */
} lifr_ifru;
};
@@ -87,7 +82,6 @@ struct lifreq
#define lifr_hwaddr lifr_ifru.lifru_hwaddr /* MAC address */
#define lifr_mtu lifr_ifru.lifru_mtu /* MTU */
#define lifr_count lifr_ifru.lifru_count /* Number of devices */
#define lifr_flags lifr_ifru.lifru_flags /* interface flags */
/* This is the older I/F request that should only be used with IPv4. However, since
* NuttX only supports IPv4 or 6 (not both), we can force the older structure to
@@ -107,7 +101,6 @@ struct ifreq
struct sockaddr ifru_hwaddr; /* MAC address */
int ifru_count; /* Number of devices */
int ifru_mtu; /* MTU size */
uint8_t ifru_flags; /* Interface flags */
} ifr_ifru;
};
@@ -118,7 +111,6 @@ struct ifreq
#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
#define ifr_mtu ifr_ifru.ifru_mtu /* MTU */
#define ifr_count ifr_ifru.ifru_count /* Number of devices */
#define ifr_flags ifr_ifru.ifru_flags /* interface flags */
#else /* CONFIG_NET_IPv6 */
@@ -131,7 +123,6 @@ struct ifreq
#define ifr_hwaddr lifr_ifru.lifru_hwaddr /* MAC address */
#define ifr_mtu lifr_ifru.lifru_mtu /* MTU */
#define ifr_count lifr_ifru.lifru_count /* Number of devices */
#define ifr_flags lifr_ifru.lifru_flags /* interface flags */
#endif /* CONFIG_NET_IPv6 */
-22
View File
@@ -616,28 +616,6 @@ EXTERN uint8_t up_buttons(void);
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
/************************************************************************************
* Relay control functions
*
* Description:
* Non-standard functions for relay control.
*
************************************************************************************/
#ifdef CONFIG_ARCH_RELAYS
EXTERN void up_relaysinit(void);
EXTERN void relays_setstat(int relays, bool stat);
EXTERN bool relays_getstat(int relays);
EXTERN void relays_setstats(uint32_t relays_stat);
EXTERN uint32_t relays_getstats(void);
EXTERN void relays_onoff(int relays, uint32_t mdelay);
EXTERN void relays_onoffs(uint32_t relays_stat, uint32_t mdelay);
EXTERN void relays_resetmode(int relays);
EXTERN void relays_powermode(int relays);
EXTERN void relays_resetmodes(uint32_t relays_stat);
EXTERN void relays_powermodes(uint32_t relays_stat);
#endif
/****************************************************************************
* Debug interfaces exported by the architecture-specific logic
****************************************************************************/
+209
View File
@@ -0,0 +1,209 @@
/****************************************************************************
* include/nuttx/binfmt.h
*
* Copyright (C) 2009 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_BINFMT_H
#define __INCLUDE_NUTTX_BINFMT_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nxflat.h>
#include <nuttx/sched.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/* This describes the file to be loaded */
struct symtab_s;
struct binary_s
{
/* Information provided to the loader to load and bind a module */
FAR const char *filename; /* Full path to the binary to be loaded */
FAR const char **argv; /* Argument list */
FAR const struct symtab_s *exports; /* Table of exported symbols */
int nexports; /* The number of symbols in exports[] */
/* Information provided from the loader (if successful) describing the
* resources used by the loaded module.
*/
main_t entrypt; /* Entry point into a program module */
FAR void *ispace; /* Memory-mapped, I-space (.text) address */
FAR struct dspace_s *dspace; /* Address of the allocated .data/.bss space */
size_t isize; /* Size of the I-space region (needed for munmap) */
size_t stacksize; /* Size of the stack in bytes (unallocated) */
};
/* This describes one binary format handler */
struct binfmt_s
{
FAR struct binfmt_s *next; /* Supports a singly-linked list */
int (*load)(FAR struct binary_s *bin); /* Verify and load binary into memory */
};
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: register_binfmt
*
* Description:
* Register a loader for a binary format
*
* Returned Value:
* This is a NuttX internal function so it follows the convention that
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
****************************************************************************/
EXTERN int register_binfmt(FAR struct binfmt_s *binfmt);
/****************************************************************************
* Name: unregister_binfmt
*
* Description:
* Register a loader for a binary format
*
* Returned Value:
* This is a NuttX internal function so it follows the convention that
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
****************************************************************************/
EXTERN int unregister_binfmt(FAR struct binfmt_s *binfmt);
/****************************************************************************
* Name: load_module
*
* Description:
* Load a module into memory, bind it to an exported symbol take, and
* prep the module for execution.
*
* Returned Value:
* This is an end-user function, so it follows the normal convention:
* Returns 0 (OK) on success. On failure, it returns -1 (ERROR) with
* errno set appropriately.
*
****************************************************************************/
EXTERN int load_module(FAR struct binary_s *bin);
/****************************************************************************
* Name: unload_module
*
* Description:
* Unload a (non-executing) module from memory. If the module has
* been started (via exec_module), calling this will be fatal.
*
* Returned Value:
* This is a NuttX internal function so it follows the convention that
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
****************************************************************************/
EXTERN int unload_module(FAR const struct binary_s *bin);
/****************************************************************************
* Name: exec_module
*
* Description:
* Execute a module that has been loaded into memory by load_module().
*
* Returned Value:
* This is an end-user function, so it follows the normal convention:
* Returns the PID of the exec'ed module. On failure, it.returns
* -1 (ERROR) and sets errno appropriately.
*
****************************************************************************/
EXTERN int exec_module(FAR const struct binary_s *bin, int priority);
/****************************************************************************
* Name: exec
*
* Description:
* This is a convenience function that wraps load_ and exec_module into
* one call.
*
* Input Parameter:
* filename - Fulll path to the binary to be loaded
* argv - Argument list
* exports - Table of exported symbols
* nexports - The number of symbols in exports
*
* Returned Value:
* This is an end-user function, so it follows the normal convention:
* Returns the PID of the exec'ed module. On failure, it.returns
* -1 (ERROR) and sets errno appropriately.
*
****************************************************************************/
EXTERN int exec(FAR const char *filename, FAR const char **argv,
FAR const struct symtab_s *exports, int nexports);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __INCLUDE_NUTTX_BINFMT_H */
+5 -18
View File
@@ -87,16 +87,11 @@
# define packed_struct __attribute__ ((packed))
/* GCC does not support the reentrant attribute */
/* GCC does not support the reentrant or naked attributes */
# define reentrant_function
# define naked_function
/* The naked attribute informs GCC that the programmer will take care of
* the function prolog and epilog.
*/
# define naked_function __attribute__ ((naked,no_instrument_function))
/* The inline_function attribute informs GCC that the function should always
* be inlined, regardless of the level of optimization. The noinline_function
* indicates that the function should never be inlined.
@@ -196,10 +191,8 @@
/* GCC supports both types double and long long */
# define CONFIG_HAVE_LONG_LONG 1
# define CONFIG_HAVE_FLOAT 1
# define CONFIG_HAVE_DOUBLE 1
# define CONFIG_HAVE_LONG_DOUBLE 1
# define CONFIG_HAVE_LONG_LONG 1
/* Structures and unions can be assigned and passed as values */
@@ -302,9 +295,7 @@
/* SDCC does not support type long long or type double */
# undef CONFIG_HAVE_LONG_LONG
# define CONFIG_HAVE_FLOAT 1
# undef CONFIG_HAVE_DOUBLE
# undef CONFIG_HAVE_LONG_DOUBLE
/* Structures and unions cannot be passed as values or used
* in assignments.
@@ -407,10 +398,8 @@
* simply do not support long long or double.
*/
# undef CONFIG_HAVE_LONG_LONG
# define CONFIG_HAVE_FLOAT 1
# undef CONFIG_HAVE_DOUBLE
# undef CONFIG_HAVE_LONG_DOUBLE
# undef CONFIG_HAVE_LONG_LONG
/* Structures and unions can be assigned and passed as values */
@@ -444,11 +433,9 @@
# undef CONFIG_LONG_IS_NOT_INT
# undef CONFIG_PTR_IS_NOT_INT
# undef CONFIG_HAVE_INLINE
# define inline 1
# define inline
# undef CONFIG_HAVE_LONG_LONG
# define CONFIG_HAVE_FLOAT 1
# undef CONFIG_HAVE_DOUBLE
# undef CONFIG_HAVE_LONG_DOUBLE
# undef CONFIG_CAN_PASS_STRUCTS
#endif
+5 -10
View File
@@ -51,10 +51,6 @@
/****************************************************************************
* Definitions
****************************************************************************/
/* Stream flags for the fs_flags field of in struct file_struct */
#define __FS_FLAG_EOF (1 << 0) /* EOF detected by a read operation */
#define __FS_FLAG_ERROR (1 << 1) /* Error detected by any operation */
/****************************************************************************
* Type Definitions
@@ -274,6 +270,11 @@ struct filelist
struct file_struct
{
int fs_filedes; /* File descriptor associated with stream */
uint16_t fs_oflags; /* Open mode flags */
#if CONFIG_NUNGET_CHARS > 0
uint8_t fs_nungotten; /* The number of characters buffered for ungetc */
unsigned char fs_ungotten[CONFIG_NUNGET_CHARS];
#endif
#if CONFIG_STDIO_BUFFER_SIZE > 0
sem_t fs_sem; /* For thread safety */
pid_t fs_holder; /* Holder of sem */
@@ -282,12 +283,6 @@ struct file_struct
FAR unsigned char *fs_bufend; /* Pointer to 1 past end of buffer */
FAR unsigned char *fs_bufpos; /* Current position in buffer */
FAR unsigned char *fs_bufread; /* Pointer to 1 past last buffered read char. */
#endif
uint16_t fs_oflags; /* Open mode flags */
uint8_t fs_flags; /* Stream flags */
#if CONFIG_NUNGET_CHARS > 0
uint8_t fs_nungotten; /* The number of characters buffered for ungetc */
unsigned char fs_ungotten[CONFIG_NUNGET_CHARS];
#endif
};
+10 -5
View File
@@ -3,7 +3,7 @@
* Driver for the Univision UG-9664HSWAG01 Display with the Solomon Systech
* SSD1305 LCD controller.
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -58,6 +58,8 @@
* CONFIG_UG9664HSWAG01_POWER
* If the hardware supports a controllable OLED a power supply, this
* configuration shold be defined. (See ug_power() below).
* CONFIG_LCD_UGDEBUG - Enable detailed UG-9664HSWAG01 debug output
* (CONFIG_DEBUG and CONFIG_VERBOSE must also be enabled).
*
* Required LCD driver settings:
* CONFIG_LCD_UG9664HSWAG01 - Enable UG-9664HSWAG01 support
@@ -88,8 +90,10 @@
****************************************************************************/
#ifdef __cplusplus
extern "C"
{
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/****************************************************************************
@@ -119,7 +123,7 @@ extern "C"
struct lcd_dev_s; /* see nuttx/lcd.h */
struct spi_dev_s; /* see nuttx/spi.h */
FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned int devno);
EXTERN FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned int devno);
/****************************************************************************
* Name: ug_power
@@ -141,11 +145,12 @@ FAR struct lcd_dev_s *ug_initialize(FAR struct spi_dev_s *spi, unsigned int devn
**************************************************************************************/
#ifdef CONFIG_UG9664HSWAG01_POWER
void ug_power(unsigned int devno, bool on);
EXTERN void ug_power(unsigned int devno, bool on);
#else
# define ug_power(a,b)
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
+2 -260
View File
@@ -50,272 +50,14 @@
#ifdef CONFIG_ARCH_MATH_H
# include <arch/math.h>
/* If CONFIG_LIB is enabled, then the math library at lib/math will be
* built. This library was taken from the math library developed for the
* Rhombus OS by Nick Johnson (https://github.com/nickbjohnson4224/rhombus).
* The port or the Rhombus math library was contributed by Darcy Gong.
*/
#else if defined CONFIG_LIBM
#endif
/****************************************************************************
* Copyright (C) 2009-2011 Nick Johnson <nickbjohnson4224 at gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Type Definitions
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* General Constants ********************************************************/
#define INFINITY (1.0/0.0)
#define NAN (0.0/0.0)
#define HUGE_VAL INFINITY
#define isnan(x) ((x) != (x))
#define isinf(x) (((x) == INFINITY) || ((x) == -INFINITY))
/* Exponential and Logarithmic constants ************************************/
#define M_E 2.7182818284590452353602874713526625
#define M_SQRT2 1.4142135623730950488016887242096981
#define M_SQRT1_2 0.7071067811865475244008443621048490
#define M_LOG2E 1.4426950408889634073599246810018921
#define M_LOG10E 0.4342944819032518276511289189166051
#define M_LN2 0.6931471805599453094172321214581765
#define M_LN10 2.3025850929940456840179914546843642
/* Trigonometric Constants **************************************************/
#define M_PI 3.1415926535897932384626433832795029
#define M_PI_2 1.5707963267948966192313216916397514
#define M_PI_4 0.7853981633974483096156608458198757
#define M_1_PI 0.3183098861837906715377675267450287
#define M_2_PI 0.6366197723675813430755350534900574
#define M_2_SQRTPI 1.1283791670955125738961589031215452
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif
/* General Functions ********************************************************/
float ceilf (float x);
#if CONFIG_HAVE_DOUBLE
double ceil (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double ceill (long double x);
#endif
float floorf(float x);
#if CONFIG_HAVE_DOUBLE
double floor (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double floorl(long double x);
#endif
float fabsf (float x);
#if CONFIG_HAVE_DOUBLE
double fabs (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double fabsl (long double x);
#endif
float modff (float x, float *iptr);
#if CONFIG_HAVE_DOUBLE
double modf (double x, double *iptr);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double modfl (long double x, long double *iptr);
#endif
float fmodf (float x, float div);
#if CONFIG_HAVE_DOUBLE
double fmod (double x, double div);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double fmodl (long double x, long double div);
#endif
/* Exponential and Logarithmic Functions ************************************/
float powf (float b, float e);
#if CONFIG_HAVE_DOUBLE
double pow (double b, double e);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double powl (long double b, long double e);
#endif
float expf (float x);
#if CONFIG_HAVE_DOUBLE
double exp (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double expl (long double x);
#endif
float logf (float x);
#if CONFIG_HAVE_DOUBLE
double log (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double logl (long double x);
#endif
float log10f(float x);
#if CONFIG_HAVE_DOUBLE
double log10 (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double log10l(long double x);
#endif
float log2f (float x);
#if CONFIG_HAVE_DOUBLE
double log2 (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double log2l (long double x);
#endif
float sqrtf (float x);
#if CONFIG_HAVE_DOUBLE
double sqrt (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double sqrtl (long double x);
#endif
float ldexpf(float x, int n);
#if CONFIG_HAVE_DOUBLE
double ldexp (double x, int n);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double ldexpl(long double x, int n);
#endif
float frexpf(float x, int *exp);
#if CONFIG_HAVE_DOUBLE
double frexp (double x, int *exp);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double frexpl(long double x, int *exp);
#endif
/* Trigonometric Functions **************************************************/
float sinf (float x);
#if CONFIG_HAVE_DOUBLE
double sin (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double sinl (long double x);
#endif
float cosf (float x);
#if CONFIG_HAVE_DOUBLE
double cos (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double cosl (long double x);
#endif
float tanf (float x);
#if CONFIG_HAVE_DOUBLE
double tan (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double tanl (long double x);
#endif
float asinf (float x);
#if CONFIG_HAVE_DOUBLE
double asin (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double asinl (long double x);
#endif
float acosf (float x);
#if CONFIG_HAVE_DOUBLE
double acos (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double acosl (long double x);
#endif
float atanf (float x);
#if CONFIG_HAVE_DOUBLE
double atan (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double atanl (long double x);
#endif
float atan2f(float y, float x);
#if CONFIG_HAVE_DOUBLE
double atan2 (double y, double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double atan2l(long double y, long double x);
#endif
float sinhf (float x);
#if CONFIG_HAVE_DOUBLE
double sinh (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double sinhl (long double x);
#endif
float coshf (float x);
#if CONFIG_HAVE_DOUBLE
double cosh (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double coshl (long double x);
#endif
float tanhf (float x);
#if CONFIG_HAVE_DOUBLE
double tanh (double x);
#endif
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double tanhl (long double x);
#endif
#if defined(__cplusplus)
}
#endif
#endif /* CONFIG_LIBM */
#endif /* __INCLUDE_NUTTX_MATH_H */
-6
View File
@@ -146,15 +146,9 @@
#define SIOCSIWPMKSA _SIOC(0x0036) /* PMKSA cache operation */
/* Interface flags */
#define SIOCSIFFLAGS _SIOC(0x0037) /* Sets the interface flags */
#define SIOCGIFFLAGS _SIOC(0x0038) /* Gets the interface flags */
/****************************************************************************
* Type Definitions
****************************************************************************/
/* See include/net/if.h */
/****************************************************************************
-4
View File
@@ -90,10 +90,6 @@ struct uip_driver_s
char d_ifname[IFNAMSIZ];
#endif
/* Drivers interface flags. See IFF_* definitions in include/net/if.h */
uint8_t d_flags;
/* Ethernet device identity */
#ifdef CONFIG_NET_ETHERNET
+264
View File
@@ -0,0 +1,264 @@
/****************************************************************************
* include/nuttx/nxflat.h
*
* Copyright (C) 2009 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_NXFLAT_H
#define __INCLUDE_NUTTX_NXFLAT_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <nxflat.h>
#include <nuttx/sched.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/* This struct provides a desciption of the currently loaded instantiation
* of an nxflat binary.
*/
struct nxflat_loadinfo_s
{
/* Instruction Space (ISpace): This region contains the nxflat file header
* plus everything from the text section. Ideally, will have only one mmap'ed
* text section instance in the system for each module.
*/
uint32_t ispace; /* Address where hdr/text is loaded */
uint32_t entryoffs; /* Offset from ispace to entry point */
uint32_t isize; /* Size of ispace. */
/* Data Space (DSpace): This region contains all information that in referenced
* as data (other than the stack which is separately allocated). There will be
* a unique instance of DSpace (and stack) for each instance of a process.
*/
struct dspace_s *dspace; /* Allocated D-Space (data/bss/etc) */
uint32_t datasize; /* Size of data segment in dspace */
uint32_t bsssize; /* Size of bss segment in dspace */
uint32_t stacksize; /* Size of stack (not allocated) */
uint32_t dsize; /* Size of dspace (may be large than parts) */
/* This is temporary memory where relocation records will be loaded. */
uint32_t relocstart; /* Start of array of struct flat_reloc */
uint16_t reloccount; /* Number of elements in reloc array */
/* File descriptors */
int filfd; /* Descriptor for the file being loaded */
/* This is a copy of the NXFLAT header (still in network order) */
struct nxflat_hdr_s header;
};
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/****************************************************************************
* These are APIs exported by libnxflat (and may be used outside of NuttX):
****************************************************************************/
/***********************************************************************
* Name: nxflat_verifyheader
*
* Description:
* Given the header from a possible NXFLAT executable, verify that it
* is an NXFLAT executable.
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
EXTERN int nxflat_verifyheader(const struct nxflat_hdr_s *header);
/***********************************************************************
* Name: nxflat_init
*
* Description:
* This function is called to configure the library to process an NXFLAT
* program binary.
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
EXTERN int nxflat_init(const char *filename,
struct nxflat_loadinfo_s *loadinfo);
/***********************************************************************
* Name: nxflat_uninit
*
* Description:
* Releases any resources committed by nxflat_init(). This essentially
* undoes the actions of nxflat_init.
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
EXTERN int nxflat_uninit(struct nxflat_loadinfo_s *loadinfo);
/***********************************************************************
* Name: nxflat_load
*
* Description:
* Loads the binary specified by nxflat_init into memory, mapping
* the I-space executable regions, allocating the D-Space region,
* and inializing the data segment (relocation information is
* temporarily loaded into the BSS region. BSS will be cleared
* by nxflat_bind() after the relocation data has been processed).
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
EXTERN int nxflat_load(struct nxflat_loadinfo_s *loadinfo);
/***********************************************************************
* Name: nxflat_read
*
* Description:
* Read 'readsize' bytes from the object file at 'offset'
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
EXTERN int nxflat_read(struct nxflat_loadinfo_s *loadinfo, char *buffer,
int readsize, int offset);
/***********************************************************************
* Name: nxflat_bind
*
* Description:
* Bind the imported symbol names in the loaded module described by
* 'loadinfo' using the exported symbol values provided by 'symtab'
* After binding the module, clear the BSS region (which held the relocation
* data) in preparation for execution.
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
struct symtab_s;
EXTERN int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo,
FAR const struct symtab_s *exports, int nexports);
/***********************************************************************
* Name: nxflat_unload
*
* Description:
* This function unloads the object from memory. This essentially
* undoes the actions of nxflat_load.
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
EXTERN int nxflat_unload(struct nxflat_loadinfo_s *loadinfo);
/****************************************************************************
* These are APIs used internally only by NuttX:
****************************************************************************/
/***********************************************************************
* Name: nxflat_initialize
*
* Description:
* NXFLAT support is built unconditionally. However, it order to
* use this binary format, this function must be called during system
* format in order to register the NXFLAT binary format.
*
* Returned Value:
* This is a NuttX internal function so it follows the convention that
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
***********************************************************************/
EXTERN int nxflat_initialize(void);
/****************************************************************************
* Name: nxflat_uninitialize
*
* Description:
* Unregister the NXFLAT binary loader
*
* Returned Value:
* None
*
****************************************************************************/
EXTERN void nxflat_uninitialize(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __INCLUDE_NUTTX_NXFLAT_H */
+3 -3
View File
@@ -163,7 +163,7 @@
#endif
#if CONFIG_PM_IDLEENTER_THRESH >= CONFIG_PM_IDLEEXIT_THRESH
# error "Must have CONFIG_PM_IDLEENTER_THRESH < CONFIG_PM_IDLEEXIT_THRESH"
# error "Must have CONFIG_PM_IDLEENTER_THRESH < CONFIG_PM_IDLEEXIT_THRESH
#endif
#ifndef CONFIG_PM_IDLEENTER_COUNT
@@ -181,7 +181,7 @@
#endif
#if CONFIG_PM_STANDBYENTER_THRESH >= CONFIG_PM_STANDBYEXIT_THRESH
# error "Must have CONFIG_PM_STANDBYENTER_THRESH < CONFIG_PM_STANDBYEXIT_THRESH"
# error "Must have CONFIG_PM_STANDBYENTER_THRESH < CONFIG_PM_STANDBYEXIT_THRESH
#endif
#ifndef CONFIG_PM_STANDBYENTER_COUNT
@@ -199,7 +199,7 @@
#endif
#if CONFIG_PM_SLEEPENTER_THRESH >= CONFIG_PM_SLEEPEXIT_THRESH
# error "Must have CONFIG_PM_SLEEPENTER_THRESH < CONFIG_PM_SLEEPEXIT_THRESH"
# error "Must have CONFIG_PM_SLEEPENTER_THRESH < CONFIG_PM_SLEEPEXIT_THRESH
#endif
#ifndef CONFIG_PM_SLEEPENTER_COUNT
+3 -3
View File
@@ -138,11 +138,11 @@ typedef union entry_u entry_t;
*/
#ifdef CONFIG_SCHED_ATEXIT
typedef CODE void (*atexitfunc_t)(void);
typedef void (*atexitfunc_t)(void);
#endif
#ifdef CONFIG_SCHED_ONEXIT
typedef CODE void (*onexitfunc_t)(int exitcode, FAR void *arg);
typedef void (*onexitfunc_t)(int exitcode, FAR void *arg);
#endif
/* POSIX Message queue */
@@ -189,7 +189,7 @@ struct _TCB
start_t start; /* Thread start function */
entry_t entry; /* Entry Point into the thread */
#if defined(CONFIG_SCHED_ATEXIT) && !defined(CONFIG_SCHED_ONEXIT)
#ifdef CONFIG_SCHED_ATEXIT
# if defined(CONFIG_SCHED_ATEXIT_MAX) && CONFIG_SCHED_ATEXIT_MAX > 1
atexitfunc_t atexitfunc[CONFIG_SCHED_ATEXIT_MAX];
# else
+163
View File
@@ -0,0 +1,163 @@
/****************************************************************************
* include/nuttx/symtab.h
*
* Copyright (C) 2009 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_SYMTAB_H
#define __INCLUDE_NUTTX_SYMTAB_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/* struct symbtab_s describes one entry in the symbol table. A symbol table
* is a fixed size array of struct symtab_s. The information is intentionally
* minimal and supports only:
*
* 1. Function points as sym_values. Of other kinds of values need to be
* supported, then typing information would also need to be included in
* the structure.
*
* 2. Fixed size arrays. There is no explicit provisional for dyanamically
* adding or removing entries from the symbol table (realloc might be
* used for that purpose if needed). The intention is to support only
* fixed size arrays completely defined at compilation or link time.
*/
struct symtab_s
{
FAR const char *sym_name; /* A pointer to the symbol name string */
FAR const void *sym_value; /* The value associated witht the string */
};
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: symtab_findbyname
*
* Description:
* Find the symbol in the symbol table with the matching name.
* This version assumes that table is not ordered with respect to symbol
* name and, hence, access time will be linear with respect to nsyms.
*
* Returned Value:
* A reference to the symbol table entry if an entry with the matching
* name is found; NULL is returned if the entry is not found.
*
****************************************************************************/
EXTERN FAR const struct symtab_s *
symtab_findbyname(FAR const struct symtab_s *symtab,
FAR const char *name, int nsyms);
/****************************************************************************
* Name: symtab_findorderedbyname
*
* Description:
* Find the symbol in the symbol table with the matching name.
* This version assumes that table ordered with respect to symbol name.
*
* Returned Value:
* A reference to the symbol table entry if an entry with the matching
* name is found; NULL is returned if the entry is not found.
*
****************************************************************************/
EXTERN FAR const struct symtab_s *
symtab_findorderedbyname(FAR const struct symtab_s *symtab,
FAR const char *name, int nsyms);
/****************************************************************************
* Name: symtab_findbyvalue
*
* Description:
* Find the symbol in the symbol table whose value closest (but not greater
* than), the provided value. This version assumes that table is not ordered
* with respect to symbol name and, hence, access time will be linear with
* respect to nsyms.
*
* Returned Value:
* A reference to the symbol table entry if an entry with the matching
* name is found; NULL is returned if the entry is not found.
*
****************************************************************************/
EXTERN FAR const struct symtab_s *
symtab_findbyvalue(FAR const struct symtab_s *symtab,
FAR void *value, int nsyms);
/****************************************************************************
* Name: symtab_findorderedbyvalue
*
* Description:
* Find the symbol in the symbol table whose value closest (but not greater
* than), the provided value. This version assumes that table is ordered
* with respect to symbol name.
*
* Returned Value:
* A reference to the symbol table entry if an entry with the matching
* name is found; NULL is returned if the entry is not found.
*
****************************************************************************/
EXTERN FAR const struct symtab_s *
symtab_findorderedbyvalue(FAR const struct symtab_s *symtab,
FAR void *value, int nsyms);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __INCLUDE_NUTTX_SYMTAB_H */
+1 -1
View File
@@ -205,7 +205,7 @@
/* USB Controller */
#ifndef CONFIG_USBDEV_SELFPOWERED
# define SELFPOWERED USB_CONFIG_ATTR_SELFPOWER
# define SELFPOWERED USB_CONFIG_ATT_SELFPOWER
#else
# define SELFPOWERED (0)
#endif
+4
View File
@@ -238,6 +238,10 @@
#define USBCOMPOSITE_TRACEERR_ALLOCDEVSTRUCT 0x000a
#define USBCOMPOSITE_TRACEERR_CLASSOBJECT 0x000b
#define USBCOMPOSITE_TRACEERR_DEVREGISTER 0x000c
#define USBCOMPOSITE_TRACEERR_INVALIDARG 0x000d
#define USBCOMPOSITE_TRACEERR_INVALIDARG 0x000f
#define USBCOMPOSITE_TRACEERR_INVALIDARG 0x0010
#define USBCOMPOSITE_TRACEERR_INVALIDARG 0x0011
/* USB Storage driver class events ******************************************/
+3 -21
View File
@@ -109,35 +109,17 @@
# endif
#endif
/* Work queue IDs (indices):
*
* Kernel Work Queues:
* HPWORK: This ID of the high priority work queue that should only be used for
* hi-priority, time-critical, driver bottom-half functions.
*
* LPWORK: This is the ID of the low priority work queue that can be used for any
* purpose. if CONFIG_SCHED_LPWORK is not defined, then there is only one kernel
* work queue and LPWORK == HPWORK.
*
* User Work Queue:
* USRWORK: CONFIG_NUTTX_KERNEL and CONFIG_SCHED_USRWORK are defined, then NuttX
* will also support a user-accessible work queue. Otherwise, USRWORK == LPWORK.
/* Work queue IDs (indices). These are both zero if there is only one work
* queue.
*/
#define HPWORK 0
#ifdef CONFIG_SCHED_LPWORK
# define LPWORK (HPWORK+1)
# define LPWORK 1
#else
# define LPWORK HPWORK
#endif
#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_SCHED_USRWORK)
# warning "Feature not implemented"
# define USRWORK (LPWORK+1)
#else
# define USRWORK LPWORK
#endif
/****************************************************************************
* Public Types
****************************************************************************/
+1 -6
View File
@@ -102,9 +102,6 @@ extern "C" {
/* ANSI-like File System Interfaces */
/* Operations on streams (FILE) */
EXTERN void clearerr(register FILE *stream);
EXTERN int fclose(FAR FILE *stream);
EXTERN int fflush(FAR FILE *stream);
EXTERN int feof(FAR FILE *stream);
@@ -123,9 +120,6 @@ EXTERN int fsetpos(FAR FILE *stream, FAR fpos_t *pos);
EXTERN long ftell(FAR FILE *stream);
EXTERN size_t fwrite(FAR const void *ptr, size_t size, size_t n_items, FAR FILE *stream);
EXTERN FAR char *gets(FAR char *s);
EXTERN int ungetc(int c, FAR FILE *stream);
/* Operations on the stdout stream, buffers, paths, and the whole printf-family */
EXTERN int printf(const char *format, ...);
EXTERN int puts(FAR const char *s);
@@ -136,6 +130,7 @@ EXTERN int snprintf(FAR char *buf, size_t size, const char *format, ...);
EXTERN int sscanf(const char *buf, const char *fmt, ...);
EXTERN void perror(FAR const char *s);
EXTERN int ungetc(int c, FAR FILE *stream);
EXTERN int vprintf(FAR const char *format, va_list ap);
EXTERN int vfprintf(FAR FILE *stream, const char *format, va_list ap);
EXTERN int vsprintf(FAR char *buf, const char *format, va_list ap);
+1 -1
View File
@@ -232,7 +232,7 @@ struct termios
* cf[set|get][o|i]speed() POSIX interfaces.
*/
speed_t c_speed; /* Input/output speed (non-POSIX)*/
speed_t c_speed; /* Input/output speed (non-POSIX)*/
};
/****************************************************************************
-1
View File
@@ -133,7 +133,6 @@ EXTERN pid_t getpid(void);
EXTERN void _exit(int status) noreturn_function;
EXTERN unsigned int sleep(unsigned int seconds);
EXTERN int usleep(useconds_t usec);
EXTERN int pause(void);
/* File descriptor operations */