]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-x86/mpspec.h
x86: fix stack overflow for large values of MAX_APICS
[linux-2.6-omap-h63xx.git] / include / asm-x86 / mpspec.h
index 57a991b9c0530a0f82268853c74a6feb2411b883..b69e7ba7bf1d634dc3fe04c8794f3ea29e514979 100644 (file)
@@ -101,6 +101,7 @@ typedef struct physid_mask physid_mask_t;
                __physid_mask;                                          \
        })
 
+/* Note: will create very large stack frames if physid_mask_t is big */
 #define physid_mask_of_physid(physid)                                  \
        ({                                                              \
                physid_mask_t __physid_mask = PHYSID_MASK_NONE;         \
@@ -108,6 +109,12 @@ typedef struct physid_mask physid_mask_t;
                __physid_mask;                                          \
        })
 
+static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map)
+{
+       physids_clear(*map);
+       physid_set(physid, *map);
+}
+
 #define PHYSID_MASK_ALL                { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} }
 #define PHYSID_MASK_NONE       { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} }