| 1 |
1275 |
phoenix |
/*
|
| 2 |
|
|
* asm-ia64/acpi.h
|
| 3 |
|
|
*
|
| 4 |
|
|
* Copyright (C) 1999 VA Linux Systems
|
| 5 |
|
|
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
|
| 6 |
|
|
* Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
|
| 7 |
|
|
* Copyright (C) 2001,2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
| 8 |
|
|
*
|
| 9 |
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 10 |
|
|
*
|
| 11 |
|
|
* This program is free software; you can redistribute it and/or modify
|
| 12 |
|
|
* it under the terms of the GNU General Public License as published by
|
| 13 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
| 14 |
|
|
* (at your option) any later version.
|
| 15 |
|
|
*
|
| 16 |
|
|
* This program is distributed in the hope that it will be useful,
|
| 17 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 18 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 19 |
|
|
* GNU General Public License for more details.
|
| 20 |
|
|
*
|
| 21 |
|
|
* You should have received a copy of the GNU General Public License
|
| 22 |
|
|
* along with this program; if not, write to the Free Software
|
| 23 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 24 |
|
|
*
|
| 25 |
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 26 |
|
|
*/
|
| 27 |
|
|
|
| 28 |
|
|
#ifndef _ASM_ACPI_H
|
| 29 |
|
|
#define _ASM_ACPI_H
|
| 30 |
|
|
|
| 31 |
|
|
#ifdef __KERNEL__
|
| 32 |
|
|
|
| 33 |
|
|
#define COMPILER_DEPENDENT_INT64 long
|
| 34 |
|
|
#define COMPILER_DEPENDENT_UINT64 unsigned long
|
| 35 |
|
|
|
| 36 |
|
|
/*
|
| 37 |
|
|
* Calling conventions:
|
| 38 |
|
|
*
|
| 39 |
|
|
* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
|
| 40 |
|
|
* ACPI_EXTERNAL_XFACE - External ACPI interfaces
|
| 41 |
|
|
* ACPI_INTERNAL_XFACE - Internal ACPI interfaces
|
| 42 |
|
|
* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
|
| 43 |
|
|
*/
|
| 44 |
|
|
#define ACPI_SYSTEM_XFACE
|
| 45 |
|
|
#define ACPI_EXTERNAL_XFACE
|
| 46 |
|
|
#define ACPI_INTERNAL_XFACE
|
| 47 |
|
|
#define ACPI_INTERNAL_VAR_XFACE
|
| 48 |
|
|
|
| 49 |
|
|
/* Asm macros */
|
| 50 |
|
|
|
| 51 |
|
|
#define ACPI_ASM_MACROS
|
| 52 |
|
|
#define BREAKPOINT3
|
| 53 |
|
|
#define ACPI_DISABLE_IRQS() __cli()
|
| 54 |
|
|
#define ACPI_ENABLE_IRQS() __sti()
|
| 55 |
|
|
#define ACPI_FLUSH_CPU_CACHE()
|
| 56 |
|
|
|
| 57 |
|
|
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
|
| 58 |
|
|
do { \
|
| 59 |
|
|
__asm__ volatile ("1: ld4 r29=[%1]\n" \
|
| 60 |
|
|
";;\n" \
|
| 61 |
|
|
"mov ar.ccv=r29\n" \
|
| 62 |
|
|
"mov r2=r29\n" \
|
| 63 |
|
|
"shr.u r30=r29,1\n" \
|
| 64 |
|
|
"and r29=-4,r29\n" \
|
| 65 |
|
|
";;\n" \
|
| 66 |
|
|
"add r29=2,r29\n" \
|
| 67 |
|
|
"and r30=1,r30\n" \
|
| 68 |
|
|
";;\n" \
|
| 69 |
|
|
"add r29=r29,r30\n" \
|
| 70 |
|
|
";;\n" \
|
| 71 |
|
|
"cmpxchg4.acq r30=[%1],r29,ar.ccv\n" \
|
| 72 |
|
|
";;\n" \
|
| 73 |
|
|
"cmp.eq p6,p7=r2,r30\n" \
|
| 74 |
|
|
"(p7) br.dpnt.few 1b\n" \
|
| 75 |
|
|
"cmp.gt p8,p9=3,r29\n" \
|
| 76 |
|
|
";;\n" \
|
| 77 |
|
|
"(p8) mov %0=-1\n" \
|
| 78 |
|
|
"(p9) mov %0=r0\n" \
|
| 79 |
|
|
:"=r"(Acq):"r"(GLptr):"r2","r29","r30","memory"); \
|
| 80 |
|
|
} while (0)
|
| 81 |
|
|
|
| 82 |
|
|
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
|
| 83 |
|
|
do { \
|
| 84 |
|
|
__asm__ volatile ("1: ld4 r29=[%1]\n" \
|
| 85 |
|
|
";;\n" \
|
| 86 |
|
|
"mov ar.ccv=r29\n" \
|
| 87 |
|
|
"mov r2=r29\n" \
|
| 88 |
|
|
"and r29=-4,r29\n" \
|
| 89 |
|
|
";;\n" \
|
| 90 |
|
|
"cmpxchg4.acq r30=[%1],r29,ar.ccv\n" \
|
| 91 |
|
|
";;\n" \
|
| 92 |
|
|
"cmp.eq p6,p7=r2,r30\n" \
|
| 93 |
|
|
"(p7) br.dpnt.few 1b\n" \
|
| 94 |
|
|
"and %0=1,r2\n" \
|
| 95 |
|
|
";;\n" \
|
| 96 |
|
|
:"=r"(Acq):"r"(GLptr):"r2","r29","r30","memory"); \
|
| 97 |
|
|
} while (0)
|
| 98 |
|
|
|
| 99 |
|
|
#define acpi_disabled 0 /* ACPI always enabled */
|
| 100 |
|
|
#define acpi_strict 1 /* no ACPI workarounds */
|
| 101 |
|
|
static inline void disable_acpi(void) { }
|
| 102 |
|
|
|
| 103 |
|
|
const char *acpi_get_sysname (void);
|
| 104 |
|
|
int acpi_request_vector (u32 int_type);
|
| 105 |
|
|
int acpi_get_prt (struct pci_vector_struct **vectors, int *count);
|
| 106 |
|
|
int acpi_get_interrupt_model (int *type);
|
| 107 |
|
|
int acpi_irq_to_vector (u32 irq);
|
| 108 |
|
|
|
| 109 |
|
|
#ifdef CONFIG_ACPI_NUMA
|
| 110 |
|
|
#include <asm/numa.h>
|
| 111 |
|
|
/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/
|
| 112 |
|
|
#define MAX_PXM_DOMAINS (256)
|
| 113 |
|
|
extern int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
|
| 114 |
|
|
extern int __initdata nid_to_pxm_map[NR_NODES];
|
| 115 |
|
|
#endif
|
| 116 |
|
|
|
| 117 |
|
|
#endif /*__KERNEL__*/
|
| 118 |
|
|
|
| 119 |
|
|
#endif /*_ASM_ACPI_H*/
|