Merged patacongo/nuttx into master
This commit is contained in:
commit
d6b846b323
39
ChangeLog
39
ChangeLog
@ -2741,7 +2741,7 @@
|
||||
the worker thread, disabling interrupts does not provide protected; Need to
|
||||
disable pre-emption. (2) Fix handling of touch ID and (2) add some logic to
|
||||
prevent certain kinds of data overrun.
|
||||
* include/nx/nxtk.h and graphics/nx/nxtk/nxtk_internal.h: Move setting
|
||||
* include/nx/nxtk.h and graphics/nx/nxtk/nxtk.h: Move setting
|
||||
of configuration defaults from the internal header file to a place where
|
||||
other logic can use the defaults.
|
||||
* graphics/nxtk/nxtk_events.c: Fixed an important but in the logic that
|
||||
@ -4680,7 +4680,7 @@
|
||||
* arch/arm/src/kl/kl_gpio.c and .h, configs/freedom-kl25z/src/freedom-kl25z.h,
|
||||
and configs/freedom-kl25z/src/kl_led.c: Fixes LEDs on the Freedom KL25Z
|
||||
board (2013-5-6).
|
||||
* arch/arm/src/kinetis/kinetis_pin.c and arch/arm/src/kinetis/kinetis_internal.h:
|
||||
* arch/arm/src/kinetis/kinetis_pin.c and arch/arm/src/kinetis/kinetis.h:
|
||||
The Kinetis GPIO logic had some of the same issues as did the
|
||||
Kinetis L (2013-5-6).
|
||||
* arch/arm/src/stm32/stm32_idle.c: Add an option to conditionally disable
|
||||
@ -11253,3 +11253,38 @@
|
||||
(2015-12-23).
|
||||
* arch/arm/src/stm32: Add timer input capture driver. From Pierre-Noel
|
||||
Bouteville (2015-12-24).
|
||||
* arch/avr: Add support for the Atmega2560. From Dimitry Kloper
|
||||
(2015-12-19).
|
||||
* configs/arduino-mega2560: Add support for the Arduino-Mega2560. From
|
||||
Dimitry Koper (2015-12-29).
|
||||
* sched/signal, sched/mqueue, sched/timer, include/signal.h,
|
||||
include/nuttx/signal, fs/aio, libc/aio, and probably other
|
||||
directories: Add support for the SIGEV_THREAD notification method in
|
||||
struct sigevent. This initial implementation will only work in the
|
||||
FLAT build. See the top-level TODO file for additional details
|
||||
(2015-12-30).
|
||||
* include/nuttx/compiler.h, include/nuttx/streams.h include/stdio.h
|
||||
include/syslog.h libc/stdio/, and libc/syslog: ntroduce support for
|
||||
Atmel toolchain in-flash strings. Atmel toolchain AVR compiler
|
||||
provides a transparent in-flash object support using __flash and
|
||||
__memx symbols. The former indicates to compiler that this is a flash-
|
||||
based object. The later used with pointer indicates that the referenced
|
||||
object may reside either in flash or in RAM. The compiler automatically
|
||||
makes 32-bit pointer with flag indicating whether referenced object is
|
||||
in flash or RAM and generates code to access either in run-time. Thus,
|
||||
any function that accepts __memx object can transparently work with RAM
|
||||
and flash objects.
|
||||
For platforms with a Harvard architecture and a very small RAM like AVR
|
||||
this allows to move all constant strings used in trace messages to flash
|
||||
in the instruction address space, releasing resources for other things.
|
||||
This change introduces IOBJ and IPTR type qualifiers. The 'I' indicates
|
||||
that the object may lie in instruction space on a Harvard architecture
|
||||
machine. For platforms that do not have __flash and __memx or similar
|
||||
symbols IOBJ and IPTR are empty, making the types equivalent to, for
|
||||
example, 'const char' and 'const char*'. For Atmel compiler these will
|
||||
become 'const __flash char' and 'const __memx char*'. All printf()
|
||||
functions and syslog() functions are changed so that the qualifier is
|
||||
used with the format parameter. From Dimitry Kloper (2016-01-05).
|
||||
* drivers/net/tun.c: Fix a compile time error in the TUN driver. From
|
||||
Vladimir Komendantskiy (2016-01-05).
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit fad904fdf955e20b9c96d51abe10df13eafc645d
|
||||
Subproject commit 4217e1a644a0dfe8f111ab07f9df38af2ea906d7
|
@ -1256,6 +1256,8 @@ nuttx/
|
||||
|- configs/
|
||||
| |- amber/
|
||||
| | `- README.txt
|
||||
| |- arduino-mega2560/
|
||||
| | `- README.txt
|
||||
| |- arduino-due/
|
||||
| | `- README.txt
|
||||
| |- avr32dev1/
|
||||
|
39
TODO
39
TODO
@ -1,4 +1,4 @@
|
||||
NuttX TODO List (Last updated December 23, 2015)
|
||||
NuttX TODO List (Last updated January 3, 2016)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||
@ -19,6 +19,7 @@ nuttx/
|
||||
(6) Binary loaders (binfmt/)
|
||||
(11) Network (net/, drivers/net)
|
||||
(4) USB (drivers/usbdev, drivers/usbhost)
|
||||
(1) Other drivers (drivers/)
|
||||
(11) Libraries (libc/, libm/)
|
||||
(11) File system/Generic drivers (fs/, drivers/)
|
||||
(8) Graphics subsystem (graphics/)
|
||||
@ -340,9 +341,17 @@ o Signals (sched/signal, arch/)
|
||||
embedded system.
|
||||
|
||||
Title: SIGEV_THREAD
|
||||
Description: sig_notify() logic does not support SIGEV_THREAD; structure
|
||||
struct sigevent does not provide required members sigev_notify_function
|
||||
or sigev_notify_attributes.
|
||||
Description: Implementation of support for support for SIGEV_THREAD is available
|
||||
only in the FLAT build mode because it uses the OS work queues to
|
||||
perform the callback. The alternative for the PROTECTED and KERNEL
|
||||
builds would be to create pthreads in the user space to perform the
|
||||
callbacks. That is not a very attractive solution due to performance
|
||||
issues. It would also require some additional logic to specify the
|
||||
TCB of the parent so that the pthread could be bound to the correct
|
||||
group.
|
||||
|
||||
There is also some user-space logic in libc/aio/lio_listio.c. That
|
||||
logic could use the user-space work queue for the callbacks.
|
||||
Status: Low, there are alternative designs. However, these features
|
||||
are required by the POSIX standard.
|
||||
Priority: Low for now
|
||||
@ -1600,6 +1609,28 @@ o Build system
|
||||
Status: Open
|
||||
Priority: Low.
|
||||
|
||||
o Other drivers (drivers/)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Title: I2C NOT THREAD SAFE
|
||||
Description: Unlike the SPI interface, the I2C interface has no method to lock
|
||||
the interface. This is a problem for all non-atomic I2C operations
|
||||
in a multi-tasking I2C environment:
|
||||
- I2C_SETFREQUENCY: Frequency setting can be overwritten by other
|
||||
I2C usage.
|
||||
- I2C_SETADDRESS used with I2C_READ, I2C_WRITE, and I2C_WRITEREAD:
|
||||
Similarly, address can and will be changed by other I2C usage.
|
||||
- I2C_TRANSFER: This is the only interface that is properly self
|
||||
contained and protected from most mult-tasking issues. But even
|
||||
this interface can suffer if there are differing frequency settings.
|
||||
Status: Open
|
||||
Priority: Medium-High. The fix is easy but effects a lot of software. There
|
||||
are two ways to fix theses problems: (1) Add a locking method such
|
||||
as is provided with the SPI interface, or (2) make each interface
|
||||
self-contained and atomic: Remove the I2C_FREQUENCY and I2C_ADDRESS
|
||||
methods; Add frequency to all interfaces and add the address to
|
||||
I2C_READ, I2C_WRITE, and I2C_WRITEREAD.
|
||||
|
||||
o Linux/Cywgin simulation (arch/sim)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
2
arch
2
arch
@ -1 +1 @@
|
||||
Subproject commit d7d9c92a8fdf84a14d03b6e1e7c099d4ad623400
|
||||
Subproject commit ea52a0fb857e10b4def9c68ef355db1390be213b
|
2
configs
2
configs
@ -1 +1 @@
|
||||
Subproject commit 7bd42035e04fcc31e13b1a0e15e643395a591a69
|
||||
Subproject commit d28a8f8d19ce051147cf27eb7f85668ea588d33c
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* drivers/mmcsd/mmcsd_internal.h
|
||||
* drivers/mmcsd/mmcsd.h
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -33,8 +33,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __DRIVERS_MMCSD_MMCSD_INTERNAL_H
|
||||
#define __DRIVERS_MMCSD_MMCSD_INTERNAL_H
|
||||
#ifndef __DRIVERS_MMCSD_MMCSD_H
|
||||
#define __DRIVERS_MMCSD_MMCSD_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
@ -102,4 +102,4 @@ EXTERN void mmcsd_dmpcsd(FAR const uint8_t *csd, uint8_t cardtype);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif /* __DRIVERS_MMCSD_MMCSD_INTERNAL_H */
|
||||
#endif /* __DRIVERS_MMCSD_MMCSD_H */
|
@ -47,7 +47,7 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include "mmcsd_csd.h"
|
||||
#include "mmcsd_internal.h"
|
||||
#include "mmcsd.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -65,7 +65,7 @@
|
||||
#include <nuttx/sdio.h>
|
||||
#include <nuttx/mmcsd.h>
|
||||
|
||||
#include "mmcsd_internal.h"
|
||||
#include "mmcsd.h"
|
||||
#include "mmcsd_sdio.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
#include "mmcsd_spi.h"
|
||||
#include "mmcsd_csd.h"
|
||||
#include "mmcsd_internal.h"
|
||||
#include "mmcsd.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -425,75 +425,54 @@ static void tun_receive(FAR struct tun_device_s *priv)
|
||||
|
||||
/* We only accept IP packets of the configured type and ARP packets */
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
#if defined(CONFIG_NET_IPv4)
|
||||
nllvdbg("IPv4 frame\n");
|
||||
NETDEV_RXIPV4(&priv->dev);
|
||||
|
||||
/* Give the IPv4 packet to the network layer */
|
||||
|
||||
ipv4_input(&priv->dev);
|
||||
|
||||
/* If the above function invocation resulted in data that should be
|
||||
* sent out on the network, the field d_len will set to a value > 0.
|
||||
*/
|
||||
|
||||
if (priv->dev.d_len > 0)
|
||||
{
|
||||
nllvdbg("IPv4 frame\n");
|
||||
NETDEV_RXIPV4(&priv->dev);
|
||||
|
||||
/* Give the IPv4 packet to the network layer */
|
||||
|
||||
ipv4_input(&priv->dev);
|
||||
|
||||
/* If the above function invocation resulted in data that should be
|
||||
* sent out on the network, the field d_len will set to a value > 0.
|
||||
*/
|
||||
|
||||
if (priv->dev.d_len > 0)
|
||||
{
|
||||
priv->write_d_len = priv->dev.d_len;
|
||||
tun_transmit(priv);
|
||||
}
|
||||
else
|
||||
{
|
||||
priv->write_d_len = 0;
|
||||
tun_pollnotify(priv, POLLOUT);
|
||||
}
|
||||
priv->write_d_len = priv->dev.d_len;
|
||||
tun_transmit(priv);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (BUF->type == HTONS(ETHTYPE_IP6))
|
||||
{
|
||||
nllvdbg("Iv6 frame\n");
|
||||
NETDEV_RXIPV6(&priv->dev);
|
||||
priv->write_d_len = 0;
|
||||
tun_pollnotify(priv, POLLOUT);
|
||||
}
|
||||
|
||||
/* Give the IPv6 packet to the network layer */
|
||||
#elif defined(CONFIG_NET_IPv6)
|
||||
nllvdbg("Iv6 frame\n");
|
||||
NETDEV_RXIPV6(&priv->dev);
|
||||
|
||||
ipv6_input(&priv->dev);
|
||||
/* Give the IPv6 packet to the network layer */
|
||||
|
||||
/* If the above function invocation resulted in data that should be
|
||||
* sent out on the network, the field d_len will set to a value > 0.
|
||||
*/
|
||||
ipv6_input(&priv->dev);
|
||||
|
||||
if (priv->dev.d_len > 0)
|
||||
{
|
||||
/* Update the Ethernet header with the correct MAC address */
|
||||
/* If the above function invocation resulted in data that should be
|
||||
* sent out on the network, the field d_len will set to a value > 0.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
if (IFF_IS_IPv4(priv->dev.d_flags))
|
||||
{
|
||||
arp_out(&priv->dev);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
{
|
||||
neighbor_out(&priv->dev);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* And send the packet */
|
||||
|
||||
tun_transmit(priv);
|
||||
}
|
||||
if (priv->dev.d_len > 0)
|
||||
{
|
||||
priv->write_d_len = priv->dev.d_len;
|
||||
tun_transmit(priv);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
NETDEV_RXDROPPED(&priv->dev);
|
||||
priv->write_d_len = 0;
|
||||
tun_pollnotify(priv, POLLOUT);
|
||||
}
|
||||
|
||||
#else
|
||||
NETDEV_RXDROPPED(&priv->dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* drivers/power/pm_internal.h
|
||||
* drivers/power/pm
|
||||
*
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -33,8 +33,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __DRIVERS_POWER_PM_INTERNAL_H
|
||||
#define __DRIVERS_POWER_PM_INTERNAL_H
|
||||
#ifndef __DRIVERS_POWER_PM_H
|
||||
#define __DRIVERS_POWER_PM_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
@ -207,4 +207,4 @@ EXTERN void pm_update(int16_t accum);
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* #define __DRIVERS_POWER_PM_INTERNAL_H */
|
||||
#endif /* #define __DRIVERS_POWER_PM_H */
|
@ -43,7 +43,7 @@
|
||||
#include <nuttx/clock.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "pm_internal.h"
|
||||
#include "pm.h"
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
@ -163,4 +163,5 @@ void pm_activity(int priority)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/power/pm.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "pm_internal.h"
|
||||
#include "pm.h"
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include <nuttx/clock.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "pm_internal.h"
|
||||
#include "pm.h"
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
#include <nuttx/power/pm.h>
|
||||
|
||||
#include "pm_internal.h"
|
||||
#include "pm.h"
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
@ -109,4 +109,5 @@ void pm_initialize(void)
|
||||
sem_init(&g_pmglobals.regsem, 0, 1);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
#include <nuttx/power/pm.h>
|
||||
|
||||
#include "pm_internal.h"
|
||||
#include "pm.h"
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
@ -109,4 +109,5 @@ int pm_register(FAR struct pm_callback_s *callbacks)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include <nuttx/power/pm.h>
|
||||
#include <nuttx/wqueue.h>
|
||||
|
||||
#include "pm_internal.h"
|
||||
#include "pm.h"
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
|
@ -900,7 +900,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
irqrestore(state);
|
||||
|
||||
*(int *)arg = count;
|
||||
*(FAR int *)((uintptr_t)arg) = count;
|
||||
ret = 0;
|
||||
}
|
||||
break;
|
||||
@ -923,7 +923,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
irqrestore(state);
|
||||
|
||||
*(int *)arg = count;
|
||||
*(FAR int *)((uintptr_t)arg) = count;
|
||||
ret = 0;
|
||||
}
|
||||
break;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* fs/aio/aio_signal.c
|
||||
*
|
||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -51,29 +51,10 @@
|
||||
|
||||
#ifdef CONFIG_FS_AIO
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: aio_signal
|
||||
*
|
||||
@ -126,6 +107,19 @@ int aio_signal(pid_t pid, FAR struct aiocb *aiocbp)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
/* Notify the client via a function call */
|
||||
|
||||
else if (aiocbp->aio_sigevent.sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
ret = sig_notification(pid, &aiocbp->aio_sigevent);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("ERROR: sig_notification failed: %d\n", ret);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Send the poll signal in any event in case the caller is waiting
|
||||
* on sig_suspend();
|
||||
*/
|
||||
|
@ -495,7 +495,7 @@
|
||||
# define LDIR_GETWCHAR6(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11))
|
||||
# define LDIR_GETWCHAR7(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+2))
|
||||
# define LDIR_GETWCHAR8(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+4))
|
||||
# define LDIR_GETWCHAR8(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6))
|
||||
# define LDIR_GETWCHAR9(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6))
|
||||
# define LDIR_GETWCHAR10(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+8))
|
||||
# define LDIR_GETWCHAR11(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+10))
|
||||
# define LDIR_GETWCHAR12(p) fat_getuint16(UBYTE_PTR(p,LDIR_WCHAR12_13))
|
||||
@ -550,7 +550,7 @@
|
||||
# define LDIR_PUTWCHAR6(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11),v)
|
||||
# define LDIR_PUTWCHAR7(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+2),v)
|
||||
# define LDIR_PUTWCHAR8(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+4),v)
|
||||
# define LDIR_PUTWCHAR8(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6),v)
|
||||
# define LDIR_PUTWCHAR9(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+6),v)
|
||||
# define LDIR_PUTWCHAR10(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+8),v)
|
||||
# define LDIR_PUTWCHAR11(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR6_11+10),v)
|
||||
# define LDIR_PUTWCHAR12(p) fat_putuint16(UBYTE_PTR(p,LDIR_WCHAR12_13),v)
|
||||
|
@ -98,16 +98,16 @@
|
||||
|
||||
/* Timing constants *********************************************************/
|
||||
|
||||
#define NSEC_PER_SEC 1000000000
|
||||
#define USEC_PER_SEC 1000000
|
||||
#define MSEC_PER_SEC 1000
|
||||
#define DSEC_PER_SEC 10
|
||||
#define NSEC_PER_DSEC 100000000
|
||||
#define USEC_PER_DSEC 100000
|
||||
#define MSEC_PER_DSEC 100
|
||||
#define NSEC_PER_MSEC 1000000
|
||||
#define USEC_PER_MSEC 1000
|
||||
#define NSEC_PER_USEC 1000
|
||||
#define NSEC_PER_SEC 1000000000L
|
||||
#define USEC_PER_SEC 1000000L
|
||||
#define MSEC_PER_SEC 1000L
|
||||
#define DSEC_PER_SEC 10L
|
||||
#define NSEC_PER_DSEC 100000000L
|
||||
#define USEC_PER_DSEC 100000L
|
||||
#define MSEC_PER_DSEC 100L
|
||||
#define NSEC_PER_MSEC 1000000L
|
||||
#define USEC_PER_MSEC 1000L
|
||||
#define NSEC_PER_USEC 1000L
|
||||
|
||||
/* If CONFIG_SCHED_TICKLESS is not defined, then the interrupt interval of
|
||||
* the system timer is given by USEC_PER_TICK. This is the expected number
|
||||
|
@ -40,6 +40,8 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@ -127,26 +129,44 @@
|
||||
*/
|
||||
|
||||
#if defined(__m32c__)
|
||||
/* No I-space access qualifiers */
|
||||
|
||||
# define IOBJ
|
||||
# define IPTR
|
||||
|
||||
/* Select the small, 16-bit addressing model */
|
||||
|
||||
# define CONFIG_SMALL_MEMORY 1
|
||||
# define CONFIG_SMALL_MEMORY 1
|
||||
|
||||
/* Long and int are not the same size */
|
||||
|
||||
# define CONFIG_LONG_IS_NOT_INT 1
|
||||
# define CONFIG_LONG_IS_NOT_INT 1
|
||||
|
||||
/* Pointers and int are the same size */
|
||||
|
||||
# undef CONFIG_PTR_IS_NOT_INT
|
||||
|
||||
#elif defined(__AVR__)
|
||||
/* Select the small, 16-bit addressing model */
|
||||
# if defined(CONFIG_AVR_HAS_MEMX_PTR)
|
||||
/* I-space access qualifiers needed by Harvard architecture */
|
||||
|
||||
# define CONFIG_SMALL_MEMORY 1
|
||||
# define IOBJ __flash
|
||||
# define IPTR __memx
|
||||
|
||||
# else
|
||||
/* No I-space access qualifiers */
|
||||
|
||||
# define IOBJ
|
||||
# define IPTR
|
||||
# endif
|
||||
|
||||
/* Select the small, 16-bit addressing model (for D-Space) */
|
||||
|
||||
# define CONFIG_SMALL_MEMORY 1
|
||||
|
||||
/* Long and int are not the same size */
|
||||
|
||||
# define CONFIG_LONG_IS_NOT_INT 1
|
||||
# define CONFIG_LONG_IS_NOT_INT 1
|
||||
|
||||
/* Pointers and int are the same size */
|
||||
|
||||
@ -159,9 +179,14 @@
|
||||
# define CONFIG_HAVE_FARPOINTER 1
|
||||
|
||||
#elif defined(__mc68hc1x__)
|
||||
/* No I-space access qualifiers */
|
||||
|
||||
# define IOBJ
|
||||
# define IPTR
|
||||
|
||||
/* Select the small, 16-bit addressing model */
|
||||
|
||||
# define CONFIG_SMALL_MEMORY 1
|
||||
# define CONFIG_SMALL_MEMORY 1
|
||||
|
||||
/* Normally, mc68hc1x code is compiled with the -mshort option
|
||||
* which results in a 16-bit integer. If -mnoshort is defined
|
||||
@ -171,22 +196,28 @@
|
||||
# if __INT__ == 16
|
||||
/* int is 16-bits, long is 32-bits */
|
||||
|
||||
# define CONFIG_LONG_IS_NOT_INT 1
|
||||
# define CONFIG_LONG_IS_NOT_INT 1
|
||||
|
||||
/* Pointers and int are the same size (16-bits) */
|
||||
/* Pointers and int are the same size (16-bits) */
|
||||
|
||||
# undef CONFIG_PTR_IS_NOT_INT
|
||||
#else
|
||||
# else
|
||||
/* int and long are both 32-bits */
|
||||
|
||||
# undef CONFIG_LONG_IS_NOT_INT
|
||||
|
||||
/* Pointers and int are NOT the same size */
|
||||
/* Pointers and int are NOT the same size */
|
||||
|
||||
# define CONFIG_PTR_IS_NOT_INT 1
|
||||
#endif
|
||||
# define CONFIG_PTR_IS_NOT_INT 1
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
/* No I-space access qualifiers */
|
||||
|
||||
# define IOBJ
|
||||
# define IPTR
|
||||
|
||||
/* Select the large, 32-bit addressing model */
|
||||
|
||||
# undef CONFIG_SMALL_MEMORY
|
||||
@ -491,7 +522,6 @@ extern "C"
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/mqueue.h
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011, 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2011, 2014-2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -80,8 +80,7 @@ struct mqueue_inode_s
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
FAR struct mq_des *ntmqdes; /* Notification: Owning mqdes (NULL if none) */
|
||||
pid_t ntpid; /* Notification: Receiving Task's PID */
|
||||
int ntsigno; /* Notification: Signal number */
|
||||
union sigval ntvalue; /* Notification: Signal value */
|
||||
struct sigevent ntevent; /* Notification description */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* include/nuttx/pthread.h
|
||||
* Non-standard, NuttX-specific pthread-related declarations.
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -51,11 +51,17 @@
|
||||
|
||||
/* Default pthread attribute initializer */
|
||||
|
||||
#if CONFIG_RR_INTERVAL == 0
|
||||
# define PTHREAD_DEFAULT_POLICY SCHED_FIFO
|
||||
#else
|
||||
# define PTHREAD_DEFAULT_POLICY SCHED_RR
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SCHED_SPORADIC
|
||||
# define PTHREAD_ATTR_INITIALIZER \
|
||||
{ \
|
||||
PTHREAD_DEFAULT_PRIORITY, /* priority */ \
|
||||
SCHED_RR, /* policy */ \
|
||||
PTHREAD_DEFAULT_POLICY, /* policy */ \
|
||||
PTHREAD_EXPLICIT_SCHED, /* inheritsched */ \
|
||||
0, /* low_priority */ \
|
||||
0, /* max_repl */ \
|
||||
@ -67,7 +73,7 @@
|
||||
# define PTHREAD_ATTR_INITIALIZER \
|
||||
{ \
|
||||
PTHREAD_DEFAULT_PRIORITY, /* priority */ \
|
||||
SCHED_RR, /* policy */ \
|
||||
PTHREAD_DEFAULT_POLICY, /* policy */ \
|
||||
PTHREAD_EXPLICIT_SCHED, /* inheritsched */ \
|
||||
PTHREAD_STACK_DEFAULT, /* stacksize */ \
|
||||
}
|
||||
|
76
include/nuttx/signal.h
Normal file
76
include/nuttx/signal.h
Normal file
@ -0,0 +1,76 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/signal.h
|
||||
*
|
||||
* Copyright (C) 2015 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_SIGNAL_H
|
||||
#define __INCLUDE_NUTTX_SIGNAL_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if defined(CONFIG_SIG_EVTHREAD) && defined(CONFIG_BUILD_FLAT)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sig_notification
|
||||
*
|
||||
* Description:
|
||||
* Notify a client a signal event via a function call. This function is
|
||||
* an internal OS interface that implements the common logic for signal
|
||||
* event notification for the case of SIGEV_THREAD.
|
||||
*
|
||||
* Input Parameters:
|
||||
* pid - The task/thread ID a the client thread to be signaled.
|
||||
* event - The instance of struct sigevent that describes how to signal
|
||||
* the client.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; A negated errno value is returned
|
||||
* on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sig_notification(pid_t pid, FAR struct sigevent *event);
|
||||
|
||||
#endif /* CONFIG_SIG_EVTHREAD && CONFIG_BUILD_FLAT */
|
||||
#endif /* __INCLUDE_NUTTX_SIGNAL_H */
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/streams.h
|
||||
*
|
||||
* Copyright (C) 2009, 2011-2012, 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2011-2012, 2014-2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -413,9 +413,10 @@ int lib_snoflush(FAR struct lib_sostream_s *this);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int lib_sprintf(FAR struct lib_outstream_s *obj, FAR const char *fmt, ...);
|
||||
int lib_sprintf(FAR struct lib_outstream_s *obj,
|
||||
FAR const IPTR char *fmt, ...);
|
||||
int lib_vsprintf(FAR struct lib_outstream_s *obj,
|
||||
FAR const char *src, va_list ap);
|
||||
FAR const IPTR char *src, va_list ap);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
@ -167,7 +167,7 @@ extern "C"
|
||||
|
||||
WDOG_ID wd_create(void);
|
||||
int wd_delete(WDOG_ID wdog);
|
||||
int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...);
|
||||
int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...);
|
||||
int wd_cancel(WDOG_ID wdog);
|
||||
int wd_gettime(WDOG_ID wdog);
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
#include <stdbool.h> /* C99 boolean types */
|
||||
#include <unistd.h> /* For getpid */
|
||||
#include <semaphore.h> /* Needed for sem_t */
|
||||
#include <signal.h> /* Needed for sigset_t */
|
||||
#include <signal.h> /* Needed for sigset_t, includes this file */
|
||||
#include <time.h> /* Needed for struct timespec */
|
||||
|
||||
/********************************************************************************
|
||||
@ -158,8 +158,11 @@ extern "C"
|
||||
|
||||
/* pthread-specific types */
|
||||
|
||||
typedef int pthread_key_t;
|
||||
typedef FAR void *pthread_addr_t;
|
||||
typedef int pthread_key_t;
|
||||
#define __PTHREAD_KEY_T_DEFINED 1
|
||||
|
||||
typedef FAR void *pthread_addr_t;
|
||||
#define __PTHREAD_ADDR_T_DEFINED 1
|
||||
|
||||
typedef pthread_addr_t (*pthread_startroutine_t)(pthread_addr_t);
|
||||
typedef pthread_startroutine_t pthread_func_t;
|
||||
@ -182,17 +185,24 @@ struct pthread_attr_s
|
||||
struct timespec budget; /* Initial budget */
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct pthread_attr_s pthread_attr_t;
|
||||
#define __PTHREAD_ATTR_T_DEFINED 1
|
||||
|
||||
typedef pid_t pthread_t;
|
||||
#define __PTHREAD_T_DEFINED 1
|
||||
|
||||
typedef int pthread_condattr_t;
|
||||
#define __PTHREAD_CONDATTR_T_DEFINED 1
|
||||
|
||||
struct pthread_cond_s
|
||||
{
|
||||
sem_t sem;
|
||||
};
|
||||
|
||||
typedef struct pthread_cond_s pthread_cond_t;
|
||||
#define __PTHREAD_COND_T_DEFINED 1
|
||||
|
||||
#define PTHREAD_COND_INITIALIZER {SEM_INITIALIZER(0)}
|
||||
|
||||
struct pthread_mutexattr_s
|
||||
@ -202,7 +212,9 @@ struct pthread_mutexattr_s
|
||||
uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct pthread_mutexattr_s pthread_mutexattr_t;
|
||||
#define __PTHREAD_MUTEXATTR_T_DEFINED 1
|
||||
|
||||
struct pthread_mutex_s
|
||||
{
|
||||
@ -213,7 +225,9 @@ struct pthread_mutex_s
|
||||
int nlocks; /* The number of recursive locks held */
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct pthread_mutex_s pthread_mutex_t;
|
||||
#define __PTHREAD_MUTEX_T_DEFINED 1
|
||||
|
||||
#ifdef CONFIG_MUTEX_TYPES
|
||||
# define PTHREAD_MUTEX_INITIALIZER {-1, SEM_INITIALIZER(1), PTHREAD_MUTEX_DEFAULT, 0}
|
||||
@ -225,16 +239,21 @@ struct pthread_barrierattr_s
|
||||
{
|
||||
int pshared;
|
||||
};
|
||||
|
||||
typedef struct pthread_barrierattr_s pthread_barrierattr_t;
|
||||
#define __PTHREAD_BARRIERATTR_T_DEFINED 1
|
||||
|
||||
struct pthread_barrier_s
|
||||
{
|
||||
sem_t sem;
|
||||
unsigned int count;
|
||||
};
|
||||
|
||||
typedef struct pthread_barrier_s pthread_barrier_t;
|
||||
#define __PTHREAD_BARRIER_T_DEFINED 1
|
||||
|
||||
typedef bool pthread_once_t;
|
||||
#define __PTHREAD_ONCE_T_DEFINED 1
|
||||
|
||||
/* Forware references */
|
||||
|
||||
@ -413,4 +432,78 @@ int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
|
||||
}
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
* Minimal Type Definitions
|
||||
********************************************************************************/
|
||||
|
||||
#else /* __INCLUDE_PTHREAD_H */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/* Avoid circular dependencies by assuring that simple type definitions are
|
||||
* available in any inclusion ordering.
|
||||
*/
|
||||
|
||||
#ifndef __PTHREAD_KEY_T_DEFINED
|
||||
typedef int pthread_key_t;
|
||||
# define __PTHREAD_KEY_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_ADDR_T_DEFINED
|
||||
typedef FAR void *pthread_addr_t;
|
||||
# define __PTHREAD_ADDR_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_ATTR_T_DEFINED
|
||||
struct pthread_attr_s;
|
||||
typedef struct pthread_attr_s pthread_attr_t;
|
||||
# define __PTHREAD_ATTR_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_T_DEFINED
|
||||
typedef pid_t pthread_t;
|
||||
# define __PTHREAD_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_CONDATTR_T_DEFINED
|
||||
typedef int pthread_condattr_t;
|
||||
# define __PTHREAD_CONDATTR_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_COND_T_DEFINED
|
||||
struct pthread_cond_s;
|
||||
typedef struct pthread_cond_s pthread_cond_t;
|
||||
# define __PTHREAD_COND_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_MUTEXATTR_T_DEFINED
|
||||
struct pthread_mutexattr_s;
|
||||
typedef struct pthread_mutexattr_s pthread_mutexattr_t;
|
||||
# define __PTHREAD_MUTEXATTR_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_MUTEX_T_DEFINED
|
||||
struct pthread_mutex_s;
|
||||
typedef struct pthread_mutex_s pthread_mutex_t;
|
||||
# define __PTHREAD_MUTEX_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_BARRIERATTR_T_DEFINED
|
||||
struct pthread_barrierattr_s;
|
||||
typedef struct pthread_barrierattr_s pthread_barrierattr_t;
|
||||
# define __PTHREAD_BARRIERATTR_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_BARRIER_T_DEFINED
|
||||
struct pthread_barrier_s;
|
||||
typedef struct pthread_barrier_s pthread_barrier_t;
|
||||
# define __PTHREAD_BARRIER_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __PTHREAD_ONCE_T_DEFINED
|
||||
typedef bool pthread_once_t;
|
||||
# define __PTHREAD_ONCE_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_PTHREAD_H */
|
||||
|
@ -46,6 +46,10 @@
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
# include <pthread.h> /* Needed for pthread_attr_t, includes this file */
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
* Pre-processor Definitions
|
||||
********************************************************************************/
|
||||
@ -162,8 +166,11 @@
|
||||
|
||||
/* Values for the sigev_notify field of struct sigevent */
|
||||
|
||||
#define SIGEV_NONE 0 /* No notification desired */
|
||||
#define SIGEV_SIGNAL 1 /* Notify via signal */
|
||||
#define SIGEV_NONE 0 /* No asynchronous notification is delivered */
|
||||
#define SIGEV_SIGNAL 1 /* Notify via signal,with an application-defined value */
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
# define SIGEV_THREAD 3 /* A notification function is called */
|
||||
#endif
|
||||
|
||||
/* Special values of of sa_handler used by sigaction and sigset. They are all
|
||||
* treated like NULL for now. This is okay for SIG_DFL and SIG_IGN because
|
||||
@ -189,6 +196,7 @@
|
||||
/* This defines a set of 32 signals (numbered 0 through 31). */
|
||||
|
||||
typedef uint32_t sigset_t; /* Bit set of 32 signals */
|
||||
#define __SIGSET_T_DEFINED 1
|
||||
|
||||
/* This defines the type of the siginfo si_value field */
|
||||
|
||||
@ -203,11 +211,22 @@ union sigval
|
||||
* available on a queue
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
typedef CODE void (*sigev_notify_function_t)(union sigval value);
|
||||
#else
|
||||
typedef CODE void (*sigev_notify_function_t)(FAR void *sival_ptr);
|
||||
#endif
|
||||
|
||||
struct sigevent
|
||||
{
|
||||
uint8_t sigev_notify; /* Notification method: SIGEV_SIGNAL or SIGEV_NONE */
|
||||
uint8_t sigev_notify; /* Notification method: SIGEV_SIGNAL, SIGEV_NONE, or SIGEV_THREAD */
|
||||
uint8_t sigev_signo; /* Notification signal */
|
||||
union sigval sigev_value; /* Data passed with notification */
|
||||
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
sigev_notify_function_t sigev_notify_function; /* Notification function */
|
||||
FAR pthread_attr_t *sigev_notify_attributes; /* Notification attributes (not used) */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* The following types is used to pass parameters to/from signal handlers */
|
||||
@ -225,6 +244,7 @@ struct siginfo
|
||||
};
|
||||
|
||||
typedef struct siginfo siginfo_t;
|
||||
#define __SIGINFO_T_DEFINED 1
|
||||
|
||||
/* Non-standard convenience definition of signal handling function types.
|
||||
* These should be used only internally within the NuttX signal logic.
|
||||
@ -251,10 +271,6 @@ struct sigaction
|
||||
#define sa_handler sa_u._sa_handler
|
||||
#define sa_sigaction sa_u._sa_sigaction
|
||||
|
||||
/********************************************************************************
|
||||
* Public Data
|
||||
********************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
* Public Function Prototypes
|
||||
********************************************************************************/
|
||||
@ -297,4 +313,27 @@ int sigqueue(int pid, int signo, FAR void *sival_ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
* Minimal Type Definitions
|
||||
********************************************************************************/
|
||||
|
||||
#else /* __INCLUDE_SIGNAL_H */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Avoid circular dependencies by assuring that simple type definitions are
|
||||
* available in any inclusion ordering.
|
||||
*/
|
||||
|
||||
#ifndef __SIGSET_T_DEFINED
|
||||
typedef uint32_t sigset_t;
|
||||
# define __SIGSET_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#ifndef __SIGINFO_T_DEFINED
|
||||
struct siginfo;
|
||||
typedef struct siginfo siginfo_t;
|
||||
# define __SIGINFO_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_SIGNAL_H */
|
||||
|
@ -143,35 +143,40 @@ int fgetc(FAR FILE *stream);
|
||||
int fgetpos(FAR FILE *stream, FAR fpos_t *pos);
|
||||
char *fgets(FAR char *s, int n, FAR FILE *stream);
|
||||
FAR FILE *fopen(FAR const char *path, FAR const char *type);
|
||||
int fprintf(FAR FILE *stream, FAR const char *format, ...);
|
||||
int fprintf(FAR FILE *stream, FAR const IPTR char *format, ...);
|
||||
int fputc(int c, FAR FILE *stream);
|
||||
int fputs(FAR const char *s, FAR FILE *stream);
|
||||
size_t fread(FAR void *ptr, size_t size, size_t n_items, FAR FILE *stream);
|
||||
FAR FILE *freopen(FAR const char *path, FAR const char *mode, FAR FILE *stream);
|
||||
FAR FILE *freopen(FAR const char *path, FAR const char *mode,
|
||||
FAR FILE *stream);
|
||||
int fseek(FAR FILE *stream, long int offset, int whence);
|
||||
int fsetpos(FAR FILE *stream, FAR fpos_t *pos);
|
||||
long ftell(FAR FILE *stream);
|
||||
size_t fwrite(FAR const void *ptr, size_t size, size_t n_items, FAR FILE *stream);
|
||||
size_t fwrite(FAR const void *ptr, size_t size, size_t n_items,
|
||||
FAR FILE *stream);
|
||||
FAR char *gets(FAR char *s);
|
||||
FAR char *gets_s(FAR char *s, rsize_t n);
|
||||
int ungetc(int c, FAR FILE *stream);
|
||||
|
||||
/* Operations on the stdout stream, buffers, paths, and the whole printf-family */
|
||||
|
||||
int printf(FAR const char *format, ...);
|
||||
int printf(FAR const IPTR char *format, ...);
|
||||
int puts(FAR const char *s);
|
||||
int rename(FAR const char *oldpath, FAR const char *newpath);
|
||||
int sprintf(FAR char *buf, FAR const char *format, ...);
|
||||
int asprintf (FAR char **ptr, FAR const char *fmt, ...);
|
||||
int snprintf(FAR char *buf, size_t size, FAR const char *format, ...);
|
||||
int sprintf(FAR char *buf, FAR const IPTR char *format, ...);
|
||||
int asprintf (FAR char **ptr, FAR const IPTR char *fmt, ...);
|
||||
int snprintf(FAR char *buf, size_t size,
|
||||
FAR const IPTR char *format, ...);
|
||||
int sscanf(FAR const char *buf, FAR const char *fmt, ...);
|
||||
void perror(FAR const char *s);
|
||||
|
||||
int vprintf(FAR const char *format, va_list ap);
|
||||
int vfprintf(FAR FILE *stream, const char *format, va_list ap);
|
||||
int vsprintf(FAR char *buf, const char *format, va_list ap);
|
||||
int vasprintf(FAR char **ptr, const char *fmt, va_list ap);
|
||||
int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap);
|
||||
int vprintf(FAR const IPTR FAR char *format, va_list ap);
|
||||
int vfprintf(FAR FILE *stream, FAR const IPTR char *format,
|
||||
va_list ap);
|
||||
int vsprintf(FAR char *buf, FAR const IPTR char *format, va_list ap);
|
||||
int vasprintf(FAR char **ptr, FAR const IPTR char *fmt, va_list ap);
|
||||
int vsnprintf(FAR char *buf, size_t size, FAR const IPTR char *format,
|
||||
va_list ap);
|
||||
int vsscanf(FAR const char *buf, FAR const char *s, va_list ap);
|
||||
|
||||
/* Operations on file descriptors including:
|
||||
@ -182,8 +187,8 @@ int vsscanf(FAR const char *buf, FAR const char *s, va_list ap);
|
||||
*/
|
||||
|
||||
FAR FILE *fdopen(int fd, FAR const char *type);
|
||||
int dprintf(int fd, FAR const char *fmt, ...);
|
||||
int vdprintf(int fd, FAR const char *fmt, va_list ap);
|
||||
int dprintf(int fd, FAR const IPTR char *fmt, ...);
|
||||
int vdprintf(int fd, FAR const IPTR char *fmt, va_list ap);
|
||||
|
||||
/* Operations on paths */
|
||||
|
||||
|
@ -78,12 +78,12 @@
|
||||
do \
|
||||
{ \
|
||||
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
|
||||
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
|
||||
if ((vvp)->tv_usec < 0) \
|
||||
if ((uvp)->tv_usec > (tvp)->tv_usec) \
|
||||
{ \
|
||||
(vvp)->tv_sec--; \
|
||||
(vvp)->tv_usec += 1000000; \
|
||||
(tvp)->tv_usec += 1000000; \
|
||||
} \
|
||||
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdarg.h>
|
||||
@ -167,8 +168,8 @@ void closelog(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int syslog(int priority, FAR const char *format, ...);
|
||||
int vsyslog(int priority, FAR const char *src, va_list ap);
|
||||
int syslog(int priority, FAR const IPTR char *format, ...);
|
||||
int vsyslog(int priority, FAR const IPTR char *src, va_list ap);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lowsyslog and lowvsyslog
|
||||
@ -198,8 +199,8 @@ int vsyslog(int priority, FAR const char *src, va_list ap);
|
||||
|
||||
#ifdef CONFIG_ARCH_LOWPUTC
|
||||
|
||||
int lowsyslog(int priority, FAR const char *format, ...);
|
||||
int lowvsyslog(int priority, FAR const char *format, va_list ap);
|
||||
int lowsyslog(int priority, FAR const IPTR char *format, ...);
|
||||
int lowvsyslog(int priority, FAR const IPTR char *format, va_list ap);
|
||||
|
||||
#else
|
||||
|
||||
|
@ -45,16 +45,13 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include <nuttx/signal.h>
|
||||
|
||||
#include "libc.h"
|
||||
#include "aio/aio.h"
|
||||
|
||||
#ifdef CONFIG_FS_AIO
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
@ -69,14 +66,6 @@ struct lio_sighand_s
|
||||
struct sigaction oact; /* Signal handler to restore */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
@ -205,14 +194,23 @@ static void lio_sighandler(int signo, siginfo_t *info, void *ucontext)
|
||||
if (sighand->sig->sigev_notify == SIGEV_SIGNAL)
|
||||
{
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
(void)sigqueue(sighand->pid, sighand->sig->sigev_signo,
|
||||
sighand->sig->sigev_value);
|
||||
DEBUGASSERT(sigqueue(sighand->pid, sighand->sig->sigev_signo,
|
||||
sighand->sig->sigev_value));
|
||||
#else
|
||||
(void)sigqueue(sighand->pid, sighand->sig->sigev_signo,
|
||||
sighand->sig->sigev_value.sival_ptr);
|
||||
DEBUGASSERT(sigqueue(sighand->pid, sighand->sig->sigev_signo,
|
||||
sighand->sig->sigev_value.sival_ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
/* Notify the client via a function call */
|
||||
|
||||
else if (ighand->sig->sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
DEBUGASSERT(sig_notification(sighand->pid, &sighand->sig));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* And free the container */
|
||||
|
||||
lib_free(sighand);
|
||||
@ -651,7 +649,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent,
|
||||
*/
|
||||
|
||||
status = lio_waitall(list, nent);
|
||||
if (status < 0 && ret != OK)
|
||||
if (status < 0 && ret == OK)
|
||||
{
|
||||
/* Something bad happened while waiting and this is the first
|
||||
* error to be reported.
|
||||
@ -679,7 +677,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent,
|
||||
/* Setup a signal handler to detect when until all I/O completes. */
|
||||
|
||||
status = lio_sigsetup(list, nent, sig);
|
||||
if (status < 0 && ret != OK)
|
||||
if (status < 0 && ret == OK)
|
||||
{
|
||||
/* Something bad happened while setting up the signal and this
|
||||
* is the first error to be reported.
|
||||
@ -698,8 +696,7 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent,
|
||||
status = sigqueue(getpid(), sig->sigev_signo,
|
||||
sig->sigev_value.sival_ptr);
|
||||
#endif
|
||||
|
||||
if (status < 0 && ret != OK)
|
||||
if (status < 0 && ret == OK)
|
||||
{
|
||||
/* Something bad happened while signalling ourself and this is
|
||||
* the first error to be reported.
|
||||
@ -711,6 +708,24 @@ int lio_listio(int mode, FAR struct aiocb *const list[], int nent,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
/* Notify the client via a function call */
|
||||
|
||||
else if (sig && sig->sigev_notify == SIGEV_THREAD)
|
||||
{
|
||||
status = sig_notification(sighand->pid, &sighand->sig);
|
||||
if (status < 0 && ret == OK)
|
||||
{
|
||||
/* Something bad happened while performing the notification
|
||||
* and this is the first error to be reported.
|
||||
*/
|
||||
|
||||
retcode = -status;
|
||||
ret = ERROR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Case 3: mode == LIO_NOWAIT and sig == NULL
|
||||
*
|
||||
* Just return now.
|
||||
|
@ -52,7 +52,7 @@
|
||||
#include <nuttx/audio/audio.h>
|
||||
#include <nuttx/usb/audio.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#if defined(CONFIG_AUDIO)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/lib_internal.h
|
||||
* libc/libc.h
|
||||
*
|
||||
* Copyright (C) 2007-2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@ -33,8 +33,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __LIBC_LIB_INTERNAL_H
|
||||
#define __LIBC_LIB_INTERNAL_H
|
||||
#ifndef __LIBC_LIBC_H
|
||||
#define __LIBC_LIBC_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
@ -233,4 +233,4 @@ ssize_t lib_parse_hostfile(FAR FILE *stream, FAR struct hostent *host,
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LIBC_LIB_INTERNAL_H */
|
||||
#endif /* __LIBC_LIBC_H */
|
@ -35,7 +35,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_HAVE_DOUBLE
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_HAVE_LONG_DOUBLE
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#ifndef CONFIG_CPP_HAVE_VARARGS
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#if defined(CONFIG_LIBC_IOCTL_VARIADIC) && CONFIG_NFILE_DESCRIPTORS > 0
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#if CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/lib.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#if (!defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)) || \
|
||||
defined(__KERNEL__)
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <errno.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private types
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <netdb.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
#include "netdb/lib_netdb.h"
|
||||
|
||||
#ifdef CONFIG_NETDB_HOSTFILE
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/net/loopback.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
#include "netdb/lib_netdb.h"
|
||||
|
||||
#ifdef CONFIG_NETDB_HOSTFILE
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <netdb.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
#include "netdb/lib_netdb.h"
|
||||
|
||||
#ifdef CONFIG_LIBC_NETDB
|
||||
|
@ -53,7 +53,7 @@
|
||||
#include <nuttx/net/dns.h>
|
||||
#include <nuttx/net/loopback.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
#include "netdb/lib_dns.h"
|
||||
|
||||
#ifdef CONFIG_LIBC_NETDB
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_NETDB_HOSTFILE
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/spawn.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/spawn.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
#include <nuttx/spawn.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
#include <nuttx/spawn.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -92,7 +92,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int asprintf (FAR char **ptr, const char *fmt, ...)
|
||||
int asprintf (FAR char **ptr, FAR const IPTR char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
@ -47,7 +47,7 @@
|
||||
* Name: dprintf
|
||||
****************************************************************************/
|
||||
|
||||
int dprintf(int fd, FAR const char *fmt, ...)
|
||||
int dprintf(int fd, FAR const IPTR char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -42,7 +42,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -79,7 +79,7 @@
|
||||
* Name: fprintf
|
||||
****************************************************************************/
|
||||
|
||||
int fprintf(FAR FILE *stream, FAR const char *fmt, ...)
|
||||
int fprintf(FAR FILE *stream, FAR const IPTR char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int n;
|
||||
|
@ -42,7 +42,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/streams.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_STDIO_LINEBUFFER
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_STDIO_LINEBUFFER
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -76,7 +76,8 @@
|
||||
* Name: lib_sprintf
|
||||
****************************************************************************/
|
||||
|
||||
int lib_sprintf(FAR struct lib_outstream_s *obj, const char *fmt, ...)
|
||||
int lib_sprintf(FAR struct lib_outstream_s *obj, FAR const IPTR char *fmt,
|
||||
...)
|
||||
{
|
||||
va_list ap;
|
||||
int n;
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -145,7 +145,8 @@ enum
|
||||
/* Pointer to ASCII conversion */
|
||||
|
||||
#ifdef CONFIG_PTR_IS_NOT_INT
|
||||
static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags, FAR void *p);
|
||||
static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags,
|
||||
FAR void *p);
|
||||
#ifndef CONFIG_NOPRINTF_FIELDWIDTH
|
||||
static int getsizesize(uint8_t fmt, uint8_t flags, FAR void *p)
|
||||
#endif /* CONFIG_NOPRINTF_FIELDWIDTH */
|
||||
@ -154,7 +155,8 @@ static int getsizesize(uint8_t fmt, uint8_t flags, FAR void *p)
|
||||
/* Unsigned int to ASCII conversion */
|
||||
|
||||
static void utodec(FAR struct lib_outstream_s *obj, unsigned int n);
|
||||
static void utohex(FAR struct lib_outstream_s *obj, unsigned int n, uint8_t a);
|
||||
static void utohex(FAR struct lib_outstream_s *obj, unsigned int n,
|
||||
uint8_t a);
|
||||
static void utooct(FAR struct lib_outstream_s *obj, unsigned int n);
|
||||
static void utobin(FAR struct lib_outstream_s *obj, unsigned int n);
|
||||
static void utoascii(FAR struct lib_outstream_s *obj, uint8_t fmt,
|
||||
@ -169,7 +171,8 @@ static int getusize(uint8_t fmt, uint8_t flags, unsigned int lln);
|
||||
|
||||
#ifdef CONFIG_LONG_IS_NOT_INT
|
||||
static void lutodec(FAR struct lib_outstream_s *obj, unsigned long ln);
|
||||
static void lutohex(FAR struct lib_outstream_s *obj, unsigned long ln, uint8_t a);
|
||||
static void lutohex(FAR struct lib_outstream_s *obj, unsigned long ln,
|
||||
uint8_t a);
|
||||
static void lutooct(FAR struct lib_outstream_s *obj, unsigned long ln);
|
||||
static void lutobin(FAR struct lib_outstream_s *obj, unsigned long ln);
|
||||
static void lutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt,
|
||||
@ -184,14 +187,16 @@ static int getlusize(uint8_t fmt, FAR uint8_t flags, unsigned long ln);
|
||||
|
||||
#if defined(CONFIG_HAVE_LONG_LONG) && defined(CONFIG_LIBC_LONG_LONG)
|
||||
static void llutodec(FAR struct lib_outstream_s *obj, unsigned long long lln);
|
||||
static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long lln, uint8_t a);
|
||||
static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long lln,
|
||||
uint8_t a);
|
||||
static void llutooct(FAR struct lib_outstream_s *obj, unsigned long long lln);
|
||||
static void llutobin(FAR struct lib_outstream_s *obj, unsigned long long lln);
|
||||
static void llutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt,
|
||||
uint8_t flags, unsigned long long lln);
|
||||
#ifndef CONFIG_NOPRINTF_FIELDWIDTH
|
||||
static void llfixup(uint8_t fmt, FAR uint8_t *flags, FAR long long *lln);
|
||||
static int getllusize(uint8_t fmt, FAR uint8_t flags, FAR unsigned long long lln);
|
||||
static int getllusize(uint8_t fmt, FAR uint8_t flags,
|
||||
FAR unsigned long long lln);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -235,7 +240,8 @@ static const char g_nullstring[] = "(null)";
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PTR_IS_NOT_INT
|
||||
static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags, FAR void *p)
|
||||
static void ptohex(FAR struct lib_outstream_s *obj, uint8_t flags,
|
||||
FAR void *p)
|
||||
{
|
||||
union
|
||||
{
|
||||
@ -309,7 +315,8 @@ static void utodec(FAR struct lib_outstream_s *obj, unsigned int n)
|
||||
* Name: utohex
|
||||
****************************************************************************/
|
||||
|
||||
static void utohex(FAR struct lib_outstream_s *obj, unsigned int n, uint8_t a)
|
||||
static void utohex(FAR struct lib_outstream_s *obj, unsigned int n,
|
||||
uint8_t a)
|
||||
{
|
||||
bool nonzero = false;
|
||||
uint8_t bits;
|
||||
@ -376,7 +383,8 @@ static void utobin(FAR struct lib_outstream_s *obj, unsigned int n)
|
||||
* Name: utoascii
|
||||
****************************************************************************/
|
||||
|
||||
static void utoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, uint8_t flags, unsigned int n)
|
||||
static void utoascii(FAR struct lib_outstream_s *obj, uint8_t fmt,
|
||||
uint8_t flags, unsigned int n)
|
||||
{
|
||||
/* Perform the integer conversion according to the format specifier */
|
||||
|
||||
@ -577,7 +585,8 @@ static void lutodec(FAR struct lib_outstream_s *obj, unsigned long n)
|
||||
* Name: lutohex
|
||||
****************************************************************************/
|
||||
|
||||
static void lutohex(FAR struct lib_outstream_s *obj, unsigned long n, uint8_t a)
|
||||
static void lutohex(FAR struct lib_outstream_s *obj, unsigned long n,
|
||||
uint8_t a)
|
||||
{
|
||||
bool nonzero = false;
|
||||
uint8_t bits;
|
||||
@ -644,7 +653,8 @@ static void lutobin(FAR struct lib_outstream_s *obj, unsigned long n)
|
||||
* Name: lutoascii
|
||||
****************************************************************************/
|
||||
|
||||
static void lutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, uint8_t flags, unsigned long ln)
|
||||
static void lutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt,
|
||||
uint8_t flags, unsigned long ln)
|
||||
{
|
||||
/* Perform the integer conversion according to the format specifier */
|
||||
|
||||
@ -827,7 +837,8 @@ static void llutodec(FAR struct lib_outstream_s *obj, unsigned long long n)
|
||||
* Name: llutohex
|
||||
****************************************************************************/
|
||||
|
||||
static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long n, uint8_t a)
|
||||
static void llutohex(FAR struct lib_outstream_s *obj, unsigned long long n,
|
||||
uint8_t a)
|
||||
{
|
||||
bool nonzero = false;
|
||||
uint8_t bits;
|
||||
@ -894,7 +905,8 @@ static void llutobin(FAR struct lib_outstream_s *obj, unsigned long long n)
|
||||
* Name: llutoascii
|
||||
****************************************************************************/
|
||||
|
||||
static void llutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt, uint8_t flags, unsigned long long lln)
|
||||
static void llutoascii(FAR struct lib_outstream_s *obj, uint8_t fmt,
|
||||
uint8_t flags, unsigned long long lln)
|
||||
{
|
||||
/* Perform the integer conversion according to the format specifier */
|
||||
|
||||
@ -1164,7 +1176,8 @@ static void postjustify(FAR struct lib_outstream_s *obj, uint8_t fmt,
|
||||
* libc/stdio/lib_vsprintf
|
||||
****************************************************************************/
|
||||
|
||||
int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list ap)
|
||||
int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const IPTR char *src,
|
||||
va_list ap)
|
||||
{
|
||||
FAR char *ptmp;
|
||||
#ifndef CONFIG_NOPRINTF_FIELDWIDTH
|
||||
@ -1616,5 +1629,3 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a
|
||||
|
||||
return obj->nput;
|
||||
}
|
||||
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_LOWGETC
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include <errno.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -86,7 +86,7 @@
|
||||
* Name: printf
|
||||
****************************************************************************/
|
||||
|
||||
int printf(FAR const char *fmt, ...)
|
||||
int printf(FAR const IPTR char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
@ -42,7 +42,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib_internal.h"
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user