MINOR: cpu-set: compare two cpu sets with ha_cpuset_isequal()
This function returns true if two CPU sets are equal.
This commit is contained in:
parent
e17512c3b2
commit
3955f151b1
@ -44,6 +44,9 @@ int ha_cpuset_ffs(const struct hap_cpuset *set);
|
||||
*/
|
||||
void ha_cpuset_assign(struct hap_cpuset *dst, struct hap_cpuset *src);
|
||||
|
||||
/* returns true if the sets are equal */
|
||||
int ha_cpuset_isequal(const struct hap_cpuset *dst, const struct hap_cpuset *src);
|
||||
|
||||
/* Returns the biggest index plus one usable on the platform.
|
||||
*/
|
||||
int ha_cpuset_size(void);
|
||||
|
14
src/cpuset.c
14
src/cpuset.c
@ -134,6 +134,20 @@ void ha_cpuset_assign(struct hap_cpuset *dst, struct hap_cpuset *src)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* returns true if the sets are equal */
|
||||
int ha_cpuset_isequal(const struct hap_cpuset *dst, const struct hap_cpuset *src)
|
||||
{
|
||||
#if defined(CPUSET_USE_CPUSET)
|
||||
return CPU_EQUAL(&dst->cpuset, &src->cpuset);
|
||||
|
||||
#elif defined(CPUSET_USE_FREEBSD_CPUSET)
|
||||
return !CPU_CMP(&src->cpuset, &dst->cpuset);
|
||||
|
||||
#elif defined(CPUSET_USE_ULONG)
|
||||
return dst->cpuset == src->cpuset;
|
||||
#endif
|
||||
}
|
||||
|
||||
int ha_cpuset_size()
|
||||
{
|
||||
#if defined(CPUSET_USE_CPUSET) || defined(CPUSET_USE_FREEBSD_CPUSET)
|
||||
|
Loading…
x
Reference in New Issue
Block a user