diff options
Diffstat (limited to 'include/asm-x86_64')
| -rw-r--r-- | include/asm-x86_64/bitops.h | 2 | ||||
| -rw-r--r-- | include/asm-x86_64/mpspec.h | 45 | ||||
| -rw-r--r-- | include/asm-x86_64/percpu.h | 5 | ||||
| -rw-r--r-- | include/asm-x86_64/processor.h | 1 | ||||
| -rw-r--r-- | include/asm-x86_64/smp.h | 1 | ||||
| -rw-r--r-- | include/asm-x86_64/suspend.h | 2 | ||||
| -rw-r--r-- | include/asm-x86_64/topology.h | 11 |
7 files changed, 53 insertions, 14 deletions
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index 6830b9ee6174..59c0a4785301 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h @@ -466,7 +466,7 @@ static __inline__ int ffs(int x) __asm__("bsfl %1,%0\n\t" "cmovzl %2,%0" - : "=r" (r) : "g" (x), "r" (32)); + : "=r" (r) : "g" (x), "r" (-1)); return r+1; } diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h index bf783aa470ea..02245540c2f3 100644 --- a/include/asm-x86_64/mpspec.h +++ b/include/asm-x86_64/mpspec.h @@ -169,7 +169,6 @@ extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES]; extern cpumask_t mp_bus_to_cpumask [MAX_MP_BUSSES]; extern unsigned int boot_cpu_physical_apicid; -extern cpumask_t phys_cpu_present_map; extern int smp_found_config; extern void find_smp_config (void); extern void get_smp_config (void); @@ -198,5 +197,49 @@ extern void mp_config_ioapic_for_sci(int irq); extern int using_apic_timer; +#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) + +struct physid_mask +{ + unsigned long mask[PHYSID_ARRAY_SIZE]; +}; + +typedef struct physid_mask physid_mask_t; + +#define physid_set(physid, map) set_bit(physid, (map).mask) +#define physid_clear(physid, map) clear_bit(physid, (map).mask) +#define physid_isset(physid, map) test_bit(physid, (map).mask) +#define physid_test_and_set(physid, map) test_and_set_bit(physid, (map).mask) + +#define physids_and(dst, src1, src2) bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS) +#define physids_or(dst, src1, src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS) +#define physids_clear(map) bitmap_clear((map).mask, MAX_APICS) +#define physids_complement(map) bitmap_complement((map).mask, MAX_APICS) +#define physids_empty(map) bitmap_empty((map).mask, MAX_APICS) +#define physids_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, MAX_APICS) +#define physids_weight(map) bitmap_weight((map).mask, MAX_APICS) +#define physids_shift_right(d, s, n) bitmap_shift_right((d).mask, (s).mask, n, MAX_APICS) +#define physids_shift_left(d, s, n) bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS) +#define physids_coerce(map) ((map).mask[0]) + +#define physids_promote(physids) \ + ({ \ + physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ + __physid_mask.mask[0] = physids; \ + __physid_mask; \ + }) + +#define physid_mask_of_physid(physid) \ + ({ \ + physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ + physid_set(physid, __physid_mask); \ + __physid_mask; \ + }) + +#define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} } +#define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} } + +extern physid_mask_t phys_cpu_present_map; + #endif diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 832fc326fb02..d73be96517d4 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h @@ -31,6 +31,9 @@ do { \ memcpy((pcpudst)+__per_cpu_offset(__i), \ (src), (size)); \ } while (0) + +extern void setup_per_cpu_areas(void); + #else /* ! SMP */ #define DEFINE_PER_CPU(type, name) \ @@ -46,6 +49,4 @@ do { \ #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) -extern void setup_per_cpu_areas(void); - #endif /* _ASM_X8664_PERCPU_H_ */ diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 12714f573352..e151dbb1e704 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h @@ -225,7 +225,6 @@ struct tss_struct { * 8 bytes, for an extra "long" of ~0UL */ unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; - u32 __cacheline_filler[4]; /* size is 0x100 */ } __attribute__((packed)) ____cacheline_aligned; struct thread_struct { diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index 7959579136bd..ba4e4ad1a189 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h @@ -36,7 +36,6 @@ struct pt_regs; */ extern void smp_alloc_memory(void); -extern cpumask_t phys_cpu_present_map; extern cpumask_t cpu_online_map; extern volatile unsigned long smp_invalidate_needed; extern int pic_mode; diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h index 3b3f794d9cec..e34526cd6e9f 100644 --- a/include/asm-x86_64/suspend.h +++ b/include/asm-x86_64/suspend.h @@ -44,7 +44,7 @@ extern unsigned long saved_context_eflags; :"r" ((thread)->debugreg##register)) extern void fix_processor_context(void); -extern void do_magic(int resume); +extern int do_magic(int resume); #ifdef CONFIG_ACPI_SLEEP extern unsigned long saved_eip; diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index c4f359c87973..d4548e5ed6dc 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h @@ -10,21 +10,18 @@ /* Map the K8 CPU local memory controllers to a simple 1:1 CPU:NODE topology */ extern int fake_node; -extern cpumask_t cpu_online_map; +extern unsigned long cpu_online_map; #define cpu_to_node(cpu) (fake_node ? 0 : (cpu)) #define memblk_to_node(memblk) (fake_node ? 0 : (memblk)) #define parent_node(node) (node) #define node_to_first_cpu(node) (fake_node ? 0 : (node)) -#define node_to_cpu_mask(node) (fake_node ? cpu_online_map : cpumask_of_cpu(node)) +#define node_to_cpu_mask(node) (fake_node ? cpu_online_map : (1UL << (node))) #define node_to_memblk(node) (node) -static inline cpumask_t pcibus_to_cpumask(int bus) +static inline unsigned long pcibus_to_cpumask(int bus) { - cpumask_t ret; - - cpus_and(ret, mp_bus_to_cpumask[bus], cpu_online_map); - return ret; + return mp_bus_to_cpumask[bus] & cpu_online_map; } #define NODE_BALANCE_RATE 30 /* CHECKME */ |
