Browse Source

ACPI: move to consortium source (#201)

* ACPI: move to the standard acpica, not the linux one.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: get ACPICA to build.

This is from Intel. We can use the Intel source straight since we build as a library and restrictions
are somewhat less applicable.

This is from ACPI commit f39a732d2a0575b8a28b3d59f1836c7a3e4aa9cc

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPICA: Add tables.

Just a matter of adding a build file.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: remove unused platform/ (new one is in acpia/)

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: create build.json files for all components.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: Get user mode to build.

Kernel is temporarily disabled.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* acpi: get coreboot.h back.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: add new include files.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: start building the kernel with ACPICA

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: almost compiling.

And the init function in devacpi is calling a global init function.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: more attempts to get it to compile

It doesn't help that the ACPICA guys redefined a bunch of standard things.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: it *almost* now all compiles.

note we had to force an undef of _LINUX and __linux__.

Now we need to define AcpiOsInitialize, once we know what it does.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: compiles and builds a working kernel/userland.

As a test, devacpi::acpiinit, calls AcpiOsInitialize, which we also provide.

Many of the type names and declarations in ACPICA do not
follow the Plan 9 standard. We hope to wall most of the
usages behind the wall of devacpi. There's a lot of value
in not changing them, as one can then read the relevant
docs and see the same names in the doc as in our code.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: start calling functions.

Now the fun begins. There's all kinds of functions missing we'll need to provide.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: implement some functions.

There are others we still have no idea how to implement. Also,
the Flags to the lock stuff are unknown.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: set up the simpler functions.

I don't understand the harder ones.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: now builds.

I had to take the disassembler out of the kernel, but I am not
sure we even want it there.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* ACPI: re enable SMP

It was off while we worked things out, now it goes on.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* acpi: make acpi enabled by a flag.

This makes testing much easier.

At this point, I think the first pass of integrating ACPICA is done,
and things appear to work. I suspect if we want we can take this patch series
in. You may want to test it.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

* acpi: use the acpica library for cache utilities

That's what most other OSes do.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
ron minnich 3 years ago
parent
commit
f61c558764
100 changed files with 29859 additions and 11379 deletions
  1. 39 0
      amd64/include/mach_acpi.h
  2. 0 2
      sys/include/acpi.h
  3. 0 244
      sys/include/acpi/acbuffer.h
  4. 0 246
      sys/include/acpi/acconfig.h
  5. 0 388
      sys/include/acpi/acexcep.h
  6. 0 92
      sys/include/acpi/acnames.h
  7. 0 67
      sys/include/acpi/acpi.h
  8. 0 648
      sys/include/acpi/acpi_bus.h
  9. 0 123
      sys/include/acpi/acpi_drivers.h
  10. 0 24
      sys/include/acpi/acpi_io.h
  11. 0 65
      sys/include/acpi/acpi_lpat.h
  12. 0 20
      sys/include/acpi/acpi_numa.h
  13. 298 0
      sys/include/acpi/acpica/acapps.h
  14. 327 0
      sys/include/acpi/acpica/acbuffer.h
  15. 239 0
      sys/include/acpi/acpica/acclib.h
  16. 140 0
      sys/include/acpi/acpica/accommon.h
  17. 328 0
      sys/include/acpi/acpica/acconfig.h
  18. 570 0
      sys/include/acpi/acpica/acdebug.h
  19. 1168 0
      sys/include/acpi/acpica/acdisasm.h
  20. 546 0
      sys/include/acpi/acpica/acdispat.h
  21. 434 0
      sys/include/acpi/acpica/acevents.h
  22. 426 0
      sys/include/acpi/acpica/acexcep.h
  23. 486 0
      sys/include/acpi/acpica/acglobal.h
  24. 299 0
      sys/include/acpi/acpica/achware.h
  25. 828 0
      sys/include/acpi/acpica/acinterp.h
  26. 1511 0
      sys/include/acpi/acpica/aclocal.h
  27. 495 0
      sys/include/acpi/acpica/acmacros.h
  28. 164 0
      sys/include/acpi/acpica/acnames.h
  29. 627 0
      sys/include/acpi/acpica/acnamesp.h
  30. 663 0
      sys/include/acpi/acpica/acobject.h
  31. 108 34
      sys/src/libacpi/acpica/acopcode.h
  32. 211 126
      sys/include/acpi/acoutput.h
  33. 436 0
      sys/include/acpi/acpica/acparser.h
  34. 139 0
      sys/include/acpi/acpica/acpi.h
  35. 685 0
      sys/include/acpi/acpica/acpiosxf.h
  36. 1326 0
      sys/include/acpi/acpica/acpixf.h
  37. 1201 0
      sys/include/acpi/acpica/acpredef.h
  38. 515 0
      sys/include/acpi/acpica/acresrc.h
  39. 787 0
      sys/include/acpi/acpica/acrestyp.h
  40. 341 0
      sys/include/acpi/acpica/acstruct.h
  41. 329 0
      sys/include/acpi/acpica/actables.h
  42. 526 0
      sys/include/acpi/acpica/actbl.h
  43. 1557 0
      sys/include/acpi/acpica/actbl1.h
  44. 1794 0
      sys/include/acpi/acpica/actbl2.h
  45. 997 0
      sys/include/acpi/acpica/actbl3.h
  46. 1477 0
      sys/include/acpi/acpica/actypes.h
  47. 1194 0
      sys/include/acpi/acpica/acutils.h
  48. 162 0
      sys/include/acpi/acpica/acuuid.h
  49. 586 0
      sys/include/acpi/acpica/amlcode.h
  50. 703 0
      sys/include/acpi/acpica/amlresrc.h
  51. 177 0
      sys/include/acpi/acpica/platform/accygwin.h
  52. 200 0
      sys/include/acpi/acpica/platform/acdragonfly.h
  53. 156 0
      sys/include/acpi/acpica/platform/acdragonflyex.h
  54. 347 0
      sys/include/acpi/acpica/platform/acefi.h
  55. 927 0
      sys/include/acpi/acpica/platform/acefiex.h
  56. 488 0
      sys/include/acpi/acpica/platform/acenv.h
  57. 147 0
      sys/include/acpi/acpica/platform/acenvex.h
  58. 187 0
      sys/include/acpi/acpica/platform/acfreebsd.h
  59. 154 0
      sys/include/acpi/acpica/platform/acgcc.h
  60. 178 0
      sys/include/acpi/acpica/platform/achaiku.h
  61. 30 25
      sys/include/acpi/platform/acenvex.h
  62. 154 0
      sys/include/acpi/acpica/platform/acintel.h
  63. 289 0
      sys/include/acpi/acpica/platform/aclinux.h
  64. 230 0
      sys/include/acpi/acpica/platform/aclinuxex.h
  65. 130 0
      sys/include/acpi/acpica/platform/acmacosx.h
  66. 267 0
      sys/include/acpi/acpica/platform/acmsvc.h
  67. 126 0
      sys/include/acpi/acpica/platform/acmsvcex.h
  68. 187 0
      sys/include/acpi/acpica/platform/acnetbsd.h
  69. 166 0
      sys/include/acpi/acpica/platform/acos2.h
  70. 146 0
      sys/include/acpi/acpica/platform/acqnx.h
  71. 218 0
      sys/include/acpi/acpica/platform/acwin.h
  72. 156 0
      sys/include/acpi/acpica/platform/acwin64.h
  73. 124 0
      sys/include/acpi/acpica/platform/acwinex.h
  74. 0 456
      sys/include/acpi/acpiosxf.h
  75. 0 969
      sys/include/acpi/acpixf.h
  76. 0 621
      sys/include/acpi/acrestyp.h
  77. 0 416
      sys/include/acpi/actbl.h
  78. 0 1211
      sys/include/acpi/actbl1.h
  79. 0 1467
      sys/include/acpi/actbl2.h
  80. 0 762
      sys/include/acpi/actbl3.h
  81. 0 1299
      sys/include/acpi/actypes.h
  82. 0 89
      sys/include/acpi/acuuid.h
  83. 0 50
      sys/include/acpi/apei.h
  84. 0 25
      sys/include/acpi/button.h
  85. 0 137
      sys/include/acpi/cppc_acpi.h
  86. 0 72
      sys/include/acpi/ghes.h
  87. 0 18
      sys/include/acpi/hed.h
  88. 0 35
      sys/include/acpi/pdc_intel.h
  89. 0 403
      sys/include/acpi/platform/acenv.h
  90. 0 82
      sys/include/acpi/platform/acgcc.h
  91. 0 202
      sys/include/acpi/platform/acharvey.h
  92. 0 208
      sys/include/acpi/platform/aclinux.h
  93. 0 149
      sys/include/acpi/platform/aclinuxex.h
  94. 0 54
      sys/include/acpi/platform/acmsvcex.h
  95. 0 49
      sys/include/acpi/platform/acwinex.h
  96. 0 422
      sys/include/acpi/processor.h
  97. 0 11
      sys/include/acpi/reboot.h
  98. 0 61
      sys/include/acpi/video.h
  99. 13 7
      sys/src/9/amd64/core.json
  100. 0 0
      sys/src/9/amd64/devacpi.c

+ 39 - 0
amd64/include/mach_acpi.h

@@ -0,0 +1,39 @@
+/* acpi.h */
+/* File for Harvey-specific ACPI defines. */
+
+/* ACPI redefines things found in libc, but this one thing we need.
+ */
+
+#if 0
+typedef
+struct Lock {
+	int32_t	key;
+	int32_t	sem;
+} Lock;
+
+typedef struct QLp QLp;
+struct QLp
+{
+	int	inuse;
+	QLp	*next;
+	char	state;
+};
+
+typedef
+struct QLock
+{
+	Lock	lock;
+	int	locked;
+	QLp	*head;
+	QLp 	*tail;
+} QLock;
+
+#endif
+typedef QLock ACPI_MUTEX;
+typedef uint32_t UINT32;
+typedef uint16_t UINT16;
+typedef uint8_t UINT8;
+typedef int ACPI_THREAD_ID;
+
+#define ACPI_MACHINE_WIDTH 64
+

+ 0 - 2
sys/include/acpi.h

@@ -1,2 +0,0 @@
-/* acpi.h */
-/* File for Harvey-specific ACPI defines. */

+ 0 - 244
sys/include/acpi/acbuffer.h

@@ -1,244 +0,0 @@
-/******************************************************************************
- *
- * Name: acbuffer.h - Support for buffers returned by ACPI predefined names
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2016, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef __ACBUFFER_H__
-#define __ACBUFFER_H__
-
-/*
- * Contains buffer structures for these predefined names:
- * _FDE, _GRT, _GTM, _PLD, _SRT
- */
-
-/*
- * Note: C bitfields are not used for this reason:
- *
- * "Bitfields are great and easy to read, but unfortunately the C language
- * does not specify the layout of bitfields in memory, which means they are
- * essentially useless for dealing with packed data in on-disk formats or
- * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
- * this decision was a design error in C. Ritchie could have picked an order
- * and stuck with it." Norman Ramsey.
- * See http://stackoverflow.com/a/1053662/41661
- */
-
-/* _FDE return value */
-
-struct acpi_fde_info {
-	u32 floppy0;
-	u32 floppy1;
-	u32 floppy2;
-	u32 floppy3;
-	u32 tape;
-};
-
-/*
- * _GRT return value
- * _SRT input value
- */
-struct acpi_grt_info {
-	u16 year;
-	u8 month;
-	u8 day;
-	u8 hour;
-	u8 minute;
-	u8 second;
-	u8 valid;
-	u16 milliseconds;
-	u16 timezone;
-	u8 daylight;
-	u8 reserved[3];
-};
-
-/* _GTM return value */
-
-struct acpi_gtm_info {
-	u32 pio_speed0;
-	u32 dma_speed0;
-	u32 pio_speed1;
-	u32 dma_speed1;
-	u32 flags;
-};
-
-/*
- * Formatted _PLD return value. The minimum size is a package containing
- * one buffer.
- * Revision 1: Buffer is 16 bytes (128 bits)
- * Revision 2: Buffer is 20 bytes (160 bits)
- *
- * Note: This structure is returned from the acpi_decode_pld_buffer
- * interface.
- */
-struct acpi_pld_info {
-	u8 revision;
-	u8 ignore_color;
-	u8 red;
-	u8 green;
-	u8 blue;
-	u16 width;
-	u16 height;
-	u8 user_visible;
-	u8 dock;
-	u8 lid;
-	u8 panel;
-	u8 vertical_position;
-	u8 horizontal_position;
-	u8 shape;
-	u8 group_orientation;
-	u8 group_token;
-	u8 group_position;
-	u8 bay;
-	u8 ejectable;
-	u8 ospm_eject_required;
-	u8 cabinet_number;
-	u8 card_cage_number;
-	u8 reference;
-	u8 rotation;
-	u8 order;
-	u8 reserved;
-	u16 vertical_offset;
-	u16 horizontal_offset;
-};
-
-/*
- * Macros to:
- *     1) Convert a _PLD buffer to internal struct acpi_pld_info format - ACPI_PLD_GET*
- *        (Used by acpi_decode_pld_buffer)
- *     2) Construct a _PLD buffer - ACPI_PLD_SET*
- *        (Intended for BIOS use only)
- */
-#define ACPI_PLD_REV1_BUFFER_SIZE               16	/* For Revision 1 of the buffer (From ACPI spec) */
-#define ACPI_PLD_REV2_BUFFER_SIZE               20	/* For Revision 2 of the buffer (From ACPI spec) */
-#define ACPI_PLD_BUFFER_SIZE                    20	/* For Revision 2 of the buffer (From ACPI spec) */
-
-/* First 32-bit dword, bits 0:32 */
-
-#define ACPI_PLD_GET_REVISION(dword)            ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK)
-#define ACPI_PLD_SET_REVISION(dword,value)      ACPI_SET_BITS (dword, 0, ACPI_7BIT_MASK, value)	/* Offset 0, Len 7 */
-
-#define ACPI_PLD_GET_IGNORE_COLOR(dword)        ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_IGNORE_COLOR(dword,value)  ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value)	/* Offset 7, Len 1 */
-
-#define ACPI_PLD_GET_RED(dword)                 ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
-#define ACPI_PLD_SET_RED(dword,value)           ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value)	/* Offset 8, Len 8 */
-
-#define ACPI_PLD_GET_GREEN(dword)               ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
-#define ACPI_PLD_SET_GREEN(dword,value)         ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value)	/* Offset 16, Len 8 */
-
-#define ACPI_PLD_GET_BLUE(dword)                ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
-#define ACPI_PLD_SET_BLUE(dword,value)          ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value)	/* Offset 24, Len 8 */
-
-/* Second 32-bit dword, bits 33:63 */
-
-#define ACPI_PLD_GET_WIDTH(dword)               ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
-#define ACPI_PLD_SET_WIDTH(dword,value)         ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value)	/* Offset 32+0=32, Len 16 */
-
-#define ACPI_PLD_GET_HEIGHT(dword)              ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
-#define ACPI_PLD_SET_HEIGHT(dword,value)        ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value)	/* Offset 32+16=48, Len 16 */
-
-/* Third 32-bit dword, bits 64:95 */
-
-#define ACPI_PLD_GET_USER_VISIBLE(dword)        ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_USER_VISIBLE(dword,value)  ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value)	/* Offset 64+0=64, Len 1 */
-
-#define ACPI_PLD_GET_DOCK(dword)                ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_DOCK(dword,value)          ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value)	/* Offset 64+1=65, Len 1 */
-
-#define ACPI_PLD_GET_LID(dword)                 ACPI_GET_BITS (dword, 2, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_LID(dword,value)           ACPI_SET_BITS (dword, 2, ACPI_1BIT_MASK, value)	/* Offset 64+2=66, Len 1 */
-
-#define ACPI_PLD_GET_PANEL(dword)               ACPI_GET_BITS (dword, 3, ACPI_3BIT_MASK)
-#define ACPI_PLD_SET_PANEL(dword,value)         ACPI_SET_BITS (dword, 3, ACPI_3BIT_MASK, value)	/* Offset 64+3=67, Len 3 */
-
-#define ACPI_PLD_GET_VERTICAL(dword)            ACPI_GET_BITS (dword, 6, ACPI_2BIT_MASK)
-#define ACPI_PLD_SET_VERTICAL(dword,value)      ACPI_SET_BITS (dword, 6, ACPI_2BIT_MASK, value)	/* Offset 64+6=70, Len 2 */
-
-#define ACPI_PLD_GET_HORIZONTAL(dword)          ACPI_GET_BITS (dword, 8, ACPI_2BIT_MASK)
-#define ACPI_PLD_SET_HORIZONTAL(dword,value)    ACPI_SET_BITS (dword, 8, ACPI_2BIT_MASK, value)	/* Offset 64+8=72, Len 2 */
-
-#define ACPI_PLD_GET_SHAPE(dword)               ACPI_GET_BITS (dword, 10, ACPI_4BIT_MASK)
-#define ACPI_PLD_SET_SHAPE(dword,value)         ACPI_SET_BITS (dword, 10, ACPI_4BIT_MASK, value)	/* Offset 64+10=74, Len 4 */
-
-#define ACPI_PLD_GET_ORIENTATION(dword)         ACPI_GET_BITS (dword, 14, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_ORIENTATION(dword,value)   ACPI_SET_BITS (dword, 14, ACPI_1BIT_MASK, value)	/* Offset 64+14=78, Len 1 */
-
-#define ACPI_PLD_GET_TOKEN(dword)               ACPI_GET_BITS (dword, 15, ACPI_8BIT_MASK)
-#define ACPI_PLD_SET_TOKEN(dword,value)         ACPI_SET_BITS (dword, 15, ACPI_8BIT_MASK, value)	/* Offset 64+15=79, Len 8 */
-
-#define ACPI_PLD_GET_POSITION(dword)            ACPI_GET_BITS (dword, 23, ACPI_8BIT_MASK)
-#define ACPI_PLD_SET_POSITION(dword,value)      ACPI_SET_BITS (dword, 23, ACPI_8BIT_MASK, value)	/* Offset 64+23=87, Len 8 */
-
-#define ACPI_PLD_GET_BAY(dword)                 ACPI_GET_BITS (dword, 31, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_BAY(dword,value)           ACPI_SET_BITS (dword, 31, ACPI_1BIT_MASK, value)	/* Offset 64+31=95, Len 1 */
-
-/* Fourth 32-bit dword, bits 96:127 */
-
-#define ACPI_PLD_GET_EJECTABLE(dword)           ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_EJECTABLE(dword,value)     ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value)	/* Offset 96+0=96, Len 1 */
-
-#define ACPI_PLD_GET_OSPM_EJECT(dword)          ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_OSPM_EJECT(dword,value)    ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value)	/* Offset 96+1=97, Len 1 */
-
-#define ACPI_PLD_GET_CABINET(dword)             ACPI_GET_BITS (dword, 2, ACPI_8BIT_MASK)
-#define ACPI_PLD_SET_CABINET(dword,value)       ACPI_SET_BITS (dword, 2, ACPI_8BIT_MASK, value)	/* Offset 96+2=98, Len 8 */
-
-#define ACPI_PLD_GET_CARD_CAGE(dword)           ACPI_GET_BITS (dword, 10, ACPI_8BIT_MASK)
-#define ACPI_PLD_SET_CARD_CAGE(dword,value)     ACPI_SET_BITS (dword, 10, ACPI_8BIT_MASK, value)	/* Offset 96+10=106, Len 8 */
-
-#define ACPI_PLD_GET_REFERENCE(dword)           ACPI_GET_BITS (dword, 18, ACPI_1BIT_MASK)
-#define ACPI_PLD_SET_REFERENCE(dword,value)     ACPI_SET_BITS (dword, 18, ACPI_1BIT_MASK, value)	/* Offset 96+18=114, Len 1 */
-
-#define ACPI_PLD_GET_ROTATION(dword)            ACPI_GET_BITS (dword, 19, ACPI_4BIT_MASK)
-#define ACPI_PLD_SET_ROTATION(dword,value)      ACPI_SET_BITS (dword, 19, ACPI_4BIT_MASK, value)	/* Offset 96+19=115, Len 4 */
-
-#define ACPI_PLD_GET_ORDER(dword)               ACPI_GET_BITS (dword, 23, ACPI_5BIT_MASK)
-#define ACPI_PLD_SET_ORDER(dword,value)         ACPI_SET_BITS (dword, 23, ACPI_5BIT_MASK, value)	/* Offset 96+23=119, Len 5 */
-
-/* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */
-
-#define ACPI_PLD_GET_VERT_OFFSET(dword)         ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
-#define ACPI_PLD_SET_VERT_OFFSET(dword,value)   ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value)	/* Offset 128+0=128, Len 16 */
-
-#define ACPI_PLD_GET_HORIZ_OFFSET(dword)        ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
-#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value)  ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value)	/* Offset 128+16=144, Len 16 */
-
-#endif				/* ACBUFFER_H */

+ 0 - 246
sys/include/acpi/acconfig.h

@@ -1,246 +0,0 @@
-/******************************************************************************
- *
- * Name: acconfig.h - Global configuration constants
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2016, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef _ACCONFIG_H
-#define _ACCONFIG_H
-
-/******************************************************************************
- *
- * Configuration options
- *
- *****************************************************************************/
-
-/*
- * ACPI_DEBUG_OUTPUT    - This switch enables all the debug facilities of the
- *                        ACPI subsystem.  This includes the DEBUG_PRINT output
- *                        statements.  When disabled, all DEBUG_PRINT
- *                        statements are compiled out.
- *
- * ACPI_APPLICATION     - Use this switch if the subsystem is going to be run
- *                        at the application level.
- *
- */
-
-/*
- * OS name, used for the _OS object.  The _OS object is essentially obsolete,
- * but there is a large base of ASL/AML code in existing machines that check
- * for the string below.  The use of this string usually guarantees that
- * the ASL will execute down the most tested code path.  Also, there is some
- * code that will not execute the _OSI method unless _OS matches the string
- * below.  Therefore, change this string at your own risk.
- */
-#define ACPI_OS_NAME                    "Microsoft Windows NT"
-
-/* Maximum objects in the various object caches */
-
-#define ACPI_MAX_STATE_CACHE_DEPTH      96	/* State objects */
-#define ACPI_MAX_PARSE_CACHE_DEPTH      96	/* Parse tree objects */
-#define ACPI_MAX_EXTPARSE_CACHE_DEPTH   96	/* Parse tree objects */
-#define ACPI_MAX_OBJECT_CACHE_DEPTH     96	/* Interpreter operand objects */
-#define ACPI_MAX_NAMESPACE_CACHE_DEPTH  96	/* Namespace objects */
-
-/*
- * Should the subsystem abort the loading of an ACPI table if the
- * table checksum is incorrect?
- */
-#ifndef ACPI_CHECKSUM_ABORT
-#define ACPI_CHECKSUM_ABORT             FALSE
-#endif
-
-/*
- * Generate a version of ACPICA that only supports "reduced hardware"
- * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
- * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
- * model. In other words, no ACPI hardware is supported.
- *
- * If TRUE, this means no support for the following:
- *      PM Event and Control registers
- *      SCI interrupt (and handler)
- *      Fixed Events
- *      General Purpose Events (GPEs)
- *      Global Lock
- *      ACPI PM timer
- *      FACS table (Waking vectors and Global Lock)
- */
-#ifndef ACPI_REDUCED_HARDWARE
-#define ACPI_REDUCED_HARDWARE           FALSE
-#endif
-
-/******************************************************************************
- *
- * Subsystem Constants
- *
- *****************************************************************************/
-
-/* Version of ACPI supported */
-
-#define ACPI_CA_SUPPORT_LEVEL           5
-
-/* Maximum count for a semaphore object */
-
-#define ACPI_MAX_SEMAPHORE_COUNT        256
-
-/* Maximum object reference count (detects object deletion issues) */
-
-#define ACPI_MAX_REFERENCE_COUNT        0x1000
-
-/* Default page size for use in mapping memory for operation regions */
-
-#define ACPI_DEFAULT_PAGE_SIZE          4096	/* Must be power of 2 */
-
-/* owner_id tracking. 8 entries allows for 255 owner_ids */
-
-#define ACPI_NUM_OWNERID_MASKS          8
-
-/* Size of the root table array is increased by this increment */
-
-#define ACPI_ROOT_TABLE_SIZE_INCREMENT  4
-
-/* Maximum sleep allowed via Sleep() operator */
-
-#define ACPI_MAX_SLEEP                  2000	/* 2000 millisec == two seconds */
-
-/* Address Range lists are per-space_id (Memory and I/O only) */
-
-#define ACPI_ADDRESS_RANGE_MAX          2
-
-/******************************************************************************
- *
- * ACPI Specification constants (Do not change unless the specification changes)
- *
- *****************************************************************************/
-
-/* Method info (in WALK_STATE), containing local variables and argumetns */
-
-#define ACPI_METHOD_NUM_LOCALS          8
-#define ACPI_METHOD_MAX_LOCAL           7
-
-#define ACPI_METHOD_NUM_ARGS            7
-#define ACPI_METHOD_MAX_ARG             6
-
-/*
- * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
- */
-#define ACPI_OBJ_NUM_OPERANDS           8
-#define ACPI_OBJ_MAX_OPERAND            7
-
-/* Number of elements in the Result Stack frame, can be an arbitrary value */
-
-#define ACPI_RESULTS_FRAME_OBJ_NUM      8
-
-/*
- * Maximal number of elements the Result Stack can contain,
- * it may be an arbitray value not exceeding the types of
- * result_size and result_count (now u8).
- */
-#define ACPI_RESULTS_OBJ_NUM_MAX        255
-
-/* Constants used in searching for the RSDP in low memory */
-
-#define ACPI_EBDA_PTR_LOCATION          0x0000040E	/* Physical Address */
-#define ACPI_EBDA_PTR_LENGTH            2
-#define ACPI_EBDA_WINDOW_SIZE           1024
-#define ACPI_HI_RSDP_WINDOW_BASE        0x000E0000	/* Physical Address */
-#define ACPI_HI_RSDP_WINDOW_SIZE        0x00020000
-#define ACPI_RSDP_SCAN_STEP             16
-
-/* Operation regions */
-
-#define ACPI_USER_REGION_BEGIN          0x80
-
-/* Maximum space_ids for Operation Regions */
-
-#define ACPI_MAX_ADDRESS_SPACE          255
-#define ACPI_NUM_DEFAULT_SPACES         4
-
-/* Array sizes.  Used for range checking also */
-
-#define ACPI_MAX_MATCH_OPCODE           5
-
-/* RSDP checksums */
-
-#define ACPI_RSDP_CHECKSUM_LENGTH       20
-#define ACPI_RSDP_XCHECKSUM_LENGTH      36
-
-/* SMBus, GSBus and IPMI bidirectional buffer size */
-
-#define ACPI_SMBUS_BUFFER_SIZE          34
-#define ACPI_GSBUS_BUFFER_SIZE          34
-#define ACPI_IPMI_BUFFER_SIZE           66
-
-/* _sx_d and _sx_w control methods */
-
-#define ACPI_NUM_sx_d_METHODS           4
-#define ACPI_NUM_sx_w_METHODS           5
-
-/******************************************************************************
- *
- * Miscellaneous constants
- *
- *****************************************************************************/
-
-/* UUID constants */
-
-#define UUID_BUFFER_LENGTH          16	/* Length of UUID in memory */
-#define UUID_STRING_LENGTH          36	/* Total length of a UUID string */
-
-/* Positions for required hyphens (dashes) in UUID strings */
-
-#define UUID_HYPHEN1_OFFSET         8
-#define UUID_HYPHEN2_OFFSET         13
-#define UUID_HYPHEN3_OFFSET         18
-#define UUID_HYPHEN4_OFFSET         23
-
-/******************************************************************************
- *
- * ACPI AML Debugger
- *
- *****************************************************************************/
-
-#define ACPI_DEBUGGER_MAX_ARGS          ACPI_METHOD_NUM_ARGS + 4	/* Max command line arguments */
-#define ACPI_DB_LINE_BUFFER_SIZE        512
-
-#define ACPI_DEBUGGER_COMMAND_PROMPT    '-'
-#define ACPI_DEBUGGER_EXECUTE_PROMPT    '%'
-
-#endif				/* _ACCONFIG_H */

+ 0 - 388
sys/include/acpi/acexcep.h

@@ -1,388 +0,0 @@
-/******************************************************************************
- *
- * Name: acexcep.h - Exception codes returned by the ACPI subsystem
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2016, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef __ACEXCEP_H__
-#define __ACEXCEP_H__
-
-/* This module contains all possible exception codes for acpi_status */
-
-/*
- * Exception code classes
- */
-#define AE_CODE_ENVIRONMENTAL           0x0000	/* General ACPICA environment */
-#define AE_CODE_PROGRAMMER              0x1000	/* External ACPICA interface caller */
-#define AE_CODE_ACPI_TABLES             0x2000	/* ACPI tables */
-#define AE_CODE_AML                     0x3000	/* From executing AML code */
-#define AE_CODE_CONTROL                 0x4000	/* Internal control codes */
-
-#define AE_CODE_MAX                     0x4000
-#define AE_CODE_MASK                    0xF000
-
-/*
- * Macros to insert the exception code classes
- */
-#define EXCEP_ENV(code)                 ((acpi_status) (code | AE_CODE_ENVIRONMENTAL))
-#define EXCEP_PGM(code)                 ((acpi_status) (code | AE_CODE_PROGRAMMER))
-#define EXCEP_TBL(code)                 ((acpi_status) (code | AE_CODE_ACPI_TABLES))
-#define EXCEP_AML(code)                 ((acpi_status) (code | AE_CODE_AML))
-#define EXCEP_CTL(code)                 ((acpi_status) (code | AE_CODE_CONTROL))
-
-/*
- * Exception info table. The "Description" field is used only by the
- * ACPICA help application (acpihelp).
- */
-struct acpi_exception_info {
-	char *name;
-
-#ifdef ACPI_HELP_APP
-	char *description;
-#endif
-};
-
-#ifdef ACPI_HELP_APP
-#define EXCEP_TXT(name,description)     {name, description}
-#else
-#define EXCEP_TXT(name,description)     {name}
-#endif
-
-/*
- * Success is always zero, failure is non-zero
- */
-#define ACPI_SUCCESS(a)                 (!(a))
-#define ACPI_FAILURE(a)                 (a)
-
-#define ACPI_SKIP(a)                    (a == AE_CTRL_SKIP)
-#define AE_OK                           (acpi_status) 0x0000
-
-/*
- * Environmental exceptions
- */
-#define AE_ERROR                        EXCEP_ENV (0x0001)
-#define AE_NO_ACPI_TABLES               EXCEP_ENV (0x0002)
-#define AE_NO_NAMESPACE                 EXCEP_ENV (0x0003)
-#define AE_NO_MEMORY                    EXCEP_ENV (0x0004)
-#define AE_NOT_FOUND                    EXCEP_ENV (0x0005)
-#define AE_NOT_EXIST                    EXCEP_ENV (0x0006)
-#define AE_ALREADY_EXISTS               EXCEP_ENV (0x0007)
-#define AE_TYPE                         EXCEP_ENV (0x0008)
-#define AE_NULL_OBJECT                  EXCEP_ENV (0x0009)
-#define AE_NULL_ENTRY                   EXCEP_ENV (0x000A)
-#define AE_BUFFER_OVERFLOW              EXCEP_ENV (0x000B)
-#define AE_STACK_OVERFLOW               EXCEP_ENV (0x000C)
-#define AE_STACK_UNDERFLOW              EXCEP_ENV (0x000D)
-#define AE_NOT_IMPLEMENTED              EXCEP_ENV (0x000E)
-#define AE_SUPPORT                      EXCEP_ENV (0x000F)
-#define AE_LIMIT                        EXCEP_ENV (0x0010)
-#define AE_TIME                         EXCEP_ENV (0x0011)
-#define AE_ACQUIRE_DEADLOCK             EXCEP_ENV (0x0012)
-#define AE_RELEASE_DEADLOCK             EXCEP_ENV (0x0013)
-#define AE_NOT_ACQUIRED                 EXCEP_ENV (0x0014)
-#define AE_ALREADY_ACQUIRED             EXCEP_ENV (0x0015)
-#define AE_NO_HARDWARE_RESPONSE         EXCEP_ENV (0x0016)
-#define AE_NO_GLOBAL_LOCK               EXCEP_ENV (0x0017)
-#define AE_ABORT_METHOD                 EXCEP_ENV (0x0018)
-#define AE_SAME_HANDLER                 EXCEP_ENV (0x0019)
-#define AE_NO_HANDLER                   EXCEP_ENV (0x001A)
-#define AE_OWNER_ID_LIMIT               EXCEP_ENV (0x001B)
-#define AE_NOT_CONFIGURED               EXCEP_ENV (0x001C)
-#define AE_ACCESS                       EXCEP_ENV (0x001D)
-#define AE_IO_ERROR                     EXCEP_ENV (0x001E)
-
-#define AE_CODE_ENV_MAX                 0x001E
-
-/*
- * Programmer exceptions
- */
-#define AE_BAD_PARAMETER                EXCEP_PGM (0x0001)
-#define AE_BAD_CHARACTER                EXCEP_PGM (0x0002)
-#define AE_BAD_PATHNAME                 EXCEP_PGM (0x0003)
-#define AE_BAD_DATA                     EXCEP_PGM (0x0004)
-#define AE_BAD_HEX_CONSTANT             EXCEP_PGM (0x0005)
-#define AE_BAD_OCTAL_CONSTANT           EXCEP_PGM (0x0006)
-#define AE_BAD_DECIMAL_CONSTANT         EXCEP_PGM (0x0007)
-#define AE_MISSING_ARGUMENTS            EXCEP_PGM (0x0008)
-#define AE_BAD_ADDRESS                  EXCEP_PGM (0x0009)
-
-#define AE_CODE_PGM_MAX                 0x0009
-
-/*
- * Acpi table exceptions
- */
-#define AE_BAD_SIGNATURE                EXCEP_TBL (0x0001)
-#define AE_BAD_HEADER                   EXCEP_TBL (0x0002)
-#define AE_BAD_CHECKSUM                 EXCEP_TBL (0x0003)
-#define AE_BAD_VALUE                    EXCEP_TBL (0x0004)
-#define AE_INVALID_TABLE_LENGTH         EXCEP_TBL (0x0005)
-
-#define AE_CODE_TBL_MAX                 0x0005
-
-/*
- * AML exceptions. These are caused by problems with
- * the actual AML byte stream
- */
-#define AE_AML_BAD_OPCODE               EXCEP_AML (0x0001)
-#define AE_AML_NO_OPERAND               EXCEP_AML (0x0002)
-#define AE_AML_OPERAND_TYPE             EXCEP_AML (0x0003)
-#define AE_AML_OPERAND_VALUE            EXCEP_AML (0x0004)
-#define AE_AML_UNINITIALIZED_LOCAL      EXCEP_AML (0x0005)
-#define AE_AML_UNINITIALIZED_ARG        EXCEP_AML (0x0006)
-#define AE_AML_UNINITIALIZED_ELEMENT    EXCEP_AML (0x0007)
-#define AE_AML_NUMERIC_OVERFLOW         EXCEP_AML (0x0008)
-#define AE_AML_REGION_LIMIT             EXCEP_AML (0x0009)
-#define AE_AML_BUFFER_LIMIT             EXCEP_AML (0x000A)
-#define AE_AML_PACKAGE_LIMIT            EXCEP_AML (0x000B)
-#define AE_AML_DIVIDE_BY_ZERO           EXCEP_AML (0x000C)
-#define AE_AML_BAD_NAME                 EXCEP_AML (0x000D)
-#define AE_AML_NAME_NOT_FOUND           EXCEP_AML (0x000E)
-#define AE_AML_INTERNAL                 EXCEP_AML (0x000F)
-#define AE_AML_INVALID_SPACE_ID         EXCEP_AML (0x0010)
-#define AE_AML_STRING_LIMIT             EXCEP_AML (0x0011)
-#define AE_AML_NO_RETURN_VALUE          EXCEP_AML (0x0012)
-#define AE_AML_METHOD_LIMIT             EXCEP_AML (0x0013)
-#define AE_AML_NOT_OWNER                EXCEP_AML (0x0014)
-#define AE_AML_MUTEX_ORDER              EXCEP_AML (0x0015)
-#define AE_AML_MUTEX_NOT_ACQUIRED       EXCEP_AML (0x0016)
-#define AE_AML_INVALID_RESOURCE_TYPE    EXCEP_AML (0x0017)
-#define AE_AML_INVALID_INDEX            EXCEP_AML (0x0018)
-#define AE_AML_REGISTER_LIMIT           EXCEP_AML (0x0019)
-#define AE_AML_NO_WHILE                 EXCEP_AML (0x001A)
-#define AE_AML_ALIGNMENT                EXCEP_AML (0x001B)
-#define AE_AML_NO_RESOURCE_END_TAG      EXCEP_AML (0x001C)
-#define AE_AML_BAD_RESOURCE_VALUE       EXCEP_AML (0x001D)
-#define AE_AML_CIRCULAR_REFERENCE       EXCEP_AML (0x001E)
-#define AE_AML_BAD_RESOURCE_LENGTH      EXCEP_AML (0x001F)
-#define AE_AML_ILLEGAL_ADDRESS          EXCEP_AML (0x0020)
-#define AE_AML_INFINITE_LOOP            EXCEP_AML (0x0021)
-#define AE_AML_UNINITIALIZED_NODE       EXCEP_AML (0x0022)
-#define AE_AML_TARGET_TYPE              EXCEP_AML (0x0023)
-
-#define AE_CODE_AML_MAX                 0x0023
-
-/*
- * Internal exceptions used for control
- */
-#define AE_CTRL_RETURN_VALUE            EXCEP_CTL (0x0001)
-#define AE_CTRL_PENDING                 EXCEP_CTL (0x0002)
-#define AE_CTRL_TERMINATE               EXCEP_CTL (0x0003)
-#define AE_CTRL_TRUE                    EXCEP_CTL (0x0004)
-#define AE_CTRL_FALSE                   EXCEP_CTL (0x0005)
-#define AE_CTRL_DEPTH                   EXCEP_CTL (0x0006)
-#define AE_CTRL_END                     EXCEP_CTL (0x0007)
-#define AE_CTRL_TRANSFER                EXCEP_CTL (0x0008)
-#define AE_CTRL_BREAK                   EXCEP_CTL (0x0009)
-#define AE_CTRL_CONTINUE                EXCEP_CTL (0x000A)
-#define AE_CTRL_SKIP                    EXCEP_CTL (0x000B)
-#define AE_CTRL_PARSE_CONTINUE          EXCEP_CTL (0x000C)
-#define AE_CTRL_PARSE_PENDING           EXCEP_CTL (0x000D)
-
-#define AE_CODE_CTRL_MAX                0x000D
-
-/* Exception strings for acpi_format_exception */
-
-#ifdef ACPI_DEFINE_EXCEPTION_TABLE
-
-/*
- * String versions of the exception codes above
- * These strings must match the corresponding defines exactly
- */
-static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
-	EXCEP_TXT("AE_OK", "No error"),
-	EXCEP_TXT("AE_ERROR", "Unspecified error"),
-	EXCEP_TXT("AE_NO_ACPI_TABLES", "ACPI tables could not be found"),
-	EXCEP_TXT("AE_NO_NAMESPACE", "A namespace has not been loaded"),
-	EXCEP_TXT("AE_NO_MEMORY", "Insufficient dynamic memory"),
-	EXCEP_TXT("AE_NOT_FOUND", "A requested entity is not found"),
-	EXCEP_TXT("AE_NOT_EXIST", "A required entity does not exist"),
-	EXCEP_TXT("AE_ALREADY_EXISTS", "An entity already exists"),
-	EXCEP_TXT("AE_TYPE", "The object type is incorrect"),
-	EXCEP_TXT("AE_NULL_OBJECT", "A required object was missing"),
-	EXCEP_TXT("AE_NULL_ENTRY", "The requested object does not exist"),
-	EXCEP_TXT("AE_BUFFER_OVERFLOW", "The buffer provided is too small"),
-	EXCEP_TXT("AE_STACK_OVERFLOW", "An internal stack overflowed"),
-	EXCEP_TXT("AE_STACK_UNDERFLOW", "An internal stack underflowed"),
-	EXCEP_TXT("AE_NOT_IMPLEMENTED", "The feature is not implemented"),
-	EXCEP_TXT("AE_SUPPORT", "The feature is not supported"),
-	EXCEP_TXT("AE_LIMIT", "A predefined limit was exceeded"),
-	EXCEP_TXT("AE_TIME", "A time limit or timeout expired"),
-	EXCEP_TXT("AE_ACQUIRE_DEADLOCK",
-		  "Internal error, attempt was made to acquire a mutex in improper order"),
-	EXCEP_TXT("AE_RELEASE_DEADLOCK",
-		  "Internal error, attempt was made to release a mutex in improper order"),
-	EXCEP_TXT("AE_NOT_ACQUIRED",
-		  "An attempt to release a mutex or Global Lock without a previous acquire"),
-	EXCEP_TXT("AE_ALREADY_ACQUIRED",
-		  "Internal error, attempt was made to acquire a mutex twice"),
-	EXCEP_TXT("AE_NO_HARDWARE_RESPONSE",
-		  "Hardware did not respond after an I/O operation"),
-	EXCEP_TXT("AE_NO_GLOBAL_LOCK", "There is no FACS Global Lock"),
-	EXCEP_TXT("AE_ABORT_METHOD", "A control method was aborted"),
-	EXCEP_TXT("AE_SAME_HANDLER",
-		  "Attempt was made to install the same handler that is already installed"),
-	EXCEP_TXT("AE_NO_HANDLER",
-		  "A handler for the operation is not installed"),
-	EXCEP_TXT("AE_OWNER_ID_LIMIT",
-		  "There are no more Owner IDs available for ACPI tables or control methods"),
-	EXCEP_TXT("AE_NOT_CONFIGURED",
-		  "The interface is not part of the current subsystem configuration"),
-	EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation"),
-	EXCEP_TXT("AE_IO_ERROR", "An I/O error occurred")
-};
-
-static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
-	EXCEP_TXT(NULL, NULL),
-	EXCEP_TXT("AE_BAD_PARAMETER", "A parameter is out of range or invalid"),
-	EXCEP_TXT("AE_BAD_CHARACTER",
-		  "An invalid character was found in a name"),
-	EXCEP_TXT("AE_BAD_PATHNAME",
-		  "An invalid character was found in a pathname"),
-	EXCEP_TXT("AE_BAD_DATA",
-		  "A package or buffer contained incorrect data"),
-	EXCEP_TXT("AE_BAD_HEX_CONSTANT", "Invalid character in a Hex constant"),
-	EXCEP_TXT("AE_BAD_OCTAL_CONSTANT",
-		  "Invalid character in an Octal constant"),
-	EXCEP_TXT("AE_BAD_DECIMAL_CONSTANT",
-		  "Invalid character in a Decimal constant"),
-	EXCEP_TXT("AE_MISSING_ARGUMENTS",
-		  "Too few arguments were passed to a control method"),
-	EXCEP_TXT("AE_BAD_ADDRESS", "An illegal null I/O address")
-};
-
-static const struct acpi_exception_info acpi_gbl_exception_names_tbl[] = {
-	EXCEP_TXT(NULL, NULL),
-	EXCEP_TXT("AE_BAD_SIGNATURE", "An ACPI table has an invalid signature"),
-	EXCEP_TXT("AE_BAD_HEADER", "Invalid field in an ACPI table header"),
-	EXCEP_TXT("AE_BAD_CHECKSUM", "An ACPI table checksum is not correct"),
-	EXCEP_TXT("AE_BAD_VALUE", "An invalid value was found in a table"),
-	EXCEP_TXT("AE_INVALID_TABLE_LENGTH",
-		  "The FADT or FACS has improper length")
-};
-
-static const struct acpi_exception_info acpi_gbl_exception_names_aml[] = {
-	EXCEP_TXT(NULL, NULL),
-	EXCEP_TXT("AE_AML_BAD_OPCODE", "Invalid AML opcode encountered"),
-	EXCEP_TXT("AE_AML_NO_OPERAND", "A required operand is missing"),
-	EXCEP_TXT("AE_AML_OPERAND_TYPE",
-		  "An operand of an incorrect type was encountered"),
-	EXCEP_TXT("AE_AML_OPERAND_VALUE",
-		  "The operand had an inappropriate or invalid value"),
-	EXCEP_TXT("AE_AML_UNINITIALIZED_LOCAL",
-		  "Method tried to use an uninitialized local variable"),
-	EXCEP_TXT("AE_AML_UNINITIALIZED_ARG",
-		  "Method tried to use an uninitialized argument"),
-	EXCEP_TXT("AE_AML_UNINITIALIZED_ELEMENT",
-		  "Method tried to use an empty package element"),
-	EXCEP_TXT("AE_AML_NUMERIC_OVERFLOW",
-		  "Overflow during BCD conversion or other"),
-	EXCEP_TXT("AE_AML_REGION_LIMIT",
-		  "Tried to access beyond the end of an Operation Region"),
-	EXCEP_TXT("AE_AML_BUFFER_LIMIT",
-		  "Tried to access beyond the end of a buffer"),
-	EXCEP_TXT("AE_AML_PACKAGE_LIMIT",
-		  "Tried to access beyond the end of a package"),
-	EXCEP_TXT("AE_AML_DIVIDE_BY_ZERO",
-		  "During execution of AML Divide operator"),
-	EXCEP_TXT("AE_AML_BAD_NAME",
-		  "An ACPI name contains invalid character(s)"),
-	EXCEP_TXT("AE_AML_NAME_NOT_FOUND",
-		  "Could not resolve a named reference"),
-	EXCEP_TXT("AE_AML_INTERNAL", "An internal error within the interprete"),
-	EXCEP_TXT("AE_AML_INVALID_SPACE_ID",
-		  "An Operation Region SpaceID is invalid"),
-	EXCEP_TXT("AE_AML_STRING_LIMIT",
-		  "String is longer than 200 characters"),
-	EXCEP_TXT("AE_AML_NO_RETURN_VALUE",
-		  "A method did not return a required value"),
-	EXCEP_TXT("AE_AML_METHOD_LIMIT",
-		  "A control method reached the maximum reentrancy limit of 255"),
-	EXCEP_TXT("AE_AML_NOT_OWNER",
-		  "A thread tried to release a mutex that it does not own"),
-	EXCEP_TXT("AE_AML_MUTEX_ORDER", "Mutex SyncLevel release mismatch"),
-	EXCEP_TXT("AE_AML_MUTEX_NOT_ACQUIRED",
-		  "Attempt to release a mutex that was not previously acquired"),
-	EXCEP_TXT("AE_AML_INVALID_RESOURCE_TYPE",
-		  "Invalid resource type in resource list"),
-	EXCEP_TXT("AE_AML_INVALID_INDEX",
-		  "Invalid Argx or Localx (x too large)"),
-	EXCEP_TXT("AE_AML_REGISTER_LIMIT",
-		  "Bank value or Index value beyond range of register"),
-	EXCEP_TXT("AE_AML_NO_WHILE", "Break or Continue without a While"),
-	EXCEP_TXT("AE_AML_ALIGNMENT",
-		  "Non-aligned memory transfer on platform that does not support this"),
-	EXCEP_TXT("AE_AML_NO_RESOURCE_END_TAG",
-		  "No End Tag in a resource list"),
-	EXCEP_TXT("AE_AML_BAD_RESOURCE_VALUE",
-		  "Invalid value of a resource element"),
-	EXCEP_TXT("AE_AML_CIRCULAR_REFERENCE",
-		  "Two references refer to each other"),
-	EXCEP_TXT("AE_AML_BAD_RESOURCE_LENGTH",
-		  "The length of a Resource Descriptor in the AML is incorrect"),
-	EXCEP_TXT("AE_AML_ILLEGAL_ADDRESS",
-		  "A memory, I/O, or PCI configuration address is invalid"),
-	EXCEP_TXT("AE_AML_INFINITE_LOOP",
-		  "An apparent infinite AML While loop, method was aborted"),
-	EXCEP_TXT("AE_AML_UNINITIALIZED_NODE",
-		  "A namespace node is uninitialized or unresolved"),
-	EXCEP_TXT("AE_AML_TARGET_TYPE",
-		  "A target operand of an incorrect type was encountered")
-};
-
-static const struct acpi_exception_info acpi_gbl_exception_names_ctrl[] = {
-	EXCEP_TXT(NULL, NULL),
-	EXCEP_TXT("AE_CTRL_RETURN_VALUE", "A Method returned a value"),
-	EXCEP_TXT("AE_CTRL_PENDING", "Method is calling another method"),
-	EXCEP_TXT("AE_CTRL_TERMINATE", "Terminate the executing method"),
-	EXCEP_TXT("AE_CTRL_TRUE", "An If or While predicate result"),
-	EXCEP_TXT("AE_CTRL_FALSE", "An If or While predicate result"),
-	EXCEP_TXT("AE_CTRL_DEPTH", "Maximum search depth has been reached"),
-	EXCEP_TXT("AE_CTRL_END", "An If or While predicate is false"),
-	EXCEP_TXT("AE_CTRL_TRANSFER", "Transfer control to called method"),
-	EXCEP_TXT("AE_CTRL_BREAK", "A Break has been executed"),
-	EXCEP_TXT("AE_CTRL_CONTINUE", "A Continue has been executed"),
-	EXCEP_TXT("AE_CTRL_SKIP", "Not currently used"),
-	EXCEP_TXT("AE_CTRL_PARSE_CONTINUE", "Used to skip over bad opcodes"),
-	EXCEP_TXT("AE_CTRL_PARSE_PENDING", "Used to implement AML While loops")
-};
-
-#endif				/* EXCEPTION_TABLE */
-
-#endif				/* __ACEXCEP_H__ */

