summaryrefslogtreecommitdiff
path: root/nuttx/sched/group
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-28 14:35:17 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-28 14:35:17 -0600
commitcc09a5c2a7cc6181c3c7b138e2c7cee68696602a (patch)
treec6362f99dca60d9b281d5b6f0b9e9b4b2948cc50 /nuttx/sched/group
parentbeff06c0279b1e95ad95c70fa2c64958c70975bd (diff)
downloadnuttx-cc09a5c2a7cc6181c3c7b138e2c7cee68696602a.tar.gz
nuttx-cc09a5c2a7cc6181c3c7b138e2c7cee68696602a.tar.bz2
nuttx-cc09a5c2a7cc6181c3c7b138e2c7cee68696602a.zip
Add VFS-based sem_open() implementation
Diffstat (limited to 'nuttx/sched/group')
-rw-r--r--nuttx/sched/group/group_free.c9
-rw-r--r--nuttx/sched/group/group_malloc.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/nuttx/sched/group/group_free.c b/nuttx/sched/group/group_free.c
index 631482e06..88205cebf 100644
--- a/nuttx/sched/group/group_free.c
+++ b/nuttx/sched/group/group_free.c
@@ -84,7 +84,14 @@
void group_free(FAR struct task_group_s *group, FAR void *mem)
{
- DEBUGASSERT(group && mem);
+ /* A NULL group pointer means the current group */
+
+ if (!group)
+ {
+ FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head;
+ DEBUGASSERT(tcb && tcb->group);
+ group = tcb->group;
+ }
/* Check the group is privileged */
diff --git a/nuttx/sched/group/group_malloc.c b/nuttx/sched/group/group_malloc.c
index 3ca23a5b6..e48bd3d35 100644
--- a/nuttx/sched/group/group_malloc.c
+++ b/nuttx/sched/group/group_malloc.c
@@ -87,7 +87,14 @@
FAR void *group_malloc(FAR struct task_group_s *group, size_t nbytes)
{
- DEBUGASSERT(group);
+ /* A NULL group pointer means the current group */
+
+ if (!group)
+ {
+ FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head;
+ DEBUGASSERT(tcb && tcb->group);
+ group = tcb->group;
+ }
/* Check the group type */