1/* 2 * BK Id: SCCS/s.smp.h 1.14 03/28/02 16:54:23 hozer 3 */ 4/* smp.h: PPC specific SMP stuff. 5 * 6 * Original was a copy of sparc smp.h. Now heavily modified 7 * for PPC. 8 * 9 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 10 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com> 11 */ 12#ifdef __KERNEL__ 13#ifndef _PPC_SMP_H 14#define _PPC_SMP_H 15 16#include <linux/config.h> 17#include <linux/kernel.h> 18 19#ifdef CONFIG_SMP 20 21#ifndef __ASSEMBLY__ 22 23struct cpuinfo_PPC { 24 unsigned long loops_per_jiffy; 25 unsigned long pvr; 26 unsigned long *pgd_cache; 27 unsigned long *pte_cache; 28 unsigned long pgtable_cache_sz; 29}; 30 31extern struct cpuinfo_PPC cpu_data[NR_CPUS]; 32extern unsigned long cpu_online_map; 33extern unsigned long smp_proc_in_lock[NR_CPUS]; 34extern volatile unsigned long cpu_callin_map[NR_CPUS]; 35extern int smp_tb_synchronized; 36 37extern void smp_store_cpu_info(int id); 38extern void smp_send_tlb_invalidate(int); 39extern void smp_send_xmon_break(int cpu); 40struct pt_regs; 41extern void smp_message_recv(int, struct pt_regs *); 42extern void smp_local_timer_interrupt(struct pt_regs *); 43 44#define NO_PROC_ID 0xFF /* No processor magic marker */ 45#define PROC_CHANGE_PENALTY 20 46 47/* 1 to 1 mapping on PPC -- Cort */ 48#define cpu_logical_map(cpu) (cpu) 49#define cpu_number_map(x) (x) 50 51#define smp_processor_id() (current->processor) 52 53extern int smp_hw_index[NR_CPUS]; 54#define hard_smp_processor_id() (smp_hw_index[smp_processor_id()]) 55 56struct klock_info_struct { 57 unsigned long kernel_flag; 58 unsigned char akp; 59}; 60 61extern struct klock_info_struct klock_info; 62#define KLOCK_HELD 0xffffffff 63#define KLOCK_CLEAR 0x0 64 65#ifdef CONFIG_750_SMP 66#define smp_send_tlb_invalidate(x) smp_ppc750_send_tlb_invalidate(x) 67#else 68#define smp_send_tlb_invalidate(x) do {} while(0) 69#endif 70 71#endif /* __ASSEMBLY__ */ 72 73#else /* !(CONFIG_SMP) */ 74 75#endif /* !(CONFIG_SMP) */ 76 77#endif /* !(_PPC_SMP_H) */ 78#endif /* __KERNEL__ */ 79