* libc/sys/rtems/sys/cpuset.h: Use __inline instead of inline.
This commit is contained in:
parent
9bd3bcc642
commit
f4fc6b0663
@ -1,3 +1,7 @@
|
||||
2013-12-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* libc/sys/rtems/sys/cpuset.h: Use __inline instead of inline.
|
||||
|
||||
2013-12-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* libc/include/machine/_default_types.h: Move extern "C" after
|
||||
|
@ -45,8 +45,7 @@
|
||||
#ifndef _SYS_CPUSET_H_
|
||||
#define _SYS_CPUSET_H_
|
||||
|
||||
#include <machine/_default_types.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -72,13 +71,13 @@ typedef struct _cpuset {
|
||||
} cpu_set_t;
|
||||
|
||||
/* determine the mask for a particular cpu within the element */
|
||||
static inline cpu_set_word_t __cpuset_mask(int cpu)
|
||||
static __inline cpu_set_word_t __cpuset_mask(int cpu)
|
||||
{
|
||||
return (cpu_set_word_t)1 << ((size_t)cpu % _NCPUBITS);
|
||||
}
|
||||
|
||||
/* determine the index for this cpu within the cpu set array */
|
||||
static inline size_t __cpuset_index(int cpu)
|
||||
static __inline size_t __cpuset_index(int cpu)
|
||||
{
|
||||
return (size_t)cpu / _NCPUBITS;
|
||||
}
|
||||
@ -88,19 +87,19 @@ static inline size_t __cpuset_index(int cpu)
|
||||
|
||||
cpu_set_t *__cpuset_alloc(int num_cpus);
|
||||
|
||||
static inline cpu_set_t *CPU_ALLOC(int num_cpus)
|
||||
static __inline cpu_set_t *CPU_ALLOC(int num_cpus)
|
||||
{
|
||||
return __cpuset_alloc(num_cpus);
|
||||
}
|
||||
|
||||
void __cpuset_free(cpu_set_t *set);
|
||||
|
||||
static inline void CPU_FREE(cpu_set_t *set)
|
||||
static __inline void CPU_FREE(cpu_set_t *set)
|
||||
{
|
||||
__cpuset_free(set);
|
||||
}
|
||||
|
||||
static inline void CPU_ZERO_S(size_t setsize, cpu_set_t *set)
|
||||
static __inline void CPU_ZERO_S(size_t setsize, cpu_set_t *set)
|
||||
{
|
||||
cpu_set_word_t *w = &set->__bits[0];
|
||||
size_t n = setsize / sizeof(*w);
|
||||
@ -110,12 +109,12 @@ static inline void CPU_ZERO_S(size_t setsize, cpu_set_t *set)
|
||||
w[i] = 0;
|
||||
}
|
||||
|
||||
static inline void CPU_ZERO(cpu_set_t *set)
|
||||
static __inline void CPU_ZERO(cpu_set_t *set)
|
||||
{
|
||||
CPU_ZERO_S(sizeof(*set), set);
|
||||
}
|
||||
|
||||
static inline void CPU_FILL_S(size_t setsize, cpu_set_t *set)
|
||||
static __inline void CPU_FILL_S(size_t setsize, cpu_set_t *set)
|
||||
{
|
||||
cpu_set_word_t *w = &set->__bits[0];
|
||||
size_t n = setsize / sizeof(*w);
|
||||
@ -125,54 +124,54 @@ static inline void CPU_FILL_S(size_t setsize, cpu_set_t *set)
|
||||
w[i] = ~(cpu_set_word_t)0;
|
||||
}
|
||||
|
||||
static inline void CPU_FILL(cpu_set_t *set)
|
||||
static __inline void CPU_FILL(cpu_set_t *set)
|
||||
{
|
||||
CPU_FILL_S(sizeof(*set), set);
|
||||
}
|
||||
|
||||
static inline void CPU_SET_S(int cpu, size_t setsize, cpu_set_t *set)
|
||||
static __inline void CPU_SET_S(int cpu, size_t setsize, cpu_set_t *set)
|
||||
{
|
||||
cpu_set_word_t *w = &set->__bits[0];
|
||||
|
||||
w[__cpuset_index(cpu)] |= __cpuset_mask(cpu);
|
||||
}
|
||||
|
||||
static inline void CPU_SET(int cpu, cpu_set_t *set)
|
||||
static __inline void CPU_SET(int cpu, cpu_set_t *set)
|
||||
{
|
||||
CPU_SET_S(cpu, sizeof(*set), set);
|
||||
}
|
||||
|
||||
static inline void CPU_CLR_S(int cpu, size_t setsize, cpu_set_t *set)
|
||||
static __inline void CPU_CLR_S(int cpu, size_t setsize, cpu_set_t *set)
|
||||
{
|
||||
cpu_set_word_t *w = &set->__bits[0];
|
||||
|
||||
w[__cpuset_index(cpu)] &= ~__cpuset_mask(cpu);
|
||||
}
|
||||
|
||||
static inline void CPU_CLR(int cpu, cpu_set_t *set)
|
||||
static __inline void CPU_CLR(int cpu, cpu_set_t *set)
|
||||
{
|
||||
CPU_CLR_S(cpu, sizeof(*set), set);
|
||||
}
|
||||
|
||||
static inline int CPU_ISSET_S(int cpu, size_t setsize, cpu_set_t *set)
|
||||
static __inline int CPU_ISSET_S(int cpu, size_t setsize, cpu_set_t *set)
|
||||
{
|
||||
const cpu_set_word_t *w = &set->__bits[0];
|
||||
|
||||
return ((w[__cpuset_index(cpu)] & __cpuset_mask(cpu)) != 0);
|
||||
}
|
||||
|
||||
static inline int CPU_ISSET(int cpu, cpu_set_t *set)
|
||||
static __inline int CPU_ISSET(int cpu, cpu_set_t *set)
|
||||
{
|
||||
return CPU_ISSET_S(cpu, sizeof(*set), set);
|
||||
}
|
||||
|
||||
/* copy src set to dest set */
|
||||
static inline void CPU_COPY( cpu_set_t *dest, const cpu_set_t *src )
|
||||
static __inline void CPU_COPY( cpu_set_t *dest, const cpu_set_t *src )
|
||||
{
|
||||
*dest = *src;
|
||||
}
|
||||
|
||||
static inline void CPU_AND_S(size_t setsize, cpu_set_t *destset,
|
||||
static __inline void CPU_AND_S(size_t setsize, cpu_set_t *destset,
|
||||
const cpu_set_t *srcset1, const cpu_set_t *srcset2)
|
||||
{
|
||||
cpu_set_word_t *wdest = &destset->__bits[0];
|
||||
@ -185,13 +184,13 @@ static inline void CPU_AND_S(size_t setsize, cpu_set_t *destset,
|
||||
wdest[i] = wsrc1[i] & wsrc2[i];
|
||||
}
|
||||
|
||||
static inline void CPU_AND(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
static __inline void CPU_AND(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
const cpu_set_t *srcset2)
|
||||
{
|
||||
CPU_AND_S(sizeof(*destset), destset, srcset1, srcset2);
|
||||
}
|
||||
|
||||
static inline void CPU_OR_S(size_t setsize, cpu_set_t *destset,
|
||||
static __inline void CPU_OR_S(size_t setsize, cpu_set_t *destset,
|
||||
const cpu_set_t *srcset1, const cpu_set_t *srcset2)
|
||||
{
|
||||
cpu_set_word_t *wdest = &destset->__bits[0];
|
||||
@ -204,13 +203,13 @@ static inline void CPU_OR_S(size_t setsize, cpu_set_t *destset,
|
||||
wdest[i] = wsrc1[i] | wsrc2[i];
|
||||
}
|
||||
|
||||
static inline void CPU_OR(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
static __inline void CPU_OR(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
const cpu_set_t *srcset2)
|
||||
{
|
||||
CPU_OR_S(sizeof(*destset), destset, srcset1, srcset2);
|
||||
}
|
||||
|
||||
static inline void CPU_XOR_S(size_t setsize, cpu_set_t *destset,
|
||||
static __inline void CPU_XOR_S(size_t setsize, cpu_set_t *destset,
|
||||
const cpu_set_t *srcset1, const cpu_set_t *srcset2)
|
||||
{
|
||||
cpu_set_word_t *wdest = &destset->__bits[0];
|
||||
@ -223,13 +222,13 @@ static inline void CPU_XOR_S(size_t setsize, cpu_set_t *destset,
|
||||
wdest[i] = wsrc1[i] ^ wsrc2[i];
|
||||
}
|
||||
|
||||
static inline void CPU_XOR(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
static __inline void CPU_XOR(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
const cpu_set_t *srcset2)
|
||||
{
|
||||
CPU_XOR_S(sizeof(*destset), destset, srcset1, srcset2);
|
||||
}
|
||||
|
||||
static inline void CPU_NAND_S(size_t setsize, cpu_set_t *destset,
|
||||
static __inline void CPU_NAND_S(size_t setsize, cpu_set_t *destset,
|
||||
const cpu_set_t *srcset1, const cpu_set_t *srcset2)
|
||||
{
|
||||
cpu_set_word_t *wdest = &destset->__bits[0];
|
||||
@ -242,13 +241,13 @@ static inline void CPU_NAND_S(size_t setsize, cpu_set_t *destset,
|
||||
wdest[i] = ~(wsrc1[i] & wsrc2[i]);
|
||||
}
|
||||
|
||||
static inline void CPU_NAND(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
static __inline void CPU_NAND(cpu_set_t *destset, const cpu_set_t *srcset1,
|
||||
const cpu_set_t *srcset2)
|
||||
{
|
||||
CPU_NAND_S(sizeof(*destset), destset, srcset1, srcset2);
|
||||
}
|
||||
|
||||
static inline int CPU_COUNT_S(size_t setsize, const cpu_set_t *set)
|
||||
static __inline int CPU_COUNT_S(size_t setsize, const cpu_set_t *set)
|
||||
{
|
||||
int count = 0;
|
||||
const cpu_set_word_t *w = &set->__bits[0];
|
||||
@ -263,12 +262,12 @@ static inline int CPU_COUNT_S(size_t setsize, const cpu_set_t *set)
|
||||
return count;
|
||||
}
|
||||
|
||||
static inline int CPU_COUNT(const cpu_set_t *set)
|
||||
static __inline int CPU_COUNT(const cpu_set_t *set)
|
||||
{
|
||||
return CPU_COUNT_S(sizeof(*set), set);
|
||||
}
|
||||
|
||||
static inline int CPU_EQUAL_S(size_t setsize, const cpu_set_t *set1,
|
||||
static __inline int CPU_EQUAL_S(size_t setsize, const cpu_set_t *set1,
|
||||
const cpu_set_t *set2)
|
||||
{
|
||||
const cpu_set_word_t *w1 = &set1->__bits[0];
|
||||
@ -283,19 +282,19 @@ static inline int CPU_EQUAL_S(size_t setsize, const cpu_set_t *set1,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int CPU_EQUAL(const cpu_set_t *set1, const cpu_set_t *set2)
|
||||
static __inline int CPU_EQUAL(const cpu_set_t *set1, const cpu_set_t *set2)
|
||||
{
|
||||
return CPU_EQUAL_S(sizeof(*set1), set1, set2);
|
||||
}
|
||||
|
||||
/* return 1 if the sets set1 and set2 are equal, otherwise return 0 */
|
||||
static inline int CPU_CMP( const cpu_set_t *set1, const cpu_set_t *set2 )
|
||||
static __inline int CPU_CMP( const cpu_set_t *set1, const cpu_set_t *set2 )
|
||||
{
|
||||
return CPU_EQUAL(set1, set2);
|
||||
}
|
||||
|
||||
/* return 1 if the set is empty, otherwise return 0 */
|
||||
static inline int CPU_EMPTY( const cpu_set_t *set )
|
||||
static __inline int CPU_EMPTY( const cpu_set_t *set )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user