cpuset.h File Reference

The Cpuset API, for use in libtopology itself. More...

#include <topology/config.h>
#include <topology/cpuset-bits.h>

Go to the source code of this file.

Data Structures

struct  topo_cpuset_t
 Set of CPUs represented as a bitmask. More...

Defines

#define TOPO_CPUSET_ZERO   (topo_cpuset_t){ .s[0 ... TOPO_CPUSUBSET_COUNT-1] = TOPO_CPUSUBSET_ZERO }
 Predefined cpuset with no CPU set.
#define TOPO_CPUSET_FULL   (topo_cpuset_t){ .s[0 ... TOPO_CPUSUBSET_COUNT-1] = TOPO_CPUSUBSET_FULL }
 Predefined cpuset with all CPUs set.
#define TOPO_CPUSET_CPU(cpu)   ({ topo_cpuset_t __set = TOPO_CPUSET_ZERO; TOPO_CPUSUBSET_CPUSUBSET(__set,cpu) = TOPO_CPUSUBSET_VAL(cpu); __set; })
 Predefined cpuset with CPU cpu set.
#define TOPO_CPUSET_STRING_LENGTH   (TOPO_CPUSET_SUBSTRING_COUNT*(TOPO_CPUSET_SUBSTRING_LENGTH+1))
 Maximal required length of a string for printing a CPU set.
#define TOPO_PRIxCPUSET   "s"
 Printf format for printing a CPU set.
#define topo_cpuset_foreach_begin(cpu, set)
 Loop macro iterating on CPU set set.
#define topo_cpuset_foreach_end()   }
 End of loop.

Functions

static __inline__ int topo_cpuset_snprintf (char *__topo_restrict buf, size_t buflen, const topo_cpuset_t *__topo_restrict set)
 Stringify a cpuset.
static __inline__ void topo_cpuset_from_string (const char *__topo_restrict string, topo_cpuset_t *__topo_restrict set)
 Parse a cpuset string.
static __inline__ void topo_cpuset_zero (topo_cpuset_t *set)
 Primitives & macros for building, modifying and consulting "sets" of cpus.
static __inline__ void topo_cpuset_fill (topo_cpuset_t *set)
 Fill CPU set set.
static __inline__ void topo_cpuset_from_ulong (topo_cpuset_t *set, unsigned long mask)
 Setup CPU set set from unsigned long mask.
static __inline__ void topo_cpuset_from_ith_ulong (topo_cpuset_t *set, int i, unsigned long mask)
 Setup CPU set set from unsigned long mask used as i -th subset.
static __inline__ unsigned long topo_cpuset_to_ulong (const topo_cpuset_t *set)
 Convert the beginning part of CPU set set into unsigned long mask.
static __inline__ unsigned long topo_cpuset_to_ith_ulong (const topo_cpuset_t *set, int i)
 Convert the i -th subset of CPU set set into unsigned long mask.
static __inline__ void topo_cpuset_cpu (topo_cpuset_t *set, unsigned cpu)
 Clear CPU set set and set CPU cpu.
static __inline__ void topo_cpuset_all_but_cpu (topo_cpuset_t *set, unsigned cpu)
 Clear CPU set set and set all but the CPU cpu.
static __inline__ void topo_cpuset_set (topo_cpuset_t *set, unsigned cpu)
 Add CPU cpu in CPU set set.
static __inline__ void topo_cpuset_set_range (topo_cpuset_t *set, unsigned begincpu, unsigned endcpu)
 Add CPUs from begincpu to endcpu in CPU set set.
static __inline__ void topo_cpuset_clr (topo_cpuset_t *set, unsigned cpu)
 Remove CPU cpu from CPU set set.
static __inline__ int topo_cpuset_isset (const topo_cpuset_t *set, unsigned cpu)
 Test whether CPU cpu is part of set set.
static __inline__ int topo_cpuset_iszero (const topo_cpuset_t *set)
 Test whether set set is zero.
static __inline__ int topo_cpuset_isfull (const topo_cpuset_t *set)
 Test whether set set is full.
static __inline__ int topo_cpuset_isequal (const topo_cpuset_t *set1, const topo_cpuset_t *set2)
 Test whether set set1 is equal to set set2.
static __inline__ int topo_cpuset_intersects (const topo_cpuset_t *set1, const topo_cpuset_t *set2)
 Test whether sets set1 and set2 intersects.
static __inline__ int topo_cpuset_isincluded (const topo_cpuset_t *sub_set, const topo_cpuset_t *super_set)
 Test whether set sub_set is part of set super_set.
static __inline__ void topo_cpuset_orset (topo_cpuset_t *set, const topo_cpuset_t *modifier_set)
 Or set modifier_set into set set.
static __inline__ void topo_cpuset_andset (topo_cpuset_t *set, const topo_cpuset_t *modifier_set)
 And set modifier_set into set set.
static __inline__ void topo_cpuset_clearset (topo_cpuset_t *set, const topo_cpuset_t *modifier_set)
 Clear set modifier_set out of set set.
static __inline__ void topo_cpuset_xorset (topo_cpuset_t *set, const topo_cpuset_t *modifier_set)
 Xor set set with set modifier_set.
static __inline__ int topo_cpuset_first (const topo_cpuset_t *cpuset)
 Compute the first CPU (least significant bit) in CPU set set.
static __inline__ void topo_cpuset_singlify (topo_cpuset_t *set)
 Keep a single CPU among those set in CPU set set.
static __inline__ int topo_cpuset_compar_first (const topo_cpuset_t *set1, const topo_cpuset_t *set2)
 Compar CPU sets set1 and set2 using their first set bit.
static __inline__ int topo_cpuset_compar (const topo_cpuset_t *set1, const topo_cpuset_t *set2)
 Compar CPU sets set1 and set2 using their last bits.
static __inline__ int topo_cpuset_weight (const topo_cpuset_t *set)
 Compute the weight of CPU set set.


Detailed Description

The Cpuset API, for use in libtopology itself.


Generated on Fri Jul 3 19:00:23 2009 for libtopology by  doxygen 1.5.9