Re: [Patch 6/23] mask v2 - Replace cpumask_t with one using mask

Matthew Dobson
2004-04-02T22:25:25Z

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

On Thu, 2004-04-01 at 13:11, Paul Jackson wrote:
> Patch_6_of_23 - Rework cpumasks to use new mask ADT
> Removes many old include/asm-<arch> and asm-generic cpumask files
> Add intersects, subset, xor and andnot operators.
> Provides temporary emulators for obsolete const, promote, coerce
> Presents entire cpumask API clearly in single cpumask.h file

<snip>

> +#else /* !CONFIG_SMP */
> +
> +#define cpu_online_map cpumask_of_cpu(0)
> +#define cpu_possible_map cpumask_of_cpu(0)

I mentioned earlier that there's probably a better way to do this for
UP... What do you think about this?

-Matt

[-- Attachment #2: UP-cpu_online_map.patch --]
[-- Type: text/x-patch, Size: 691 bytes --]

diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.4-pj_mask_v2/include/linux/cpumask.h linux-2.6.4-UP_online_map/include/linux/cpumask.h
--- linux-2.6.4-pj_mask_v2/include/linux/cpumask.h Fri Apr 2 14:03:21 2004
+++ linux-2.6.4-UP_online_map/include/linux/cpumask.h Fri Apr 2 14:13:54 2004
@@ -134,8 +134,12 @@ extern cpumask_t cpu_possible_map;

#else /* !CONFIG_SMP */

-#define cpu_online_map cpumask_of_cpu(0)
-#define cpu_possible_map cpumask_of_cpu(0)
+#define cpu_online_map \
+({ \
+ cpumask_t m = MASK_ALL1(NR_CPUS); \
+ m; \
+})
+#define cpu_possible_map cpu_online_map

#define num_online_cpus() 1
#define num_possible_cpus() 1