acpixf.h revision 151600
1 2/****************************************************************************** 3 * 4 * Name: acpixf.h - External interfaces to the ACPI subsystem 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117 118#ifndef __ACXFACE_H__ 119#define __ACXFACE_H__ 120 121#include <contrib/dev/acpica/actypes.h> 122#include <contrib/dev/acpica/actbl.h> 123 124 125 /* 126 * Global interfaces 127 */ 128 129ACPI_STATUS 130AcpiInitializeSubsystem ( 131 void); 132 133ACPI_STATUS 134AcpiEnableSubsystem ( 135 UINT32 Flags); 136 137ACPI_STATUS 138AcpiInitializeObjects ( 139 UINT32 Flags); 140 141ACPI_STATUS 142AcpiTerminate ( 143 void); 144 145ACPI_STATUS 146AcpiSubsystemStatus ( 147 void); 148 149ACPI_STATUS 150AcpiEnable ( 151 void); 152 153ACPI_STATUS 154AcpiDisable ( 155 void); 156 157ACPI_STATUS 158AcpiGetSystemInfo ( 159 ACPI_BUFFER *RetBuffer); 160 161const char * 162AcpiFormatException ( 163 ACPI_STATUS Exception); 164 165ACPI_STATUS 166AcpiPurgeCachedObjects ( 167 void); 168 169ACPI_STATUS 170AcpiInstallInitializationHandler ( 171 ACPI_INIT_HANDLER Handler, 172 UINT32 Function); 173 174/* 175 * ACPI Memory manager 176 */ 177 178void * 179AcpiAllocate ( 180 UINT32 Size); 181 182void * 183AcpiCallocate ( 184 UINT32 Size); 185 186void 187AcpiFree ( 188 void *Address); 189 190 191/* 192 * ACPI table manipulation interfaces 193 */ 194 195ACPI_STATUS 196AcpiFindRootPointer ( 197 UINT32 Flags, 198 ACPI_POINTER *RsdpAddress); 199 200ACPI_STATUS 201AcpiLoadTables ( 202 void); 203 204ACPI_STATUS 205AcpiLoadTable ( 206 ACPI_TABLE_HEADER *TablePtr); 207 208ACPI_STATUS 209AcpiUnloadTable ( 210 ACPI_TABLE_TYPE TableType); 211 212ACPI_STATUS 213AcpiGetTableHeader ( 214 ACPI_TABLE_TYPE TableType, 215 UINT32 Instance, 216 ACPI_TABLE_HEADER *OutTableHeader); 217 218ACPI_STATUS 219AcpiGetTable ( 220 ACPI_TABLE_TYPE TableType, 221 UINT32 Instance, 222 ACPI_BUFFER *RetBuffer); 223 224ACPI_STATUS 225AcpiGetFirmwareTable ( 226 ACPI_STRING Signature, 227 UINT32 Instance, 228 UINT32 Flags, 229 ACPI_TABLE_HEADER **TablePointer); 230 231 232/* 233 * Namespace and name interfaces 234 */ 235 236ACPI_STATUS 237AcpiWalkNamespace ( 238 ACPI_OBJECT_TYPE Type, 239 ACPI_HANDLE StartObject, 240 UINT32 MaxDepth, 241 ACPI_WALK_CALLBACK UserFunction, 242 void *Context, 243 void **ReturnValue); 244 245ACPI_STATUS 246AcpiGetDevices ( 247 char *HID, 248 ACPI_WALK_CALLBACK UserFunction, 249 void *Context, 250 void **ReturnValue); 251 252ACPI_STATUS 253AcpiGetName ( 254 ACPI_HANDLE Handle, 255 UINT32 NameType, 256 ACPI_BUFFER *RetPathPtr); 257 258ACPI_STATUS 259AcpiGetHandle ( 260 ACPI_HANDLE Parent, 261 ACPI_STRING Pathname, 262 ACPI_HANDLE *RetHandle); 263 264ACPI_STATUS 265AcpiAttachData ( 266 ACPI_HANDLE ObjHandle, 267 ACPI_OBJECT_HANDLER Handler, 268 void *Data); 269 270ACPI_STATUS 271AcpiDetachData ( 272 ACPI_HANDLE ObjHandle, 273 ACPI_OBJECT_HANDLER Handler); 274 275ACPI_STATUS 276AcpiGetData ( 277 ACPI_HANDLE ObjHandle, 278 ACPI_OBJECT_HANDLER Handler, 279 void **Data); 280 281 282/* 283 * Object manipulation and enumeration 284 */ 285 286ACPI_STATUS 287AcpiEvaluateObject ( 288 ACPI_HANDLE Object, 289 ACPI_STRING Pathname, 290 ACPI_OBJECT_LIST *ParameterObjects, 291 ACPI_BUFFER *ReturnObjectBuffer); 292 293ACPI_STATUS 294AcpiEvaluateObjectTyped ( 295 ACPI_HANDLE Object, 296 ACPI_STRING Pathname, 297 ACPI_OBJECT_LIST *ExternalParams, 298 ACPI_BUFFER *ReturnBuffer, 299 ACPI_OBJECT_TYPE ReturnType); 300 301ACPI_STATUS 302AcpiGetObjectInfo ( 303 ACPI_HANDLE Handle, 304 ACPI_BUFFER *ReturnBuffer); 305 306ACPI_STATUS 307AcpiGetNextObject ( 308 ACPI_OBJECT_TYPE Type, 309 ACPI_HANDLE Parent, 310 ACPI_HANDLE Child, 311 ACPI_HANDLE *OutHandle); 312 313ACPI_STATUS 314AcpiGetType ( 315 ACPI_HANDLE Object, 316 ACPI_OBJECT_TYPE *OutType); 317 318ACPI_STATUS 319AcpiGetParent ( 320 ACPI_HANDLE Object, 321 ACPI_HANDLE *OutHandle); 322 323 324/* 325 * Event handler interfaces 326 */ 327 328ACPI_STATUS 329AcpiInstallFixedEventHandler ( 330 UINT32 AcpiEvent, 331 ACPI_EVENT_HANDLER Handler, 332 void *Context); 333 334ACPI_STATUS 335AcpiRemoveFixedEventHandler ( 336 UINT32 AcpiEvent, 337 ACPI_EVENT_HANDLER Handler); 338 339ACPI_STATUS 340AcpiInstallNotifyHandler ( 341 ACPI_HANDLE Device, 342 UINT32 HandlerType, 343 ACPI_NOTIFY_HANDLER Handler, 344 void *Context); 345 346ACPI_STATUS 347AcpiRemoveNotifyHandler ( 348 ACPI_HANDLE Device, 349 UINT32 HandlerType, 350 ACPI_NOTIFY_HANDLER Handler); 351 352ACPI_STATUS 353AcpiInstallAddressSpaceHandler ( 354 ACPI_HANDLE Device, 355 ACPI_ADR_SPACE_TYPE SpaceId, 356 ACPI_ADR_SPACE_HANDLER Handler, 357 ACPI_ADR_SPACE_SETUP Setup, 358 void *Context); 359 360ACPI_STATUS 361AcpiRemoveAddressSpaceHandler ( 362 ACPI_HANDLE Device, 363 ACPI_ADR_SPACE_TYPE SpaceId, 364 ACPI_ADR_SPACE_HANDLER Handler); 365 366ACPI_STATUS 367AcpiInstallGpeHandler ( 368 ACPI_HANDLE GpeDevice, 369 UINT32 GpeNumber, 370 UINT32 Type, 371 ACPI_EVENT_HANDLER Address, 372 void *Context); 373 374ACPI_STATUS 375AcpiInstallExceptionHandler ( 376 ACPI_EXCEPTION_HANDLER Handler); 377 378 379/* 380 * Event interfaces 381 */ 382 383ACPI_STATUS 384AcpiAcquireGlobalLock ( 385 UINT16 Timeout, 386 UINT32 *Handle); 387 388ACPI_STATUS 389AcpiReleaseGlobalLock ( 390 UINT32 Handle); 391 392ACPI_STATUS 393AcpiRemoveGpeHandler ( 394 ACPI_HANDLE GpeDevice, 395 UINT32 GpeNumber, 396 ACPI_EVENT_HANDLER Address); 397 398ACPI_STATUS 399AcpiEnableEvent ( 400 UINT32 Event, 401 UINT32 Flags); 402 403ACPI_STATUS 404AcpiDisableEvent ( 405 UINT32 Event, 406 UINT32 Flags); 407 408ACPI_STATUS 409AcpiClearEvent ( 410 UINT32 Event); 411 412ACPI_STATUS 413AcpiGetEventStatus ( 414 UINT32 Event, 415 ACPI_EVENT_STATUS *EventStatus); 416 417ACPI_STATUS 418AcpiSetGpeType ( 419 ACPI_HANDLE GpeDevice, 420 UINT32 GpeNumber, 421 UINT8 Type); 422 423ACPI_STATUS 424AcpiEnableGpe ( 425 ACPI_HANDLE GpeDevice, 426 UINT32 GpeNumber, 427 UINT32 Flags); 428 429ACPI_STATUS 430AcpiDisableGpe ( 431 ACPI_HANDLE GpeDevice, 432 UINT32 GpeNumber, 433 UINT32 Flags); 434 435ACPI_STATUS 436AcpiClearGpe ( 437 ACPI_HANDLE GpeDevice, 438 UINT32 GpeNumber, 439 UINT32 Flags); 440 441ACPI_STATUS 442AcpiGetGpeStatus ( 443 ACPI_HANDLE GpeDevice, 444 UINT32 GpeNumber, 445 UINT32 Flags, 446 ACPI_EVENT_STATUS *EventStatus); 447 448ACPI_STATUS 449AcpiInstallGpeBlock ( 450 ACPI_HANDLE GpeDevice, 451 ACPI_GENERIC_ADDRESS *GpeBlockAddress, 452 UINT32 RegisterCount, 453 UINT32 InterruptLevel); 454 455ACPI_STATUS 456AcpiRemoveGpeBlock ( 457 ACPI_HANDLE GpeDevice); 458 459 460/* 461 * Resource interfaces 462 */ 463 464typedef 465ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) ( 466 ACPI_RESOURCE *Resource, 467 void *Context); 468 469 470ACPI_STATUS 471AcpiGetCurrentResources( 472 ACPI_HANDLE DeviceHandle, 473 ACPI_BUFFER *RetBuffer); 474 475ACPI_STATUS 476AcpiGetPossibleResources( 477 ACPI_HANDLE DeviceHandle, 478 ACPI_BUFFER *RetBuffer); 479 480ACPI_STATUS 481AcpiWalkResources ( 482 ACPI_HANDLE DeviceHandle, 483 char *Path, 484 ACPI_WALK_RESOURCE_CALLBACK UserFunction, 485 void *Context); 486 487ACPI_STATUS 488AcpiSetCurrentResources ( 489 ACPI_HANDLE DeviceHandle, 490 ACPI_BUFFER *InBuffer); 491 492ACPI_STATUS 493AcpiGetIrqRoutingTable ( 494 ACPI_HANDLE BusDeviceHandle, 495 ACPI_BUFFER *RetBuffer); 496 497ACPI_STATUS 498AcpiResourceToAddress64 ( 499 ACPI_RESOURCE *Resource, 500 ACPI_RESOURCE_ADDRESS64 *Out); 501 502/* 503 * Hardware (ACPI device) interfaces 504 */ 505 506ACPI_STATUS 507AcpiGetRegister ( 508 UINT32 RegisterId, 509 UINT32 *ReturnValue, 510 UINT32 Flags); 511 512ACPI_STATUS 513AcpiSetRegister ( 514 UINT32 RegisterId, 515 UINT32 Value, 516 UINT32 Flags); 517 518ACPI_STATUS 519AcpiSetFirmwareWakingVector ( 520 ACPI_PHYSICAL_ADDRESS PhysicalAddress); 521 522ACPI_STATUS 523AcpiGetFirmwareWakingVector ( 524 ACPI_PHYSICAL_ADDRESS *PhysicalAddress); 525 526ACPI_STATUS 527AcpiGetSleepTypeData ( 528 UINT8 SleepState, 529 UINT8 *Slp_TypA, 530 UINT8 *Slp_TypB); 531 532ACPI_STATUS 533AcpiEnterSleepStatePrep ( 534 UINT8 SleepState); 535 536ACPI_STATUS 537AcpiEnterSleepState ( 538 UINT8 SleepState); 539 540ACPI_STATUS 541AcpiEnterSleepStateS4bios ( 542 void); 543 544ACPI_STATUS 545AcpiLeaveSleepState ( 546 UINT8 SleepState); 547 548 549#endif /* __ACXFACE_H__ */ 550