treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
[linux-block.git] / arch / ia64 / include / asm / acpi.h
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4 2/*
1da177e4
LT
3 * Copyright (C) 1999 VA Linux Systems
4 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
5 * Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
6 * Copyright (C) 2001,2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
1da177e4
LT
7 */
8
9#ifndef _ASM_ACPI_H
10#define _ASM_ACPI_H
11
12#ifdef __KERNEL__
13
35729449
VP
14#include <acpi/pdc_intel.h>
15
1da177e4
LT
16#include <linux/init.h>
17#include <linux/numa.h>
2c6e6db4 18#include <asm/numa.h>
1da177e4 19
e56d953d 20#ifdef CONFIG_ACPI
247dba58 21extern int acpi_lapic;
1da177e4
LT
22#define acpi_disabled 0 /* ACPI always enabled on IA64 */
23#define acpi_noirq 0 /* ACPI always enabled on IA64 */
24#define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
25#define acpi_strict 1 /* no ACPI spec workarounds on IA64 */
b50154d5
GG
26
27static inline bool acpi_has_cpu_in_madt(void)
28{
29 return !!acpi_lapic;
30}
e56d953d 31#endif
c1c30634 32#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
1da177e4
LT
33static inline void disable_acpi(void) { }
34
d868080d 35#ifdef CONFIG_IA64_GENERIC
1da177e4 36const char *acpi_get_sysname (void);
d868080d
AC
37#else
38static inline const char *acpi_get_sysname (void)
39{
40# if defined (CONFIG_IA64_HP_SIM)
41 return "hpsim";
42# elif defined (CONFIG_IA64_HP_ZX1)
43 return "hpzx1";
44# elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB)
45 return "hpzx1_swiotlb";
46# elif defined (CONFIG_IA64_SGI_SN2)
47 return "sn2";
48# elif defined (CONFIG_IA64_SGI_UV)
49 return "uv";
50# elif defined (CONFIG_IA64_DIG)
51 return "dig";
d868080d
AC
52# elif defined(CONFIG_IA64_DIG_VTD)
53 return "dig_vtd";
54# else
55# error Unknown platform. Fix acpi.c.
56# endif
57}
58#endif
1da177e4
LT
59int acpi_request_vector (u32 int_type);
60int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
61
f1a2003e
RW
62/* Low-level suspend routine. */
63extern int acpi_suspend_lowlevel(void);
c41b93fb 64
e8b2fd01
LB
65extern unsigned long acpi_wakeup_address;
66
55e59c51
AR
67/*
68 * Record the cpei override flag and current logical cpu. This is
69 * useful for CPU removal.
70 */
71extern unsigned int can_cpei_retarget(void);
72extern unsigned int is_cpu_cpei_target(unsigned int cpu);
73extern void set_cpei_target_cpu(unsigned int cpu);
74extern unsigned int get_cpei_target_cpu(void);
a6b14fa6 75extern void prefill_possible_map(void);
2c6e6db4 76#ifdef CONFIG_ACPI_HOTPLUG_CPU
a6b14fa6 77extern int additional_cpus;
2c6e6db4 78#else
79#define additional_cpus 0
80#endif
55e59c51 81
1da177e4 82#ifdef CONFIG_ACPI_NUMA
0d9adec5
JS
83#if MAX_NUMNODES > 256
84#define MAX_PXM_DOMAINS MAX_NUMNODES
3ad5ef8b 85#else
1da177e4 86#define MAX_PXM_DOMAINS (256)
3ad5ef8b 87#endif
5b5e76e9 88extern int pxm_to_nid_map[MAX_PXM_DOMAINS];
1da177e4
LT
89extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
90#endif
91
1d9cb470 92static inline bool arch_has_acpi_pdc(void) { return true; }
6c5807d7
AC
93static inline void arch_acpi_set_pdc_bits(u32 *buf)
94{
95 buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
96}
1d9cb470 97
67535736
AL
98#define acpi_unlazy_tlb(x)
99
2c6e6db4 100#ifdef CONFIG_ACPI_NUMA
101extern cpumask_t early_cpu_possible_map;
102#define for_each_possible_early_cpu(cpu) \
5d2068da 103 for_each_cpu((cpu), &early_cpu_possible_map)
2c6e6db4 104
105static inline void per_cpu_scan_finalize(int min_cpus, int reserve_cpus)
106{
107 int low_cpu, high_cpu;
108 int cpu;
109 int next_nid = 0;
110
5d2068da 111 low_cpu = cpumask_weight(&early_cpu_possible_map);
2c6e6db4 112
113 high_cpu = max(low_cpu, min_cpus);
114 high_cpu = min(high_cpu + reserve_cpus, NR_CPUS);
115
116 for (cpu = low_cpu; cpu < high_cpu; cpu++) {
5d2068da 117 cpumask_set_cpu(cpu, &early_cpu_possible_map);
2c6e6db4 118 if (node_cpuid[cpu].nid == NUMA_NO_NODE) {
119 node_cpuid[cpu].nid = next_nid;
120 next_nid++;
121 if (next_nid >= num_online_nodes())
122 next_nid = 0;
123 }
124 }
125}
312521d0
RR
126
127extern void acpi_numa_fixup(void);
128
2c6e6db4 129#endif /* CONFIG_ACPI_NUMA */
130
1da177e4
LT
131#endif /*__KERNEL__*/
132
133#endif /*_ASM_ACPI_H*/