+ 0 - 92
sys/include/acpi/acnames.h

@@ -1,92 +0,0 @@
-/******************************************************************************
- *
- * Name: acnames.h - Global names and strings
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2016, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef __ACNAMES_H__
-#define __ACNAMES_H__
-
-/* Method names - these methods can appear anywhere in the namespace */
-
-#define METHOD_NAME__ADR        "_ADR"
-#define METHOD_NAME__AEI        "_AEI"
-#define METHOD_NAME__BBN        "_BBN"
-#define METHOD_NAME__CBA        "_CBA"
-#define METHOD_NAME__CID        "_CID"
-#define METHOD_NAME__CLS        "_CLS"
-#define METHOD_NAME__CRS        "_CRS"
-#define METHOD_NAME__DDN        "_DDN"
-#define METHOD_NAME__HID        "_HID"
-#define METHOD_NAME__INI        "_INI"
-#define METHOD_NAME__PLD        "_PLD"
-#define METHOD_NAME__DSD        "_DSD"
-#define METHOD_NAME__PRS        "_PRS"
-#define METHOD_NAME__PRT        "_PRT"
-#define METHOD_NAME__PRW        "_PRW"
-#define METHOD_NAME__PS0        "_PS0"
-#define METHOD_NAME__PS1        "_PS1"
-#define METHOD_NAME__PS2        "_PS2"
-#define METHOD_NAME__PS3        "_PS3"
-#define METHOD_NAME__REG        "_REG"
-#define METHOD_NAME__SB_        "_SB_"
-#define METHOD_NAME__SEG        "_SEG"
-#define METHOD_NAME__SRS        "_SRS"
-#define METHOD_NAME__STA        "_STA"
-#define METHOD_NAME__SUB        "_SUB"
-#define METHOD_NAME__UID        "_UID"
-
-/* Method names - these methods must appear at the namespace root */
-
-#define METHOD_PATHNAME__PTS    "\\_PTS"
-#define METHOD_PATHNAME__SST    "\\_SI._SST"
-#define METHOD_PATHNAME__WAK    "\\_WAK"
-
-/* Definitions of the predefined namespace names  */
-
-#define ACPI_UNKNOWN_NAME       (u32) 0x3F3F3F3F	/* Unknown name is "????" */
-#define ACPI_ROOT_NAME          (u32) 0x5F5F5F5C	/* Root name is    "\___" */
-
-#define ACPI_PREFIX_MIXED       (u32) 0x69706341	/* "Acpi" */
-#define ACPI_PREFIX_LOWER       (u32) 0x69706361	/* "acpi" */
-
-#define ACPI_NS_ROOT_PATH       "\\"
-
-#endif				/* __ACNAMES_H__  */

