Skip to content

Commit

Permalink
lib/libc, os/include: remove CONFIG_SMP dependency for POSIX APIs
Browse files Browse the repository at this point in the history
This patch removes CONFIG_SMP dependency for the POSIX APIs to make it work
irrespective of SMP configs enabled.

Signed-off-by: Neel <[email protected]>
  • Loading branch information
neel-samsung authored and kishore-sn committed Feb 11, 2025
1 parent 8d386e1 commit ab4b3ad
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions lib/libc/pthread/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ CSRCS += pthread_setcancelstate.c pthread_setcanceltype.c
CSRCS += pthread_testcancel.c
CSRCS += pthread_rwlock.c pthread_rwlock_rdlock.c pthread_rwlock_wrlock.c
CSRCS += pthread_once.c pthread_yield.c
ifeq ($(CONFIG_SMP),y)
CSRCS += pthread_attr_getaffinity.c pthread_attr_setaffinity.c
endif

ifeq ($(CONFIG_ENABLE_IOTIVITY),y)
CSRCS += pthread_condattrsetclock.c
Expand Down
3 changes: 1 addition & 2 deletions lib/libc/sched/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ ifneq ($(CONFIG_CANCELLATION_POINTS),y)
CSRCS += task_setcanceltype.c task_testcancel.c
endif

ifeq ($(CONFIG_SMP),y)
CSRCS += sched_cpucount.c
endif

# Add the sched directory to the build

DEPPATH += --dep-path sched
Expand Down
3 changes: 0 additions & 3 deletions lib/libc/sched/sched_cpucount.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <sched.h>

#ifdef CONFIG_SMP

/****************************************************************************
* Public Functions
Expand Down Expand Up @@ -62,5 +61,3 @@ int sched_cpucount(FAR const cpu_set_t *set)

return count;
}

#endif /* CONFIG_SMP */
2 changes: 0 additions & 2 deletions os/include/pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -779,14 +779,12 @@ int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize);
*/
int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, long *stackaddr);

#ifdef CONFIG_SMP
/* Set or obtain thread affinity attributes */

int pthread_attr_setaffinity_np(FAR pthread_attr_t *attr, \
size_t cpusetsize, FAR const cpu_set_t *cpuset);
int pthread_attr_getaffinity_np(FAR const pthread_attr_t *attr, \
size_t cpusetsize, cpu_set_t *cpuset);
#endif

/* Create, operate on, and destroy mutex attributes. */
/**
Expand Down

0 comments on commit ab4b3ad

Please sign in to comment.