Comments from 07/18/00 code review

date	2000.07.19.22.55.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 20:05:41 +00:00
parent 5359ba537c
commit dfa11e9b31
8 changed files with 315 additions and 226 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: tables.h - ACPI table management
* Name: actables.h - ACPI table management
*
*****************************************************************************/
@ -114,11 +114,8 @@
*
*****************************************************************************/
#ifndef __TABLES_H__
#define __TABLES_H__
#include "actypes.h"
#include "actables.h"
#ifndef __ACTABLES_H__
#define __ACTABLES_H__
/* Used in AcpiTbMapAcpiTable for size parameter if table header is to be used */
@ -138,7 +135,7 @@ AcpiTbHandleToObject (
ACPI_STATUS
AcpiTbGetTableFacs (
char *BufferPtr,
INT8 *BufferPtr,
ACPI_TABLE_DESC *TableInfo);
@ -155,7 +152,7 @@ AcpiTbGetTablePtr (
ACPI_STATUS
AcpiTbGetTable (
void *PhysicalAddress,
char *BufferPtr,
INT8 *BufferPtr,
ACPI_TABLE_DESC *TableInfo);
@ -166,7 +163,7 @@ AcpiTbGetTable (
ACPI_STATUS
AcpiTbGetAllTables (
UINT32 NumberOfTables,
char *BufferPtr);
INT8 *BufferPtr);
/*
@ -175,12 +172,12 @@ AcpiTbGetAllTables (
ACPI_STATUS
AcpiTbInstallTable (
char *TablePtr,
INT8 *TablePtr,
ACPI_TABLE_DESC *TableInfo);
ACPI_STATUS
AcpiTbRecognizeTable (
char *TablePtr,
INT8 *TablePtr,
ACPI_TABLE_DESC *TableInfo);
ACPI_STATUS
@ -218,9 +215,9 @@ ACPI_STATUS
AcpiTbGetTableRsdt (
UINT32 *NumberOfTables);
char *
INT8 *
AcpiTbScanMemoryForRsdp (
char *StartAddress,
INT8 *StartAddress,
UINT32 Length);
ACPI_STATUS
@ -256,4 +253,4 @@ AcpiTbValidateTableHeader (
ACPI_TABLE_HEADER *TableHeader);
#endif /* __TABLES_H__ */
#endif /* __ACTABLES_H__ */

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actables.h - Table data structures defined in ACPI specification
* Name: actbl.h - Table data structures defined in ACPI specification
*
*****************************************************************************/
@ -114,8 +114,8 @@
*
*****************************************************************************/
#ifndef __ACTABLES_H__
#define __ACTABLES_H__
#ifndef __ACTBL_H__
#define __ACTBL_H__
/*
@ -154,9 +154,9 @@
typedef struct /* Root System Descriptor Pointer */
{
char Signature [8]; /* contains "RSD PTR " */
INT8 Signature [8]; /* contains "RSD PTR " */
UINT8 Checksum; /* to make sum of struct == 0 */
char OemId [6]; /* OEM identification */
INT8 OemId [6]; /* OEM identification */
UINT8 Reserved; /* reserved - must be zero */
UINT32 RsdtPhysicalAddress; /* physical address of RSDT */
@ -165,15 +165,15 @@ typedef struct /* Root System Descriptor Pointer */
typedef struct /* ACPI common table header */
{
char Signature [4]; /* identifies type of table */
INT8 Signature [4]; /* identifies type of table */
UINT32 Length; /* length of table, in bytes,
* including header */
UINT8 Revision; /* specification minor version # */
UINT8 Checksum; /* to make sum of entire table == 0 */
char OemId [6]; /* OEM identification */
char OemTableId [8]; /* OEM table identification */
INT8 OemId [6]; /* OEM identification */
INT8 OemTableId [8]; /* OEM table identification */
UINT32 OemRevision; /* OEM revision number */
char AslCompilerId [4]; /* ASL compiler vendor ID */
INT8 AslCompilerId [4]; /* ASL compiler vendor ID */
UINT32 AslCompilerRevision; /* ASL compiler revision number */
} ACPI_TABLE_HEADER;
@ -255,8 +255,8 @@ typedef struct /* Smart Battery Description Table */
typedef struct _AcpiTableSupport
{
char *Name;
char *Signature;
INT8 *Name;
INT8 *Signature;
UINT8 SigLength;
UINT8 Flags;
UINT16 Status;
@ -276,4 +276,4 @@ typedef struct _AcpiTableSupport
#endif
#endif /* __ACTABLES_H__ */
#endif /* __ACTBL_H__ */

View File

@ -131,7 +131,7 @@ typedef struct
typedef struct
{
char Signature[4]; /* signature "FACS" */
INT8 Signature[4]; /* signature "FACS" */
UINT32 Length; /* length of structure, in bytes */
UINT32 HardwareSignature; /* hardware configuration signature */
UINT32 FirmwareWakingVector; /* ACPI OS waking vector */

View File

@ -136,7 +136,7 @@ typedef struct
typedef struct
{
char Signature[4]; /* signature "FACS" */
INT8 Signature[4]; /* signature "FACS" */
UINT32 Length; /* length of structure, in bytes */
UINT32 HardwareSignature; /* hardware configuration signature */
UINT32 Reserved4; /* must be 0 */
@ -156,7 +156,7 @@ typedef struct
ACPI_TABLE_HEADER header; /* table header */
UINT32 ReservedPad; /* IA64 alignment, must be 0 */
ACPI_TBLPTR FirmwareCtrl; /* Physical address of FACS */
ACPI_TBLPTR AcpiDsdt; /* Physical address of DSDT */
ACPI_TBLPTR Dsdt; /* Physical address of DSDT */
UINT8 Model; /* System Interrupt Model */
UINT8 AddressSpace; /* Address Space Bitmask */
UINT16 SciInt; /* System vector of SCI interrupt */
@ -181,8 +181,8 @@ typedef struct
UINT8 Gpe1BlkLen; /* Byte Length of ports at gpe1_blk */
UINT8 Gpe1Base; /* offset in gpe model where gpe1 events start */
UINT8 Reserved3; /* reserved */
UINT16 PLvl2Lat; /* worst case HW latency to enter/exit C2 state */
UINT16 PLvl3Lat; /* worst case HW latency to enter/exit C3 state */
UINT16 Plvl2Lat; /* worst case HW latency to enter/exit C2 state */
UINT16 Plvl3Lat; /* worst case HW latency to enter/exit C3 state */
UINT8 DayAlrm; /* index to day-of-month alarm in RTC CMOS RAM */
UINT8 MonAlrm; /* index to month-of-year alarm in RTC CMOS RAM */
UINT8 Century; /* index to century in RTC CMOS RAM */
@ -190,11 +190,11 @@ typedef struct
UINT32_BIT FlushCash : 1; /* PAL_FLUSH_CACHE is correctly supported */
UINT32_BIT Reserved5 : 1; /* reserved - must be zero */
UINT32_BIT ProcC1 : 1; /* all processors support C1 state */
UINT32_BIT PLvl2Up : 1; /* C2 state works on MP system */
UINT32_BIT Plvl2Up : 1; /* C2 state works on MP system */
UINT32_BIT PwrButton : 1; /* Power button is handled as a generic feature */
UINT32_BIT SleepButton : 1; /* Sleep button is handled as a generic feature, or not present */
UINT32_BIT FixedRTC : 1; /* RTC wakeup stat not in fixed register space */
UINT32_BIT RTCS4 : 1; /* RTC wakeup stat not possible from S4 */
UINT32_BIT Rtcs4 : 1; /* RTC wakeup stat not possible from S4 */
UINT32_BIT TmrValExt : 1; /* tmr_val is 32 bits */
UINT32_BIT DockCap : 1; /* Supports Docking */
UINT32_BIT Reserved6 : 22; /* reserved - must be zero */

View File

@ -114,8 +114,8 @@
*
*****************************************************************************/
#ifndef _ACTYPES_H
#define _ACTYPES_H
#ifndef __ACTYPES_H__
#define __ACTYPES_H__
/*! [Begin] no source code translation (keep the typedefs) */
@ -204,6 +204,7 @@ typedef UINT32 ACPI_IO_ADDRESS;
#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
#define _HW_ALIGNMENT_SUPPORT
#endif
@ -215,7 +216,6 @@ typedef UINT32 ACPI_IO_ADDRESS;
typedef UINT8 BOOLEAN;
typedef UINT32 UINT32_BIT;
typedef NATIVE_INT ACPI_PTRDIFF;
typedef NATIVE_UINT ACPI_SIZE;
/*
@ -226,6 +226,19 @@ typedef NATIVE_UINT ACPI_SIZE;
#define ACPI_INT32_MAX (INT32) 0x7FFFFFFF
#define ACPI_UINT32_MAX (UINT32) 0xFFFFFFFF
#ifdef DEFINE_ALTERNATE_TYPES
/*
* Types used only in translated source
*/
typedef INT8 s8;
typedef INT16 s16;
typedef INT32 s32;
typedef UINT8 u8;
typedef UINT16 u16;
typedef UINT32 u32;
#endif
/*! [End] no source code translation !*/
@ -253,7 +266,7 @@ typedef NATIVE_UINT ACPI_SIZE;
*/
typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */
typedef UINT32 ACPI_NAME; /* 4-char ACPI name */
typedef UINT32 ACPI_NAME; /* 4-INT8 ACPI name */
typedef char* ACPI_STRING; /* Null terminated ASCII string */
typedef void* ACPI_HANDLE; /* Actually a ptr to an NTE */
@ -268,14 +281,14 @@ typedef void* ACPI_HANDLE; /* Actually a ptr to an
/*
* Sleep state constants
*/
#define S0 (UINT8) 0
#define S1 (UINT8) 1
#define S2 (UINT8) 2
#define S3 (UINT8) 3
#define S4 (UINT8) 4
#define S4BIOS (UINT8) 5
#define S5 (UINT8) 6
#define ACPI_S_STATES_MAX S5
#define ACPI_STATE_S0 (UINT8) 0
#define ACPI_STATE_S1 (UINT8) 1
#define ACPI_STATE_S2 (UINT8) 2
#define ACPI_STATE_S3 (UINT8) 3
#define ACPI_STATE_S4 (UINT8) 4
#define ACPI_STATE_S4BIOS (UINT8) 5
#define ACPI_STATE_S5 (UINT8) 6
#define ACPI_S_STATES_MAX ACPI_STATE_S5
/*
@ -284,16 +297,16 @@ typedef void* ACPI_HANDLE; /* Actually a ptr to an
typedef UINT32 ACPI_TABLE_TYPE;
#define TABLE_RSDP (ACPI_TABLE_TYPE) 0
#define TABLE_APIC (ACPI_TABLE_TYPE) 1
#define TABLE_DSDT (ACPI_TABLE_TYPE) 2
#define TABLE_FACP (ACPI_TABLE_TYPE) 3
#define TABLE_FACS (ACPI_TABLE_TYPE) 4
#define TABLE_PSDT (ACPI_TABLE_TYPE) 5
#define TABLE_RSDT (ACPI_TABLE_TYPE) 6
#define TABLE_SSDT (ACPI_TABLE_TYPE) 7
#define TABLE_SBST (ACPI_TABLE_TYPE) 8
#define TABLE_BOOT (ACPI_TABLE_TYPE) 9
#define ACPI_TABLE_RSDP (ACPI_TABLE_TYPE) 0
#define ACPI_TABLE_APIC (ACPI_TABLE_TYPE) 1
#define ACPI_TABLE_DSDT (ACPI_TABLE_TYPE) 2
#define ACPI_TABLE_FACP (ACPI_TABLE_TYPE) 3
#define ACPI_TABLE_FACS (ACPI_TABLE_TYPE) 4
#define ACPI_TABLE_PSDT (ACPI_TABLE_TYPE) 5
#define ACPI_TABLE_RSDT (ACPI_TABLE_TYPE) 6
#define ACPI_TABLE_SSDT (ACPI_TABLE_TYPE) 7
#define ACPI_TABLE_SBST (ACPI_TABLE_TYPE) 8
#define ACPI_TABLE_BOOT (ACPI_TABLE_TYPE) 9
#define ACPI_TABLE_MAX 9
#define NUM_ACPI_TABLES 10
@ -367,33 +380,33 @@ typedef UINT8 OBJECT_TYPE_INTERNAL;
typedef UINT32 ACPI_EVENT_TYPE;
#define EVENT_FIXED (ACPI_EVENT_TYPE) 0
#define EVENT_GPE (ACPI_EVENT_TYPE) 1
#define ACPI_EVENT_FIXED (ACPI_EVENT_TYPE) 0
#define ACPI_EVENT_GPE (ACPI_EVENT_TYPE) 1
/*
* Fixed events
*/
#define EVENT_PMTIMER (ACPI_EVENT_TYPE) 0
#define ACPI_EVENT_PMTIMER (ACPI_EVENT_TYPE) 0
/*
* There's no bus master event so index 1 is used for IRQ's that are not
* handled by the SCI handler
*/
#define EVENT_NOT_USED (ACPI_EVENT_TYPE) 1
#define EVENT_GLOBAL (ACPI_EVENT_TYPE) 2
#define EVENT_POWER_BUTTON (ACPI_EVENT_TYPE) 3
#define EVENT_SLEEP_BUTTON (ACPI_EVENT_TYPE) 4
#define EVENT_RTC (ACPI_EVENT_TYPE) 5
#define EVENT_GENERAL (ACPI_EVENT_TYPE) 6
#define ACPI_EVENT_NOT_USED (ACPI_EVENT_TYPE) 1
#define ACPI_EVENT_GLOBAL (ACPI_EVENT_TYPE) 2
#define ACPI_EVENT_POWER_BUTTON (ACPI_EVENT_TYPE) 3
#define ACPI_EVENT_SLEEP_BUTTON (ACPI_EVENT_TYPE) 4
#define ACPI_EVENT_RTC (ACPI_EVENT_TYPE) 5
#define ACPI_EVENT_GENERAL (ACPI_EVENT_TYPE) 6
#define ACPI_EVENT_MAX 6
#define NUM_FIXED_EVENTS (ACPI_EVENT_TYPE) 7
#define GPE_INVALID 0xFF
#define GPE_MAX 0xFF
#define ACPI_GPE_INVALID 0xFF
#define ACPI_GPE_MAX 0xFF
#define NUM_GPE 256
#define EVENT_LEVEL_TRIGGERED (ACPI_EVENT_TYPE) 1
#define EVENT_EDGE_TRIGGERED (ACPI_EVENT_TYPE) 2
#define ACPI_EVENT_LEVEL_TRIGGERED (ACPI_EVENT_TYPE) 1
#define ACPI_EVENT_EDGE_TRIGGERED (ACPI_EVENT_TYPE) 2
/*
* AcpiEvent Status:
@ -411,8 +424,8 @@ typedef UINT32 ACPI_EVENT_TYPE;
*/
typedef UINT32 ACPI_EVENT_STATUS;
#define EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
#define EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x02
#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x02
/* Notify types */
@ -452,7 +465,7 @@ typedef union AcpiObj
{
ACPI_OBJECT_TYPE Type;
UINT32 Length; /* # of bytes in string, excluding trailing null */
char *Pointer; /* points to the string value */
INT8 *Pointer; /* points to the string value */
} String;
struct
@ -688,8 +701,8 @@ typedef struct
/*
* TBD: [Restructure]: a HID or a _UID can return either a number or a string
*/
char HardwareId [9]; /* _HID value if any */
char UniqueId[9]; /* _UID value if any */
INT8 HardwareId [9]; /* _HID value if any */
INT8 UniqueId[9]; /* _UID value if any */
UINT32 Address; /* _ADR value if any */
UINT32 CurrentStatus; /* _STA value */
} ACPI_DEVICE_INFO;
@ -709,8 +722,8 @@ typedef struct
typedef struct
{
void *HandlerContext;
char *MappedPhysicalAddress;
char *MappedLogicalAddress;
INT8 *MappedPhysicalAddress;
INT8 *MappedLogicalAddress;
UINT32 MappedLength;
} MEM_HANDLER_CONTEXT;
@ -1044,4 +1057,4 @@ typedef struct _prt_tag
* END: Definitions for PCI Routing tables
*/
#endif /* ACTYPES_H */
#endif /* __ACTYPES_H__ */

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: common.h -- prototypes for the common (subsystem-wide) procedures
* Name: accommon.h -- prototypes for the common (subsystem-wide) procedures
*
*****************************************************************************/
@ -114,8 +114,8 @@
*
*****************************************************************************/
#ifndef _COMMON_H
#define _COMMON_H
#ifndef _ACCOMMON_H
#define _ACCOMMON_H
#define REF_INCREMENT (UINT16) 0
@ -157,11 +157,11 @@ AcpiCmSubsystemShutdown (
* AcpiCmGlobal - Global data structures and procedures
*/
char *
INT8 *
AcpiCmGetMutexName (
UINT32 MutexId);
char *
INT8 *
AcpiCmGetTypeName (
UINT32 Type);
@ -178,69 +178,69 @@ AcpiCmAllocateOwnerId (
* AcpiCmClib - Local implementations of C library functions
*/
ACPI_SIZE
NATIVE_UINT
AcpiCmStrlen (
const char *String);
const INT8 *String);
char *
INT8 *
AcpiCmStrcpy (
char *DstString,
const char *SrcString);
INT8 *DstString,
const INT8 *SrcString);
char *
INT8 *
AcpiCmStrncpy (
char *DstString,
const char *SrcString,
ACPI_SIZE Count);
INT8 *DstString,
const INT8 *SrcString,
NATIVE_UINT Count);
UINT32
AcpiCmStrncmp (
const char *String1,
const char *String2,
ACPI_SIZE Count);
const INT8 *String1,
const INT8 *String2,
NATIVE_UINT Count);
UINT32
AcpiCmStrcmp (
const char *String1,
const char *String2);
const INT8 *String1,
const INT8 *String2);
char *
INT8 *
AcpiCmStrcat (
char *DstString,
const char *SrcString);
INT8 *DstString,
const INT8 *SrcString);
char *
INT8 *
AcpiCmStrncat (
char *DstString,
const char *SrcString,
ACPI_SIZE Count);
INT8 *DstString,
const INT8 *SrcString,
NATIVE_UINT Count);
UINT32
AcpiCmStrtoul (
const char *String,
char **Terminator,
const INT8 *String,
INT8 **Terminator,
INT32 Base);
char *
INT8 *
AcpiCmStrstr (
char *String1,
char *String2);
INT8 *String1,
INT8 *String2);
char *
INT8 *
AcpiCmStrupr (
char *SrcString);
INT8 *SrcString);
void *
AcpiCmMemcpy (
void *Dest,
const void *Src,
ACPI_SIZE Count);
NATIVE_UINT Count);
void *
AcpiCmMemset (
void *Dest,
INT32 Value,
ACPI_SIZE Count);
NATIVE_UINT Count);
INT32
AcpiCmToUpper (
@ -259,13 +259,13 @@ ACPI_STATUS
AcpiCmBuildSimpleObject(
ACPI_OBJECT_INTERNAL *Obj,
ACPI_OBJECT *UserObj,
char *DataSpace,
INT8 *DataSpace,
UINT32 *BufferSpaceUsed);
ACPI_STATUS
AcpiCmBuildPackageObject (
ACPI_OBJECT_INTERNAL *Obj,
char *Buffer,
INT8 *Buffer,
UINT32 *SpaceUsed);
ACPI_STATUS
@ -305,7 +305,7 @@ AcpiCmUpdateObjectReference (
ACPI_OBJECT_INTERNAL *
_CmCreateInternalObject (
char *ModuleName,
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId,
OBJECT_TYPE_INTERNAL Type);
@ -352,7 +352,7 @@ FunctionTraceStr (
INT32 LineNumber,
INT32 ComponentId,
ACPI_STRING FunctionName,
char *String);
INT8 *String);
void
FunctionExit (
@ -383,7 +383,7 @@ FunctionPtrExit (
INT32 LineNumber,
INT32 ComponentId,
ACPI_STRING FunctionName,
char *Ptr);
INT8 *Ptr);
void
DebugPrintPrefix (
@ -396,11 +396,11 @@ DebugPrint (
INT32 LineNumber,
INT32 ComponentId,
INT32 PrintLevel,
char *Format, ...);
INT8 *Format, ...);
void
DebugPrintRaw (
char *Format, ...);
INT8 *Format, ...);
void
_ReportInfo (
@ -423,16 +423,9 @@ _ReportWarning (
INT32 ComponentId,
ACPI_STRING Message);
void
_ReportSuccess (
ACPI_STRING ModuleName,
INT32 LineNumber,
INT32 ComponentId,
ACPI_STRING Message);
void
AcpiCmDumpBuffer (
char *Buffer,
INT8 *Buffer,
UINT32 Count,
UINT32 Display,
INT32 componentId);
@ -476,23 +469,23 @@ AcpiCmDeleteInternalObjectList (
ACPI_STATUS
AcpiCmEvaluateNumericObject (
char *MethodName,
NAME_TABLE_ENTRY *AcpiDevice,
INT8 *MethodName,
ACPI_NAMED_OBJECT *AcpiDevice,
UINT32 *Address);
ACPI_STATUS
AcpiCmExecute_HID (
NAME_TABLE_ENTRY *AcpiDevice,
ACPI_NAMED_OBJECT *AcpiDevice,
DEVICE_ID *Hid);
ACPI_STATUS
AcpiCmExecute_STA (
NAME_TABLE_ENTRY *AcpiDevice,
ACPI_NAMED_OBJECT *AcpiDevice,
UINT32 *StatusFlags);
ACPI_STATUS
AcpiCmExecute_UID (
NAME_TABLE_ENTRY *AcpiDevice,
ACPI_NAMED_OBJECT *AcpiDevice,
DEVICE_ID *Uid);
@ -500,7 +493,7 @@ AcpiCmExecute_UID (
* AcpiCmError - exception interfaces
*/
char *
INT8 *
AcpiCmFormatException (
ACPI_STATUS Status);
@ -543,7 +536,7 @@ AcpiCmReleaseMutex (
void *
_CmAllocateObjectDesc (
char *ModuleName,
INT8 *ModuleName,
INT32 LineNumber,
INT32 ComponentId);
@ -643,7 +636,7 @@ AcpiCmValidAcpiName (
BOOLEAN
AcpiCmValidAcpiCharacter (
char Character);
INT8 Character);
/*
@ -738,4 +731,4 @@ AcpiCmDumpCurrentAllocations (
#endif
#endif /* _COMMON_H */
#endif /* _ACCOMMON_H */

View File

@ -199,7 +199,7 @@
#define AML_IF_OP (UINT16) 0xa0
#define AML_ELSE_OP (UINT16) 0xa1
#define AML_WHILE_OP (UINT16) 0xa2
#define AML_NOOP_CODE (UINT16) 0xa3
#define AML_NOOP_OP (UINT16) 0xa3
#define AML_RETURN_OP (UINT16) 0xa4
#define AML_BREAK_OP (UINT16) 0xa5
#define AML_BREAK_POINT_OP (UINT16) 0xcc
@ -224,9 +224,9 @@
#define AML_WAIT_OP (UINT16) 0x5b25
#define AML_RESET_OP (UINT16) 0x5b26
#define AML_RELEASE_OP (UINT16) 0x5b27
#define AML_FROM_BCDOP (UINT16) 0x5b28
#define AML_TO_BCDOP (UINT16) 0x5b29
#define AML_UN_LOAD_OP (UINT16) 0x5b2a
#define AML_FROM_BCD_OP (UINT16) 0x5b28
#define AML_TO_BCD_OP (UINT16) 0x5b29
#define AML_UNLOAD_OP (UINT16) 0x5b2a
#define AML_REVISION_OP (UINT16) 0x5b30
#define AML_DEBUG_OP (UINT16) 0x5b31
#define AML_FATAL_OP (UINT16) 0x5b32
@ -466,13 +466,13 @@ typedef enum
extern UINT8 AcpiGbl_Aml [NUM_OPCODES];
extern UINT16 AcpiGbl_Pfx [NUM_OPCODES];
extern char *AcpiGbl_ShortOps [NUM_OPCODES];
extern char *AcpiGbl_LongOps [NUM_OPCODES];
extern char *AcpiGbl_RegionTypes [NUM_REGION_TYPES];
extern char *AcpiGbl_MatchOps [NUM_MATCH_OPS];
extern char *AcpiGbl_AccessTypes [NUM_ACCESS_TYPES];
extern char *AcpiGbl_UpdateRules [NUM_UPDATE_RULES];
extern char *AcpiGbl_FENames [NUM_FIELD_NAMES];
extern INT8 *AcpiGbl_ShortOps [NUM_OPCODES];
extern INT8 *AcpiGbl_LongOps [NUM_OPCODES];
extern INT8 *AcpiGbl_RegionTypes [NUM_REGION_TYPES];
extern INT8 *AcpiGbl_MatchOps [NUM_MATCH_OPS];
extern INT8 *AcpiGbl_AccessTypes [NUM_ACCESS_TYPES];
extern INT8 *AcpiGbl_UpdateRules [NUM_UPDATE_RULES];
extern INT8 *AcpiGbl_FENames [NUM_FIELD_NAMES];
/*
@ -483,7 +483,7 @@ extern char *AcpiGbl_FENames [NUM_FIELD_NAMES];
/* Data used in keeping track of fields */
char *AcpiGbl_FENames[NUM_FIELD_NAMES] =
INT8 *AcpiGbl_FENames[NUM_FIELD_NAMES] =
{
"skip",
"?access?"
@ -492,7 +492,7 @@ char *AcpiGbl_FENames[NUM_FIELD_NAMES] =
/* Region type decoding */
char *AcpiGbl_RegionTypes[NUM_REGION_TYPES] =
INT8 *AcpiGbl_RegionTypes[NUM_REGION_TYPES] =
{
"SystemMemory",
"SystemIO",
@ -502,7 +502,7 @@ char *AcpiGbl_RegionTypes[NUM_REGION_TYPES] =
};
char *AcpiGbl_MatchOps[NUM_MATCH_OPS] =
INT8 *AcpiGbl_MatchOps[NUM_MATCH_OPS] =
{
"Error",
"MTR",
@ -516,7 +516,7 @@ char *AcpiGbl_MatchOps[NUM_MATCH_OPS] =
/* Access type decoding */
char *AcpiGbl_AccessTypes[NUM_ACCESS_TYPES] =
INT8 *AcpiGbl_AccessTypes[NUM_ACCESS_TYPES] =
{
"AnyAcc",
"ByteAcc",
@ -530,7 +530,7 @@ char *AcpiGbl_AccessTypes[NUM_ACCESS_TYPES] =
/* Update rule decoding */
char *AcpiGbl_UpdateRules[NUM_UPDATE_RULES] =
INT8 *AcpiGbl_UpdateRules[NUM_UPDATE_RULES] =
{
"Preserve",
"WriteAsOnes",

View File

@ -119,23 +119,16 @@
/*
* define SYSTEM_CLIB_FUNCTIONS if linking to an actual C library.
* Otherwise, local versions of the string and memory functions will be used.
*/
/******************************************************************************
* Environment configuration. The purpose of this file is to interface to the
* local generation environment.
*
* Using native C library functions
* 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
* Otherwise, local versions of string/memory functions will be used.
* 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
* the standard header files may be used.
*
*****************************************************************************/
#ifdef SYSTEM_CLIB_FUNCTIONS
/*
* Standard C library headers.
* We want to keep these to a minimum.
*
* The ACPI subsystem only uses low level functions that do not call OS
* system services and may therefore be inlined in the code.
* The ACPI subsystem only uses low level C library functions that do not call
* operating system services and may therefore be inlined in the code.
*
* It may be necessary to tailor these include files to the target
* generation environment.
@ -162,24 +155,86 @@
*
*/
/*
* Environment-specific configuration
*/
#ifdef _LINUX
#include <linux/config.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/ctype.h>
#include <asm/system.h>
/* Single threaded */
#define ACPI_APPLICATION
/* Use native Linux string library */
#define ACPI_USE_SYSTEM_CLIBRARY
/* Special functions */
#define strtoul simple_strtoul
#else
#ifdef _AED_EFI
#include <efi.h>
#include <efistdarg.h>
#include <efilib.h>
#else
/* All other environments */
#define ACPI_USE_STANDARD_HEADERS
#endif
#endif
/******************************************************************************
*
* C library configuration
*
*****************************************************************************/
#ifdef ACPI_USE_SYSTEM_CLIBRARY
/*
* Use the standard C library headers.
* We want to keep these to a minimum.
*
*/
#ifdef ACPI_USE_STANDARD_HEADERS
/*
* Use the standard headers from the standard locations
*/
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#endif /* ACPI_USE_STANDARD_HEADERS */
/*
* We will be using the standard Clib functions
* We will be linking to the standard Clib functions
*/
#define STRSTR(s1,s2) strstr((char *) (s1), (char *) (s2))
#define STRUPR(s) strupr((char *) (s))
#define STRLEN(s) strlen((char *) (s))
#define STRCPY(d,s) strcpy((char *) (d), (char *) (s))
#define STRNCPY(d,s,n) strncpy((char *) (d), (char *) (s), (n))
#define STRNCMP(d,s,n) strncmp((char *) (d), (char *) (s), (n))
#define STRCMP(d,s) strcmp((char *) (d), (char *) (s))
#define STRCAT(d,s) strcat((char *) (d), (char *) (s))
#define STRNCAT(d,s,n) strncat((char *) (d), (char *) (s), (n))
#define STRTOUL(d,s,n) strtoul((char *) (d), (char **) (s), (n))
#define STRSTR(s1,s2) strstr((INT8 *) (s1), (INT8 *) (s2))
#define STRUPR(s) strupr((INT8 *) (s))
#define STRLEN(s) strlen((INT8 *) (s))
#define STRCPY(d,s) strcpy((INT8 *) (d), (INT8 *) (s))
#define STRNCPY(d,s,n) strncpy((INT8 *) (d), (INT8 *) (s), (n))
#define STRNCMP(d,s,n) strncmp((INT8 *) (d), (INT8 *) (s), (n))
#define STRCMP(d,s) strcmp((INT8 *) (d), (INT8 *) (s))
#define STRCAT(d,s) strcat((INT8 *) (d), (INT8 *) (s))
#define STRNCAT(d,s,n) strncat((INT8 *) (d), (INT8 *) (s), (n))
#define STRTOUL(d,s,n) strtoul((INT8 *) (d), (INT8 **) (s), (n))
#define MEMCPY(d,s,n) memcpy(d, s, (size_t) n)
#define MEMSET(d,s,n) memset(d, s, (size_t) n)
#define TOUPPER toupper
@ -219,29 +274,31 @@ typedef char *va_list;
*/
#define _Bnd(X, bnd) (((sizeof(X)) + (bnd)) & (~(bnd)))
#define va_arg(ap, T) (*(T *)(((ap) += ((_Bnd(T, _AUPBND))) - (_Bnd(T, _ADNBND)))))
#define va_arg(ap, T) (*(T *)(((ap) += ((_Bnd(T, _AUPBND))) \
- (_Bnd(T, _ADNBND)))))
#define va_end(ap) (void)0
#define va_start(ap, A) (void) ((ap) = (((char *)&(A)) + (_Bnd(A, _AUPBND))))
#define va_start(ap, A) (void) ((ap) = (((INT8 *)&(A)) \
+ (_Bnd(A, _AUPBND))))
#endif /* va_arg */
#define STRSTR(s1,s2) AcpiCmStrstr ((char *) (s1), (char *) (s2))
#define STRUPR(s) AcpiCmStrupr ((char *) (s))
#define STRLEN(s) AcpiCmStrlen ((char *) (s))
#define STRCPY(d,s) AcpiCmStrcpy ((char *) (d), (char *) (s))
#define STRNCPY(d,s,n) AcpiCmStrncpy ((char *) (d), (char *) (s), (n))
#define STRNCMP(d,s,n) AcpiCmStrncmp ((char *) (d), (char *) (s), (n))
#define STRCMP(d,s) AcpiCmStrcmp ((char *) (d), (char *) (s))
#define STRCAT(d,s) AcpiCmStrcat ((char *) (d), (char *) (s))
#define STRNCAT(d,s,n) AcpiCmStrncat ((char *) (d), (char *) (s), (n))
#define STRTOUL(d,s,n) AcpiCmStrtoul ((char *) (d), (char **) (s), (n))
#define STRSTR(s1,s2) AcpiCmStrstr ((INT8 *) (s1), (INT8 *) (s2))
#define STRUPR(s) AcpiCmStrupr ((INT8 *) (s))
#define STRLEN(s) AcpiCmStrlen ((INT8 *) (s))
#define STRCPY(d,s) AcpiCmStrcpy ((INT8 *) (d), (INT8 *) (s))
#define STRNCPY(d,s,n) AcpiCmStrncpy ((INT8 *) (d), (INT8 *) (s), (n))
#define STRNCMP(d,s,n) AcpiCmStrncmp ((INT8 *) (d), (INT8 *) (s), (n))
#define STRCMP(d,s) AcpiCmStrcmp ((INT8 *) (d), (INT8 *) (s))
#define STRCAT(d,s) AcpiCmStrcat ((INT8 *) (d), (INT8 *) (s))
#define STRNCAT(d,s,n) AcpiCmStrncat ((INT8 *) (d), (INT8 *) (s), (n))
#define STRTOUL(d,s,n) AcpiCmStrtoul ((INT8 *) (d), (INT8 **) (s), (n))
#define MEMCPY(d,s,n) AcpiCmMemcpy ((void *) (d), (const void *) (s), (n))
#define MEMSET(d,v,n) AcpiCmMemset ((void *) (d), (v), (n))
#define TOUPPER AcpiCmToUpper
#define TOLOWER AcpiCmToLower
#endif /* LOCAL_CLIB_FUNCTIONS */
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
/******************************************************************************
@ -260,6 +317,9 @@ typedef char *va_list;
#ifdef WIN32 /* MS VC */
/*! [Begin] no source code translation */
#define ACPI_ASM_MACROS
#define causeinterrupt(level) __asm {int level}
#define BREAKPOINT3 __asm {int 3}
#define disable() __asm {cli}
@ -268,7 +328,7 @@ typedef char *va_list;
#define wbinvd() __asm {WBINVD}
#define ASM_AcquireGL(GLptr, Acq) __asm { \
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) __asm { \
__asm mov ecx, GLptr \
\
__asm acq10: \
@ -285,7 +345,7 @@ typedef char *va_list;
__asm mov Acq, al \
}
#define ASM_ReleaseGL(GLptr, Pnd) __asm { \
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pnd) __asm { \
__asm mov ecx, GLptr \
\
__asm Rel10: \
@ -300,18 +360,29 @@ typedef char *va_list;
__asm mov Pnd, al \
}
/*! [End] no source code translation !*/
#elif defined(__GNUC__)
#endif /* WIN32 */
#ifdef __GNUC__
#ifdef __ia64__
#define _IA64
#endif
#define ACPI_ASM_MACROS
#define causeinterrupt(level)
#define BREAKPOINT3
#define disable() __asm ("cli")
#define enable() __asm ("sti")
#define halt() __asm ("hlt")
#define wbinvd() __asm ("wbinvd")
#define disable() __cli()
#define enable() __sti()
#define halt() __asm__ __volatile__ ("sti; hlt":::"memory")
#define wbinvd()
/*
/*! [Begin] no source code translation
*
* A brief explanation as GNU inline assembly is a bit hairy
* %0 is the output parameter in EAX ("=a")
* %1 and %2 are the input parameters in ECX ("c") and an immediate value ("i") respectively
@ -319,44 +390,58 @@ typedef char *va_list;
* Immediate values in the assembly are preceded by "$" as in "$0x1"
* The final asm parameter is the non-output registers altered by the operation
*/
#define ASM_AcquireGL(GLptr, Acq) \
asm("1: movl (%1),%%eax;" \
"movl %%eax,%%edx;" \
"andl %2,%%edx;" \
"btsl $0x1,%%edx;" \
"adcl $0x0,%%edx;" \
"lock; cmpxchgl %%edx,(%1);" \
"jnz 1b;" \
\
"cmpb $0x3,%%dl;" \
"sbbl %%eax,%%eax" \
:"=a"(Acq):"c"(GLptr),"i"(~1L):"cx","dx")
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
do { \
int dummy; \
asm("1: movl (%1),%%eax;" \
"movl %%eax,%%edx;" \
"andl %2,%%edx;" \
"btsl $0x1,%%edx;" \
"adcl $0x0,%%edx;" \
"lock; cmpxchgl %%edx,(%1);" \
"jnz 1b;" \
"cmpb $0x3,%%dl;" \
"sbbl %%eax,%%eax" \
:"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx"); \
} while(0)
#define ASM_ReleaseGL(GLptr, Acq) \
asm("1: movl (%1),%%eax;" \
"movl %%eax,%%edx;" \
"andl %2,%%edx;" \
"lock; cmpxchgl %%edx,(%1);" \
"jnz 1b;" \
\
"andl $0x1,%%eax" \
:"=a"(Acq):"c"(GLptr),"i"(~3L):"cx","dx")
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
do { \
int dummy; \
asm("1: movl (%1),%%eax;" \
"movl %%eax,%%edx;" \
"andl %2,%%edx;" \
"lock; cmpxchgl %%edx,(%1);" \
"jnz 1b;" \
"andl $0x1,%%eax" \
:"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \
} while(0)
/*! [End] no source code translation !*/
#endif /* __GNUC__ */
#else
#ifndef ACPI_ASM_MACROS
/* Unrecognized compiler, use defaults */
#define ACPI_ASM_MACROS
#define causeinterrupt(level)
#define BREAKPOINT3
#define disable()
#define enable()
#define halt()
#define ASM_AcquireGL(GLptr, Acq)
#define ASM_ReleaseGL(GLptr, Acq)
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)
#endif /* ACPI_ASM_MACROS */
#endif
#ifdef ACPI_APPLICATION
/* Don't want software interrupts within a ring3 application */
#undef causeinterrupt
#undef BREAKPOINT3
#define causeinterrupt(level)
@ -364,15 +449,16 @@ typedef char *va_list;
#endif
#ifdef _MSC_VER /* disable some level-4 warnings */
/******************************************************************************
*
* Compiler-specific
*
*****************************************************************************/
#ifdef _MSC_VER /* disable some level-4 warnings */
#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
#pragma warning(disable:4127) /* warning C4127: conditional expression is constant */
#pragma warning(disable:4100) /* warn C4100: unreferenced formal parameter */
#pragma warning(disable:4127) /* warn C4127: conditional expression is constant */
#endif