+ 0 - 67
sys/include/acpi/acpi.h

@@ -1,67 +0,0 @@
-/******************************************************************************
- *
- * Name: acpi.h - Master public include file used to interface to ACPICA
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2016, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef __ACPI_H__
-#define __ACPI_H__
-
-/*
- * Public include files for use by code that will interface to ACPICA.
- *
- * Information includes the ACPICA data types, names, exceptions, and
- * external interface prototypes. Also included are the definitions for
- * all ACPI tables (FADT, MADT, etc.)
- *
- * Note: The order of these include files is important.
- */
-#include <acpi/platform/acenv.h>	/* Environment-specific items */
-#include <acpi/acnames.h>		/* Common ACPI names and strings */
-#include <acpi/actypes.h>		/* ACPICA data types and structures */
-#include <acpi/acexcep.h>		/* ACPICA exceptions */
-#include <acpi/actbl.h>		/* ACPI table definitions */
-#include <acpi/acoutput.h>		/* Error output and Debug macros */
-#include <acpi/acrestyp.h>		/* Resource Descriptor structs */
-#include <acpi/acpiosxf.h>		/* OSL interfaces (ACPICA-to-OS) */
-#include <acpi/acpixf.h>		/* ACPI core subsystem external interfaces */
-#include <acpi/platform/acenvex.h>	/* Extra environment-specific items */
-
-#endif				/* __ACPI_H__ */

