提交 cd83e42c 编写于 作者: R Rusty Russell 提交者: Ingo Molnar

cpumask: new API, v2

- add cpumask_of()
- add free_bootmem_cpumask_var()
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 2d3854a3
...@@ -893,6 +893,12 @@ static inline void cpumask_copy(struct cpumask *dstp, ...@@ -893,6 +893,12 @@ static inline void cpumask_copy(struct cpumask *dstp,
*/ */
#define cpumask_any_and(mask1, mask2) cpumask_first_and((mask1), (mask2)) #define cpumask_any_and(mask1, mask2) cpumask_first_and((mask1), (mask2))
/**
* cpumask_of - the cpumask containing just a given cpu
* @cpu: the cpu (<= nr_cpu_ids)
*/
#define cpumask_of(cpu) (get_cpu_mask(cpu))
/** /**
* to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
* @bitmap: the bitmap * @bitmap: the bitmap
...@@ -946,6 +952,7 @@ typedef struct cpumask *cpumask_var_t; ...@@ -946,6 +952,7 @@ typedef struct cpumask *cpumask_var_t;
bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags);
void alloc_bootmem_cpumask_var(cpumask_var_t *mask); void alloc_bootmem_cpumask_var(cpumask_var_t *mask);
void free_cpumask_var(cpumask_var_t mask); void free_cpumask_var(cpumask_var_t mask);
void free_bootmem_cpumask_var(cpumask_var_t mask);
#else #else
typedef struct cpumask cpumask_var_t[1]; typedef struct cpumask cpumask_var_t[1];
...@@ -962,6 +969,10 @@ static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask) ...@@ -962,6 +969,10 @@ static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask)
static inline void free_cpumask_var(cpumask_var_t mask) static inline void free_cpumask_var(cpumask_var_t mask)
{ {
} }
static inline void free_bootmem_cpumask_var(cpumask_var_t mask)
{
}
#endif /* CONFIG_CPUMASK_OFFSTACK */ #endif /* CONFIG_CPUMASK_OFFSTACK */
/* The pointer versions of the maps, these will become the primary versions. */ /* The pointer versions of the maps, these will become the primary versions. */
......
...@@ -107,4 +107,9 @@ void free_cpumask_var(cpumask_var_t mask) ...@@ -107,4 +107,9 @@ void free_cpumask_var(cpumask_var_t mask)
kfree(mask); kfree(mask);
} }
EXPORT_SYMBOL(free_cpumask_var); EXPORT_SYMBOL(free_cpumask_var);
void free_bootmem_cpumask_var(cpumask_var_t mask)
{
free_bootmem((unsigned long)mask, cpumask_size());
}
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册