File Index
Files and directories
Sign in
FILE

numa.h

File preview with syntax highlighting.

linux-6.19.14/arch/x86/include/asm/numa.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _ASM_X86_NUMA_H
 3#define _ASM_X86_NUMA_H
 4
 5#include <linux/nodemask.h>
 6#include <linux/errno.h>
 7
 8#include <asm/topology.h>
 9#include <asm/apicdef.h>
10
11#ifdef CONFIG_NUMA
12
13extern int numa_off;
14
15/*
16 * __apicid_to_node[] stores the raw mapping between physical apicid and
17 * node and is used to initialize cpu_to_node mapping.
18 *
19 * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus
20 * should be accessed by the accessors - set_apicid_to_node() and
21 * numa_cpu_node().
22 */
23extern s16 __apicid_to_node[MAX_LOCAL_APIC];
24extern nodemask_t numa_nodes_parsed __initdata;
25extern nodemask_t numa_phys_nodes_parsed __initdata;
26
27static inline void set_apicid_to_node(int apicid, s16 node)
28{
29	__apicid_to_node[apicid] = node;
30}
31
32extern int numa_cpu_node(int cpu);
33
34#else	/* CONFIG_NUMA */
35static inline void set_apicid_to_node(int apicid, s16 node)
36{
37}
38
39static inline int numa_cpu_node(int cpu)
40{
41	return NUMA_NO_NODE;
42}
43#endif	/* CONFIG_NUMA */
44
45#ifdef CONFIG_NUMA
46extern void numa_set_node(int cpu, int node);
47extern void numa_clear_node(int cpu);
48extern void __init init_cpu_to_node(void);
49extern void numa_add_cpu(unsigned int cpu);
50extern void numa_remove_cpu(unsigned int cpu);
51extern void init_gi_nodes(void);
52extern int num_phys_nodes(void);
53#else	/* CONFIG_NUMA */
54static inline void numa_set_node(int cpu, int node)	{ }
55static inline void numa_clear_node(int cpu)		{ }
56static inline void init_cpu_to_node(void)		{ }
57static inline void numa_add_cpu(unsigned int cpu)	{ }
58static inline void numa_remove_cpu(unsigned int cpu)	{ }
59static inline void init_gi_nodes(void)			{ }
60static inline int num_phys_nodes(void)
61{
62	return 1;
63}
64#endif	/* CONFIG_NUMA */
65
66#ifdef CONFIG_DEBUG_PER_CPU_MAPS
67void debug_cpumask_set_cpu(unsigned int cpu, int node, bool enable);
68#endif
69
70#endif	/* _ASM_X86_NUMA_H */
~/ Read-only file preview.