+ 0 - 648
sys/include/acpi/acpi_bus.h

@@ -1,648 +0,0 @@
-/*
- *  acpi_bus.h - ACPI Bus Driver ($Revision: 22 $)
- *
- *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
- *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or (at
- *  your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-#ifndef __ACPI_BUS_H__
-#define __ACPI_BUS_H__
-
-#include <linux/device.h>
-#include <linux/property.h>
-
-/* TBD: Make dynamic */
-#define ACPI_MAX_HANDLES	10
-struct acpi_handle_list {
-	u32 count;
-	acpi_handle handles[ACPI_MAX_HANDLES];
-};
-
-/* acpi_utils.h */
-acpi_status
-acpi_extract_package(union acpi_object *package,
-		     struct acpi_buffer *format, struct acpi_buffer *buffer);
-acpi_status
-acpi_evaluate_integer(acpi_handle handle,
-		      acpi_string pathname,
-		      struct acpi_object_list *arguments, unsigned long long *data);
-acpi_status
-acpi_evaluate_reference(acpi_handle handle,
-			acpi_string pathname,
-			struct acpi_object_list *arguments,
-			struct acpi_handle_list *list);
-acpi_status
-acpi_evaluate_ost(acpi_handle handle, u32 source_event, u32 status_code,
-		  struct acpi_buffer *status_buf);
-
-acpi_status
-acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
-
-bool acpi_has_method(acpi_handle handle, char *name);
-acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
-				       u64 arg);
-acpi_status acpi_evaluate_ej0(acpi_handle handle);
-acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
-bool acpi_ata_match(acpi_handle handle);
-bool acpi_bay_match(acpi_handle handle);
-bool acpi_dock_match(acpi_handle handle);
-
-bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs);
-union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid,
-			int rev, int func, union acpi_object *argv4);
-
-static inline union acpi_object *
-acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func,
-			union acpi_object *argv4, acpi_object_type type)
-{
-	union acpi_object *obj;
-
-	obj = acpi_evaluate_dsm(handle, uuid, rev, func, argv4);
-	if (obj && obj->type != type) {
-		ACPI_FREE(obj);
-		obj = NULL;
-	}
-
-	return obj;
-}
-
-#define	ACPI_INIT_DSM_ARGV4(cnt, eles)			\
-	{						\
-	  .package.type = ACPI_TYPE_PACKAGE,		\
-	  .package.count = (cnt),			\
-	  .package.elements = (eles)			\
-	}
-
-bool acpi_dev_present(const char *hid);
-
-#ifdef CONFIG_ACPI
-
-#include <linux/proc_fs.h>
-
-#define ACPI_BUS_FILE_ROOT	"acpi"
-extern struct proc_dir_entry *acpi_root_dir;
-
-enum acpi_bus_device_type {
-	ACPI_BUS_TYPE_DEVICE = 0,
-	ACPI_BUS_TYPE_POWER,
-	ACPI_BUS_TYPE_PROCESSOR,
-	ACPI_BUS_TYPE_THERMAL,
-	ACPI_BUS_TYPE_POWER_BUTTON,
-	ACPI_BUS_TYPE_SLEEP_BUTTON,
-	ACPI_BUS_DEVICE_TYPE_COUNT
-};
-
-struct acpi_driver;
-struct acpi_device;
-
-/*
- * ACPI Scan Handler
- * -----------------
- */
-
-struct acpi_hotplug_profile {
-	struct kobject kobj;
-	int (*scan_dependent)(struct acpi_device *adev);
-	void (*notify_online)(struct acpi_device *adev);
-	bool enabled:1;
-	bool demand_offline:1;
-};
-
-static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile(
-						struct kobject *kobj)
-{
-	return container_of(kobj, struct acpi_hotplug_profile, kobj);
-}
-
-struct acpi_scan_handler {
-	const struct acpi_device_id *ids;
-	struct list_head list_node;
-	bool (*match)(const char *idstr, const struct acpi_device_id **matchid);
-	int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
-	void (*detach)(struct acpi_device *dev);
-	void (*bind)(struct device *phys_dev);
-	void (*unbind)(struct device *phys_dev);
-	struct acpi_hotplug_profile hotplug;
-};
-
-/*
- * ACPI Hotplug Context
- * --------------------
- */
-
-struct acpi_hotplug_context {
-	struct acpi_device *self;
-	int (*notify)(struct acpi_device *, u32);
-	void (*uevent)(struct acpi_device *, u32);
-	void (*fixup)(struct acpi_device *);
-};
-
-/*
- * ACPI Driver
- * -----------
- */
-
-typedef int (*acpi_op_add) (struct acpi_device * device);
-typedef int (*acpi_op_remove) (struct acpi_device * device);
-typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
-
-struct acpi_device_ops {
-	acpi_op_add add;
-	acpi_op_remove remove;
-	acpi_op_notify notify;
-};
-
-#define ACPI_DRIVER_ALL_NOTIFY_EVENTS	0x1	/* system AND device events */
-
-struct acpi_driver {
-	char name[80];
-	char class[80];
-	const struct acpi_device_id *ids; /* Supported Hardware IDs */
-	unsigned int flags;
-	struct acpi_device_ops ops;
-	struct device_driver drv;
-	struct module *owner;
-};
-
-/*
- * ACPI Device
- * -----------
- */
-
-/* Status (_STA) */
-
-struct acpi_device_status {
-	u32 present:1;
-	u32 enabled:1;
-	u32 show_in_ui:1;
-	u32 functional:1;
-	u32 battery_present:1;
-	u32 reserved:27;
-};
-
-/* Flags */
-
-struct acpi_device_flags {
-	u32 dynamic_status:1;
-	u32 removable:1;
-	u32 ejectable:1;
-	u32 power_manageable:1;
-	u32 match_driver:1;
-	u32 initialized:1;
-	u32 visited:1;
-	u32 hotplug_notify:1;
-	u32 is_dock_station:1;
-	u32 of_compatible_ok:1;
-	u32 coherent_dma:1;
-	u32 cca_seen:1;
-	u32 reserved:20;
-};
-
-/* File System */
-
-struct acpi_device_dir {
-	struct proc_dir_entry *entry;
-};
-
-#define acpi_device_dir(d)	((d)->dir.entry)
-
-/* Plug and Play */
-
-typedef char acpi_bus_id[8];
-typedef unsigned long acpi_bus_address;
-typedef char acpi_device_name[40];
-typedef char acpi_device_class[20];
-
-struct acpi_hardware_id {
-	struct list_head list;
-	const char *id;
-};
-
-struct acpi_pnp_type {
-	u32 hardware_id:1;
-	u32 bus_address:1;
-	u32 platform_id:1;
-	u32 reserved:29;
-};
-
-struct acpi_device_pnp {
-	acpi_bus_id bus_id;		/* Object name */
-	struct acpi_pnp_type type;	/* ID type */
-	acpi_bus_address bus_address;	/* _ADR */
-	char *unique_id;		/* _UID */
-	struct list_head ids;		/* _HID and _CIDs */
-	acpi_device_name device_name;	/* Driver-determined */
-	acpi_device_class device_class;	/*        "          */
-	union acpi_object *str_obj;	/* unicode string for _STR method */
-};
-
-#define acpi_device_bid(d)	((d)->pnp.bus_id)
-#define acpi_device_adr(d)	((d)->pnp.bus_address)
-const char *acpi_device_hid(struct acpi_device *device);
-#define acpi_device_uid(d)	((d)->pnp.unique_id)
-#define acpi_device_name(d)	((d)->pnp.device_name)
-#define acpi_device_class(d)	((d)->pnp.device_class)
-
-/* Power Management */
-
-struct acpi_device_power_flags {
-	u32 explicit_get:1;	/* _PSC present? */
-	u32 power_resources:1;	/* Power resources */
-	u32 inrush_current:1;	/* Serialize Dx->D0 */
-	u32 power_removed:1;	/* Optimize Dx->D0 */
-	u32 ignore_parent:1;	/* Power is independent of parent power state */
-	u32 dsw_present:1;	/* _DSW present? */
-	u32 reserved:26;
-};
-
-struct acpi_device_power_state {
-	struct {
-		u8 valid:1;
-		u8 explicit_set:1;	/* _PSx present? */
-		u8 reserved:6;
-	} flags;
-	int power;		/* % Power (compared to D0) */
-	int latency;		/* Dx->D0 time (microseconds) */
-	struct list_head resources;	/* Power resources referenced */
-};
-
-struct acpi_device_power {
-	int state;		/* Current state */
-	struct acpi_device_power_flags flags;
-	struct acpi_device_power_state states[ACPI_D_STATE_COUNT];	/* Power states (D0-D3Cold) */
-};
-
-/* Performance Management */
-
-struct acpi_device_perf_flags {
-	u8 reserved:8;
-};
-
-struct acpi_device_perf_state {
-	struct {
-		u8 valid:1;
-		u8 reserved:7;
-	} flags;
-	u8 power;		/* % Power (compared to P0) */
-	u8 performance;		/* % Performance (    "   ) */
-	int latency;		/* Px->P0 time (microseconds) */
-};
-
-struct acpi_device_perf {
-	int state;
-	struct acpi_device_perf_flags flags;
-	int state_count;
-	struct acpi_device_perf_state *states;
-};
-
-/* Wakeup Management */
-struct acpi_device_wakeup_flags {
-	u8 valid:1;		/* Can successfully enable wakeup? */
-	u8 run_wake:1;		/* Run-Wake GPE devices */
-	u8 notifier_present:1;  /* Wake-up notify handler has been installed */
-	u8 enabled:1;		/* Enabled for wakeup */
-};
-
-struct acpi_device_wakeup_context {
-	struct work_struct work;
-	struct device *dev;
-};
-
-struct acpi_device_wakeup {
-	acpi_handle gpe_device;
-	u64 gpe_number;
-	u64 sleep_state;
-	struct list_head resources;
-	struct acpi_device_wakeup_flags flags;
-	struct acpi_device_wakeup_context context;
-	struct wakeup_source *ws;
-	int prepare_count;
-};
-
-struct acpi_device_physical_node {
-	unsigned int node_id;
-	struct list_head node;
-	struct device *dev;
-	bool put_online:1;
-};
-
-/* ACPI Device Specific Data (_DSD) */
-struct acpi_device_data {
-	const union acpi_object *pointer;
-	const union acpi_object *properties;
-	const union acpi_object *of_compatible;
-	struct list_head subnodes;
-};
-
-struct acpi_gpio_mapping;
-
-/* Device */
-struct acpi_device {
-	int device_type;
-	acpi_handle handle;		/* no handle for fixed hardware */
-	struct fwnode_handle fwnode;
-	struct acpi_device *parent;
-	struct list_head children;
-	struct list_head node;
-	struct list_head wakeup_list;
-	struct list_head del_list;
-	struct acpi_device_status status;
-	struct acpi_device_flags flags;
-	struct acpi_device_pnp pnp;
-	struct acpi_device_power power;
-	struct acpi_device_wakeup wakeup;
-	struct acpi_device_perf performance;
-	struct acpi_device_dir dir;
-	struct acpi_device_data data;
-	struct acpi_scan_handler *handler;
-	struct acpi_hotplug_context *hp;
-	struct acpi_driver *driver;
-	const struct acpi_gpio_mapping *driver_gpios;
-	void *driver_data;
-	struct device dev;
-	unsigned int physical_node_count;
-	unsigned int dep_unmet;
-	struct list_head physical_node_list;
-	struct mutex physical_node_lock;
-	void (*remove)(struct acpi_device *);
-};
-
-/* Non-device subnode */
-struct acpi_data_node {
-	const char *name;
-	acpi_handle handle;
-	struct fwnode_handle fwnode;
-	struct acpi_device_data data;
-	struct list_head sibling;
-	struct kobject kobj;
-	struct completion kobj_done;
-};
-
-static inline bool is_acpi_node(struct fwnode_handle *fwnode)
-{
-	return fwnode && (fwnode->type == FWNODE_ACPI
-		|| fwnode->type == FWNODE_ACPI_DATA);
-}
-
-static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
-{
-	return fwnode && fwnode->type == FWNODE_ACPI;
-}
-
-static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
-{
-	return is_acpi_device_node(fwnode) ?
-		container_of(fwnode, struct acpi_device, fwnode) : NULL;
-}
-
-static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
-{
-	return fwnode && fwnode->type == FWNODE_ACPI_DATA;
-}
-
-static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
-{
-	return is_acpi_data_node(fwnode) ?
-		container_of(fwnode, struct acpi_data_node, fwnode) : NULL;
-}
-
-static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev)
-{
-	return &adev->fwnode;
-}
-
-static inline void *acpi_driver_data(struct acpi_device *d)
-{
-	return d->driver_data;
-}
-
-#define to_acpi_device(d)	container_of(d, struct acpi_device, dev)
-#define to_acpi_driver(d)	container_of(d, struct acpi_driver, drv)
-
-static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta)
-{
-	*((u32 *)&adev->status) = sta;
-}
-
-static inline void acpi_set_hp_context(struct acpi_device *adev,
-				       struct acpi_hotplug_context *hp)
-{
-	hp->self = adev;
-	adev->hp = hp;
-}
-
-void acpi_initialize_hp_context(struct acpi_device *adev,
-				struct acpi_hotplug_context *hp,
-				int (*notify)(struct acpi_device *, u32),
-				void (*uevent)(struct acpi_device *, u32));
-
-/* acpi_device.dev.bus == &acpi_bus_type */
-extern struct bus_type acpi_bus_type;
-
-/*
- * Events
- * ------
- */
-
-struct acpi_bus_event {
-	struct list_head node;
-	acpi_device_class device_class;
-	acpi_bus_id bus_id;
-	u32 type;
-	u32 data;
-};
-
-extern struct kobject *acpi_kobj;
-extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
-void acpi_bus_private_data_handler(acpi_handle, void *);
-int acpi_bus_get_private_data(acpi_handle, void **);
-int acpi_bus_attach_private_data(acpi_handle, void *);
-void acpi_bus_detach_private_data(acpi_handle);
-extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
-extern int register_acpi_notifier(struct notifier_block *);
-extern int unregister_acpi_notifier(struct notifier_block *);
-
-/*
- * External Functions
- */
-
-int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
-struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle);
-void acpi_bus_put_acpi_device(struct acpi_device *adev);
-acpi_status acpi_bus_get_status_handle(acpi_handle handle,
-				       unsigned long long *sta);
-int acpi_bus_get_status(struct acpi_device *device);
-
-int acpi_bus_set_power(acpi_handle handle, int state);
-const char *acpi_power_state_string(int state);
-int acpi_device_get_power(struct acpi_device *device, int *state);
-int acpi_device_set_power(struct acpi_device *device, int state);
-int acpi_bus_init_power(struct acpi_device *device);
-int acpi_device_fix_up_power(struct acpi_device *device);
-int acpi_bus_update_power(acpi_handle handle, int *state_p);
-int acpi_device_update_power(struct acpi_device *device, int *state_p);
-bool acpi_bus_power_manageable(acpi_handle handle);
-
-#ifdef CONFIG_PM
-bool acpi_bus_can_wakeup(acpi_handle handle);
-#else
-static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; }
-#endif
-
-void acpi_scan_lock_acquire(void);
-void acpi_scan_lock_release(void);
-void acpi_lock_hp_context(void);
-void acpi_unlock_hp_context(void);
-int acpi_scan_add_handler(struct acpi_scan_handler *handler);
-int acpi_bus_register_driver(struct acpi_driver *driver);
-void acpi_bus_unregister_driver(struct acpi_driver *driver);
-int acpi_bus_scan(acpi_handle handle);
-void acpi_bus_trim(struct acpi_device *start);
-acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
-int acpi_match_device_ids(struct acpi_device *device,
-			  const struct acpi_device_id *ids);
-int acpi_create_dir(struct acpi_device *);
-void acpi_remove_dir(struct acpi_device *);
-
-static inline bool acpi_device_enumerated(struct acpi_device *adev)
-{
-	return adev && adev->flags.initialized && adev->flags.visited;
-}
-
-/**
- * module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
- * @__acpi_driver: acpi_driver struct
- *
- * Helper macro for ACPI drivers which do not do anything special in module
- * init/exit. This eliminates a lot of boilerplate. Each module may only
- * use this macro once, and calling it replaces module_init() and module_exit()
- */
-#define module_acpi_driver(__acpi_driver) \
-	module_driver(__acpi_driver, acpi_bus_register_driver, \
-		      acpi_bus_unregister_driver)
-
-/*
- * Bind physical devices with ACPI devices
- */
-struct acpi_bus_type {
-	struct list_head list;
-	const char *name;
-	bool (*match)(struct device *dev);
-	struct acpi_device * (*find_companion)(struct device *);
-	void (*setup)(struct device *);
-	void (*cleanup)(struct device *);
-};
-int register_acpi_bus_type(struct acpi_bus_type *);
-int unregister_acpi_bus_type(struct acpi_bus_type *);
-int acpi_bind_one(struct device *dev, struct acpi_device *adev);
-int acpi_unbind_one(struct device *dev);
-
-struct acpi_pci_root {
-	struct acpi_device * device;
-	struct pci_bus *bus;
-	u16 segment;
-	struct resource secondary;	/* downstream bus range */
-
-	u32 osc_support_set;	/* _OSC state of support bits */
-	u32 osc_control_set;	/* _OSC state of control bits */
-	phys_addr_t mcfg_addr;
-};
-
-/* helper */
-
-bool acpi_dma_supported(struct acpi_device *adev);
-enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev);
-
-struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
-					   u64 address, bool check_children);
-int acpi_is_root_bridge(acpi_handle);
-struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
-
-int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
-int acpi_disable_wakeup_device_power(struct acpi_device *dev);
-
-#ifdef CONFIG_PM
-acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
-				 void (*work_func)(struct work_struct *work));
-acpi_status acpi_remove_pm_notifier(struct acpi_device *adev);
-int acpi_pm_device_sleep_state(struct device *, int *, int);
-int acpi_pm_device_run_wake(struct device *, bool);
-#else
-static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
-					       struct device *dev,
-				               void (*work_func)(struct work_struct *work))
-{
-	return AE_SUPPORT;
-}
-static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev)
-{
-	return AE_SUPPORT;
-}
-static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
-{
-	if (p)
-		*p = ACPI_STATE_D0;
-
-	return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
-		m : ACPI_STATE_D0;
-}
-static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
-{
-	return -ENODEV;
-}
-#endif
-
-#ifdef CONFIG_PM_SLEEP
-int acpi_pm_device_sleep_wake(struct device *, bool);
-#else
-static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
-{
-	return -ENODEV;
-}
-#endif
-
-#ifdef CONFIG_ACPI_SLEEP
-u32 acpi_target_system_state(void);
-#else
-static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; }
-#endif
-
-static inline bool acpi_device_power_manageable(struct acpi_device *adev)
-{
-	return adev->flags.power_manageable;
-}
-
-static inline bool acpi_device_can_wakeup(struct acpi_device *adev)
-{
-	return adev->wakeup.flags.valid;
-}
-
-static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
-{
-	return adev->power.states[ACPI_STATE_D3_COLD].flags.valid ||
-		((acpi_gbl_FADT.header.revision < 6) &&
-		adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set);
-}
-
-#else	/* CONFIG_ACPI */
-
-static inline int register_acpi_bus_type(void *bus) { return 0; }
-static inline int unregister_acpi_bus_type(void *bus) { return 0; }
-
-#endif				/* CONFIG_ACPI */
-
-#endif /*__ACPI_BUS_H__*/

