1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */ 2*4882a593Smuzhiyun #ifndef __ASM_TOPOLOGY_H 3*4882a593Smuzhiyun #define __ASM_TOPOLOGY_H 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun #include <linux/cpumask.h> 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun #ifdef CONFIG_NUMA 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun struct pci_bus; 10*4882a593Smuzhiyun int pcibus_to_node(struct pci_bus *bus); 11*4882a593Smuzhiyun #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ 12*4882a593Smuzhiyun cpu_all_mask : \ 13*4882a593Smuzhiyun cpumask_of_node(pcibus_to_node(bus))) 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun #endif /* CONFIG_NUMA */ 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun #include <linux/arch_topology.h> 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun #ifdef CONFIG_ARM64_AMU_EXTN 20*4882a593Smuzhiyun /* 21*4882a593Smuzhiyun * Replace task scheduler's default counter-based 22*4882a593Smuzhiyun * frequency-invariance scale factor setting. 23*4882a593Smuzhiyun */ 24*4882a593Smuzhiyun void topology_scale_freq_tick(void); 25*4882a593Smuzhiyun #define arch_scale_freq_tick topology_scale_freq_tick 26*4882a593Smuzhiyun #endif /* CONFIG_ARM64_AMU_EXTN */ 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun /* Replace task scheduler's default frequency-invariant accounting */ 29*4882a593Smuzhiyun #define arch_set_freq_scale topology_set_freq_scale 30*4882a593Smuzhiyun #define arch_scale_freq_capacity topology_get_freq_scale 31*4882a593Smuzhiyun #define arch_scale_freq_invariant topology_scale_freq_invariant 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun /* Replace task scheduler's default cpu-invariant accounting */ 34*4882a593Smuzhiyun #define arch_scale_cpu_capacity topology_get_cpu_scale 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun /* Enable topology flag updates */ 37*4882a593Smuzhiyun #define arch_update_cpu_topology topology_update_cpu_topology 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun /* Replace task scheduler's default thermal pressure API */ 40*4882a593Smuzhiyun #define arch_scale_thermal_pressure topology_get_thermal_pressure 41*4882a593Smuzhiyun #define arch_set_thermal_pressure topology_set_thermal_pressure 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun #include <asm-generic/topology.h> 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun #endif /* _ASM_ARM_TOPOLOGY_H */ 46