PERFORCE change 15223 for review
Robert Watson
rwatson at freebsd.org
Tue Jul 30 20:56:23 GMT 2002
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=15223
Change 15223 by rwatson at rwatson_tislabs on 2002/07/30 13:56:21
Follow-up integ from trustedbsd_base: pick up acpi build fixes
from the main tree.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/conf/files#39 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acconfig.h#6 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acenv.h#5 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acfreebsd.h#4 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acpiosxf.h#6 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acpixf.h#5 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acutils.h#6 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/dbcmds.c#6 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/dbdisasm.c#5 delete
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/dbfileio.c#5 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/dbxface.c#6 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/psparse.c#5 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/rscreate.c#5 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/tbget.c#5 integrate
.. //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/utglobal.c#5 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/acpica/Osd/OsdTable.c#2 integrate
.. //depot/projects/trustedbsd/mac/sys/dev/acpica/acpi.c#13 integrate
.. //depot/projects/trustedbsd/mac/sys/i386/include/acpica_machdep.h#1 branch
.. //depot/projects/trustedbsd/mac/sys/ia64/include/acpica_machdep.h#1 branch
.. //depot/projects/trustedbsd/mac/sys/kern/kern_condvar.c#10 integrate
.. //depot/projects/trustedbsd/mac/sys/kern/vfs_bio.c#12 integrate
.. //depot/projects/trustedbsd/mac/sys/modules/acpi/Makefile#5 integrate
.. //depot/projects/trustedbsd/mac/usr.bin/sed/main.c#7 integrate
Differences ...
==== //depot/projects/trustedbsd/mac/sys/conf/files#39 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.676 2002/07/30 17:44:28 joe Exp $
+# $FreeBSD: src/sys/conf/files,v 1.677 2002/07/30 19:35:20 iwasaki Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -56,7 +56,6 @@
coda/coda_vnops.c optional vcoda
compat/linprocfs/linprocfs.c optional linprocfs
contrib/dev/acpica/dbcmds.c optional acpica acpi_debug nowerror
-contrib/dev/acpica/dbdisasm.c optional acpica acpi_debug nowerror
contrib/dev/acpica/dbdisply.c optional acpica acpi_debug nowerror
contrib/dev/acpica/dbexec.c optional acpica acpi_debug nowerror
contrib/dev/acpica/dbfileio.c optional acpica acpi_debug nowerror
@@ -65,6 +64,14 @@
contrib/dev/acpica/dbstats.c optional acpica acpi_debug nowerror
contrib/dev/acpica/dbutils.c optional acpica acpi_debug nowerror
contrib/dev/acpica/dbxface.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmbuffer.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmnames.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmopcode.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmresrc.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmresrcl.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmresrcs.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmutils.c optional acpica acpi_debug nowerror
+contrib/dev/acpica/dmwalk.c optional acpica acpi_debug nowerror
contrib/dev/acpica/dsfield.c optional acpica nowerror
contrib/dev/acpica/dsmethod.c optional acpica
contrib/dev/acpica/dsmthdat.c optional acpica
@@ -122,8 +129,9 @@
contrib/dev/acpica/nssearch.c optional acpica
contrib/dev/acpica/nsutils.c optional acpica
contrib/dev/acpica/nswalk.c optional acpica
+contrib/dev/acpica/nsxfeval.c optional acpica nowerror
contrib/dev/acpica/nsxfname.c optional acpica nowerror
-contrib/dev/acpica/nsxfobj.c optional acpica
+contrib/dev/acpica/nsxfobj.c optional acpica nowerror
contrib/dev/acpica/psargs.c optional acpica
contrib/dev/acpica/psfind.c optional acpica
contrib/dev/acpica/psopcode.c optional acpica
@@ -146,7 +154,9 @@
contrib/dev/acpica/rsxface.c optional acpica
contrib/dev/acpica/tbconvrt.c optional acpica
contrib/dev/acpica/tbget.c optional acpica
+contrib/dev/acpica/tbgetall.c optional acpica
contrib/dev/acpica/tbinstal.c optional acpica
+contrib/dev/acpica/tbrsdt.c optional acpica
contrib/dev/acpica/tbutils.c optional acpica
contrib/dev/acpica/tbxface.c optional acpica
contrib/dev/acpica/tbxfroot.c optional acpica
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acconfig.h#6 (text+ko) ====
@@ -145,7 +145,7 @@
/* Version string */
-#define ACPI_CA_VERSION 0x20020611
+#define ACPI_CA_VERSION 0x20020725
/* Version of ACPI supported */
@@ -243,6 +243,15 @@
#define ACPI_MAX_ADDRESS_SPACE 255
+/* Array sizes. Used for range checking also */
+
+#define NUM_ACCESS_TYPES 6
+#define NUM_UPDATE_RULES 3
+#define NUM_LOCK_RULES 2
+#define NUM_MATCH_OPS 6
+#define NUM_OPCODES 256
+#define NUM_FIELD_NAMES 2
+
/* RSDP checksums */
#define ACPI_RSDP_CHECKSUM_LENGTH 20
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acenv.h#5 (text+ko) ====
@@ -123,11 +123,13 @@
*/
#ifdef _ACPI_DUMP_APP
+#ifndef MSDOS
#define ACPI_DEBUG
+#endif
#define ACPI_APPLICATION
-#define ENABLE_DEBUGGER
+#define ACPI_DISASSEMBLER
+#define ACPI_NO_METHOD_EXECUTION
#define ACPI_USE_SYSTEM_CLIBRARY
-#define PARSER_ONLY
#endif
#ifdef _ACPI_EXEC_APP
@@ -136,13 +138,15 @@
#define ACPI_DEBUG
#define ACPI_APPLICATION
#define ENABLE_DEBUGGER
+#define ACPI_DISASSEMBLER
#define ACPI_USE_SYSTEM_CLIBRARY
#endif
#ifdef _ACPI_ASL_COMPILER
#define ACPI_DEBUG
#define ACPI_APPLICATION
-/* #define ENABLE_DEBUGGER */
+#define ACPI_DISASSEMBLER
+#define ACPI_CONSTANT_EVAL_ONLY
#define ACPI_USE_SYSTEM_CLIBRARY
#endif
@@ -276,7 +280,6 @@
/*
* Use the standard C library headers.
* We want to keep these to a minimum.
- *
*/
#ifdef ACPI_USE_STANDARD_HEADERS
@@ -306,12 +309,16 @@
#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n))
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n))
+
#define ACPI_TOUPPER toupper
#define ACPI_TOLOWER tolower
#define ACPI_IS_XDIGIT isxdigit
#define ACPI_IS_DIGIT isdigit
#define ACPI_IS_SPACE isspace
#define ACPI_IS_UPPER isupper
+#define ACPI_IS_PRINT isprint
+#define ACPI_IS_ALPHA isalpha
+#define ACPI_IS_ASCII isascii
/******************************************************************************
*
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acfreebsd.h#4 (text+ko) ====
@@ -126,6 +126,7 @@
/* FreeBSD uses GCC */
#include "acgcc.h"
+#include <machine/acpica_machdep.h>
#ifdef _KERNEL
#include "opt_acpi.h"
@@ -136,160 +137,6 @@
#include <sys/libkern.h>
#include <machine/stdarg.h>
-#ifdef __ia64__
-#define _IA64
-
-/*
- * Calling conventions:
- *
- * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
- * ACPI_EXTERNAL_XFACE - External ACPI interfaces
- * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
- * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
- */
-#define ACPI_SYSTEM_XFACE
-#define ACPI_EXTERNAL_XFACE
-#define ACPI_INTERNAL_XFACE
-#define ACPI_INTERNAL_VAR_XFACE
-
-/* Asm macros */
-
-#define ACPI_ASM_MACROS
-#define BREAKPOINT3
-#define ACPI_DISABLE_IRQS() disable_intr()
-#define ACPI_ENABLE_IRQS() enable_intr()
-
-#define ACPI_FLUSH_CPU_CACHE() /* XXX ia64_fc()? */
-
-/*! [Begin] no source code translation */
-
-#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
- do { \
- __asm__ volatile ("1: ld4 r29=%1\n" \
- ";;\n" \
- "mov ar.ccv=r29\n" \
- "mov r2=r29\n" \
- "shr.u r30=r29,1\n" \
- "and r29=-4,r29\n" \
- ";;\n" \
- "add r29=2,r29\n" \
- "and r30=1,r30\n" \
- ";;\n" \
- "add r29=r29,r30\n" \
- ";;\n" \
- "cmpxchg4.acq r30=%1,r29,ar.ccv\n" \
- ";;\n" \
- "cmp.eq p6,p7=r2,r30\n" \
- "(p7) br.dpnt.few 1b\n" \
- "cmp.gt p8,p9=3,r29\n" \
- ";;\n" \
- "(p8) mov %0=-1\n" \
- "(p9) mov %0=r0\n" \
- :"=r"(Acq):"m"(GLptr):"r2","r29","r30","memory"); \
- } while (0)
-
-#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
- do { \
- __asm__ volatile ("1: ld4 r29=%1\n" \
- ";;\n" \
- "mov ar.ccv=r29\n" \
- "mov r2=r29\n" \
- "and r29=-4,r29\n" \
- ";;\n" \
- "cmpxchg4.acq r30=%1,r29,ar.ccv\n" \
- ";;\n" \
- "cmp.eq p6,p7=r2,r30\n" \
- "(p7) br.dpnt.few 1b\n" \
- "and %0=1,r2\n" \
- ";;\n" \
- :"=r"(Acq):"m"(GLptr):"r2","r29","r30","memory"); \
- } while (0)
-/*! [End] no source code translation !*/
-
-
-#else /* DO IA32 */
-
-/*
- * Calling conventions:
- *
- * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
- * ACPI_EXTERNAL_XFACE - External ACPI interfaces
- * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
- * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
- */
-#define ACPI_SYSTEM_XFACE
-#define ACPI_EXTERNAL_XFACE
-#define ACPI_INTERNAL_XFACE
-#define ACPI_INTERNAL_VAR_XFACE
-
-/* Asm macros */
-
-#define ACPI_ASM_MACROS
-#define BREAKPOINT3
-#define ACPI_DISABLE_IRQS() disable_intr()
-#define ACPI_ENABLE_IRQS() enable_intr()
-
-#define ACPI_FLUSH_CPU_CACHE() wbinvd()
-
-#define asm __asm
-/*! [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
- * All actual register references are preceded with "%%" as in "%%edx"
- * Immediate values in the assembly are preceded by "$" as in "$0x1"
- * The final asm parameter are the operation altered non-output registers.
- */
-#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 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)
-
-
-/*
- * Math helper asm macros
- */
-#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
- asm("divl %2;" \
- :"=a"(q32), "=d"(r32) \
- :"r"(d32), \
- "0"(n_lo), "1"(n_hi))
-
-
-#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
- asm("shrl $1,%2;" \
- "rcrl $1,%3;" \
- :"=r"(n_hi), "=r"(n_lo) \
- :"0"(n_hi), "1"(n_lo))
-
-/*! [End] no source code translation !*/
-
-#endif /* IA 32 */
-
#ifdef DEBUGGER_THREADING
#undef DEBUGGER_THREADING
#endif /* DEBUGGER_THREADING */
@@ -349,15 +196,4 @@
}
#endif /* _KERNEL */
-#if defined(__ia64__) || defined(__x86_64__)
-#define ACPI_MACHINE_WIDTH 64
-#define COMPILER_DEPENDENT_INT64 long
-#define COMPILER_DEPENDENT_UINT64 unsigned long
-#else
-#define ACPI_MACHINE_WIDTH 32
-#define COMPILER_DEPENDENT_INT64 long long
-#define COMPILER_DEPENDENT_UINT64 unsigned long long
-#define ACPI_USE_NATIVE_DIVIDE
-#endif
-
#endif /* __ACFREEBSD_H__ */
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acpiosxf.h#6 (text+ko) ====
@@ -296,7 +296,6 @@
void *Value,
UINT32 Width);
-
ACPI_STATUS
AcpiOsWritePort (
ACPI_IO_ADDRESS Address,
@@ -314,7 +313,6 @@
void *Value,
UINT32 Width);
-
ACPI_STATUS
AcpiOsWriteMemory (
ACPI_PHYSICAL_ADDRESS Address,
@@ -333,7 +331,6 @@
void *Value,
UINT32 Width);
-
ACPI_STATUS
AcpiOsWritePciConfiguration (
ACPI_PCI_ID *PciId,
@@ -351,7 +348,6 @@
void *Pointer,
UINT32 Length);
-
BOOLEAN
AcpiOsWritable (
void *Pointer,
@@ -380,6 +376,10 @@
const NATIVE_CHAR *Format,
va_list Args);
+void
+AcpiOsRedirectOutput (
+ void *Destination);
+
/*
* Debug input
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acpixf.h#5 (text+ko) ====
@@ -135,6 +135,10 @@
UINT32 Flags);
ACPI_STATUS
+AcpiInitializeObjects (
+ UINT32 Flags);
+
+ACPI_STATUS
AcpiTerminate (
void);
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/acutils.h#6 (text+ko) ====
@@ -193,7 +193,6 @@
#endif
-
NATIVE_CHAR *
AcpiUtGetTypeName (
ACPI_OBJECT_TYPE Type);
@@ -316,6 +315,9 @@
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
+#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
+#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
+#define ACPI_IS_ASCII(c) ((c) < 0x80)
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/dbcmds.c#6 (text+ko) ====
@@ -449,7 +449,9 @@
NumStatements = ACPI_STRTOUL (Statements, NULL, 0);
}
+#ifdef ACPI_DISASSEMBLER
AcpiDmDisassemble (NULL, Op, NumStatements);
+#endif
}
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/dbfileio.c#5 (text+ko) ====
@@ -121,7 +121,7 @@
#include "acnamesp.h"
#include "actables.h"
-#ifdef ENABLE_DEBUGGER
+#if (defined ENABLE_DEBUGGER || defined ACPI_DISASSEMBLER)
#define _COMPONENT ACPI_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
@@ -177,6 +177,7 @@
}
+#ifdef ENABLE_DEBUGGER
/*******************************************************************************
*
* FUNCTION: AcpiDbCloseDebugFile
@@ -242,6 +243,7 @@
#endif
}
+#endif
#ifdef ACPI_APPLICATION
@@ -285,7 +287,7 @@
Status = AcpiTbValidateTableHeader (&TableHeader);
if ((ACPI_FAILURE (Status)) ||
- (TableHeader.Length > 524288)) /* 1/2 Mbyte should be enough */
+ (TableHeader.Length > 0x800000)) /* 8 Mbyte should be enough */
{
AcpiOsPrintf ("Table header is invalid!\n");
return (AE_ERROR);
@@ -380,10 +382,15 @@
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
+ TableInfo.Pointer = TablePtr;
+ Status = AcpiTbRecognizeTable (&TableInfo, ACPI_TABLE_SECONDARY);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
/* Install the new table into the local data structures */
- TableInfo.Pointer = TablePtr;
-
Status = AcpiTbInstallTable (&TableInfo);
if (ACPI_FAILURE (Status))
{
@@ -394,7 +401,7 @@
}
-#ifndef PARSER_ONLY
+#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
Status = AcpiNsLoadTable (TableInfo.InstalledDesc, AcpiGbl_RootNode);
if (ACPI_FAILURE (Status))
{
@@ -430,7 +437,7 @@
/* Get the entire file */
- AcpiOsPrintf ("Loading Acpi table from file %s\n", Filename);
+ fprintf (stderr, "Loading Acpi table from file %s\n", Filename);
Status = AcpiDbLoadTable (fp, &AcpiGbl_DbTablePtr, &TableLength);
fclose(fp);
@@ -489,8 +496,8 @@
return (Status);
}
- AcpiOsPrintf ("%4.4s at %p successfully installed and loaded\n",
- AcpiGbl_DbTablePtr->Signature, AcpiGbl_DbTablePtr);
+ fprintf (stderr, "Acpi table [%4.4s] successfully installed and loaded\n",
+ AcpiGbl_DbTablePtr->Signature);
AcpiGbl_AcpiHardwarePresent = FALSE;
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/dbxface.c#6 (text+ko) ====
@@ -269,7 +269,9 @@
/* Now we can display it */
+#ifdef ACPI_DISASSEMBLER
AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX);
+#endif
if ((Op->Common.AmlOpcode == AML_IF_OP) ||
(Op->Common.AmlOpcode == AML_WHILE_OP))
@@ -425,9 +427,11 @@
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
AcpiGbl_DbOpt_tables = FALSE;
+ AcpiGbl_DbOpt_stats = FALSE;
+#ifdef ACPI_DISASSEMBLER
AcpiGbl_DbOpt_disasm = FALSE;
- AcpiGbl_DbOpt_stats = FALSE;
AcpiGbl_DbOpt_verbose = TRUE;
+#endif
AcpiGbl_DbOpt_ini_methods = TRUE;
AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE);
@@ -475,11 +479,13 @@
}
}
+#ifdef ACPI_DISASSEMBLER
if (!AcpiGbl_DbOpt_verbose)
{
AcpiGbl_DbOpt_disasm = TRUE;
AcpiGbl_DbOpt_stats = FALSE;
}
+#endif
return (AE_OK);
}
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/psparse.c#5 (text+ko) ====
@@ -590,7 +590,7 @@
ParserState = &WalkState->ParserState;
WalkState->ArgTypes = 0;
-#ifndef PARSER_ONLY
+#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
if (WalkState->WalkType & ACPI_WALK_METHOD_RESTART)
{
/* We are restarting a preempted control method */
@@ -708,6 +708,10 @@
PreOp.Common.Value.Arg = NULL;
PreOp.Common.AmlOpcode = WalkState->Opcode;
+ /*
+ * Get and append arguments until we find the node that contains
+ * the name (the type ARGP_NAME).
+ */
while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME)
{
Arg = AcpiPsGetNextArg (ParserState,
@@ -1297,7 +1301,6 @@
/* We are done with this walk, move on to the parent if any */
WalkState = AcpiDsPopWalkState (Thread);
-
/* Save the last effective return value */
if (CallerReturnDesc && WalkState->ReturnDesc)
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/rscreate.c#5 (text+ko) ====
@@ -132,7 +132,6 @@
*
* PARAMETERS: ByteStreamBuffer - Pointer to the resource byte stream
* OutputBuffer - Pointer to the user's buffer
- * OutputBufferLength - Pointer to the size of OutputBuffer
*
* RETURN: Status - AE_OK if okay, else a valid ACPI_STATUS code
* If OutputBuffer is not large enough, OutputBufferLength
@@ -212,7 +211,6 @@
* PARAMETERS: PackageObject - Pointer to an ACPI_OPERAND_OBJECT
* package
* OutputBuffer - Pointer to the user's buffer
- * OutputBufferLength - Size of OutputBuffer
*
* RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code.
* If the OutputBuffer is too small, the error will be
@@ -349,7 +347,7 @@
if ((*SubObjectList)->Reference.Opcode != AML_INT_NAMEPATH_OP)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need name, found reference op %X\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Need name, found reference op %X\n",
(*SubObjectList)->Reference.Opcode));
return_ACPI_STATUS (AE_BAD_DATA);
}
==== //depot/projects/trustedbsd/mac/sys/contrib/dev/acpica/tbget.c#5 (text+ko) ====
@@ -126,233 +126,158 @@
/*******************************************************************************
*
- * FUNCTION: AcpiTbTableOverride
+ * FUNCTION: AcpiTbGetTable
*
- * PARAMETERS: *TableInfo - Info for current table
+ * PARAMETERS: Address - Address of table to retrieve. Can be
+ * Logical or Physical
+ * TableInfo - Where table info is returned
*
* RETURN: None
*
- * DESCRIPTION: Attempts override of current table with a new one if provided
- * by the host OS.
+ * DESCRIPTION: Get entire table of unknown size.
*
******************************************************************************/
-void
-AcpiTbTableOverride (
+ACPI_STATUS
+AcpiTbGetTable (
+ ACPI_POINTER *Address,
ACPI_TABLE_DESC *TableInfo)
{
- ACPI_TABLE_HEADER *NewTable;
ACPI_STATUS Status;
- ACPI_POINTER Address;
- ACPI_TABLE_DESC NewTableInfo;
+ ACPI_TABLE_HEADER Header;
- ACPI_FUNCTION_TRACE ("AcpiTbTableOverride");
+ ACPI_FUNCTION_TRACE ("TbGetTable");
- Status = AcpiOsTableOverride (TableInfo->Pointer, &NewTable);
+ /*
+ * Get the header in order to get signature and table size
+ */
+ Status = AcpiTbGetTableHeader (Address, &Header);
if (ACPI_FAILURE (Status))
{
- /* Some severe error from the OSL, but we basically ignore it */
-
- ACPI_REPORT_ERROR (("Could not override ACPI table, %s\n",
- AcpiFormatException (Status)));
- return_VOID;
+ return_ACPI_STATUS (Status);
}
- if (!NewTable)
- {
- /* No table override */
+ /* Get the entire table */
- return_VOID;
- }
-
- /*
- * We have a new table to override the old one. Get a copy of
- * the new one. We know that the new table has a logical pointer.
- */
- Address.PointerType = ACPI_LOGICAL_POINTER;
- Address.Pointer.Logical = NewTable;
-
- Status = AcpiTbGetTable (&Address, &NewTableInfo);
+ Status = AcpiTbGetTableBody (Address, &Header, TableInfo);
if (ACPI_FAILURE (Status))
{
- ACPI_REPORT_ERROR (("Could not copy ACPI table override\n"));
- return_VOID;
+ ACPI_REPORT_ERROR (("Could not get ACPI table (size %X), %s\n",
+ Header.Length, AcpiFormatException (Status)));
+ return_ACPI_STATUS (Status);
}
- /*
- * Delete the original table
- */
- AcpiTbDeleteSingleTable (TableInfo);
-
- /* Copy the table info */
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Successful table override [%4.4s]\n",
- ((ACPI_TABLE_HEADER *) NewTableInfo.Pointer)->Signature));
-
- ACPI_MEMCPY (TableInfo, &NewTableInfo, sizeof (ACPI_TABLE_DESC));
- return_VOID;
+ return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbGetTableWithOverride
+ * FUNCTION: AcpiTbGetTableHeader
*
- * PARAMETERS: Address - Physical or logical address of table
- * *TableInfo - Where the table info is returned
+ * PARAMETERS: Address - Address of table to retrieve. Can be
+ * Logical or Physical
+ * ReturnHeader - Where the table header is returned
*
* RETURN: Status
*
- * DESCRIPTION: Gets and installs the table with possible table override by OS.
+ * DESCRIPTION: Get an ACPI table header. Works in both physical or virtual
+ * addressing mode. Works with both physical or logical pointers.
+ * Table is either copied or mapped, depending on the pointer
+ * type and mode of the processor.
*
******************************************************************************/
ACPI_STATUS
-AcpiTbGetTableWithOverride (
+AcpiTbGetTableHeader (
ACPI_POINTER *Address,
- ACPI_TABLE_DESC *TableInfo)
+ ACPI_TABLE_HEADER *ReturnHeader)
{
- ACPI_STATUS Status;
+ ACPI_STATUS Status = AE_OK;
+ ACPI_TABLE_HEADER *Header = NULL;
- ACPI_FUNCTION_TRACE ("AcpiTbGetTableWithOverride");
-
+ ACPI_FUNCTION_TRACE ("TbGetTableHeader");
- Status = AcpiTbGetTable (Address, TableInfo);
- if (ACPI_FAILURE (Status))
- {
- ACPI_REPORT_ERROR (("Could not get ACPI table, %s\n",
- AcpiFormatException (Status)));
- return_ACPI_STATUS (Status);
- }
/*
- * Attempt override. It either happens or it doesn't, no status
+ * Flags contains the current processor mode (Virtual or Physical addressing)
+ * The PointerType is either Logical or Physical
*/
- AcpiTbTableOverride (TableInfo);
+ switch (Address->PointerType)
+ {
+ case ACPI_PHYSMODE_PHYSPTR:
+ case ACPI_LOGMODE_LOGPTR:
- /* Install the table */
+ /* Pointer matches processor mode, copy the header */
- Status = AcpiTbInstallTable (TableInfo);
- if (ACPI_FAILURE (Status))
- {
- ACPI_REPORT_ERROR (("Could not install ACPI table, %s\n",
- AcpiFormatException (Status)));
- }
+ ACPI_MEMCPY (ReturnHeader, Address->Pointer.Logical, sizeof (ACPI_TABLE_HEADER));
+ break;
- return_ACPI_STATUS (Status);
-}
+ case ACPI_LOGMODE_PHYSPTR:
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbGetTablePtr
- *
- * PARAMETERS: TableType - one of the defined table types
- * Instance - Which table of this type
- * TablePtrLoc - pointer to location to place the pointer for
- * return
- *
- * RETURN: Status
- *
- * DESCRIPTION: This function is called to get the pointer to an ACPI table.
- *
- ******************************************************************************/
+ /* Create a logical address for the physical pointer*/
-ACPI_STATUS
-AcpiTbGetTablePtr (
- ACPI_TABLE_TYPE TableType,
- UINT32 Instance,
- ACPI_TABLE_HEADER **TablePtrLoc)
-{
- ACPI_TABLE_DESC *TableDesc;
- UINT32 i;
+ Status = AcpiOsMapMemory (Address->Pointer.Physical, sizeof (ACPI_TABLE_HEADER),
+ (void **) &Header);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_REPORT_ERROR (("Could not map memory at %p for length %X\n",
+ Address->Pointer.Physical, sizeof (ACPI_TABLE_HEADER)));
+ return_ACPI_STATUS (Status);
+ }
+ /* Copy header and delete mapping */
- ACPI_FUNCTION_TRACE ("TbGetTablePtr");
+ ACPI_MEMCPY (ReturnHeader, Header, sizeof (ACPI_TABLE_HEADER));
+ AcpiOsUnmapMemory (Header, sizeof (ACPI_TABLE_HEADER));
+ break;
- if (!AcpiGbl_DSDT)
- {
- return_ACPI_STATUS (AE_NO_ACPI_TABLES);
- }
+ default:
- if (TableType > ACPI_TABLE_MAX)
- {
+ ACPI_REPORT_ERROR (("Invalid address flags %X\n",
+ Address->PointerType));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /*
- * For all table types (Single/Multiple), the first
- * instance is always in the list head.
- */
- if (Instance == 1)
- {
- /*
- * Just pluck the pointer out of the global table!
- * Will be null if no table is present
- */
- *TablePtrLoc = AcpiGbl_AcpiTables[TableType].Pointer;
- return_ACPI_STATUS (AE_OK);
- }
-
- /*
- * Check for instance out of range
- */
- if (Instance > AcpiGbl_AcpiTables[TableType].Count)
- {
- return_ACPI_STATUS (AE_NOT_EXIST);
- }
-
- /* Walk the list to get the desired table
- * Since the if (Instance == 1) check above checked for the
- * first table, setting TableDesc equal to the .Next member
- * is actually pointing to the second table. Therefore, we
- * need to walk from the 2nd table until we reach the Instance
- * that the user is looking for and return its table pointer.
- */
- TableDesc = AcpiGbl_AcpiTables[TableType].Next;
- for (i = 2; i < Instance; i++)
- {
- TableDesc = TableDesc->Next;
- }
-
- /* We are now pointing to the requested table's descriptor */
-
- *TablePtrLoc = TableDesc->Pointer;
-
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbGetTable
+ * FUNCTION: AcpiTbGetTableBody
*
- * PARAMETERS: Address - Physical address of table to retrieve
- * *TableInfo - Where the table info is returned
+ * PARAMETERS: Address - Address of table to retrieve. Can be
+ * Logical or Physical
+ * Header - Header of the table to retrieve
+ * TableInfo - Where the table info is returned
*
* RETURN: Status
*
- * DESCRIPTION: Maps the physical address of table into a logical address
+ * DESCRIPTION: Get an entire ACPI table with support to allow the host OS to
+ * replace the table with a newer version (table override.)
+ * Works in both physical or virtual
+ * addressing mode. Works with both physical or logical pointers.
+ * Table is either copied or mapped, depending on the pointer
+ * type and mode of the processor.
*
******************************************************************************/
ACPI_STATUS
-AcpiTbGetTable (
+AcpiTbGetTableBody (
ACPI_POINTER *Address,
+ ACPI_TABLE_HEADER *Header,
ACPI_TABLE_DESC *TableInfo)
{
- ACPI_TABLE_HEADER *TableHeader = NULL;
- ACPI_TABLE_HEADER *FullTable = NULL;
- ACPI_SIZE Size;
- UINT8 Allocation;
- ACPI_STATUS Status = AE_OK;
+ ACPI_STATUS Status;
- ACPI_FUNCTION_TRACE ("TbGetTable");
+ ACPI_FUNCTION_TRACE ("TbGetTableBody");
if (!TableInfo || !Address)
@@ -360,587 +285,298 @@
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- switch (Address->PointerType)
+ /*
+ * Attempt table override.
+ */
+ Status = AcpiTbTableOverride (Header, TableInfo);
+ if (ACPI_SUCCESS (Status))
{
- case ACPI_LOGICAL_POINTER:
+ /* Table was overridden by the host OS */
- /*
- * Getting data from a buffer, not BIOS tables
- */
- TableHeader = Address->Pointer.Logical;
-
- /* Allocate buffer for the entire table */
-
- FullTable = ACPI_MEM_ALLOCATE (TableHeader->Length);
- if (!FullTable)
- {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-
- /* Copy the entire table (including header) to the local buffer */
-
- Size = (ACPI_SIZE) TableHeader->Length;
- ACPI_MEMCPY (FullTable, TableHeader, Size);
-
- /* Save allocation type */
-
- Allocation = ACPI_MEM_ALLOCATED;
- break;
-
-
- case ACPI_PHYSICAL_POINTER:
-
- /*
- * Not reading from a buffer, just map the table's physical memory
- * into our address space.
- */
- Size = SIZE_IN_HEADER;
-
- Status = AcpiTbMapAcpiTable (Address->Pointer.Physical, &Size, &FullTable);
- if (ACPI_FAILURE (Status))
- {
>>> TRUNCATED FOR MAIL (1000 lines) <<<
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list