+ 0 - 123
sys/include/acpi/acpi_drivers.h

@@ -1,123 +0,0 @@
-/*
- *  acpi_drivers.h  ($Revision: 31 $)
- *
- *  Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
- *  Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or (at
- *  your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful, but
- *  WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-#ifndef __ACPI_DRIVERS_H__
-#define __ACPI_DRIVERS_H__
-
-#define ACPI_MAX_STRING			80
-
-/*
- * Please update drivers/acpi/debug.c and Documentation/acpi/debug.txt
- * if you add to this list.
- */
-#define ACPI_BUS_COMPONENT		0x00010000
-#define ACPI_AC_COMPONENT		0x00020000
-#define ACPI_BATTERY_COMPONENT		0x00040000
-#define ACPI_BUTTON_COMPONENT		0x00080000
-#define ACPI_SBS_COMPONENT		0x00100000
-#define ACPI_FAN_COMPONENT		0x00200000
-#define ACPI_PCI_COMPONENT		0x00400000
-#define ACPI_POWER_COMPONENT		0x00800000
-#define ACPI_CONTAINER_COMPONENT	0x01000000
-#define ACPI_SYSTEM_COMPONENT		0x02000000
-#define ACPI_THERMAL_COMPONENT		0x04000000
-#define ACPI_MEMORY_DEVICE_COMPONENT	0x08000000
-#define ACPI_VIDEO_COMPONENT		0x10000000
-#define ACPI_PROCESSOR_COMPONENT	0x20000000
-
-/*
- * _HID definitions
- * HIDs must conform to ACPI spec(6.1.4)
- * Linux specific HIDs do not apply to this and begin with LNX:
- */
-
-#define ACPI_POWER_HID			"LNXPOWER"
-#define ACPI_PROCESSOR_OBJECT_HID	"LNXCPU"
-#define ACPI_SYSTEM_HID			"LNXSYSTM"
-#define ACPI_THERMAL_HID		"LNXTHERM"
-#define ACPI_BUTTON_HID_POWERF		"LNXPWRBN"
-#define ACPI_BUTTON_HID_SLEEPF		"LNXSLPBN"
-#define ACPI_VIDEO_HID			"LNXVIDEO"
-#define ACPI_BAY_HID			"LNXIOBAY"
-#define ACPI_DOCK_HID			"LNXDOCK"
-/* Quirk for broken IBM BIOSes */
-#define ACPI_SMBUS_IBM_HID		"SMBUSIBM"
-
-/*
- * For fixed hardware buttons, we fabricate acpi_devices with HID
- * ACPI_BUTTON_HID_POWERF or ACPI_BUTTON_HID_SLEEPF.  Fixed hardware
- * signals only an event; it doesn't supply a notification value.
- * To allow drivers to treat notifications from fixed hardware the
- * same as those from real devices, we turn the events into this
- * notification value.
- */
-#define ACPI_FIXED_HARDWARE_EVENT	0x100
-
-/* --------------------------------------------------------------------------
-                                       PCI
-   -------------------------------------------------------------------------- */
-
-
-/* ACPI PCI Interrupt Link (pci_link.c) */
-
-int acpi_irq_penalty_init(void);
-int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
-			       int *polarity, char **name);
-int acpi_pci_link_free_irq(acpi_handle handle);
-
-/* ACPI PCI Device Binding (pci_bind.c) */
-
-struct pci_bus;
-
-struct pci_dev *acpi_get_pci_dev(acpi_handle);
-
-/* Arch-defined function to add a bus to the system */
-
-struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root);
-
-#ifdef CONFIG_X86
-void pci_acpi_crs_quirks(void);
-#else
-static inline void pci_acpi_crs_quirks(void) { }
-#endif
-
-/* --------------------------------------------------------------------------
-                                    Processor
-   -------------------------------------------------------------------------- */
-
-#define ACPI_PROCESSOR_LIMIT_NONE	0x00
-#define ACPI_PROCESSOR_LIMIT_INCREMENT	0x01
-#define ACPI_PROCESSOR_LIMIT_DECREMENT	0x02
-
-/*--------------------------------------------------------------------------
-                                  Dock Station
-  -------------------------------------------------------------------------- */
-
-#ifdef CONFIG_ACPI_DOCK
-extern int is_dock_device(struct acpi_device *adev);
-#else
-static inline int is_dock_device(struct acpi_device *adev)
-{
-	return 0;
-}
-#endif /* CONFIG_ACPI_DOCK */
-
-#endif /*__ACPI_DRIVERS_H__*/

