aclinux.h revision 7b1019a6d29ccb7999dc76cba3dde1c627e8e609
4b22b9337f359bfd063322244f5336cc7c6ffcfars/******************************************************************************
cda73f64f20b8a0afc4909f5ea1f055ec7913856Toomas Soome * Name: aclinux.h - OS specific defines, etc. for Linux
4b22b9337f359bfd063322244f5336cc7c6ffcfars *****************************************************************************/
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * Copyright (C) 2000 - 2016, Intel Corp.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * All rights reserved.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Redistribution and use in source and binary forms, with or without
4b22b9337f359bfd063322244f5336cc7c6ffcfars * modification, are permitted provided that the following conditions
4b22b9337f359bfd063322244f5336cc7c6ffcfars * are met:
4b22b9337f359bfd063322244f5336cc7c6ffcfars * 1. Redistributions of source code must retain the above copyright
4b22b9337f359bfd063322244f5336cc7c6ffcfars * notice, this list of conditions, and the following disclaimer,
4b22b9337f359bfd063322244f5336cc7c6ffcfars * without modification.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * 2. Redistributions in binary form must reproduce at minimum a disclaimer
4b22b9337f359bfd063322244f5336cc7c6ffcfars * substantially similar to the "NO WARRANTY" disclaimer below
4b22b9337f359bfd063322244f5336cc7c6ffcfars * ("Disclaimer") and any redistribution must be conditioned upon
4b22b9337f359bfd063322244f5336cc7c6ffcfars * including a substantially similar Disclaimer requirement for further
4b22b9337f359bfd063322244f5336cc7c6ffcfars * binary redistribution.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * 3. Neither the names of the above-listed copyright holders nor the names
4b22b9337f359bfd063322244f5336cc7c6ffcfars * of any contributors may be used to endorse or promote products derived
4b22b9337f359bfd063322244f5336cc7c6ffcfars * from this software without specific prior written permission.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Alternatively, this software may be distributed under the terms of the
4b22b9337f359bfd063322244f5336cc7c6ffcfars * GNU General Public License ("GPL") version 2 as published by the Free
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Software Foundation.
4b22b9337f359bfd063322244f5336cc7c6ffcfars * NO WARRANTY
4b22b9337f359bfd063322244f5336cc7c6ffcfars * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4b22b9337f359bfd063322244f5336cc7c6ffcfars * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4b22b9337f359bfd063322244f5336cc7c6ffcfars * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
4b22b9337f359bfd063322244f5336cc7c6ffcfars * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4b22b9337f359bfd063322244f5336cc7c6ffcfars * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4b22b9337f359bfd063322244f5336cc7c6ffcfars * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4b22b9337f359bfd063322244f5336cc7c6ffcfars * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
4b22b9337f359bfd063322244f5336cc7c6ffcfars * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
4b22b9337f359bfd063322244f5336cc7c6ffcfars * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * POSSIBILITY OF SUCH DAMAGES.
4b22b9337f359bfd063322244f5336cc7c6ffcfars/* ACPICA external files should not include ACPICA headers directly. */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome/* Common (in-kernel/user-space) ACPICA configuration */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome/* Kernel specific ACPICA configuration */
cda73f64f20b8a0afc4909f5ea1f055ec7913856Toomas Soome/* External globals for __KERNEL__, stubs is needed */
cda73f64f20b8a0afc4909f5ea1f055ec7913856Toomas Soome/* Generating stubs for configurable ACPICA macros */
4b22b9337f359bfd063322244f5336cc7c6ffcfars/* Generating stubs for configurable ACPICA functions */
4b22b9337f359bfd063322244f5336cc7c6ffcfars/* External interface for __KERNEL__, stub is needed */
4b22b9337f359bfd063322244f5336cc7c6ffcfars static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
4b22b9337f359bfd063322244f5336cc7c6ffcfars#endif /* CONFIG_ACPI */
4b22b9337f359bfd063322244f5336cc7c6ffcfars/* Host-dependent types and defines for in-kernel ACPICA */
4b22b9337f359bfd063322244f5336cc7c6ffcfars#define ACPI_CPU_FLAGS unsigned long
4b22b9337f359bfd063322244f5336cc7c6ffcfars/* Use native linux version of AcpiOsAllocateZeroed */
4b22b9337f359bfd063322244f5336cc7c6ffcfars * Overrides for in-kernel ACPICA
4b22b9337f359bfd063322244f5336cc7c6ffcfars * OSL interfaces used by debugger/disassembler
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome * OSL interfaces used by utilities
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_MSG_EXCEPTION KERN_ERR "ACPI Exception: "
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_MSG_WARNING KERN_WARNING "ACPI Warning: "
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): "
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): "
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#else /* !__KERNEL__ */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome/* Define/disable kernel-specific declarators */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome/* Host-dependent types and defines for user-space ACPICA */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#if defined(__ia64__) || defined(__x86_64__) ||\
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define COMPILER_DEPENDENT_UINT64 unsigned long
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#define COMPILER_DEPENDENT_UINT64 unsigned long long
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#endif /* __KERNEL__ */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome/* Linux uses GCC */
5ffb0c9b03b5149ff4f5821a62be4a52408ada2aToomas Soome#endif /* __ACLINUX_H__ */