18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* smp.h: Sparc64 specific SMP stuff. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (C) 1996, 2008 David S. Miller (davem@davemloft.net) 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifndef _SPARC64_SMP_H 88c2ecf20Sopenharmony_ci#define _SPARC64_SMP_H 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include <linux/threads.h> 118c2ecf20Sopenharmony_ci#include <asm/asi.h> 128c2ecf20Sopenharmony_ci#include <asm/starfire.h> 138c2ecf20Sopenharmony_ci#include <asm/spitfire.h> 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#include <linux/cpumask.h> 188c2ecf20Sopenharmony_ci#include <linux/cache.h> 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#endif /* !(__ASSEMBLY__) */ 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci/* 278c2ecf20Sopenharmony_ci * Private routines/data 288c2ecf20Sopenharmony_ci */ 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#include <linux/bitops.h> 318c2ecf20Sopenharmony_ci#include <linux/atomic.h> 328c2ecf20Sopenharmony_ci#include <asm/percpu.h> 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciDECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 358c2ecf20Sopenharmony_ciextern cpumask_t cpu_core_map[NR_CPUS]; 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_civoid smp_init_cpu_poke(void); 388c2ecf20Sopenharmony_civoid scheduler_poke(void); 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_civoid arch_send_call_function_single_ipi(int cpu); 418c2ecf20Sopenharmony_civoid arch_send_call_function_ipi_mask(const struct cpumask *mask); 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci/* 448c2ecf20Sopenharmony_ci * General functions that each host system must provide. 458c2ecf20Sopenharmony_ci */ 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ciint hard_smp_processor_id(void); 488c2ecf20Sopenharmony_ci#define raw_smp_processor_id() (current_thread_info()->cpu) 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_civoid smp_fill_in_cpu_possible_map(void); 518c2ecf20Sopenharmony_civoid smp_fill_in_sib_core_maps(void); 528c2ecf20Sopenharmony_civoid cpu_play_dead(void); 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_civoid smp_fetch_global_regs(void); 558c2ecf20Sopenharmony_civoid smp_fetch_global_pmu(void); 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_cistruct seq_file; 588c2ecf20Sopenharmony_civoid smp_bogo(struct seq_file *); 598c2ecf20Sopenharmony_civoid smp_info(struct seq_file *); 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_civoid smp_callin(void); 628c2ecf20Sopenharmony_civoid cpu_panic(void); 638c2ecf20Sopenharmony_civoid smp_synchronize_tick_client(void); 648c2ecf20Sopenharmony_civoid smp_capture(void); 658c2ecf20Sopenharmony_civoid smp_release(void); 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#ifdef CONFIG_HOTPLUG_CPU 688c2ecf20Sopenharmony_ciint __cpu_disable(void); 698c2ecf20Sopenharmony_civoid __cpu_die(unsigned int cpu); 708c2ecf20Sopenharmony_ci#endif 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci#endif /* !(__ASSEMBLY__) */ 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#else 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#define hard_smp_processor_id() 0 778c2ecf20Sopenharmony_ci#define smp_fill_in_sib_core_maps() do { } while (0) 788c2ecf20Sopenharmony_ci#define smp_fetch_global_regs() do { } while (0) 798c2ecf20Sopenharmony_ci#define smp_fetch_global_pmu() do { } while (0) 808c2ecf20Sopenharmony_ci#define smp_fill_in_cpu_possible_map() do { } while (0) 818c2ecf20Sopenharmony_ci#define smp_init_cpu_poke() do { } while (0) 828c2ecf20Sopenharmony_ci#define scheduler_poke() do { } while (0) 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci#endif /* !(CONFIG_SMP) */ 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci#endif /* !(_SPARC64_SMP_H) */ 87