+ 0 - 24
sys/include/acpi/acpi_io.h

@@ -1,24 +0,0 @@
-#ifndef _ACPI_IO_H_
-#define _ACPI_IO_H_
-
-#include <linux/io.h>
-
-#include <asm/acpi.h>
-
-#ifndef acpi_os_ioremap
-static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
-					    acpi_size size)
-{
-       return ioremap_cache(phys, size);
-}
-#endif
-
-void __iomem *__init_refok
-acpi_os_map_iomem(acpi_physical_address phys, acpi_size size);
-void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size);
-void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
-
-int acpi_os_map_generic_address(struct acpi_generic_address *addr);
-void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
-
-#endif

+ 0 - 65
sys/include/acpi/acpi_lpat.h

@@ -1,65 +0,0 @@
-/*
- * acpi_lpat.h - LPAT table processing functions
- *
- * Copyright (C) 2015 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef ACPI_LPAT_H
-#define ACPI_LPAT_H
-
-struct acpi_lpat {
-	int temp;
-	int raw;
-};
-
-struct acpi_lpat_conversion_table {
-	struct acpi_lpat *lpat;
-	int lpat_count;
-};
-
-#ifdef CONFIG_ACPI
-
-int acpi_lpat_raw_to_temp(struct acpi_lpat_conversion_table *lpat_table,
-			  int raw);
-int acpi_lpat_temp_to_raw(struct acpi_lpat_conversion_table *lpat_table,
-			  int temp);
-struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table(acpi_handle
-								  handle);
-void acpi_lpat_free_conversion_table(struct acpi_lpat_conversion_table
-				     *lpat_table);
-
-#else
-static int acpi_lpat_raw_to_temp(struct acpi_lpat_conversion_table *lpat_table,
-				 int raw)
-{
-	return 0;
-}
-
-static int acpi_lpat_temp_to_raw(struct acpi_lpat_conversion_table *lpat_table,
-				 int temp)
-{
-	return 0;
-}
-
-static struct acpi_lpat_conversion_table *acpi_lpat_get_conversion_table(
-							acpi_handle handle)
-{
-	return NULL;
-}
-
-static void acpi_lpat_free_conversion_table(struct acpi_lpat_conversion_table
-					    *lpat_table)
-{
-}
-
-#endif
-#endif

+ 0 - 20
sys/include/acpi/acpi_numa.h

@@ -1,20 +0,0 @@
-#ifndef __ACPI_NUMA_H
-#define __ACPI_NUMA_H
-
-#ifdef CONFIG_ACPI_NUMA
-#include <linux/kernel.h>
-
-/* Proximity bitmap length */
-#if MAX_NUMNODES > 256
-#define MAX_PXM_DOMAINS MAX_NUMNODES
-#else
-#define MAX_PXM_DOMAINS (256)	/* Old pxm spec is defined 8 bit */
-#endif
-
-extern int pxm_to_node(int);
-extern int node_to_pxm(int);
-extern int acpi_map_pxm_to_node(int);
-extern unsigned char acpi_srat_revision;
-
-#endif				/* CONFIG_ACPI_NUMA */
-#endif				/* __ACP_NUMA_H */

