smp.h (498495dba268b20e8eadd7fe93c140c68b6cc9d2) | smp.h (b3545192e2b4647234254c5122f8cbfddbcbdaa0) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * SMP Support 4 * 5 * Copyright (C) 1999 VA Linux Systems 6 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com> 7 * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P. 8 * David Mosberger-Tang <davidm@hpl.hp.com> --- 4 unchanged lines hidden (view full) --- 13 14#include <linux/init.h> 15#include <linux/threads.h> 16#include <linux/kernel.h> 17#include <linux/cpumask.h> 18#include <linux/bitops.h> 19#include <linux/irqreturn.h> 20 | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * SMP Support 4 * 5 * Copyright (C) 1999 VA Linux Systems 6 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com> 7 * (c) Copyright 2001-2003, 2005 Hewlett-Packard Development Company, L.P. 8 * David Mosberger-Tang <davidm@hpl.hp.com> --- 4 unchanged lines hidden (view full) --- 13 14#include <linux/init.h> 15#include <linux/threads.h> 16#include <linux/kernel.h> 17#include <linux/cpumask.h> 18#include <linux/bitops.h> 19#include <linux/irqreturn.h> 20 |
21#include <asm/io.h> | |
22#include <asm/param.h> 23#include <asm/processor.h> 24#include <asm/ptrace.h> 25 26static inline unsigned int 27ia64_get_lid (void) 28{ 29 union { --- 9 unchanged lines hidden (view full) --- 39 lid.bits = ia64_getreg(_IA64_REG_CR_LID); 40 return lid.f.id << 8 | lid.f.eid; 41} 42 43#define hard_smp_processor_id() ia64_get_lid() 44 45#ifdef CONFIG_SMP 46 | 21#include <asm/param.h> 22#include <asm/processor.h> 23#include <asm/ptrace.h> 24 25static inline unsigned int 26ia64_get_lid (void) 27{ 28 union { --- 9 unchanged lines hidden (view full) --- 38 lid.bits = ia64_getreg(_IA64_REG_CR_LID); 39 return lid.f.id << 8 | lid.f.eid; 40} 41 42#define hard_smp_processor_id() ia64_get_lid() 43 44#ifdef CONFIG_SMP 45 |
47#define XTP_OFFSET 0x1e0008 48 49#define SMP_IRQ_REDIRECTION (1 << 0) 50#define SMP_IPI_REDIRECTION (1 << 1) 51 | |
52#define raw_smp_processor_id() (current_thread_info()->cpu) 53 54extern struct smp_boot_data { 55 int cpu_count; 56 int cpu_phys_id[NR_CPUS]; 57} smp_boot_data __initdata; 58 59extern char no_int_routing; 60 61extern cpumask_t cpu_core_map[NR_CPUS]; 62DECLARE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); 63extern int smp_num_siblings; 64extern void __iomem *ipi_base_addr; | 46#define raw_smp_processor_id() (current_thread_info()->cpu) 47 48extern struct smp_boot_data { 49 int cpu_count; 50 int cpu_phys_id[NR_CPUS]; 51} smp_boot_data __initdata; 52 53extern char no_int_routing; 54 55extern cpumask_t cpu_core_map[NR_CPUS]; 56DECLARE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); 57extern int smp_num_siblings; 58extern void __iomem *ipi_base_addr; |
65extern unsigned char smp_int_redirect; | |
66 67extern volatile int ia64_cpu_to_sapicid[]; 68#define cpu_physical_id(i) ia64_cpu_to_sapicid[i] 69 70extern unsigned long ap_wakeup_vector; 71 72/* 73 * Function to map hard smp processor id to logical id. Slow, so don't use this in --- 5 unchanged lines hidden (view full) --- 79 int i; 80 81 for (i = 0; i < NR_CPUS; ++i) 82 if (cpu_physical_id(i) == cpuid) 83 break; 84 return i; 85} 86 | 59 60extern volatile int ia64_cpu_to_sapicid[]; 61#define cpu_physical_id(i) ia64_cpu_to_sapicid[i] 62 63extern unsigned long ap_wakeup_vector; 64 65/* 66 * Function to map hard smp processor id to logical id. Slow, so don't use this in --- 5 unchanged lines hidden (view full) --- 72 int i; 73 74 for (i = 0; i < NR_CPUS; ++i) 75 if (cpu_physical_id(i) == cpuid) 76 break; 77 return i; 78} 79 |
87/* 88 * XTP control functions: 89 * min_xtp : route all interrupts to this CPU 90 * normal_xtp: nominal XTP value 91 * max_xtp : never deliver interrupts to this CPU. 92 */ 93 94static inline void 95min_xtp (void) 96{ 97 if (smp_int_redirect & SMP_IRQ_REDIRECTION) 98 writeb(0x00, ipi_base_addr + XTP_OFFSET); /* XTP to min */ 99} 100 101static inline void 102normal_xtp (void) 103{ 104 if (smp_int_redirect & SMP_IRQ_REDIRECTION) 105 writeb(0x08, ipi_base_addr + XTP_OFFSET); /* XTP normal */ 106} 107 108static inline void 109max_xtp (void) 110{ 111 if (smp_int_redirect & SMP_IRQ_REDIRECTION) 112 writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */ 113} 114 | |
115/* Upping and downing of CPUs */ 116extern int __cpu_disable (void); 117extern void __cpu_die (unsigned int cpu); 118extern void cpu_die (void) __attribute__ ((noreturn)); 119extern void __init smp_build_cpu_map(void); 120 121extern void __init init_smp_config (void); 122extern void smp_do_timer (struct pt_regs *regs); --- 16 unchanged lines hidden --- | 80/* Upping and downing of CPUs */ 81extern int __cpu_disable (void); 82extern void __cpu_die (unsigned int cpu); 83extern void cpu_die (void) __attribute__ ((noreturn)); 84extern void __init smp_build_cpu_map(void); 85 86extern void __init init_smp_config (void); 87extern void smp_do_timer (struct pt_regs *regs); --- 16 unchanged lines hidden --- |