acpi.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Copyright (C) 1999 VA Linux Systems
  3. * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  4. * Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
  5. * Copyright (C) 2001,2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
  6. *
  7. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. *
  23. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. */
  25. #ifndef _ASM_ACPI_H
  26. #define _ASM_ACPI_H
  27. #ifdef __KERNEL__
  28. #include <acpi/pdc_intel.h>
  29. #include <linux/init.h>
  30. #include <linux/numa.h>
  31. #include <asm/numa.h>
  32. #ifdef CONFIG_ACPI
  33. extern int acpi_lapic;
  34. #define acpi_disabled 0 /* ACPI always enabled on IA64 */
  35. #define acpi_noirq 0 /* ACPI always enabled on IA64 */
  36. #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
  37. #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */
  38. static inline bool acpi_has_cpu_in_madt(void)
  39. {
  40. return !!acpi_lapic;
  41. }
  42. #endif
  43. #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
  44. static inline void disable_acpi(void) { }
  45. #ifdef CONFIG_IA64_GENERIC
  46. const char *acpi_get_sysname (void);
  47. #else
  48. static inline const char *acpi_get_sysname (void)
  49. {
  50. # if defined (CONFIG_IA64_HP_SIM)
  51. return "hpsim";
  52. # elif defined (CONFIG_IA64_HP_ZX1)
  53. return "hpzx1";
  54. # elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB)
  55. return "hpzx1_swiotlb";
  56. # elif defined (CONFIG_IA64_SGI_SN2)
  57. return "sn2";
  58. # elif defined (CONFIG_IA64_SGI_UV)
  59. return "uv";
  60. # elif defined (CONFIG_IA64_DIG)
  61. return "dig";
  62. # elif defined(CONFIG_IA64_DIG_VTD)
  63. return "dig_vtd";
  64. # else
  65. # error Unknown platform. Fix acpi.c.
  66. # endif
  67. }
  68. #endif
  69. int acpi_request_vector (u32 int_type);
  70. int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
  71. /* Low-level suspend routine. */
  72. extern int acpi_suspend_lowlevel(void);
  73. extern unsigned long acpi_wakeup_address;
  74. /*
  75. * Record the cpei override flag and current logical cpu. This is
  76. * useful for CPU removal.
  77. */
  78. extern unsigned int can_cpei_retarget(void);
  79. extern unsigned int is_cpu_cpei_target(unsigned int cpu);
  80. extern void set_cpei_target_cpu(unsigned int cpu);
  81. extern unsigned int get_cpei_target_cpu(void);
  82. extern void prefill_possible_map(void);
  83. #ifdef CONFIG_ACPI_HOTPLUG_CPU
  84. extern int additional_cpus;
  85. #else
  86. #define additional_cpus 0
  87. #endif
  88. #ifdef CONFIG_ACPI_NUMA
  89. #if MAX_NUMNODES > 256
  90. #define MAX_PXM_DOMAINS MAX_NUMNODES
  91. #else
  92. #define MAX_PXM_DOMAINS (256)
  93. #endif
  94. extern int pxm_to_nid_map[MAX_PXM_DOMAINS];
  95. extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
  96. #endif
  97. static inline bool arch_has_acpi_pdc(void) { return true; }
  98. static inline void arch_acpi_set_pdc_bits(u32 *buf)
  99. {
  100. buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
  101. }
  102. #define acpi_unlazy_tlb(x)
  103. #ifdef CONFIG_ACPI_NUMA
  104. extern cpumask_t early_cpu_possible_map;
  105. #define for_each_possible_early_cpu(cpu) \
  106. for_each_cpu((cpu), &early_cpu_possible_map)
  107. static inline void per_cpu_scan_finalize(int min_cpus, int reserve_cpus)
  108. {
  109. int low_cpu, high_cpu;
  110. int cpu;
  111. int next_nid = 0;
  112. low_cpu = cpumask_weight(&early_cpu_possible_map);
  113. high_cpu = max(low_cpu, min_cpus);
  114. high_cpu = min(high_cpu + reserve_cpus, NR_CPUS);
  115. for (cpu = low_cpu; cpu < high_cpu; cpu++) {
  116. cpumask_set_cpu(cpu, &early_cpu_possible_map);
  117. if (node_cpuid[cpu].nid == NUMA_NO_NODE) {
  118. node_cpuid[cpu].nid = next_nid;
  119. next_nid++;
  120. if (next_nid >= num_online_nodes())
  121. next_nid = 0;
  122. }
  123. }
  124. }
  125. #endif /* CONFIG_ACPI_NUMA */
  126. #endif /*__KERNEL__*/
  127. #endif /*_ASM_ACPI_H*/