+ 298 - 0
sys/include/acpi/acpica/acapps.h

@@ -0,0 +1,298 @@
+/******************************************************************************
+ *
+ * Module Name: acapps - common include for ACPI applications/tools
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#ifndef _ACAPPS
+#define _ACAPPS
+
+#include <stdio.h>
+
+#ifdef _MSC_VER                 /* disable some level-4 warnings */
+#pragma warning(disable:4100)   /* warning C4100: unreferenced formal parameter */
+#endif
+
+/* Common info for tool signons */
+
+#define ACPICA_NAME                 "Intel ACPI Component Architecture"
+#define ACPICA_COPYRIGHT            "Copyright (c) 2000 - 2016 Intel Corporation"
+
+#if ACPI_MACHINE_WIDTH == 64
+#define ACPI_WIDTH          "-64"
+
+#elif ACPI_MACHINE_WIDTH == 32
+#define ACPI_WIDTH          "-32"
+
+#else
+#error unknown ACPI_MACHINE_WIDTH
+#define ACPI_WIDTH          "-??"
+
+#endif
+
+/* Macros for signons and file headers */
+
+#define ACPI_COMMON_SIGNON(UtilityName) \
+    "\n%s\n%s version %8.8X%s\n%s\n\n", \
+    ACPICA_NAME, \
+    UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
+    ACPICA_COPYRIGHT
+
+#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
+    "%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \
+    Prefix, ACPICA_NAME, \
+    Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
+    Prefix, ACPICA_COPYRIGHT, \
+    Prefix
+
+/* Macros for usage messages */
+
+#define ACPI_USAGE_HEADER(Usage) \
+    AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
+
+#define ACPI_USAGE_TEXT(Description) \
+    AcpiOsPrintf (Description);
+
+#define ACPI_OPTION(Name, Description) \
+    AcpiOsPrintf ("  %-20s%s\n", Name, Description);
+
+
+/* Check for unexpected exceptions */
+
+#define ACPI_CHECK_STATUS(Name, Status, Expected) \
+    if (Status != Expected) \
+    { \
+        AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
+            AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
+    }
+
+/* Check for unexpected non-AE_OK errors */
+
+
+#define ACPI_CHECK_OK(Name, Status)   ACPI_CHECK_STATUS (Name, Status, AE_OK);
+
+#define FILE_SUFFIX_DISASSEMBLY     "dsl"
+#define FILE_SUFFIX_BINARY_TABLE    ".dat" /* Needs the dot */
+
+
+/* acfileio */
+
+ACPI_STATUS
+AcGetAllTablesFromFile (
+    char                    *Filename,
+    UINT8                   GetOnlyAmlTables,
+    ACPI_NEW_TABLE_DESC     **ReturnListHead);
+
+BOOLEAN
+AcIsFileBinary (
+    FILE                    *File);
+
+ACPI_STATUS
+AcValidateTableHeader (
+    FILE                    *File,
+    long                    TableOffset);
+
+
+/* Values for GetOnlyAmlTables */
+
+#define ACPI_GET_ONLY_AML_TABLES    TRUE
+#define ACPI_GET_ALL_TABLES         FALSE
+
+
+/*
+ * getopt
+ */
+int
+AcpiGetopt(
+    int                     argc,
+    char                    **argv,
+    char                    *opts);
+
+int
+AcpiGetoptArgument (
+    int                     argc,
+    char                    **argv);
+
+extern int                  AcpiGbl_Optind;
+extern int                  AcpiGbl_Opterr;
+extern int                  AcpiGbl_SubOptChar;
+extern char                 *AcpiGbl_Optarg;
+
+
+/*
+ * cmfsize - Common get file size function
+ */
+UINT32
+CmGetFileSize (
+    ACPI_FILE               File);
+
+
+/*
+ * adwalk
+ */
+void
+AcpiDmCrossReferenceNamespace (
+    ACPI_PARSE_OBJECT       *ParseTreeRoot,
+    ACPI_NAMESPACE_NODE     *NamespaceRoot,
+    ACPI_OWNER_ID           OwnerId);
+
+void
+AcpiDmDumpTree (
+    ACPI_PARSE_OBJECT       *Origin);
+
+void
+AcpiDmFindOrphanMethods (
+    ACPI_PARSE_OBJECT       *Origin);
+
+void
+AcpiDmFinishNamespaceLoad (
+    ACPI_PARSE_OBJECT       *ParseTreeRoot,
+    ACPI_NAMESPACE_NODE     *NamespaceRoot,
+    ACPI_OWNER_ID           OwnerId);
+
+void
+AcpiDmConvertResourceIndexes (
+    ACPI_PARSE_OBJECT       *ParseTreeRoot,
+    ACPI_NAMESPACE_NODE     *NamespaceRoot);
+
+
+/*
+ * adfile
+ */
+ACPI_STATUS
+AdInitialize (
+    void);
+
+char *
+FlGenerateFilename (
+    char                    *InputFilename,
+    char                    *Suffix);
+
+ACPI_STATUS
+FlSplitInputPathname (
+    char                    *InputPath,
+    char                    **OutDirectoryPath,
+    char                    **OutFilename);
+
+char *
+AdGenerateFilename (
+    char                    *Prefix,
+    char                    *TableId);
+
+void
+AdWriteTable (
+    ACPI_TABLE_HEADER       *Table,
+    UINT32                  Length,
+    char                    *TableName,
+    char                    *OemTableId);
+
+#endif /* _ACAPPS */

+ 327 - 0
sys/include/acpi/acpica/acbuffer.h

