1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2a439fe51SSam Ravnborg /* smp.h: Sparc64 specific SMP stuff. 3a439fe51SSam Ravnborg * 4a439fe51SSam Ravnborg * Copyright (C) 1996, 2008 David S. Miller (davem@davemloft.net) 5a439fe51SSam Ravnborg */ 6a439fe51SSam Ravnborg 7a439fe51SSam Ravnborg #ifndef _SPARC64_SMP_H 8a439fe51SSam Ravnborg #define _SPARC64_SMP_H 9a439fe51SSam Ravnborg 10a439fe51SSam Ravnborg #include <linux/threads.h> 11a439fe51SSam Ravnborg #include <asm/asi.h> 12a439fe51SSam Ravnborg #include <asm/starfire.h> 13a439fe51SSam Ravnborg #include <asm/spitfire.h> 14a439fe51SSam Ravnborg 15a439fe51SSam Ravnborg #ifndef __ASSEMBLY__ 16a439fe51SSam Ravnborg 17a439fe51SSam Ravnborg #include <linux/cpumask.h> 18a439fe51SSam Ravnborg #include <linux/cache.h> 19a439fe51SSam Ravnborg 20a439fe51SSam Ravnborg #endif /* !(__ASSEMBLY__) */ 21a439fe51SSam Ravnborg 22a439fe51SSam Ravnborg #ifdef CONFIG_SMP 23a439fe51SSam Ravnborg 24a439fe51SSam Ravnborg #ifndef __ASSEMBLY__ 25a439fe51SSam Ravnborg 26a439fe51SSam Ravnborg /* 27a439fe51SSam Ravnborg * Private routines/data 28a439fe51SSam Ravnborg */ 29a439fe51SSam Ravnborg 30a439fe51SSam Ravnborg #include <linux/bitops.h> 3160063497SArun Sharma #include <linux/atomic.h> 32a439fe51SSam Ravnborg #include <asm/percpu.h> 33a439fe51SSam Ravnborg 34a439fe51SSam Ravnborg DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 35a439fe51SSam Ravnborg extern cpumask_t cpu_core_map[NR_CPUS]; 36a439fe51SSam Ravnborg 378536e02eSVijay Kumar void smp_init_cpu_poke(void); 388536e02eSVijay Kumar void scheduler_poke(void); 398536e02eSVijay Kumar 40f05a6865SSam Ravnborg void arch_send_call_function_single_ipi(int cpu); 41f05a6865SSam Ravnborg void arch_send_call_function_ipi_mask(const struct cpumask *mask); 42a439fe51SSam Ravnborg 43a439fe51SSam Ravnborg /* 44a439fe51SSam Ravnborg * General functions that each host system must provide. 45a439fe51SSam Ravnborg */ 46a439fe51SSam Ravnborg 47f05a6865SSam Ravnborg int hard_smp_processor_id(void); 48a439fe51SSam Ravnborg #define raw_smp_processor_id() (current_thread_info()->cpu) 49a439fe51SSam Ravnborg 50f05a6865SSam Ravnborg void smp_fill_in_sib_core_maps(void); 51*b9952d50SJosh Poimboeuf void __noreturn cpu_play_dead(void); 52a439fe51SSam Ravnborg 53f05a6865SSam Ravnborg void smp_fetch_global_regs(void); 54f05a6865SSam Ravnborg void smp_fetch_global_pmu(void); 55a439fe51SSam Ravnborg 56cb1b8209SSam Ravnborg struct seq_file; 57cb1b8209SSam Ravnborg void smp_bogo(struct seq_file *); 58cb1b8209SSam Ravnborg void smp_info(struct seq_file *); 59cb1b8209SSam Ravnborg 60a0c54a21SSam Ravnborg void smp_callin(void); 61a0c54a21SSam Ravnborg void cpu_panic(void); 62a0c54a21SSam Ravnborg void smp_synchronize_tick_client(void); 63a0c54a21SSam Ravnborg void smp_capture(void); 64a0c54a21SSam Ravnborg void smp_release(void); 65a0c54a21SSam Ravnborg 66a439fe51SSam Ravnborg #ifdef CONFIG_HOTPLUG_CPU 67f05a6865SSam Ravnborg int __cpu_disable(void); 68f05a6865SSam Ravnborg void __cpu_die(unsigned int cpu); 69a439fe51SSam Ravnborg #endif 70a439fe51SSam Ravnborg 71a439fe51SSam Ravnborg #endif /* !(__ASSEMBLY__) */ 72a439fe51SSam Ravnborg 73a439fe51SSam Ravnborg #else 74a439fe51SSam Ravnborg 75a439fe51SSam Ravnborg #define hard_smp_processor_id() 0 76a439fe51SSam Ravnborg #define smp_fill_in_sib_core_maps() do { } while (0) 77a439fe51SSam Ravnborg #define smp_fetch_global_regs() do { } while (0) 78916ca14aSDavid S. Miller #define smp_fetch_global_pmu() do { } while (0) 798536e02eSVijay Kumar #define smp_init_cpu_poke() do { } while (0) 808536e02eSVijay Kumar #define scheduler_poke() do { } while (0) 81a439fe51SSam Ravnborg 82a439fe51SSam Ravnborg #endif /* !(CONFIG_SMP) */ 83a439fe51SSam Ravnborg 84a439fe51SSam Ravnborg #endif /* !(_SPARC64_SMP_H) */ 85