nuttx/include:Modify the CPU_SET series macro definition in sched.h

Modify the CPU_SET series macro definition to avoid an error when shifting 31 bits to the left.

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
This commit is contained in:
chenzhijia 2024-09-26 17:18:11 +08:00 committed by GUIDINGLI
parent aca7552d9c
commit 65fbf4cf64

View file

@ -85,15 +85,15 @@
/* void CPU_SET(int cpu, FAR cpu_set_t *set); */ /* void CPU_SET(int cpu, FAR cpu_set_t *set); */
#define CPU_SET(c,s) do { *(s) |= (1 << (c)); } while (0) #define CPU_SET(c,s) do { *(s) |= (1u << (c)); } while (0)
/* void CPU_CLR(int cpu, FAR cpu_set_t *set); */ /* void CPU_CLR(int cpu, FAR cpu_set_t *set); */
#define CPU_CLR(c,s) do { *(s) &= ~(1 << (c)); } while (0) #define CPU_CLR(c,s) do { *(s) &= ~(1u << (c)); } while (0)
/* int CPU_ISSET(int cpu, FAR const cpu_set_t *set); */ /* int CPU_ISSET(int cpu, FAR const cpu_set_t *set); */
#define CPU_ISSET(c,s) ((*(s) & (1 << (c))) != 0) #define CPU_ISSET(c,s) ((*(s) & (1u << (c))) != 0)
/* int CPU_COUNT(FAR const cpu_set_t *set); */ /* int CPU_COUNT(FAR const cpu_set_t *set); */