diff options
author | Richard Braun <rbraun@sceen.net> | 2014-05-05 21:51:02 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-05-05 21:51:02 +0200 |
commit | dfa3674f5d71f995ce464570dce75ad1dba0c92a (patch) | |
tree | a3c9245ae034b9a0c3b9e587e2eba23f16970597 /kern/cpumap.h | |
parent | d8580cf84d3040956bdf8d799b02ad060b144ed9 (diff) |
kern/cpumap: add cmp/and/or/xor operations
Diffstat (limited to 'kern/cpumap.h')
-rw-r--r-- | kern/cpumap.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/kern/cpumap.h b/kern/cpumap.h index 710eb08..9cbdfa1 100644 --- a/kern/cpumap.h +++ b/kern/cpumap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Richard Braun. + * Copyright (c) 2013-2014 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,6 +50,12 @@ cpumap_copy(struct cpumap *dest, const struct cpumap *src) bitmap_copy(dest->cpus, src->cpus, MAX_CPUS); } +static inline int +cpumap_cmp(const struct cpumap *a, const struct cpumap *b) +{ + return bitmap_cmp(a->cpus, b->cpus, MAX_CPUS); +} + static inline void cpumap_set(struct cpumap *cpumap, int index) { @@ -80,6 +86,24 @@ cpumap_test(const struct cpumap *cpumap, int index) return bitmap_test(cpumap->cpus, index); } +static inline void +cpumap_and(struct cpumap *a, const struct cpumap *b) +{ + bitmap_and(a->cpus, b->cpus, MAX_CPUS); +} + +static inline void +cpumap_or(struct cpumap *a, const struct cpumap *b) +{ + bitmap_or(a->cpus, b->cpus, MAX_CPUS); +} + +static inline void +cpumap_xor(struct cpumap *a, const struct cpumap *b) +{ + bitmap_xor(a->cpus, b->cpus, MAX_CPUS); +} + static inline int cpumap_find_next(const struct cpumap *cpumap, int index) { |