acpixf.h revision 151937
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 - 2005, 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 */ 128ACPI_STATUS 129AcpiInitializeSubsystem ( 130 void); 131 132ACPI_STATUS 133AcpiEnableSubsystem ( 134 UINT32 Flags); 135 136ACPI_STATUS 137AcpiInitializeObjects ( 138 UINT32 Flags); 139 140ACPI_STATUS 141AcpiTerminate ( 142 void); 143 144ACPI_STATUS 145AcpiSubsystemStatus ( 146 void); 147 148ACPI_STATUS 149AcpiEnable ( 150 void); 151 152ACPI_STATUS 153AcpiDisable ( 154 void); 155 156ACPI_STATUS 157AcpiGetSystemInfo ( 158 ACPI_BUFFER *RetBuffer); 159 160const char * 161AcpiFormatException ( 162 ACPI_STATUS Exception); 163 164ACPI_STATUS 165AcpiPurgeCachedObjects ( 166 void); 167 168ACPI_STATUS 169AcpiInstallInitializationHandler ( 170 ACPI_INIT_HANDLER Handler, 171 UINT32 Function); 172 173/* 174 * ACPI Memory managment 175 */ 176void * 177AcpiAllocate ( 178 UINT32 Size); 179 180void * 181AcpiCallocate ( 182 UINT32 Size); 183 184void 185AcpiFree ( 186 void *Address); 187 188 189/* 190 * ACPI table manipulation interfaces 191 */ 192ACPI_STATUS 193AcpiFindRootPointer ( 194 UINT32 Flags, 195 ACPI_POINTER *RsdpAddress); 196 197ACPI_STATUS 198AcpiLoadTables ( 199 void); 200 201ACPI_STATUS 202AcpiLoadTable ( 203 ACPI_TABLE_HEADER *TablePtr); 204 205ACPI_STATUS 206AcpiUnloadTable ( 207 ACPI_TABLE_TYPE TableType); 208 209ACPI_STATUS 210AcpiGetTableHeader ( 211 ACPI_TABLE_TYPE TableType, 212 UINT32 Instance, 213 ACPI_TABLE_HEADER *OutTableHeader); 214 215ACPI_STATUS 216AcpiGetTable ( 217 ACPI_TABLE_TYPE TableType, 218 UINT32 Instance, 219 ACPI_BUFFER *RetBuffer); 220 221ACPI_STATUS 222AcpiGetFirmwareTable ( 223 ACPI_STRING Signature, 224 UINT32 Instance, 225 UINT32 Flags, 226 ACPI_TABLE_HEADER **TablePointer); 227 228 229/* 230 * Namespace and name interfaces 231 */ 232ACPI_STATUS 233AcpiWalkNamespace ( 234 ACPI_OBJECT_TYPE Type, 235 ACPI_HANDLE StartObject, 236 UINT32 MaxDepth, 237 ACPI_WALK_CALLBACK UserFunction, 238 void *Context, 239 void **ReturnValue); 240 241ACPI_STATUS 242AcpiGetDevices ( 243 char *HID, 244 ACPI_WALK_CALLBACK UserFunction, 245 void *Context, 246 void **ReturnValue); 247 248ACPI_STATUS 249AcpiGetName ( 250 ACPI_HANDLE Handle, 251 UINT32 NameType, 252 ACPI_BUFFER *RetPathPtr); 253 254ACPI_STATUS 255AcpiGetHandle ( 256 ACPI_HANDLE Parent, 257 ACPI_STRING Pathname, 258 ACPI_HANDLE *RetHandle); 259 260ACPI_STATUS 261AcpiAttachData ( 262 ACPI_HANDLE ObjHandle, 263 ACPI_OBJECT_HANDLER Handler, 264 void *Data); 265 266ACPI_STATUS 267AcpiDetachData ( 268 ACPI_HANDLE ObjHandle, 269 ACPI_OBJECT_HANDLER Handler); 270 271ACPI_STATUS 272AcpiGetData ( 273 ACPI_HANDLE ObjHandle, 274 ACPI_OBJECT_HANDLER Handler, 275 void **Data); 276 277ACPI_STATUS 278AcpiDebugTrace ( 279 char *Name, 280 UINT32 DebugLevel, 281 UINT32 DebugLayer, 282 UINT32 Flags); 283 284 285/* 286 * Object manipulation and enumeration 287 */ 288ACPI_STATUS 289AcpiEvaluateObject ( 290 ACPI_HANDLE Object, 291 ACPI_STRING Pathname, 292 ACPI_OBJECT_LIST *ParameterObjects, 293 ACPI_BUFFER *ReturnObjectBuffer); 294 295ACPI_STATUS 296AcpiEvaluateObjectTyped ( 297 ACPI_HANDLE Object, 298 ACPI_STRING Pathname, 299 ACPI_OBJECT_LIST *ExternalParams, 300 ACPI_BUFFER *ReturnBuffer, 301 ACPI_OBJECT_TYPE ReturnType); 302 303ACPI_STATUS 304AcpiGetObjectInfo ( 305 ACPI_HANDLE Handle, 306 ACPI_BUFFER *ReturnBuffer); 307 308ACPI_STATUS 309AcpiGetNextObject ( 310 ACPI_OBJECT_TYPE Type, 311 ACPI_HANDLE Parent, 312 ACPI_HANDLE Child, 313 ACPI_HANDLE *OutHandle); 314 315ACPI_STATUS 316AcpiGetType ( 317 ACPI_HANDLE Object, 318 ACPI_OBJECT_TYPE *OutType); 319 320ACPI_STATUS 321AcpiGetParent ( 322 ACPI_HANDLE Object, 323 ACPI_HANDLE *OutHandle); 324 325 326/* 327 * Event handler interfaces 328 */ 329ACPI_STATUS 330AcpiInstallFixedEventHandler ( 331 UINT32 AcpiEvent, 332 ACPI_EVENT_HANDLER Handler, 333 void *Context); 334 335ACPI_STATUS 336AcpiRemoveFixedEventHandler ( 337 UINT32 AcpiEvent, 338 ACPI_EVENT_HANDLER Handler); 339 340ACPI_STATUS 341AcpiInstallNotifyHandler ( 342 ACPI_HANDLE Device, 343 UINT32 HandlerType, 344 ACPI_NOTIFY_HANDLER Handler, 345 void *Context); 346 347ACPI_STATUS 348AcpiRemoveNotifyHandler ( 349 ACPI_HANDLE Device, 350 UINT32 HandlerType, 351 ACPI_NOTIFY_HANDLER Handler); 352 353ACPI_STATUS 354AcpiInstallAddressSpaceHandler ( 355 ACPI_HANDLE Device, 356 ACPI_ADR_SPACE_TYPE SpaceId, 357 ACPI_ADR_SPACE_HANDLER Handler, 358 ACPI_ADR_SPACE_SETUP Setup, 359 void *Context); 360 361ACPI_STATUS 362AcpiRemoveAddressSpaceHandler ( 363 ACPI_HANDLE Device, 364 ACPI_ADR_SPACE_TYPE SpaceId, 365 ACPI_ADR_SPACE_HANDLER Handler); 366 367ACPI_STATUS 368AcpiInstallGpeHandler ( 369 ACPI_HANDLE GpeDevice, 370 UINT32 GpeNumber, 371 UINT32 Type, 372 ACPI_EVENT_HANDLER Address, 373 void *Context); 374 375ACPI_STATUS 376AcpiInstallExceptionHandler ( 377 ACPI_EXCEPTION_HANDLER Handler); 378 379 380/* 381 * Event interfaces 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 InterruptNumber); 454 455ACPI_STATUS 456AcpiRemoveGpeBlock ( 457 ACPI_HANDLE GpeDevice); 458 459 460/* 461 * Resource interfaces 462 */ 463typedef 464ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) ( 465 ACPI_RESOURCE *Resource, 466 void *Context); 467 468 469ACPI_STATUS 470AcpiGetCurrentResources( 471 ACPI_HANDLE DeviceHandle, 472 ACPI_BUFFER *RetBuffer); 473 474ACPI_STATUS 475AcpiGetPossibleResources( 476 ACPI_HANDLE DeviceHandle, 477 ACPI_BUFFER *RetBuffer); 478 479ACPI_STATUS 480AcpiWalkResources ( 481 ACPI_HANDLE DeviceHandle, 482 char *Path, 483 ACPI_WALK_RESOURCE_CALLBACK UserFunction, 484 void *Context); 485 486ACPI_STATUS 487AcpiSetCurrentResources ( 488 ACPI_HANDLE DeviceHandle, 489 ACPI_BUFFER *InBuffer); 490 491ACPI_STATUS 492AcpiGetIrqRoutingTable ( 493 ACPI_HANDLE BusDeviceHandle, 494 ACPI_BUFFER *RetBuffer); 495 496ACPI_STATUS 497AcpiResourceToAddress64 ( 498 ACPI_RESOURCE *Resource, 499 ACPI_RESOURCE_ADDRESS64 *Out); 500 501/* 502 * Hardware (ACPI device) interfaces 503 */ 504ACPI_STATUS 505AcpiGetRegister ( 506 UINT32 RegisterId, 507 UINT32 *ReturnValue, 508 UINT32 Flags); 509 510ACPI_STATUS 511AcpiSetRegister ( 512 UINT32 RegisterId, 513 UINT32 Value, 514 UINT32 Flags); 515 516ACPI_STATUS 517AcpiSetFirmwareWakingVector ( 518 ACPI_PHYSICAL_ADDRESS PhysicalAddress); 519 520ACPI_STATUS 521AcpiGetFirmwareWakingVector ( 522 ACPI_PHYSICAL_ADDRESS *PhysicalAddress); 523 524ACPI_STATUS 525AcpiGetSleepTypeData ( 526 UINT8 SleepState, 527 UINT8 *Slp_TypA, 528 UINT8 *Slp_TypB); 529 530ACPI_STATUS 531AcpiEnterSleepStatePrep ( 532 UINT8 SleepState); 533 534ACPI_STATUS 535AcpiEnterSleepState ( 536 UINT8 SleepState); 537 538ACPI_STATUS 539AcpiEnterSleepStateS4bios ( 540 void); 541 542ACPI_STATUS 543AcpiLeaveSleepState ( 544 UINT8 SleepState); 545 546 547#endif /* __ACXFACE_H__ */ 548