ACPICA: Difference between revisions
[unchecked revision] | [unchecked revision] |
No edit summary |
No edit summary |
||
Line 27: | Line 27: | ||
free(Memory); |
free(Memory); |
||
} |
} |
||
=== AcpiOsPrintf === |
|||
==== Prototype ==== |
|||
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format, ...); |
|||
==== Description ==== |
|||
Print formatted string |
|||
==== Example ==== |
|||
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format, ...) { |
|||
va_list args; |
|||
va_start(args, Format); |
|||
printf(Format, args); |
|||
va_end(args); |
|||
} |
|||
=== AcpiOsPrintf === |
|||
==== Prototype ==== |
|||
void ACPI_INTERNAL_VAR_XFACE AcpiOsVprintf(const char *Format, va_list Args); |
|||
==== Description ==== |
|||
Print formatted using va_list as argument list. |
|||
==== Example ==== |
|||
void ACPI_INTERNAL_VAR_XFACE AcpiOsVprintf(const char *Format, va_list Args) { |
|||
printf(Format, Args); |
|||
} |
|||
== External links == |
== External links == |
||
*[http://www.acpica.org/ ACPICA Website] |
*[http://www.acpica.org/ ACPICA Website] |
Revision as of 12:15, 20 May 2009
The ACPI Component Architecture ACPICA provides an operating system (OS)-independent reference implementation of the Advanced Configuration and Power Interface. It can be adapted to any host OS. The ACPICA code is meant to be directly integrated into the host OS, as a kernel-resident subsystem. Hosting the ACPICA requires no changes to the core ACPICA code. However, it does require a small OS-specific interface layer, which must be written specifically for each host OS.
The complexity of the ACPI specification leads to a lengthy and difficult implementation in OS software. The purpose of the ACPI Component Architecture is to simplify ACPI implementations for operating system vendors (OSVs) by providing major portions of an ACPI implementation in OS-independent ACPI modules that can be easily integrated into any OS.
As said before you need to implement yourself few functions that are part of the OS interface layer. Here are those functions:
OS Layer
There are about 25-30 functions to be implemented:
AcpiOsAllocate
Prototype
void *AcpiOsAllocate(ACPI_SIZE Size);
Description
Dinamically allocate memory in the heap. Return NULL on error or end of memory.
Example
void *AcpiOsAllocate(ACPI_SIZE Size) { return malloc(Size); }
AcpiOsFree
Prototype
void AcpiOsFree(void *Memory);
Description
Free previously dinamically allocated memory
Example
void AcpiOsFree(void *Memory) { free(Memory); }
AcpiOsPrintf
Prototype
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format, ...);
Description
Print formatted string
Example
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format, ...) { va_list args; va_start(args, Format); printf(Format, args); va_end(args); }
AcpiOsPrintf
Prototype
void ACPI_INTERNAL_VAR_XFACE AcpiOsVprintf(const char *Format, va_list Args);
Description
Print formatted using va_list as argument list.
Example
void ACPI_INTERNAL_VAR_XFACE AcpiOsVprintf(const char *Format, va_list Args) { printf(Format, Args); }
External links
- ACPICA Website
- ACPICA Programmer Reference. Explains how to integrate it in your OS.