mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a Signed-off-by: ligd <liguiding@fishsemi.com>
This commit is contained in:
@@ -50,6 +50,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Configuration */
|
/* Configuration */
|
||||||
|
|
||||||
#undef HAVE_KERNEL_HEAP
|
#undef HAVE_KERNEL_HEAP
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Configuration */
|
/* Configuration */
|
||||||
|
|
||||||
#undef HAVE_KERNEL_HEAP
|
#undef HAVE_KERNEL_HEAP
|
||||||
|
|||||||
@@ -455,7 +455,9 @@ static struct usbhost_cdcacm_s g_prealloc[CONFIG_USBHOST_CDCACM_NPREALLOC];
|
|||||||
static FAR struct usbhost_freestate_s *g_freelist;
|
static FAR struct usbhost_freestate_s *g_freelist;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This is a bitmap that is used to allocate device minor numbers /dev/ttyACM[n]. */
|
/* This is a bitmap that is used to allocate device
|
||||||
|
* minor numbers /dev/ttyACM[n].
|
||||||
|
*/
|
||||||
|
|
||||||
static uint32_t g_devinuse;
|
static uint32_t g_devinuse;
|
||||||
|
|
||||||
@@ -1109,7 +1111,9 @@ static void usbhost_rxdata_work(FAR void *arg)
|
|||||||
while (priv->rxena && !priv->disconnected)
|
while (priv->rxena && !priv->disconnected)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* Stop now if there is no room for another character in the RX buffer. */
|
/* Stop now if there is no room for another
|
||||||
|
* character in the RX buffer.
|
||||||
|
*/
|
||||||
|
|
||||||
if (nexthead == rxbuf->tail)
|
if (nexthead == rxbuf->tail)
|
||||||
{
|
{
|
||||||
@@ -1938,11 +1942,15 @@ usbhost_create(FAR struct usbhost_hubport_s *hport,
|
|||||||
priv->usbclass.connect = usbhost_connect;
|
priv->usbclass.connect = usbhost_connect;
|
||||||
priv->usbclass.disconnected = usbhost_disconnected;
|
priv->usbclass.disconnected = usbhost_disconnected;
|
||||||
|
|
||||||
/* The initial reference count is 1... One reference is held by the driver */
|
/* The initial reference count is 1...
|
||||||
|
* One reference is held by the driver
|
||||||
|
*/
|
||||||
|
|
||||||
priv->crefs = 1;
|
priv->crefs = 1;
|
||||||
|
|
||||||
/* Initialize semaphores (this works okay in the interrupt context) */
|
/* Initialize semaphores
|
||||||
|
* (this works okay in the interrupt context)
|
||||||
|
*/
|
||||||
|
|
||||||
nxsem_init(&priv->exclsem, 0, 1);
|
nxsem_init(&priv->exclsem, 0, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -416,7 +416,9 @@ static const uint8_t encoding[USBHID_NUMENCODINGS] =
|
|||||||
KEYCODE_F11, KEYCODE_F12,
|
KEYCODE_F11, KEYCODE_F12,
|
||||||
KEYCODE_PRTSCRN, KEYCODE_SCROLLLOCK,
|
KEYCODE_PRTSCRN, KEYCODE_SCROLLLOCK,
|
||||||
|
|
||||||
/* 0x48-0x4f: Pause,Insert,Home,PageUp,DeleteForward,End,PageDown,RightArrow */
|
/* 0x48-0x4f: Pause,Insert,Home,PageUp,
|
||||||
|
* DeleteForward,End,PageDown,RightArrow
|
||||||
|
*/
|
||||||
|
|
||||||
KEYCODE_PAUSE, KEYCODE_INSERT,
|
KEYCODE_PAUSE, KEYCODE_INSERT,
|
||||||
KEYCODE_HOME, KEYCODE_PAGEUP,
|
KEYCODE_HOME, KEYCODE_PAGEUP,
|
||||||
@@ -469,7 +471,9 @@ static const uint8_t encoding[USBHID_NUMENCODINGS] =
|
|||||||
KEYCODE_COPY, KEYCODE_PASTE,
|
KEYCODE_COPY, KEYCODE_PASTE,
|
||||||
KEYCODE_FIND, KEYCODE_MUTE,
|
KEYCODE_FIND, KEYCODE_MUTE,
|
||||||
|
|
||||||
/* 0x80-0x87: VolUp,VolDown,LCapsLock,lNumLock,LScrollLock,,,=,International1 */
|
/* 0x80-0x87: VolUp,VolDown,LCapsLock,lNumLock,LScrollLock,,,
|
||||||
|
* =,International1
|
||||||
|
*/
|
||||||
|
|
||||||
KEYCODE_VOLUP, KEYCODE_VOLDOWN,
|
KEYCODE_VOLUP, KEYCODE_VOLDOWN,
|
||||||
KEYCODE_LCAPSLOCK, KEYCODE_LNUMLOCK,
|
KEYCODE_LCAPSLOCK, KEYCODE_LNUMLOCK,
|
||||||
@@ -1481,7 +1485,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||||||
uinfo("Interface descriptor\n");
|
uinfo("Interface descriptor\n");
|
||||||
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
|
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
|
||||||
|
|
||||||
/* Did we already find what we needed from a preceding interface? */
|
/* Did we already find what we needed
|
||||||
|
* from a preceding interface?
|
||||||
|
*/
|
||||||
|
|
||||||
if ((found & USBHOST_RQDFOUND) == USBHOST_RQDFOUND)
|
if ((found & USBHOST_RQDFOUND) == USBHOST_RQDFOUND)
|
||||||
{
|
{
|
||||||
@@ -1605,7 +1611,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||||||
|
|
||||||
if (found == USBHOST_ALLFOUND)
|
if (found == USBHOST_ALLFOUND)
|
||||||
{
|
{
|
||||||
/* Yes.. then break out of the loop and use the preceding interface */
|
/* Yes.. then break out of the loop
|
||||||
|
* and use the preceding interface
|
||||||
|
*/
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
@@ -1681,7 +1689,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||||||
char devname[DEV_NAMELEN];
|
char devname[DEV_NAMELEN];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Set aside a transfer buffer for exclusive use by the keyboard class driver */
|
/* Set aside a transfer buffer for exclusive
|
||||||
|
* use by the keyboard class driver
|
||||||
|
*/
|
||||||
|
|
||||||
ret = usbhost_tdalloc(priv);
|
ret = usbhost_tdalloc(priv);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -1731,7 +1741,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||||||
(FAR char * const *)NULL);
|
(FAR char * const *)NULL);
|
||||||
if (priv->pollpid < 0)
|
if (priv->pollpid < 0)
|
||||||
{
|
{
|
||||||
/* Failed to started the poll thread... probably due to memory resources */
|
/* Failed to started the poll thread...
|
||||||
|
* probably due to memory resources
|
||||||
|
*/
|
||||||
|
|
||||||
usbhost_givesem(&g_exclsem);
|
usbhost_givesem(&g_exclsem);
|
||||||
ret = (int)priv->pollpid;
|
ret = (int)priv->pollpid;
|
||||||
|
|||||||
@@ -237,7 +237,9 @@ struct usbhost_state_s
|
|||||||
|
|
||||||
struct usbhost_class_s usbclass;
|
struct usbhost_class_s usbclass;
|
||||||
|
|
||||||
/* This is an instance of the USB host driver bound to this class instance */
|
/* This is an instance of the USB host driver
|
||||||
|
* bound to this class instance
|
||||||
|
*/
|
||||||
|
|
||||||
struct usbhost_driver_s *drvr;
|
struct usbhost_driver_s *drvr;
|
||||||
|
|
||||||
@@ -1173,7 +1175,9 @@ static int usbhost_mouse_poll(int argc, char *argv[])
|
|||||||
|
|
||||||
priv->sample.valid = true;
|
priv->sample.valid = true;
|
||||||
|
|
||||||
/* Indicate the availability of new sample data for this ID */
|
/* Indicate the availability of new sample data
|
||||||
|
* for this ID
|
||||||
|
*/
|
||||||
|
|
||||||
priv->sample.id = priv->id;
|
priv->sample.id = priv->id;
|
||||||
#else
|
#else
|
||||||
@@ -1498,7 +1502,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||||||
uinfo("Interface descriptor\n");
|
uinfo("Interface descriptor\n");
|
||||||
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
|
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
|
||||||
|
|
||||||
/* Did we already find what we needed from a preceding interface? */
|
/* Did we already find what we needed from
|
||||||
|
* a preceding interface?
|
||||||
|
*/
|
||||||
|
|
||||||
if ((found & USBHOST_ALLFOUND) == USBHOST_ALLFOUND)
|
if ((found & USBHOST_ALLFOUND) == USBHOST_ALLFOUND)
|
||||||
{
|
{
|
||||||
@@ -1588,7 +1594,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||||||
|
|
||||||
if (found == USBHOST_ALLFOUND)
|
if (found == USBHOST_ALLFOUND)
|
||||||
{
|
{
|
||||||
/* Yes.. then break out of the loop and use the preceding interface */
|
/* Yes.. then break out of the loop
|
||||||
|
* and use the preceding interface
|
||||||
|
*/
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
@@ -1646,7 +1654,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||||||
char devname[DEV_NAMELEN];
|
char devname[DEV_NAMELEN];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Set aside a transfer buffer for exclusive use by the mouse class driver */
|
/* Set aside a transfer buffer for exclusive
|
||||||
|
* use by the mouse class driver
|
||||||
|
*/
|
||||||
|
|
||||||
ret = usbhost_tdalloc(priv);
|
ret = usbhost_tdalloc(priv);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -1696,7 +1706,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||||||
(FAR char * const *)NULL);
|
(FAR char * const *)NULL);
|
||||||
if (priv->pollpid < 0)
|
if (priv->pollpid < 0)
|
||||||
{
|
{
|
||||||
/* Failed to started the poll thread... probably due to memory resources */
|
/* Failed to started the poll thread...
|
||||||
|
* probably due to memory resources
|
||||||
|
*/
|
||||||
|
|
||||||
usbhost_givesem(&g_exclsem);
|
usbhost_givesem(&g_exclsem);
|
||||||
ret = priv->pollpid;
|
ret = priv->pollpid;
|
||||||
|
|||||||
@@ -1241,7 +1241,9 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv)
|
|||||||
|
|
||||||
DEBUGASSERT(priv != NULL);
|
DEBUGASSERT(priv != NULL);
|
||||||
|
|
||||||
/* Set aside a transfer buffer for exclusive use by the mass storage driver */
|
/* Set aside a transfer buffer for exclusive
|
||||||
|
* use by the mass storage driver
|
||||||
|
*/
|
||||||
|
|
||||||
ret = usbhost_talloc(priv);
|
ret = usbhost_talloc(priv);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -1729,7 +1731,9 @@ static FAR struct usbhost_class_s *
|
|||||||
|
|
||||||
priv->crefs = 1;
|
priv->crefs = 1;
|
||||||
|
|
||||||
/* Initialize semaphores (this works okay in the interrupt context) */
|
/* Initialize semaphores
|
||||||
|
* (this works okay in the interrupt context)
|
||||||
|
*/
|
||||||
|
|
||||||
nxsem_init(&priv->exclsem, 0, 1);
|
nxsem_init(&priv->exclsem, 0, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -150,8 +150,8 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/* Otherwise, the kernel-space allocators are declared in include/nuttx/mm/mm.h
|
/* Otherwise, the kernel-space allocators are declared in
|
||||||
* and we can call them directly.
|
* include/nuttx/mm/mm.h and we can call them directly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -168,6 +168,7 @@ extern "C"
|
|||||||
* unprivileged code.
|
* unprivileged code.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Functions defined in group/group_malloc.c ********************************/
|
/* Functions defined in group/group_malloc.c ********************************/
|
||||||
|
|
||||||
FAR void *group_malloc(FAR struct task_group_s *group, size_t nbytes);
|
FAR void *group_malloc(FAR struct task_group_s *group, size_t nbytes);
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/nuttx/mm/mm.h
|
* include/nuttx/mm/mm.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2013-2014, 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2013-2014, 2017 Gregory Nutt.
|
||||||
|
* All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -52,6 +53,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Configuration ************************************************************/
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
/* If the MCU has a small (16-bit) address capability, then we will use
|
/* If the MCU has a small (16-bit) address capability, then we will use
|
||||||
* a smaller chunk header that contains 16-bit size/offset information.
|
* a smaller chunk header that contains 16-bit size/offset information.
|
||||||
* We will also use the smaller header on MCUs with wider addresses if
|
* We will also use the smaller header on MCUs with wider addresses if
|
||||||
@@ -111,6 +113,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Chunk Header Definitions *************************************************/
|
/* Chunk Header Definitions *************************************************/
|
||||||
|
|
||||||
/* These definitions define the characteristics of allocator
|
/* These definitions define the characteristics of allocator
|
||||||
*
|
*
|
||||||
* MM_MIN_SHIFT is used to define MM_MIN_CHUNK.
|
* MM_MIN_SHIFT is used to define MM_MIN_CHUNK.
|
||||||
@@ -366,12 +369,12 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap);
|
|||||||
int mm_trysemaphore(FAR struct mm_heap_s *heap);
|
int mm_trysemaphore(FAR struct mm_heap_s *heap);
|
||||||
void mm_givesemaphore(FAR struct mm_heap_s *heap);
|
void mm_givesemaphore(FAR struct mm_heap_s *heap);
|
||||||
|
|
||||||
/* Functions contained in umm_sem.c ****************************************/
|
/* Functions contained in umm_sem.c *****************************************/
|
||||||
|
|
||||||
int umm_trysemaphore(void);
|
int umm_trysemaphore(void);
|
||||||
void umm_givesemaphore(void);
|
void umm_givesemaphore(void);
|
||||||
|
|
||||||
/* Functions contained in kmm_sem.c ****************************************/
|
/* Functions contained in kmm_sem.c *****************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||||
int kmm_trysemaphore(void);
|
int kmm_trysemaphore(void);
|
||||||
|
|||||||
@@ -66,8 +66,8 @@
|
|||||||
* (which runs at the lowest of priority and may not be appropriate
|
* (which runs at the lowest of priority and may not be appropriate
|
||||||
* if memory reclamation is of high priority). If CONFIG_SCHED_HPWORK
|
* if memory reclamation is of high priority). If CONFIG_SCHED_HPWORK
|
||||||
* is enabled, then the following options can also be used:
|
* is enabled, then the following options can also be used:
|
||||||
* CONFIG_SCHED_HPNTHREADS - The number of thread in the high-priority queue's
|
* CONFIG_SCHED_HPNTHREADS - The number of thread in the high-priority
|
||||||
* thread pool. Default: 1
|
* queue's thread pool. Default: 1
|
||||||
* CONFIG_SCHED_HPWORKPRIORITY - The execution priority of the high-
|
* CONFIG_SCHED_HPWORKPRIORITY - The execution priority of the high-
|
||||||
* priority worker thread. Default: 224
|
* priority worker thread. Default: 224
|
||||||
* CONFIG_SCHED_HPWORKSTACKSIZE - The stack size allocated for the worker
|
* CONFIG_SCHED_HPWORKSTACKSIZE - The stack size allocated for the worker
|
||||||
@@ -379,8 +379,8 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker,
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Cancel previously queued work. This removes work from the work queue.
|
* Cancel previously queued work. This removes work from the work queue.
|
||||||
* After work has been cancelled, it may be re-queue by calling work_queue()
|
* After work has been cancelled, it may be re-queue by calling
|
||||||
* again.
|
* work_queue() again.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* qid - The work queue ID
|
* qid - The work queue ID
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* libs/libc/misc/lib_stream.c
|
* libs/libc/misc/lib_stream.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2011, 2013-2014, 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2011, 2013-2014, 2017 Gregory Nutt.
|
||||||
|
* All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
@@ -151,7 +151,8 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem)
|
|||||||
* index past the tail chunk because it is always allocated.
|
* index past the tail chunk because it is always allocated.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
andbeyond = (FAR struct mm_allocnode_s *)((FAR char *)next + next->size);
|
andbeyond = (FAR struct mm_allocnode_s *)
|
||||||
|
((FAR char *)next + next->size);
|
||||||
|
|
||||||
/* Remove the next node. There must be a predecessor,
|
/* Remove the next node. There must be a predecessor,
|
||||||
* but there may not be a successor node.
|
* but there may not be a successor node.
|
||||||
@@ -167,7 +168,8 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem)
|
|||||||
/* Then merge the two chunks */
|
/* Then merge the two chunks */
|
||||||
|
|
||||||
node->size += next->size;
|
node->size += next->size;
|
||||||
andbeyond->preceding = node->size | (andbeyond->preceding & MM_ALLOC_BIT);
|
andbeyond->preceding = node->size |
|
||||||
|
(andbeyond->preceding & MM_ALLOC_BIT);
|
||||||
next = (FAR struct mm_freenode_s *)andbeyond;
|
next = (FAR struct mm_freenode_s *)andbeyond;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,8 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
|
|||||||
{
|
{
|
||||||
/* Get a pointer to the next node in physical memory */
|
/* Get a pointer to the next node in physical memory */
|
||||||
|
|
||||||
next = (FAR struct mm_freenode_s *)(((FAR char *)node) + node->size);
|
next = (FAR struct mm_freenode_s *)
|
||||||
|
(((FAR char *)node) + node->size);
|
||||||
|
|
||||||
/* Create the remainder node */
|
/* Create the remainder node */
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -51,6 +51,10 @@
|
|||||||
# include <nuttx/irq.h>
|
# include <nuttx/irq.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MONITOR_MM_SEMAPHORE
|
||||||
|
# include <debug.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -86,7 +90,6 @@
|
|||||||
/* Define MONITOR_MM_SEMAPHORE to enable semaphore state monitoring */
|
/* Define MONITOR_MM_SEMAPHORE to enable semaphore state monitoring */
|
||||||
|
|
||||||
#ifdef MONITOR_MM_SEMAPHORE
|
#ifdef MONITOR_MM_SEMAPHORE
|
||||||
# include <debug.h>
|
|
||||||
# define msemerr _err
|
# define msemerr _err
|
||||||
# define msemwarn _warn
|
# define msemwarn _warn
|
||||||
# define mseminfo _info
|
# define mseminfo _info
|
||||||
|
|||||||
@@ -130,9 +130,9 @@ void bluetooth_container_initialize(void)
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* A reference to the allocated container structure. All user fields in this
|
* A reference to the allocated container structure.
|
||||||
* structure have been zeroed. On a failure to allocate, NULL is
|
* All user fields in this structure have been zeroed.
|
||||||
* returned.
|
* On a failure to allocate, NULL is returned.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* The caller has locked the network.
|
* The caller has locked the network.
|
||||||
|
|||||||
@@ -130,9 +130,9 @@ void ieee802154_container_initialize(void)
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* A reference to the allocated container structure. All user fields in this
|
* A reference to the allocated container structure.
|
||||||
* structure have been zeroed. On a failure to allocate, NULL is
|
* All user fields in this structure have been zeroed.
|
||||||
* returned.
|
* On a failure to allocate, NULL is returned.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* The caller has locked the network.
|
* The caller has locked the network.
|
||||||
|
|||||||
+15
-13
@@ -2,7 +2,8 @@
|
|||||||
* net/igmp/igmp_group.c
|
* net/igmp/igmp_group.c
|
||||||
* IGMP group data structure management logic
|
* IGMP group data structure management logic
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010, 2013-2014, 2016, 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2013-2014, 2016, 2018 Gregory Nutt.
|
||||||
|
* All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* The NuttX implementation of IGMP was inspired by the IGMP add-on for the
|
* The NuttX implementation of IGMP was inspired by the IGMP add-on for the
|
||||||
@@ -20,21 +21,21 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
* 3. Neither the name of CITEL Technologies Ltd nor the names of its
|
||||||
* may be used to endorse or promote products derived from this software
|
* contributors may be used to endorse or promote products derived
|
||||||
* without specific prior written permission.
|
* from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
* SUCH DAMAGE.
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -224,7 +225,8 @@ FAR struct igmp_group_s *igmp_grpallocfind(FAR struct net_driver_s *dev,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void igmp_grpfree(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group)
|
void igmp_grpfree(FAR struct net_driver_s *dev,
|
||||||
|
FAR struct igmp_group_s *group)
|
||||||
{
|
{
|
||||||
grpinfo("Free: %p flags: %02x\n", group, group->flags);
|
grpinfo("Free: %p flags: %02x\n", group, group->flags);
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -14,21 +14,21 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
* 3. Neither the name of CITEL Technologies Ltd nor the names of its
|
||||||
* may be used to endorse or promote products derived from this software
|
* contributors may be used to endorse or promote products derived
|
||||||
* without specific prior written permission.
|
* from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
|
||||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
* SUCH DAMAGE.
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -62,9 +62,9 @@
|
|||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* The g_free_reass is a list of reassembly buffer structures that are available for
|
/* The g_free_reass is a list of reassembly buffer structures that are
|
||||||
* general use. The number of messages in this list is a system configuration
|
* available for general use. The number of messages in this list is a
|
||||||
* item. Protected only by the network lock.
|
* system configuration item. Protected only by the network lock.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FAR struct sixlowpan_reassbuf_s *g_free_reass;
|
static FAR struct sixlowpan_reassbuf_s *g_free_reass;
|
||||||
@@ -75,7 +75,8 @@ static FAR struct sixlowpan_reassbuf_s *g_active_reass;
|
|||||||
|
|
||||||
/* Pool of pre-allocated reassembly buffer structures */
|
/* Pool of pre-allocated reassembly buffer structures */
|
||||||
|
|
||||||
static struct sixlowpan_reassbuf_s g_metadata_pool[CONFIG_NET_6LOWPAN_NREASSBUF];
|
static struct sixlowpan_reassbuf_s
|
||||||
|
g_metadata_pool[CONFIG_NET_6LOWPAN_NREASSBUF];
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@@ -245,8 +246,8 @@ void sixlowpan_reass_initialize(void)
|
|||||||
FAR struct sixlowpan_reassbuf_s *reass;
|
FAR struct sixlowpan_reassbuf_s *reass;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Initialize g_free_reass, the list of reassembly buffer structures that are
|
/* Initialize g_free_reass, the list of reassembly buffer structures that
|
||||||
* available for allocation.
|
* are available for allocation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
g_free_reass = NULL;
|
g_free_reass = NULL;
|
||||||
@@ -314,8 +315,8 @@ FAR struct sixlowpan_reassbuf_s *
|
|||||||
#ifdef CONFIG_NET_6LOWPAN_REASS_STATIC
|
#ifdef CONFIG_NET_6LOWPAN_REASS_STATIC
|
||||||
reass = NULL;
|
reass = NULL;
|
||||||
#else
|
#else
|
||||||
/* If we cannot get a reassembly buffer instance from the free list, then we
|
/* If we cannot get a reassembly buffer instance from the free list,
|
||||||
* will have to allocate one from the kernel memory pool.
|
* then we will have to allocate one from the kernel memory pool.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
reass = (FAR struct sixlowpan_reassbuf_s *)
|
reass = (FAR struct sixlowpan_reassbuf_s *)
|
||||||
@@ -428,8 +429,8 @@ void sixlowpan_reass_free(FAR struct sixlowpan_reassbuf_s *reass)
|
|||||||
|
|
||||||
sixlowpan_remove_active(reass);
|
sixlowpan_remove_active(reass);
|
||||||
|
|
||||||
/* If this is a pre-allocated reassembly buffer structure, then just put it back
|
/* If this is a pre-allocated reassembly buffer structure, then just put it
|
||||||
* in the free list.
|
* back in the free list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (reass->rb_pool == REASS_POOL_PREALLOCATED)
|
if (reass->rb_pool == REASS_POOL_PREALLOCATED)
|
||||||
|
|||||||
@@ -311,7 +311,8 @@ static inline void group_release(FAR struct task_group_s *group)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef HAVE_GROUP_MEMBERS
|
#ifdef HAVE_GROUP_MEMBERS
|
||||||
static inline void group_removemember(FAR struct task_group_s *group, pid_t pid)
|
static inline void group_removemember(FAR struct task_group_s *group,
|
||||||
|
pid_t pid)
|
||||||
{
|
{
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -193,7 +193,9 @@ volatile dq_queue_t g_waitingforfill;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
||||||
/* This is the list of all tasks that have been stopped via SIGSTOP or SIGSTP */
|
/* This is the list of all tasks that have been stopped
|
||||||
|
* via SIGSTOP or SIGSTP
|
||||||
|
*/
|
||||||
|
|
||||||
volatile dq_queue_t g_stoppedtasks;
|
volatile dq_queue_t g_stoppedtasks;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ static const char g_pthreadname[] = "<pthread>";
|
|||||||
* This functions sets up parameters in the Task Control Block (TCB) in
|
* This functions sets up parameters in the Task Control Block (TCB) in
|
||||||
* preparation for starting a new thread.
|
* preparation for starting a new thread.
|
||||||
*
|
*
|
||||||
* pthread_argsetup() is called from task_init() and nxtask_start() to create
|
* pthread_argsetup() is called from task_init() and nxtask_start() to
|
||||||
* a new task (with arguments cloned via strdup) or pthread_create() which
|
* create a new task (with arguments cloned via strdup) or pthread_create()
|
||||||
* has one argument passed by value (distinguished by the pthread boolean
|
* which has one argument passed by value (distinguished by the pthread
|
||||||
* argument).
|
* boolean argument).
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* tcb - Address of the new task's TCB
|
* tcb - Address of the new task's TCB
|
||||||
@@ -260,7 +260,8 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr,
|
|||||||
|
|
||||||
/* Allocate a TCB for the new task. */
|
/* Allocate a TCB for the new task. */
|
||||||
|
|
||||||
ptcb = (FAR struct pthread_tcb_s *)kmm_zalloc(sizeof(struct pthread_tcb_s));
|
ptcb = (FAR struct pthread_tcb_s *)
|
||||||
|
kmm_zalloc(sizeof(struct pthread_tcb_s));
|
||||||
if (!ptcb)
|
if (!ptcb)
|
||||||
{
|
{
|
||||||
serr("ERROR: Failed to allocate TCB\n");
|
serr("ERROR: Failed to allocate TCB\n");
|
||||||
|
|||||||
@@ -1037,7 +1037,9 @@ int sched_sporadic_resume(FAR struct tcb_s *tcb)
|
|||||||
|
|
||||||
unrealized = now - sporadic->eventtime;
|
unrealized = now - sporadic->eventtime;
|
||||||
|
|
||||||
/* Ignore very short pre-emptions that are below our timing resolution. */
|
/* Ignore very short pre-emptions that are below
|
||||||
|
* our timing resolution.
|
||||||
|
*/
|
||||||
|
|
||||||
if (unrealized > 0)
|
if (unrealized > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
+20
-18
@@ -12,30 +12,31 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice,
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer.
|
* this list of conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* 3. Neither the name of the copyright holder nor the names of its
|
* 3. Neither the name of the copyright holder nor the names of its
|
||||||
* contributors may be used to endorse or promote products derived from this
|
* contributors may be used to endorse or promote products derived from
|
||||||
* software without specific prior written permission.
|
* this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -300,7 +301,8 @@ FAR struct bt_buf_s *bt_buf_alloc(enum bt_buf_type_e type,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
buf = (FAR struct bt_buf_s *)kmm_malloc((sizeof (struct bt_buf_s)));
|
buf = (FAR struct bt_buf_s *)
|
||||||
|
kmm_malloc((sizeof (struct bt_buf_s)));
|
||||||
|
|
||||||
/* Check if we successfully allocated the buffer structure */
|
/* Check if we successfully allocated the buffer structure */
|
||||||
|
|
||||||
|
|||||||
@@ -51,9 +51,10 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* NOTE: The CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE options is marked as marked
|
/* NOTE: The CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE options is marked as
|
||||||
* 'experimental' and with the default 0 zero because there are no interrupt
|
* marked 'experimental' and with the default 0 zero because there are no
|
||||||
* level allocations performed by the current IEEE 802.15.4 MAC code.
|
* interrupt level allocations performed by the current IEEE 802.15.4 MAC
|
||||||
|
* code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(CONFIG_IEEE802154_PRIMITIVE_PREALLOC) || \
|
#if !defined(CONFIG_IEEE802154_PRIMITIVE_PREALLOC) || \
|
||||||
@@ -101,8 +102,8 @@ struct ieee802154_priv_primitive_s
|
|||||||
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > 0
|
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > 0
|
||||||
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE
|
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE
|
||||||
/* The g_primfree is a list of primitive structures that are available for
|
/* The g_primfree is a list of primitive structures that are available for
|
||||||
* general use. The number of messages in this list is a system configuration
|
* general use. The number of messages in this list is a system
|
||||||
* item.
|
* configuration item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct ieee802154_priv_primitive_s *g_primfree;
|
static struct ieee802154_priv_primitive_s *g_primfree;
|
||||||
@@ -118,7 +119,8 @@ static struct ieee802154_priv_primitive_s *g_primfree_irq;
|
|||||||
|
|
||||||
/* Pool of pre-allocated primitive structures */
|
/* Pool of pre-allocated primitive structures */
|
||||||
|
|
||||||
static struct ieee802154_priv_primitive_s g_primpool[CONFIG_IEEE802154_PRIMITIVE_PREALLOC];
|
static struct ieee802154_priv_primitive_s
|
||||||
|
g_primpool[CONFIG_IEEE802154_PRIMITIVE_PREALLOC];
|
||||||
#endif /* CONFIG_IEEE802154_PRIMITIVE_PREALLOC > 0 */
|
#endif /* CONFIG_IEEE802154_PRIMITIVE_PREALLOC > 0 */
|
||||||
|
|
||||||
static bool g_poolinit = false;
|
static bool g_poolinit = false;
|
||||||
@@ -159,8 +161,8 @@ void ieee802154_primitivepool_initialize(void)
|
|||||||
int remaining = CONFIG_IEEE802154_PRIMITIVE_PREALLOC;
|
int remaining = CONFIG_IEEE802154_PRIMITIVE_PREALLOC;
|
||||||
|
|
||||||
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE
|
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE
|
||||||
/* Initialize g_primfree, the list of primitive structures that are available
|
/* Initialize g_primfree, the list of primitive structures that are
|
||||||
* for general use.
|
* available for general use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
g_primfree = NULL;
|
g_primfree = NULL;
|
||||||
@@ -228,9 +230,9 @@ void ieee802154_primitivepool_initialize(void)
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* A reference to the allocated primitive structure. All user fields in this
|
* A reference to the allocated primitive structure.
|
||||||
* structure have been zeroed. On a failure to allocate, NULL is
|
* All user fields in this structure have been zeroed.
|
||||||
* returned.
|
* On a failure to allocate, NULL is returned.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -317,7 +319,9 @@ FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remember that this primitive structure was dynamically allocated */
|
/* Remember that this primitive structure
|
||||||
|
* was dynamically allocated
|
||||||
|
*/
|
||||||
|
|
||||||
pool = POOL_PRIMITIVE_DYNAMIC;
|
pool = POOL_PRIMITIVE_DYNAMIC;
|
||||||
}
|
}
|
||||||
@@ -341,8 +345,8 @@ FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void)
|
|||||||
* Name: ieee802154_primitive_free
|
* Name: ieee802154_primitive_free
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The ieee802154_primitive_free function will return a primitive structure to
|
* The ieee802154_primitive_free function will return a primitive structure
|
||||||
* the free pool of messages if it was a pre-allocated primitive
|
* to the free pool of messages if it was a pre-allocated primitive
|
||||||
* structure. If the primitive structure was allocated dynamically it will
|
* structure. If the primitive structure was allocated dynamically it will
|
||||||
* be deallocated.
|
* be deallocated.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -55,9 +55,9 @@
|
|||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* The g_free_metadata is a list of meta-data structures that are available for
|
/* The g_free_metadata is a list of meta-data structures that are available
|
||||||
* general use. The number of messages in this list is a system configuration
|
* for general use. The number of messages in this list is a system
|
||||||
* item.
|
* configuration item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FAR struct pktradio_metadata_s *g_free_metadata;
|
static FAR struct pktradio_metadata_s *g_free_metadata;
|
||||||
@@ -140,8 +140,8 @@ void pktradio_metadata_initialize(void)
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* A reference to the allocated metadata structure. All user fields in this
|
* A reference to the allocated metadata structure. All user fields in
|
||||||
* structure have been zeroed. On a failure to allocate, NULL is
|
* this structure have been zeroed. On a failure to allocate, NULL is
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user