Build fixes for NetBSD.

This commit is contained in:
jmcneill 2009-08-18 16:26:10 +00:00
parent 70fe0f31af
commit 2e3763cf26
39 changed files with 158 additions and 147 deletions

View File

@ -1770,7 +1770,7 @@ GetCrs:
* Perform comparison of original AML to newly created AML. This tests both
* the AML->Resource conversion and the Resource->Aml conversion.
*/
Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS);
Status = AcpiDmTestResourceConversion (Node, __UNCONST(METHOD_NAME__CRS));
/* Execute _SRS with the resource list */

View File

@ -237,7 +237,7 @@ AcpiDbExecuteMethod (
Params[1].Type = ACPI_TYPE_STRING;
Params[1].String.Length = 12;
Params[1].String.Pointer = "AML Debugger";
Params[1].String.Pointer = __UNCONST("AML Debugger");
break;
default:

View File

@ -799,7 +799,7 @@ AcpiDbCommandDispatch (
break;
case CMD_METHODS:
Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]);
Status = AcpiDbDisplayObjects (__UNCONST("METHOD"), AcpiGbl_DbArgs[1]);
break;
case CMD_NAMESPACE:

View File

@ -138,7 +138,7 @@ AcpiDbDumpBuffer (
UINT32 Address);
#endif
static char *Converter = "0123456789ABCDEF";
static const char *Converter = "0123456789ABCDEF";
/*******************************************************************************

View File

@ -222,7 +222,7 @@ AcpiDmDescriptorName (
void
AcpiDmDumpInteger8 (
UINT8 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%2.2X, // %s\n", Value, Name);
}
@ -230,7 +230,7 @@ AcpiDmDumpInteger8 (
void
AcpiDmDumpInteger16 (
UINT16 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%4.4X, // %s\n", Value, Name);
}
@ -238,7 +238,7 @@ AcpiDmDumpInteger16 (
void
AcpiDmDumpInteger32 (
UINT32 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%8.8X, // %s\n", Value, Name);
}
@ -246,7 +246,7 @@ AcpiDmDumpInteger32 (
void
AcpiDmDumpInteger64 (
UINT64 Value,
char *Name)
const char *Name)
{
AcpiOsPrintf ("0x%8.8X%8.8X, // %s\n", ACPI_FORMAT_UINT64 (Value), Name);
}

View File

@ -127,7 +127,7 @@
/* Common names for address and memory descriptors */
static char *AcpiDmAddressNames[] =
static const char *AcpiDmAddressNames[] =
{
"Granularity",
"Range Minimum",
@ -136,7 +136,7 @@ static char *AcpiDmAddressNames[] =
"Length"
};
static char *AcpiDmMemoryNames[] =
static const char *AcpiDmMemoryNames[] =
{
"Range Minimum",
"Range Maximum",
@ -1067,7 +1067,7 @@ AcpiDmInterruptDescriptor (
void
AcpiDmVendorCommon (
char *Name,
const char *Name,
UINT8 *ByteData,
UINT32 Length,
UINT32 Level)

View File

@ -1564,7 +1564,7 @@ AcpiDsExecEndControlOp (
/* Call to the OSL in case OS wants a piece of the action */
Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
"Executed AML Breakpoint opcode");
__UNCONST("Executed AML Breakpoint opcode"));
break;

View File

@ -638,7 +638,7 @@ AcpiEvInitializeRegion (
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *MethodNode;
ACPI_NAME *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;
ACPI_NAME *RegNamePtr = (ACPI_NAME *) __UNCONST(METHOD_NAME__REG);
ACPI_OPERAND_OBJECT *RegionObj2;

View File

@ -134,12 +134,12 @@
static void
AcpiExOutString (
char *Title,
char *Value);
const char *Title,
const char *Value);
static void
AcpiExOutPointer (
char *Title,
const char *Title,
void *Value);
static void
@ -441,7 +441,7 @@ AcpiExDumpObject (
while (Count)
{
Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset);
Name = Info->Name;
Name = __UNCONST(Info->Name);
switch (Info->Opcode)
{
@ -902,15 +902,15 @@ AcpiExDumpOperands (
static void
AcpiExOutString (
char *Title,
char *Value)
const char *Title,
const char *Value)
{
AcpiOsPrintf ("%20s : %s\n", Title, Value);
}
static void
AcpiExOutPointer (
char *Title,
const char *Title,
void *Value)
{
AcpiOsPrintf ("%20s : %p\n", Title, Value);

View File

@ -121,7 +121,7 @@
typedef struct CommandInfo
{
char *Name; /* Command Name */
const char *Name; /* Command Name */
UINT8 MinArgs; /* Minimum arguments required */
} COMMAND_INFO;
@ -129,7 +129,7 @@ typedef struct CommandInfo
typedef struct ArgumentInfo
{
char *Name; /* Argument Name */
const char *Name; /* Argument Name */
} ARGUMENT_INFO;

View File

@ -123,7 +123,7 @@
#define BLOCK_PAREN 1
#define BLOCK_BRACE 2
#define BLOCK_COMMA_LIST 4
#define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD"
#define ACPI_DEFAULT_RESNAME *(const UINT32 *) "__RD"
typedef struct acpi_external_list
{
@ -560,22 +560,22 @@ AcpiDmIsStringBuffer (
void
AcpiDmDumpInteger8 (
UINT8 Value,
char *Name);
const char *Name);
void
AcpiDmDumpInteger16 (
UINT16 Value,
char *Name);
const char *Name);
void
AcpiDmDumpInteger32 (
UINT32 Value,
char *Name);
const char *Name);
void
AcpiDmDumpInteger64 (
UINT64 Value,
char *Name);
const char *Name);
void
AcpiDmResourceTemplate (
@ -670,7 +670,7 @@ AcpiDmVendorLargeDescriptor (
void
AcpiDmVendorCommon (
char *Name,
const char *Name,
UINT8 *ByteData,
UINT32 Length,
UINT32 Level);

View File

@ -141,7 +141,7 @@ typedef const struct acpi_exdump_info
{
UINT8 Opcode;
UINT8 Offset;
char *Name;
const char *Name;
} ACPI_EXDUMP_INFO;

View File

@ -170,7 +170,7 @@ union acpi_parse_object;
/* Debug names for the mutexes above */
static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
static const char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
{
"ACPI_MTX_Interpreter",
"ACPI_MTX_Namespace",
@ -839,7 +839,7 @@ ACPI_STATUS (*ACPI_EXECUTE_OP) (
typedef struct acpi_opcode_info
{
#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
char *Name; /* Opcode name (disassembler/debug only) */
const char *Name; /* Opcode name (disassembler/debug only) */
#endif
UINT32 ParseArgs; /* Grammar/Parse time arguments */
UINT32 RuntimeArgs; /* Interpret time arguments */
@ -1132,14 +1132,14 @@ typedef struct acpi_bit_register_info
typedef struct acpi_interface_info
{
char *Name;
const char *Name;
UINT8 Value;
} ACPI_INTERFACE_INFO;
typedef struct acpi_port_info
{
char *Name;
const char *Name;
UINT16 Start;
UINT16 End;
UINT8 OsiDependency;

View File

@ -162,31 +162,31 @@
/* Hi...Lo Lo...Hi */
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[0];}
#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[1];\
(( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[0];}
#define ACPI_MOVE_16_TO_32(d, s) {(*(UINT32 *)(void *)(d))=0;\
((UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\
((UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];}
((UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[1];\
((UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[0];}
#define ACPI_MOVE_16_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\
((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
((UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[1];\
((UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[0];}
/* 32-bit source, 16/32/64 destination */
#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];}
#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[3];\
(( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[2];\
(( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[1];\
(( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[0];}
#define ACPI_MOVE_32_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\
((UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\
((UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\
((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
((UINT8 *)(void *)(d))[4] = ((const UINT8 *)(const void *)(s))[3];\
((UINT8 *)(void *)(d))[5] = ((const UINT8 *)(const void *)(s))[2];\
((UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[1];\
((UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[0];}
/* 64-bit source, 16/32/64 destination */
@ -194,14 +194,14 @@
#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[5];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[4];\
(( UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\
(( UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[7];\
(( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[6];\
(( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[5];\
(( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[4];\
(( UINT8 *)(void *)(d))[4] = ((const UINT8 *)(const void *)(s))[3];\
(( UINT8 *)(void *)(d))[5] = ((const UINT8 *)(const void *)(s))[2];\
(( UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[1];\
(( UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[0];}
#else
/*
* Macros for little-endian machines
@ -213,21 +213,21 @@
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d, s) *(UINT16 *)(void *)(d) = *(UINT16 *)(void *)(s)
#define ACPI_MOVE_16_TO_32(d, s) *(UINT32 *)(void *)(d) = *(UINT16 *)(void *)(s)
#define ACPI_MOVE_16_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT16 *)(void *)(s)
#define ACPI_MOVE_16_TO_16(d, s) *(UINT16 *)(void *)(d) = *(const UINT16 *)(const void *)(s)
#define ACPI_MOVE_16_TO_32(d, s) *(UINT32 *)(void *)(d) = *(const UINT16 *)(const void *)(s)
#define ACPI_MOVE_16_TO_64(d, s) *(UINT64 *)(void *)(d) = *(const UINT16 *)(const void *)(s)
/* 32-bit source, 16/32/64 destination */
#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_32_TO_32(d, s) *(UINT32 *)(void *)(d) = *(UINT32 *)(void *)(s)
#define ACPI_MOVE_32_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT32 *)(void *)(s)
#define ACPI_MOVE_32_TO_32(d, s) *(UINT32 *)(void *)(d) = *(const UINT32 *)(const void *)(s)
#define ACPI_MOVE_32_TO_64(d, s) *(UINT64 *)(void *)(d) = *(const UINT32 *)(const void *)(s)
/* 64-bit source, 16/32/64 destination */
#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT64 *)(void *)(s)
#define ACPI_MOVE_64_TO_64(d, s) *(UINT64 *)(void *)(d) = *(const UINT64 *)(const void *)(s)
#else
/*
@ -238,8 +238,8 @@
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[1];}
#define ACPI_MOVE_16_TO_32(d, s) {(*(UINT32 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);}
#define ACPI_MOVE_16_TO_64(d, s) {(*(UINT64 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);}
@ -248,10 +248,10 @@
#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[3];}
#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[1];\
(( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[2];\
(( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[3];}
#define ACPI_MOVE_32_TO_64(d, s) {(*(UINT64 *)(void *)(d)) = 0; ACPI_MOVE_32_TO_32(d, s);}
@ -259,14 +259,14 @@
#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[3];\
(( UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[4];\
(( UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[5];\
(( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[6];\
(( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[7];}
#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((const UINT8 *)(const void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((const UINT8 *)(const void *)(s))[1];\
(( UINT8 *)(void *)(d))[2] = ((const UINT8 *)(const void *)(s))[2];\
(( UINT8 *)(void *)(d))[3] = ((const UINT8 *)(const void *)(s))[3];\
(( UINT8 *)(void *)(d))[4] = ((const UINT8 *)(const void *)(s))[4];\
(( UINT8 *)(void *)(d))[5] = ((const UINT8 *)(const void *)(s))[5];\
(( UINT8 *)(void *)(d))[6] = ((const UINT8 *)(const void *)(s))[6];\
(( UINT8 *)(void *)(d))[7] = ((const UINT8 *)(const void *)(s))[7];}
#endif
#endif

View File

@ -290,7 +290,7 @@ AcpiNsDumpEntry (
void
AcpiNsDumpPathname (
ACPI_HANDLE Handle,
char *Msg,
const char *Msg,
UINT32 Level,
UINT32 Component);

View File

@ -289,7 +289,7 @@ AcpiOsGetPhysicalAddress (
*/
ACPI_STATUS
AcpiOsCreateCache (
char *CacheName,
const char *CacheName,
UINT16 ObjectSize,
UINT16 MaxDepth,
ACPI_CACHE_T **ReturnCache);

View File

@ -234,13 +234,13 @@ AcpiLoadTables (
ACPI_STATUS
AcpiGetTableHeader (
ACPI_STRING Signature,
ACPI_CONST_STRING Signature,
UINT32 Instance,
ACPI_TABLE_HEADER *OutTableHeader);
ACPI_STATUS
AcpiGetTable (
ACPI_STRING Signature,
ACPI_CONST_STRING Signature,
UINT32 Instance,
ACPI_TABLE_HEADER **OutTable);
@ -287,7 +287,7 @@ AcpiGetName (
ACPI_STATUS
AcpiGetHandle (
ACPI_HANDLE Parent,
ACPI_STRING Pathname,
ACPI_CONST_STRING Pathname,
ACPI_HANDLE *RetHandle);
ACPI_STATUS
@ -321,14 +321,14 @@ AcpiDebugTrace (
ACPI_STATUS
AcpiEvaluateObject (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_CONST_STRING Pathname,
ACPI_OBJECT_LIST *ParameterObjects,
ACPI_BUFFER *ReturnObjectBuffer);
ACPI_STATUS
AcpiEvaluateObjectTyped (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_CONST_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer,
ACPI_OBJECT_TYPE ReturnType);
@ -544,7 +544,7 @@ AcpiGetPossibleResources(
ACPI_STATUS
AcpiWalkResources (
ACPI_HANDLE DeviceHandle,
char *Name,
const char *Name,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
void *Context);

View File

@ -186,8 +186,8 @@ typedef const struct acpi_rsdump_info
{
UINT8 Opcode;
UINT8 Offset;
char *Name;
const char **Pointer;
const char *Name;
const char * const *Pointer;
} ACPI_RSDUMP_INFO;

View File

@ -233,7 +233,7 @@ AcpiTbVerifyChecksum (
void
AcpiTbInstallTable (
ACPI_PHYSICAL_ADDRESS Address,
char *Signature,
const char *Signature,
UINT32 TableIndex);
ACPI_STATUS

View File

@ -447,6 +447,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */
typedef UINT32 ACPI_NAME; /* 4-byte ACPI name */
typedef char * ACPI_STRING; /* Null terminated ASCII string */
typedef const char * ACPI_CONST_STRING; /* Null terminated ASCII string */
typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */
@ -978,9 +979,9 @@ typedef struct acpi_buffer
*/
typedef struct acpi_predefined_names
{
char *Name;
const char *Name;
UINT8 Type;
char *Val;
const char *Val;
} ACPI_PREDEFINED_NAMES;

View File

@ -195,7 +195,7 @@ AcpiUtInitGlobals (
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
char *
const char *
AcpiUtGetMutexName (
UINT32 MutexId);
@ -542,13 +542,13 @@ AcpiUtOsiImplementation (
ACPI_STATUS
AcpiUtEvaluateObject (
ACPI_NAMESPACE_NODE *PrefixNode,
char *Path,
const char *Path,
UINT32 ExpectedReturnBtypes,
ACPI_OPERAND_OBJECT **ReturnDesc);
ACPI_STATUS
AcpiUtEvaluateNumericObject (
char *ObjectName,
const char *ObjectName,
ACPI_NAMESPACE_NODE *DeviceNode,
ACPI_INTEGER *Value);
@ -812,7 +812,7 @@ void
AcpiUtDisplayInitPathname (
UINT8 Type,
ACPI_NAMESPACE_NODE *ObjHandle,
char *Path);
const char *Path);
#endif
@ -940,7 +940,7 @@ AcpiUtDumpAllocations (
ACPI_STATUS
AcpiUtCreateList (
char *ListName,
const char *ListName,
UINT16 ObjectSize,
ACPI_MEMORY_LIST **ReturnCache);

View File

@ -1,6 +1,7 @@
/******************************************************************************
*
* Name: acnetbsd.h - OS specific defines, etc.
* $Revision: 1.2 $
*
*****************************************************************************/
@ -8,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp.
* All rights reserved.
*
* 2. License
@ -120,6 +121,10 @@
#include "acgcc.h"
#define ACPI_THREAD_ID uintptr_t
#define ACPI_UINTPTR_T uintptr_t
#define ACPI_USE_LOCAL_CACHE
#ifdef _LP64
#define ACPI_MACHINE_WIDTH 64
#else
@ -129,18 +134,22 @@
#define COMPILER_DEPENDENT_INT64 int64_t
#define COMPILER_DEPENDENT_UINT64 uint64_t
#if defined(_KERNEL) || defined(_STANDALONE)
#ifdef _KERNEL
#include "opt_acpi.h" /* collect build-time options here */
#endif /* _KERNEL */
#include <sys/param.h>
#include <sys/systm.h>
#include <machine/stdarg.h>
#include <machine/acpi_func.h>
#include <dev/acpi/acpica/acpi_func.h>
#define asm __asm
#define ACPI_USE_NATIVE_DIVIDE
#define ACPI_ASM_MACROS /* tell acenv.h */
#define ACPI_SYSTEM_XFACE
#define ACPI_EXTERNAL_XFACE
#define ACPI_INTERNAL_XFACE
@ -166,7 +175,7 @@ isprint(int ch)
return(isspace(ch) || isascii(ch));
}
#else /* _KERNEL */
#else /* defined(_KERNEL) || defined(_STANDALONE) */
#include <ctype.h>
@ -179,7 +188,7 @@ isprint(int ch)
/* XXX */
#define __inline inline
#endif /* _KERNEL */
#endif /* defined(_KERNEL) || defined(_STANDALONE) */
/* Always use NetBSD code over our local versions */
#define ACPI_USE_SYSTEM_CLIBRARY

View File

@ -190,7 +190,7 @@ AcpiNsRootInitialize (
continue;
}
Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type,
Status = AcpiNsLookup (NULL, __UNCONST(InitVal->Name), InitVal->Type,
ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
NULL, &NewNode);
@ -217,7 +217,7 @@ AcpiNsRootInitialize (
if (!Val)
{
Val = InitVal->Val;
Val = __UNCONST(InitVal->Val);
}
/*
@ -453,7 +453,7 @@ AcpiNsLookup (
NumSegments = 0;
ThisNode = AcpiGbl_RootNode;
Path = "";
Path = __UNCONST("");
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Null Pathname (Zero segments), Flags=%X\n", Flags));

View File

@ -214,7 +214,7 @@ AcpiNsPrintPathname (
void
AcpiNsDumpPathname (
ACPI_HANDLE Handle,
char *Msg,
const char *Msg,
UINT32 Level,
UINT32 Component)
{

View File

@ -665,7 +665,7 @@ AcpiNsInitOneDevice (
ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI));
Info->PrefixNode = DeviceNode;
Info->Pathname = METHOD_NAME__INI;
Info->Pathname = __UNCONST(METHOD_NAME__INI);
Info->Parameters = NULL;
Info->Flags = ACPI_IGNORE_RETURN_VALUE;

View File

@ -157,7 +157,7 @@ AcpiNsResolveReferences (
ACPI_STATUS
AcpiEvaluateObjectTyped (
ACPI_HANDLE Handle,
ACPI_STRING Pathname,
ACPI_CONST_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer,
ACPI_OBJECT_TYPE ReturnType)
@ -165,7 +165,6 @@ AcpiEvaluateObjectTyped (
ACPI_STATUS Status;
BOOLEAN MustFree = FALSE;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@ -256,7 +255,7 @@ ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped)
ACPI_STATUS
AcpiEvaluateObject (
ACPI_HANDLE Handle,
ACPI_STRING Pathname,
ACPI_CONST_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer)
{
@ -277,7 +276,7 @@ AcpiEvaluateObject (
return_ACPI_STATUS (AE_NO_MEMORY);
}
Info->Pathname = Pathname;
Info->Pathname = __UNCONST(Pathname);
/* Convert and validate the device handle */

View File

@ -156,12 +156,13 @@ AcpiNsCopyDeviceId (
ACPI_STATUS
AcpiGetHandle (
ACPI_HANDLE Parent,
ACPI_STRING Pathname,
ACPI_CONST_STRING Pathname,
ACPI_HANDLE *RetHandle)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node = NULL;
ACPI_NAMESPACE_NODE *PrefixNode = NULL;
ACPI_STRING UPathname = __UNCONST(Pathname);
ACPI_FUNCTION_ENTRY ();
@ -192,13 +193,13 @@ AcpiGetHandle (
*
* Error for <null Parent + relative path>
*/
if (AcpiNsValidRootPrefix (Pathname[0]))
if (AcpiNsValidRootPrefix (UPathname[0]))
{
/* Pathname is fully qualified (starts with '\') */
/* Special case for root-only, since we can't search for it */
if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH))
if (!ACPI_STRCMP (UPathname, ACPI_NS_ROOT_PATH))
{
*RetHandle = AcpiNsConvertEntryToHandle (AcpiGbl_RootNode);
return (AE_OK);
@ -213,7 +214,7 @@ AcpiGetHandle (
/* Find the Node and convert to a handle */
Status = AcpiNsGetNode (PrefixNode, Pathname, ACPI_NS_NO_UPSEARCH, &Node);
Status = AcpiNsGetNode (PrefixNode, UPathname, ACPI_NS_NO_UPSEARCH, &Node);
if (ACPI_SUCCESS (Status))
{
*RetHandle = AcpiNsConvertEntryToHandle (Node);

View File

@ -554,10 +554,10 @@ AcpiPsGetOpcodeName (
/* Always guaranteed to return a valid pointer */
return (Op->Name);
return __UNCONST(Op->Name);
#else
return ("OpcodeName unavailable");
return __UNCONST("OpcodeName unavailable");
#endif
}

View File

@ -822,7 +822,7 @@ AcpiRsSetSrsMethodData (
}
Info->PrefixNode = Node;
Info->Pathname = METHOD_NAME__SRS;
Info->Pathname = __UNCONST(METHOD_NAME__SRS);
Info->Parameters = Args;
Info->Flags = ACPI_IGNORE_RETURN_VALUE;

View File

@ -632,7 +632,7 @@ AcpiRsMatchVendorResource (
ACPI_STATUS
AcpiWalkResources (
ACPI_HANDLE DeviceHandle,
char *Name,
const char *Name,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
void *Context)
{
@ -640,7 +640,7 @@ AcpiWalkResources (
ACPI_BUFFER Buffer;
ACPI_RESOURCE *Resource;
ACPI_RESOURCE *ResourceEnd;
char *UName = __UNCONST(Name);
ACPI_FUNCTION_TRACE (AcpiWalkResources);
@ -648,8 +648,8 @@ AcpiWalkResources (
/* Parameter validation */
if (!DeviceHandle || !UserFunction || !Name ||
(!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) &&
!ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS)))
(!ACPI_COMPARE_NAME (UName, METHOD_NAME__CRS) &&
!ACPI_COMPARE_NAME (UName, METHOD_NAME__PRS)))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@ -657,7 +657,7 @@ AcpiWalkResources (
/* Get the _CRS or _PRS resource list */
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer);
Status = AcpiRsGetMethodData (DeviceHandle, UName, &Buffer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);

View File

@ -148,7 +148,7 @@ AcpiTbSetupFadtRegisters (
typedef struct acpi_fadt_info
{
char *Name;
const char *Name;
UINT8 Address64;
UINT8 Address32;
UINT8 Length;
@ -566,7 +566,7 @@ static void
AcpiTbValidateFadt (
void)
{
char *Name;
const char *Name;
ACPI_GENERIC_ADDRESS *Address64;
UINT8 Length;
UINT32 i;

View File

@ -414,7 +414,7 @@ AcpiTbChecksum (
void
AcpiTbInstallTable (
ACPI_PHYSICAL_ADDRESS Address,
char *Signature,
const char *Signature,
UINT32 TableIndex)
{
UINT8 Flags;

View File

@ -323,14 +323,14 @@ ACPI_EXPORT_SYMBOL (AcpiReallocateRootTable)
ACPI_STATUS
AcpiGetTableHeader (
char *Signature,
ACPI_CONST_STRING Signature,
UINT32 Instance,
ACPI_TABLE_HEADER *OutTableHeader)
{
UINT32 i;
UINT32 j;
ACPI_TABLE_HEADER *Header;
ACPI_STRING USignature = __UNCONST(Signature);
/* Parameter validation */
@ -344,7 +344,7 @@ AcpiGetTableHeader (
for (i = 0, j = 0; i < AcpiGbl_RootTableList.Count; i++)
{
if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
Signature))
USignature))
{
continue;
}
@ -408,14 +408,14 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader)
ACPI_STATUS
AcpiGetTable (
char *Signature,
ACPI_CONST_STRING Signature,
UINT32 Instance,
ACPI_TABLE_HEADER **OutTable)
{
UINT32 i;
UINT32 j;
ACPI_STATUS Status;
ACPI_STRING USignature = __UNCONST(Signature);
/* Parameter validation */
@ -429,7 +429,7 @@ AcpiGetTable (
for (i = 0, j = 0; i < AcpiGbl_RootTableList.Count; i++)
{
if (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
Signature))
USignature))
{
continue;
}

View File

@ -140,7 +140,7 @@
ACPI_STATUS
AcpiOsCreateCache (
char *CacheName,
const char *CacheName,
UINT16 ObjectSize,
UINT16 MaxDepth,
ACPI_MEMORY_LIST **ReturnCache)
@ -168,7 +168,7 @@ AcpiOsCreateCache (
ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST));
Cache->LinkOffset = 8;
Cache->ListName = CacheName;
Cache->ListName = __UNCONST(CacheName);
Cache->ObjectSize = ObjectSize;
Cache->MaxDepth = MaxDepth;

View File

@ -125,8 +125,8 @@
#ifdef ACPI_DEBUG_OUTPUT
static ACPI_THREAD_ID AcpiGbl_PrevThreadId = (ACPI_THREAD_ID) 0xFFFFFFFF;
static char *AcpiGbl_FnEntryStr = "----Entry";
static char *AcpiGbl_FnExitStr = "----Exit-";
static const char *AcpiGbl_FnEntryStr = "----Entry";
static const char *AcpiGbl_FnExitStr = "----Exit-";
/* Local prototypes */

View File

@ -276,13 +276,14 @@ Exit:
ACPI_STATUS
AcpiUtEvaluateObject (
ACPI_NAMESPACE_NODE *PrefixNode,
char *Path,
const char *Path,
UINT32 ExpectedReturnBtypes,
ACPI_OPERAND_OBJECT **ReturnDesc)
{
ACPI_EVALUATE_INFO *Info;
ACPI_STATUS Status;
UINT32 ReturnBtype;
char *UPath = __UNCONST(Path);
ACPI_FUNCTION_TRACE (UtEvaluateObject);
@ -297,7 +298,7 @@ AcpiUtEvaluateObject (
}
Info->PrefixNode = PrefixNode;
Info->Pathname = Path;
Info->Pathname = UPath;
/* Evaluate the object/method */
@ -307,7 +308,7 @@ AcpiUtEvaluateObject (
if (Status == AE_NOT_FOUND)
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s.%s] was not found\n",
AcpiUtGetNodeName (PrefixNode), Path));
AcpiUtGetNodeName (PrefixNode), UPath));
}
else
{
@ -418,7 +419,7 @@ Cleanup:
ACPI_STATUS
AcpiUtEvaluateNumericObject (
char *ObjectName,
const char *ObjectName,
ACPI_NAMESPACE_NODE *DeviceNode,
ACPI_INTEGER *Value)
{

View File

@ -419,11 +419,11 @@ AcpiUtGetRegionName (
if (SpaceId >= ACPI_USER_REGION_BEGIN)
{
return ("UserDefinedRegion");
return __UNCONST("UserDefinedRegion");
}
else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
{
return ("InvalidSpaceId");
return __UNCONST("InvalidSpaceId");
}
return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
@ -461,7 +461,7 @@ AcpiUtGetEventName (
if (EventId > ACPI_EVENT_MAX)
{
return ("InvalidEventID");
return __UNCONST("InvalidEventID");
}
return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
@ -549,7 +549,7 @@ AcpiUtGetObjectTypeName (
if (!ObjDesc)
{
return ("[NULL Object Descriptor]");
return __UNCONST("[NULL Object Descriptor]");
}
return (AcpiUtGetTypeName (ObjDesc->Common.Type));
@ -579,7 +579,7 @@ AcpiUtGetNodeName (
if (!Object)
{
return ("NULL");
return __UNCONST("NULL");
}
/* Check for Root node */
@ -587,14 +587,14 @@ AcpiUtGetNodeName (
if ((Object == ACPI_ROOT_OBJECT) ||
(Object == AcpiGbl_RootNode))
{
return ("\"\\\" ");
return __UNCONST("\"\\\" ");
}
/* Descriptor must be a namespace node */
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
return ("####");
return __UNCONST("####");
}
/*
@ -651,7 +651,7 @@ AcpiUtGetDescriptorName (
if (!Object)
{
return ("NULL OBJECT");
return __UNCONST("NULL OBJECT");
}
if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX)
@ -737,7 +737,7 @@ AcpiUtGetReferenceName (
*
******************************************************************************/
char *
const char *
AcpiUtGetMutexName (
UINT32 MutexId)
{

View File

@ -703,7 +703,7 @@ void
AcpiUtDisplayInitPathname (
UINT8 Type,
ACPI_NAMESPACE_NODE *ObjHandle,
char *Path)
const char *Path)
{
ACPI_STATUS Status;
ACPI_BUFFER Buffer;

View File

@ -173,7 +173,7 @@ AcpiUtRemoveAllocation (
ACPI_STATUS
AcpiUtCreateList (
char *ListName,
const char *ListName,
UINT16 ObjectSize,
ACPI_MEMORY_LIST **ReturnCache)
{
@ -188,7 +188,7 @@ AcpiUtCreateList (
ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST));
Cache->ListName = ListName;
Cache->ListName = __UNCONST(ListName);
Cache->ObjectSize = ObjectSize;
*ReturnCache = Cache;