mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 01:14:38 +00:00
MINOR: cpuset: add ha_cpuset_or() to bitwise-OR two CPU sets
This operation was not implemented and will be needed later.
This commit is contained in:
parent
f2af7a5d20
commit
69d2ff7078
@ -23,6 +23,10 @@ int ha_cpuset_clr(struct hap_cpuset *set, int cpu);
|
||||
*/
|
||||
void ha_cpuset_and(struct hap_cpuset *dst, struct hap_cpuset *src);
|
||||
|
||||
/* Bitwise OR equivalent operation between <src> and <dst> stored in <dst>.
|
||||
*/
|
||||
void ha_cpuset_or(struct hap_cpuset *dst, struct hap_cpuset *src);
|
||||
|
||||
/* returns non-zero if CPU index <cpu> is set in <set>, otherwise 0. */
|
||||
int ha_cpuset_isset(const struct hap_cpuset *set, int cpu);
|
||||
|
||||
|
13
src/cpuset.c
13
src/cpuset.c
@ -60,6 +60,19 @@ void ha_cpuset_and(struct hap_cpuset *dst, struct hap_cpuset *src)
|
||||
#endif
|
||||
}
|
||||
|
||||
void ha_cpuset_or(struct hap_cpuset *dst, struct hap_cpuset *src)
|
||||
{
|
||||
#if defined(CPUSET_USE_CPUSET)
|
||||
CPU_OR(&dst->cpuset, &dst->cpuset, &src->cpuset);
|
||||
|
||||
#elif defined(CPUSET_USE_FREEBSD_CPUSET)
|
||||
CPU_OR(&dst->cpuset, &src->cpuset);
|
||||
|
||||
#elif defined(CPUSET_USE_ULONG)
|
||||
dst->cpuset |= src->cpuset;
|
||||
#endif
|
||||
}
|
||||
|
||||
int ha_cpuset_isset(const struct hap_cpuset *set, int cpu)
|
||||
{
|
||||
if (cpu >= ha_cpuset_size())
|
||||
|
Loading…
Reference in New Issue
Block a user