39c715b717
This patch implements a number of smp_processor_id() cleanup ideas that Arjan van de Ven and I came up with. The previous __smp_processor_id/_smp_processor_id/smp_processor_id API spaghetti was hard to follow both on the implementational and on the usage side. Some of the complexity arose from picking wrong names, some of the complexity comes from the fact that not all architectures defined __smp_processor_id. In the new code, there are two externally visible symbols: - smp_processor_id(): debug variant. - raw_smp_processor_id(): nondebug variant. Replaces all existing uses of _smp_processor_id() and __smp_processor_id(). Defined by every SMP architecture in include/asm-*/smp.h. There is one new internal symbol, dependent on DEBUG_PREEMPT: - debug_smp_processor_id(): internal debug variant, mapped to smp_processor_id(). Also, i moved debug_smp_processor_id() from lib/kernel_lock.c into a new lib/smp_processor_id.c file. All related comments got updated and/or clarified. I have build/boot tested the following 8 .config combinations on x86: {SMP,UP} x {PREEMPT,!PREEMPT} x {DEBUG_PREEMPT,!DEBUG_PREEMPT} I have also build/boot tested x64 on UP/PREEMPT/DEBUG_PREEMPT. (Other architectures are untested, but should work just fine.) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
70 lines
1.6 KiB
C
70 lines
1.6 KiB
C
/* smp.h: PPC specific SMP stuff.
|
|
*
|
|
* Original was a copy of sparc smp.h. Now heavily modified
|
|
* for PPC.
|
|
*
|
|
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
|
|
* Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
|
|
*/
|
|
#ifdef __KERNEL__
|
|
#ifndef _PPC_SMP_H
|
|
#define _PPC_SMP_H
|
|
|
|
#include <linux/config.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/bitops.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/cpumask.h>
|
|
#include <linux/threads.h>
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
struct cpuinfo_PPC {
|
|
unsigned long loops_per_jiffy;
|
|
unsigned long pvr;
|
|
unsigned long *pgd_cache;
|
|
unsigned long *pte_cache;
|
|
unsigned long pgtable_cache_sz;
|
|
};
|
|
|
|
extern struct cpuinfo_PPC cpu_data[];
|
|
extern cpumask_t cpu_online_map;
|
|
extern cpumask_t cpu_possible_map;
|
|
extern unsigned long smp_proc_in_lock[];
|
|
extern volatile unsigned long cpu_callin_map[];
|
|
extern int smp_tb_synchronized;
|
|
|
|
extern void smp_send_tlb_invalidate(int);
|
|
extern void smp_send_xmon_break(int cpu);
|
|
struct pt_regs;
|
|
extern void smp_message_recv(int, struct pt_regs *);
|
|
|
|
#define NO_PROC_ID 0xFF /* No processor magic marker */
|
|
#define PROC_CHANGE_PENALTY 20
|
|
|
|
#define raw_smp_processor_id() (current_thread_info()->cpu)
|
|
|
|
extern int __cpu_up(unsigned int cpu);
|
|
|
|
extern int smp_hw_index[];
|
|
#define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
|
|
|
|
struct klock_info_struct {
|
|
unsigned long kernel_flag;
|
|
unsigned char akp;
|
|
};
|
|
|
|
extern struct klock_info_struct klock_info;
|
|
#define KLOCK_HELD 0xffffffff
|
|
#define KLOCK_CLEAR 0x0
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#else /* !(CONFIG_SMP) */
|
|
|
|
#endif /* !(CONFIG_SMP) */
|
|
|
|
#endif /* !(_PPC_SMP_H) */
|
|
#endif /* __KERNEL__ */
|