@@ -0,0 +1,327 @@
+/******************************************************************************
+ *
+ * Name: acbuffer.h - Support for buffers returned by ACPI predefined names
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#ifndef __ACBUFFER_H__
+#define __ACBUFFER_H__
+
+/*
+ * Contains buffer structures for these predefined names:
+ * _FDE, _GRT, _GTM, _PLD, _SRT
+ */
+
+/*
+ * Note: C bitfields are not used for this reason:
+ *
+ * "Bitfields are great and easy to read, but unfortunately the C language
+ * does not specify the layout of bitfields in memory, which means they are
+ * essentially useless for dealing with packed data in on-disk formats or
+ * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
+ * this decision was a design error in C. Ritchie could have picked an order
+ * and stuck with it." Norman Ramsey.
+ * See http://stackoverflow.com/a/1053662/41661
+ */
+
+
+/* _FDE return value */
+
+typedef struct acpi_fde_info
+{
+    UINT32              Floppy0;
+    UINT32              Floppy1;
+    UINT32              Floppy2;
+    UINT32              Floppy3;
+    UINT32              Tape;
+
+} ACPI_FDE_INFO;
+
+/*
+ * _GRT return value
+ * _SRT input value
+ */
+typedef struct acpi_grt_info
+{
+    UINT16              Year;
+    UINT8               Month;
+    UINT8               Day;
+    UINT8               Hour;
+    UINT8               Minute;
+    UINT8               Second;
+    UINT8               Valid;
+    UINT16              Milliseconds;
+    UINT16              Timezone;
+    UINT8               Daylight;
+    UINT8               Reserved[3];
+
+} ACPI_GRT_INFO;
+
+/* _GTM return value */
+
+typedef struct acpi_gtm_info
+{
+    UINT32              PioSpeed0;
+    UINT32              DmaSpeed0;
+    UINT32              PioSpeed1;
+    UINT32              DmaSpeed1;
+    UINT32              Flags;
+
+} ACPI_GTM_INFO;
+
+/*
+ * Formatted _PLD return value. The minimum size is a package containing
+ * one buffer.
+ * Revision 1: Buffer is 16 bytes (128 bits)
+ * Revision 2: Buffer is 20 bytes (160 bits)
+ *
+ * Note: This structure is returned from the AcpiDecodePldBuffer
+ * interface.
+ */
+typedef struct acpi_pld_info
+{
+    UINT8               Revision;
+    UINT8               IgnoreColor;
+    UINT8               Red;
+    UINT8               Green;
+    UINT8               Blue;
+    UINT16              Width;
+    UINT16              Height;
+    UINT8               UserVisible;
+    UINT8               Dock;
+    UINT8               Lid;
+    UINT8               Panel;
+    UINT8               VerticalPosition;
+    UINT8               HorizontalPosition;
+    UINT8               Shape;
+    UINT8               GroupOrientation;
+    UINT8               GroupToken;
+    UINT8               GroupPosition;
+    UINT8               Bay;
+    UINT8               Ejectable;
+    UINT8               OspmEjectRequired;
+    UINT8               CabinetNumber;
+    UINT8               CardCageNumber;
+    UINT8               Reference;
+    UINT8               Rotation;
+    UINT8               Order;
+    UINT8               Reserved;
+    UINT16              VerticalOffset;
+    UINT16              HorizontalOffset;
+
+} ACPI_PLD_INFO;
+
+
+/*
+ * Macros to:
+ *     1) Convert a _PLD buffer to internal ACPI_PLD_INFO format - ACPI_PLD_GET*
+ *        (Used by AcpiDecodePldBuffer)
+ *     2) Construct a _PLD buffer - ACPI_PLD_SET*
+ *        (Intended for BIOS use only)
+ */
+#define ACPI_PLD_REV1_BUFFER_SIZE               16 /* For Revision 1 of the buffer (From ACPI spec) */
+#define ACPI_PLD_REV2_BUFFER_SIZE               20 /* For Revision 2 of the buffer (From ACPI spec) */
+#define ACPI_PLD_BUFFER_SIZE                    20 /* For Revision 2 of the buffer (From ACPI spec) */
+
+/* First 32-bit dword, bits 0:32 */
+
+#define ACPI_PLD_GET_REVISION(dword)            ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK)
+#define ACPI_PLD_SET_REVISION(dword,value)      ACPI_SET_BITS (dword, 0, ACPI_7BIT_MASK, value)     /* Offset 0, Len 7 */
+
+#define ACPI_PLD_GET_IGNORE_COLOR(dword)        ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_IGNORE_COLOR(dword,value)  ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value)     /* Offset 7, Len 1 */
+
+#define ACPI_PLD_GET_RED(dword)                 ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_RED(dword,value)           ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value)    /* Offset 8, Len 8 */
+
+#define ACPI_PLD_GET_GREEN(dword)               ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_GREEN(dword,value)         ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value)    /* Offset 16, Len 8 */
+
+#define ACPI_PLD_GET_BLUE(dword)                ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_BLUE(dword,value)          ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value)    /* Offset 24, Len 8 */
+
+/* Second 32-bit dword, bits 33:63 */
+
+#define ACPI_PLD_GET_WIDTH(dword)               ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_WIDTH(dword,value)         ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value)    /* Offset 32+0=32, Len 16 */
+
+#define ACPI_PLD_GET_HEIGHT(dword)              ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_HEIGHT(dword,value)        ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value)   /* Offset 32+16=48, Len 16 */
+
+/* Third 32-bit dword, bits 64:95 */
+
+#define ACPI_PLD_GET_USER_VISIBLE(dword)        ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_USER_VISIBLE(dword,value)  ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value)     /* Offset 64+0=64, Len 1 */
+
+#define ACPI_PLD_GET_DOCK(dword)                ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_DOCK(dword,value)          ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value)     /* Offset 64+1=65, Len 1 */
+
+#define ACPI_PLD_GET_LID(dword)                 ACPI_GET_BITS (dword, 2, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_LID(dword,value)           ACPI_SET_BITS (dword, 2, ACPI_1BIT_MASK, value)     /* Offset 64+2=66, Len 1 */
+
+#define ACPI_PLD_GET_PANEL(dword)               ACPI_GET_BITS (dword, 3, ACPI_3BIT_MASK)
+#define ACPI_PLD_SET_PANEL(dword,value)         ACPI_SET_BITS (dword, 3, ACPI_3BIT_MASK, value)     /* Offset 64+3=67, Len 3 */
+
+#define ACPI_PLD_GET_VERTICAL(dword)            ACPI_GET_BITS (dword, 6, ACPI_2BIT_MASK)
+#define ACPI_PLD_SET_VERTICAL(dword,value)      ACPI_SET_BITS (dword, 6, ACPI_2BIT_MASK, value)     /* Offset 64+6=70, Len 2 */
+
+#define ACPI_PLD_GET_HORIZONTAL(dword)          ACPI_GET_BITS (dword, 8, ACPI_2BIT_MASK)
+#define ACPI_PLD_SET_HORIZONTAL(dword,value)    ACPI_SET_BITS (dword, 8, ACPI_2BIT_MASK, value)     /* Offset 64+8=72, Len 2 */
+
+#define ACPI_PLD_GET_SHAPE(dword)               ACPI_GET_BITS (dword, 10, ACPI_4BIT_MASK)
+#define ACPI_PLD_SET_SHAPE(dword,value)         ACPI_SET_BITS (dword, 10, ACPI_4BIT_MASK, value)    /* Offset 64+10=74, Len 4 */
+
+#define ACPI_PLD_GET_ORIENTATION(dword)         ACPI_GET_BITS (dword, 14, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_ORIENTATION(dword,value)   ACPI_SET_BITS (dword, 14, ACPI_1BIT_MASK, value)    /* Offset 64+14=78, Len 1 */
+
+#define ACPI_PLD_GET_TOKEN(dword)               ACPI_GET_BITS (dword, 15, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_TOKEN(dword,value)         ACPI_SET_BITS (dword, 15, ACPI_8BIT_MASK, value)    /* Offset 64+15=79, Len 8 */
+
+#define ACPI_PLD_GET_POSITION(dword)            ACPI_GET_BITS (dword, 23, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_POSITION(dword,value)      ACPI_SET_BITS (dword, 23, ACPI_8BIT_MASK, value)    /* Offset 64+23=87, Len 8 */
+
+#define ACPI_PLD_GET_BAY(dword)                 ACPI_GET_BITS (dword, 31, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_BAY(dword,value)           ACPI_SET_BITS (dword, 31, ACPI_1BIT_MASK, value)    /* Offset 64+31=95, Len 1 */
+
+/* Fourth 32-bit dword, bits 96:127 */
+
+#define ACPI_PLD_GET_EJECTABLE(dword)           ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_EJECTABLE(dword,value)     ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value)     /* Offset 96+0=96, Len 1 */
+
+#define ACPI_PLD_GET_OSPM_EJECT(dword)          ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_OSPM_EJECT(dword,value)    ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value)     /* Offset 96+1=97, Len 1 */
+
+#define ACPI_PLD_GET_CABINET(dword)             ACPI_GET_BITS (dword, 2, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_CABINET(dword,value)       ACPI_SET_BITS (dword, 2, ACPI_8BIT_MASK, value)     /* Offset 96+2=98, Len 8 */
+
+#define ACPI_PLD_GET_CARD_CAGE(dword)           ACPI_GET_BITS (dword, 10, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_CARD_CAGE(dword,value)     ACPI_SET_BITS (dword, 10, ACPI_8BIT_MASK, value)    /* Offset 96+10=106, Len 8 */
+
+#define ACPI_PLD_GET_REFERENCE(dword)           ACPI_GET_BITS (dword, 18, ACPI_1BIT_MASK)
+#define ACPI_PLD_SET_REFERENCE(dword,value)     ACPI_SET_BITS (dword, 18, ACPI_1BIT_MASK, value)    /* Offset 96+18=114, Len 1 */
+
+#define ACPI_PLD_GET_ROTATION(dword)            ACPI_GET_BITS (dword, 19, ACPI_4BIT_MASK)
+#define ACPI_PLD_SET_ROTATION(dword,value)      ACPI_SET_BITS (dword, 19, ACPI_4BIT_MASK, value)    /* Offset 96+19=115, Len 4 */
+
+#define ACPI_PLD_GET_ORDER(dword)               ACPI_GET_BITS (dword, 23, ACPI_5BIT_MASK)
+#define ACPI_PLD_SET_ORDER(dword,value)         ACPI_SET_BITS (dword, 23, ACPI_5BIT_MASK, value)    /* Offset 96+23=119, Len 5 */
+
+/* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */
+
+#define ACPI_PLD_GET_VERT_OFFSET(dword)         ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_VERT_OFFSET(dword,value)   ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value)    /* Offset 128+0=128, Len 16 */
+
+#define ACPI_PLD_GET_HORIZ_OFFSET(dword)        ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
+#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value)  ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value)   /* Offset 128+16=144, Len 16 */
+
+
+#endif /* ACBUFFER_H */

+ 239 - 0
sys/include/acpi/acpica/acclib.h

@@ -0,0 +1,239 @@
+/******************************************************************************
+ *
+ * Name: acclib.h -- C library support. Prototypes for the (optional) local
+ *                   implementations of required C library functions.
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************/
+
+#ifndef _ACCLIB_H
+#define _ACCLIB_H
+
+
+/*
+ * Prototypes and macros for local implementations of C library functions
+ */
+
+/* is* functions. The AcpiGbl_Ctypes array is defined in utclib.c */
+
+extern const UINT8 AcpiGbl_Ctypes[];
+
+#define _ACPI_XA     0x00    /* extra alphabetic - not supported */
+#define _ACPI_XS     0x40    /* extra space */
+#define _ACPI_BB     0x00    /* BEL, BS, etc. - not supported */
+#define _ACPI_CN     0x20    /* CR, FF, HT, NL, VT */
+#define _ACPI_DI     0x04    /* '0'-'9' */
+#define _ACPI_LO     0x02    /* 'a'-'z' */
+#define _ACPI_PU     0x10    /* punctuation */
+#define _ACPI_SP     0x08    /* space, tab, CR, LF, VT, FF */
+#define _ACPI_UP     0x01    /* 'A'-'Z' */
+#define _ACPI_XD     0x80    /* '0'-'9', 'A'-'F', 'a'-'f' */
+
+#define isdigit(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_DI))
+#define isspace(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_SP))
+#define isxdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_XD))
+#define isupper(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_UP))
+#define islower(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO))
+#define isprint(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
+#define isalpha(c)  (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
+
+
+/* Strings */
+
+char *
+strcat (
+    char                    *DstString,
+    const char              *SrcString);
+
+char *
+strchr (
+    const char              *String,
+    int                     ch);
+
+char *
+strcpy (
+    char                    *DstString,