Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --strip-trailing-cr -ur ./driver/acpisym/acpisym.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/acpisym/acpisym.c"
- --- ./driver/acpisym/acpisym.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/acpisym/acpisym.c" 2022-04-28 11:28:50.548828100 +0500
- @@ -42,6 +42,7 @@
- #include "acpiterm.h"
- #include "acpiirp.h"
- #include "acpilog.h"
- +#include "arblib.h"
- #include "acpiosnt.h"
- #include "..\nt\irqarb.h"
- Only in c:\ACPI\ACPI_W2003\Base\busdrv\acpi/driver/acpisym: obj
- diff --strip-trailing-cr -ur ./driver/amlinew/acpins.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/acpins.c"
- --- ./driver/amlinew/acpins.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/acpins.c" 2022-04-04 04:05:08.000000000 +0500
- @@ -740,7 +740,7 @@
- EXIT(3, ("EvalPackageElement=%x (Type=%s,Value=%x,Len=%d,Buff=%x)\n",
- rc, GetObjectTypeName(pdataResult->dwDataType),
- - pdataResult->uipDataValue, pdataResult->dwDataLen,
- + pdataResult->dwDataValue, pdataResult->dwDataLen,
- pdataResult->pbDataBuff));
- return rc;
- } //EvalPackageElement
- diff --strip-trailing-cr -ur ./driver/amlinew/amldebug.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amldebug.c"
- --- ./driver/amlinew/amldebug.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amldebug.c" 2022-04-06 03:31:36.000000000 +0500
- @@ -1915,7 +1915,7 @@
- else if (icArgs < MAX_NUM_ARGS)
- {
- MEMZERO(&Args[icArgs], sizeof(OBJDATA));
- - if (IsNumber(pszArg, 0, &Args[icArgs].uipDataValue))
- + if (IsNumber(pszArg, 0, (PULONG_PTR) &Args[icArgs].dwDataValue))
- {
- Args[icArgs].dwDataType = OBJTYPE_INTDATA;
- icArgs++;
- @@ -2230,7 +2230,7 @@
- switch (pdata->dwDataType)
- {
- case OBJTYPE_INTDATA:
- - PRINTF("0x%p", pdata->uipDataValue);
- + PRINTF("0x%p", pdata->dwDataValue);
- break;
- case OBJTYPE_STRDATA:
- @@ -2260,7 +2260,7 @@
- default:
- PRINTF("<Obj=%p,Type=%s,Value=0x%p,Buff=%p,Len=%d>",
- pdata, GetObjectTypeName(pdata->dwDataType),
- - pdata->uipDataValue, pdata->pbDataBuff, pdata->dwDataLen);
- + pdata->dwDataValue, pdata->pbDataBuff, pdata->dwDataLen);
- }
- EXIT(4, ("PrintObject!\n"));
- diff --strip-trailing-cr -ur ./driver/amlinew/amliapi.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amliapi.c"
- --- ./driver/amlinew/amliapi.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amliapi.c" 2022-04-04 04:02:00.000000000 +0500
- @@ -160,7 +160,7 @@
- &pns, 0)) == STATUS_SUCCESS))
- {
- pns->ObjData.dwDataType = OBJTYPE_INTDATA;
- - pns->ObjData.uipDataValue = AMLI_REVISION;
- + pns->ObjData.dwDataValue = AMLI_REVISION;
- }
- if ((rc == STATUS_SUCCESS) &&
- diff --strip-trailing-cr -ur ./driver/amlinew/amlipriv.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amlipriv.h"
- --- ./driver/amlinew/amlipriv.h 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amlipriv.h" 2022-03-31 20:01:00.000000000 +0500
- @@ -285,6 +285,7 @@
- #define AMLISTA_CONTINUE 0x00008003
- #define AMLISTA_PENDING 0x00008004
- #define AMLISTA_TIMEOUT 0x00008005
- +#define AMLISTA_CONTINUEOP 0x00008006
- // Global AMLI flags
- #define AMLIF_LOCKED 0x00000001
- @@ -331,6 +332,7 @@
- #define ARGOBJ_BASICDATA 'D' //INTDATA,STRDATA,BUFFDATA
- #define ARGOBJ_COMPLEXDATA 'C' //BUFFDATA,PKGDATA
- #define ARGOBJ_REFERENCE 'R' //OBJALIAS,DATAALIAS,BUFFFIELD
- +#define ARGOBJ_STRBUFDATA 'T' //OBJTYPE_STRDATA/OBJTYPE_BUFFDATA
- #define MAX_BYTE 0xff
- #define MAX_WORD 0xffff
- diff --strip-trailing-cr -ur ./driver/amlinew/amlitest.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amlitest.c"
- --- ./driver/amlinew/amlitest.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/amlitest.c" 2022-04-02 22:47:12.000000000 +0500
- @@ -52,6 +52,7 @@
- PCCHAR DebugMessage,
- ...)
- {
- + int index;
- va_list ap;
- va_start(ap, DebugMessage);
- @@ -61,17 +62,16 @@
- - if(_vsnprintf(AmliTestDebugBuffer,
- + index = _vsnprintf(AmliTestDebugBuffer,
- 200,
- DebugMessage,
- - ap) < 0)
- + ap);
- + if(index == -1)
- {
- - //
- - // _vsnprintf failed, don't print out anything.
- - //
- - AmliTestDebugBuffer[0] = '\0';
- + AmliTestDebugBuffer[0] = '\0';
- + } else {
- + AmliTestDebugBuffer[index] = '\0';
- }
- - AmliTestDebugBuffer[199] = '\0';
- DbgPrint(AmliTestDebugBuffer);
- }
- diff --strip-trailing-cr -ur ./driver/amlinew/data.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/data.c"
- --- ./driver/amlinew/data.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/data.c" 2022-03-31 19:47:44.000000000 +0500
- @@ -188,6 +188,22 @@
- atToBCD = {"ToBCD", OP_TOBCD, "CS", C2, 0, NULL, 0, ExprOp1},
- atWait = {"Wait", OP_WAIT, "SC", C2, 0, NULL, 0, Wait},
- atXOr = {"XOr", OP_XOR, "CCS", C2, 0, NULL, 0, ExprOp2},
- +
- + // ACPI 2.0
- + atToBuffer = {"ToBuffer", OP_TOBUFFER, "CS", C2, 0, NULL, 0, ToBuffer},
- + atToDecString = {"ToDecimalString", OP_TODECSTRING, "CS", C2, 0, NULL, 0, ToDecimalString},
- + atToHexString = {"ToHexString", OP_TOHEXSTRING, "CS", C2, 0, NULL, 0, ToHexString},
- + atToInteger = {"ToInteger", OP_TOINTEGER, "CS", C2, 0, NULL, 0, ToInteger},
- + atQWordField = {"CreateQWordField", OP_QWORDFIELD, "CCN", OB, 0, NULL, 0, CreateQWordField},
- + atConcatRes = {"ConcatenateResTemplate", OP_CONCATRESTMPL, "CCS", C2, 0, NULL, 0, ConcatenateResTemplate},
- + atMod = {"Mod", OP_MOD, "CCS", C2, 0, NULL, 0, ExprOp2},
- + atToString = {"ToString", OP_TOSTRING, "CCS", C2, 0, NULL, 0, ToString},
- + atCopyObject = {"CopyObject", OP_COPYOBJECT, "CS", C2, 0, NULL, 0, CopyObject},
- + atMid = {"Mid", OP_MID, "CCCS", C2, 0, NULL, 0, MidString},
- + atContinue = {"Continue", OP_CONTINUE, NULL, C1, 0, NULL, 0, Continue},
- + atTimer = {"Timer", OP_TIMER , NULL, C2, 0, NULL, 0, Timer},
- + // OP_QWORD=0xE - see atDataObj
- +
- //
- // Misc. Opcodes
- //
- @@ -206,7 +222,7 @@
- //0x08 0x09 0x0a 0x0b
- &atName, NULL, &atDataObj, &atDataObj,
- //0x0c 0x0d 0x0e 0x0f
- - &atDataObj, &atString, NULL, NULL,
- + &atDataObj, &atString, &atDataObj, NULL,
- //0x10 0x11 0x12 0x13
- &atScope, &atBuffer, &atPackage, NULL,
- //0x14 0x15 0x16 0x17
- @@ -266,19 +282,19 @@
- //0x80 0x81 0x82 0x83
- &atNot, &atFindSetLBit, &atFindSetRBit, &atDerefOf,
- //0x84 0x85 0x86 0x87
- - NULL, NULL, &atNotify, &atSizeOf,
- + &atConcatRes, &atMod, &atNotify, &atSizeOf,
- //0x88 0x89 0x8a 0x8b
- &atIndex, &atMatch, &atDWordField, &atWordField,
- //0x8c 0x8d 0x8e 0x8f
- - &atByteField, &atBitField, &atObjType, NULL,
- + &atByteField, &atBitField, &atObjType, &atQWordField,
- //0x90 0x91 0x92 0x93
- &atLAnd, &atLOr, &atLNot, &atLEq,
- //0x94 0x95 0x96 0x97
- - &atLG, &atLL, NULL, NULL,
- + &atLG, &atLL, &atToBuffer, &atToDecString,
- //0x98 0x99 0x9a 0x9b
- - NULL, NULL, NULL, NULL,
- + &atToHexString, &atToInteger, NULL, NULL,
- //0x9c 0x9d 0x9e 0x9f
- - NULL, NULL, NULL, NULL,
- + &atToString, &atCopyObject, &atMid, &atContinue,
- //0xa0 0xa1 0xa2 0xa3
- &atIf, &atElse, &atWhile, &atNOP,
- //0xa4 0xa5 0xa6 0xa7
- @@ -349,6 +365,7 @@
- EXOP_REVISION, &atDataObj,
- EXOP_DEBUG, &atDebugObj,
- EXOP_FATAL, &atFatal,
- + EXOP_TIMER, &atTimer,
- EXOP_OPREGION, &atOpRegion,
- EXOP_FIELD, &atField,
- EXOP_DEVICE, &atDevice,
- diff --strip-trailing-cr -ur ./driver/amlinew/misc.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/misc.c"
- --- ./driver/amlinew/misc.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/misc.c" 2022-04-05 16:20:27.692382800 +0500
- @@ -597,7 +597,7 @@
- MEMZERO(&data, sizeof(OBJDATA));
- data.dwDataType = OBJTYPE_INTDATA;
- - data.uipDataValue = (ULONG_PTR)dwData;
- + data.dwDataValue = (ULONG)dwData;
- rc = WriteObject(pctxt, pdataObj, &data);
- @@ -830,7 +830,7 @@
- switch (pdata->dwDataType)
- {
- case OBJTYPE_INTDATA:
- - pb = (PUCHAR)&pdata->uipDataValue;
- + pb = (PUCHAR)&pdata->dwDataValue;
- dwcb = sizeof(ULONG);
- break;
- @@ -1334,6 +1334,17 @@
- i,
- GetObjectTypeName(pArgs[i].dwDataType)));
- }
- + break;
- +
- + case ARGOBJ_STRBUFDATA:
- + if ((pArgs[i].dwDataType != OBJTYPE_STRDATA) &&
- + (pArgs[i].dwDataType != OBJTYPE_BUFFDATA))
- + {
- + rc = AMLI_LOGERR(AMLIERR_UNEXPECTED_OBJTYPE,
- + ("ValidateArgTypes: expected Arg%d to be type str/buff (Type=%s)",
- + i,
- + GetObjectTypeName(pArgs[i].dwDataType)));
- + }
- break;
- default:
- diff --strip-trailing-cr -ur ./driver/amlinew/namedobj.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/namedobj.c"
- --- ./driver/amlinew/namedobj.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/namedobj.c" 2022-12-18 13:45:02.173828100 +0500
- @@ -9,6 +9,141 @@
- #include "pch.h"
- +// AcpiInformation re-definition
- +///////////////////////////////////////////////////
- +typedef struct _ACPIInformation {
- +
- + //
- + // Linear address of Root System Description Table
- + //
- + PRSDT RootSystemDescTable;
- +
- + //
- + // Linear address of Fixed ACPI Description Table
- + //
- + PFADT FixedACPIDescTable;
- +
- + //
- + // Linear address of the FACS
- + //
- + PFACS FirmwareACPIControlStructure;
- +
- + //
- + // Linear address of Differentiated System Description Table
- + //
- + PDSDT DiffSystemDescTable;
- +
- + //
- + // Linear address of Mulitple APIC table
- + //
- + PMAPIC MultipleApicTable;
- +
- + //
- + // Linear address of GlobalLock ULONG_PTR (contained within Firmware ACPI control structure)
- + //
- + PULONG GlobalLock;
- +
- + //
- + // Queue used for waiting on release of the Global Lock. Also, queue
- + // lock and owner info.
- + //
- + LIST_ENTRY GlobalLockQueue;
- + KSPIN_LOCK GlobalLockQueueLock;
- + PVOID GlobalLockOwnerContext;
- + ULONG GlobalLockOwnerDepth;
- +
- + //
- + // Did we find SCI_EN set when we loaded ?
- + //
- + BOOLEAN ACPIOnly;
- +
- + //
- + // I/O address of PM1a_BLK
- + //
- + ULONG_PTR PM1a_BLK;
- +
- + //
- + // I/O address of PM1b_BLK
- + //
- + ULONG_PTR PM1b_BLK;
- +
- + //
- + // I/O address of PM1a_CNT_BLK
- + //
- + ULONG_PTR PM1a_CTRL_BLK;
- +
- + //
- + // I/O address of PM1b_CNT_BLK
- + //
- + ULONG_PTR PM1b_CTRL_BLK;
- +
- + //
- + // I/O address of PM2_CNT_BLK
- + //
- + ULONG_PTR PM2_CTRL_BLK;
- +
- + //
- + // I/O address of PM_TMR
- + //
- + ULONG_PTR PM_TMR;
- + ULONG_PTR GP0_BLK;
- + ULONG_PTR GP0_ENABLE;
- +
- + //
- + // Length of GP0 register block (Total, status+enable regs)
- + //
- + UCHAR GP0_LEN;
- +
- + //
- + // Number of GP0 logical registers
- + //
- + USHORT Gpe0Size;
- + ULONG_PTR GP1_BLK;
- + ULONG_PTR GP1_ENABLE;
- +
- + //
- + // Length of GP1 register block
- + //
- + UCHAR GP1_LEN;
- +
- + //
- + // Number of GP1 logical registers
- + //
- + USHORT Gpe1Size;
- + USHORT GP1_Base_Index;
- +
- + //
- + // Total number of GPE logical registers
- + //
- + USHORT GpeSize;
- +
- + //
- + // I/O address of SMI_CMD
- + //
- + ULONG_PTR SMI_CMD;
- +
- + //
- + // Bit mask of enabled PM1 events.
- + //
- + USHORT pm1_en_bits;
- + USHORT pm1_wake_mask;
- + USHORT pm1_wake_status;
- + USHORT c2_latency;
- + USHORT c3_latency;
- +
- + //
- + // see below for bit descriptions.
- + //
- + ULONG ACPI_Flags;
- + ULONG ACPI_Capabilities;
- +
- + BOOLEAN Dockable;
- +
- +} ACPIInformation, *PACPIInformation;
- +extern PACPIInformation AcpiInformation;
- +///////////////////////////////////////////////////
- +
- +
- #ifdef LOCKABLE_PRAGMA
- #pragma ACPI_LOCKABLE_DATA
- #pragma ACPI_LOCKABLE_CODE
- @@ -78,9 +213,9 @@
- pbf = (PBANKFIELDOBJ)pterm->pnsObj->ObjData.pbDataBuff;
- pbf->pnsBase = pnsBase;
- pbf->pnsBank = pnsBank;
- - pbf->dwBankValue = (ULONG)pterm->pdataArgs[2].uipDataValue;
- + pbf->dwBankValue = (ULONG)pterm->pdataArgs[2].dwDataValue;
- rc = ParseFieldList(pctxt, pterm->pbOpEnd, pterm->pnsObj,
- - (ULONG)pterm->pdataArgs[3].uipDataValue,
- + (ULONG)pterm->pdataArgs[3].dwDataValue,
- ((POPREGIONOBJ)pnsBase->ObjData.pbDataBuff)->dwLen);
- }
- }
- @@ -169,9 +304,9 @@
- STATUS_SUCCESS)
- {
- pbf->FieldDesc.dwByteOffset = (ULONG)
- - (pterm->pdataArgs[1].uipDataValue/8);
- + (pterm->pdataArgs[1].dwDataValue/8);
- pbf->FieldDesc.dwStartBitPos = (ULONG)
- - (pterm->pdataArgs[1].uipDataValue -
- + (pterm->pdataArgs[1].dwDataValue -
- pbf->FieldDesc.dwByteOffset*8);
- pbf->FieldDesc.dwNumBits = 1;
- pbf->FieldDesc.dwFieldFlags = ACCTYPE_BYTE;
- @@ -205,7 +340,7 @@
- if ((rc = CreateXField(pctxt, pterm, &pterm->pdataArgs[2], &pbf)) ==
- STATUS_SUCCESS)
- {
- - pbf->FieldDesc.dwByteOffset = (ULONG)pterm->pdataArgs[1].uipDataValue;
- + pbf->FieldDesc.dwByteOffset = (ULONG)pterm->pdataArgs[1].dwDataValue;
- pbf->FieldDesc.dwStartBitPos = 0;
- pbf->FieldDesc.dwNumBits = 8*sizeof(UCHAR);
- pbf->FieldDesc.dwFieldFlags = ACCTYPE_BYTE;
- @@ -239,7 +374,7 @@
- if ((rc = CreateXField(pctxt, pterm, &pterm->pdataArgs[2], &pbf)) ==
- STATUS_SUCCESS)
- {
- - pbf->FieldDesc.dwByteOffset = (ULONG)pterm->pdataArgs[1].uipDataValue;
- + pbf->FieldDesc.dwByteOffset = (ULONG)pterm->pdataArgs[1].dwDataValue;
- pbf->FieldDesc.dwStartBitPos = 0;
- pbf->FieldDesc.dwNumBits = 8*sizeof(USHORT);
- pbf->FieldDesc.dwFieldFlags = ACCTYPE_WORD;
- @@ -273,7 +408,7 @@
- if ((rc = CreateXField(pctxt, pterm, &pterm->pdataArgs[2], &pbf)) ==
- STATUS_SUCCESS)
- {
- - pbf->FieldDesc.dwByteOffset = (ULONG)pterm->pdataArgs[1].uipDataValue;
- + pbf->FieldDesc.dwByteOffset = (ULONG)pterm->pdataArgs[1].dwDataValue;
- pbf->FieldDesc.dwStartBitPos = 0;
- pbf->FieldDesc.dwNumBits = 8*sizeof(ULONG);
- pbf->FieldDesc.dwFieldFlags = ACCTYPE_DWORD;
- @@ -310,11 +445,11 @@
- STATUS_SUCCESS)
- {
- pbf->FieldDesc.dwByteOffset = (ULONG)
- - (pterm->pdataArgs[1].uipDataValue/8);
- + (pterm->pdataArgs[1].dwDataValue/8);
- pbf->FieldDesc.dwStartBitPos = (ULONG)
- - (pterm->pdataArgs[1].uipDataValue -
- + (pterm->pdataArgs[1].dwDataValue -
- pbf->FieldDesc.dwByteOffset*8);
- - pbf->FieldDesc.dwNumBits = (ULONG)pterm->pdataArgs[2].uipDataValue;
- + pbf->FieldDesc.dwNumBits = (ULONG)pterm->pdataArgs[2].dwDataValue;
- pbf->FieldDesc.dwFieldFlags = ACCTYPE_BYTE | FDF_BUFFER_TYPE;
- }
- }
- @@ -344,10 +479,119 @@
- {
- TRACENAME("DEVICE")
- NTSTATUS rc = STATUS_SUCCESS;
- + PUCHAR NextOp, OrigOp, OneByte, TwoByte, ThreeByte, FourByte;
- + PUCHAR DeviceDef;
- + ULONG ProcDefType = 0;
- + ULONG i, DeviceOpSize;
- ENTER(2, ("Device(pctxt=%x,pbOp=%x,pterm=%x)\n",
- pctxt, pctxt->pbOp, pterm));
- + // convert Device(HID=ACPI0007,...) to Processor(...) opcode
- +
- + // ACPI0007 Device definition #1:
- + // 5B 82 1A 43 30 30 30 Device (C000)
- + // 08 5F 48 49 44 0D 41 43 50 49 30 30 30 37 00 Name (_HID, "ACPI0007") <- OrigOp
- + // 08 5F 55 49 44 00 Name (_UID, Zero)
- + // 5B 82 1A XX XX XX XX 08 5F 48 49 44 0D 41 43 50 49 30 30 30 37 00 08 5F 55 49 44 YY
- +
- + // ACPI0007 Device definition #2:
- + // 5B 82 1B 43 30 30 30 Device (C000)
- + // 08 5F 48 49 44 0D 41 43 50 49 30 30 30 37 00 Name (_HID, "ACPI0007") <- OrigOp
- + // 08 5F 55 49 44 0A YY Name (_UID, 2)
- + // 5B 82 1B XX XX XX XX 08 5F 48 49 44 0D 41 43 50 49 30 30 30 37 00 08 5F 55 49 44 0A YY
- +
- +
- + NextOp = pctxt->pbOp; // next OP
- + DeviceDef = NextOp - 7 ; // 5B 82 1A / 5B 82 1B
- +
- + if (NextOp) { // next OP exist
- + if (DeviceDef[0] == 0x5B && // 5B 82 1A definition #1
- + DeviceDef[1] == 0x82 &&
- + DeviceDef[2] == 0x1A ) {
- + ProcDefType = 1;
- + DeviceOpSize = 28;
- + KdPrint(("Try ACPI0007 def #1 \n"));
- + } else
- + if (DeviceDef[0] == 0x5B && // 5B 82 1B definition #2
- + DeviceDef[1] == 0x82 &&
- + DeviceDef[2] == 0x1B ) {
- + ProcDefType = 2;
- + DeviceOpSize = 29;
- + KdPrint(("Try ACPI0007 def #2 \n"));
- + }
- + }
- +
- + if (ProcDefType == 0 ||
- + DeviceDef[13] != 'A' ||
- + DeviceDef[14] != 'C' ||
- + DeviceDef[15] != 'P' ||
- + DeviceDef[16] != 'I' ||
- + DeviceDef[17] != '0' ||
- + DeviceDef[18] != '0' ||
- + DeviceDef[19] != '0' ||
- + DeviceDef[20] != '7' )
- + ProcDefType = 0; // not ACPI0007
- +
- + if (ProcDefType != 0) {
- + CHAR ProcName[4];
- + UCHAR ProcEnum;
- + ULONG dwPBlk, dwPBlkLen;
- + UCHAR *pdwPBlk;
- +
- + ProcName[0] = DeviceDef[3]; // N
- + ProcName[1] = DeviceDef[4]; // A
- + ProcName[2] = DeviceDef[5]; // M
- + ProcName[3] = DeviceDef[6]; // E
- +
- + // FACP.PM1A_Event_Block + 0x10, https://www.tonymacx86.com/threads/cpu-wrapping-ssdt-cpu-wrap-ssdt-cpur-acpi0007.316894/
- + dwPBlk = (ULONG) AcpiInformation->FixedACPIDescTable->pm1a_evt_blk_io_port + 0x10;
- +
- + // 0 or 6 per ACPI spec
- + dwPBlkLen = (ULONG) 6;
- +
- + // Processor (CPU0, 0x01, 0x00001810, 0x06) (NAME, enum, addr, size)
- + // 5B 83 0B 43 50 55 30 01 10 18 00 00 06
- + DeviceDef[0] = 0x5B;
- + DeviceDef[1] = 0x83;
- + DeviceDef[2] = 0x0B;
- +
- + DeviceDef[3] = ProcName[0];
- + DeviceDef[4] = ProcName[1];
- + DeviceDef[5] = ProcName[2];
- + DeviceDef[6] = ProcName[3];
- +
- + if (ProcDefType == 1)
- + DeviceDef[7] = DeviceDef[27]; // YY
- + else
- + if (ProcDefType == 2)
- + DeviceDef[7] = DeviceDef[28]; // YY
- +
- + pdwPBlk = (UCHAR *) &dwPBlk;
- +
- + DeviceDef[8] = pdwPBlk[0];
- + DeviceDef[9] = pdwPBlk[1];
- + DeviceDef[10] = pdwPBlk[2];
- + DeviceDef[11] = pdwPBlk[3];
- +
- + DeviceDef[12] = (UCHAR) dwPBlkLen;
- +
- + for (i = 13; i < DeviceOpSize; i++) {
- + DeviceDef[i] = 0xA3; // Noop
- + }
- +
- + pctxt->pbOp = DeviceDef; // reverse OPcode back
- +
- + KdPrint(("ACPI0007 CPU=%x PBlk=%x NextOp=%X,%X,%X,%X \n",
- + DeviceDef[7],
- + dwPBlk,
- + DeviceDef[DeviceOpSize],
- + DeviceDef[DeviceOpSize+1],
- + DeviceDef[DeviceOpSize+2],
- + DeviceDef[DeviceOpSize+3]));
- + }
- + else
- + { // normal Device()
- if ((rc = CreateNameSpaceObject(pctxt->pheapCurrent,
- (PSZ)pterm->pdataArgs[0].pbDataBuff,
- pctxt->pnsScope, pctxt->powner,
- @@ -361,6 +605,35 @@
- rc = PushScope(pctxt, pctxt->pbOp, pterm->pbOpEnd, NULL, pterm->pnsObj,
- pctxt->powner, pctxt->pheapCurrent, pterm->pdataResult);
- }
- + else
- + if (rc == AMLIERR_OBJ_ALREADY_EXIST) {
- + // Doubled device definition workaround, change OpCode pointer to next object
- + NextOp = pctxt->pbOp; // next OP
- + OneByte = NextOp - 7 ; // 5B 82 (3F) NN AA MM EE
- + TwoByte = NextOp - 8 ; // 5B 82 (4F L2) NN AA MM EE
- + ThreeByte = NextOp - 9 ; // 5B 82 (8F L2 L3) NN AA MM EE
- + FourByte = NextOp - 10 ; // 5B 82 (CF L3 L3 L4) NN AA MM EE
- +
- + rc = STATUS_SUCCESS;
- +
- + if (NextOp) { // next OP exist
- + if (OneByte[0] == 0x5B && OneByte[1] == 0x82) { // 0x5B 0x82 Device() Opcode
- + pctxt->pbOp = OneByte + OneByte[2] + 2; // start + pkglength + opcodelength
- + } else
- + if (TwoByte[0] == 0x5B && TwoByte[1] == 0x82) {
- + pctxt->pbOp = TwoByte + (TwoByte[3] << 4) + (TwoByte[2] & 0x0F) + 2; // pkglength magic
- + } else
- + if (ThreeByte[0] == 0x5B && ThreeByte[1] == 0x82) {
- + pctxt->pbOp = ThreeByte + (ThreeByte[4] << (4+8)) + (ThreeByte[3] << 4) + (ThreeByte[2] & 0x0F) + 2;
- + } else
- + if (FourByte[0] == 0x5B && FourByte[1] == 0x82) {
- + pctxt->pbOp = FourByte + (FourByte[5] << (4+8+8)) + (FourByte[4] << (4+8)) + (FourByte[3] << 4) + (FourByte[2] & 0x0F) + 2;
- + }
- + else
- + rc = AMLIERR_OBJ_ALREADY_EXIST; // unknow Device() opcode coding
- + }
- + }
- + }
- EXIT(2, ("Device=%x (pnsObj=%x)\n", rc, pterm->pnsObj));
- return rc;
- @@ -488,7 +761,7 @@
- pfd = (PFIELDOBJ)pterm->pnsObj->ObjData.pbDataBuff;
- pfd->pnsBase = pnsBase;
- rc = ParseFieldList(pctxt, pterm->pbOpEnd, pterm->pnsObj,
- - (ULONG)pterm->pdataArgs[1].uipDataValue,
- + (ULONG)pterm->pdataArgs[1].dwDataValue,
- ((POPREGIONOBJ)pnsBase->ObjData.pbDataBuff)->dwLen);
- }
- }
- @@ -563,7 +836,7 @@
- pif->pnsIndex = pnsIdx;
- pif->pnsData = pnsData;
- rc = ParseFieldList(pctxt, pterm->pbOpEnd, pterm->pnsObj,
- - (ULONG)pterm->pdataArgs[2].uipDataValue,
- + (ULONG)pterm->pdataArgs[2].dwDataValue,
- 0xffffffff);
- }
- }
- @@ -694,7 +967,7 @@
- &pterm->pnsObj, 0)) == STATUS_SUCCESS)
- {
- rc = InitMutex(pctxt->pheapCurrent, pterm->pnsObj,
- - (ULONG)pterm->pdataArgs[1].uipDataValue);
- + (ULONG)pterm->pdataArgs[1].dwDataValue);
- }
- EXIT(2, ("Mutex=%x (pnsObj=%x)\n", rc, pterm->pnsObj));
- @@ -742,9 +1015,9 @@
- MEMZERO(pterm->pnsObj->ObjData.pbDataBuff,
- pterm->pnsObj->ObjData.dwDataLen);
- pop = (POPREGIONOBJ)pterm->pnsObj->ObjData.pbDataBuff;
- - pop->bRegionSpace = (UCHAR)pterm->pdataArgs[1].uipDataValue;
- - pop->uipOffset = pterm->pdataArgs[2].uipDataValue;
- - pop->dwLen = (ULONG)pterm->pdataArgs[3].uipDataValue;
- + pop->bRegionSpace = (UCHAR)pterm->pdataArgs[1].dwDataValue;
- + pop->uipOffset = pterm->pdataArgs[2].dwDataValue;
- + pop->dwLen = (ULONG)pterm->pdataArgs[3].dwDataValue;
- KeInitializeSpinLock(&pop->listLock);
- if (pop->bRegionSpace == REGSPACE_MEM)
- {
- @@ -831,8 +1104,8 @@
- MEMZERO(pterm->pnsObj->ObjData.pbDataBuff,
- pterm->pnsObj->ObjData.dwDataLen);
- ppr = (PPOWERRESOBJ)pterm->pnsObj->ObjData.pbDataBuff;
- - ppr->bSystemLevel = (UCHAR)pterm->pdataArgs[1].uipDataValue;
- - ppr->bResOrder = (UCHAR)pterm->pdataArgs[2].uipDataValue;
- + ppr->bSystemLevel = (UCHAR)pterm->pdataArgs[1].dwDataValue;
- + ppr->bResOrder = (UCHAR)pterm->pdataArgs[2].dwDataValue;
- if (ghCreate.pfnHandler != NULL)
- {
- ((PFNOO)ghCreate.pfnHandler)(OBJTYPE_POWERRES, pterm->pnsObj);
- @@ -890,9 +1163,9 @@
- MEMZERO(pterm->pnsObj->ObjData.pbDataBuff,
- pterm->pnsObj->ObjData.dwDataLen);
- pproc = (PPROCESSOROBJ)pterm->pnsObj->ObjData.pbDataBuff;
- - pproc->bApicID = (UCHAR)pterm->pdataArgs[1].uipDataValue;
- - pproc->dwPBlk = (ULONG)pterm->pdataArgs[2].uipDataValue;
- - pproc->dwPBlkLen = (ULONG)pterm->pdataArgs[3].uipDataValue;
- + pproc->bApicID = (UCHAR)pterm->pdataArgs[1].dwDataValue;
- + pproc->dwPBlk = (ULONG)pterm->pdataArgs[2].dwDataValue;
- + pproc->dwPBlkLen = (ULONG)pterm->pdataArgs[3].dwDataValue;
- if (ghCreate.pfnHandler != NULL)
- {
- ((PFNOO)ghCreate.pfnHandler)(OBJTYPE_PROCESSOR, pterm->pnsObj);
- diff --strip-trailing-cr -ur ./driver/amlinew/nsmod.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/nsmod.c"
- --- ./driver/amlinew/nsmod.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/nsmod.c" 2022-04-04 04:13:00.000000000 +0500
- @@ -45,7 +45,7 @@
- &pterm->pnsObj, 0)) == STATUS_SUCCESS))
- {
- pterm->pnsObj->ObjData.dwDataType = OBJTYPE_OBJALIAS;
- - pterm->pnsObj->ObjData.uipDataValue = (ULONG_PTR)pnsSrc;
- + pterm->pnsObj->ObjData.pnsAlias = pnsSrc;
- }
- EXIT(2, ("Alias=%x (pnsObj=%x)\n", rc, pterm->pnsObj));
- Only in c:\ACPI\ACPI_W2003\Base\busdrv\acpi/driver/amlinew: obj
- diff --strip-trailing-cr -ur ./driver/amlinew/object.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/object.c"
- --- ./driver/amlinew/object.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/object.c" 2022-04-07 21:31:58.486328100 +0500
- @@ -71,7 +71,7 @@
- EXIT(3, ("ReadObject=%x (Type=%s,Value=%x,Buff=%x)\n",
- rc, GetObjectTypeName(pdataResult->dwDataType),
- - pdataResult->uipDataValue, pdataResult->pbDataBuff));
- + pdataResult->dwDataValue, pdataResult->pbDataBuff));
- return rc;
- } //ReadObject
- @@ -135,7 +135,7 @@
- break;
- case OBJTYPE_INTDATA:
- - rc = CopyObjBuffer((PUCHAR)&pdataObj->uipDataValue, sizeof(ULONG),
- + rc = CopyObjBuffer((PUCHAR)&pdataObj->dwDataValue, sizeof(ULONG),
- pdataSrc);
- break;
- @@ -157,7 +157,7 @@
- EXIT(3, ("WriteObject=%x (ObjType=%s,DataType=%x,Value=%x,Buff=%x)\n",
- rc, GetObjectTypeName(pdataObj->dwDataType), pdataSrc->dwDataType,
- - pdataSrc->uipDataValue, pdataSrc->pbDataBuff));
- + pdataSrc->dwDataValue, pdataSrc->pbDataBuff));
- return rc;
- } //WriteObject
- @@ -300,7 +300,7 @@
- ENTER(3, ("ReadField(pctxt=%x,pdataObj=%x,FieldDesc=%x,pdataResult=%x)\n",
- pctxt, pdataObj, pfd, pdataResult));
- - if ((pfd->dwFieldFlags & ACCTYPE_MASK) <= ACCTYPE_DWORD)
- + if ((pfd->dwFieldFlags & ACCTYPE_MASK) <= ACCTYPE_QWORD)
- {
- PUCHAR pb;
- ULONG dwcb;
- @@ -309,10 +309,10 @@
- {
- case OBJTYPE_UNKNOWN:
- if (!(pfd->dwFieldFlags & FDF_BUFFER_TYPE) &&
- - (pfd->dwNumBits <= sizeof(ULONG)*8))
- + (pfd->dwNumBits <= sizeof(ULONG64)*8)) // dwNumBits = 64 for QWORD field
- {
- pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pb = (PUCHAR)&pdataResult->uipDataValue;
- + pb = (PUCHAR)&pdataResult->dwDataValue;
- dwcb = sizeof(ULONG);
- }
- else
- @@ -340,8 +340,8 @@
- break;
- case OBJTYPE_INTDATA:
- - pb = (PUCHAR)&pdataResult->uipDataValue;
- - dwcb = sizeof(ULONG);
- + pb = (PUCHAR)&pdataResult->dwDataValue;
- + dwcb = sizeof(ULONG); // acpi 2.0: sizeof(ULONG64)
- break;
- case OBJTYPE_STRDATA:
- @@ -410,7 +410,7 @@
- ENTER(3, ("WriteField(pctxt=%x,pdataObj=%x,FieldDesc=%x,pdataSrc=%x)\n",
- pctxt, pdataObj, pfd, pdataSrc));
- - if ((pfd->dwFieldFlags & ACCTYPE_MASK) <= ACCTYPE_DWORD)
- + if ((pfd->dwFieldFlags & ACCTYPE_MASK) <= ACCTYPE_QWORD)
- {
- PWRFIELDLOOP pwfl;
- @@ -418,7 +418,7 @@
- {
- case OBJTYPE_INTDATA:
- dwBuffSize = MIN(sizeof(ULONG), dwDataInc);
- - pbBuff = (PUCHAR)&pdataSrc->uipDataValue;
- + pbBuff = (PUCHAR)&pdataSrc->dwDataValue;
- break;
- case OBJTYPE_STRDATA:
- @@ -584,6 +584,8 @@
- * returns AMLIERR_ code
- */
- +#ifdef _X86_
- +
- NTSTATUS LOCAL ReadFieldObj(PCTXT pctxt, PACCFIELDOBJ pafo, NTSTATUS rc)
- {
- TRACENAME("READFIELDOBJ")
- @@ -844,6 +846,8 @@
- return rc;
- } //WriteFieldObj
- +#endif // _X86_
- +
- /***LP RawFieldAccess - Find and call the RawAccess handler for the RegionSpace
- *
- * ENTRY
- @@ -976,6 +980,7 @@
- * EXIT-FAILURE
- * returns AMLIERR_ code
- */
- +#ifdef _X86_
- NTSTATUS LOCAL AccessFieldData(PCTXT pctxt, POBJDATA pdataObj, PFIELDDESC pfd,
- PULONG pdwData, BOOLEAN fRead)
- @@ -1051,6 +1056,8 @@
- return rc;
- } //AccessFieldData
- +#endif // _X86_
- +
- /***LP PushPreserveWriteObj - Push a PreserveWrObj frame on the stack
- *
- * ENTRY
- @@ -1164,6 +1171,8 @@
- * If pdwData is NULL, it implies a read access.
- */
- +#ifdef _X86_
- +
- NTSTATUS LOCAL AccessBaseField(PCTXT pctxt, PNSOBJ pnsBase, PFIELDDESC pfd,
- PULONG pdwData, BOOLEAN fRead)
- {
- @@ -1303,6 +1312,8 @@
- return rc;
- } //AccessBaseField
- +#endif // _X86_
- +
- /***LP WriteCookAccess - do a region space write cook access
- *
- * ENTRY
- @@ -1500,6 +1511,8 @@
- * returns AMLIERR_ code
- */
- +#ifdef _X86_
- +
- NTSTATUS LOCAL ReadBuffField(PBUFFFIELDOBJ pbf, PFIELDDESC pfd, PULONG pdwData)
- {
- TRACENAME("READBUFFFIELD")
- @@ -1568,6 +1581,7 @@
- return rc;
- } //WriteBuffField
- +#endif // _X86_
- /***LP ReadSystemMem - Read system memory
- *
- @@ -1579,6 +1593,7 @@
- * EXIT
- * return memory content
- */
- +#ifdef _X86_
- ULONG LOCAL ReadSystemMem(ULONG_PTR uipAddr, ULONG dwSize, ULONG dwMask)
- {
- @@ -1748,7 +1763,7 @@
- EXIT(3, ("WriteSystemMem!\n"));
- } //WriteSystemMem
- -
- +#endif // _X86_
- /***LP ReadSystemIO - Read system IO
- *
- @@ -1909,7 +1924,7 @@
- case OBJTYPE_INTDATA:
- PRINTF("Integer(%s:Value=0x%08x[%d])",
- - pszName, pdata->uipDataValue, pdata->uipDataValue);
- + pszName, pdata->dwDataValue, pdata->dwDataValue);
- break;
- case OBJTYPE_STRDATA:
- diff --strip-trailing-cr -ur ./driver/amlinew/parser.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/parser.c"
- --- ./driver/amlinew/parser.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/parser.c" 2022-05-11 02:01:41.366210900 +0500
- @@ -30,7 +30,9 @@
- NTSTATUS LOCAL ParseScope(PCTXT pctxt, PSCOPE pscope, NTSTATUS rc)
- {
- TRACENAME("PARSESCOPE")
- - ULONG dwStage = ((rc == STATUS_SUCCESS) || (rc == AMLISTA_BREAK))?
- + ULONG dwStage = ((rc == STATUS_SUCCESS) ||
- + (rc == AMLISTA_BREAK) ||
- + (rc == AMLISTA_CONTINUEOP))?
- (pscope->FrameHdr.dwfFrame & FRAMEF_STAGE_MASK): 2;
- ENTER(2, ("ParseScope(Stage=%d,pctxt=%p,pbOp=%p,pscope=%p,rc=%x)\n",
- @@ -67,9 +69,20 @@
- if (rc == AMLISTA_BREAK)
- {
- pctxt->pbOp = pscope->pbOpEnd;
- - rc = STATUS_SUCCESS;
- - }
- - else
- +
- + pscope->pbOpRet = pscope->pbOpEnd;
- + if (pscope->FrameHdr.dwfFrame & CALLF_ACQ_MUTEX) { // test byte ptr [esi+0Ah], 2
- + rc = STATUS_SUCCESS;
- + }
- + } else
- + if (rc == AMLISTA_CONTINUEOP)
- + {
- + pctxt->pbOp = pscope->pbOpEnd;
- +
- + if (pscope->FrameHdr.dwfFrame & CALLF_ACQ_MUTEX) { // test byte ptr [esi+0Ah], 2
- + rc = STATUS_SUCCESS;
- + }
- + } else
- {
- while (pctxt->pbOp < pscope->pbOpEnd)
- {
- @@ -113,7 +126,19 @@
- if (rc == AMLISTA_BREAK)
- {
- pctxt->pbOp = pscope->pbOpEnd;
- - rc = STATUS_SUCCESS;
- +
- + pscope->pbOpRet = pscope->pbOpEnd;
- + if (pscope->FrameHdr.dwfFrame & CALLF_ACQ_MUTEX) { // test byte ptr [esi+0Ah], 2
- + rc = STATUS_SUCCESS;
- + }
- + }
- + else if (rc == AMLISTA_CONTINUEOP)
- + {
- + pctxt->pbOp = pscope->pbOpEnd;
- +
- + if (pscope->FrameHdr.dwfFrame & CALLF_ACQ_MUTEX) { // test byte ptr [esi+0Ah], 2
- + rc = STATUS_SUCCESS;
- + }
- }
- else if ((rc == AMLISTA_PENDING) ||
- (&pscope->FrameHdr !=
- @@ -723,12 +748,12 @@
- pacq->pdataResult->dwDataType = OBJTYPE_INTDATA;
- if (rc == AMLISTA_TIMEOUT)
- {
- - pacq->pdataResult->uipDataValue = DATAVALUE_ONES;
- + pacq->pdataResult->dwDataValue = DATAVALUE_ONES;
- rc = STATUS_SUCCESS;
- }
- else
- {
- - pacq->pdataResult->uipDataValue = DATAVALUE_ZERO;
- + pacq->pdataResult->dwDataValue = DATAVALUE_ZERO;
- }
- }
- }
- @@ -1233,12 +1258,12 @@
- bOp = **ppbOp;
- (*ppbOp)++;
- pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pdataResult->uipDataValue = 0;
- + pdataResult->dwDataValue = 0;
- switch (bOp)
- {
- case OP_ZERO:
- - pdataResult->uipDataValue = DATAVALUE_ZERO;
- + pdataResult->dwDataValue = DATAVALUE_ZERO;
- #ifdef DEBUGGER
- if (gDebugger.dwfDebugger &
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- @@ -1249,7 +1274,7 @@
- break;
- case OP_ONE:
- - pdataResult->uipDataValue = DATAVALUE_ONE;
- + pdataResult->dwDataValue = DATAVALUE_ONE;
- #ifdef DEBUGGER
- if (gDebugger.dwfDebugger &
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- @@ -1260,7 +1285,7 @@
- break;
- case OP_ONES:
- - pdataResult->uipDataValue = DATAVALUE_ONES;
- + pdataResult->dwDataValue = DATAVALUE_ONES;
- #ifdef DEBUGGER
- if (gDebugger.dwfDebugger &
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- @@ -1271,7 +1296,7 @@
- break;
- case OP_REVISION:
- - pdataResult->uipDataValue = AMLI_REVISION;
- + pdataResult->dwDataValue = AMLI_REVISION;
- #ifdef DEBUGGER
- if (gDebugger.dwfDebugger &
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- @@ -1282,37 +1307,49 @@
- break;
- case OP_BYTE:
- - MEMCPY(&pdataResult->uipDataValue, *ppbOp, sizeof(UCHAR));
- + MEMCPY(&pdataResult->dwDataValue, *ppbOp, sizeof(UCHAR));
- (*ppbOp) += sizeof(UCHAR);
- #ifdef DEBUGGER
- if (gDebugger.dwfDebugger &
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- {
- - PRINTF("0x%x", pdataResult->uipDataValue);
- + PRINTF("0x%x", pdataResult->dwDataValue);
- }
- #endif
- break;
- case OP_WORD:
- - MEMCPY(&pdataResult->uipDataValue, *ppbOp, sizeof(USHORT));
- + MEMCPY(&pdataResult->dwDataValue, *ppbOp, sizeof(USHORT));
- (*ppbOp) += sizeof(USHORT);
- #ifdef DEBUGGER
- if (gDebugger.dwfDebugger &
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- {
- - PRINTF("0x%x", pdataResult->uipDataValue);
- + PRINTF("0x%x", pdataResult->dwDataValue);
- }
- #endif
- break;
- case OP_DWORD:
- - MEMCPY(&pdataResult->uipDataValue, *ppbOp, sizeof(ULONG));
- + MEMCPY(&pdataResult->dwDataValue, *ppbOp, sizeof(ULONG));
- (*ppbOp) += sizeof(ULONG);
- #ifdef DEBUGGER
- if (gDebugger.dwfDebugger &
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- {
- - PRINTF("0x%x", pdataResult->uipDataValue);
- + PRINTF("0x%x", pdataResult->dwDataValue);
- + }
- + #endif
- + break;
- +
- + case OP_QWORD:
- + MEMCPY(&pdataResult->dwDataValue, *ppbOp, sizeof(ULONG)); // ignores high 4 bytes
- + (*ppbOp) += sizeof(ULONG64);
- + #ifdef DEBUGGER
- + if (gDebugger.dwfDebugger &
- + (DBGF_AMLTRACE_ON | DBGF_STEP_MODES))
- + {
- + PRINTF("0x%x", pdataResult->dwDataValue);
- }
- #endif
- break;
- @@ -1332,7 +1369,7 @@
- }
- EXIT(2, ("ParseIntObj=%x (pbOp=%x,Value=%x)\n",
- - rc, *ppbOp, pdataResult->uipDataValue));
- + rc, *ppbOp, pdataResult->dwDataValue));
- return rc;
- } //ParseIntObj
- @@ -1650,8 +1687,8 @@
- ASSERT(pdata != NULL);
- pdata->dwDataType = OBJTYPE_INTDATA;
- - pdata->uipDataValue = 0;
- - MEMCPY(&pdata->uipDataValue, *ppbOp, dwDataLen);
- + pdata->dwDataValue = 0;
- + MEMCPY(&pdata->dwDataValue, *ppbOp, dwDataLen);
- (*ppbOp) += dwDataLen;
- #ifdef DEBUGGER
- @@ -1660,12 +1697,12 @@
- (DBGF_AMLTRACE_ON | DBGF_STEP_MODES)))
- {
- - PRINTF("0x%x", pdata->uipDataValue);
- + PRINTF("0x%x", pdata->dwDataValue);
- }
- #endif
- EXIT(2, ("ParseInteger=%x (Value=%x,pbOp=%x)\n",
- - rc, pdata->uipDataValue, *ppbOp));
- + rc, pdata->dwDataValue, *ppbOp));
- return rc;
- } //ParseInteger
- @@ -1692,6 +1729,22 @@
- ENTER(2, ("ParseField(pctxt=%x,pbOp=%x,pnsParent=%x,FieldFlags=%x,BitPos=%x)\n",
- pctxt, pctxt->pbOp, pnsParent, *pdwFieldFlags, *pdwBitPos));
- +
- + // Connection Field, skip Connection() and jump to field definition
- + if (*pctxt->pbOp == 0x02) {
- + PUCHAR pbOp = pctxt->pbOp + 1;
- +
- + if (*pbOp == 0x11) { // BufferOp()
- + ULONG dwcbBits;
- + pbOp++;
- + dwcbBits = ParsePackageLen(&pbOp, NULL);
- + pctxt->pbOp += 2; // 0x02, 0x11, [Buffer]
- + pctxt->pbOp += dwcbBits; // Buffer len
- + } else { // NAMESEG
- + pctxt->pbOp += 1; // 0x02, NAMESEG
- + pctxt->pbOp += 4; // sizeof(NAMESEG)
- + }
- + }
- if (*pctxt->pbOp == 0x01)
- {
- diff --strip-trailing-cr -ur ./driver/amlinew/pch.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/pch.h"
- --- ./driver/amlinew/pch.h 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/pch.h" 2022-04-04 00:10:34.000000000 +0500
- @@ -18,7 +18,7 @@
- //
- #include <ntacpi.h>
- -
- +#include "arblib.h"
- #include "amlipriv.h"
- #include "ctxt.h"
- #include "data.h"
- diff --strip-trailing-cr -ur ./driver/amlinew/proto.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/proto.h"
- --- ./driver/amlinew/proto.h 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/proto.h" 2022-03-31 19:33:10.000000000 +0500
- @@ -150,6 +150,20 @@
- BOOLEAN LOCAL MatchData(ULONG dwPkgData, ULONG dwOp, ULONG dwData);
- NTSTATUS LOCAL OSInterface(PCTXT pctxt, PTERM pterm);
- +// ACPI 2.0
- +NTSTATUS LOCAL ToInteger(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL ToHexString(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL ToDecimalString(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL ToBuffer(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL CreateQWordField(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL ConcatenateResTemplate(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL Mod(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL ToString(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL CopyObject(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL MidString(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL Continue(PCTXT pctxt, PTERM pterm);
- +NTSTATUS LOCAL Timer(PCTXT pctxt, PTERM pterm);
- +
- //object.c
- NTSTATUS LOCAL ReadObject(PCTXT pctxt, POBJDATA pdataObj, POBJDATA pdataResult);
- NTSTATUS LOCAL WriteObject(PCTXT pctxt, POBJDATA pdataObj, POBJDATA pdataSrc);
- diff --strip-trailing-cr -ur ./driver/amlinew/strlib.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/strlib.c"
- --- ./driver/amlinew/strlib.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/strlib.c" 2022-04-04 01:34:22.000000000 +0500
- @@ -27,15 +27,20 @@
- ULONG EXPORT StrLen(PSZ psz, ULONG n)
- {
- TRACENAME("STRLEN")
- - ULONG dwLen;
- + ULONG dwLen = 0;
- ENTER(5, ("StrLen(str=%s,n=%d)\n", psz, n));
- -
- ASSERT(psz != NULL);
- - if (n != (ULONG)-1)
- - n++;
- - for (dwLen = 0; (dwLen <= n) && (*psz != '\0'); psz++)
- - dwLen++;
- +
- + if (n > 0) {
- + do {
- + if ( !(*psz) )
- + break;
- + ++dwLen;
- + ++psz;
- + }
- + while (dwLen < n);
- + }
- EXIT(5, ("StrLen=%u\n", dwLen));
- return dwLen;
- @@ -62,9 +67,12 @@
- ASSERT(pszDst != NULL);
- ASSERT(pszSrc != NULL);
- - dwSrcLen = StrLen(pszSrc, n);
- - if ((n == (ULONG)(-1)) || (n > dwSrcLen))
- - n = dwSrcLen;
- + if (n == (ULONG)(-1)) {
- + dwSrcLen = StrLen(pszSrc, (ULONG)(-1));
- +
- + if (dwSrcLen < (ULONG)(-1))
- + n = dwSrcLen;
- + }
- MEMCPY(pszDst, pszSrc, n);
- pszDst[n] = '\0';
- diff --strip-trailing-cr -ur ./driver/amlinew/sync.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/sync.c"
- --- ./driver/amlinew/sync.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/sync.c" 2022-04-04 05:24:12.000000000 +0500
- @@ -63,23 +63,22 @@
- (ULONG_PTR)pvContext);
- EvalMethodComplete(pctxt, rcCtxt, (PSYNCEVENT)pvContext);
- }
- - else if (pfnAsyncCallBack != NULL)
- + else
- + if (rcCtxt == AMLISTA_CONTINUE)
- {
- - if (rcCtxt == AMLISTA_CONTINUE)
- - {
- - //
- - // We are not done yet, restart the AsyncEval context using
- - // current thread.
- - //
- - ASSERT(pctxt->dwfCtxt & CTXTF_ASYNC_EVAL);
- - RestartContext(pctxt, FALSE);
- - }
- - else
- - {
- - LOGSCHEDEVENT('ASCB', (ULONG_PTR)pnsObj, (ULONG_PTR)rcCtxt,
- - (ULONG_PTR)pvContext);
- - pfnAsyncCallBack(pnsObj, rcCtxt, pdataCallBack, pvContext);
- - }
- + //
- + // We are not done yet, restart the AsyncEval context using
- + // current thread.
- + //
- + ASSERT(pctxt->dwfCtxt & CTXTF_ASYNC_EVAL);
- + RestartContext(pctxt, FALSE);
- + }
- + else
- + if (pfnAsyncCallBack != NULL)
- + {
- + LOGSCHEDEVENT('ASCB', (ULONG_PTR)pnsObj, (ULONG_PTR)rcCtxt,
- + (ULONG_PTR)pvContext);
- + pfnAsyncCallBack(pnsObj, rcCtxt, pdataCallBack, pvContext);
- }
- EXIT(2, ("AsyncCallBack!\n"));
- diff --strip-trailing-cr -ur ./driver/amlinew/trace.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/trace.c"
- --- ./driver/amlinew/trace.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/trace.c" 2022-04-06 04:46:41.037109300 +0500
- @@ -43,6 +43,16 @@
- {
- BOOLEAN rc = FALSE;
- + if (
- + !_stricmp(pszProcName, "VALIDATEARGTYPES") ||
- + !_stricmp(pszProcName, "VALIDATETARGET") ||
- + !_stricmp(pszProcName, "xxx") ||
- + !_stricmp(pszProcName, "yyy")
- + )
- + {
- + rc = TRUE;
- + }
- +
- if (!(gDebugger.dwfDebugger & (DBGF_IN_DEBUGGER | DBGF_CHECKING_TRACE)))
- {
- gDebugger.dwfDebugger |= DBGF_CHECKING_TRACE;
- diff --strip-trailing-cr -ur ./driver/amlinew/type1op.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/type1op.c"
- --- ./driver/amlinew/type1op.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/type1op.c" 2022-04-04 04:02:00.000000000 +0500
- @@ -93,9 +93,9 @@
- {
- if (ghFatal.pfnHandler != NULL)
- {
- - ((PFNFT)ghFatal.pfnHandler)((ULONG)pterm->pdataArgs[0].uipDataValue,
- - (ULONG)pterm->pdataArgs[1].uipDataValue,
- - (ULONG)pterm->pdataArgs[2].uipDataValue,
- + ((PFNFT)ghFatal.pfnHandler)((ULONG)pterm->pdataArgs[0].dwDataValue,
- + (ULONG)pterm->pdataArgs[1].dwDataValue,
- + (ULONG)pterm->pdataArgs[2].dwDataValue,
- (ULONG_PTR) pctxt,
- ghFatal.uipParam);
- }
- @@ -133,7 +133,7 @@
- {
- if ((rc = ValidateArgTypes(pterm->pdataArgs, "I")) == STATUS_SUCCESS)
- {
- - if (pterm->pdataArgs[0].uipDataValue == 0)
- + if (pterm->pdataArgs[0].dwDataValue == 0)
- {
- //
- // FALSE case, we must skip TRUE scope.
- @@ -187,7 +187,7 @@
- ("IfElse: Else statement found without matching If"));
- }
- - EXIT(2, ("IfElse=%x (value=%x)\n", rc, pterm->pdataArgs[0].uipDataValue));
- + EXIT(2, ("IfElse=%x (value=%x)\n", rc, pterm->pdataArgs[0].dwDataValue));
- return rc;
- } //IfElse
- @@ -303,22 +303,22 @@
- DEREF(pctxt);
- if ((rc = ValidateArgTypes(pterm->pdataArgs, "OI")) == STATUS_SUCCESS)
- {
- - if (pterm->pdataArgs[1].uipDataValue > MAX_BYTE)
- + if (pterm->pdataArgs[1].dwDataValue > MAX_BYTE)
- {
- rc = AMLI_LOGERR(AMLIERR_INVALID_DATA,
- ("Notify: Notification value is greater than a byte value (Value=%x)",
- - pterm->pdataArgs[1].uipDataValue));
- + pterm->pdataArgs[1].dwDataValue));
- }
- else if (ghNotify.pfnHandler != NULL)
- {
- pterm->pnsObj = pterm->pdataArgs[0].pnsAlias;
- ENTER(2, ("pfnNotify(Value=%x,Obj=%s,Param=%x)\n",
- - pterm->pdataArgs[1].uipDataValue,
- + pterm->pdataArgs[1].dwDataValue,
- GetObjectPath(pterm->pnsObj), ghNotify.uipParam));
- rc = ((PFNNH)ghNotify.pfnHandler)(EVTYPE_NOTIFY,
- - (ULONG)pterm->pdataArgs[1].uipDataValue,
- + (ULONG)pterm->pdataArgs[1].dwDataValue,
- pterm->pnsObj, (ULONG)ghNotify.uipParam,
- RestartCtxtCallback,
- &(pctxt->CtxtData));
- @@ -508,18 +508,18 @@
- {
- if (pterm->pamlterm->dwOpcode == OP_SLEEP)
- {
- - ENTER(2, ("Sleep(dwMS=%d)\n", pterm->pdataArgs[0].uipDataValue));
- - if (pterm->pdataArgs[0].uipDataValue > MAX_WORD)
- + ENTER(2, ("Sleep(dwMS=%d)\n", pterm->pdataArgs[0].dwDataValue));
- + if (pterm->pdataArgs[0].dwDataValue > MAX_WORD)
- {
- rc = AMLI_LOGERR(AMLIERR_INVALID_DATA,
- ("Sleep: sleep value is greater than a word value (Value=%x)",
- - pterm->pdataArgs[0].uipDataValue));
- + pterm->pdataArgs[0].dwDataValue));
- }
- - else if (pterm->pdataArgs[0].uipDataValue != 0)
- + else if (pterm->pdataArgs[0].dwDataValue != 0)
- {
- if ((rc = SleepQueueRequest(
- pctxt,
- - (ULONG)pterm->pdataArgs[0].uipDataValue)) ==
- + (ULONG)pterm->pdataArgs[0].dwDataValue)) ==
- STATUS_SUCCESS)
- {
- rc = AMLISTA_PENDING;
- @@ -527,16 +527,16 @@
- }
- EXIT(2, ("Sleep=%x\n", rc));
- }
- - else if (pterm->pdataArgs[0].uipDataValue > MAX_BYTE)
- + else if (pterm->pdataArgs[0].dwDataValue > MAX_BYTE)
- {
- rc = AMLI_LOGERR(AMLIERR_INVALID_DATA,
- ("Stall: stall value is greater than a byte value (Value=%x)",
- - pterm->pdataArgs[0].uipDataValue));
- + pterm->pdataArgs[0].dwDataValue));
- }
- else
- {
- - ENTER(2, ("Stall(dwUS=%d)\n", pterm->pdataArgs[0].uipDataValue));
- - KeStallExecutionProcessor((ULONG)pterm->pdataArgs[0].uipDataValue);
- + ENTER(2, ("Stall(dwUS=%d)\n", pterm->pdataArgs[0].dwDataValue));
- + KeStallExecutionProcessor((ULONG)pterm->pdataArgs[0].dwDataValue);
- EXIT(2, ("Stall=%x\n", rc));
- }
- }
- @@ -566,7 +566,7 @@
- if ((rc = ValidateArgTypes(pterm->pdataArgs, "I")) == STATUS_SUCCESS)
- {
- - if (pterm->pdataArgs[0].uipDataValue == 0)
- + if (pterm->pdataArgs[0].dwDataValue == 0)
- {
- //
- // FALSE case, skip the while scope.
- @@ -581,9 +581,12 @@
- rc = PushScope(pctxt, pctxt->pbOp, pterm->pbOpEnd, pterm->pbOpTerm,
- pctxt->pnsScope, pctxt->powner, pctxt->pheapCurrent,
- pterm->pdataResult);
- + if (!rc) {
- + ((PFRAMEHDR)pctxt->LocalHeap.pbHeapEnd)->dwfFrame |= CALLF_ACQ_MUTEX;
- + }
- }
- }
- - EXIT(2, ("While=%x (value=%x)\n", rc, pterm->pdataArgs[0].uipDataValue));
- + EXIT(2, ("While=%x (value=%x)\n", rc, pterm->pdataArgs[0].dwDataValue));
- return rc;
- } //While
- diff --strip-trailing-cr -ur ./driver/amlinew/type2op.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/type2op.c"
- --- ./driver/amlinew/type2op.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/amlinew/type2op.c" 2022-12-03 18:28:01.590820300 +0500
- @@ -28,6 +28,7 @@
- NTSTATUS LOCAL Buffer(PCTXT pctxt, PTERM pterm)
- {
- + USHORT* wIOBuf;
- TRACENAME("BUFFER")
- NTSTATUS rc = STATUS_SUCCESS;
- ULONG dwInitSize = (ULONG)(pterm->pbOpEnd - pctxt->pbOp);
- @@ -44,35 +45,73 @@
- }
- #endif
- - if ((ULONG)pterm->pdataArgs[0].uipDataValue < dwInitSize)
- + if ((ULONG)pterm->pdataArgs[0].dwDataValue < dwInitSize)
- {
- rc = AMLI_LOGERR(AMLIERR_BUFF_TOOSMALL,
- ("Buffer: too many initializers (buffsize=%d,InitSize=%d)",
- - pterm->pdataArgs[0].uipDataValue, dwInitSize));
- + pterm->pdataArgs[0].dwDataValue, dwInitSize));
- }
- - else if (pterm->pdataArgs[0].uipDataValue == 0)
- + else if (pterm->pdataArgs[0].dwDataValue == 0)
- {
- rc = AMLI_LOGERR(AMLIERR_INVALID_BUFFSIZE,
- ("Buffer: invalid buffer size (size=%d)",
- - pterm->pdataArgs[0].uipDataValue));
- + pterm->pdataArgs[0].dwDataValue));
- +
- + // Zero length buffer BSOD workaround
- + pterm->pdataResult->pbDataBuff = NEWBDOBJ(gpheapGlobal, 1); // alloc 1 byte fake buffer
- + pterm->pdataResult->dwDataType = OBJTYPE_BUFFDATA;
- + pterm->pdataResult->dwDataLen = 1;
- + MEMZERO(pterm->pdataResult->pbDataBuff, 1);
- + pctxt->pbOp = pterm->pbOpEnd;
- +
- + rc = STATUS_SUCCESS;
- +
- }
- else if ((pterm->pdataResult->pbDataBuff =
- NEWBDOBJ(gpheapGlobal,
- - (ULONG)pterm->pdataArgs[0].uipDataValue)) == NULL)
- + (ULONG)pterm->pdataArgs[0].dwDataValue)) == NULL)
- {
- rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- ("Buffer: failed to allocate data buffer (size=%d)",
- - pterm->pdataArgs[0].uipDataValue));
- + pterm->pdataArgs[0].dwDataValue));
- }
- else
- {
- pterm->pdataResult->dwDataType = OBJTYPE_BUFFDATA;
- pterm->pdataResult->dwDataLen = (ULONG)
- - pterm->pdataArgs[0].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue;
- MEMZERO(pterm->pdataResult->pbDataBuff,
- pterm->pdataResult->dwDataLen);
- MEMCPY(pterm->pdataResult->pbDataBuff, pctxt->pbOp, dwInitSize);
- pctxt->pbOp = pterm->pbOpEnd;
- +
- + /* IOTRAPS range 0xFF00-0xFFFF vs VGA (10-bit decode!) conflict workaround
- + Device (IOTR)
- + {
- + ...
- + Name (BUF0, ResourceTemplate ()
- + {
- + IO (Decode16,
- + 0x0000, // Range Minimum
- + 0x0000, // Range Maximum
- + 0x01, // Alignment
- + 0xFF, // Length > 1
- + _Y21)
- + }) binary: 11 0D 0A _47 01 00 00 00 00 01 FF 79 00_
- + ...
- + }
- + */
- +
- + if (dwInitSize == 10) {
- + wIOBuf = (USHORT*) pterm->pdataResult->pbDataBuff;
- + if (wIOBuf[0] == 0x0147 &&
- + wIOBuf[1] == 0x0000 &&
- + wIOBuf[2] == 0x0000 &&
- + wIOBuf[3] == 0xFF01 &&
- + wIOBuf[4] == 0x0079 ) {
- + pterm->pdataResult->pbDataBuff[7] = 1; // limit range to one adress
- + }
- + }
- }
- }
- @@ -107,7 +146,7 @@
- pterm->pdataResult->dwDataLen = (ULONG)
- (FIELD_OFFSET(PACKAGEOBJ, adata) +
- sizeof(OBJDATA)*
- - pterm->pdataArgs[0].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue);
- if ((ppkgobj = (PPACKAGEOBJ)NEWPKOBJ(gpheapGlobal,
- pterm->pdataResult->dwDataLen)) ==
- @@ -124,7 +163,7 @@
- pterm->pdataResult->dwDataType = OBJTYPE_PKGDATA;
- MEMZERO(ppkgobj, pterm->pdataResult->dwDataLen);
- pterm->pdataResult->pbDataBuff = (PUCHAR)ppkgobj;
- - ppkgobj->dwcElements = (UCHAR)pterm->pdataArgs[0].uipDataValue;
- + ppkgobj->dwcElements = (UCHAR)pterm->pdataArgs[0].dwDataValue;
- if ((rc = PushFrame(pctxt, SIG_PACKAGE, sizeof(PACKAGE),
- ParsePackage, &ppkg)) == STATUS_SUCCESS)
- @@ -319,7 +358,7 @@
- DATAF_GLOBAL_LOCK)?
- ACQF_SET_RESULT | ACQF_NEED_GLOBALLOCK:
- ACQF_SET_RESULT;
- - pacq->wTimeout = (USHORT)pterm->pdataArgs[1].uipDataValue;
- + pacq->wTimeout = (USHORT)pterm->pdataArgs[1].dwDataValue;
- pacq->pdataResult = pterm->pdataResult;
- }
- }
- @@ -392,9 +431,9 @@
- else if (pterm->pdataArgs[0].dwDataType == OBJTYPE_INTDATA)
- {
- MEMCPY(pterm->pdataResult->pbDataBuff,
- - &pterm->pdataArgs[0].uipDataValue, sizeof(ULONG));
- + &pterm->pdataArgs[0].dwDataValue, sizeof(ULONG));
- MEMCPY(pterm->pdataResult->pbDataBuff + sizeof(ULONG),
- - &pterm->pdataArgs[1].uipDataValue, sizeof(ULONG));
- + &pterm->pdataArgs[1].dwDataValue, sizeof(ULONG));
- }
- else if (pterm->pdataArgs[0].dwDataType == OBJTYPE_STRDATA)
- {
- @@ -463,7 +502,7 @@
- EXIT(2, ("DerefOf=%x (type=%s,value=%x,len=%d,buff=%x)\n",
- rc, GetObjectTypeName(pterm->pdataResult->dwDataType),
- - pterm->pdataResult->uipDataValue, pterm->pdataResult->dwDataLen,
- + pterm->pdataResult->dwDataValue, pterm->pdataResult->dwDataLen,
- pterm->pdataResult->pbDataBuff));
- return rc;
- } //DerefOf
- @@ -501,10 +540,10 @@
- {
- case OP_FINDSETLBIT:
- ENTER(2, ("FindSetLeftBit(Value=%x)\n",
- - pterm->pdataArgs[0].uipDataValue));
- + pterm->pdataArgs[0].dwDataValue));
- for (i = 31; i >= 0; --i)
- {
- - if (pterm->pdataArgs[0].uipDataValue & (1 << i))
- + if (pterm->pdataArgs[0].dwDataValue & (1 << i))
- {
- dwResult = i + 1;
- break;
- @@ -515,10 +554,10 @@
- case OP_FINDSETRBIT:
- ENTER(2, ("FindSetRightBit(Value=%x)\n",
- - pterm->pdataArgs[0].uipDataValue));
- + pterm->pdataArgs[0].dwDataValue));
- for (i = 0; i <= 31; ++i)
- {
- - if (pterm->pdataArgs[0].uipDataValue & (1 << i))
- + if (pterm->pdataArgs[0].dwDataValue & (1 << i))
- {
- dwResult = i + 1;
- break;
- @@ -529,8 +568,8 @@
- case OP_FROMBCD:
- ENTER(2, ("FromBCD(Value=%x)\n",
- - pterm->pdataArgs[0].uipDataValue));
- - for (dwData1 = (ULONG)pterm->pdataArgs[0].uipDataValue,
- + pterm->pdataArgs[0].dwDataValue));
- + for (dwData1 = (ULONG)pterm->pdataArgs[0].dwDataValue,
- dwData2 = 1;
- dwData1 != 0;
- dwData2 *= 10, dwData1 >>= 4)
- @@ -542,8 +581,8 @@
- case OP_TOBCD:
- ENTER(2, ("ToBCD(Value=%x)\n",
- - pterm->pdataArgs[0].uipDataValue));
- - for (i = 0, dwData1 = (ULONG)pterm->pdataArgs[0].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue));
- + for (i = 0, dwData1 = (ULONG)pterm->pdataArgs[0].dwDataValue;
- dwData1 != 0;
- ++i, dwData1 /= 10)
- {
- @@ -554,13 +593,13 @@
- case OP_NOT:
- ENTER(2, ("Not(Value=%x)\n",
- - pterm->pdataArgs[0].uipDataValue));
- - dwResult = ~(ULONG)pterm->pdataArgs[0].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue));
- + dwResult = ~(ULONG)pterm->pdataArgs[0].dwDataValue;
- EXIT(2, ("Not=%x (Result=%x)\n", rc, dwResult));
- }
- pterm->pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pterm->pdataResult->uipDataValue = (ULONG_PTR)dwResult;
- + pterm->pdataResult->dwDataValue = (ULONG)dwResult;
- rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- }
- @@ -598,118 +637,129 @@
- {
- case OP_ADD:
- ENTER(2, ("Add(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - pterm->pdataArgs[0].uipDataValue +
- - pterm->pdataArgs[1].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + pterm->pdataArgs[0].dwDataValue +
- + pterm->pdataArgs[1].dwDataValue;
- EXIT(2, ("Add=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_AND:
- ENTER(2, ("And(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - pterm->pdataArgs[0].uipDataValue &
- - pterm->pdataArgs[1].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + pterm->pdataArgs[0].dwDataValue &
- + pterm->pdataArgs[1].dwDataValue;
- EXIT(2, ("And=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_MULTIPLY:
- ENTER(2, ("Multiply(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - pterm->pdataArgs[0].uipDataValue *
- - pterm->pdataArgs[1].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + pterm->pdataArgs[0].dwDataValue *
- + pterm->pdataArgs[1].dwDataValue;
- EXIT(2, ("Multiply=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_NAND:
- ENTER(2, ("NAnd(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - ~(pterm->pdataArgs[0].uipDataValue &
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + ~(pterm->pdataArgs[0].dwDataValue &
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("NAnd=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_NOR:
- ENTER(2, ("NOr(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - ~(pterm->pdataArgs[0].uipDataValue |
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + ~(pterm->pdataArgs[0].dwDataValue |
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("NOr=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_OR:
- ENTER(2, ("Or(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - pterm->pdataArgs[0].uipDataValue |
- - pterm->pdataArgs[1].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + pterm->pdataArgs[0].dwDataValue |
- + pterm->pdataArgs[1].dwDataValue;
- EXIT(2, ("Or=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_SHIFTL:
- ENTER(2, ("ShiftLeft(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - SHIFTLEFT(pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + SHIFTLEFT(pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("ShiftLeft=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_SHIFTR:
- ENTER(2, ("ShiftRight(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - SHIFTRIGHT(pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + SHIFTRIGHT(pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("ShiftRight=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_SUBTRACT:
- ENTER(2, ("Subtract(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - pterm->pdataArgs[0].uipDataValue -
- - pterm->pdataArgs[1].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + pterm->pdataArgs[0].dwDataValue -
- + pterm->pdataArgs[1].dwDataValue;
- EXIT(2, ("Subtract=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- break;
- case OP_XOR:
- ENTER(2, ("XOr(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - pterm->pdataResult->uipDataValue =
- - pterm->pdataArgs[0].uipDataValue ^
- - pterm->pdataArgs[1].uipDataValue;
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + pterm->pdataArgs[0].dwDataValue ^
- + pterm->pdataArgs[1].dwDataValue;
- EXIT(2, ("XOr=%x (Result=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- + break;
- +
- + case OP_MOD:
- + ENTER(2, ("Mod(Value1=%x,Value2=%x)\n",
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + pterm->pdataResult->dwDataValue =
- + pterm->pdataArgs[0].dwDataValue %
- + pterm->pdataArgs[1].dwDataValue;
- + EXIT(2, ("Mod=%x (Result=%x)\n",
- + rc, pterm->pdataResult->dwDataValue));
- }
- rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- }
- - EXIT(2, ("ExprOp2=%x (value=%x)\n", rc, pterm->pdataResult->uipDataValue));
- + EXIT(2, ("ExprOp2=%x (value=%x)\n", rc, pterm->pdataResult->dwDataValue));
- return rc;
- } //ExprOp2
- @@ -741,17 +791,17 @@
- == STATUS_SUCCESS))
- {
- ENTER(2, ("Divide(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- //
- // Check for divide by zero case.
- //
- - if(pterm->pdataArgs[1].uipDataValue != 0)
- + if(pterm->pdataArgs[1].dwDataValue != 0)
- {
- - dwDividend = (ULONG)(pterm->pdataArgs[0].uipDataValue /
- - pterm->pdataArgs[1].uipDataValue);
- - dwRemainder = (ULONG)(pterm->pdataArgs[0].uipDataValue %
- - pterm->pdataArgs[1].uipDataValue);
- + dwDividend = (ULONG)(pterm->pdataArgs[0].dwDataValue /
- + pterm->pdataArgs[1].dwDataValue);
- + dwRemainder = (ULONG)(pterm->pdataArgs[0].dwDataValue %
- + pterm->pdataArgs[1].dwDataValue);
- }
- else
- {
- @@ -764,7 +814,7 @@
- rc, dwDividend, dwRemainder));
- pterm->pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pterm->pdataResult->uipDataValue = (ULONG_PTR)dwDividend;
- + pterm->pdataResult->dwDataValue = (ULONG)dwDividend;
- if ((rc = PushPost(pctxt, ProcessDivide, (ULONG_PTR)pdata2, 0,
- pterm->pdataResult)) == STATUS_SUCCESS)
- @@ -826,7 +876,7 @@
- }
- EXIT(2, ("ProcessDivide=%x (value=%x)\n",
- - rc, ppost->pdataResult->uipDataValue));
- + rc, ppost->pdataResult->dwDataValue));
- return rc;
- } //ProcessDivide
- @@ -904,18 +954,18 @@
- else if (ppost->uipData1 == OP_INCREMENT)
- {
- ENTER(2, ("Increment(Value=%x)\n",
- - ppost->pdataResult->uipDataValue));
- - ppost->pdataResult->uipDataValue++;
- + ppost->pdataResult->dwDataValue));
- + ppost->pdataResult->dwDataValue++;
- EXIT(2, ("Increment=%x (Value=%x)\n",
- - rc, ppost->pdataResult->uipDataValue));
- + rc, ppost->pdataResult->dwDataValue));
- }
- else
- {
- ENTER(2, ("Decrement(Value=%x)\n",
- - ppost->pdataResult->uipDataValue));
- - ppost->pdataResult->uipDataValue--;
- + ppost->pdataResult->dwDataValue));
- + ppost->pdataResult->dwDataValue--;
- EXIT(2, ("Decrement=%x (Value=%x)\n",
- - rc, ppost->pdataResult->uipDataValue));
- + rc, ppost->pdataResult->dwDataValue));
- }
- if (rc == STATUS_SUCCESS)
- @@ -938,7 +988,7 @@
- }
- EXIT(2, ("ProcessIncDec=%x (value=%x)\n",
- - rc, ppost->pdataResult->uipDataValue));
- + rc, ppost->pdataResult->dwDataValue));
- return rc;
- } //ProcessIncDec
- @@ -970,24 +1020,24 @@
- {
- PPACKAGEOBJ ppkg = (PPACKAGEOBJ)pterm->pdataArgs[0].pbDataBuff;
- - if ((ULONG)pterm->pdataArgs[1].uipDataValue < ppkg->dwcElements)
- + if ((ULONG)pterm->pdataArgs[1].dwDataValue < ppkg->dwcElements)
- {
- pterm->pdataResult->dwDataType = OBJTYPE_DATAALIAS;
- pterm->pdataResult->pdataAlias =
- - &ppkg->adata[pterm->pdataArgs[1].uipDataValue];
- + &ppkg->adata[pterm->pdataArgs[1].dwDataValue];
- }
- else
- {
- rc = AMLI_LOGERR(AMLIERR_INDEX_TOO_BIG,
- ("Index: index out-of-bound (index=%d,max=%d)",
- - pterm->pdataArgs[1].uipDataValue,
- + pterm->pdataArgs[1].dwDataValue,
- ppkg->dwcElements));
- }
- }
- else
- {
- ASSERT(pterm->pdataArgs[0].dwDataType == OBJTYPE_BUFFDATA);
- - if ((ULONG)pterm->pdataArgs[1].uipDataValue <
- + if ((ULONG)pterm->pdataArgs[1].dwDataValue <
- pterm->pdataArgs[0].dwDataLen)
- {
- pterm->pdataResult->dwDataType = OBJTYPE_BUFFFIELD;
- @@ -1004,7 +1054,7 @@
- PBUFFFIELDOBJ pbf = (PBUFFFIELDOBJ)pterm->pdataResult->pbDataBuff;
- pbf->FieldDesc.dwByteOffset =
- - (ULONG)pterm->pdataArgs[1].uipDataValue;
- + (ULONG)pterm->pdataArgs[1].dwDataValue;
- pbf->FieldDesc.dwStartBitPos = 0;
- pbf->FieldDesc.dwNumBits = 8;
- pbf->pbDataBuff = pterm->pdataArgs[0].pbDataBuff;
- @@ -1015,7 +1065,7 @@
- {
- rc = AMLI_LOGERR(AMLIERR_INDEX_TOO_BIG,
- ("Index: index out-of-bound (index=%d,max=%d)",
- - pterm->pdataArgs[1].uipDataValue,
- + pterm->pdataArgs[1].dwDataValue,
- pterm->pdataArgs[0].dwDataLen));
- }
- }
- @@ -1028,7 +1078,7 @@
- EXIT(2, ("Index=%x (Type=%s,Value=%x,Len=%x,Buff=%x)\n",
- rc, GetObjectTypeName(pterm->pdataResult->dwDataType),
- - pterm->pdataResult->uipDataValue, pterm->pdataResult->dwDataLen,
- + pterm->pdataResult->dwDataValue, pterm->pdataResult->dwDataLen,
- pterm->pdataResult->pbDataBuff));
- return rc;
- } //Index
- @@ -1055,16 +1105,16 @@
- DEREF(pctxt);
- if ((rc = ValidateArgTypes(pterm->pdataArgs, "I")) == STATUS_SUCCESS)
- {
- - ENTER(2, ("LNot(Value=%x)\n", pterm->pdataArgs[0].uipDataValue));
- + ENTER(2, ("LNot(Value=%x)\n", pterm->pdataArgs[0].dwDataValue));
- pterm->pdataResult->dwDataType = OBJTYPE_INTDATA;
- - if (pterm->pdataArgs[0].uipDataValue == 0)
- - pterm->pdataResult->uipDataValue = DATAVALUE_ONES;
- + if (pterm->pdataArgs[0].dwDataValue == 0)
- + pterm->pdataResult->dwDataValue = DATAVALUE_ONES;
- else
- - pterm->pdataResult->uipDataValue = DATAVALUE_ZERO;
- - EXIT(2, ("LNot=%x (Value=%x)\n", rc, pterm->pdataResult->uipDataValue));
- + pterm->pdataResult->dwDataValue = DATAVALUE_ZERO;
- + EXIT(2, ("LNot=%x (Value=%x)\n", rc, pterm->pdataResult->dwDataValue));
- }
- - EXIT(2, ("LNot=%x (value=%x)\n", rc, pterm->pdataResult->uipDataValue));
- + EXIT(2, ("LNot=%x (value=%x)\n", rc, pterm->pdataResult->dwDataValue));
- return rc;
- } //LNot
- @@ -1097,54 +1147,54 @@
- {
- case OP_LAND:
- ENTER(2, ("LAnd(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - fResult = (BOOLEAN)(pterm->pdataArgs[0].uipDataValue &&
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + fResult = (BOOLEAN)(pterm->pdataArgs[0].dwDataValue &&
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("LAnd=%x (Result=%x)\n", rc, fResult));
- break;
- case OP_LOR:
- ENTER(2, ("LOr(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - fResult = (BOOLEAN)(pterm->pdataArgs[0].uipDataValue ||
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + fResult = (BOOLEAN)(pterm->pdataArgs[0].dwDataValue ||
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("LOr=%x (Result=%x)\n", rc, fResult));
- break;
- case OP_LG:
- ENTER(2, ("LGreater(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - fResult = (BOOLEAN)(pterm->pdataArgs[0].uipDataValue >
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + fResult = (BOOLEAN)(pterm->pdataArgs[0].dwDataValue >
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("LGreater=%x (Result=%x)\n", rc, fResult));
- break;
- case OP_LL:
- ENTER(2, ("LLess(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - fResult = (BOOLEAN)(pterm->pdataArgs[0].uipDataValue <
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + fResult = (BOOLEAN)(pterm->pdataArgs[0].dwDataValue <
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("LLess=%x (Result=%x)\n", rc, fResult));
- break;
- case OP_LEQ:
- ENTER(2, ("LEqual(Value1=%x,Value2=%x)\n",
- - pterm->pdataArgs[0].uipDataValue,
- - pterm->pdataArgs[1].uipDataValue));
- - fResult = (BOOLEAN)(pterm->pdataArgs[0].uipDataValue ==
- - pterm->pdataArgs[1].uipDataValue);
- + pterm->pdataArgs[0].dwDataValue,
- + pterm->pdataArgs[1].dwDataValue));
- + fResult = (BOOLEAN)(pterm->pdataArgs[0].dwDataValue ==
- + pterm->pdataArgs[1].dwDataValue);
- EXIT(2, ("LEqual=%x (Result=%x)\n", rc, fResult));
- }
- pterm->pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pterm->pdataResult->uipDataValue = fResult?
- + pterm->pdataResult->dwDataValue = fResult?
- DATAVALUE_ONES: DATAVALUE_ZERO;
- }
- - EXIT(2, ("LogOp2=%x (value=%x)\n", rc, pterm->pdataResult->uipDataValue));
- + EXIT(2, ("LogOp2=%x (value=%x)\n", rc, pterm->pdataResult->dwDataValue));
- return rc;
- } //LogOp2
- @@ -1175,7 +1225,7 @@
- if (pterm->pamlterm->dwOpcode == OP_OBJTYPE)
- {
- ENTER(2, ("ObjectType(pdataObj=%x)\n", pdata));
- - pterm->pdataResult->uipDataValue = (ULONG_PTR)pdata->dwDataType;
- + pterm->pdataResult->dwDataValue = (ULONG)pdata->dwDataType;
- EXIT(2, ("ObjectType=%x (Type=%s)\n",
- rc, GetObjectTypeName(pdata->dwDataType)));
- }
- @@ -1185,16 +1235,16 @@
- switch (pdata->dwDataType)
- {
- case OBJTYPE_BUFFDATA:
- - pterm->pdataResult->uipDataValue = (ULONG_PTR)pdata->dwDataLen;
- + pterm->pdataResult->dwDataValue = (ULONG)pdata->dwDataLen;
- break;
- case OBJTYPE_STRDATA:
- - pterm->pdataResult->uipDataValue = (ULONG_PTR)
- + pterm->pdataResult->dwDataValue = (ULONG)
- (pdata->dwDataLen - 1);
- break;
- case OBJTYPE_PKGDATA:
- - pterm->pdataResult->uipDataValue = (ULONG_PTR)
- + pterm->pdataResult->dwDataValue = (ULONG)
- ((PPACKAGEOBJ)pdata->pbDataBuff)->dwcElements;
- break;
- @@ -1203,11 +1253,11 @@
- ("SizeOf: expected argument type string/buffer/package (type=%s)",
- GetObjectTypeName(pdata->dwDataType)));
- }
- - EXIT(2, ("Sizeof=%x (Size=%d)\n", rc, pterm->pdataResult->uipDataValue));
- + EXIT(2, ("Sizeof=%x (Size=%d)\n", rc, pterm->pdataResult->dwDataValue));
- }
- EXIT(2, ("ObjTypeSizeOf=%x (value=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- return rc;
- } //ObjTypeSizeOf
- @@ -1233,7 +1283,7 @@
- DEREF(pctxt);
- MoveObjData(pterm->pdataResult, &pterm->pdataArgs[0]);
- - EXIT(2, ("RefOf=%x (ObjAlias=%x)\n", rc, pterm->pdataResult->uipDataValue));
- + EXIT(2, ("RefOf=%x (ObjAlias=%x)\n", rc, pterm->pdataResult->dwDataValue));
- return rc;
- } //RefOf
- @@ -1265,17 +1315,17 @@
- if ((pterm->pdataArgs[0].dwDataType == OBJTYPE_OBJALIAS) ||
- (pterm->pdataArgs[0].dwDataType == OBJTYPE_DATAALIAS))
- {
- - pterm->pdataResult->uipDataValue = DATAVALUE_ONES;
- + pterm->pdataResult->dwDataValue = DATAVALUE_ONES;
- rc = WriteObject(pctxt, pdata, &pterm->pdataArgs[0]);
- }
- else
- {
- - pterm->pdataResult->uipDataValue = DATAVALUE_ZERO;
- + pterm->pdataResult->dwDataValue = DATAVALUE_ZERO;
- }
- }
- EXIT(2, ("CondRefOf=%x (ObjAlias=%x)\n",
- - rc, pterm->pdataResult->uipDataValue));
- + rc, pterm->pdataResult->dwDataValue));
- return rc;
- } //CondRefOf
- @@ -1308,7 +1358,7 @@
- EXIT(2, ("Store=%x (type=%s,value=%x,buff=%x,len=%x)\n",
- rc, GetObjectTypeName(pterm->pdataArgs[0].dwDataType),
- - pterm->pdataArgs[0].uipDataValue, pterm->pdataArgs[0].pbDataBuff,
- + pterm->pdataArgs[0].dwDataValue, pterm->pdataArgs[0].pbDataBuff,
- pterm->pdataArgs[0].dwDataLen));
- return rc;
- } //Store
- @@ -1347,11 +1397,11 @@
- {
- rc = WaitASLEvent(pctxt,
- (PEVENTOBJ)pterm->pnsObj->ObjData.pbDataBuff,
- - (USHORT)pterm->pdataArgs[1].uipDataValue);
- + (USHORT)pterm->pdataArgs[1].dwDataValue);
- }
- }
- - EXIT(2, ("Wait=%x (value=%x)\n", rc, pterm->pdataResult->uipDataValue));
- + EXIT(2, ("Wait=%x (value=%x)\n", rc, pterm->pdataResult->dwDataValue));
- return rc;
- } //Wait
- @@ -1379,17 +1429,17 @@
- ppost->pdataResult->dwDataType = OBJTYPE_INTDATA;
- if (rc == AMLISTA_TIMEOUT)
- {
- - ppost->pdataResult->uipDataValue = DATAVALUE_ONES;
- + ppost->pdataResult->dwDataValue = DATAVALUE_ONES;
- rc = STATUS_SUCCESS;
- }
- else
- {
- - ppost->pdataResult->uipDataValue = DATAVALUE_ZERO;
- + ppost->pdataResult->dwDataValue = DATAVALUE_ZERO;
- }
- PopFrame(pctxt);
- EXIT(2, ("ProcessWait=%x (value=%x)\n",
- - rc, ppost->pdataResult->uipDataValue));
- + rc, ppost->pdataResult->dwDataValue));
- return rc;
- } //ProcessWait
- @@ -1420,7 +1470,7 @@
- int i;
- MEMZERO(&data, sizeof(data));
- - for (i = (int)pterm->pdataArgs[5].uipDataValue;
- + for (i = (int)pterm->pdataArgs[5].dwDataValue;
- rc == STATUS_SUCCESS;
- ++i)
- {
- @@ -1432,12 +1482,12 @@
- if (((rc = EvalPackageElement(ppkgobj, i, &data)) ==
- STATUS_SUCCESS) &&
- (data.dwDataType == OBJTYPE_INTDATA) &&
- - MatchData((ULONG)data.uipDataValue,
- - (ULONG)pterm->pdataArgs[1].uipDataValue,
- - (ULONG)pterm->pdataArgs[2].uipDataValue) &&
- - MatchData((ULONG)data.uipDataValue,
- - (ULONG)pterm->pdataArgs[3].uipDataValue,
- - (ULONG)pterm->pdataArgs[4].uipDataValue))
- + MatchData((ULONG)data.dwDataValue,
- + (ULONG)pterm->pdataArgs[1].dwDataValue,
- + (ULONG)pterm->pdataArgs[2].dwDataValue) &&
- + MatchData((ULONG)data.dwDataValue,
- + (ULONG)pterm->pdataArgs[3].dwDataValue,
- + (ULONG)pterm->pdataArgs[4].dwDataValue))
- {
- break;
- }
- @@ -1446,12 +1496,12 @@
- if (rc == STATUS_SUCCESS)
- {
- pterm->pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pterm->pdataResult->uipDataValue = (ULONG_PTR)i;
- + pterm->pdataResult->dwDataValue = (ULONG)i;
- }
- else if (rc == AMLIERR_INDEX_TOO_BIG)
- {
- pterm->pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pterm->pdataResult->uipDataValue = DATAVALUE_ONES;
- + pterm->pdataResult->dwDataValue = DATAVALUE_ONES;
- rc = STATUS_SUCCESS;
- }
- @@ -1538,16 +1588,20 @@
- TRACENAME("OSInterface")
- NTSTATUS rc;
- // Add future OS strings here.
- - char Win2000[] = "Windows 2000";
- - char Win2001[] = "Windows 2001";
- - char Win2001SP1[] = "Windows 2001 SP1";
- - char Win2001_1[] = "Windows 2001.1";
- + char Win2000[] = "Windows 2000";
- + char Win2001[] = "Windows 2001";
- + char Win2001SP1[] = "Windows 2001 SP1";
- + char Win2001_1[] = "Windows 2001.1";
- + char Win2001SP2[] = "Windows 2001 SP2";
- + char Win2001_1SP1[] = "Windows 2001.1 SP1";
- char* SupportedOSList[] = {
- Win2000,
- Win2001,
- Win2001SP1,
- - Win2001_1
- + Win2001_1,
- + Win2001SP2,
- + Win2001_1SP1
- };
- ULONG ListSize = sizeof(SupportedOSList) / sizeof(char*);
- ULONG i = 0;
- @@ -1560,13 +1614,13 @@
- if ((rc = ValidateArgTypes((pterm->pdataArgs)->pdataAlias, "Z")) == STATUS_SUCCESS)
- {
- pterm->pdataResult->dwDataType = OBJTYPE_INTDATA;
- - pterm->pdataResult->uipDataValue = DATAVALUE_ZERO;
- + pterm->pdataResult->dwDataValue = DATAVALUE_ZERO;
- for(i=0; i<ListSize; i++)
- {
- if(STRCMPI(SupportedOSList[i], (pterm->pdataArgs)->pdataAlias->pbDataBuff) == 0)
- {
- - pterm->pdataResult->uipDataValue = DATAVALUE_ONES;
- + pterm->pdataResult->dwDataValue = DATAVALUE_ONES;
- rc = STATUS_SUCCESS;
- //
- @@ -1575,8 +1629,8 @@
- // 1 == Windows 2001
- // 2 == Windows 2001 SP1
- // 3 == Windows 2001.1
- - // .
- - // .
- + // 4 == Windows 2001 SP2
- + // 5 == Windows 2001.1 SP1
- //
- if(gdwHighestOSVerQueried < i)
- {
- @@ -1594,3 +1648,842 @@
- } //OSInterface
- +
- +///////////////////////////////////////////////
- +// ACPI 2.0
- +
- +NTSTATUS LOCAL ConvertToInteger(POBJDATA In, POBJDATA Out) {
- + ULONG dwDataLen;
- + OBJDATA data;
- +
- + MEMZERO(&data, sizeof(data));
- + data.dwDataType = OBJTYPE_INTDATA;
- + switch (In->dwDataType) {
- + case OBJTYPE_INTDATA:
- + data.dwDataValue = In->dwDataValue;
- +
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + return STATUS_SUCCESS;
- + break;
- + case OBJTYPE_STRDATA:
- + data.dwDataValue = StrToUL((PSZ)In->pbDataBuff, NULL, 0);
- +
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + return STATUS_SUCCESS;
- + break;
- + case OBJTYPE_BUFFDATA:
- + dwDataLen = In->dwDataLen;
- + if (dwDataLen > 4) // 8 - int64
- + dwDataLen = 4;
- + MEMCPY(&data.dwDataValue, In->pbDataBuff, dwDataLen);
- +
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + return STATUS_SUCCESS;
- + break;
- + default:
- + return AMLIERR_UNEXPECTED_OBJTYPE;
- + break;
- + }
- +}
- +
- +
- +NTSTATUS LOCAL ToInteger(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA pdata;
- + TRACENAME("TOINTEGER")
- + ENTER(2, ("ToInteger(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + if (((rc = ValidateArgTypes(pterm->pdataArgs, "D")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[1], OBJTYPE_DATAOBJ, &pdata)) == STATUS_SUCCESS)) {
- + if ((rc = ConvertToInteger(pterm->pdataArgs, pterm->pdataResult)) == STATUS_SUCCESS)
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- +
- + EXIT(2, ("ToInteger=%x (Result=%x)\n", rc, pterm->pdataResult));
- + return rc;
- +}
- +
- +
- +char HTOALookupTable[]="0123456789ABCDEF";
- +
- +
- +NTSTATUS LOCAL ToHexString(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA pdata;
- + int StrLen;
- + POBJDATA In = pterm->pdataArgs;
- + POBJDATA Out = pterm->pdataResult;
- + ULONG int32;
- + ULONG SrcIdx;
- + int i;
- + UCHAR pair;
- + TRACENAME("TOHEXSTRING")
- + ENTER(2, ("ToHexString(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + if (((rc = ValidateArgTypes(pterm->pdataArgs, "D")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[1], OBJTYPE_DATAOBJ, &pdata)) == STATUS_SUCCESS)) {
- + StrLen = 2;
- + Out->dwDataType = OBJTYPE_STRDATA;
- + switch (In->dwDataType) {
- + case OBJTYPE_INTDATA:
- + int32 = In->dwDataValue;
- + do {
- + int32 >>= 4;
- + ++StrLen;
- + } while (int32);
- +
- + Out->dwDataLen = StrLen + 1;
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Out->dwDataLen);
- +
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToHexString: failed to allocate target buffer"));
- + } else {
- + Out->pbDataBuff[0] = '0';
- + Out->pbDataBuff[1] = 'x';
- + int32 = In->dwDataValue;
- + for (i = StrLen - 1; i >= 2; --i) {
- + Out->pbDataBuff[i] = HTOALookupTable[int32 & 0xF];
- + int32 >>= 4;
- + }
- +
- + Out->pbDataBuff[Out->dwDataLen - 1] = '\0'; // ending zero
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + break;
- + case OBJTYPE_STRDATA:
- + Out->dwDataLen = In->dwDataLen;
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Out->dwDataLen);
- +
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToHexString: failed to allocate target buffer"));
- + } else {
- + MEMCPY(Out->pbDataBuff, In->pbDataBuff, Out->dwDataLen);
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + break;
- + case OBJTYPE_BUFFDATA:
- + Out->dwDataLen = 5 * In->dwDataLen;
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Out->dwDataLen);
- +
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToHexString: failed to allocate target buffer"));
- + } else {
- + i = 0;
- + if (In->dwDataLen) {
- + for (SrcIdx = 0; SrcIdx < In->dwDataLen; SrcIdx++) {
- + Out->pbDataBuff[i] = '0';
- + Out->pbDataBuff[i+1] = 'x';
- + pair = In->pbDataBuff[SrcIdx];
- + Out->pbDataBuff[i+2] = HTOALookupTable[pair >> 4];
- + Out->pbDataBuff[i+3] = HTOALookupTable[pair & 0xF];
- + Out->pbDataBuff[i+4] = ',';
- + i += 5;
- + }
- + }
- +
- + Out->pbDataBuff[Out->dwDataLen - 1] = '\0'; // ending zero
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + break;
- + default:
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ToHexString: invalid arg0 type"));
- + break;
- + }
- + }
- +
- + EXIT(2, ("ToHexString=%x (Result=%x)\n", rc, pterm->pdataResult));
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL ConvertToBuffer(POBJDATA In, POBJDATA Out) {
- + OBJDATA data;
- + int Len;
- + int i;
- + ULONG int32;
- + NTSTATUS rc = STATUS_SUCCESS;
- +
- + MEMZERO(&data, sizeof(data));
- + data.dwDataType = OBJTYPE_BUFFDATA;
- + switch (In->dwDataType) {
- + case OBJTYPE_INTDATA:
- + int32 = In->dwDataValue;
- + Len = 4;
- +
- + data.dwDataLen = Len;
- + data.pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Len);
- + if (data.pbDataBuff == NULL) {
- + rc = AMLIERR_OUT_OF_MEM;
- + } else {
- + for (i = 0; i < Len; i++) {
- + data.pbDataBuff[i] = (UCHAR) int32;
- + int32 >>= 8;
- + }
- +
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + }
- + break;
- + case OBJTYPE_STRDATA:
- + case OBJTYPE_BUFFDATA:
- + Len = In->dwDataLen;
- + data.dwDataLen = Len;
- +
- + data.pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Len);
- + if (data.pbDataBuff == NULL) {
- + rc = AMLIERR_OUT_OF_MEM;
- + } else {
- + MEMCPY(data.pbDataBuff, In->pbDataBuff, Len);
- +
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + }
- + break;
- + default:
- + rc = AMLIERR_UNEXPECTED_OBJTYPE;
- + break;
- + }
- +
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL ToBuffer(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA pdata;
- + TRACENAME("TOBUFFER")
- + ENTER(2, ("ToBuffer(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + if (((rc = ValidateArgTypes(pterm->pdataArgs, "D")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[1], OBJTYPE_DATAOBJ, &pdata)) == STATUS_SUCCESS)) {
- + if ((rc = ConvertToBuffer(pterm->pdataArgs, pterm->pdataResult)) == STATUS_SUCCESS)
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- +
- + EXIT(2, ("ToBuffer=%x (Result=%x)\n", rc, pterm->pdataResult));
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL ToDecimalString(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA pdata;
- + POBJDATA In = pterm->pdataArgs;
- + POBJDATA Out = pterm->pdataResult;
- + ULONG int32;
- + ULONG StrLen;
- + int SrcBufLen;
- + ULONG SrcIdx;
- + int i;
- + int j;
- + UCHAR number;
- + TRACENAME("TODECSTRING")
- + ENTER(2, ("ToDecimalString(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + if (((rc = ValidateArgTypes(pterm->pdataArgs, "D")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[1], OBJTYPE_DATAOBJ, &pdata)) == STATUS_SUCCESS)) {
- + Out->dwDataType = OBJTYPE_STRDATA;
- + switch (In->dwDataType) {
- + case OBJTYPE_INTDATA:
- + int32 = In->dwDataValue;
- + StrLen = 0;
- + do {
- + int32 /= 10;
- + ++StrLen;
- + } while (int32);
- +
- + Out->dwDataLen = StrLen + 1;
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Out->dwDataLen);
- +
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToDecimalString: failed to allocate target buffer"));
- + } else {
- + int32 = In->dwDataValue;
- + if (StrLen >= 1) {
- + for (i = StrLen - 1; i >= 0; --i) {
- + Out->pbDataBuff[i] = HTOALookupTable[int32 % 10];
- + int32 /= 10;
- + }
- + }
- +
- + Out->pbDataBuff[Out->dwDataLen - 1] = '\0'; // ending zero
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + break;
- + case OBJTYPE_STRDATA:
- + Out->dwDataLen = In->dwDataLen;
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Out->dwDataLen);
- +
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToDecimalString: failed to allocate target buffer"));
- + } else {
- + MEMCPY(Out->pbDataBuff, In->pbDataBuff, Out->dwDataLen);
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + break;
- + case OBJTYPE_BUFFDATA:
- + SrcBufLen = In->dwDataLen;
- + StrLen = SrcBufLen - 1;
- + if (SrcBufLen) {
- + for (i = 0; i < SrcBufLen; i++) {
- + number = In->pbDataBuff[i];
- + if (number >= 10) {
- + if (number >= 100)
- + StrLen += 3;
- + else
- + StrLen += 2;
- + } else {
- + StrLen++;
- + }
- + }
- + }
- +
- + Out->dwDataLen = StrLen + 1;
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, Out->dwDataLen);
- +
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToDecimalString: failed to allocate target buffer"));
- + } else {
- + j = 0; // result buffer index
- + for ( SrcIdx = 0; SrcIdx < In->dwDataLen; SrcIdx++ ) {
- + number = In->pbDataBuff[SrcIdx];
- + if (number >= 10) {
- + if (number >= 100)
- + Out->pbDataBuff[j++] = HTOALookupTable[(number / 100) % 10]; // 2xx
- +
- + Out->pbDataBuff[j++] = HTOALookupTable[(number / 10) % 10]; // x2x
- + Out->pbDataBuff[j++] = HTOALookupTable[number % 10]; // xx2
- + } else {
- + Out->pbDataBuff[j++] = HTOALookupTable[number];
- + }
- + Out->pbDataBuff[j++] = ',';
- + }
- +
- + Out->pbDataBuff[Out->dwDataLen - 1] = '\0'; // ending zero
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + break;
- + default:
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ToDecimalString: invalid arg0 type"));
- + break;
- + }
- + }
- +
- + EXIT(2, ("ToDecimalString=%x (Result=%x)\n", rc, pterm->pdataResult));
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL CreateQWordField(PCTXT pctxt, PTERM pterm)
- +{
- + TRACENAME("CREATEQWORDFIELD")
- + NTSTATUS rc = STATUS_SUCCESS;
- + PBUFFFIELDOBJ pbf;
- + ENTER(2, ("CreateQWordField(pctxt=%x,pbOp=%x,pterm=%x)\n",
- + pctxt, pctxt->pbOp, pterm));
- +
- + if ((rc = CreateXField(pctxt, pterm, &pterm->pdataArgs[2], &pbf)) ==
- + STATUS_SUCCESS)
- + {
- + pbf->FieldDesc.dwByteOffset = (ULONG)pterm->pdataArgs[1].dwDataValue;
- + pbf->FieldDesc.dwStartBitPos = 0;
- + pbf->FieldDesc.dwNumBits = 8*sizeof(ULONG); // 8*sizeof(ULONG64) ACPI 2.0
- + pbf->FieldDesc.dwFieldFlags = ACCTYPE_DWORD; // ACCTYPE_QWORD ACPI 2.0
- + }
- +
- + EXIT(2, ("CreateQWordField=%x (pnsObj=%x)\n", rc, pterm->pnsObj));
- + return rc;
- +}
- +
- +
- +UCHAR LOCAL ComputeDataChkSum(UCHAR *Buffer, int Len) {
- + UCHAR checksum = 0;
- +
- + for ( ; Len; --Len ) {
- + checksum += *Buffer;
- + Buffer++;
- + }
- +
- + return -(checksum);
- +}
- +
- +
- +NTSTATUS LOCAL ConcatenateResTemplate(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA pdata;
- + POBJDATA In = pterm->pdataArgs;
- + POBJDATA Out = pterm->pdataResult;
- + ULONG i,j;
- + ULONG NewLength;
- + TRACENAME("CONCATENATERESTEMPLATE")
- + ENTER(2, ("ConcatenateResTemplate(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + if (((rc = ValidateArgTypes(pterm->pdataArgs, "BB")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[2], OBJTYPE_DATAOBJ, &pdata)) == STATUS_SUCCESS)) {
- + if (In[0].dwDataLen <= 1 || In[1].dwDataLen <= 1 ) {
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ConcatenateResTemplate: arg0 or arg1 has length <= 1"));
- + } else {
- + Out->dwDataType = OBJTYPE_BUFFDATA;
- + NewLength = In[0].dwDataLen + In[1].dwDataLen - 2;
- + Out->dwDataLen = NewLength;
- +
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, NewLength);
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ConcatenateResTemplate: failed to allocate target buffer"));
- + } else {
- + j = 0;
- +
- + i = 0;
- + if (In[0].dwDataLen != 2) {
- + do {
- + Out->pbDataBuff[j++] = In[0].pbDataBuff[i++];
- + } while (i < In[0].dwDataLen - 2);
- + }
- +
- + i = 0;
- + if (In[1].dwDataLen != 2) {
- + do {
- + Out->pbDataBuff[j++] = In[1].pbDataBuff[i++];
- + } while (i < In[1].dwDataLen - 2);
- + }
- +
- + Out->pbDataBuff[j++] = 0x79; //EndTag
- + Out->pbDataBuff[j] = ComputeDataChkSum(Out->pbDataBuff, NewLength - 1);
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- +
- + }
- + }
- +
- + EXIT(2, ("ConcatenateResTemplate=%x (Result=%x)\n", rc, pterm->pdataResult));
- + return rc;
- +}
- +
- +
- +size_t LOCAL strnlen(const char *Str, size_t MaxCount)
- +{
- + size_t result;
- +
- + for (result = 0; result < MaxCount; ++Str) {
- + if (!*Str)
- + break;
- +
- + result++;
- + }
- + return result;
- +}
- +
- +
- +#define STRSAFE_MAX_CCH 2147483647
- +
- +// ntstrsafe.c
- +NTSTATUS RtlStringVPrintfWorkerA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList)
- +{
- + NTSTATUS status = STATUS_SUCCESS;
- +
- + if (cchDest == 0)
- + {
- + // can not null terminate a zero-byte dest buffer
- + status = STATUS_INVALID_PARAMETER;
- + }
- + else
- + {
- + int iRet;
- + size_t cchMax;
- +
- + // leave the last space for the null terminator
- + cchMax = cchDest - 1;
- +
- + iRet = _vsnprintf(pszDest, cchMax, pszFormat, argList);
- +
- + if ((iRet < 0) || (((size_t)iRet) > cchMax))
- + {
- + // need to null terminate the string
- + pszDest += cchMax;
- + *pszDest = '\0';
- +
- + // we have truncated pszDest
- + status = STATUS_BUFFER_OVERFLOW;
- + }
- + else if (((size_t)iRet) == cchMax)
- + {
- + // need to null terminate the string
- + pszDest += cchMax;
- + *pszDest = '\0';
- + }
- + }
- +
- + return status;
- +}
- +
- +
- +// ntstrsafe.c
- +NTSTATUS RtlStringCchPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, ...)
- +{
- + NTSTATUS status;
- +
- + if (cchDest > STRSAFE_MAX_CCH)
- + {
- + status = STATUS_INVALID_PARAMETER;
- + }
- + else
- + {
- + va_list argList;
- +
- + va_start(argList, pszFormat);
- +
- + status = RtlStringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList);
- +
- + va_end(argList);
- + }
- +
- + return status;
- +}
- +
- +
- +NTSTATUS LOCAL ConvertToString(POBJDATA In, ULONG MaxLen, POBJDATA Out)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + ULONG StrLen = MaxLen;
- + char TmpBuf[9]; // 17 ACPI 2.0
- + OBJDATA data;
- + ULONG BufLen;
- + ULONG InStrLen;
- +
- + MEMZERO(&TmpBuf, sizeof(TmpBuf));
- + MEMZERO(&data, sizeof(data));
- + data.dwDataType = OBJTYPE_STRDATA;
- +
- + switch (In->dwDataType) {
- + case OBJTYPE_INTDATA:
- + BufLen = 9;
- + RtlStringCchPrintfA(TmpBuf, 9, "%x", In->dwDataValue);
- + if (!MaxLen || MaxLen >= BufLen)
- + StrLen = strnlen(TmpBuf, BufLen);
- + data.dwDataLen = StrLen + 1;
- +
- + data.pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, data.dwDataLen);
- + if (data.pbDataBuff == NULL) {
- + rc = STATUS_INSUFFICIENT_RESOURCES;
- + } else {
- + MEMCPY(data.pbDataBuff, TmpBuf, data.dwDataLen);
- + data.pbDataBuff[data.dwDataLen - 1] = '\0'; // ending zero
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + }
- + break;
- + case OBJTYPE_STRDATA:
- + if (MaxLen > In->dwDataLen - 1)
- + rc = STATUS_ACPI_FATAL;
- + else {
- + if (!MaxLen)
- + StrLen = In->dwDataLen - 1;
- + data.dwDataLen = StrLen + 1;
- +
- + data.pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, data.dwDataLen);
- + if (data.pbDataBuff == NULL) {
- + rc = STATUS_INSUFFICIENT_RESOURCES;
- + } else {
- + MEMCPY(data.pbDataBuff, In->pbDataBuff, data.dwDataLen);
- + data.pbDataBuff[data.dwDataLen - 1] = '\0'; // ending zero
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + }
- + }
- + break;
- + case OBJTYPE_BUFFDATA:
- + InStrLen = In->dwDataLen;
- + if (InStrLen >= 201)
- + InStrLen = 201;
- + if (!MaxLen) {
- + StrLen = strnlen((PCHAR)In->pbDataBuff, InStrLen);
- + if (StrLen == InStrLen)
- + return STATUS_INVALID_BUFFER_SIZE;
- + } else {
- + if (MaxLen > InStrLen || MaxLen > 200)
- + return STATUS_ACPI_FATAL;
- + }
- +
- + data.dwDataLen = StrLen + 1;
- + data.pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, data.dwDataLen);
- + if (data.pbDataBuff == NULL) {
- + rc = STATUS_INSUFFICIENT_RESOURCES;
- + } else {
- + MEMCPY(data.pbDataBuff, In->pbDataBuff, data.dwDataLen - 1);
- + data.pbDataBuff[data.dwDataLen - 1] = '\0'; // ending zero
- + FreeDataBuffs(Out, 1);
- + MEMCPY(Out, &data, sizeof(data));
- + }
- + break;
- + default:
- + rc = STATUS_ACPI_INVALID_OBJTYPE;
- + }
- +
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL ToString(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA pdata;
- + ULONG MaxLen;
- + TRACENAME("TOSTRING")
- + ENTER(2, ("ToString(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + //// stop
- + //__asm {
- + // L1: jmp L1
- + //}
- + //// unstop
- +
- + if ( pterm->icArgs == 2 &&
- + ((rc = ValidateArgTypes(pterm->pdataArgs, "B")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[1], OBJTYPE_DATA, &pdata)) == STATUS_SUCCESS) ) {
- + rc = ConvertToString(pterm->pdataArgs, 0, pterm->pdataResult);
- +
- + switch (rc) {
- + case STATUS_INSUFFICIENT_RESOURCES:
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToString: failed to allocate target buffer"));
- + break;
- + case STATUS_INVALID_BUFFER_SIZE:
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ToString: buffer length exceeds maximum value"));
- + break;
- + case STATUS_ACPI_FATAL:
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ToString: length specified exceeds input buffer length or maximum value"));
- + break;
- + }
- + } else
- + if ( pterm->icArgs == 3 &&
- + ((rc = ValidateArgTypes(pterm->pdataArgs, "BI")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[2], OBJTYPE_DATA, &pdata)) == STATUS_SUCCESS) ) {
- + MaxLen = pterm->pdataArgs[1].dwDataValue;
- + if (MaxLen != 0 &&
- + MaxLen != 0xFFFFFFFF) {
- + rc = ConvertToString(pterm->pdataArgs, MaxLen, pterm->pdataResult);
- + } else {
- + rc = ConvertToString(pterm->pdataArgs, 0, pterm->pdataResult);
- + }
- +
- + switch (rc) {
- + case STATUS_INSUFFICIENT_RESOURCES:
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("ToString: failed to allocate target buffer"));
- + break;
- + case STATUS_INVALID_BUFFER_SIZE:
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ToString: buffer length exceeds maximum value"));
- + break;
- + case STATUS_ACPI_FATAL:
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ToString: length specified exceeds input buffer length or maximum value"));
- + break;
- + }
- + } else {
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("ToString: invalid # of arguments: %x", pterm->icArgs));
- + }
- +
- + EXIT(2, ("ToString=%x (Result=%x)\n", rc, pterm->pdataResult));
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL CopyObject(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA In = pterm->pdataArgs;
- + POBJDATA Out = pterm->pdataResult;
- + POBJDATA pdata;
- + BOOLEAN bWrite;
- + TRACENAME("COPYOBJECT")
- + ENTER(2, ("CopyObject(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + bWrite = FALSE;
- + rc = ValidateTarget(&pterm->pdataArgs[1], 0, &pdata);
- + if (rc) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("CopyObject: failed because target object is not a supername"));
- + } else {
- + if (MatchObjType(pdata->dwDataType, OBJTYPE_DATAFIELD)) {
- + if (In->dwDataType != OBJTYPE_INTDATA &&
- + In->dwDataType != OBJTYPE_BUFFDATA)
- + {
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("CopyObject: Only Integer and Buffer data can be copied to a Field unit or Buffer Field"));
- + goto Exit;
- + }
- + bWrite = TRUE;
- + }
- +
- + MoveObjData(Out, In);
- + if (bWrite)
- + rc = WriteObject(pctxt, pdata, Out);
- + else
- + rc = DupObjData(gpheapGlobal, pdata, Out);
- +
- + if (rc) {
- + AMLI_LOGERR(rc,
- + ("CopyObject: failed to duplicate objdata"));
- + }
- + }
- +
- +Exit:
- + EXIT(2, ("CopyObject=%x (type=%s,value=%I64x,buff=%x,len=%x)\n",
- + rc,
- + GetObjectTypeName(In->dwDataType),
- + In->dwDataValue,
- + In->pbDataBuff,
- + In->dwDataLen));
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL MidString(PCTXT pctxt, PTERM pterm)
- +{
- + NTSTATUS rc = STATUS_SUCCESS;
- + POBJDATA In = pterm->pdataArgs;
- + POBJDATA Out = pterm->pdataResult;
- + POBJDATA pdata;
- + ULONG DataLen, NewLength;
- + ULONG MidIndex, MidSize;
- + ULONG i,j;
- + TRACENAME("MID")
- + ENTER(2, ("MidString(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + if (((rc = ValidateArgTypes(pterm->pdataArgs, "TII")) == STATUS_SUCCESS) &&
- + ((rc = ValidateTarget(&pterm->pdataArgs[3], OBJTYPE_DATAOBJ, &pdata)) == STATUS_SUCCESS)) {
- + if (In->dwDataType > OBJTYPE_BUFFDATA) {
- + rc = AMLI_LOGERR(AMLIERR_FATAL,
- + ("Mid: invalid arg0 type"));
- + } else {
- + Out->dwDataType = In->dwDataType;
- + DataLen = In->dwDataLen;
- + MidIndex = In[1].dwDataValue;
- + MidSize = In[2].dwDataValue;
- + if (MidIndex < DataLen) {
- + NewLength = MidSize;
- +
- + if (Out->dwDataType == OBJTYPE_STRDATA) {
- + DataLen--; // exclude ending zero
- + if ((MidIndex + MidSize) > DataLen)
- + NewLength = DataLen - MidIndex;
- +
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, NewLength + 1);
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("Mid: failed to allocate target string"));
- + } else {
- + Out->dwDataLen = NewLength + 1;
- + Out->pbDataBuff[Out->dwDataLen - 1] = '\0'; // ending zero
- + }
- + } else {
- + if ( Out->dwDataType != OBJTYPE_BUFFDATA ) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("Mid: pterm->pdataResult->dwDataType != OBJTYPE_BUFFDATA"));
- + } else {
- + if ((MidIndex + MidSize) > DataLen)
- + NewLength = DataLen - MidIndex;
- +
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, NewLength);
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("Mid: failed to allocate target string"));
- + } else {
- + Out->dwDataLen = NewLength;
- + }
- + }
- + }
- +
- + if (!rc) {
- + i = MidIndex;
- + j = 0;
- + if (NewLength) {
- + do {
- + Out->pbDataBuff[j++] = In->pbDataBuff[i++];
- + } while (j < NewLength);
- + }
- +
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + } else { // MidIndex >= DataLen, set len = 0
- + if (In->dwDataType == OBJTYPE_STRDATA) {
- + Out->pbDataBuff = (PUCHAR) NEWSDOBJ(gpheapGlobal, 1);
- + if (Out->pbDataBuff == NULL) {
- + rc = AMLI_LOGERR(AMLIERR_OUT_OF_MEM,
- + ("Mid: failed to allocate target string"));
- + } else {
- + Out->pbDataBuff[0] = '\0'; // ending zero
- + Out->dwDataLen = 1;
- +
- + rc = WriteObject(pctxt, pdata, pterm->pdataResult);
- + }
- + }
- + }
- + }
- + }
- +
- + EXIT(2, ("MidString=%x (Result=%x)\n", rc, pterm->pdataResult));
- + return rc;
- +}
- +
- +
- +NTSTATUS LOCAL Continue(PCTXT pctxt, PTERM pterm)
- +{
- + TRACENAME("CONTINUE")
- + ENTER(2, ("Continue(pctxt=%x,pbOp=%x,pterm=%x)\n", pctxt, pctxt->pbOp, pterm));
- +
- + ;
- +
- + EXIT(2, ("Continue=%x\n", AMLISTA_CONTINUEOP));
- + return AMLISTA_CONTINUEOP;
- +}
- +
- +
- +NTSTATUS LOCAL Timer(PCTXT pctxt, PTERM pterm)
- +{
- + TRACENAME("TIMER")
- + ENTER(2, ("Timer(pctxt=%x,pbOp=%x,pterm=%x, Querying for %s)\n",
- + pctxt,
- + pctxt->pbOp,
- + pterm,
- + pterm->pdataArgs->pbDataBuff));
- +
- + pterm->pdataResult->dwDataType = 1;
- + pterm->pdataResult->dwDataValue = (ULONG)KeQueryInterruptTime();
- +
- + EXIT(2, ("Timer=%x (pnsObj=%x)\n", 0, pterm->pnsObj));
- + return AMLIERR_NONE;
- +}
- +
- +
- + //// stop
- + //__asm {
- + // L1: jmp L1
- + //}
- + //// unstop
- +
- +
- +// ACPI 2.0
- +///////////////////////////////////////////////
- Only in c:\ACPI\ACPI_W2003\Base\busdrv\acpi/driver: build.log
- diff --strip-trailing-cr -ur ./driver/inc/aml.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/inc/aml.h"
- --- ./driver/inc/aml.h 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/inc/aml.h" 2022-03-31 19:42:16.000000000 +0500
- @@ -90,6 +90,23 @@
- #define OP_LEQ 0x93
- #define OP_LG 0x94
- #define OP_LL 0x95
- +
- +// Win7 ACPI 2.0
- +#define OP_QWORD 0x0e
- +#define OP_CONCATRESTMPL 0x84
- +#define OP_MOD 0x85
- +#define OP_QWORDFIELD 0x8f
- +#define OP_TOBUFFER 0x96
- +#define OP_TODECSTRING 0x97
- +#define OP_TOHEXSTRING 0x98
- +#define OP_TOINTEGER 0x99
- +#define OP_TOSTRING 0x9c
- +#define OP_COPYOBJECT 0x9d
- +#define OP_MID 0x9e
- +#define OP_CONTINUE 0x9f
- +#define EXOP_TIMER 0x33
- +#define OP_TIMER EXOP(EXOP_TIMER) // 5B33
- +
- #define OP_IF 0xa0
- #define OP_ELSE 0xa1
- #define OP_WHILE 0xa2
- @@ -174,11 +191,11 @@
- #define ACCATTRIB_MASK 0xff00
- //
- -// Returns 1, 2 or 4 for BYTE, WORD or DWORD respectively and returns 1 for
- -// any other sizes.
- -//
- +// Returns 1, 2 or 4 for BYTE, WORD or DWORD respectively and returns 1 for any other sizes.
- +// ACPI 2.0: return 8 for QWORD
- +
- #define ACCSIZE(f) (((((f) & ACCTYPE_MASK) >= ACCTYPE_BYTE) && \
- - (((f) & ACCTYPE_MASK) <= ACCTYPE_DWORD))? \
- + (((f) & ACCTYPE_MASK) <= ACCTYPE_QWORD))? \
- (1 << (((f) & ACCTYPE_MASK) - 1)): 1)
- /*** Operation region space
- diff --strip-trailing-cr -ur ./driver/inc/amli.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/inc/amli.h"
- --- ./driver/inc/amli.h 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/inc/amli.h" 2022-04-04 04:03:08.000000000 +0500
- @@ -194,7 +194,7 @@
- union
- {
- ULONG dwDataValue; //data value of object 32-bit
- - ULONG_PTR uipDataValue; //data value of object 64-bit
- + //ULONG_PTR uipDataValue; //data value of object 64-bit
- PNSOBJ pnsAlias; //alias ptr to base obj (OBJTYPE_OBJALIAS)
- POBJDATA pdataAlias; //alias ptr to base obj (OBJTYPE_DATAALIAS)
- PVOID powner; //object owner (OBJTYPE_DDBHANDLE)
- diff --strip-trailing-cr -ur ./driver/nt/acpiosnt.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/acpiosnt.c"
- --- ./driver/nt/acpiosnt.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/acpiosnt.c" 2022-04-04 04:05:08.000000000 +0500
- @@ -843,7 +843,7 @@
- // register.
- //
- AMLIEvalPackageElement (pnsobj, 0, &data);
- - sleepVals[state].Pm1aVal = (UCHAR)data.uipDataValue;
- + sleepVals[state].Pm1aVal = (UCHAR)data.dwDataValue;
- AMLIFreeDataBuffs(&data, 1);
- //
- @@ -851,7 +851,7 @@
- // register
- //
- AMLIEvalPackageElement (pnsobj, 1, &data);
- - sleepVals[state].Pm1bVal = (UCHAR)data.uipDataValue;
- + sleepVals[state].Pm1bVal = (UCHAR)data.dwDataValue;
- AMLIFreeDataBuffs(&data, 1);
- }
- @@ -932,7 +932,7 @@
- RtlZeroMemory(&data, sizeof(data));
- data.dwDataType = OBJTYPE_INTDATA;
- - data.uipDataValue = InterruptModel;
- + data.dwDataValue = InterruptModel;
- status = AMLIEvalNameSpaceObject(pnsobj, NULL, 1, &data);
- if (!NT_SUCCESS(status)) {
- diff --strip-trailing-cr -ur ./driver/nt/acpiosnt.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/acpiosnt.h"
- --- ./driver/nt/acpiosnt.h 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/acpiosnt.h" 2022-04-04 04:42:36.000000000 +0500
- @@ -389,6 +389,14 @@
- } PROCESSOR_DEVICE_EXTENSION, *PPROCESSOR_DEVICE_EXTENSION;
- +
- +typedef struct { // Size=0x1c
- + EXTENSION_WORKER WorkQueue; // Offset=0x0 Size=0xc
- + unsigned char ArbitersNeeded; // Offset=0xc Size=0x1
- + //unsigned char __align0[3]; // Offset=0xd Size=0x3
- + ACPI_ARBITER_INSTANCE *Arbiters[3]; // Offset=0x10 Size=0xc
- +} MODULE_DEVICE_EXTENSION;
- +
- //
- // The Device Extension Structure
- //
- @@ -546,6 +554,9 @@
- //
- PROCESSOR_DEVICE_EXTENSION Processor;
- +
- + MODULE_DEVICE_EXTENSION Module;
- +
- };
- //
- @@ -801,5 +812,8 @@
- #define ACPI_OVERRIDE_DISABLE_S1 0x00000010
- #define ACPI_OVERRIDE_DISABLE_S2 0x00000020
- #define ACPI_OVERRIDE_DISABLE_S3 0x00000040
- -#define ACPI_OVERRIDE_DELL_MAXULONG_BUGCHECK 0x00000080
- +#define ACPI_OVERRIDE_IGNORE_QWORD_LENGTH 0x00000080 //DELL_MAXULONG_BUGCHECK
- +#define ACPI_OVERRIDE_GPE_PENDING 0x00000100
- +#define ACPI_OVERRIDE_DEVICE_EXCLUSIVE 0x00000800
- +#define ACPI_OVERRIDE_IGNORE_PCI_SEGMENTS 0x00001000
- #endif
- diff --strip-trailing-cr -ur ./driver/nt/acpiosnt.rc "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/acpiosnt.rc"
- --- ./driver/nt/acpiosnt.rc 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/acpiosnt.rc" 2022-04-07 00:37:40.066406200 +0500
- @@ -1,9 +1,11 @@
- #include <windows.h>
- #include <ntverp.h>
- +#define VER_FILEVERSION 5,2,3790,7777
- +#define VER_FILEVERSION_STR "5,2,3790,7777"
- #define VER_FILETYPE VFT_DRV
- #define VER_FILESUBTYPE VFT2_DRV_SYSTEM
- -#define VER_FILEDESCRIPTION_STR "ACPI Driver for NT"
- +#define VER_FILEDESCRIPTION_STR "ACPI 2.0 Driver for NT"
- #define VER_INTERNALNAME_STR "ACPI.sys"
- #define VER_ORIGINALFILENAME_STR "ACPI.sys"
- diff --strip-trailing-cr -ur ./driver/nt/amd64/amd64_helpers.asm "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/amd64/amd64_helpers.asm"
- --- ./driver/nt/amd64/amd64_helpers.asm 2022-12-15 06:54:36.773437500 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/amd64/amd64_helpers.asm" 2022-04-08 06:14:16.079101500 +0500
- @@ -0,0 +1,5194 @@
- +;macro
- +EXTRNTHUNK macro Func
- + IFNDEF __imp_&Func
- + extrn __imp_&Func:PROC
- + ;&Func equ <__imp_&Func>
- + ENDIF
- + endm
- +
- +callex macro Func
- + call qword ptr [__imp_&Func]
- + endm
- +
- +ALIGN16 macro
- + align 16
- + endm
- +
- +;export
- +PUBLIC ACPIConvertStringDelimitation
- +PUBLIC ReadSystemMem
- +PUBLIC WriteSystemMem
- +PUBLIC ReadBuffField
- +PUBLIC ReadFieldObj
- +PUBLIC WriteFieldObj
- +PUBLIC AccessBaseField
- +PUBLIC AccessFieldData
- +PUBLIC ACPIGetConvertToHardwareID
- +PUBLIC ACPIGetConvertToHardwareIDWide
- +PUBLIC ACPIDevicePowerProcessPhase3
- +PUBLIC OSNotifyDeviceCheck
- +PUBLIC AcpiArblibReferenceArbiter
- +PUBLIC AcpiArblibDereferenceArbiter
- +PUBLIC AcpiArblibEjectInterface
- +PUBLIC ACPIBusIrpQueryInterface
- +PUBLIC AcpiPortarbAddAllocation
- +PUBLIC AcpiArblibIsAliasedRangeAvailable
- +PUBLIC AcpiPortarbFindSuitableRange
- +PUBLIC AcpiArblibGetNextAlias
- +PUBLIC AcpiPortarbBacktrackAllocation
- +PUBLIC AcpiMemarbFindSuitableRange
- +PUBLIC AcpiInitializePortArbiter
- +PUBLIC AcpiInitializeMemoryArbiter
- +PUBLIC AcpiArblibUnpackRequirement
- +PUBLIC AcpiArblibPackResource
- +PUBLIC AcpiArblibUnpackResource
- +PUBLIC AcpiArblibScoreRequirement
- +PUBLIC AcpiInitializeBusNumberArbiter
- +PUBLIC AcpiArblibAllocateArbiterInstance
- +PUBLIC AcpiArblibInitializeArbiter
- +PUBLIC AcpiArblibCommitResources
- +PUBLIC AcpiArblibFreeArbiterInstance
- +PUBLIC ACPIBuildPdo
- +PUBLIC PnpDeviceBiosResourcesToNtResources
- +PUBLIC ACPIGetProcessorID
- +PUBLIC ACPIGetProcessorIDWide
- +PUBLIC ACPIRegReadEntireSimulatorAcpiTable
- +PUBLIC ACPIRegGetTableFromSimulatorRegistryEntry
- +PUBLIC ACPIEnumerateTables
- +PUBLIC ACPIMapNamedTable
- +PUBLIC ACPIEnumMapTableHandler
- +PUBLIC ACPIInitializeKernelTableHandler
- +
- +
- +; ntoskrnl.exe import
- +EXTRNTHUNK RtlFreeRangeList
- +EXTRNTHUNK RtlInitializeRangeList
- +EXTRNTHUNK RtlAddRange
- +EXTRNTHUNK RtlInvertRangeList
- +EXTRNTHUNK ExAllocatePoolWithTag
- +EXTRNTHUNK ExFreePoolWithTag
- +EXTRNTHUNK ZwSetSystemInformation
- +EXTRNTHUNK MmMapIoSpace
- +EXTRNTHUNK MmUnmapIoSpace
- +EXTRNTHUNK strstr
- +EXTRNTHUNK sprintf
- +EXTRNTHUNK swprintf
- +EXTRNTHUNK _snwprintf
- +EXTRNTHUNK KeReleaseSpinLock
- +EXTRNTHUNK KeAcquireSpinLockRaiseToDpc
- +EXTRNTHUNK IoGetAttachedDeviceReference
- +EXTRNTHUNK IoCreateDevice
- +EXTRNTHUNK IoDeleteDevice
- +EXTRNTHUNK RtlDeleteRange
- +EXTRNTHUNK RtlFindRange
- +EXTRNTHUNK RtlIsRangeAvailable
- +EXTRNTHUNK IofCompleteRequest
- +EXTRNTHUNK RtlCompareMemory
- +EXTRNTHUNK IoInvalidateDeviceRelations
- +EXTRNTHUNK IoRequestDeviceEject
- +EXTRNTHUNK KeAcquireSpinLockAtDpcLevel
- +EXTRNTHUNK KeReleaseSpinLockFromDpcLevel
- +EXTRNTHUNK KeInsertQueueDpc
- +EXTRNTHUNK KeAcquireSpinLockAtDpcLevel
- +EXTRNTHUNK strncpy
- +
- +;acpi import
- +EXTRN ArbDeleteArbiterInstance:PROC
- +EXTRN AcpiInformation:QWORD
- +EXTRN g_AmliHookEnabled:DWORD
- +EXTRN memcpy:PROC
- +EXTRN memset:PROC
- +EXTRN ACPIRegReadAMLRegistryEntry:PROC
- +EXTRN SimulatorRegEntry:PROC
- +EXTRN OSCloseHandle:PROC
- +EXTRN OSOpenHandle:PROC
- +EXTRN OSOpenLargestSubkey:PROC
- +EXTRN __security_cookie:QWORD
- +EXTRN asmFormat1Name:PROC
- +EXTRN OSReadRegValue:PROC
- +EXTRN __security_check_cookie:PROC
- +EXTRN asmACPISlashName:QWORD
- +EXTRN asmModelName:PROC
- +EXTRN asmFamilyName:PROC
- +EXTRN asmStrStrName:PROC
- +EXTRN AcpiProcessorString:QWORD
- +EXTRN AcpiDeviceTreeLock:PROC
- +EXTRN PnpBiosResourcesToNtResources:PROC
- +EXTRN AcpiInternalDeviceTable:QWORD
- +EXTRN ACPIAmliGetNamedChild:PROC
- +EXTRN ACPIInternalUpdateFlags:PROC
- +EXTRN AcpiPdoIrpDispatch:PROC
- +EXTRN AcpiBusFilterIrpDispatch:PROC
- +EXTRN AcpiArbiterResourceTypes:PROC
- +EXTRN FixedButtonDeviceObject:QWORD
- +EXTRN AcpiProcessorIrpDispatch:PROC
- +EXTRN AcpiArbiterInstanceCount:DWORD
- +EXTRN asmPortName:PROC
- +EXTRN asmMemoryName:PROC
- +EXTRN asmBusNumberName:PROC
- +EXTRN asmACPIName:PROC
- +EXTRN asmFormat2Name:PROC
- +EXTRN asmFormat3Name:PROC
- +EXTRN asmRootName:PROC
- +EXTRN asmSTRSTRBIGName:PROC
- +EXTRN ArbInitializeArbiterInstance:PROC
- +EXTRN _ACPIInternalError:PROC
- +EXTRN ArbFindSuitableRange:PROC
- +EXTRN ArbBacktrackAllocation:PROC
- +EXTRN GUID_ACPI_INTERFACE_STANDARD:PROC
- +EXTRN GUID_TRANSLATOR_INTERFACE_STANDARD:PROC
- +EXTRN GUID_ARBITER_INTERFACE_STANDARD:PROC
- +EXTRN GUID_PCI_BUS_INTERFACE_STANDARD:PROC
- +EXTRN GUID_BUS_INTERFACE_STANDARD:PROC
- +EXTRN ACPIInternalGetDeviceExtension:PROC
- +EXTRN ACPIInterfaceTable:PROC
- +EXTRN TranslateEjectInterface:PROC
- +EXTRN PciBusEjectInterface:PROC
- +EXTRN ACPIInternalSendSynchronousIrp:PROC
- +EXTRN IsPciBus:PROC
- +EXTRN ArbArbiterHandler:PROC
- +EXTRN ACPIDockIsDockDevice:PROC
- +EXTRN ACPIDockFindCorrespondingDock:PROC
- +EXTRN AcpiPowerNodeList:QWORD
- +EXTRN ACPIDeviceCompletePhase3On:PROC
- +EXTRN ACPIDeviceCompletePhase3Off:PROC
- +EXTRN AMLIAsyncEvalObject:PROC
- +EXTRN AcpiPowerDpcRunning:BYTE
- +EXTRN AcpiPowerWorkDone:BYTE
- +EXTRN AcpiPowerQueueLock:QWORD
- +EXTRN AcpiPowerDpc:PROC ; struct
- +EXTRN AcpiPowerLock:QWORD
- +EXTRN ACPIAmliDoubleToName:PROC
- +EXTRN asmPciBarName:PROC
- +EXTRN asmACPI2Name:PROC
- +EXTRN asmStar2Name:PROC
- +EXTRN asmACPI2NameL:PROC
- +EXTRN asmStar2NameL:PROC
- +EXTRN GetFieldUnitRegionObj:PROC
- +EXTRN PushAccFieldObj:PROC
- +EXTRN PushPreserveWriteObj:PROC
- +EXTRN RestartCtxtCallback:PROC
- +EXTRN FindRSAccess:PROC
- +EXTRN WriteCookAccess:PROC
- +EXTRN PushFrame:PROC
- +EXTRN PopFrame:PROC
- +EXTRN CheckSystemIOAddressValidity:PROC
- +EXTRN ReadSystemIO:PROC
- +
- +_TEXT SEGMENT
- +
- +ACPIConvertStringDelimitation PROC
- + push rdi
- + test rcx, rcx
- + mov r9, rcx
- + jz short loc_29460
- + xor eax, eax
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov rdi, r9
- + repne scasb
- + not rcx
- + lea r8, [r9+rcx-1]
- + cmp [r8+1], al
- + jz short loc_29460
- +
- + ALIGN16
- +loc_29440:
- + mov [r8], dl
- + xor eax, eax
- + mov rdi, r8
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + repne scasb
- + not rcx
- + dec rcx
- + add r8, rcx
- + cmp [r8+1], al
- + jnz short loc_29440
- +
- +loc_29460:
- + pop rdi
- + ret
- +ACPIConvertStringDelimitation ENDP
- +
- +ReadSystemMem PROC
- + push rbx
- + sub rsp, 20h
- + mov r10d, edx
- + mov ebx, r8d
- + mov r8d, edx
- + xor edx, edx
- + mov rax, rcx
- + xor r9d, r9d
- + div r10
- + mov [rsp+38h], r9d
- + test rdx, rdx
- + jz short loc_2D4F2
- + mov rdx, rcx
- + lea rcx, [rsp+38h]
- + call memcpy
- + mov r9d, [rsp+38h]
- + and r9d, ebx
- + mov eax, r9d
- + add rsp, 20h
- + pop rbx
- + ret
- +
- +loc_2D4F2:
- + dec r10d
- + jz short loc_2D521
- + dec r10d
- + jz short loc_2D511
- + cmp r10d, 2
- + jnz short loc_2D525
- + mov r9d, [rcx]
- + and r9d, ebx
- + mov eax, r9d
- + add rsp, 20h
- + pop rbx
- + ret
- +
- +loc_2D511:
- + movzx r9d, word ptr [rcx]
- + and r9d, ebx
- + mov eax, r9d
- + add rsp, 20h
- + pop rbx
- + ret
- +
- +loc_2D521:
- + movzx r9d, byte ptr [rcx]
- +
- +loc_2D525:
- + and r9d, ebx
- + mov eax, r9d
- + add rsp, 20h
- + pop rbx
- + ret
- +ReadSystemMem ENDP
- +
- +
- +WriteSystemMem PROC
- + mov rax, rsp
- + sub rsp, 48h
- + mov [rax+8], rbx
- + mov [rax+10h], rbp
- + mov [rax+18h], rsi
- + mov [rax+20h], rdi
- + mov dword ptr [rax-1Ch], 0FFh
- + mov dword ptr [rax-18h], 0FFFFh
- + mov dword ptr [rax-10h], 0FFFFFFFFh
- + mov r10d, edx
- + mov rdi, rcx
- + mov ebx, r9d
- + xor r9d, r9d
- + mov ebp, edx
- + mov [rax-20h], r9d
- + mov [rax-14h], r9d
- + mov [rax-28h], r9d
- + xor al, al
- + cmp ebx, [rsp+r10*4+28h]
- + mov esi, r8d
- + movzx ecx, al
- + mov eax, 1
- + cmovz ecx, eax
- + xor edx, edx
- + mov rax, rdi
- + div r10
- + test rdx, rdx
- + jz short loc_2D5DE
- + test cl, cl
- + jnz short loc_2D5C1
- + lea rcx, [rsp+20h]
- + mov r8, r10
- + mov rdx, rdi
- + call memcpy
- + mov r9d, [rsp+20h]
- +
- +loc_2D5C1:
- + not ebx
- + lea rdx, [rsp+20h]
- + mov r8, rbp
- + and ebx, r9d
- + mov rcx, rdi
- + or ebx, esi
- + mov [rsp+20h], ebx
- + call memcpy
- + jmp short loc_2D639
- +
- +loc_2D5DE:
- + dec r10d
- + jz short loc_2D61E
- + dec r10d
- + jz short loc_2D605
- + cmp r10d, 2
- + jnz short loc_2D639
- + test cl, cl
- + jnz short loc_2D5F5
- + mov r9d, [rdi]
- +
- +loc_2D5F5:
- + not ebx
- + and ebx, r9d
- + or ebx, r8d
- + mov [rsp+20h], ebx
- + mov [rdi], ebx
- + jmp short loc_2D634
- +
- +loc_2D605:
- + test cl, cl
- + jnz short loc_2D60D
- + movzx r9d, word ptr [rdi]
- +
- +loc_2D60D:
- + not ebx
- + and ebx, r9d
- + or ebx, r8d
- + mov [rsp+20h], ebx
- + mov [rdi], bx
- + jmp short loc_2D634
- +
- +loc_2D61E:
- + test cl, cl
- + jnz short loc_2D626
- + movzx r9d, byte ptr [rdi]
- +
- +loc_2D626:
- + not ebx
- + and ebx, r9d
- + or ebx, r8d
- + mov [rsp+20h], ebx
- + mov [rdi], bl
- +
- +loc_2D634:
- + lock or dword ptr [rsp], 0
- +
- +loc_2D639:
- + mov rdi, [rsp+68h]
- + mov rsi, [rsp+60h]
- + mov rbp, [rsp+58h]
- + mov rbx, [rsp+50h]
- + add rsp, 48h
- + ret
- +WriteSystemMem ENDP
- +
- +
- +ReadBuffField PROC
- + sub rsp, 38h
- + mov r11, rcx
- + mov ecx, [rdx+0Ch]
- + mov [rsp+58h], rdi
- + and ecx, 0Fh
- + mov rdi, r8
- + mov r9, rdx
- + cmp ecx, 1
- + jb short loc_2D801
- + cmp ecx, 3
- + ja short loc_2D801
- + mov edx, 1
- + dec ecx
- + mov r8d, edx
- + shl r8d, cl
- + jmp short loc_2D809
- +
- +loc_2D801:
- + mov edx, 1
- + mov r8d, edx
- +
- +loc_2D809:
- + mov r10d, [r9]
- + lea eax, [r10+r8]
- + cmp eax, [r11+18h]
- + ja loc_2D8D7
- + mov ecx, [r9+8]
- + cmp ecx, 20h
- + jb short loc_2D827
- + xor edx, edx
- + jmp short loc_2D829
- +
- +loc_2D827:
- + shl edx, cl
- +
- +loc_2D829:
- + mov ecx, [r9+4]
- + mov r9, r10
- +
- +loc_2D830:
- + mov [rsp+50h], rbx
- + add r9, [r11+10h]
- + lea ebx, [rdx-1]
- + xor edx, edx
- + mov rax, r9
- + mov r10d, r8d
- + shl ebx, cl
- + div r10
- + xor ecx, ecx
- + test rdx, rdx
- + mov [rsp+20h], ecx
- + jz short loc_2D87D
- + lea rcx, [rsp+20h]
- + mov r8, r10
- + mov rdx, r9
- + call memcpy
- + mov ecx, [rsp+20h]
- + and ecx, ebx
- + mov rbx, [rsp+50h]
- + xor eax, eax
- + mov [rdi], ecx
- + mov rdi, [rsp+58h]
- + add rsp, 38h
- + ret
- +
- +loc_2D87D:
- + dec r8d
- + jz short loc_2D8BE
- + dec r8d
- + jz short loc_2D8A5
- + cmp r8d, 2
- + jnz short loc_2D8C2
- + mov ecx, [r9]
- + and ecx, ebx
- + mov rbx, [rsp+50h]
- + xor eax, eax
- + mov [rdi], ecx
- + mov rdi, [rsp+58h]
- + add rsp, 38h
- + ret
- +
- +loc_2D8A5:
- + movzx ecx, word ptr [r9]
- + and ecx, ebx
- + mov rbx, [rsp+50h]
- + xor eax, eax
- + mov [rdi], ecx
- + mov rdi, [rsp+58h]
- + add rsp, 38h
- + ret
- +
- +loc_2D8BE:
- + movzx ecx, byte ptr [r9]
- +
- +loc_2D8C2:
- + and ecx, ebx
- + mov rbx, [rsp+50h]
- + xor eax, eax
- + mov [rdi], ecx
- + mov rdi, [rsp+58h]
- + add rsp, 38h
- + ret
- +
- +loc_2D8D7:
- + mov eax, 0C0140004h
- + mov rdi, [rsp+58h]
- + add rsp, 38h
- + ret
- +ReadBuffField ENDP
- +
- +
- +ReadFieldObj PROC
- + sub rsp, 58h
- + test r8d, r8d
- + mov [rsp+60h], rbx
- + mov [rsp+78h], rdi
- + mov [rsp+50h], r12
- + mov edi, r8d
- + mov rbx, rdx
- + mov r12, rcx
- + jnz short loc_2E529
- + mov eax, [rdx+8]
- + and eax, 0Fh
- + jmp short loc_2E52E
- +
- +loc_2E529:
- + mov eax, 3
- +
- +loc_2E52E:
- + mov [rsp+68h], rbp
- + mov [rsp+70h], rsi
- + mov [rsp+48h], r13
- + xor r13d, r13d
- + test eax, eax
- + jz short loc_2E560
- + dec eax
- + jz short loc_2E58E
- + dec eax
- + jz loc_2E63F
- + dec eax
- + jz loc_2E75A
- + mov eax, r8d
- + jmp loc_2E764
- +
- +loc_2E560:
- + mov eax, [rbx+34h]
- + cmp [rbx+44h], eax
- + jge loc_2E720
- + mov rax, [rbx+18h]
- + inc dword ptr [rbx+8]
- + cmp word ptr [rax+2], 5
- + jnz short loc_2E58E
- + mov rax, [rax+20h]
- + mov rax, [rax+10h]
- + cmp word ptr [rax+3Ah], 84h
- + jz loc_2E726
- +
- +loc_2E58E:
- + mov rax, [rbx+18h]
- + inc dword ptr [rbx+8]
- + lea rsi, [rbx+48h]
- + cmp word ptr [rax+2], 0Eh
- + jnz short loc_2E5B4
- + mov rcx, [rax+20h]
- + lea rdx, [rbx+4Ch]
- + mov r8, rsi
- + call ReadBuffField
- + mov edi, eax
- + jmp short loc_2E629
- +
- +loc_2E5B4:
- + mov rcx, [rax+20h]
- + mov [rsp+30h], r13
- + mov rax, [rcx+10h]
- + cmp word ptr [rax+3Ah], 84h
- + jnz short loc_2E5F9
- + mov rax, [rax+58h]
- + lea rdx, ReadFieldObj
- + mov rcx, r12
- + mov r9, [rax+8]
- + mov dword ptr [rsp+28h], 4
- + mov [rsp+20h], rsi
- + lea r8, [r9+38h]
- + mov r9, [r9+58h]
- + call PushAccFieldObj
- + mov edi, eax
- + jmp short loc_2E629
- +
- +loc_2E5F9:
- + lea rdx, [rsp+30h]
- + call GetFieldUnitRegionObj
- + test eax, eax
- + mov edi, eax
- + jnz short loc_2E629
- + mov rdx, [rsp+30h]
- + test rdx, rdx
- + jz short loc_2E629
- + lea r8, [rbx+4Ch]
- + mov r9, rsi
- + mov rcx, r12
- + mov byte ptr [rsp+20h], 1
- + call AccessBaseField
- + mov edi, eax
- +
- +loc_2E629:
- + test edi, edi
- + jnz loc_2E762
- + cmp rbx, [r12+170h]
- + jnz loc_2E762
- +
- +loc_2E63F:
- + cmp [rbx+44h], r13d
- + jle short loc_2E69C
- + mov ecx, [rbx+40h]
- + cmp ecx, 20h
- + jl short loc_2E652
- + mov r9d, r13d
- + jmp short loc_2E65B
- +
- +loc_2E652:
- + mov r9d, 1
- + shl r9d, cl
- +
- +loc_2E65B:
- + mov ecx, [rbx+3Ch]
- + cmp ecx, 20h
- + jl short loc_2E668
- + mov eax, r13d
- + jmp short loc_2E66D
- +
- +loc_2E668:
- + mov eax, [rbx+48h]
- + shl eax, cl
- +
- +loc_2E66D:
- + mov r8d, [rbx+38h]
- + mov edx, [rbx+30h]
- + dec r9d
- + shl r9d, cl
- + mov rcx, [rbx+20h]
- + and r8d, eax
- + call WriteSystemMem
- + mov r11d, [rbx+30h]
- + add [rbx+20h], r11
- + mov rax, [rbx+20h]
- + cmp rax, [rbx+28h]
- + jnb loc_2E757
- +
- +loc_2E69C:
- + mov r8d, [rbx+40h]
- + mov edx, [rbx+3Ch]
- + mov ecx, r8d
- + shr dword ptr [rbx+48h], cl
- + mov ecx, [rbx+54h]
- + cmp ecx, edx
- + jge short loc_2E6C9
- + cmp ecx, 20h
- + jb short loc_2E6BA
- + mov eax, r13d
- + jmp short loc_2E6C1
- +
- +loc_2E6BA:
- + mov eax, 1
- + shl eax, cl
- +
- +loc_2E6C1:
- + dec eax
- + and eax, [rbx+48h]
- + mov [rbx+48h], eax
- +
- +loc_2E6C9:
- + cmp edx, 20h
- + jl short loc_2E6D3
- + mov r9d, r13d
- + jmp short loc_2E6DE
- +
- +loc_2E6D3:
- + mov ecx, edx
- + mov r9d, 1
- + shl r9d, cl
- +
- +loc_2E6DE:
- + mov edx, [rbx+30h]
- + mov ecx, r8d
- + mov r8d, [rbx+48h]
- + dec r9d
- + sar r9d, cl
- + mov rcx, [rbx+20h]
- + call WriteSystemMem
- + mov eax, [rbx+30h]
- + mov ecx, [rbx+50h]
- + add [rbx+4Ch], eax
- + inc dword ptr [rbx+44h]
- + shl eax, 3
- + sub ecx, eax
- + mov eax, [rbx+44h]
- + mov [rbx+50h], r13d
- + add [rbx+54h], ecx
- + cmp eax, [rbx+34h]
- + jge short loc_2E757
- + add dword ptr [rbx+8], 0FFFFFFFEh
- + jmp loc_2E560
- +
- +loc_2E720:
- + add dword ptr [rbx+8], 3
- + jmp short loc_2E75A
- +
- +loc_2E726:
- + mov rax, [rax+58h]
- + lea rdx, WriteFieldObj
- + mov rcx, r12
- + mov r9, [rax]
- + lea rax, [rbx+4Ch]
- + mov dword ptr [rsp+28h], 4
- + lea r8, [r9+38h]
- + mov r9, [r9+58h]
- + mov [rsp+20h], rax
- + call PushAccFieldObj
- + jmp short loc_2E764
- +
- +loc_2E757:
- + inc dword ptr [rbx+8]
- +
- +loc_2E75A:
- + mov rcx, r12
- + call PopFrame
- +
- +loc_2E762:
- + mov eax, edi
- +
- +loc_2E764:
- + mov r13, [rsp+48h]
- + mov r12, [rsp+50h]
- + mov rdi, [rsp+78h]
- + mov rsi, [rsp+70h]
- + mov rbp, [rsp+68h]
- + mov rbx, [rsp+60h]
- + add rsp, 58h
- + ret
- +ReadFieldObj ENDP
- +
- +
- +WriteFieldObj PROC
- + sub rsp, 48h
- + test r8d, r8d
- + mov [rsp+50h], rbx
- + mov [rsp+58h], rbp
- + mov [rsp+68h], rdi
- + mov rbx, rdx
- + mov rbp, rcx
- + mov edi, r8d
- + jnz short loc_2E239
- + mov eax, [rdx+8]
- + and eax, 0Fh
- + jmp short loc_2E23E
- +
- +loc_2E239:
- + mov eax, 3
- +
- +loc_2E23E:
- + mov [rsp+60h], rsi
- + mov [rsp+40h], r12
- + xor r12d, r12d
- + test eax, eax
- + jz short loc_2E26B
- + dec eax
- + jz short loc_2E299
- + dec eax
- + jz loc_2E3B1
- + dec eax
- + jz loc_2E414
- + mov eax, r8d
- + jmp loc_2E41E
- +
- +loc_2E26B:
- + mov eax, [rbx+34h]
- + cmp [rbx+44h], eax
- + jge loc_2E3DA
- + mov rax, [rbx+18h]
- + inc dword ptr [rbx+8]
- + cmp word ptr [rax+2], 5
- + jnz short loc_2E299
- + mov rax, [rax+20h]
- + mov rax, [rax+10h]
- + cmp word ptr [rax+3Ah], 84h
- + jz loc_2E3E0
- +
- +loc_2E299:
- + mov ecx, [rbx+30h]
- + mov r10, [rbx+20h]
- + inc dword ptr [rbx+8]
- + mov edi, [rbx+38h]
- + xor edx, edx
- + mov rax, r10
- + div rcx
- + mov r9d, r12d
- + mov [rsp+30h], r12d
- + test rdx, rdx
- + mov r8, rcx
- + jz short loc_2E2D2
- + lea rcx, [rsp+30h]
- + mov rdx, r10
- + call memcpy
- + mov r9d, [rsp+30h]
- + jmp short loc_2E2EE
- +
- +loc_2E2D2:
- + dec ecx
- + jz short loc_2E2EA
- + dec ecx
- + jz short loc_2E2E4
- + cmp ecx, 2
- + jnz short loc_2E2EE
- + mov r9d, [r10]
- + jmp short loc_2E2EE
- +
- +loc_2E2E4:
- + movzx r9d, word ptr [r10]
- + jmp short loc_2E2EE
- +
- +loc_2E2EA:
- + movzx r9d, byte ptr [r10]
- +
- +loc_2E2EE:
- + and r9d, edi
- + cmp [rbx+44h], r12d
- + jle short loc_2E373
- + mov ecx, [rbx+3Ch]
- + lea rdi, [rbx+48h]
- + shr r9d, cl
- + mov ecx, [rbx+30h]
- + add [rbx+20h], rcx
- + mov r10, [rbx+20h]
- + mov [rdi], r9d
- + cmp r10, [rbx+28h]
- + jb short loc_2E31A
- + mov r9d, r12d
- + jmp short loc_2E37A
- +
- +loc_2E31A:
- + mov esi, [rbx+38h]
- + xor edx, edx
- + mov rax, r10
- + div rcx
- + mov r9d, r12d
- + mov [rsp+34h], r12d
- + test rdx, rdx
- + mov r8, rcx
- + jz short loc_2E34C
- + lea rcx, [rsp+34h]
- + mov rdx, r10
- + call memcpy
- + mov r9d, [rsp+34h]
- + and r9d, esi
- + jmp short loc_2E37A
- +
- +loc_2E34C:
- + dec ecx
- + jz short loc_2E36A
- + dec ecx
- + jz short loc_2E361
- + cmp ecx, 2
- + jnz short loc_2E36E
- + mov r9d, [r10]
- + and r9d, esi
- + jmp short loc_2E37A
- +
- +loc_2E361:
- + movzx r9d, word ptr [r10]
- + and r9d, esi
- + jmp short loc_2E37A
- +
- +loc_2E36A:
- + movzx r9d, byte ptr [r10]
- +
- +loc_2E36E:
- + and r9d, esi
- + jmp short loc_2E37A
- +
- +loc_2E373:
- + lea rdi, [rbx+48h]
- + mov [rdi], r12d
- +
- +loc_2E37A:
- + mov ecx, [rbx+40h]
- + mov rdx, [rbx+18h]
- + lea r8, [rbx+4Ch]
- + shl r9d, cl
- + mov rcx, rbp
- + mov [rsp+20h], r12b
- + and r9d, [rbx+38h]
- + or [rdi], r9d
- + mov r9, rdi
- + call AccessFieldData
- + cmp eax, 8004h
- + mov edi, eax
- + jz short loc_2E41E
- + cmp rbx, [rbp+170h]
- + jnz short loc_2E41E
- +
- +loc_2E3B1:
- + mov eax, [rbx+30h]
- + mov ecx, [rbx+50h]
- + inc dword ptr [rbx+44h]
- + add [rbx+4Ch], eax
- + shl eax, 3
- + mov [rbx+50h], r12d
- + sub ecx, eax
- + mov eax, [rbx+44h]
- + add [rbx+54h], ecx
- + cmp eax, [rbx+34h]
- + jge short loc_2E411
- + add dword ptr [rbx+8], 0FFFFFFFEh
- + jmp loc_2E26B
- +
- +loc_2E3DA:
- + add dword ptr [rbx+8], 3
- + jmp short loc_2E414
- +
- +loc_2E3E0:
- + mov rax, [rax+58h]
- + lea rdx, WriteFieldObj
- + mov rcx, rbp
- + mov r9, [rax]
- + lea rax, [rbx+4Ch]
- + mov dword ptr [rsp+28h], 4
- + lea r8, [r9+38h]
- + mov r9, [r9+58h]
- + mov [rsp+20h], rax
- + call PushAccFieldObj
- + jmp short loc_2E41E
- +
- +loc_2E411:
- + inc dword ptr [rbx+8]
- +
- +loc_2E414:
- + mov rcx, rbp
- + call PopFrame
- + mov eax, edi
- +
- +loc_2E41E:
- + mov r12, [rsp+40h]
- + mov rdi, [rsp+68h]
- + mov rsi, [rsp+60h]
- + mov rbp, [rsp+58h]
- + mov rbx, [rsp+50h]
- + add rsp, 48h
- + ret
- +WriteFieldObj ENDP
- +
- +
- +AccessBaseField PROC
- + mov [rsp+10h], rdx
- + mov [rsp+8], rcx
- + mov rax, rsp
- + sub rsp, 88h
- + mov r10, [rdx+58h]
- + mov [rax-8], rbx
- + mov [rax-18h], rsi
- + mov [rax-20h], rdi
- + mov edi, [r8]
- + mov [rax-28h], r12
- + add rdi, [r10]
- + mov r12, r9
- + mov r9d, [r8+0Ch]
- + mov ecx, r9d
- + xor esi, esi
- + and ecx, 0Fh
- + cmp ecx, 1
- + jb short loc_2DC44
- + cmp ecx, 3
- + ja short loc_2DC44
- + mov eax, 1
- + dec ecx
- + mov ebx, eax
- + shl ebx, cl
- + jmp short loc_2DC4B
- +
- +loc_2DC44:
- + mov eax, 1
- + mov ebx, eax
- +
- +loc_2DC4B:
- + mov ecx, [r8+8]
- + mov [rsp+78h], rbp
- + cmp ecx, 20h
- + jb short loc_2DC5D
- + mov ebp, esi
- + jmp short loc_2DC61
- +
- +loc_2DC5D:
- + mov ebp, eax
- + shl ebp, cl
- +
- +loc_2DC61:
- + mov ecx, [r8+4]
- + dec ebp
- + shl ebp, cl
- + lea ecx, [rbx*8]
- + cmp ecx, 20h
- + jb short loc_2DC79
- + mov eax, esi
- + jmp short loc_2DC7B
- +
- +loc_2DC79:
- + shl eax, cl
- +
- +loc_2DC7B:
- + test r9b, 60h
- + mov [rsp+50h], r14
- + mov [rsp+48h], r15
- + lea r14d, [rax-1]
- + jnz short loc_2DC9D
- + mov eax, ebp
- + not eax
- + test r14d, eax
- + jz short loc_2DC9D
- + mov r15b, 1
- + jmp short loc_2DCA0
- +
- +loc_2DC9D:
- + xor r15b, r15b
- +
- +loc_2DCA0:
- + and [r12], ebp
- + mov [rsp+58h], r13
- + movzx r13d, byte ptr [rsp+0B0h]
- + test r13b, r13b
- + jnz short loc_2DCCD
- + mov eax, [r8+0Ch]
- + and al, 60h
- + cmp al, 20h
- + jnz short loc_2DCCD
- + mov eax, ebp
- + not eax
- + or eax, [r12]
- + mov [r12], eax
- +
- +loc_2DCCD:
- + movzx ecx, byte ptr [r10+0Ch]
- + test ecx, ecx
- + mov edx, ecx
- + jz loc_2DF06
- + dec edx
- + jz loc_2DE0D
- + call FindRSAccess
- + test rax, rax
- + mov r14, rax
- + jz loc_2DE03
- + mov r10, [rax+10h]
- + test r10, r10
- + jz loc_2DE03
- + test r13b, r13b
- + jz short loc_2DD6C
- + mov rax, [rsp+90h]
- + mov rdx, [rsp+98h]
- + mov r9d, ebx
- + add rax, 148h
- + mov r8, rdi
- + xor ecx, ecx
- + mov [rsp+38h], rax
- + lea rax, RestartCtxtCallback
- + mov [rsp+30h], rax
- + mov rax, [r14+18h]
- + mov [rsp+28h], rax
- + mov [rsp+20h], r12
- + call r10
- + cmp eax, 103h
- + mov esi, eax
- + jnz short loc_2DD5A
- + mov esi, 8004h
- + jmp loc_2DF99
- +
- +loc_2DD5A:
- + test eax, eax
- + jz loc_2DF99
- + mov esi, 0C0140018h
- + jmp loc_2DF99
- +
- +loc_2DD6C:
- + mov rcx, [rsp+90h]
- + lea rax, [rsp+0A8h]
- + lea r9, WriteCookAccess
- + mov edx, 41435257h
- + mov r8d, 40h
- + mov [rsp+20h], rax
- + call PushFrame
- + test eax, eax
- + mov esi, eax
- + jnz loc_2DF99
- + mov rax, [rsp+0A8h]
- + mov rcx, [rsp+98h]
- + mov [rax+18h], rcx
- + mov rax, [rsp+0A8h]
- + mov [rax+20h], r14
- + mov rax, [rsp+0A8h]
- + mov [rax+28h], edi
- + mov rax, [rsp+0A8h]
- + mov [rax+2Ch], ebx
- + mov rax, [rsp+0A8h]
- + mov ecx, [r12]
- + mov [rax+30h], ecx
- + mov rax, [rsp+0A8h]
- + mov [rax+34h], ebp
- + mov rax, [rsp+0A8h]
- + mov [rax+3Ch], r15b
- + jmp loc_2DF99
- +
- +loc_2DE03:
- + mov esi, 0C0140010h
- + jmp loc_2DF99
- +
- +loc_2DE0D:
- + test r13b, r13b
- + jz short loc_2DE84
- + lea r9, [rsp+98h]
- + mov r8d, ebx
- + mov edx, edi
- + mov cl, 1
- + mov [rsp+98h], esi
- + call CheckSystemIOAddressValidity
- + test al, al
- + jz short loc_2DE72
- + dec ebx
- + jz short loc_2DE60
- + dec ebx
- + jz short loc_2DE4D
- + cmp ebx, 2
- + jnz short loc_2DE72
- + movzx edx, di
- + in eax, dx
- + and eax, ebp
- + mov [r12], eax
- + jmp loc_2DF99
- +
- +loc_2DE4D:
- + movzx edx, di
- + in ax, dx
- + movzx eax, ax
- + and eax, ebp
- + mov [r12], eax
- + jmp loc_2DF99
- +
- +loc_2DE60:
- + movzx edx, di
- + in al, dx
- + movzx eax, al
- + and eax, ebp
- + mov [r12], eax
- + jmp loc_2DF99
- +
- +loc_2DE72:
- + mov eax, [rsp+98h]
- + and eax, ebp
- + mov [r12], eax
- + jmp loc_2DF99
- +
- +loc_2DE84:
- + test r15b, r15b
- + jz short loc_2DE9B
- + not ebp
- + mov edx, ebx
- + mov ecx, edi
- + mov r8d, ebp
- + call ReadSystemIO
- + or [r12], eax
- +
- +loc_2DE9B:
- + mov eax, [r12]
- + lea r9, [rsp+0B0h]
- + mov r8d, ebx
- + mov edx, edi
- + xor ecx, ecx
- + mov [rsp+0B0h], eax
- + call CheckSystemIOAddressValidity
- + test al, al
- + jz loc_2DF99
- + dec ebx
- + jz short loc_2DEF5
- + dec ebx
- + jz short loc_2DEE3
- + cmp ebx, 2
- + jnz loc_2DF99
- + mov eax, [rsp+0B0h]
- + movzx edx, di
- + out dx, eax
- + jmp loc_2DF99
- +
- +loc_2DEE3:
- + movzx eax, word ptr [rsp+0B0h]
- + movzx edx, di
- + out dx, ax
- + jmp loc_2DF99
- +
- +loc_2DEF5:
- + movzx eax, byte ptr [rsp+0B0h]
- + movzx edx, di
- + out dx, al
- + jmp loc_2DF99
- +
- +loc_2DF06:
- + test r13b, r13b
- + jz short loc_2DF70
- + xor edx, edx
- + mov r8d, ebx
- + mov rax, rdi
- + div r8
- + mov ecx, esi
- + mov [rsp+0A0h], esi
- + test rdx, rdx
- + jz short loc_2DF43
- + lea rcx, [rsp+0A0h]
- + mov rdx, rdi
- + call memcpy
- + mov ecx, [rsp+0A0h]
- + and ecx, ebp
- + mov [r12], ecx
- + jmp short loc_2DF99
- +
- +loc_2DF43:
- + dec ebx
- + jz short loc_2DF65
- + dec ebx
- + jz short loc_2DF5A
- + cmp ebx, 2
- + jnz short loc_2DF68
- + mov ecx, [rdi]
- + and ecx, ebp
- + mov [r12], ecx
- + jmp short loc_2DF99
- +
- +loc_2DF5A:
- + movzx ecx, word ptr [rdi]
- + and ecx, ebp
- + mov [r12], ecx
- + jmp short loc_2DF99
- +
- +loc_2DF65:
- + movzx ecx, byte ptr [rdi]
- +
- +loc_2DF68:
- + and ecx, ebp
- + mov [r12], ecx
- + jmp short loc_2DF99
- +
- +loc_2DF70:
- + test r15b, r15b
- + jz short loc_2DF88
- + not ebp
- + mov edx, ebx
- + mov rcx, rdi
- + mov r8d, ebp
- + call ReadSystemMem
- + or [r12], eax
- +
- +loc_2DF88:
- + mov r8d, [r12]
- + mov r9d, r14d
- + mov edx, ebx
- + mov rcx, rdi
- + call WriteSystemMem
- +
- +loc_2DF99:
- + mov r15, [rsp+48h]
- + mov r14, [rsp+50h]
- + mov r13, [rsp+58h]
- + mov r12, [rsp+60h]
- + mov rdi, [rsp+68h]
- + mov rbp, [rsp+78h]
- + mov rbx, [rsp+80h]
- + mov eax, esi
- + mov rsi, [rsp+70h]
- + add rsp, 88h
- + ret
- +AccessBaseField ENDP
- +
- +
- +AccessFieldData PROC
- + sub rsp, 58h
- + cmp word ptr [rdx+2], 0Eh
- + mov [rsp+50h], rbx
- + mov [rsp+48h], rbp
- + mov [rsp+40h], rsi
- + mov [rsp+38h], rdi
- + mov rax, rdx
- + mov rdi, r8
- + mov rsi, r9
- + mov rbp, rcx
- + jnz loc_2E0A9
- + cmp byte ptr [rsp+80h], 0
- + jz short loc_2E02D
- + mov rcx, [rax+20h]
- + mov r8, r9
- + mov rdx, rdi
- + call ReadBuffField
- + jmp loc_2E1ED
- +
- +loc_2E02D:
- + mov ecx, [r8+0Ch]
- + mov rbp, [rdx+20h]
- + xor ebx, ebx
- + and ecx, 0Fh
- + cmp ecx, 1
- + jb short loc_2E053
- + cmp ecx, 3
- + ja short loc_2E053
- + mov edx, 1
- + dec ecx
- + mov r10d, edx
- + shl r10d, cl
- + jmp short loc_2E05B
- +
- +loc_2E053:
- + mov edx, 1
- + mov r10d, edx
- +
- +loc_2E05B:
- + mov r11d, [r8]
- + lea eax, [r11+r10]
- + cmp eax, [rbp+18h]
- + ja short loc_2E09D
- + mov ecx, [r8+8]
- + cmp ecx, 20h
- + jb short loc_2E074
- + mov edx, ebx
- + jmp short loc_2E076
- +
- +loc_2E074:
- + shl edx, cl
- +
- +loc_2E076:
- + mov ecx, [r8+4]
- + lea r9d, [rdx-1]
- + mov edx, r10d
- + shl r9d, cl
- + mov rcx, r11
- + add rcx, [rbp+10h]
- + mov r8d, r9d
- + and r8d, [rsi]
- + call WriteSystemMem
- + mov eax, ebx
- + jmp loc_2E1ED
- +
- +loc_2E09D:
- + mov ebx, 0C0140004h
- + mov eax, ebx
- + jmp loc_2E1ED
- +
- +loc_2E0A9:
- + mov rcx, [rdx+20h]
- + xor ebx, ebx
- + mov [rsp+68h], rbx
- + mov rax, [rcx+10h]
- + cmp word ptr [rax+3Ah], 84h
- + jnz loc_2E1BB
- + cmp [rsp+80h], bl
- + mov r10, [rax+58h]
- + jz short loc_2E0FE
- + mov r9, [r10+8]
- + lea rdx, ReadFieldObj
- + mov rcx, rbp
- + lea r8, [r9+38h]
- + mov r9, [r9+58h]
- + mov dword ptr [rsp+28h], 4
- + mov [rsp+20h], rsi
- + call PushAccFieldObj
- + jmp loc_2E1ED
- +
- +loc_2E0FE:
- + mov ecx, [r8+8]
- + mov edx, 1
- + cmp ecx, 20h
- + jb short loc_2E110
- + mov eax, ebx
- + jmp short loc_2E114
- +
- +loc_2E110:
- + mov eax, edx
- + shl eax, cl
- +
- +loc_2E114:
- + mov ecx, [r8+4]
- + mov r11d, [r8+0Ch]
- + lea r9d, [rax-1]
- + shl r9d, cl
- + mov r8d, r11d
- + and r8d, 0Fh
- + not r9d
- + cmp r8d, edx
- + jb short loc_2E142
- + cmp r8d, 3
- + ja short loc_2E142
- + lea ecx, [r8-1]
- + mov eax, edx
- + shl eax, cl
- + jmp short loc_2E144
- +
- +loc_2E142:
- + mov eax, edx
- +
- +loc_2E144:
- + shl eax, 3
- + cmp eax, 20h
- + jge short loc_2E16E
- + cmp r8d, edx
- + jb short loc_2E161
- + cmp r8d, 3
- + ja short loc_2E161
- + lea ecx, [r8-1]
- + mov eax, edx
- + shl eax, cl
- + jmp short loc_2E163
- +
- +loc_2E161:
- + mov eax, edx
- +
- +loc_2E163:
- + lea ecx, [rax*8]
- + shl edx, cl
- + mov ebx, edx
- +
- +loc_2E16E:
- + test r11b, 60h
- + jnz short loc_2E191
- + lea eax, [rbx-1]
- + test r9d, eax
- + jz short loc_2E191
- + mov rdx, [r10+8]
- + mov r8d, [rsi]
- + mov rcx, rbp
- + add rdx, 38h
- + call PushPreserveWriteObj
- + jmp short loc_2E1ED
- +
- +loc_2E191:
- + mov r9, [r10+8]
- + lea rdx, WriteFieldObj
- + mov rcx, rbp
- + lea r8, [r9+38h]
- + mov r9, [r9+58h]
- + mov dword ptr [rsp+28h], 4
- + mov [rsp+20h], rsi
- + call PushAccFieldObj
- + jmp short loc_2E1ED
- +
- +loc_2E1BB:
- + lea rdx, [rsp+68h]
- + call GetFieldUnitRegionObj
- + test eax, eax
- + jnz short loc_2E1ED
- + mov rdx, [rsp+68h]
- + test rdx, rdx
- + jz short loc_2E1ED
- + movzx eax, byte ptr [rsp+80h]
- + mov r9, rsi
- + mov r8, rdi
- + mov rcx, rbp
- + mov [rsp+20h], al
- + call AccessBaseField
- +
- +loc_2E1ED:
- + mov rdi, [rsp+38h]
- + mov rsi, [rsp+40h]
- + mov rbp, [rsp+48h]
- + mov rbx, [rsp+50h]
- + add rsp, 58h
- + ret
- +AccessFieldData ENDP
- +
- +ACPIGetConvertToHardwareID PROC
- + mov r11, rsp
- + sub rsp, 78h
- + mov [r11-8], rbx
- + mov [r11-10h], rbp
- + mov [r11-18h], rsi
- + mov [r11-20h], rdi
- + mov [r11-28h], r12
- + mov [r11-30h], r13
- + mov eax, r9d
- + xor r13b, r13b
- + mov [r11-38h], r14
- + and eax, 8000000h
- + mov esi, r9d
- + mov rdi, r8
- + mov rbp, rcx
- + jnz loc_1FAE7
- + mov rcx, 1000000000h
- + test [rbp+0], rcx
- + jz loc_1FAE7
- + lea rax, [r11+10h]
- + mov rcx, rbp
- + mov [r11-50h], rax
- + lea rax, [r11-48h]
- + mov [r11-58h], rax
- + call ACPIGetProcessorID
- + test eax, eax
- + mov edi, eax
- + js short loc_1FABD
- + mov ebp, [rsp+88h]
- + mov rdi, [rsp+30h]
- + mov rbx, [rsp+30h]
- +
- +loc_1FA90:
- + mov rax, [rsp+0A0h]
- + mov [rax], rdi
- + mov rax, [rsp+0A8h]
- + test rax, rax
- + jz short loc_1FAAA
- + mov [rax], ebp
- +
- +loc_1FAAA:
- + xor edi, edi
- +
- +loc_1FAAC:
- + cmp r13b, 1
- + jnz short loc_1FABD
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- +
- +loc_1FABD:
- + mov eax, edi
- +
- +loc_1FABF:
- + mov r14, [rsp+40h]
- + mov r13, [rsp+48h]
- + mov r12, [rsp+50h]
- + mov rdi, [rsp+58h]
- + mov rsi, [rsp+60h]
- + mov rbp, [rsp+68h]
- + mov rbx, [rsp+70h]
- + add rsp, 78h
- + ret
- +
- +loc_1FAE7:
- + test eax, eax
- + jnz loc_1FB71
- + mov rcx, 800000000000h
- + test [rbp+0], rcx
- + jz short loc_1FB71
- + mov rdi, [rbp+1B0h]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov r8d, 53706341h
- + repne scasb
- + not rcx
- + lea r12, [rcx-1]
- + mov ecx, r9d
- + shr ecx, 1Ch
- + add r12d, 0FFFFFFFCh
- + not ecx
- + mov edx, r12d
- + mov edi, r12d
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jz loc_1FC4A
- + mov r8, rdi
- + xor edx, edx
- + mov rcx, rax
- + call memset
- + mov rdx, [rbp+1B0h]
- + lea r8d, [r12-1]
- + add rdx, 5
- + mov rcx, rbx
- + mov r13b, 1
- + callex strncpy
- + jmp loc_1FC6A
- +
- +loc_1FB71:
- + test eax, eax
- + jnz short loc_1FBDE
- + mov rax, 4000000000h
- + test [rbp+0], rax
- + jz short loc_1FBDE
- + mov ecx, r9d
- + mov r12d, 0Dh
- + mov r8d, 53706341h
- + shr ecx, 1Ch
- + mov rdx, r12
- + not ecx
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jnz short loc_1FBB7
- + mov eax, 0C000009Ah
- + jmp loc_1FABF
- +
- +loc_1FBB7:
- + xor eax, eax
- + lea rdx, asmPciBarName
- + mov rcx, rbx
- + mov [rbx], rax
- + mov [rbx+8], eax
- + lea r8d, [rax+0Ch]
- + mov [rbx+0Ch], al
- + mov r13b, 1
- + callex strncpy
- + jmp loc_1FC6A
- +
- +loc_1FBDE:
- + test edx, edx
- + jns short loc_1FBE9
- + mov eax, edx
- + jmp loc_1FABF
- +
- +loc_1FBE9:
- + movzx ecx, word ptr [r8+2]
- + dec ecx
- + jz short loc_1FC22
- + dec ecx
- + jz short loc_1FC00
- + mov eax, 0C014000Fh
- + jmp loc_1FABF
- +
- +loc_1FC00:
- + mov rbx, [r8+20h]
- + cmp byte ptr [rbx], 2Ah
- + jnz short loc_1FC0C
- + inc rbx
- +
- +loc_1FC0C:
- + xor eax, eax
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov rdi, rbx
- + repne scasb
- + not rcx
- + mov r12d, ecx
- + jmp short loc_1FC6A
- +
- +loc_1FC22:
- + mov ecx, r9d
- + mov r12d, 8
- + mov r8d, 53706341h
- + shr ecx, 1Ch
- + mov rdx, r12
- + not ecx
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jnz short loc_1FC54
- +
- +loc_1FC4A:
- + mov edi, 0C000009Ah
- + jmp loc_1FABD
- +
- +loc_1FC54:
- + xor eax, eax
- + xor r8d, r8d
- + mov rcx, rbx
- + mov [rbx], rax
- + mov edx, [rdi+10h]
- + mov r13b, 1
- + call ACPIAmliDoubleToName
- +
- +loc_1FC6A:
- + shr esi, 1Ch
- + lea ebp, [r12+r12+7]
- + mov r8d, 53706341h
- + not esi
- + mov edx, ebp
- + mov r14d, ebp
- + and esi, 1
- + mov ecx, esi
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rdi, rax
- + jnz short loc_1FC9C
- + mov edi, 0C000009Ah
- + jmp loc_1FAAC
- +
- +loc_1FC9C:
- + mov r8, r14
- + xor edx, edx
- + mov rcx, rax
- +
- +loc_1FCA4:
- + call memset
- + lea rdx, asmACPI2Name
- + mov r8, rbx
- + mov rcx, rdi
- + callex sprintf
- + lea ecx, [r12+5]
- + lea rdx, asmStar2Name
- + add rcx, rdi
- + mov r8, rbx
- + callex sprintf
- + jmp loc_1FA90
- +ACPIGetConvertToHardwareID ENDP
- +
- +
- +ACPIGetConvertToHardwareIDWide PROC
- + mov r11, rsp
- + sub rsp, 78h
- + mov [r11-8], rbx
- + mov [r11-10h], rbp
- + mov [r11-18h], rsi
- + mov [r11-20h], rdi
- + mov [r11-28h], r12
- + mov [r11-30h], r13
- + mov eax, r9d
- + xor r13b, r13b
- + mov [r11-38h], r14
- + and eax, 8000000h
- + mov esi, r9d
- + mov rdi, r8
- + mov rbp, rcx
- + jnz loc_1FDBB
- + mov rcx, 1000000000h
- + test [rbp+0], rcx
- + jz loc_1FDBB
- + lea rax, [r11+10h]
- + mov rcx, rbp
- + mov [r11-50h], rax
- + lea rax, [r11-48h]
- + mov [r11-58h], rax
- + call ACPIGetProcessorIDWide
- + test eax, eax
- + mov edi, eax
- + js short loc_1FD91
- + mov ebp, [rsp+88h]
- + mov rdi, [rsp+30h]
- + mov rbx, [rsp+30h]
- +
- +loc_1FD60:
- + mov rax, [rsp+0A0h]
- + mov rcx, [rsp+0A8h]
- + test rcx, rcx
- + mov [rax], rdi
- + jz short loc_1FD7E
- + lea eax, [rbp+rbp+0]
- + mov [rcx], eax
- +
- +loc_1FD7E:
- + xor edi, edi
- +
- +loc_1FD80:
- + cmp r13b, 1
- + jnz short loc_1FD91
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- +
- +loc_1FD91:
- + mov eax, edi
- +
- +loc_1FD93:
- + mov r14, [rsp+40h]
- + mov r13, [rsp+48h]
- + mov r12, [rsp+50h]
- + mov rdi, [rsp+58h]
- + mov rsi, [rsp+60h]
- + mov rbp, [rsp+68h]
- + mov rbx, [rsp+70h]
- + add rsp, 78h
- + ret
- +
- +loc_1FDBB:
- + test eax, eax
- + jnz loc_1FE45
- + mov rcx, 800000000000h
- + test [rbp+0], rcx
- + jz short loc_1FE45
- + mov rdi, [rbp+1B0h]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov r8d, 53706341h
- + repne scasb
- + not rcx
- + lea r12, [rcx-1]
- + mov ecx, r9d
- + shr ecx, 1Ch
- + add r12d, 0FFFFFFFCh
- + not ecx
- + mov edx, r12d
- + mov edi, r12d
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jz loc_1FF1E
- + mov r8, rdi
- + xor edx, edx
- + mov rcx, rax
- + call memset
- + mov rdx, [rbp+1B0h]
- + lea r8d, [r12-1]
- + add rdx, 5
- + mov rcx, rbx
- + mov r13b, 1
- + callex strncpy
- + jmp loc_1FF3E
- +
- +loc_1FE45:
- + test eax, eax
- + jnz short loc_1FEB2
- + mov rax, 4000000000h
- + test [rbp+0], rax
- + jz short loc_1FEB2
- + mov ecx, r9d
- + mov r12d, 0Dh
- + mov r8d, 53706341h
- + shr ecx, 1Ch
- + mov rdx, r12
- + not ecx
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jnz short loc_1FE8B
- + mov eax, 0C000009Ah
- + jmp loc_1FD93
- +
- +loc_1FE8B:
- + xor eax, eax
- + lea rdx, asmPciBarName
- + mov rcx, rbx
- + mov [rbx], rax
- + mov [rbx+8], eax
- + lea r8d, [rax+0Ch]
- + mov [rbx+0Ch], al
- + mov r13b, 1
- + callex strncpy
- + jmp loc_1FF3E
- +
- +loc_1FEB2:
- + test edx, edx
- + jns short loc_1FEBD
- + mov eax, edx
- + jmp loc_1FD93
- +
- +loc_1FEBD:
- + movzx ecx, word ptr [r8+2]
- + dec ecx
- + jz short loc_1FEF6
- + dec ecx
- + jz short loc_1FED4
- + mov eax, 0C014000Fh
- + jmp loc_1FD93
- +
- +loc_1FED4:
- + mov rbx, [r8+20h]
- + cmp byte ptr [rbx], 2Ah
- + jnz short loc_1FEE0
- + inc rbx
- +
- +loc_1FEE0:
- + xor eax, eax
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov rdi, rbx
- + repne scasb
- + not rcx
- + mov r12d, ecx
- + jmp short loc_1FF3E
- +
- +loc_1FEF6:
- + mov ecx, r9d
- + mov r12d, 8
- + mov r8d, 53706341h
- + shr ecx, 1Ch
- + mov rdx, r12
- + not ecx
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jnz short loc_1FF28
- +
- +loc_1FF1E:
- + mov edi, 0C000009Ah
- + jmp loc_1FD91
- +
- +loc_1FF28:
- + xor eax, eax
- + xor r8d, r8d
- + mov rcx, rbx
- + mov [rbx], rax
- + mov edx, [rdi+10h]
- + mov r13b, 1
- + call ACPIAmliDoubleToName
- +
- +loc_1FF3E:
- + shr esi, 1Ch
- + lea ebp, [r12+r12+7]
- + mov r8d, 53706341h
- + mov r14d, ebp
- + not esi
- + add r14, r14
- + and esi, 1
- + mov rdx, r14
- + mov ecx, esi
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rdi, rax
- + jnz short loc_1FF74
- + mov edi, 0C000009Ah
- + jmp loc_1FD80
- +
- +loc_1FF74:
- + mov r8, r14
- + xor edx, edx
- + mov rcx, rax
- + call memset
- + lea rdx, asmACPI2NameL
- + mov r8, rbx
- + mov rcx, rdi
- + callex swprintf
- + lea edx, [r12+5]
- + mov r8, rbx
- + lea rcx, [rdi+rdx*2]
- + lea rdx, asmStar2NameL
- + callex swprintf
- + jmp loc_1FD60
- +ACPIGetConvertToHardwareIDWide ENDP
- +
- +
- +ACPIDevicePowerProcessPhase3 PROC
- + mov rax, rsp
- + sub rsp, 68h
- + mov [rax+8], rbx
- + mov [rax+10h], rbp
- + mov [rax+18h], rsi
- + mov [rax+20h], rdi
- + mov [rax-8], r12
- + mov [rax-10h], r13
- + mov [rax-18h], r14
- + lea rcx, AcpiPowerLock
- + xor r13b, r13b
- + mov [rax-20h], r15
- + callex KeAcquireSpinLockAtDpcLevel
- + mov r12, [AcpiPowerNodeList]
- + lea rdi, AcpiPowerNodeList
- + mov r9d, 4
- + xor r15d, r15d
- + cmp r12, rdi
- + lea edx, [r9-3]
- + jz loc_194F3
- + lea r14, ACPIDeviceCompletePhase3On
- +
- +loc_19352:
- + mov rsi, r12
- + mov r12, [r12]
- + test byte ptr [rsi+10h], 2
- + jz loc_194E1
- + mov eax, 3
- + lock cmpxchg [rsi+40h], r9d
- + jnz loc_194E1
- + mov r10, [rsi+30h]
- + lea r11, [rsi+30h]
- + mov r8d, r15d
- + cmp r10, r11
- + jz short loc_193CD
- +
- + ALIGN16
- +loc_19390:
- + mov rdx, [r10-8]
- + lea r9, [r10-28h]
- + mov r10, [r10]
- + xor eax, eax
- + lock cmpxchg [rdx+17Ch], r15d
- + mov ecx, [r9+14h]
- + cmp [rdx+178h], ecx
- + jz short loc_193BC
- + test eax, eax
- + jz short loc_193BF
- + cmp [r9+18h], r15b
- + jz short loc_193BF
- +
- +loc_193BC:
- + inc r8d
- +
- +loc_193BF:
- + cmp r10, r11
- + jnz short loc_19390
- + mov edx, 1
- + lea r9d, [rdx+3]
- +
- +loc_193CD:
- + mov eax, r8d
- + xchg eax, [rsi+18h]
- + mov rcx, [rsi+10h]
- + test rcx, 440h
- + jnz loc_194E1
- + test rcx, 220h
- + jnz short loc_193F6
- + test r8d, r8d
- + jz loc_194E1
- +
- +loc_193F6:
- + mov eax, r9d
- + lock cmpxchg [rsi+40h], edx
- + lea rcx, AcpiPowerLock
- + callex KeReleaseSpinLockFromDpcLevel
- + mov rcx, [rsi+48h]
- + xor r9d, r9d
- + xor r8d, r8d
- + xor edx, edx
- + mov [rsp+28h], rsi
- + mov [rsp+20h], r14
- + call AMLIAsyncEvalObject
- + cmp eax, 103h
- + mov ebx, eax
- + jz loc_194D1
- + lea rcx, AcpiPowerLock
- + callex KeAcquireSpinLockRaiseToDpc
- + test ebx, ebx
- + movzx edi, al
- + js short loc_19459
- + xor r8d, r8d
- + lea rcx, [rsi+10h]
- + lea edx, [r8+10h]
- + call ACPIInternalUpdateFlags
- + jmp short loc_1946A
- +
- +loc_19459:
- + lea rcx, [rsi+10h]
- + xor r8d, r8d
- + mov edx, 10000h
- + call ACPIInternalUpdateFlags
- +
- +loc_1946A:
- + lea rcx, AcpiPowerLock
- + movzx edx, dil
- + callex KeReleaseSpinLock
- + mov eax, 1
- + lock cmpxchg [rsi+40h], r15d
- + lea rcx, AcpiPowerQueueLock
- + callex KeAcquireSpinLockRaiseToDpc
- + cmp [AcpiPowerDpcRunning], r15b
- + mov [AcpiPowerWorkDone], 1
- + movzx ebx, al
- + jnz short loc_194B8
- + lea rcx, AcpiPowerDpc
- + xor r8d, r8d
- + xor edx, edx
- + callex KeInsertQueueDpc
- +
- +loc_194B8:
- + lea rcx, AcpiPowerQueueLock
- + movzx edx, bl
- + callex KeReleaseSpinLock
- + lea rdi, AcpiPowerNodeList
- + jmp short loc_194D4
- +
- +loc_194D1:
- + mov r13b, 1
- +
- +loc_194D4:
- + lea rcx, AcpiPowerLock
- + callex KeAcquireSpinLockAtDpcLevel
- +
- +loc_194E1:
- + cmp r12, rdi
- + mov edx, 1
- + lea r9d, [rdx+3]
- + jnz loc_19352
- +
- +loc_194F3:
- + mov rsi, [AcpiPowerNodeList+8] ; Blink
- + cmp rsi, rdi
- + jz loc_19643
- + lea r14, ACPIDeviceCompletePhase3Off
- + lea rax, AcpiPowerNodeList
- +
- +loc_19511:
- + mov rbx, rsi
- + mov rsi, [rsi+8]
- + test byte ptr [rbx+10h], 2
- + jz loc_19631
- + mov eax, r9d
- + lock cmpxchg [rbx+40h], edx
- + jz short loc_19543
- + test eax, eax
- + jz loc_1962A
- + mov r13b, 1
- + lea rax, AcpiPowerNodeList
- + jmp loc_19631
- +
- +loc_19543:
- + lea rcx, AcpiPowerLock
- + callex KeReleaseSpinLockFromDpcLevel
- + mov rcx, [rbx+50h]
- + xor r9d, r9d
- + xor r8d, r8d
- + xor edx, edx
- + mov [rsp+28h], rbx
- + mov [rsp+20h], r14
- + call AMLIAsyncEvalObject
- + cmp eax, 103h
- + mov ebp, eax
- + jz loc_19611
- + lea rcx, AcpiPowerLock
- + callex KeAcquireSpinLockRaiseToDpc
- + test ebp, ebp
- + movzx r12d, al
- + js short loc_195A0
- + lea rcx, [rbx+10h]
- + mov r8b, 1
- + mov edx, 10h
- + call ACPIInternalUpdateFlags
- + jmp short loc_195B1
- +
- +loc_195A0:
- + lea rcx, [rbx+10h]
- + xor r8d, r8d
- + mov edx, 10000h
- + call ACPIInternalUpdateFlags
- +
- +loc_195B1:
- + lea rcx, AcpiPowerLock
- + movzx edx, r12b
- + callex KeReleaseSpinLock
- + mov eax, 1
- + lock cmpxchg [rbx+40h], r15d
- + lea rcx, AcpiPowerQueueLock
- + callex KeAcquireSpinLockRaiseToDpc
- + cmp [AcpiPowerDpcRunning], r15b
- + mov [AcpiPowerWorkDone], 1
- + movzx ebx, al
- + jnz short loc_195FF
- + lea rcx, AcpiPowerDpc
- + xor r8d, r8d
- + xor edx, edx
- + callex KeInsertQueueDpc
- +
- +loc_195FF:
- + lea rcx, AcpiPowerQueueLock
- + movzx edx, bl
- + callex KeReleaseSpinLock
- + jmp short loc_19614
- +
- +loc_19611:
- + mov r13b, 1
- +
- +loc_19614:
- + lea rcx, AcpiPowerLock
- + callex KeAcquireSpinLockAtDpcLevel
- + lea rax, AcpiPowerNodeList
- + jmp short loc_19631
- +
- +loc_1962A:
- + lea rax, AcpiPowerNodeList
- +
- +loc_19631:
- + cmp rsi, rax
- + mov edx, 1
- + lea r9d, [rdx+3]
- + jnz loc_19511
- +
- +loc_19643:
- + lea rcx, AcpiPowerLock
- + callex KeReleaseSpinLockFromDpcLevel
- + mov r15, [rsp+48h]
- + mov r14, [rsp+50h]
- + mov r12, [rsp+60h]
- + mov rdi, [rsp+88h]
- + mov rsi, [rsp+80h]
- + mov rbp, [rsp+78h]
- + mov rbx, [rsp+70h]
- + neg r13b
- + mov r13, [rsp+58h]
- + sbb eax, eax
- + and eax, 103h
- + add rsp, 68h
- + ret
- +ACPIDevicePowerProcessPhase3 ENDP
- +
- +
- +OSNotifyDeviceCheck PROC
- + sub rsp, 28h
- + mov [rsp+40h], rbx
- + mov [rsp+48h], rdi
- + mov rbx, rcx
- + call ACPIDockIsDockDevice
- + test al, al
- + jz short loc_24C89
- + mov rdi, [rbx+60h]
- + mov rcx, rbx
- + call ACPIDockIsDockDevice
- + test al, al
- + jz short loc_24C59
- + mov rcx, rdi
- + call ACPIDockFindCorrespondingDock
- + test rax, rax
- + mov rdi, rax
- + jnz short loc_24C62
- + mov rdi, [rsp+48h]
- + mov rbx, [rsp+40h]
- + add rsp, 28h
- + ret
- +
- +loc_24C59:
- + test rdi, rdi
- + jz loc_24D03
- +
- +loc_24C62:
- + test byte ptr [rdi], 8
- + jnz loc_24D03
- + mov rcx, [rdi+200h]
- + callex IoRequestDeviceEject
- + xor eax, eax
- + mov rdi, [rsp+48h]
- + mov rbx, [rsp+40h]
- + add rsp, 28h
- + ret
- +
- +loc_24C89:
- + lea rcx, AcpiDeviceTreeLock
- + callex KeAcquireSpinLockRaiseToDpc
- + movzx edi, al
- +
- + ALIGN16
- +loc_24CA0:
- + mov rcx, [rbx+60h]
- + mov rbx, [rbx+10h]
- + test rcx, rcx
- + jz short loc_24CB8
- + cmp dword ptr [rcx+8], 5F534750h
- + jz short loc_24CC2
- + xor ecx, ecx
- +
- +loc_24CB8:
- + test rbx, rbx
- + jnz short loc_24CA0
- + test rcx, rcx
- + jz short loc_24CF2
- +
- +loc_24CC2:
- + mov rcx, [rcx+208h]
- + test rcx, rcx
- + jz short loc_24CF2
- + xchg ax, ax
- +
- +loc_24CD0:
- + test byte ptr [rcx], 8
- + jz short loc_24CE3
- + mov rcx, [rcx+208h]
- + test rcx, rcx
- + jnz short loc_24CD0
- + jmp short loc_24CF2
- +
- +loc_24CE3:
- + mov rcx, [rcx+200h]
- + xor edx, edx
- + callex IoInvalidateDeviceRelations
- +
- +loc_24CF2:
- + lea rcx, AcpiDeviceTreeLock
- + movzx edx, dil
- + callex KeReleaseSpinLock
- +
- +loc_24D03:
- + mov rdi, [rsp+48h]
- + mov rbx, [rsp+40h]
- + xor eax, eax
- + add rsp, 28h
- + ret
- +OSNotifyDeviceCheck ENDP
- +
- +
- +AcpiArblibReferenceArbiter PROC
- + lock inc dword ptr [rcx+50h]
- + ret
- +AcpiArblibReferenceArbiter ENDP
- +
- +
- +AcpiArblibDereferenceArbiter PROC
- + lock dec dword ptr [rcx+50h]
- + ret
- +AcpiArblibDereferenceArbiter ENDP
- +
- +
- +AcpiArblibEjectInterface PROC
- + push rbx
- + sub rsp, 20h
- + mov rbx, rdx
- + call ACPIInternalGetDeviceExtension
- + mov r8, [rbx+0B8h]
- + cmp word ptr [r8+12h], 0
- + mov ecx, [r8+20h]
- + mov rdx, [r8+18h]
- + jnz loc_4E068
- + cmp word ptr [r8+10h], 30h
- + jnb short loc_4DFEC
- + mov eax, 0C000000Dh
- + add rsp, 20h
- + pop rbx
- + ret
- +
- +loc_4DFEC:
- + cmp ecx, 1
- + jnz short loc_4DFFA
- + mov rcx, [rax+0C0h]
- + jmp short loc_4E014
- +
- +loc_4DFFA:
- + cmp ecx, 3
- + jnz short loc_4E008
- + mov rcx, [rax+0B8h]
- + jmp short loc_4E014
- +
- +loc_4E008:
- + cmp ecx, 6
- + jnz short loc_4E068
- + mov rcx, [rax+0C8h]
- +
- +loc_4E014:
- + cmp byte ptr [rcx+82h], 1
- + jnz short loc_4E068
- + lea rax, AcpiArblibReferenceArbiter
- + add rcx, 88h
- + mov word ptr [rdx], 30h
- + mov [rdx+10h], rax
- + lea rax, AcpiArblibDereferenceArbiter
- + mov word ptr [rdx+2], 0
- + mov [rdx+18h], rax
- + lea rax, ArbArbiterHandler
- + mov [rdx+8], rcx
- + mov [rdx+20h], rax
- + mov dword ptr [rdx+28h], 0
- + call AcpiArblibReferenceArbiter
- + xor eax, eax
- + add rsp, 20h
- + pop rbx
- + ret
- +
- +loc_4E068:
- + mov eax, 0C00000BBh
- + add rsp, 20h
- + pop rbx
- + ret
- +AcpiArblibEjectInterface ENDP
- +
- +
- +ACPIBusIrpQueryInterface PROC
- + mov rax, rsp
- + sub rsp, 38h
- + mov [rax+8], rbx
- + mov [rax+10h], rbp
- + mov [rax+18h], rsi
- + mov [rax+20h], rdi
- + mov [rax-8], r12
- + mov [rax-10h], r13
- + mov [rax-18h], r14
- + mov r14, [rdx+0B8h]
- + mov rbx, rdx
- + mov rsi, rcx
- + call ACPIInternalGetDeviceExtension
- + mov rbp, [r14+8]
- + mov r12d, [r14+20h]
- + lea rdx, GUID_ACPI_INTERFACE_STANDARD
- + xor edi, edi
- + cmp rbp, rdx
- + mov r13, rax
- + jz short loc_4F4F8
- + lea r8d, [rdi+10h]
- + mov rcx, rbp
- + callex RtlCompareMemory
- + mov ecx, edi
- + cmp rax, 10h
- + setz cl
- + test ecx, ecx
- + jz short loc_4F536
- +
- +loc_4F4F8:
- + movzx eax, word ptr [r14+10h]
- + cmp ax, 58h
- + jbe short loc_4F50A
- + mov ebp, 58h
- + jmp short loc_4F50D
- +
- +loc_4F50A:
- + movzx ebp, ax
- +
- +loc_4F50D:
- + mov r12, [r14+18h]
- + lea rdx, ACPIInterfaceTable
- + mov r8d, ebp
- + mov rcx, r12
- + call memcpy
- + cmp ebp, 10h
- + jbe loc_4F70A
- + mov [r12+8], rsi
- + mov [rbx+30h], edi
- + jmp short loc_4F596
- +
- +loc_4F536:
- + lea rdx, GUID_TRANSLATOR_INTERFACE_STANDARD
- + cmp rbp, rdx
- + jz short loc_4F562
- + mov r8d, 10h
- + mov rcx, rbp
- + callex RtlCompareMemory
- + mov ecx, edi
- + cmp rax, 10h
- + setz cl
- + test ecx, ecx
- + jz loc_4F5F5
- +
- +loc_4F562:
- + cmp r12d, 2
- + jnz short loc_4F5CB
- + mov rcx, rsi
- + call IsPciBus
- + test al, al
- + jz short loc_4F593
- + mov rax, [rbx+0B8h]
- + xor edx, edx
- + mov rcx, [rax+8]
- + mov [rcx], edx
- + mov [rcx+4], edx
- + mov [rcx+8], edx
- + mov [rcx+0Ch], edx
- + mov dword ptr [rbx+30h], 0C00000BBh
- +
- +loc_4F593:
- + mov edi, [rbx+30h]
- +
- +loc_4F596:
- + xor edx, edx
- + mov rcx, rbx
- + callex IofCompleteRequest
- + mov r14, [rsp+20h]
- + mov r13, [rsp+28h]
- + mov r12, [rsp+30h]
- + mov rsi, [rsp+50h]
- + mov rbp, [rsp+48h]
- + mov rbx, [rsp+40h]
- + mov eax, edi
- + mov rdi, [rsp+58h]
- + add rsp, 38h
- + ret
- +
- +loc_4F5CB:
- + cmp r12d, 1
- + jz short loc_4F5D7
- + cmp r12d, 3
- + jnz short loc_4F593
- +
- +loc_4F5D7:
- + mov rcx, rsi
- + call IsPciBus
- + test al, al
- + jz short loc_4F593
- + mov rdx, rbx
- + mov rcx, rsi
- + call TranslateEjectInterface
- + mov edi, eax
- + jmp loc_4F6FE
- +
- +loc_4F5F5:
- + lea rdx, GUID_PCI_BUS_INTERFACE_STANDARD
- + cmp rbp, rdx
- + jz short loc_4F61D
- + mov r8d, 10h
- + mov rcx, rbp
- + callex RtlCompareMemory
- + mov ecx, edi
- + cmp rax, 10h
- + setz cl
- + test ecx, ecx
- + jz short loc_4F63F
- +
- +loc_4F61D:
- + mov rcx, rsi
- + call IsPciBus
- + test al, al
- + jz loc_4F593
- + mov rdx, rbx
- + mov rcx, rsi
- + call PciBusEjectInterface
- + mov edi, eax
- + jmp loc_4F6FE
- +
- +loc_4F63F:
- + lea rdx, GUID_BUS_INTERFACE_STANDARD
- + cmp rbp, rdx
- + jz short loc_4F667
- + mov r8d, 10h
- + mov rcx, rbp
- + callex RtlCompareMemory
- + mov ecx, edi
- + cmp rax, 10h
- + setz cl
- + test ecx, ecx
- + jz short loc_4F6A1
- +
- +loc_4F667:
- + mov dword ptr [rbx+30h], 0C00002B9h
- + mov rax, [r13+208h]
- + test rax, rax
- + jz loc_4F593
- + mov rcx, [rax+1F0h]
- + test rcx, rcx
- + jz loc_4F593
- + xor r8d, r8d
- + mov rdx, r14
- + call ACPIInternalSendSynchronousIrp
- + mov [rbx+30h], eax
- + jmp loc_4F593
- +
- +loc_4F6A1:
- + lea rdx, GUID_ARBITER_INTERFACE_STANDARD
- + cmp rbp, rdx
- + jz short loc_4F6CC
- + mov r8d, 10h
- + mov rcx, rbp
- + callex RtlCompareMemory
- + cmp rax, 10h
- + setz dil
- + test edi, edi
- + jz loc_4F593
- +
- +loc_4F6CC:
- + mov rax, 2000000000h
- + test [r13+0], rax
- + jz loc_4F593
- + cmp byte ptr [r13+0B0h], 0
- + jz loc_4F593
- + mov rdx, rbx
- + mov rcx, rsi
- + call AcpiArblibEjectInterface
- + mov edi, eax
- + mov [rbx+30h], eax
- +
- +loc_4F6FE:
- + cmp edi, 0C00000BBh
- + jz loc_4F593
- +
- +loc_4F70A:
- + mov [rbx+30h], edi
- + jmp loc_4F596
- +ACPIBusIrpQueryInterface ENDP
- +
- +
- +AcpiPortarbAddAllocation PROC
- + mov r11, rsp
- + sub rsp, 68h
- + mov rax, [rdx+28h]
- + movzx r9d, byte ptr [rdx+42h]
- + mov r8, [rdx+8]
- + mov [r11+8], rbx
- + mov [r11+10h], rbp
- + mov [r11+18h], rsi
- + mov [r11+20h], rdi
- + mov rbp, rcx
- + mov edi, 1
- + test [rax+1Ch], dil
- + mov eax, 3
- + mov [r11-8], r12
- + cmovnz edi, eax
- + mov rax, [rdx+20h]
- + mov rbx, rdx
- + mov rcx, [rax+20h]
- + mov rdx, [rdx]
- + mov [r11-10h], r13
- + mov [r11-38h], rcx
- + mov rcx, [rbp+28h]
- + xor r13d, r13d
- + mov [r11-40h], r13
- + mov [rsp+20h], edi
- + callex RtlAddRange
- + mov rdx, [rbx]
- + mov rax, [rbx+28h]
- + movzx esi, byte ptr [rbx+42h]
- + mov [rsp+40h], rdx
- + mov rcx, [rax+20h]
- + lea r8, [rsp+40h]
- + movzx r12d, word ptr [rcx+4]
- + or sil, 10h
- + mov ecx, r12d
- + call AcpiArblibGetNextAlias
- + test al, al
- + jz short loc_5438B
- +
- + ALIGN16
- +loc_54340:
- + mov rax, [rbx+28h]
- + mov r9, [rbx+20h]
- + mov rdx, [rsp+40h]
- + mov ecx, [rax+10h]
- + mov rax, [r9+20h]
- + movzx r9d, sil
- + mov [rsp+30h], rax
- + lea r8, [rcx+rdx-1]
- + mov rcx, [rbp+28h]
- + mov [rsp+28h], r13
- + mov [rsp+20h], edi
- + callex RtlAddRange
- + mov rdx, [rsp+40h]
- + lea r8, [rsp+40h]
- + mov ecx, r12d
- + call AcpiArblibGetNextAlias
- + test al, al
- + jnz short loc_54340
- +
- +loc_5438B:
- + mov r13, [rsp+58h]
- + mov r12, [rsp+60h]
- + mov rdi, [rsp+88h]
- + mov rsi, [rsp+80h]
- + mov rbp, [rsp+78h]
- + mov rbx, [rsp+70h]
- + add rsp, 68h
- + ret
- +AcpiPortarbAddAllocation ENDP
- +
- +
- +AcpiArblibIsAliasedRangeAvailable PROC
- + mov rax, rsp
- + sub rsp, 0B8h
- + mov [rax+10h], rbp
- + mov [rax+18h], rsi
- + mov [rax-10h], r13
- + mov rsi, rcx
- + mov rcx, [rdx+20h]
- + xor r13b, r13b
- + mov eax, [rcx+28h]
- + mov rbp, rdx
- + test eax, eax
- + jz short loc_4D8D5
- + cmp eax, 2
- + jz short loc_4D8D5
- + test byte ptr [rcx+2Ch], 1
- + jz short loc_4D8D8
- +
- +loc_4D8D5:
- + mov r13b, 1
- +
- +loc_4D8D8:
- + mov [rsp+0C0h], rbx
- + mov rbx, [rdx+28h]
- + mov [rsp+0D8h], rdi
- + mov rax, [rbx+20h]
- + mov rdi, [rdx]
- + mov [rsp+0B0h], r12
- + movzx r12d, word ptr [rax+4]
- + lea rcx, [rsp+50h]
- + mov r8d, 50h
- + mov [rsp+0A0h], r14
- + call memcpy
- + test byte ptr [rbx+1Ch], 1
- + mov r14d, 2
- + mov eax, 3
- + mov ebx, r12d
- + cmovnz r14d, eax
- + and ebx, 4
- +
- +loc_4D931:
- + test ebx, ebx
- + jz short loc_4D93E
- + add rdi, 400h
- + jmp short loc_4D94F
- +
- +loc_4D93E:
- + test r12b, 8
- + jz loc_4D9D0
- + add rdi, 1000h
- +
- +loc_4D94F:
- + cmp rdi, 0FFFFh
- + ja short loc_4D9D0
- + mov rax, [rbp+28h]
- + mov r9d, r14d
- + mov rdx, rdi
- + mov ecx, [rax+10h]
- + lea rax, [rsp+40h]
- + mov [rsp+38h], rax
- + mov rax, [rsi+130h]
- + lea r8, [rcx+rdi-1]
- + mov rcx, [rsi+28h]
- + mov [rsp+30h], rax
- + mov rax, [rsi+128h]
- + mov [rsp+28h], rax
- + mov [rsp+20h], r13b
- + callex RtlIsRangeAvailable
- + cmp byte ptr [rsp+40h], 1
- + jz short loc_4D931
- + mov rax, [rbp+28h]
- + mov [rsp+60h], rdi
- + lea rdx, [rsp+50h]
- + mov ecx, [rax+10h]
- + lea rax, [rcx+rdi-1]
- + mov rcx, rsi
- + mov [rsp+68h], rax
- + call qword ptr [rsi+108h]
- + test al, al
- + jnz loc_4D931
- + jmp short loc_4D9D2
- +
- +loc_4D9D0:
- + mov al, 1
- +
- +loc_4D9D2:
- + mov r14, [rsp+0A0h]
- + mov r13, [rsp+0A8h]
- + mov r12, [rsp+0B0h]
- + mov rdi, [rsp+0D8h]
- + mov rsi, [rsp+0D0h]
- + mov rbp, [rsp+0C8h]
- + mov rbx, [rsp+0C0h]
- + add rsp, 0B8h
- + ret
- +AcpiArblibIsAliasedRangeAvailable ENDP
- +
- +
- +AcpiPortarbFindSuitableRange PROC
- + sub rsp, 58h
- + mov [rsp+60h], rbx
- + mov rbx, rdx
- + mov rdx, [rdx+28h]
- + cmp dword ptr [rdx+10h], 0
- + mov [rsp+78h], rdi
- + mov rdi, rcx
- + jnz short loc_541A6
- + mov rax, [rbx]
- + mov [rbx+8], rax
- + mov al, 1
- + mov rdi, [rsp+78h]
- + mov rbx, [rsp+60h]
- + add rsp, 58h
- + ret
- +
- +loc_541A6:
- + mov rcx, [rbx+20h]
- +
- +loc_541AA:
- + mov [rsp+68h], rbp
- + xor bpl, bpl
- + mov eax, [rcx+28h]
- + test eax, eax
- + jz short loc_541C4
- + cmp eax, 2
- + jz short loc_541C4
- + test byte ptr [rcx+2Ch], 1
- + jz short loc_541C7
- +
- +loc_541C4:
- + mov bpl, 1
- +
- +loc_541C7:
- + mov rax, [rbx+18h]
- + mov [rsp+70h], rsi
- + movzx esi, byte ptr [rdx+1Ch]
- + and esi, 1
- + cmp [rbx+10h], rax
- + ja loc_54272
- +
- +loc_541E1:
- + mov rax, [rdi+130h]
- + mov r9d, [rdx+10h]
- + mov r8, [rbx+18h]
- + mov rcx, [rdi+28h]
- + mov [rsp+48h], rbx
- + mov [rsp+40h], rax
- + mov rax, [rdi+128h]
- + mov [rsp+38h], rax
- + mov eax, [rdx+14h]
- + mov rdx, [rbx+10h]
- + mov [rsp+30h], bpl
- + mov [rsp+28h], esi
- + mov [rsp+20h], eax
- + callex RtlFindRange
- + test eax, eax
- + jns short loc_54238
- + mov rdx, rbx
- + mov rcx, rdi
- + call qword ptr [rdi+108h]
- + test al, al
- + jz short loc_54272
- +
- +loc_54238:
- + mov rax, [rbx+28h]
- + mov rdx, rbx
- + mov ecx, [rax+10h]
- + mov rax, [rbx]
- + lea rcx, [rcx+rax-1]
- + mov [rbx+8], rcx
- + mov rcx, rdi
- + call AcpiArblibIsAliasedRangeAvailable
- + test al, al
- + jnz short loc_5428D
- + mov rdx, [rbx+28h]
- + mov eax, [rdx+10h]
- + add [rbx], rax
- + mov rax, [rbx+18h]
- + cmp [rbx+10h], rax
- + jbe loc_541E1
- +
- +loc_54272:
- + xor al, al
- +
- +loc_54274:
- + mov rsi, [rsp+70h]
- + mov rbp, [rsp+68h]
- + mov rdi, [rsp+78h]
- + mov rbx, [rsp+60h]
- + add rsp, 58h
- + ret
- +
- +loc_5428D:
- + mov al, 1
- + jmp short loc_54274
- +AcpiPortarbFindSuitableRange ENDP
- +
- +
- +AcpiArblibGetNextAlias PROC
- + test cl, 4
- + jz short loc_4D86E
- + lea rax, [rdx+400h]
- + jmp short loc_4D87A
- +
- +loc_4D86E:
- + test cl, 8
- + jz short loc_4D888
- + lea rax, [rdx+1000h]
- +
- +loc_4D87A:
- + cmp rax, 0FFFFh
- + ja short loc_4D888
- + mov [r8], rax
- + mov al, 1
- + ret
- +
- +loc_4D888:
- + xor al, al
- + ret
- +AcpiArblibGetNextAlias ENDP
- +
- +
- +AcpiPortarbBacktrackAllocation PROC
- + sub rsp, 38h
- + mov [rsp+48h], rbx
- + mov rbx, rdx
- + mov rdx, [rdx]
- + mov rax, [rbx+28h]
- + mov [rsp+50h], rsi
- + mov [rsp+20h], rdx
- + mov esi, [rax+1Ch]
- + mov [rsp+58h], rdi
- + mov rdi, rcx
- + lea r8, [rsp+20h]
- + mov ecx, esi
- + call AcpiArblibGetNextAlias
- + test al, al
- + jz short loc_54148
- +
- + ALIGN16
- +loc_54110:
- + mov rax, [rbx+28h]
- + mov rdx, [rsp+20h]
- + mov r9, [rbx+20h]
- + mov ecx, [rax+10h]
- + mov r9, [r9+20h]
- + lea r8, [rcx+rdx-1]
- + mov rcx, [rdi+28h]
- + callex RtlDeleteRange
- + mov rdx, [rsp+20h]
- + lea r8, [rsp+20h]
- + mov ecx, esi
- + call AcpiArblibGetNextAlias
- + test al, al
- + jnz short loc_54110
- +
- +loc_54148:
- + mov rdx, rbx
- + mov rcx, rdi
- + call ArbBacktrackAllocation
- + mov rdi, [rsp+58h]
- + mov rsi, [rsp+50h]
- + mov rbx, [rsp+48h]
- + add rsp, 38h
- + ret
- +AcpiPortarbBacktrackAllocation ENDP
- +
- +
- +AcpiMemarbFindSuitableRange PROC
- + mov rax, [rdx+20h]
- + test byte ptr [rax+2Ch], 1
- + jz short loc_5382E
- + or byte ptr [rdx+43h], 1
- +
- +loc_5382E:
- + jmp ArbFindSuitableRange
- +AcpiMemarbFindSuitableRange ENDP
- +
- +
- +AcpiInitializePortArbiter PROC
- + sub rsp, 38h
- + lea r8, AcpiArblibUnpackRequirement
- + mov r9, rcx
- + mov qword ptr [rsp+28h], 0
- + mov [rcx+0F8h], r8
- + lea r8, AcpiArblibPackResource
- + add rcx, 88h
- + mov [rcx+78h], r8
- + lea r8, AcpiArblibUnpackResource
- + mov [rcx+80h], r8
- + lea r8, AcpiArblibScoreRequirement
- + mov [rcx+88h], r8
- + lea r8, AcpiPortarbFindSuitableRange
- + mov [rcx+0F0h], r8
- + lea r8, AcpiPortarbAddAllocation
- + mov [rcx+0F8h], r8
- + lea r8, AcpiPortarbBacktrackAllocation
- + mov [rcx+100h], r8
- + mov rdx, [rdx+1F0h]
- + lea r8, asmRootName
- + mov [rsp+20h], r8
- + mov r8d, 1
- + call ArbInitializeArbiterInstance
- + add rsp, 38h
- + ret
- +AcpiInitializePortArbiter ENDP
- +
- +
- +AcpiInitializeMemoryArbiter PROC
- + sub rsp, 38h
- + lea r8, AcpiArblibUnpackRequirement
- + mov r9, rcx
- + mov qword ptr [rsp+28h], 0
- + mov [rcx+0F8h], r8
- + lea r8, AcpiArblibPackResource
- + add rcx, 88h
- + mov [rcx+78h], r8
- + lea r8, AcpiArblibUnpackResource
- + mov [rcx+80h], r8
- + lea r8, AcpiArblibScoreRequirement
- + mov [rcx+88h], r8
- + lea r8, AcpiMemarbFindSuitableRange
- + mov [rcx+0F0h], r8
- + mov rdx, [rdx+1F0h]
- + lea r8, asmRootName
- + mov [rsp+20h], r8
- + mov r8d, 3
- + call ArbInitializeArbiterInstance
- + add rsp, 38h
- + ret
- +AcpiInitializeMemoryArbiter ENDP
- +
- +
- +AcpiArblibUnpackRequirement PROC
- + movzx eax, byte ptr [rcx+1]
- + cmp al, 3
- + jz short loc_4D6A5
- + cmp al, 1
- + jz short loc_4D6A5
- + cmp al, 6
- + jnz short loc_4D69F
- + mov eax, [rcx+0Ch]
- + mov [rdx], rax
- + mov eax, [rcx+10h]
- + mov [r8], rax
- + mov eax, [rcx+8]
- + mov [r9], eax
- + mov rax, [rsp+28h]
- + mov dword ptr [rax], 1
- + jmp short loc_4D6CD
- +
- +loc_4D69F:
- + mov eax, 0C0000024h
- + ret
- +
- +loc_4D6A5:
- + mov rax, [rcx+10h]
- + mov [rdx], rax
- + mov rax, [rcx+18h]
- + mov rdx, [rsp+28h]
- + mov [r8], rax
- + mov eax, [rcx+8]
- + mov [r9], eax
- + mov eax, [rcx+0Ch]
- + test eax, eax
- + mov [rdx], eax
- + jnz short loc_4D6CD
- + mov dword ptr [rdx], 1
- +
- +loc_4D6CD:
- + cmp byte ptr [rcx+1], 3
- + jnz short loc_4D6EA
- + test byte ptr [rcx+4], 10h
- + jz short loc_4D6EA
- + cmp qword ptr [rcx+18h], 0FFFFFFh
- + jle short loc_4D6EA
- + mov qword ptr [r8], 0FFFFFFh
- +
- +loc_4D6EA:
- + xor eax, eax
- + ret
- +AcpiArblibUnpackRequirement ENDP
- +
- +
- +AcpiArblibPackResource PROC
- + movzx eax, byte ptr [rcx+1]
- + mov [r8], al
- + movzx eax, word ptr [rcx+4]
- + mov [r8+2], ax
- + movzx eax, byte ptr [rcx+2]
- + mov [r8+1], al
- + cmp byte ptr [rcx+1], 3
- + jz short loc_4D808
- + movzx eax, byte ptr [rcx+1]
- + cmp al, 1
- + jz short loc_4D808
- + cmp al, 6
- + jnz short loc_4D813
- + mov [r8+4], edx
- + mov eax, [rcx+8]
- + mov [r8+8], eax
- + xor eax, eax
- + ret
- +
- +loc_4D808:
- + mov [r8+4], rdx
- + mov eax, [rcx+8]
- + mov [r8+0Ch], eax
- +
- +loc_4D813:
- + xor eax, eax
- + ret
- +AcpiArblibPackResource ENDP
- +
- +
- +AcpiArblibUnpackResource PROC
- + movzx eax, byte ptr [rcx]
- + cmp al, 3
- + jz short loc_4D83E
- + cmp al, 1
- + jz short loc_4D83E
- + cmp al, 6
- + jnz short loc_4D84B
- + mov eax, [rcx+4]
- + mov [rdx], rax
- + mov eax, [rcx+8]
- + mov [r8], eax
- + xor eax, eax
- + ret
- +
- +loc_4D83E:
- + mov rax, [rcx+4]
- + mov [rdx], rax
- + mov eax, [rcx+0Ch]
- + mov [r8], eax
- +
- +loc_4D84B:
- + xor eax, eax
- + ret
- +AcpiArblibUnpackResource ENDP
- +
- +
- +AcpiArblibScoreRequirement PROC
- + push rbx
- + sub rsp, 20h
- + movzx eax, byte ptr [rcx+1]
- + mov ebx, 1
- + cmp al, 3
- + jz short loc_4D727
- + cmp al, bl
- + jz short loc_4D727
- + cmp al, 6
- + jnz short loc_4D78F
- + mov r10d, [rcx+0Ch]
- + mov r9d, [rcx+10h]
- + mov edx, ebx
- + jmp short loc_4D737
- +
- +loc_4D727:
- + mov edx, [rcx+0Ch]
- + mov r10, [rcx+10h]
- + mov r9, [rcx+18h]
- + test edx, edx
- + cmovz edx, ebx
- +
- +loc_4D737:
- + cmp al, 3
- + mov r11d, [rcx+8]
- + jnz short loc_4D755
- + test byte ptr [rcx+4], 10h
- + jz short loc_4D755
- + cmp qword ptr [rcx+18h], 0FFFFFFh
- + jle short loc_4D755
- + mov r9d, 0FFFFFFh
- +
- +loc_4D755:
- + test edx, edx
- + jnz short loc_4D75B
- +
- +loc_4D759:
- + mov edx, ebx
- +
- +loc_4D75B:
- + mov r8d, edx
- + lea rcx, [r8-1]
- + lea rdx, [r8+r10-1]
- + not rcx
- + and rdx, rcx
- + mov ecx, r11d
- + sub r9, rdx
- + sub r9, rcx
- + lea rax, [r9+1]
- + cqo
- + idiv r8
- + test rax, rax
- + jns short loc_4D7AA
- + mov eax, 0FFFFFFFFh
- + add rsp, 20h
- + pop rbx
- + ret
- +
- +loc_4D78F:
- + mov ecx, 50109h
- + call _ACPIInternalError
- + mov r11d, [rsp+30h]
- + mov r9, [rsp+30h]
- + mov r10, [rsp+30h]
- + jmp short loc_4D759
- +
- +loc_4D7AA:
- + mov ecx, 7FFFFFFFh
- + cmp rax, rcx
- + cmovg eax, ecx
- + add rsp, 20h
- + pop rbx
- + ret
- +AcpiArblibScoreRequirement ENDP
- +
- +
- +AcpiInitializeBusNumberArbiter PROC
- + sub rsp, 38h
- + lea r8, AcpiArblibUnpackRequirement
- + mov r9, rcx
- + mov qword ptr [rsp+28h], 0
- + mov [rcx+0F8h], r8
- + lea r8, AcpiArblibPackResource
- + add rcx, 88h
- + mov [rcx+78h], r8
- + lea r8, AcpiArblibUnpackResource
- + mov [rcx+80h], r8
- + lea r8, AcpiArblibScoreRequirement
- + mov [rcx+88h], r8
- + mov rdx, [rdx+1F0h]
- + lea r8, asmRootName
- + mov [rsp+20h], r8
- + mov r8d, 6
- + call ArbInitializeArbiterInstance
- + add rsp, 38h
- + ret
- +AcpiInitializeBusNumberArbiter ENDP
- +
- +
- +AcpiArblibAllocateArbiterInstance PROC
- + sub rsp, 58h
- + cmp edx, 1
- + mov [rsp+60h], rbx
- + mov [rsp+70h], rsi
- + mov rsi, rcx
- + mov ebx, edx
- + jz short loc_4DA53
- + cmp edx, 3
- + jz short loc_4DA53
- + cmp edx, 6
- + jz short loc_4DA53
- + xor eax, eax
- + mov rsi, [rsp+70h]
- + mov rbx, [rsp+60h]
- + add rsp, 58h
- + ret
- +
- +loc_4DA53:
- + mov edx, 1C0h
- + mov ecx, 101h
- + mov r8d, 69706341h
- +
- +loc_4DA63:
- + mov [rsp+50h], r12
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov r12, rax
- + jnz short loc_4DA8A
- + mov r12, [rsp+50h]
- + mov rsi, [rsp+70h]
- + mov rbx, [rsp+60h]
- + add rsp, 58h
- + ret
- +
- +loc_4DA8A:
- + xor edx, edx
- + mov r8d, 1C0h
- + mov rcx, rax
- + call memset
- + lock inc [AcpiArbiterInstanceCount]
- + cmp ebx, 1
- + jnz short loc_4DAAF
- + lea r9, asmPortName
- + jmp short loc_4DAC4
- +
- +loc_4DAAF:
- + lea r9, asmMemoryName
- + lea rax, asmBusNumberName
- + cmp ebx, 3
- + cmovnz r9, rax
- +
- +loc_4DAC4:
- + mov [rsp+78h], rdi
- + mov edi, 40h
- + lea r8, asmACPIName
- + mov rdx, rdi
- + mov rcx, r12
- + callex _snwprintf
- + test eax, eax
- + movsxd r11, eax
- + jns short loc_4DAFA
- + xor edx, edx
- + mov rcx, r12
- + callex ExFreePoolWithTag
- + xor eax, eax
- + jmp loc_4DCA5
- +
- +loc_4DAFA:
- + mov rbx, [rsi+1E8h]
- +
- +loc_4DB01:
- + mov [rsp+68h], rbp
- + sub edi, r11d
- + test rbx, rbx
- + mov [rsp+48h], r13
- + mov rax, r11
- + lea rbp, [r12+r11*2]
- + jz loc_4DC73
- + cmp qword ptr [rbx+10h], 0
- + jz loc_4DC73
- + cmp edi, 5
- + jb loc_4DC73
- + movzx eax, byte ptr [rbx+23h]
- + test al, al
- + jnz short loc_4DB42
- + mov r8d, 2Ah
- + jmp short loc_4DB46
- +
- +loc_4DB42:
- + movsx r8d, al
- +
- +loc_4DB46:
- + movzx eax, byte ptr [rbx+22h]
- + test al, al
- + jnz short loc_4DB55
- + mov edx, 2Ah
- + jmp short loc_4DB58
- +
- +loc_4DB55:
- + movsx edx, al
- +
- +loc_4DB58:
- + movzx eax, byte ptr [rbx+21h]
- + test al, al
- + jnz short loc_4DB67
- + mov ecx, 2Ah
- + jmp short loc_4DB6A
- +
- +loc_4DB67:
- + movsx ecx, al
- +
- +loc_4DB6A:
- + movzx eax, byte ptr [rbx+20h]
- + test al, al
- + jnz short loc_4DB7A
- + mov r9d, 2Ah
- + jmp short loc_4DB7E
- +
- +loc_4DB7A:
- + movsx r9d, al
- +
- +loc_4DB7E:
- + mov [rsp+30h], r8d
- + mov [rsp+28h], edx
- + mov [rsp+20h], ecx
- + lea r8, asmFormat2Name
- + mov rcx, rbp
- + mov edx, 4
- + callex _snwprintf
- + mov rbx, [rbx+10h]
- + add edi, 0FFFFFFFCh
- + cmp qword ptr [rbx+10h], 0
- + lea r13, [rbx+10h]
- + mov esi, 4
- + jz loc_4DC68
- +
- + ALIGN16
- +loc_4DBC0:
- + cmp edi, 6
- + jb loc_4DC73
- + mov r8d, esi
- + lea rcx, [rbp+0Ah]
- + mov rdx, rbp
- + add r8, r8
- + call memcpy
- + mov word ptr [rbp+8], 2Eh
- + movzx eax, byte ptr [rbx+23h]
- + add esi, 5
- + add edi, 0FFFFFFFBh
- + test al, al
- + jnz short loc_4DBF7
- + mov r8d, 2Ah
- + jmp short loc_4DBFB
- +
- +loc_4DBF7:
- + movsx r8d, al
- +
- +loc_4DBFB:
- + movzx eax, byte ptr [rbx+22h]
- + test al, al
- + jnz short loc_4DC0A
- + mov edx, 2Ah
- + jmp short loc_4DC0D
- +
- +loc_4DC0A:
- + movsx edx, al
- +
- +loc_4DC0D:
- + movzx eax, byte ptr [rbx+21h]
- + test al, al
- + jnz short loc_4DC1C
- + mov ecx, 2Ah
- + jmp short loc_4DC1F
- +
- +loc_4DC1C:
- + movsx ecx, al
- +
- +loc_4DC1F:
- + movzx eax, byte ptr [rbx+20h]
- + test al, al
- + jnz short loc_4DC2F
- + mov r9d, 2Ah
- + jmp short loc_4DC33
- +
- +loc_4DC2F:
- + movsx r9d, al
- +
- +loc_4DC33:
- + mov [rsp+30h], r8d
- + mov [rsp+28h], edx
- + mov [rsp+20h], ecx
- + lea r8, asmFormat2Name
- + mov rcx, rbp
- + mov edx, 4
- + callex _snwprintf
- + mov rbx, [r13+0]
- + cmp qword ptr [rbx+10h], 0
- + lea r13, [rbx+10h]
- + jnz loc_4DBC0
- +
- +loc_4DC68:
- + mov eax, esi
- + mov word ptr [rbp+rax*2+0], 0
- + jmp short loc_4DC98
- +
- +loc_4DC73:
- + mov r9d, [AcpiArbiterInstanceCount]
- + lea r8, asmFormat3Name
- + mov edx, edi
- + mov rcx, rbp
- + callex _snwprintf
- + lea r11d, [rdi-1]
- + mov word ptr [rbp+r11*2+0], 0
- +
- +loc_4DC98:
- + mov rbp, [rsp+68h]
- + mov r13, [rsp+48h]
- + mov rax, r12
- +
- +loc_4DCA5:
- + mov rdi, [rsp+78h]
- + mov r12, [rsp+50h]
- + mov rsi, [rsp+70h]
- + mov rbx, [rsp+60h]
- + add rsp, 58h
- + ret
- +AcpiArblibAllocateArbiterInstance ENDP
- +
- +
- +AcpiArblibInitializeArbiter PROC
- + sub rsp, 28h
- + cmp edx, 1
- + mov [rsp+38h], rbp
- + mov [rsp+40h], rsi
- + mov [rsp+48h], rdi
- + mov rbp, r8
- + mov rsi, rcx
- + mov edi, edx
- + jz short loc_4DD53
- + cmp edx, 3
- + jz short loc_4DD53
- + cmp edx, 6
- + jz short loc_4DD53
- + mov eax, 0C000000Dh
- + mov rdi, [rsp+48h]
- + mov rsi, [rsp+40h]
- + mov rbp, [rsp+38h]
- + add rsp, 28h
- + ret
- +
- +loc_4DD53:
- + mov [rsp+30h], rbx
- + call AcpiArblibAllocateArbiterInstance
- + test rax, rax
- + mov rbx, rax
- + jnz short loc_4DD6C
- + mov eax, 0C000009Ah
- + jmp short loc_4DDD6
- +
- +loc_4DD6C:
- + cmp edi, 1
- + jnz short loc_4DD80
- + mov rdx, rsi
- + mov rcx, rax
- + call AcpiInitializePortArbiter
- + mov edi, eax
- + jmp short loc_4DDA1
- +
- +loc_4DD80:
- + cmp edi, 3
- + jnz short loc_4DD94
- + mov rdx, rsi
- + mov rcx, rax
- + call AcpiInitializeMemoryArbiter
- + mov edi, eax
- + jmp short loc_4DDA1
- +
- +loc_4DD94:
- + mov rdx, rsi
- + mov rcx, rax
- + call AcpiInitializeBusNumberArbiter
- + mov edi, eax
- +
- +loc_4DDA1:
- + test edi, edi
- + jns short loc_4DDC9
- + cmp byte ptr [rbx+80h], 0
- + jz short loc_4DDBA
- + lea rcx, [rbx+88h]
- + call ArbDeleteArbiterInstance
- +
- +loc_4DDBA:
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- + mov eax, edi
- + jmp short loc_4DDD6
- +
- +loc_4DDC9:
- + mov byte ptr [rbx+80h], 1
- + xor eax, eax
- + mov [rbp+0], rbx
- +
- +loc_4DDD6:
- + mov rbx, [rsp+30h]
- + mov rdi, [rsp+48h]
- + mov rsi, [rsp+40h]
- + mov rbp, [rsp+38h]
- + add rsp, 28h
- + ret
- +AcpiArblibInitializeArbiter ENDP
- +
- +
- +ACPIBuildPdo PROC
- + mov r11, rsp
- + sub rsp, 78h
- + mov [r11+8], rbx
- + mov [r11+10h], rbp
- + mov [r11+20h], rdi
- + xor ebp, ebp
- + mov [r11-10h], r13
- + lea rax, [r11-38h]
- + mov [r11-48h], rax
- + mov [r11-18h], r14
- + movzx r14d, r9b
- + mov rbx, r8
- + mov rdi, rdx
- + lea r9d, [rbp+32h]
- + xor r8d, r8d
- + xor edx, edx
- + mov [rsp+28h], bpl
- + mov r13, rbp
- + mov [r11-38h], rbp
- + mov dword ptr [rsp+20h], 80h
- + callex IoCreateDevice
- + test eax, eax
- + js loc_11C58
- + test r14b, r14b
- + jz short loc_119E1
- + mov eax, [rdi]
- + bt rax, 14h
- + jb short loc_119DE
- + mov rcx, rbx
- + callex IoGetAttachedDeviceReference
- + test rax, rax
- + mov r13, rax
- + jnz short loc_119E1
- + mov rcx, [rsp+40h]
- + callex IoDeleteDevice
- + mov eax, 0C000000Eh
- + jmp loc_11C58
- +
- +loc_119DE:
- + xor r14b, r14b
- +
- +loc_119E1:
- + mov [rsp+90h], rsi
- + mov rax, 2000000000h
- + mov [rsp+70h], r12
- + test [rdi], rax
- + mov [rsp+58h], r15
- + jz short loc_11A23
- + mov rcx, [rdi+1E8h]
- + mov edx, 5352435Fh
- + call ACPIAmliGetNamedChild
- + test rax, rax
- + jnz loc_11B13
- + mov [rdi+0B0h], bpl
- +
- +loc_11A23:
- + lea rcx, AcpiDeviceTreeLock
- + callex KeAcquireSpinLockRaiseToDpc
- + mov rcx, [rsp+40h]
- + mov [rcx+40h], rdi
- + mov rcx, [rsp+40h]
- + movzx esi, al
- + mov [rdi+1F0h], rcx
- + mov [rdi+200h], rcx
- + lock inc dword ptr [rdi+1D4h]
- + mov r8b, 1
- + mov edx, 1FFh
- + mov rcx, rdi
- + call ACPIInternalUpdateFlags
- + xor r8d, r8d
- + mov rcx, rdi
- + lea edx, [r8+20h]
- + call ACPIInternalUpdateFlags
- + test r14b, r14b
- + mov eax, [rdi+0E0h]
- + mov [rdi+0E4h], eax
- + lea rax, AcpiPdoIrpDispatch
- + mov [rdi+0E0h], ebp
- + mov [rdi+10h], rax
- + jz short loc_11AED
- + xor r8d, r8d
- + mov rcx, rdi
- + mov [rdi+1F8h], r13
- + lea edx, [r8+40h]
- + call ACPIInternalUpdateFlags
- + mov rax, [rsp+40h]
- + lea r11, AcpiBusFilterIrpDispatch
- + mov [rdi+10h], r11
- + movzx ecx, byte ptr [r13+4Ch]
- + inc cl
- + mov [rax+4Ch], cl
- + mov rax, [rsp+40h]
- + mov ecx, [r13+98h]
- + mov [rax+98h], ecx
- + bt dword ptr [r13+30h], 0Dh
- + jnb short loc_11AED
- + mov rax, [rsp+40h]
- + or dword ptr [rax+30h], 2000h
- +
- +loc_11AED:
- + mov rax, [rdi]
- + mov rcx, 1000000000h
- + test rcx, rax
- + jz loc_11B85
- + lea rax, AcpiProcessorIrpDispatch
- + mov [rdi+10h], rax
- + jmp loc_11BE3
- +
- +loc_11B13:
- + mov byte ptr [rdi+0B0h], 1
- + mov ebx, ebp
- + mov rsi, rbp
- + lea r15, AcpiArbiterResourceTypes
- +
- +loc_11B26:
- + mov edx, [r15+rsi*4]
- + mov eax, ebx
- + mov rcx, rdi
- + lea r8, [rdi+rax*8+0B8h]
- + call AcpiArblibInitializeArbiter
- + test eax, eax
- + mov r12d, eax
- + js short loc_11B52
- + inc ebx
- + inc rsi
- + cmp ebx, 3
- + jb short loc_11B26
- + jmp loc_11A23
- +
- +loc_11B52:
- + test ebx, ebx
- + jz short loc_11B72
- + lea rdi, [rdi+rsi*8+0B8h]
- + xchg ax, ax
- +
- +loc_11B60:
- + mov rcx, [rdi-8]
- + sub rdi, 8
- + call AcpiArblibFreeArbiterInstance
- + add ebx, 0FFFFFFFFh
- + jnz short loc_11B60
- +
- +loc_11B72:
- + mov rcx, [rsp+40h]
- + callex IoDeleteDevice
- + mov eax, r12d
- + jmp loc_11C46
- +
- +loc_11B85:
- + mov rcx, 200000000000h
- + test rcx, rax
- + jz short loc_11BE3
- + cmp [AcpiInternalDeviceTable], rbp
- + jz short loc_11BE3
- + lea r12, AcpiInternalDeviceTable
- + mov rdx, r12
- + mov rbx, r12
- +
- + ALIGN16
- +loc_11BB0:
- + mov rdx, [rdx]
- + mov rcx, [rdi+1B0h]
- + callex strstr
- + test rax, rax
- + jnz short loc_11BD5
- + add rbx, 10h
- + inc ebp
- + cmp [rbx], rax
- + mov rdx, rbx
- + jnz short loc_11BB0
- + jmp short loc_11BE3
- +
- +loc_11BD5:
- + mov eax, ebp
- + add rax, rax
- + mov rax, [r12+rax*8+8]
- + mov [rdi+10h], rax
- +
- +loc_11BE3:
- + mov rax, [rdi]
- + bt rax, 12h
- + jnb short loc_11C0E
- + mov rdx, 8000000000000h
- + test rdx, rax
- + mov rax, [FixedButtonDeviceObject]
- + cmovnz rax, [rsp+40h]
- + mov [FixedButtonDeviceObject], rax
- +
- +loc_11C0E:
- + lea rcx, AcpiDeviceTreeLock
- + movzx edx, sil
- + callex KeReleaseSpinLock
- + mov r11, [rsp+40h]
- + mov rax, 10000000000000h
- + and dword ptr [r11+30h], 0FFFFFF7Fh
- + test [rdi], rax
- + jz short loc_11C44
- + mov rax, [rsp+40h]
- + or dword ptr [rax+30h], 8
- +
- +loc_11C44:
- + xor eax, eax
- +
- +loc_11C46:
- + mov r12, [rsp+70h]
- + mov rsi, [rsp+90h]
- + mov r15, [rsp+58h]
- +
- +loc_11C58:
- + mov r14, [rsp+60h]
- + mov r13, [rsp+68h]
- + mov rdi, [rsp+98h]
- + mov rbp, [rsp+88h]
- + mov rbx, [rsp+80h]
- + add rsp, 78h
- + ret
- +ACPIBuildPdo ENDP
- +
- +
- +PnpDeviceBiosResourcesToNtResources PROC
- + sub rsp, 28h
- + mov eax, r8d
- + mov r10, rdx
- + mov [rsp+30h], rbx
- + mov rbx, rcx
- + mov [rsp+38h], rbp
- + mov r8, r9
- + mov edx, eax
- + mov rcx, r10
- + mov [rsp+40h], rsi
- + mov rsi, r9
- + call PnpBiosResourcesToNtResources
- + test eax, eax
- + mov ebp, eax
- + js loc_27080
- + cmp qword ptr [rsi], 0
- + jz loc_27080
- + lea rcx, AcpiDeviceTreeLock
- +
- +loc_26FD7:
- + mov [rsp+48h], rdi
- + xor dil, dil
- + callex KeAcquireSpinLockRaiseToDpc
- + test rbx, rbx
- + jz short loc_2700A
- + mov rcx, 2000000000h
- +
- +loc_26FF4:
- + test [rbx], rcx
- + jnz short loc_27007
- + mov rbx, [rbx+208h]
- + test rbx, rbx
- + jnz short loc_26FF4
- + jmp short loc_2700A
- +
- +loc_27007:
- + mov dil, 1
- +
- +loc_2700A:
- + lea rcx, AcpiDeviceTreeLock
- + movzx edx, al
- + callex KeReleaseSpinLock
- + test dil, dil
- + mov rdi, [rsp+48h]
- + jz short loc_2707E
- +
- +loc_27024:
- + mov rax, [rsi]
- + mov ecx, [rax+1Ch]
- + lea r8, [rax+20h]
- + test ecx, ecx
- + jz short loc_2707E
- + mov r9, rcx
- +
- + ALIGN16
- +loc_27040:
- + lea rdx, [r8+8]
- + mov r8d, [r8+4]
- + shl r8, 5
- + add r8, rdx
- + cmp rdx, r8
- + jnb short loc_27079
- +
- +loc_27054:
- + movzx ecx, byte ptr [rdx+1]
- + dec ecx
- + jz short loc_27066
- + sub ecx, 2
- + jz short loc_27066
- + cmp ecx, 3
- + jnz short loc_27070
- +
- +loc_27066:
- + cmp byte ptr [rdx+2], 3
- + jnz short loc_27070
- + mov byte ptr [rdx+2], 1
- +
- +loc_27070:
- + add rdx, 20h
- + cmp rdx, r8
- + jb short loc_27054
- +
- +loc_27079:
- + dec r9
- + jnz short loc_27040
- +
- +loc_2707E:
- + mov eax, ebp
- +
- +loc_27080:
- + mov rsi, [rsp+40h]
- + mov rbp, [rsp+38h]
- + mov rbx, [rsp+30h]
- + add rsp, 28h
- + ret
- +PnpDeviceBiosResourcesToNtResources ENDP
- +
- +
- +ACPIGetProcessorID PROC
- + mov r11, rsp
- + sub rsp, 88h
- + mov rax, [__security_cookie]
- + mov [rsp+38h], rax
- + mov rax, [rsp+0B0h]
- + mov [r11-8], rbx
- + mov [r11-10h], rbp
- + mov [r11-20h], rdi
- + mov rdi, [AcpiProcessorString+8]
- + mov [rsp+28h], rax
- + mov eax, dword ptr [asmACPISlashName]
- + lea rcx, [r11-58h]
- + mov [r11-28h], r12
- + mov r12, [rsp+0B8h]
- + mov [rcx], eax
- + movzx eax, word ptr [asmACPISlashName+4]
- + mov [rcx+4], ax
- + xor eax, eax
- + mov [r11-30h], r13
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov word ptr [rsp+20h], 2Ah
- + mov [r11-38h], r14
- + repne scasb
- + mov [r11-40h], r15
- + lea rdi, [r11-58h]
- + not rcx
- + mov r15d, r9d
- + xor ebx, ebx
- + lea rbp, [rcx-1]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + xor r13d, r13d
- + repne scasb
- + mov r14d, r9d
- + not rcx
- + add ebp, ecx
- + and r15d, 40h
- + jz loc_1E198
- + mov r8d, 53706341h
- + mov edx, ebp
- + xor ecx, ecx
- + mov edi, ebp
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jnz short loc_1E0D9
- + mov eax, 0C000009Ah
- + jmp loc_1E320
- +
- +loc_1E0D9:
- + mov r8, rdi
- + xor edx, edx
- + mov rcx, rax
- + call memset
- + mov rdx, [AcpiProcessorString+8]
- + mov rcx, rbx
- +
- +loc_1E0F0:
- + movzx eax, byte ptr [rdx]
- + inc rcx
- + inc rdx
- + test al, al
- + mov [rcx-1], al
- + jnz short loc_1E0F0
- + lea rdx, asmModelName
- + mov rcx, rbx
- + callex strstr
- + lea rdx, asmFamilyName
- + mov rcx, rbx
- + mov r13, rax
- + callex strstr
- + test r13, r13
- + mov r11, rax
- + jz loc_1E1ED
- + test rax, rax
- + jz loc_1E1ED
- + xor eax, eax
- + lea rdi, [rsp+20h]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + repne scasb
- + lea rdi, [rsp+30h]
- + not rcx
- + lea rdx, [rcx-1]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + repne scasb
- + mov rdi, r11
- + not rcx
- + dec rcx
- + add edx, ecx
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + lea eax, [rdx+rbp*2]
- + lea ebp, [rax+rax*2]
- + xor eax, eax
- + repne scasb
- + mov rdi, r13
- + not rcx
- + lea rdx, [rcx-1]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + repne scasb
- + not rcx
- + dec rcx
- + add edx, ecx
- + add edx, edx
- + sub ebp, edx
- +
- +loc_1E198:
- + mov ecx, r14d
- + mov r8d, 53706341h
- + mov edx, ebp
- + shr ecx, 1Ch
- +
- +loc_1E1A6:
- + mov [rsp+70h], rsi
- + mov edi, ebp
- + not ecx
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rsi, rax
- + jnz short loc_1E202
- + mov rax, [rsp+28h]
- + xor ecx, ecx
- + test r12, r12
- + mov [rax], rcx
- + jz short loc_1E1D3
- + mov [r12], ecx
- +
- +loc_1E1D3:
- + test rbx, rbx
- + jz short loc_1E1E3
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- +
- +loc_1E1E3:
- + mov eax, 0C000009Ah
- + jmp loc_1E31B
- +
- +loc_1E1ED:
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- + mov eax, 0C0000001h
- + jmp loc_1E320
- +
- +loc_1E202:
- + mov r8, rdi
- + xor edx, edx
- + mov rcx, rax
- + call memset
- + test r14b, 20h
- + jz short loc_1E236
- + mov r9, [AcpiProcessorString+8]
- + lea r8, [rsp+30h]
- + lea rdx, asmStrStrName
- + mov rcx, rsi
- + callex sprintf
- + jmp loc_1E2F4
- +
- +loc_1E236:
- + test r15d, r15d
- + jz loc_1E2F4
- + lea r8, [rsp+30h]
- + lea rdx, asmStrStrName
- + mov r9, rbx
- + mov rcx, rsi
- + callex sprintf
- + lea r8, [rsp+20h]
- + lea rdx, asmStrStrName
- + lea edi, [rax+1]
- + mov r9, rbx
- + mov ecx, edi
- + add rcx, rsi
- + callex sprintf
- + lea r8, [rsp+30h]
- + lea rdx, asmStrStrName
- + add edi, eax
- + mov r9, rbx
- + mov byte ptr [r13-1], 0
- + inc edi
- + mov ecx, edi
- + add rcx, rsi
- + callex sprintf
- + lea r8, [rsp+20h]
- + lea rdx, asmStrStrName
- + lea edi, [rdi+rax+1]
- + mov r9, rbx
- + mov ecx, edi
- + add rcx, rsi
- + callex sprintf
- + lea r8, [rsp+30h]
- + lea rdx, asmStrStrName
- + add edi, eax
- + mov r9, rbx
- + mov byte ptr [r13-1], 0
- + inc edi
- + mov ecx, edi
- + add rcx, rsi
- + callex sprintf
- + lea r8, [rsp+20h]
- + lea rdx, asmStrStrName
- + lea ecx, [rdi+rax+1]
- + mov r9, rbx
- + add rcx, rsi
- + callex sprintf
- +
- +loc_1E2F4:
- + test rbx, rbx
- + jz short loc_1E304
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- +
- +loc_1E304:
- + test r12, r12
- + mov rax, [rsp+28h]
- + mov [rax], rsi
- + jz short loc_1E319
- + lea eax, [rbp+rbp+0]
- + mov [r12], eax
- +
- +loc_1E319:
- + xor eax, eax
- +
- +loc_1E31B:
- + mov rsi, [rsp+70h]
- +
- +loc_1E320:
- + mov r15, [rsp+48h]
- + mov r14, [rsp+50h]
- + mov r13, [rsp+58h]
- + mov r12, [rsp+60h]
- + mov rdi, [rsp+68h]
- + mov rbp, [rsp+78h]
- + mov rbx, [rsp+80h]
- + mov rcx, [rsp+38h]
- + call __security_check_cookie
- + add rsp, 88h
- + ret
- +ACPIGetProcessorID ENDP
- +
- +
- +ACPIGetProcessorIDWide PROC
- + mov r11, rsp
- + sub rsp, 88h
- + mov rax, [__security_cookie]
- + mov [rsp+38h], rax
- + mov rax, [rsp+0B0h]
- + mov [r11-8], rbx
- + mov [r11-10h], rbp
- + mov [r11-20h], rdi
- + mov rdi, [AcpiProcessorString+8]
- + mov [rsp+28h], rax
- + mov eax, dword ptr [asmACPISlashName]
- + lea rcx, [r11-58h]
- + mov [r11-28h], r12
- + mov r12, [rsp+0B8h]
- + mov [rcx], eax
- + movzx eax, word ptr [asmACPISlashName+4]
- + mov [rcx+4], ax
- + xor eax, eax
- + mov [r11-30h], r13
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov word ptr [rsp+20h], 2Ah
- + mov [r11-38h], r14
- + repne scasb
- + lea rdi, [r11-58h]
- + xor ebx, ebx
- + not rcx
- + xor r14d, r14d
- + xor r13d, r13d
- + lea rbp, [rcx-1]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + mov [r11-40h], r15
- + repne scasb
- + mov eax, r9d
- + mov r15d, r9d
- + not rcx
- + add ebp, ecx
- + and eax, 40h
- + mov [rsp+24h], eax
- + jz loc_1E4F8
- + mov r8d, 53706341h
- + mov edx, ebp
- + xor ecx, ecx
- + mov edi, ebp
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rbx, rax
- + jnz short loc_1E42F
- + mov eax, 0C000009Ah
- + jmp loc_1E683
- +
- +loc_1E42F:
- + mov r8, rdi
- + xor edx, edx
- + mov rcx, rax
- + call memset
- + mov rdx, [AcpiProcessorString+8]
- + mov rcx, rbx
- +
- + ALIGN16
- +loc_1E450:
- + movzx eax, byte ptr [rdx]
- + inc rcx
- + inc rdx
- + test al, al
- + mov [rcx-1], al
- + jnz short loc_1E450
- + lea rdx, asmModelName
- + mov rcx, rbx
- + callex strstr
- + lea rdx, asmFamilyName
- + mov rcx, rbx
- + mov r14, rax
- + callex strstr
- + test r14, r14
- + mov r13, rax
- + jz loc_1E551
- + test rax, rax
- + jz loc_1E551
- + xor eax, eax
- + lea rdi, [rsp+20h]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + repne scasb
- + lea rdi, [rsp+30h]
- + not rcx
- + lea rdx, [rcx-1]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + repne scasb
- + mov rdi, r13
- + not rcx
- + dec rcx
- + add edx, ecx
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + lea eax, [rdx+rbp*2]
- + lea ebp, [rax+rax*2]
- + xor eax, eax
- + repne scasb
- + mov rdi, r14
- + not rcx
- + lea rdx, [rcx-1]
- + mov rcx, 0FFFFFFFFFFFFFFFFh
- + repne scasb
- + not rcx
- + dec rcx
- + add edx, ecx
- + add edx, edx
- + sub ebp, edx
- +
- +loc_1E4F8:
- + mov ecx, r15d
- + mov edi, ebp
- + mov r8d, 53706341h
- + shr ecx, 1Ch
- + add rdi, rdi
- +
- +loc_1E509:
- + mov [rsp+70h], rsi
- + not ecx
- + mov rdx, rdi
- + and ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rsi, rax
- + jnz short loc_1E566
- + mov rax, [rsp+28h]
- + xor ecx, ecx
- + test r12, r12
- + mov [rax], rcx
- + jz short loc_1E537
- + mov [r12], ecx
- +
- +loc_1E537:
- + test rbx, rbx
- + jz short loc_1E547
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- +
- +loc_1E547:
- + mov eax, 0C000009Ah
- + jmp loc_1E67E
- +
- +loc_1E551:
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- + mov eax, 0C0000001h
- + jmp loc_1E683
- +
- +loc_1E566:
- + mov r8, rdi
- + xor edx, edx
- + mov rcx, rax
- + call memset
- + test r15b, 20h
- + jz short loc_1E59A
- + mov r9, [AcpiProcessorString+8]
- + lea r8, [rsp+30h]
- + lea rdx, asmSTRSTRBIGName
- + mov rcx, rsi
- + callex swprintf
- + jmp loc_1E657
- +
- +loc_1E59A:
- + cmp dword ptr [rsp+24h], 0
- + jz loc_1E657
- + lea r8, [rsp+30h]
- + lea rdx, asmSTRSTRBIGName
- + mov r9, rbx
- + mov rcx, rsi
- + callex swprintf
- + lea r8, [rsp+20h]
- + lea rdx, asmSTRSTRBIGName
- + lea edi, [rax+1]
- + mov r9, rbx
- + lea rcx, [rsi+rdi*2]
- + callex swprintf
- + lea r8, [rsp+30h]
- + lea rdx, asmSTRSTRBIGName
- + add edi, eax
- + mov r9, rbx
- + mov byte ptr [r14-1], 0
- + inc edi
- + lea rcx, [rsi+rdi*2]
- + callex swprintf
- + lea r8, [rsp+20h]
- + lea rdx, asmSTRSTRBIGName
- + lea edi, [rdi+rax+1]
- + mov r9, rbx
- + lea rcx, [rsi+rdi*2]
- + callex swprintf
- + lea r8, [rsp+30h]
- + lea rdx, asmSTRSTRBIGName
- + add edi, eax
- + mov r9, rbx
- + mov byte ptr [r13-1], 0
- + inc edi
- + lea rcx, [rsi+rdi*2]
- + callex swprintf
- + lea r8, [rsp+20h]
- + lea rdx, asmSTRSTRBIGName
- + lea ecx, [rdi+rax+1]
- + mov r9, rbx
- + lea rcx, [rsi+rcx*2]
- + callex swprintf
- +
- +loc_1E657:
- + test rbx, rbx
- + jz short loc_1E667
- + xor edx, edx
- + mov rcx, rbx
- + callex ExFreePoolWithTag
- +
- +loc_1E667:
- + test r12, r12
- + mov rax, [rsp+28h]
- + mov [rax], rsi
- + jz short loc_1E67C
- + lea eax, [rbp+rbp+0]
- + mov [r12], eax
- +
- +loc_1E67C:
- + xor eax, eax
- +
- +loc_1E67E:
- + mov rsi, [rsp+70h]
- +
- +loc_1E683:
- + mov r15, [rsp+48h]
- + mov r14, [rsp+50h]
- + mov r13, [rsp+58h]
- + mov r12, [rsp+60h]
- + mov rdi, [rsp+68h]
- + mov rbp, [rsp+78h]
- + mov rbx, [rsp+80h]
- + mov rcx, [rsp+38h]
- + call __security_check_cookie
- + add rsp, 88h
- + ret
- +ACPIGetProcessorIDWide ENDP
- +
- +
- +ACPIRegReadEntireSimulatorAcpiTable PROC
- + sub rsp, 78h
- + mov rax, [__security_cookie]
- + mov [rsp+38h], rax
- + mov [rsp+70h], rsi
- + mov rsi, [rdx]
- + mov [rsp+60h], r12
- + mov r12, rdx
- + mov [rsp+58h], r13
- + mov [rsp+48h], r15
- + mov r15, rcx
- + mov edx, 2000h
- + mov r8d, 53637041h
- + mov ecx, 1
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov r13, rax
- + jnz short loc_3B2F5
- + mov eax, 0C000009Ah
- + jmp loc_3B473
- +
- +loc_3B2F5:
- + mov [rsp+90h], rbx
- + mov [rsp+98h], rbp
- + lea rdx, asmFormat1Name
- + lea rcx, [rsp+28h]
- + mov [rsp+68h], rdi
- + xor r8d, r8d
- + mov [rsp+50h], r14
- + xor r14d, r14d
- + callex sprintf
- + lea r9, [rsp+20h]
- + lea rcx, [rsp+28h]
- + mov r8, r13
- + mov rdx, r15
- + mov dword ptr [rsp+20h], 2000h
- + call OSReadRegValue
- + test eax, eax
- + js loc_3B433
- +
- + ALIGN16
- +loc_3B350:
- + mov eax, [rsp+20h]
- + cmp eax, 8
- + jb loc_3B442
- + xor edi, edi
- + test eax, eax
- + jz loc_3B3F7
- +
- + ALIGN16
- +loc_3B370:
- + mov ebx, edi
- + add rbx, r13
- + mov eax, [rbx+4]
- + test eax, eax
- + jnz short loc_3B3D4
- + mov eax, [rbx]
- + lea rbp, [rsi+4]
- + cmp eax, [rbp+0]
- + jz short loc_3B3E6
- + mov rdx, rax
- + xor ecx, ecx
- + mov r8d, 74706341h
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rsi, rax
- + jz loc_3B449
- + mov ecx, [rbx]
- + mov edx, [rbp+0]
- + cmp ecx, edx
- + cmovb edx, ecx
- + mov rcx, rax
- + mov r8d, edx
- + mov rdx, [r12]
- + call memcpy
- + mov rcx, [r12]
- + test rcx, rcx
- + jz short loc_3B3CE
- + xor edx, edx
- + callex ExFreePoolWithTag
- +
- +loc_3B3CE:
- + mov [r12], rsi
- + jmp short loc_3B3E6
- +
- +loc_3B3D4:
- + mov ecx, [rbx]
- + lea rdx, [rbx+8]
- + mov r8, rax
- + add rcx, [r12]
- + call memcpy
- +
- +loc_3B3E6:
- + mov eax, [rbx+4]
- + lea edi, [rdi+rax+8]
- + cmp edi, [rsp+20h]
- + jb loc_3B370
- +
- +loc_3B3F7:
- + inc r14d
- + lea rdx, asmFormat1Name
- + lea rcx, [rsp+28h]
- + mov r8d, r14d
- + callex sprintf
- + lea r9, [rsp+20h]
- + lea rcx, [rsp+28h]
- + mov r8, r13
- + mov rdx, r15
- + mov dword ptr [rsp+20h], 2000h
- + call OSReadRegValue
- + test eax, eax
- + jns loc_3B350
- +
- +loc_3B433:
- + xor edx, edx
- + mov rcx, r13
- + callex ExFreePoolWithTag
- + xor eax, eax
- + jmp short loc_3B459
- +
- +loc_3B442:
- + mov eax, 0C0000001h
- + jmp short loc_3B459
- +
- +loc_3B449:
- + xor edx, edx
- + mov rcx, r13
- + callex ExFreePoolWithTag
- + mov eax, 0C000009Ah
- +
- +loc_3B459:
- + mov rdi, [rsp+68h]
- + mov rbp, [rsp+98h]
- + mov rbx, [rsp+90h]
- + mov r14, [rsp+50h]
- +
- +loc_3B473:
- + mov r15, [rsp+48h]
- + mov r13, [rsp+58h]
- + mov r12, [rsp+60h]
- + mov rsi, [rsp+70h]
- + mov rcx, [rsp+38h]
- + call __security_check_cookie
- + add rsp, 78h
- + ret
- +ACPIRegReadEntireSimulatorAcpiTable ENDP
- +
- +
- +ACPIRegGetTableFromSimulatorRegistryEntry PROC
- + mov rax, rsp
- + sub rsp, 48h
- + mov [rax+8], rbx
- + mov [rax+10h], rbp
- + mov rbp, [rcx]
- + mov [rax+18h], rsi
- + mov [rax+20h], rdi
- + xor ebx, ebx
- + mov [rax-8], r12
- + mov [rax-18h], r14
- + mov r12, rcx
- + mov r14d, 1
- + lea edx, [rbx+6Ah]
- + mov r8d, 53637041h
- + mov ecx, r14d
- + xor dil, dil
- + mov [rax-20h], rbx
- + mov [rax-28h], rbx
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov rsi, rax
- + jz loc_3B8E5
- + xor edx, edx
- + mov rcx, rax
- +
- +loc_3B78B:
- + mov [rsp+38h], r13
- + lea r8d, [rdx+6Ah]
- + call memset
- + lea rdx, SimulatorRegEntry
- + mov r8d, 54h
- + mov rcx, rsi
- + call memcpy
- + lea r11, [rsi+54h]
- + mov r8d, ebx
- + inc r11
- + mov byte ptr [r11-1], 5Ch
- + mov rdx, rbp
- + mov r9, r11
- + mov r13d, 5Fh
- + sub r9, rbp
- +
- + ALIGN16
- +loc_3B7D0:
- + movzx ecx, byte ptr [rdx]
- + test cl, cl
- + jz short loc_3B7F2
- + cmp cl, 20h
- + movzx eax, cl
- + cmovz eax, r13d
- + inc r8d
- + inc rdx
- + cmp r8d, 4
- + mov [r9+rdx-1], al
- + jb short loc_3B7D0
- +
- +loc_3B7F2:
- + mov r10d, r8d
- + lea rdx, [rbp+0Ah]
- + mov r8d, ebx
- + add r10, r11
- + inc r10
- + mov byte ptr [r10-1], 5Ch
- + mov r9, r10
- + sub r9, rdx
- +
- + ALIGN16
- +loc_3B810:
- + movzx ecx, byte ptr [rdx]
- + test cl, cl
- + jz short loc_3B832
- + cmp cl, 20h
- + movzx eax, cl
- + cmovz eax, r13d
- + inc r8d
- + inc rdx
- + cmp r8d, 6
- + mov [r9+rdx-1], al
- + jb short loc_3B810
- +
- +loc_3B832:
- + mov r9d, r8d
- + lea rdx, [rbp+10h]
- + add r9, r10
- + lea r8, [r9+1]
- + mov byte ptr [r9], 5Ch
- + sub r8, rdx
- +
- +loc_3B847:
- + movzx ecx, byte ptr [rdx]
- + test cl, cl
- + jz short loc_3B867
- + cmp cl, 20h
- + movzx eax, cl
- + cmovz eax, r13d
- + inc ebx
- + inc rdx
- + cmp ebx, 8
- + mov [r8+rdx-1], al
- + jb short loc_3B847
- +
- +loc_3B867:
- + mov byte ptr [rbx+r9+1], 0
- + lea r8, [rsp+20h]
- + xor edx, edx
- + mov rcx, rsi
- + mov byte ptr [rbx+r9+1], 0
- + call OSOpenHandle
- + mov r13, [rsp+38h]
- + test eax, eax
- + js short loc_3B8B9
- +
- +loc_3B88B:
- + mov r8d, [rbp+18h]
- + mov rcx, [rsp+20h]
- + lea rdx, [rsp+28h]
- + call OSOpenLargestSubkey
- + test eax, eax
- + js short loc_3B8B9
- + mov rcx, [rsp+28h]
- + mov rdx, r12
- + call ACPIRegReadEntireSimulatorAcpiTable
- + movzx edi, dil
- + test eax, eax
- + cmovns edi, r14d
- +
- +loc_3B8B9:
- + xor edx, edx
- + mov rcx, rsi
- + callex ExFreePoolWithTag
- + mov rcx, [rsp+20h]
- + test rcx, rcx
- + jz short loc_3B8D3
- + call OSCloseHandle
- +
- +loc_3B8D3:
- + mov rcx, [rsp+28h]
- + test rcx, rcx
- + jz short loc_3B8E2
- + call OSCloseHandle
- +
- +loc_3B8E2:
- + mov al, dil
- +
- +loc_3B8E5:
- + mov r14, [rsp+30h]
- + mov r12, [rsp+40h]
- + mov rdi, [rsp+68h]
- + mov rsi, [rsp+60h]
- + mov rbp, [rsp+58h]
- + mov rbx, [rsp+50h]
- + add rsp, 48h
- + ret
- +ACPIRegGetTableFromSimulatorRegistryEntry ENDP
- +
- +
- +ACPIEnumerateTables PROC
- + sub rsp, 58h
- + mov rax, AcpiInformation
- + mov [rsp+60h], rbx
- + mov [rsp+70h], rsi
- + mov r8, [rax]
- + mov [rsp+78h], rdi
- + xor ebx, ebx
- + mov [rsp+48h], r13
- + xor r13b, r13b
- + cmp dword ptr [r8], 54445358h
- + mov [rsp+38h], r15
- + mov rsi, rcx
- + mov [rsp+20h], ebx
- + mov r15, rdx
- + jnz short loc_3AC0E
- + mov eax, [r8+4]
- + cmp eax, 24h
- + jnb short loc_3ABFA
- + mov rdi, rax
- + mov rcx, rax
- + mov r13b, 1
- + sub rdi, rax
- + shr rdi, 3
- + jmp short loc_3AC2B
- +
- +loc_3ABFA:
- + mov ecx, 24h
- + mov rdi, rax
- + mov r13b, 1
- + sub rdi, rcx
- + shr rdi, 3
- + jmp short loc_3AC2B
- +
- +loc_3AC0E:
- + mov eax, [r8+4]
- + cmp eax, 24h
- + jnb short loc_3AC1C
- + mov rcx, rax
- + jmp short loc_3AC21
- +
- +
- +loc_3AC1C:
- + mov ecx, 24h
- +
- +loc_3AC21:
- + mov rdi, rax
- + sub rdi, rcx
- + shr rdi, 2
- +
- +loc_3AC2B:
- + test edi, edi
- + mov [rsp+68h], rbp
- + mov [rsp+50h], r12
- + mov [rsp+40h], r14
- + jz loc_3ACE3
- + test rdx, rdx
- + lea ecx, [rdi*4]
- + mov [rsp+20h], ecx
- + jz loc_3ACEA
- + mov eax, [rdx]
- + cmp eax, ecx
- + jnb short loc_3AC66
- + mov ebx, 0C0000023h
- + jmp loc_3ACEF
- +
- +loc_3AC66:
- + mov r8, rax
- + xor edx, edx
- + mov rcx, rsi
- + call memset
- + test edi, edi
- + mov r12d, ebx
- + jz short loc_3ACEF
- + mov r14d, 24h
- + mov rbp, rbx
- + sub r14, rsi
- +
- +loc_3AC86:
- + test r13b, r13b
- + jz short loc_3AC9C
- + mov rax, AcpiInformation
- + mov rcx, [rax]
- + mov rcx, [rcx+rbp+24h]
- + jmp short loc_3ACAD
- +
- +loc_3AC9C:
- + mov rax, AcpiInformation
- + lea rdx, [r14+rsi]
- + mov rcx, [rax]
- + mov ecx, [rdx+rcx]
- +
- +loc_3ACAD:
- + xor r8d, r8d
- + lea edx, [r8+24h]
- + callex MmMapIoSpace
- + test rax, rax
- + mov rcx, rax
- + jz short loc_3ACE3
- + mov eax, [rax]
- + mov edx, 24h
- + mov [rsi], eax
- + callex MmUnmapIoSpace
- + inc r12d
- + add rbp, 8
- + add rsi, 4
- + cmp r12d, edi
- + jb short loc_3AC86
- + jmp short loc_3ACEF
- +
- +loc_3ACE3:
- + mov ebx, 0C0140019h
- + jmp short loc_3ACEF
- +
- +loc_3ACEA:
- + mov ebx, 0C000000Dh
- +
- +loc_3ACEF:
- + mov edi, [rsp+20h]
- + mov r14, [rsp+40h]
- + mov r13, [rsp+48h]
- + mov r12, [rsp+50h]
- + mov rsi, [rsp+70h]
- + mov rbp, [rsp+68h]
- + mov [r15], edi
- + mov r15, [rsp+38h]
- + mov rdi, [rsp+78h]
- + mov eax, ebx
- + mov rbx, [rsp+60h]
- + add rsp, 58h
- + ret
- +ACPIEnumerateTables ENDP
- +
- +
- +AcpiArblibFreeArbiterInstance PROC
- + push rbx
- + sub rsp, 20h
- + cmp byte ptr [rcx+80h], 0
- + mov rbx, rcx
- + jz short loc_4DCEE
- + add rcx, 88h
- + call ArbDeleteArbiterInstance
- +
- +loc_4DCEE:
- + xor edx, edx
- + mov rcx, rbx
- + add rsp, 20h
- + pop rbx
- + jmp qword ptr [__imp_ExFreePoolWithTag]
- +AcpiArblibFreeArbiterInstance ENDP
- +
- +
- +ACPIMapNamedTable PROC
- + mov [rsp+20h], r9
- + mov [rsp+18h], r8
- + mov [rsp+10h], rdx
- + mov [rsp+8], ecx
- + mov rax, rsp
- + sub rsp, 88h
- + mov r10, AcpiInformation
- + mov [rax-8], rbx
- + mov [rax-10h], rbp
- + mov [rax-18h], rsi
- + mov [rax-28h], r12
- + xor ebp, ebp
- + mov [rax-30h], r13
- + mov [rax-38h], r14
- + mov [rax-40h], r15
- + xor r15b, r15b
- + mov [rax-58h], rbp
- + mov rax, [r10]
- + xor r12b, r12b
- + cmp dword ptr [rax], 54445358h
- + mov rbx, r8
- + mov r14, rdx
- + mov [rsp+21h], r15b
- + mov [rsp+20h], r15b
- + mov rsi, rbp
- + mov [rsp+24h], ebp
- + jnz short loc_3A850
- + mov eax, [rax+4]
- + cmp eax, 24h
- + jnb short loc_3A83A
- + mov r13, rax
- + mov rcx, rax
- + mov byte ptr [rsp+20h], 1
- + sub r13, rax
- + shr r13, 3
- + jmp short loc_3A86C
- +
- +loc_3A83A:
- + mov ecx, 24h
- + mov r13, rax
- + mov byte ptr [rsp+20h], 1
- + sub r13, rcx
- + shr r13, 3
- + jmp short loc_3A86C
- +
- +loc_3A850:
- + mov ecx, [rax+4]
- + cmp ecx, 24h
- + jnb short loc_3A85D
- + mov rdx, rcx
- + jmp short loc_3A862
- +
- +loc_3A85D:
- + mov edx, 24h
- +
- +loc_3A862:
- + mov r13, rcx
- + sub r13, rdx
- + shr r13, 2
- +
- +loc_3A86C:
- + test r13d, r13d
- + jnz short loc_3A87B
- + mov eax, 0C0140019h
- + jmp loc_3AB61
- +
- +loc_3A87B:
- + test r13d, r13d
- +
- +loc_3A87E:
- + mov [rsp+68h], rdi
- + mov [rsp+28h], ebp
- + jz loc_3AA28
- + mov rdi, [rsp+30h]
- + mov r14, rbp
- + mov r15d, 24h
- + jmp short loc_3A8A7
- +
- + ALIGN16
- +loc_3A8A0:
- + mov r10, AcpiInformation
- +
- +loc_3A8A7:
- + cmp [rsp+20h], bpl
- + jz short loc_3A8B8
- + mov rbx, [r10]
- + mov rbx, [r14+rbx+24h]
- + jmp short loc_3A8BF
- +
- +loc_3A8B8:
- + mov rax, [r10]
- + mov ebx, [r15+rax]
- +
- +loc_3A8BF:
- + xor r8d, r8d
- + mov rcx, rbx
- + lea edx, [r8+24h]
- + callex MmMapIoSpace
- + test rax, rax
- + mov rsi, rax
- + mov [rsp+30h], rax
- + jz loc_3A9A0
- + mov eax, [rsp+90h]
- + cmp [rsi], eax
- + jnz short loc_3A94F
- + mov rax, [rsp+98h]
- + mov r12b, 1
- + test rax, rax
- + jz short loc_3A91F
- + lea r8, [rsi+0Ah]
- + sub r8, rax
- +
- +loc_3A902:
- + movzx edx, byte ptr [rax]
- + movzx ecx, byte ptr [rax+r8]
- + sub edx, ecx
- + jnz short loc_3A915
- + inc rax
- + test ecx, ecx
- + jnz short loc_3A902
- +
- +loc_3A915:
- + movzx r12d, r12b
- + test edx, edx
- + cmovnz r12d, ebp
- +
- +loc_3A91F:
- + mov rax, [rsp+0A0h]
- + test rax, rax
- + jz short loc_3A94F
- + lea r8, [rsi+10h]
- + sub r8, rax
- +
- +loc_3A933:
- + movzx edx, byte ptr [rax]
- + movzx ecx, byte ptr [rax+r8]
- + sub edx, ecx
- + jnz short loc_3A946
- + inc rax
- + test ecx, ecx
- + jnz short loc_3A933
- +
- +loc_3A946:
- + test edx, edx
- + jz short loc_3A94F
- + xor r12b, r12b
- + jmp short loc_3A954
- +
- +loc_3A94F:
- + test r12b, r12b
- + jnz short loc_3A9B5
- +
- +loc_3A954:
- + mov edx, 24h
- + mov rcx, rsi
- + callex MmUnmapIoSpace
- + mov eax, [rsp+28h]
- + add r15, 4
- + inc eax
- + add r14, 8
- + mov rdi, rbp
- + cmp eax, r13d
- + mov rsi, rbp
- + mov [rsp+30h], rbp
- + mov [rsp+28h], eax
- + jb loc_3A8A0
- + mov rbx, [rsp+0A0h]
- + mov r14, [rsp+98h]
- + xor r12b, r12b
- + jmp loc_3AA39
- +
- +loc_3A9A0:
- + mov r14d, [rsp+24h]
- + xor r15b, r15b
- + mov ebp, 0C0140019h
- + xor r12b, r12b
- + jmp loc_3AB22
- +
- +loc_3A9B5:
- + mov r14d, [rsi+4]
- + mov edx, 24h
- + mov rcx, rsi
- + mov [rsp+24h], r14d
- + callex MmUnmapIoSpace
- + mov rdx, r14
- + xor r8d, r8d
- + mov rcx, rbx
- + mov rdi, rbp
- + callex MmMapIoSpace
- + test rax, rax
- + mov rsi, rax
- + mov [rsp+30h], rax
- + jnz short loc_3A9FB
- + xor r15b, r15b
- + mov ebp, 0C0140019h
- + xor r12b, r12b
- + jmp loc_3AB22
- +
- +loc_3A9FB:
- + lea rcx, [rsp+30h]
- + mov dl, 1
- + call ACPIRegReadAMLRegistryEntry
- + mov rsi, [rsp+30h]
- + mov rbx, [rsp+0A0h]
- + mov r14, [rsp+98h]
- + mov rdi, rsi
- + movzx r12d, al
- + xor r15b, r15b
- + jmp short loc_3AA30
- +
- +loc_3AA28:
- + mov rdi, [rsp+30h]
- + xor r12b, r12b
- +
- +loc_3AA30:
- + test rdi, rdi
- + jnz loc_3AAF1
- +
- +loc_3AA39:
- + cmp [g_AmliHookEnabled], ebp
- + jz loc_3AADB
- + mov edx, 24h
- + xor ecx, ecx
- + mov r8d, 74706341h
- + mov [rsp+28h], rbp
- + callex ExAllocatePoolWithTag
- + test rax, rax
- + mov [rsp+28h], rax
- + jz short loc_3AAD6
- + xor ecx, ecx
- + test r14, r14
- + mov [rax], rcx
- + mov [rax+8], rcx
- + mov [rax+10h], rcx
- + mov [rax+18h], rcx
- + mov [rax+20h], ecx
- + mov rax, [rsp+28h]
- + mov ecx, [rsp+90h]
- + mov [rax], ecx
- + mov rax, [rsp+28h]
- + mov dword ptr [rax+4], 24h
- + jz short loc_3AAA5
- + mov rax, [rsp+28h]
- + mov ecx, [r14]
- + mov [rax+0Ah], ecx
- +
- +loc_3AAA5:
- + test rbx, rbx
- + jz short loc_3AAB6
- + mov rax, [rsp+28h]
- + mov rcx, [rbx]
- + mov [rax+10h], rcx
- +
- +loc_3AAB6:
- + lea rcx, [rsp+28h]
- + call ACPIRegGetTableFromSimulatorRegistryEntry
- + test al, al
- + movzx r15d, al
- + mov [rsp+21h], al
- + jz short loc_3AAD6
- + mov rdi, [rsp+28h]
- + test rdi, rdi
- + jnz short loc_3AAEC
- +
- +loc_3AAD6:
- + mov rsi, [rsp+30h]
- +
- +loc_3AADB:
- + mov r14d, [rsp+24h]
- + mov r15b, [rsp+21h]
- + mov ebp, 0C0000225h
- + jmp short loc_3AB22
- +
- +loc_3AAEC:
- + mov rsi, [rsp+30h]
- +
- +loc_3AAF1:
- + mov rbx, [rsp+0B0h]
- + mov r14d, [rdi+4]
- + cmp [rbx], r14d
- + jnb short loc_3AB0C
- + mov [rbx], r14d
- + mov ebp, 0C0000023h
- + jmp short loc_3AB22
- +
- +loc_3AB0C:
- + mov rcx, [rsp+0A8h]
- + mov r8, r14
- + mov rdx, rdi
- + call memcpy
- + mov [rbx], r14d
- +
- +loc_3AB22:
- + test rsi, rsi
- + jz short loc_3AB45
- + test r12b, r12b
- + jz short loc_3AB39
- + xor edx, edx
- + mov rcx, rsi
- + callex ExFreePoolWithTag
- + jmp short loc_3AB45
- +
- +loc_3AB39:
- + mov edx, r14d
- + mov rcx, rsi
- + callex MmUnmapIoSpace
- +
- +loc_3AB45:
- + test r15b, r15b
- + jz short loc_3AB5A
- + test rdi, rdi
- + jz short loc_3AB5A
- + xor edx, edx
- + mov rcx, rdi
- + callex ExFreePoolWithTag
- +
- +loc_3AB5A:
- + mov rdi, [rsp+68h]
- + mov eax, ebp
- +
- +loc_3AB61:
- + mov r15, [rsp+48h]
- + mov r14, [rsp+50h]
- + mov r13, [rsp+58h]
- + mov r12, [rsp+60h]
- + mov rsi, [rsp+70h]
- + mov rbp, [rsp+78h]
- + mov rbx, [rsp+80h]
- + add rsp, 88h
- + ret
- +ACPIMapNamedTable ENDP
- +
- +
- +ACPIEnumMapTableHandler PROC
- + sub rsp, 38h
- + mov edx, [rcx+4]
- + test edx, edx
- + jz short loc_3AD68
- + dec edx
- + jz short loc_3AD49
- + mov eax, 0C0000002h
- + add rsp, 38h
- + ret
- +
- +loc_3AD49:
- + lea rax, [rcx+0Ch]
- + lea r9, [rcx+10h]
- + mov ecx, [rcx+8]
- + xor r8d, r8d
- + xor edx, edx
- + mov [rsp+20h], rax
- + call ACPIMapNamedTable
- + add rsp, 38h
- + ret
- +
- +loc_3AD68:
- + lea rdx, [rcx+0Ch]
- + add rcx, 10h
- + add rsp, 38h
- + jmp ACPIEnumerateTables
- +ACPIEnumMapTableHandler ENDP
- +
- +
- +ACPIInitializeKernelTableHandler PROC
- + sub rsp, 48h
- + mov r8d, 18h
- + mov [rsp+24h], cl
- + lea rax, ACPIEnumMapTableHandler
- + mov [rsp+30h], rdx
- + lea ecx, [r8+33h]
- + lea rdx, [rsp+20h]
- + mov dword ptr [rsp+20h], 41435049h
- + mov [rsp+28h], rax
- + callex ZwSetSystemInformation
- + add rsp, 48h
- + ret
- +ACPIInitializeKernelTableHandler ENDP
- +
- +
- +AcpiArblibCommitResources PROC
- + mov rax, rsp
- + sub rsp, 88h
- + cmp byte ptr [rcx+81h], 0
- + mov [rax+8], rbx
- + mov [rax+10h], rbp
- + mov [rax-10h], r13
- + mov r13d, [rcx+0A0h]
- + mov rbx, rdx
- + mov rbp, rcx
- + jz short loc_4DE47
- + mov rcx, [rcx+0A8h]
- + callex RtlFreeRangeList
- + mov byte ptr [rbp+83h], 0
- + mov byte ptr [rbp+81h], 0
- +
- +loc_4DE47:
- + mov [rsp+0A0h], rsi
- + mov [rsp+0A8h], rdi
- + mov [rsp+80h], r12
- + mov [rsp+70h], r14
- + xor r14d, r14d
- + test rbx, rbx
- + mov r12d, r14d
- + jnz short loc_4DE7F
- + lea rcx, [rsp+50h]
- + callex RtlInitializeRangeList
- + jmp loc_4DF2B
- +
- +loc_4DE7F:
- + lea rcx, [rsp+50h]
- + callex RtlInitializeRangeList
- + mov eax, [rbx+10h]
- + lea rdi, [rbx+14h]
- + lea rcx, [rax+rax*4]
- + lea rbx, [rdi+rcx*4]
- + cmp rdi, rbx
- + jnb loc_4DF2B
- +
- +loc_4DEA2:
- + movzx eax, byte ptr [rdi]
- + cmp eax, r13d
- + jnz short loc_4DF1E
- + lea rax, [rdi+14h]
- + cmp rax, rbx
- + jnb short loc_4DF1E
- +
- +loc_4DEB3:
- + cmp byte ptr [rax], 81h
- + jnz short loc_4DF1E
- + cmp word ptr [rax+2], 1
- + jz short loc_4DECA
- + add rax, 14h
- + cmp rax, rbx
- + jb short loc_4DEB3
- + jmp short loc_4DF1E
- +
- +loc_4DECA:
- + lea r8, [rsp+40h]
- + lea rdx, [rsp+48h]
- + mov rcx, rdi
- + call qword ptr [rbp+108h]
- + test eax, eax
- + mov esi, eax
- + js short loc_4DF56
- + mov eax, [rsp+40h]
- + test eax, eax
- + jz short loc_4DF1E
- + mov rdx, [rsp+48h]
- + mov [rsp+30h], r14
- + lea rcx, [rsp+50h]
- + lea r8, [rax+rdx-1]
- + xor r9d, r9d
- + mov [rsp+28h], r14
- + mov dword ptr [rsp+20h], 3
- + callex RtlAddRange
- + test eax, eax
- + mov esi, eax
- + js short loc_4DF56
- + inc r12d
- +
- +loc_4DF1E:
- + add rdi, 14h
- + cmp rdi, rbx
- + jb loc_4DEA2
- +
- +loc_4DF2B:
- + mov rcx, [rbp+0A8h]
- + lea rdx, [rsp+50h]
- + callex RtlInvertRangeList
- + test eax, eax
- + mov esi, eax
- + js short loc_4DF56
- + test r12d, r12d
- + mov byte ptr [rbp+81h], 1
- + jnz short loc_4DF56
- + mov byte ptr [rbp+83h], 1
- +
- +loc_4DF56:
- + lea rcx, [rsp+50h]
- + callex RtlFreeRangeList
- + mov r14, [rsp+70h]
- + mov r13, [rsp+78h]
- + mov r12, [rsp+80h]
- + mov rdi, [rsp+0A8h]
- + mov rbp, [rsp+98h]
- + mov rbx, [rsp+90h]
- + mov eax, esi
- + mov rsi, [rsp+0A0h]
- + add rsp, 88h
- + ret
- +AcpiArblibCommitResources ENDP
- +
- +_TEXT ends
- + END
- \ No newline at end of file
- diff --strip-trailing-cr -ur ./driver/nt/arblib.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/arblib.c"
- --- ./driver/nt/arblib.c 2022-12-15 06:55:55.852539000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/arblib.c" 2022-04-06 22:47:01.715820300 +0500
- @@ -0,0 +1,1423 @@
- +#include "pch.h"
- +
- +WCHAR asmRootName[] = L"Root";
- +WCHAR asmPortName[] = L"Port";
- +WCHAR asmMemoryName[] = L"Memory";
- +WCHAR asmBusNumberName[] = L"Bus Number";
- +WCHAR asmACPIName[] = L"ACPI %s ";
- +WCHAR asmFormat2Name[] = L"%C%C%C%C";
- +WCHAR asmFormat3Name[] = L"%x";
- +CHAR asmPciBarName[] = "PciBarTarget";
- +CHAR asmACPI2Name[] = "ACPI\\%s";
- +CHAR asmStar2Name[] = "*%s";
- +WCHAR asmACPI2NameL[] = L"ACPI\\%S";
- +WCHAR asmStar2NameL[] = L"*%S";
- +
- +
- +ULONG AcpiArbiterInstanceCount;
- +
- +#ifdef_X86_
- +
- +extern VOID __cdecl _alldiv(VOID); // ntoskrnl.lib
- +
- +
- +void __declspec(naked)
- +ACPIConvertStringDelimitation(char *psIn, char Char) {
- +_asm {
- + mov edi, edi
- + push ebp
- + mov ebp, esp
- + mov ecx, [ebp+8]
- + test ecx, ecx
- + jz short loc_28165
- + mov eax, ecx
- + push esi
- + lea esi, [eax+1]
- +
- +loc_2813E:
- + mov dl, [eax]
- + inc eax
- + test dl, dl
- + jnz short loc_2813E
- + sub eax, esi
- + jmp short loc_2815C
- +
- +loc_28149:
- + mov cl, [ebp+0Ch]
- + mov [eax], cl
- + mov ecx, eax
- + lea esi, [ecx+1]
- +
- +loc_28153:
- + mov dl, [ecx]
- + inc ecx
- + test dl, dl
- + jnz short loc_28153
- + sub ecx, esi
- +
- +loc_2815C:
- + add eax, ecx
- + cmp byte ptr [eax+1], 0
- + jnz short loc_28149
- + pop esi
- +
- +loc_28165:
- + pop ebp
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibReferenceArbiter() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov ecx, [ebp+8]
- + add ecx, 28h
- + call dword ptr [InterlockedIncrement]
- + pop ebp
- + retn 4
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibDereferenceArbiter() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov ecx, [ebp+8]
- + add ecx, 28h
- + call dword ptr [InterlockedDecrement]
- + pop ebp
- + retn 4
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibEjectInterface(VOID) {
- +_asm {
- + push ebp
- + mov ebp, esp
- + push esi
- + push dword ptr [ebp+8]
- + call ACPIInternalGetDeviceExtension
- + mov ecx, [ebp+0Ch]
- + mov edx, [ecx+60h]
- + cmp word ptr [edx+0Ah], 0
- + mov esi, [edx+10h]
- + mov ecx, [edx+0Ch]
- + jnz short loc_31C63
- + cmp word ptr [edx+8], 18h
- + jnb short loc_31C09
- + mov eax, 0C000000Dh
- + jmp short loc_31C68
- +
- +loc_31C09:
- + cmp esi, 1
- + jnz short loc_31C13
- + mov eax, [eax+6Ch]
- + jmp short loc_31C25
- +
- +loc_31C13:
- + cmp esi, 3
- + jnz short loc_31C1D
- + mov eax, [eax+68h]
- + jmp short loc_31C25
- +
- +loc_31C1D:
- + cmp esi, 6
- + jnz short loc_31C63
- + mov eax, [eax+70h]
- +
- +loc_31C25:
- + cmp byte ptr [eax+82h], 1
- + jnz short loc_31C63
- + and word ptr [ecx+2], 0
- + and dword ptr [ecx+14h], 0
- + add eax, 84h
- + push eax
- + mov word ptr [ecx], 18h
- + mov [ecx+4], eax
- + mov dword ptr [ecx+8], offset AcpiArblibReferenceArbiter
- + mov dword ptr [ecx+0Ch], offset AcpiArblibDereferenceArbiter
- + mov dword ptr [ecx+10h], offset ArbArbiterHandler
- + call AcpiArblibReferenceArbiter
- + xor eax, eax
- + jmp short loc_31C68
- +
- +loc_31C63:
- + mov eax, 0C00000BBh
- +
- +loc_31C68:
- + pop esi
- + pop ebp
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibFreeArbiterInstance (ACPI_ARBITER_INSTANCE *CommonInstance) {
- +__asm {
- + push ebp
- + mov ebp, esp
- + push esi
- + mov esi, [ebp+8]
- + cmp byte ptr [esi+80h], 0
- + jz short loc_31A24
- + lea eax, [esi+84h]
- + push eax
- + call ArbDeleteArbiterInstance
- +
- +loc_31A24:
- + push 0
- + push esi
- + call dword ptr[ExFreePoolWithTag]
- + pop esi
- + pop ebp
- + retn 4
- +}
- +}
- +
- +
- +NTSTATUS __declspec(naked)
- +AcpiArblibCommitResources (ACPI_ARBITER_INSTANCE *CommonInstance, PVOID IrpStuff) {
- +__asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 24h
- + push ebx
- + push esi
- + mov esi, [ebp+8]
- + cmp byte ptr [esi+81h], 0
- + mov eax, [esi+90h]
- + push edi
- + mov [ebp-4], eax
- + jz short loc_31AF4
- + push dword ptr [esi+94h]
- + call dword ptr[RtlFreeRangeList]
- + mov byte ptr [esi+83h], 0
- + mov byte ptr [esi+81h], 0
- +
- +loc_31AF4:
- + and dword ptr [ebp+8], 0
- + mov edi, [ebp+0Ch]
- + lea eax, [ebp-24h]
- + push eax
- + call dword ptr[RtlInitializeRangeList]
- + test edi, edi
- + jz loc_31B97
- + lea eax, [edi+14h]
- + mov edi, [edi+10h]
- + shl edi, 4
- + add edi, eax
- + mov ecx, eax
- + cmp eax, edi
- + jmp short loc_31B92
- +
- +loc_31B1E:
- + movzx eax, byte ptr [ecx]
- + cmp eax, [ebp-4]
- + jnz short loc_31B8A
- + lea eax, [ecx+10h]
- + jmp short loc_31B3A
- +
- +loc_31B2B:
- + cmp byte ptr [eax], 81h
- + jnz short loc_31B8A
- + cmp word ptr [eax+2], 1
- + jz short loc_31B40
- + add eax, 10h
- +
- +loc_31B3A:
- + cmp eax, edi
- + jb short loc_31B2B
- + jmp short loc_31B8A
- +
- +loc_31B40:
- + lea eax, [ebp-8]
- + push eax
- + lea eax, [ebp-10h]
- + push eax
- + push ecx
- + call dword ptr [esi+0C4h]
- + mov ebx, eax
- + test ebx, ebx
- + jl short loc_31BC1
- + mov eax, [ebp-8]
- + test eax, eax
- + jbe short loc_31B8A
- + xor ecx, ecx
- + add eax, [ebp-10h]
- + push ecx
- + push ecx
- + push 3
- + push ecx
- + adc ecx, [ebp-0Ch]
- + add eax, 0FFFFFFFFh
- + adc ecx, 0FFFFFFFFh
- + push ecx
- + push eax
- + push dword ptr [ebp-0Ch]
- + lea eax, [ebp-24h]
- + push dword ptr [ebp-10h]
- + push eax
- + call dword ptr[RtlAddRange]
- + mov ebx, eax
- + test ebx, ebx
- + jl short loc_31BC1
- + inc dword ptr [ebp+8]
- +
- +loc_31B8A:
- + mov ecx, [ebp+0Ch]
- + add ecx, 10h
- + cmp ecx, edi
- +
- +loc_31B92:
- + mov [ebp+0Ch], ecx
- + jb short loc_31B1E
- +
- +loc_31B97:
- + lea eax, [ebp-24h]
- + push eax
- + push dword ptr [esi+94h]
- + call dword ptr[RtlInvertRangeList]
- + mov ebx, eax
- + test ebx, ebx
- + jl short loc_31BC1
- + cmp dword ptr [ebp+8], 0
- + mov byte ptr [esi+81h], 1
- + jnz short loc_31BC1
- + mov byte ptr [esi+83h], 1
- +
- +loc_31BC1:
- + lea eax, [ebp-24h]
- + push eax
- + call dword ptr[RtlFreeRangeList]
- + pop edi
- + pop esi
- + mov eax, ebx
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibUnpackRequirement() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov eax, [ebp+8]
- + mov cl, [eax+1]
- + push ebx
- + xor ebx, ebx
- + inc ebx
- + cmp cl, 3
- + push esi
- + jz short loc_3147C
- + cmp cl, bl
- + jz short loc_3147C
- + cmp cl, 6
- + jnz short loc_31475
- + mov edx, [eax+0Ch]
- + mov ecx, [ebp+0Ch]
- + and dword ptr [ecx+4], 0
- + mov esi, [ebp+14h]
- + mov [ecx], edx
- + mov edx, [eax+10h]
- + mov ecx, [ebp+10h]
- + and dword ptr [ecx+4], 0
- + mov [ecx], edx
- + mov edx, [eax+8]
- + mov [esi], edx
- + mov edx, [ebp+18h]
- + mov [edx], ebx
- + jmp short loc_314AE
- +
- +loc_31475:
- + mov eax, 0C0000024h
- + jmp short loc_314D4
- +
- +loc_3147C:
- + mov edx, [eax+10h]
- + mov ecx, [ebp+0Ch]
- + mov esi, [ebp+14h]
- + mov [ecx], edx
- + mov edx, [eax+14h]
- + mov [ecx+4], edx
- + mov edx, [eax+18h]
- + mov ecx, [ebp+10h]
- + mov [ecx], edx
- + mov edx, [eax+1Ch]
- + mov [ecx+4], edx
- + mov edx, [eax+8]
- + mov [esi], edx
- + mov edx, [eax+0Ch]
- + test edx, edx
- + mov esi, [ebp+18h]
- + mov [esi], edx
- + jnz short loc_314AE
- + mov [esi], ebx
- +
- +loc_314AE:
- + cmp byte ptr [eax+1], 3
- + jnz short loc_314D2
- + test byte ptr [eax+4], 10h
- + jz short loc_314D2
- + cmp dword ptr [eax+1Ch], 0
- + jl short loc_314D2
- + mov edx, 0FFFFFFh
- + jg short loc_314CC
- + cmp [eax+18h], edx
- + jbe short loc_314D2
- +
- +loc_314CC:
- + and dword ptr [ecx+4], 0
- + mov [ecx], edx
- +
- +loc_314D2:
- + xor eax, eax
- +
- +loc_314D4:
- + pop esi
- + pop ebx
- + pop ebp
- + retn 14h
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibScoreRequirement() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 14h
- + and dword ptr [ebp-4], 0
- + lea eax, [ebp-4]
- + push eax
- + lea eax, [ebp+8]
- + push eax
- + lea eax, [ebp-14h]
- + push eax
- + lea eax, [ebp-0Ch]
- + push eax
- + push dword ptr [ebp+8]
- + call AcpiArblibUnpackRequirement
- + test eax, eax
- + jge short loc_31512
- + push 50109h
- + call _ACPIInternalError
- +
- +loc_31512:
- + mov ecx, [ebp-4]
- + test ecx, ecx
- + jnz short loc_3151A
- + inc ecx
- +
- +loc_3151A:
- + push ebx
- + xor eax, eax
- + push esi
- + push edi
- + mov edx, ecx
- + add edx, [ebp-0Ch]
- + mov esi, eax
- + adc esi, [ebp-8]
- + sub edx, 1
- + sbb esi, eax
- + mov edi, ecx
- + sub edi, 1
- + not edi
- + mov ebx, eax
- + sbb ebx, eax
- + and edx, edi
- + mov edi, [ebp-14h]
- + not ebx
- + and esi, ebx
- + sub edi, edx
- + mov edx, [ebp-10h]
- + sbb edx, esi
- + mov esi, [ebp+8]
- + xor ebx, ebx
- + sub edi, esi
- + sbb edx, ebx
- + push eax
- + add edi, 1
- + push ecx
- + adc edx, ebx
- + push edx
- + push edi
- + call dword ptr [_alldiv]
- + test edx, edx
- + pop edi
- + pop esi
- + pop ebx
- + jg short loc_31576
- + jl short loc_3156D
- + test eax, eax
- + jnb short loc_31572
- +
- +loc_3156D:
- + or eax, 0FFFFFFFFh
- + jmp short locret_31583
- +
- +
- +loc_31572:
- + test edx, edx
- + jl short locret_31583
- +
- +loc_31576:
- + mov ecx, 7FFFFFFFh
- + jg short loc_31581
- + cmp eax, ecx
- + jbe short locret_31583
- +
- +loc_31581:
- + mov eax, ecx
- +
- +locret_31583:
- + _emit 0xc9 ; "leave" opcode
- + retn 4
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibUnpackResource() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov eax, [ebp+8]
- + mov cl, [eax]
- + cmp cl, 3
- + jz short loc_31612
- + cmp cl, 1
- + jz short loc_31612
- + cmp cl, 6
- + jnz short loc_31628
- + mov edx, [eax+4]
- + mov ecx, [ebp+0Ch]
- + and dword ptr [ecx+4], 0
- + mov [ecx], edx
- + mov eax, [eax+8]
- + jmp short loc_31623
- +
- +loc_31612:
- + mov edx, [eax+4]
- + mov ecx, [ebp+0Ch]
- + mov [ecx], edx
- + mov edx, [eax+8]
- + mov [ecx+4], edx
- + mov eax, [eax+0Ch]
- +
- +loc_31623:
- + mov ecx, [ebp+10h]
- + mov [ecx], eax
- +
- +loc_31628:
- + xor eax, eax
- + pop ebp
- + retn 0Ch
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibPackResource() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov ecx, [ebp+8]
- + mov dl, [ecx+1]
- + mov eax, [ebp+14h]
- + mov [eax], dl
- + mov dx, [ecx+4]
- + mov [eax+2], dx
- + mov dl, [ecx+2]
- + mov [eax+1], dl
- + cmp byte ptr [ecx+1], 3
- + jz short loc_315CB
- + mov dl, [ecx+1]
- + cmp dl, 1
- + jz short loc_315CB
- + cmp dl, 6
- + jnz short loc_315DD
- + mov edx, [ebp+0Ch]
- + mov [eax+4], edx
- + mov ecx, [ecx+8]
- + mov [eax+8], ecx
- + jmp short loc_315DD
- +
- +loc_315CB:
- + mov edx, [ebp+0Ch]
- + mov [eax+4], edx
- + mov edx, [ebp+10h]
- + mov [eax+8], edx
- + mov ecx, [ecx+8]
- + mov [eax+0Ch], ecx
- +
- +loc_315DD:
- + xor eax, eax
- + pop ebp
- + retn 10h
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiMemarbFindSuitableRange() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov eax, [ebp+0Ch]
- + mov ecx, [eax+20h]
- + test byte ptr [ecx+18h], 1
- + jz short loc_35469
- + or byte ptr [eax+33h], 1
- +
- +loc_35469:
- + push eax
- + push dword ptr [ebp+8]
- + call ArbFindSuitableRange
- + pop ebp
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibGetNextAlias() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + test byte ptr [ebp+8], 4
- + jz short loc_3164A
- + mov ecx, [ebp+0Ch]
- + add ecx, 400h
- + jmp short loc_31659
- +
- +loc_3164A:
- + test byte ptr [ebp+8], 8
- + jz short loc_31677
- + mov ecx, [ebp+0Ch]
- + add ecx, 1000h
- +
- +loc_31659:
- + mov eax, [ebp+10h]
- + adc eax, 0
- + test eax, eax
- + ja short loc_31677
- + cmp ecx, 0FFFFh
- + ja short loc_31677
- + mov edx, [ebp+14h]
- + mov [edx+4], eax
- + mov [edx], ecx
- + mov al, 1
- + jmp short loc_31679
- +
- +loc_31677:
- + xor al, al
- +
- +loc_31679:
- + pop ebp
- + retn 10h
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiPortarbBacktrackAllocation() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + push ecx
- + push ecx
- + push ebx
- + push esi
- + mov esi, [ebp+0Ch]
- + mov eax, [esi]
- + mov ecx, [esi+4]
- + mov edx, [esi+24h]
- + push edi
- + mov [ebp-8], eax
- + mov [ebp-4], ecx
- + mov edi, [edx+1Ch]
- + lea edx, [ebp-8]
- + push edx
- + push ecx
- + push eax
- + push edi
- + call AcpiArblibGetNextAlias
- + mov ebx, [ebp+8]
- + jmp short loc_3597A
- +
- +loc_3593F:
- + mov eax, [esi+20h]
- + push dword ptr [eax+10h]
- + mov eax, [esi+24h]
- + mov eax, [eax+10h]
- + xor ecx, ecx
- + add eax, [ebp-8]
- + adc ecx, [ebp-4]
- + add eax, 0FFFFFFFFh
- + adc ecx, 0FFFFFFFFh
- + push ecx
- + push eax
- + push dword ptr [ebp-4]
- + push dword ptr [ebp-8]
- + push dword ptr [ebx+14h]
- + call dword ptr [RtlDeleteRange]
- + lea eax, [ebp-8]
- + push eax
- + push dword ptr [ebp-4]
- + push dword ptr [ebp-8]
- + push edi
- + call AcpiArblibGetNextAlias
- +
- +loc_3597A:
- + test al, al
- + jnz short loc_3593F
- + push esi
- + push ebx
- + call ArbBacktrackAllocation
- + pop edi
- + pop esi
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiPortarbAddAllocation() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 0Ch
- + push ebx
- + push esi
- + mov esi, [ebp+0Ch]
- + mov ecx, [esi+24h]
- + xor eax, eax
- + inc eax
- + test [ecx+1Ch], al
- + push edi
- + mov [ebp-4], eax
- + jz short loc_35AAD
- + mov dword ptr [ebp-4], 3
- +
- +loc_35AAD:
- + mov eax, [esi+20h]
- + push dword ptr [eax+10h]
- + mov ebx, [ebp+8]
- + mov edi, dword ptr [RtlAddRange]
- + push 0
- + push dword ptr [ebp-4]
- + xor eax, eax
- + mov al, [esi+32h]
- + push eax
- + push dword ptr [esi+0Ch]
- + push dword ptr [esi+8]
- + push dword ptr [esi+4]
- + push dword ptr [esi]
- + push dword ptr [ebx+14h]
- + call edi ;
- + mov eax, [esi]
- + mov ecx, [esi+4]
- + mov edx, [esi+24h]
- + mov [ebp-0Ch], eax
- + mov [ebp-8], ecx
- + mov edx, [edx+20h]
- + movzx edx, word ptr [edx+4]
- + mov [ebp+0Ch], edx
- + mov dl, [esi+32h]
- + or dl, 10h
- + mov [ebp+8], dl
- + lea edx, [ebp-0Ch]
- + push edx
- + push ecx
- + push eax
- + jmp short loc_35B39
- +
- +loc_35B00:
- + mov eax, [esi+20h]
- + push dword ptr [eax+10h]
- + mov eax, [esi+24h]
- + mov eax, [eax+10h]
- + push 0
- + push dword ptr [ebp-4]
- + xor ecx, ecx
- + add eax, [ebp-0Ch]
- + push dword ptr [ebp+8]
- + adc ecx, [ebp-8]
- + add eax, 0FFFFFFFFh
- + adc ecx, 0FFFFFFFFh
- + push ecx
- + push eax
- + push dword ptr [ebp-8]
- + push dword ptr [ebp-0Ch]
- + push dword ptr [ebx+14h]
- + call edi
- + lea eax, [ebp-0Ch]
- + push eax
- + push dword ptr [ebp-8]
- + push dword ptr [ebp-0Ch]
- +
- +loc_35B39:
- + push dword ptr [ebp+0Ch]
- + call AcpiArblibGetNextAlias
- + test al, al
- + jnz short loc_35B00
- + pop edi
- + pop esi
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibIsAliasedRangeAvailable() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 4Ch
- + push ebx
- + mov ebx, [ebp+0Ch]
- + mov eax, [ebx+20h]
- + mov ecx, [eax+14h]
- + test ecx, ecx
- + push esi
- + push edi
- + mov byte ptr [ebp-4], 0
- + jz short loc_316A9
- + cmp ecx, 2
- + jz short loc_316A9
- + test byte ptr [eax+18h], 1
- + jz short loc_316AD
- +
- +loc_316A9:
- + mov byte ptr [ebp-4], 1
- +
- +loc_316AD:
- + mov eax, [ebx+4]
- + mov edx, [ebx]
- + mov [ebp-10h], eax
- + mov eax, [ebx+24h]
- + mov ecx, [eax+20h]
- + movzx ecx, word ptr [ecx+4]
- + mov [ebp-0Ch], ecx
- + push 0Eh
- + pop ecx
- + mov esi, ebx
- + lea edi, [ebp-4Ch]
- + rep movsd
- + test byte ptr [eax+1Ch], 1
- + mov [ebp-14h], edx
- + mov dword ptr [ebp-8], 2
- + jz short loc_316E3
- + mov dword ptr [ebp-8], 3
- +
- +loc_316E3:
- + lea eax, [ebp-14h]
- + push eax
- + push dword ptr [ebp-10h]
- + push edx
- + push dword ptr [ebp-0Ch]
- + call AcpiArblibGetNextAlias
- + test al, al
- + jz loc_31787
- + mov esi, [ebp+8]
- +
- +loc_316FE:
- + mov edi, [ebp-14h]
- + lea eax, [ebp+0Fh]
- + push eax
- + push dword ptr [esi+98h]
- + mov eax, [ebx+24h]
- + push dword ptr [esi+94h]
- + mov eax, [eax+10h]
- + push dword ptr [ebp-4]
- + xor ecx, ecx
- + push dword ptr [ebp-8]
- + add eax, edi
- + adc ecx, [ebp-10h]
- + add eax, 0FFFFFFFFh
- + adc ecx, 0FFFFFFFFh
- + push ecx
- + push eax
- + push dword ptr [ebp-10h]
- + push edi
- + push dword ptr [esi+14h]
- + call dword ptr [RtlIsRangeAvailable]
- + cmp byte ptr [ebp+0Fh], 1
- + jz short loc_3176F
- + mov eax, [ebp-10h]
- + mov ecx, [ebx+24h]
- + mov [ebp-38h], eax
- + xor edx, edx
- + mov [ebp-3Ch], edi
- + mov ecx, [ecx+10h]
- + add ecx, edi
- + adc edx, eax
- + add ecx, 0FFFFFFFFh
- + lea eax, [ebp-4Ch]
- + push eax
- + adc edx, 0FFFFFFFFh
- + push esi
- + mov [ebp-34h], ecx
- + mov [ebp-30h], edx
- + call dword ptr [esi+84h]
- + test al, al
- + jz short loc_31790
- +
- +loc_3176F:
- + lea eax, [ebp-14h]
- + push eax
- + push dword ptr [ebp-10h]
- + push edi
- + push dword ptr [ebp-0Ch]
- + call AcpiArblibGetNextAlias
- + test al, al
- + jnz loc_316FE
- +
- +loc_31787:
- + mov al, 1
- +
- +loc_31789:
- + pop edi
- + pop esi
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +; ---------------------------------------------------------------------------
- +
- +loc_31790:
- + xor al, al
- + jmp short loc_31789
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiPortarbFindSuitableRange() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + push esi
- + mov esi, [ebp+0Ch]
- + mov eax, [esi+24h]
- + cmp dword ptr [eax+10h], 0
- + jnz short loc_359B6
- + mov eax, [esi]
- + mov [esi+8], eax
- + mov eax, [esi+4]
- + mov [esi+0Ch], eax
- + mov al, 1
- + jmp loc_35A7B
- +
- +loc_359B6:
- + mov ecx, [esi+20h]
- + mov edx, [ecx+14h]
- + test edx, edx
- + mov byte ptr [ebp+0Ch], 0
- + jz short loc_359CF
- + cmp edx, 2
- + jz short loc_359CF
- + test byte ptr [ecx+18h], 1
- + jz short loc_359D3
- +
- +loc_359CF:
- + mov byte ptr [ebp+0Ch], 1
- +
- +loc_359D3:
- + mov ecx, [esi+14h]
- + push ebx
- + movzx ebx, byte ptr [eax+1Ch]
- + and ebx, 1
- + cmp ecx, [esi+1Ch]
- + push edi
- + ja loc_35A77
- + jb short loc_359F6
- + mov ecx, [esi+10h]
- + cmp ecx, [esi+18h]
- + ja loc_35A77
- +
- +loc_359F6:
- + mov edi, [ebp+8]
- +
- +loc_359F9:
- + push esi
- + push dword ptr [edi+98h]
- + push dword ptr [edi+94h]
- + push dword ptr [ebp+0Ch]
- + push ebx
- + push dword ptr [eax+14h]
- + push dword ptr [eax+10h]
- + push dword ptr [esi+1Ch]
- + push dword ptr [esi+18h]
- + push dword ptr [esi+14h]
- + push dword ptr [esi+10h]
- + push dword ptr [edi+14h]
- + call dword ptr [RtlFindRange]
- + test eax, eax
- + jge short loc_35A35
- + push esi
- + push edi
- + call dword ptr [edi+84h]
- + test al, al
- + jz short loc_35A77
- +
- +loc_35A35:
- + mov eax, [esi+24h]
- + mov eax, [eax+10h]
- + xor ecx, ecx
- + add eax, [esi]
- + push esi
- + adc ecx, [esi+4]
- + add eax, 0FFFFFFFFh
- + adc ecx, 0FFFFFFFFh
- + push edi
- + mov [esi+8], eax
- + mov [esi+0Ch], ecx
- + call AcpiArblibIsAliasedRangeAvailable
- + test al, al
- + jnz short loc_35A80
- + mov eax, [esi+24h]
- + mov ecx, [eax+10h]
- + add [esi], ecx
- + adc dword ptr [esi+4], 0
- + mov ecx, [esi+14h]
- + cmp ecx, [esi+1Ch]
- + jb short loc_359F9
- + ja short loc_35A77
- + mov ecx, [esi+10h]
- + cmp ecx, [esi+18h]
- + jbe short loc_359F9
- +
- +loc_35A77:
- + xor al, al
- +
- +loc_35A79:
- + pop edi
- + pop ebx
- +
- +loc_35A7B:
- + pop esi
- + pop ebp
- + retn 8
- +; ---------------------------------------------------------------------------
- +
- +loc_35A80:
- + mov al, 1
- + jmp short loc_35A79
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiInitializeBusNumberArbiter() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov ecx, [ebp+8]
- + push 0
- + push offset asmRootName
- + lea eax, [ecx+84h]
- + push ecx
- + mov ecx, [ebp+0Ch]
- + push 6
- + mov dword ptr [eax+38h], offset AcpiArblibUnpackRequirement
- + mov dword ptr [eax+3Ch], offset AcpiArblibPackResource
- + mov dword ptr [eax+40h], offset AcpiArblibUnpackResource
- + mov dword ptr [eax+44h], offset AcpiArblibScoreRequirement
- + push dword ptr [ecx+130h]
- + push eax
- + call ArbInitializeArbiterInstance
- + pop ebp
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiInitializeMemoryArbiter() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov ecx, [ebp+8]
- + push 0
- + lea eax, [ecx+84h]
- + push offset asmRootName
- + push ecx
- + mov ecx, [ebp+0Ch]
- + push 3
- + mov dword ptr [eax+38h], offset AcpiArblibUnpackRequirement
- + mov dword ptr [eax+3Ch], offset AcpiArblibPackResource
- + mov dword ptr [eax+40h], offset AcpiArblibUnpackResource
- + mov dword ptr [eax+44h], offset AcpiArblibScoreRequirement
- + mov dword ptr [eax+78h], offset AcpiMemarbFindSuitableRange
- + push dword ptr [ecx+130h]
- + push eax
- + call ArbInitializeArbiterInstance
- + pop ebp
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiInitializePortArbiter() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov ecx, [ebp+8]
- + push 0
- + lea eax, [ecx+84h]
- + push offset asmRootName
- + push ecx
- + mov ecx, [ebp+0Ch]
- + push 1
- + mov dword ptr [eax+38h], offset AcpiArblibUnpackRequirement
- + mov dword ptr [eax+3Ch], offset AcpiArblibPackResource
- + mov dword ptr [eax+40h], offset AcpiArblibUnpackResource
- + mov dword ptr [eax+44h], offset AcpiArblibScoreRequirement
- + mov dword ptr [eax+78h], offset AcpiPortarbFindSuitableRange
- + mov dword ptr [eax+7Ch], offset AcpiPortarbAddAllocation
- + mov dword ptr [eax+80h], offset AcpiPortarbBacktrackAllocation
- + push dword ptr [ecx+130h]
- + push eax
- + call ArbInitializeArbiterInstance
- + pop ebp
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibAllocateArbiterInstance() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + push ecx
- + push ecx
- + push ebx
- + mov ebx, [ebp+0Ch]
- + cmp ebx, 1
- + jz short loc_31831
- + cmp ebx, 3
- + jz short loc_31831
- + cmp ebx, 6
- + jz short loc_31831
- + xor eax, eax
- + jmp loc_319FB
- +
- +loc_31831:
- + push esi
- + push 69706341h
- + push 120h
- + push 101h
- + call dword ptr [ExAllocatePoolWithTag]
- + mov esi, eax
- + xor eax, eax
- + test esi, esi
- + mov [ebp-8], esi
- + jz loc_319FA
- + push edi
- + push 48h
- + pop ecx
- + mov edi, esi
- + rep stosd
- + mov ecx, offset AcpiArbiterInstanceCount
- + call dword ptr [InterlockedIncrement]
- + cmp ebx, 1
- + jnz short loc_31875
- + mov eax, offset asmPortName
- + jmp short loc_31884
- +
- +loc_31875:
- + cmp ebx, 3
- + mov eax, offset asmMemoryName
- + jz short loc_31884
- + mov eax, offset asmBusNumberName
- +
- +loc_31884:
- + mov ebx, dword ptr [_snwprintf]
- + push eax
- + push offset asmACPIName
- + push 40h
- + push esi
- + call ebx
- + add esp, 10h
- + test eax, eax
- + jge short loc_318AC
- + push 0
- + push esi
- + call dword ptr [ExFreePoolWithTag]
- + xor eax, eax
- + jmp loc_319F9
- +
- +loc_318AC:
- + push 40h
- + pop ecx
- + sub ecx, eax
- + lea edi, [esi+eax*2]
- + mov eax, [ebp+8]
- + mov esi, [eax+12Ch]
- + test esi, esi
- + mov [ebp+0Ch], ecx
- + jz loc_319DB
- + cmp dword ptr [esi+8], 0
- + jz loc_319DB
- + cmp ecx, 5
- + jb loc_319DB
- + mov al, [esi+13h]
- + test al, al
- + jnz short loc_318E7
- + push 2Ah
- + pop edx
- + jmp short loc_318EA
- +
- +loc_318E7:
- + movsx edx, al
- +
- +loc_318EA:
- + mov al, [esi+12h]
- + test al, al
- + jnz short loc_318FA
- + mov dword ptr [ebp+8], 2Ah
- + jmp short loc_31900
- +
- +loc_318FA:
- + movsx eax, al
- + mov [ebp+8], eax
- +
- +loc_31900:
- + mov al, [esi+11h]
- + test al, al
- + jnz short loc_3190C
- + push 2Ah
- + pop ecx
- + jmp short loc_3190F
- +
- +loc_3190C:
- + movsx ecx, al
- +
- +loc_3190F:
- + mov al, [esi+10h]
- + test al, al
- + jnz short loc_3191B
- + push 2Ah
- + pop eax
- + jmp short loc_3191E
- +
- +loc_3191B:
- + movsx eax, al
- +
- +loc_3191E:
- + push edx
- + push dword ptr [ebp+8]
- + push ecx
- + push eax
- + push offset asmFormat2Name
- + push 4
- + push edi
- + call ebx
- + add esp, 1Ch
- + push 4
- + pop eax
- + sub [ebp+0Ch], eax
- + mov [ebp+8], eax
- + jmp loc_319C1
- +
- +loc_3193F:
- + cmp dword ptr [ebp+0Ch], 6
- + jb loc_319D8
- + mov eax, [ebp+8]
- + add eax, eax
- + push eax
- + lea eax, [edi+0Ah]
- + push edi
- + push eax
- + call dword ptr [memmove]
- + add dword ptr [ebp+8], 5
- + sub dword ptr [ebp+0Ch], 5
- + mov word ptr [edi+8], 2Eh
- + mov al, [esi+13h]
- + add esp, 0Ch
- + test al, al
- + jnz short loc_31977
- + push 2Ah
- + pop edx
- + jmp short loc_3197A
- +
- +loc_31977:
- + movsx edx, al
- +
- +loc_3197A:
- + mov al, [esi+12h]
- + test al, al
- + jnz short loc_3198A
- + mov dword ptr [ebp-4], 2Ah
- + jmp short loc_31990
- +
- +loc_3198A:
- + movsx eax, al
- + mov [ebp-4], eax
- +
- +loc_31990:
- + mov al, [esi+11h]
- + test al, al
- + jnz short loc_3199C
- + push 2Ah
- + pop ecx
- + jmp short loc_3199F
- +
- +loc_3199C:
- + movsx ecx, al
- +
- +loc_3199F:
- + mov al, [esi+10h]
- + test al, al
- + jnz short loc_319AB
- + push 2Ah
- + pop eax
- + jmp short loc_319AE
- +
- +loc_319AB:
- + movsx eax, al
- +
- +loc_319AE:
- + push edx
- + push dword ptr [ebp-4]
- + push ecx
- + push eax
- + push offset asmFormat2Name
- + push 4
- + push edi
- + call ebx
- + add esp, 1Ch
- +
- +loc_319C1:
- + mov esi, [esi+8]
- + cmp dword ptr [esi+8], 0
- + jnz loc_3193F
- + mov eax, [ebp+8]
- + and word ptr [edi+eax*2], 0
- + jmp short loc_319F6
- +
- +loc_319D8:
- + mov ecx, [ebp+0Ch]
- +
- +loc_319DB:
- + push AcpiArbiterInstanceCount
- + push offset asmFormat3Name
- + push ecx
- + push edi
- + call ebx
- + mov eax, [ebp+0Ch]
- + add esp, 10h
- + and word ptr [edi+eax*2-2], 0
- +
- +loc_319F6:
- + mov eax, [ebp-8]
- +
- +loc_319F9:
- + pop edi
- +
- +loc_319FA:
- + pop esi
- +
- +loc_319FB:
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +AcpiArblibInitializeArbiter() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + push edi
- + mov edi, [ebp+0Ch]
- + cmp edi, 1
- + jz short loc_31A57
- + cmp edi, 3
- + jz short loc_31A57
- + cmp edi, 6
- + jz short loc_31A57
- + mov eax, 0C000000Dh
- + jmp short loc_31AAF
- +
- +loc_31A57:
- + push ebx
- + mov ebx, [ebp+8]
- + push esi
- + push edi
- + push ebx
- + call AcpiArblibAllocateArbiterInstance
- + mov esi, eax
- + test esi, esi
- + jnz short loc_31A70
- + mov eax, 0C000009Ah
- + jmp short loc_31AAD
- +
- +loc_31A70:
- + cmp edi, 1
- + push ebx
- + push esi
- + jnz short loc_31A7E
- + call AcpiInitializePortArbiter
- + jmp short loc_31A8F
- +
- +
- +loc_31A7E:
- + cmp edi, 3
- + jnz short loc_31A8A
- + call AcpiInitializeMemoryArbiter
- + jmp short loc_31A8F
- +
- +loc_31A8A:
- + call AcpiInitializeBusNumberArbiter
- +
- +loc_31A8F:
- + mov edi, eax
- + test edi, edi
- + jge short loc_31A9F
- + push esi
- + call AcpiArblibFreeArbiterInstance
- + mov eax, edi
- + jmp short loc_31AAD
- +
- +loc_31A9F:
- + mov eax, [ebp+10h]
- + mov byte ptr [esi+80h], 1
- + mov [eax], esi
- + xor eax, eax
- +
- +loc_31AAD:
- + pop esi
- + pop ebx
- +
- +loc_31AAF:
- + pop edi
- + pop ebp
- + retn 0Ch
- +}
- +}
- +
- +
- +
- +#endif // _X86_
- diff --strip-trailing-cr -ur ./driver/nt/arblib.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/arblib.h"
- --- ./driver/nt/arblib.h 2022-12-15 06:55:50.332031200 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/arblib.h" 2022-04-06 22:57:00.252929600 +0500
- @@ -0,0 +1,27 @@
- +#ifndef _ARBLIB_H_
- +#define _ARBLIB_H_
- +
- +extern UINT_PTR __security_cookie;
- +extern void __fastcall __security_check_cookie(UINT_PTR cookie);
- +
- +typedef struct { // Size=0x0
- + CHAR UnknowData[0x82];
- + BOOLEAN SomeField; // x32&x64 have same 0x82 offset
- +} ACPI_ARBITER_INSTANCE;
- +
- +VOID
- +AcpiArblibFreeArbiterInstance (ACPI_ARBITER_INSTANCE *CommonInstance);
- +
- +VOID
- +AcpiArblibEjectInterface(VOID);
- +
- +VOID
- +AcpiArblibInitializeArbiter(VOID);
- +
- +NTSTATUS
- +AcpiArblibCommitResources (ACPI_ARBITER_INSTANCE *CommonInstance, PVOID IrpStuff);
- +
- +void
- +ACPIConvertStringDelimitation(char *psIn, char Char);
- +
- +#endif
- diff --strip-trailing-cr -ur ./driver/nt/buildsrc.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/buildsrc.c"
- --- ./driver/nt/buildsrc.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/buildsrc.c" 2022-04-06 23:47:17.153320300 +0500
- @@ -733,7 +733,7 @@
- //
- KeAcquireSpinLockAtDpcLevel( &AcpiBuildQueueLock );
- - } while ( AcpiBuildWorkDone );
- + } while ( AcpiBuildWorkDone || !IsListEmpty( &AcpiBuildQueueList ));
- //
- // The DPC is no longer running
- @@ -1419,6 +1419,12 @@
- }
- + if (targetDeviceObject->Flags & DO_BUFFERED_IO) {
- +
- + newDeviceObject->Flags |= DO_BUFFERED_IO;
- +
- + }
- +
- //
- // Done with the device lock
- //
- @@ -2025,7 +2031,7 @@
- }
- NTSTATUS
- -ACPIBuildPdo(
- +ACPIBuildPdo_rtm(
- IN PDRIVER_OBJECT DriverObject,
- IN PDEVICE_EXTENSION DeviceExtension,
- IN PDEVICE_OBJECT ParentPdoObject,
- @@ -2240,6 +2246,248 @@
- return STATUS_SUCCESS;
- }
- +ULONG AcpiArbiterResourceTypes[3] = {3,1,6};
- +
- +#ifdef_X86_
- +
- +NTSTATUS __declspec(naked)
- +ACPIBuildPdo(
- + IN PDRIVER_OBJECT DriverObject,
- + IN PDEVICE_EXTENSION DeviceExtension,
- + IN PDEVICE_OBJECT ParentPdoObject,
- + IN BOOLEAN CreateAsFilter
- + ) {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 0Ch
- + push ebx
- + xor ebx, ebx
- + lea eax, [ebp-4]
- + push eax
- + push ebx
- + push 80h
- + push 32h
- + push ebx
- + push ebx
- + push dword ptr [ebp+8]
- + mov [ebp-8], ebx
- + mov [ebp-4], ebx
- + call dword ptr [IoCreateDevice]
- + cmp eax, ebx
- + jl loc_11973
- + cmp [ebp+14h], bl
- + push esi
- + mov esi, [ebp+0Ch]
- + push edi
- + jz short loc_11794
- + mov eax, [esi]
- + and eax, 100000h
- + or eax, ebx
- + jnz short loc_11791
- + push dword ptr [ebp+10h]
- + call dword ptr [IoGetAttachedDeviceReference]
- + cmp eax, ebx
- + mov [ebp-8], eax
- + jnz short loc_11794
- + mov esi, 0C000000Eh
- + jmp loc_118C9
- +
- +loc_11791:
- + mov [ebp+14h], bl
- +
- +loc_11794:
- + mov ecx, [esi+4]
- + and ecx, 20h
- + xor eax, eax
- + or eax, ecx
- + jz short loc_117BC
- + mov eax, [esi+12Ch]
- + push 5352435Fh
- + push eax
- + call ACPIAmliGetNamedChild
- + test eax, eax
- + jnz loc_1187F
- + mov [esi+64h], bl
- +
- +loc_117BC:
- + mov ecx, offset AcpiDeviceTreeLock
- + call dword ptr [KfAcquireSpinLock]
- + mov [ebp+0Bh], al
- + mov eax, [ebp-4]
- + mov [eax+28h], esi
- + mov eax, [ebp-4]
- + lea ecx, [esi+120h]
- + mov [esi+130h], eax
- + mov [esi+138h], eax
- + call dword ptr [InterlockedIncrement]
- + push 1
- + push ebx
- + push 1FFh
- + push esi
- + call ACPIInternalUpdateFlags
- + push ebx
- + push ebx
- + push 20h
- + push esi
- + call ACPIInternalUpdateFlags
- + cmp [ebp+14h], bl
- + lea eax, [esi+88h]
- + mov ecx, [eax]
- + mov [esi+8Ch], ecx
- + mov [eax], ebx
- + mov dword ptr [esi+10h], offset AcpiPdoIrpDispatch
- + mov edi, 2000h
- + jz short loc_11860
- + mov eax, [ebp-8]
- + push ebx
- + push ebx
- + push 40h
- + push esi
- + mov [esi+134h], eax
- + call ACPIInternalUpdateFlags
- + mov eax, [ebp-8]
- + mov edx, [ebp-4]
- + mov dword ptr [esi+10h], offset AcpiBusFilterIrpDispatch
- + mov cl, [eax+30h]
- + inc cl
- + mov [edx+30h], cl
- + mov ecx, [eax+5Ch]
- + mov edx, [ebp-4]
- + mov [edx+5Ch], ecx
- + test [eax+1Ch], edi
- + jz short loc_11860
- + mov eax, [ebp-4]
- + or [eax+1Ch], edi
- +
- +loc_11860:
- + mov eax, [esi]
- + mov ecx, [esi+4]
- + mov [ebp-0Ch], eax
- + mov edx, ecx
- + and edx, 10h
- + xor eax, eax
- + or eax, edx
- + jz short loc_118D9
- + mov dword ptr [esi+10h], offset AcpiProcessorIrpDispatch
- + jmp loc_11922
- +
- +loc_1187F:
- + lea eax, [esi+68h]
- + mov byte ptr [esi+64h], 1
- + xor edi, edi
- + mov [ebp+8], eax
- +
- +loc_1188B:
- + push dword ptr [ebp+8]
- + push AcpiArbiterResourceTypes[edi*4]
- + push esi
- + call AcpiArblibInitializeArbiter
- + cmp eax, ebx
- + mov [ebp+0Ch], eax
- + jl short loc_118B1
- + add dword ptr [ebp+8], 4
- + inc edi
- + cmp edi, 3
- + jb short loc_1188B
- + jmp loc_117BC
- +
- +loc_118B1:
- + cmp edi, ebx
- + jz short loc_118C6
- + lea esi, [esi+edi*4+68h]
- +
- +loc_118B9:
- + sub esi, 4
- + push dword ptr [esi]
- + call AcpiArblibFreeArbiterInstance
- + dec edi
- + jnz short loc_118B9
- +
- +loc_118C6:
- + mov esi, [ebp+0Ch]
- +
- +loc_118C9:
- + push dword ptr [ebp-4]
- + call dword ptr [IoDeleteDevice]
- + mov eax, esi
- + jmp loc_11971
- +
- +loc_118D9:
- + and ecx, edi
- + xor eax, eax
- + or eax, ecx
- + jz short loc_11922
- + cmp dword ptr [AcpiInternalDeviceTable], ebx
- + mov [ebp+14h], ebx
- + jz short loc_11922
- + mov edi, offset AcpiInternalDeviceTable
- + mov eax, edi
- +
- +loc_118F3:
- + push dword ptr [eax]
- + push dword ptr [esi+10Ch]
- + call dword ptr [strstr]
- + test eax, eax
- + pop ecx
- + pop ecx
- + jnz short loc_11915
- + inc dword ptr [ebp+14h]
- + add edi, 8
- + cmp [edi], ebx
- + mov eax, edi
- + jnz short loc_118F3
- + jmp short loc_11922
- +
- +loc_11915:
- + mov eax, [ebp+14h]
- + mov eax, dword ptr (AcpiInternalDeviceTable+4)[eax*8]
- + mov [esi+10h], eax
- +
- +loc_11922:
- + mov eax, [esi]
- + mov ecx, [esi+4]
- + and eax, 40000h
- + or eax, ebx
- + jz short loc_11944
- + and ecx, 80000h
- + xor eax, eax
- + or eax, ecx
- + jz short loc_11944
- + mov eax, [ebp-4]
- + mov FixedButtonDeviceObject, eax
- +
- +loc_11944:
- + mov dl, [ebp+0Bh]
- + mov ecx, offset AcpiDeviceTreeLock
- + call dword ptr [KfReleaseSpinLock]
- + mov eax, [ebp-4]
- + and byte ptr [eax+1Ch], 7Fh
- + mov esi, [esi+4]
- + and esi, 100000h
- + xor eax, eax
- + or eax, esi
- + jz short loc_1196F
- + mov eax, [ebp-4]
- + or dword ptr [eax+1Ch], 8
- +
- +loc_1196F:
- + xor eax, eax
- +
- +loc_11971:
- + pop edi
- + pop esi
- +
- +loc_11973:
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 10h
- +}
- +}
- +
- +#endif // _X86_
- +
- +
- NTSTATUS
- ACPIBuildPowerResourceExtension(
- IN PNSOBJ PowerResource,
- @@ -3022,54 +3270,55 @@
- PUCHAR tempPtr = BuildRequest->String;
- ULONG i;
- + ACPIConvertStringDelimitation(tempPtr, ' ');
- +
- //
- // Walk the CID, trying to find the double NULL
- //
- - for ( ;tempPtr != NULL && *tempPtr != '\0'; ) {
- + //for ( ;tempPtr != NULL && *tempPtr != '\0'; ) {
- - tempPtr += strlen(tempPtr);
- - if (*(tempPtr+1) == '\0') {
- + // tempPtr += strlen(tempPtr);
- + // if (*(tempPtr+1) == '\0') {
- - //
- - // Found the double null, so we can break
- - //
- - break;
- + // //
- + // // Found the double null, so we can break
- + // //
- + // break;
- - }
- + // }
- + // //
- + // // Set the character to be a 'space'
- + // //
- + // *tempPtr = ' ';
- +
- + //}
- + //tempPtr = BuildRequest->String;
- +
- + if (tempPtr != NULL) {
- //
- - // Set the character to be a 'space'
- + // Set any special flags associated with this device id
- //
- - *tempPtr = ' ';
- + for (i = 0; AcpiInternalDeviceFlagTable[i].PnPId != NULL; i++) {
- - }
- - tempPtr = BuildRequest->String;
- -
- - //
- - // Set any special flags associated with this device id
- - //
- - for (i = 0; AcpiInternalDeviceFlagTable[i].PnPId != NULL; i++) {
- + if (strstr( tempPtr, AcpiInternalDeviceFlagTable[i].PnPId ) ) {
- - if (strstr( tempPtr, AcpiInternalDeviceFlagTable[i].PnPId ) ) {
- + ACPIInternalUpdateFlags(
- + &(deviceExtension->Flags),
- + AcpiInternalDeviceFlagTable[i].Flags,
- + FALSE
- + );
- + break;
- - ACPIInternalUpdateFlags(
- - &(deviceExtension->Flags),
- - AcpiInternalDeviceFlagTable[i].Flags,
- - FALSE
- - );
- - break;
- + }
- }
- - }
- -
- - //
- - // Done with the string
- - //
- - if (tempPtr != NULL) {
- + //
- + // Done with the string
- + //
- ExFreePool( tempPtr );
- -
- }
- //
- @@ -4056,13 +4305,13 @@
- //
- // First, store the pin that we use as the wakeup signal
- //
- - deviceExtension->PowerInfo.WakeBit = (ULONG)pinObject->uipDataValue;
- + deviceExtension->PowerInfo.WakeBit = (ULONG)pinObject->dwDataValue;
- //
- // Next, store the system state that we can wake up from
- //
- deviceExtension->PowerInfo.SystemWakeLevel = ACPIDeviceMapSystemState(
- - stateObject->uipDataValue
- + stateObject->dwDataValue
- );
- //
- @@ -4080,8 +4329,8 @@
- //
- // Calculate the correct register and mask
- //
- - gpeRegister = ( (UCHAR) (pinObject->uipDataValue) / 8);
- - gpeMask = 1 << ( (UCHAR) (pinObject->uipDataValue) % 8);
- + gpeRegister = ( (UCHAR) (pinObject->dwDataValue) / 8);
- + gpeMask = 1 << ( (UCHAR) (pinObject->dwDataValue) % 8);
- //
- // We need access to the table lock for this
- @@ -4159,7 +4408,7 @@
- //
- RtlZeroMemory( &argData, sizeof(OBJDATA) );
- argData.dwDataType = OBJTYPE_INTDATA;
- - argData.uipDataValue = 0;
- + argData.dwDataValue = 0;
- //
- // Run the method. Note that we don't specify a callback because we
- @@ -4409,7 +4658,7 @@
- //
- // Turn the power state into something that we can understand
- //
- - i = ACPIDeviceMapPowerState( result->uipDataValue );
- + i = ACPIDeviceMapPowerState( result->dwDataValue );
- //
- // No longer need the buffer
- @@ -5461,7 +5710,7 @@
- ACPIInternalUpdateFlags(
- &(powerNode->Flags),
- DEVICE_NODE_PRESENT,
- - (BOOLEAN) ((result->uipDataValue & STA_STATUS_PRESENT) ? FALSE : TRUE)
- + (BOOLEAN) ((result->dwDataValue & STA_STATUS_PRESENT) ? FALSE : TRUE)
- );
- //
- @@ -5956,7 +6205,7 @@
- // Setup the arguments that we will pass to the method
- //
- RtlZeroMemory( objData, sizeof(OBJDATA) );
- - objData[0].uipDataValue = DATAVALUE_ONE;
- + objData[0].dwDataValue = DATAVALUE_ONE;
- objData[0].dwDataType = OBJTYPE_INTDATA;
- //
- @@ -5980,16 +6229,16 @@
- // pass in a REGSPACE_PCIFCFG registration
- //
- RtlZeroMemory( objData, sizeof(objData) );
- - objData[0].uipDataValue = REGSPACE_PCICFG;
- + objData[0].dwDataValue = REGSPACE_PCICFG;
- objData[0].dwDataType = OBJTYPE_INTDATA;
- objData[1].dwDataType = OBJTYPE_INTDATA;
- if (BuildRequest->RunRequest.Flags & RUN_REQUEST_REG_METHOD_ON) {
- - objData[1].uipDataValue = 1;
- + objData[1].dwDataValue = 1;
- } else {
- - objData[1].uipDataValue = 0;
- + objData[1].dwDataValue = 0;
- }
- diff --strip-trailing-cr -ur ./driver/nt/bus.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/bus.c"
- --- ./driver/nt/bus.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/bus.c" 2022-04-04 21:17:08.000000000 +0500
- @@ -1675,7 +1675,7 @@
- }
- NTSTATUS
- -ACPIBusIrpQueryInterface(
- +ACPIBusIrpQueryInterface_rtm(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp
- )
- @@ -1904,7 +1904,238 @@
- return status;
- }
- +
- +#ifdef_X86_
- +
- +NTSTATUS __declspec(naked)
- +ACPIBusIrpQueryInterface(
- + IN PDEVICE_OBJECT DeviceObject,
- + IN PIRP Irp
- + ) {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 0Ch
- + mov eax, [ebp+0Ch]
- + push ebx
- + mov ebx, [eax+60h]
- + push esi
- + push edi
- + push dword ptr [ebp+8]
- + call ACPIInternalGetDeviceExtension
- + mov edi, [ebx+4]
- + mov [ebp-8], eax
- + mov eax, [ebx+10h]
- + mov [ebp-4], eax
- + mov eax, offset GUID_ACPI_INTERFACE_STANDARD
- + cmp edi, eax
- + jz short loc_32A77
- + mov esi, dword ptr[RtlCompareMemory]
- + push 10h
- + push eax
- + push edi
- + call esi
- + sub eax, 10h
- + neg eax
- + sbb eax, eax
- + inc eax
- + mov [ebp-0Ch], eax
- + jz short loc_32AB5
- +
- +loc_32A77:
- + mov ax, [ebx+8]
- + cmp ax, 2Ch
- + jbe short loc_32A86
- + push 2Ch
- + pop eax
- + jmp short loc_32A89
- +
- +loc_32A86:
- + movzx eax, ax
- +
- +loc_32A89:
- + mov ebx, [ebx+0Ch]
- + mov ecx, eax
- + mov edx, ecx
- + shr ecx, 2
- + mov esi, offset ACPIInterfaceTable
- + mov edi, ebx
- + rep movsd
- + mov ecx, edx
- + and ecx, 3
- + cmp eax, 8
- + rep movsb
- + jbe short loc_32AAE
- + mov eax, [ebp+8]
- + mov [ebx+4], eax
- +
- +loc_32AAE:
- + xor esi, esi
- + jmp loc_32C17
- +
- +loc_32AB5:
- + mov eax, offset GUID_TRANSLATOR_INTERFACE_STANDARD
- + cmp edi, eax
- + jz short loc_32AD1
- + push 10h
- + push eax
- + push edi
- + call esi
- + sub eax, 10h
- + neg eax
- + sbb eax, eax
- + inc eax
- + mov [ebp-0Ch], eax
- + jz short loc_32B2F
- +
- +loc_32AD1:
- + cmp dword ptr [ebp-4], 2
- + jnz short loc_32B05
- + push dword ptr [ebp+8]
- + call IsPciBus
- + test al, al
- + jz short loc_32AEB
- + push dword ptr [ebp+0Ch]
- + call SmashInterfaceQuery
- +
- +loc_32AEB:
- + mov eax, [ebp+0Ch]
- + mov esi, [eax+18h]
- +
- +loc_32AF1:
- + mov ecx, [ebp+0Ch]
- + xor dl, dl
- + call dword ptr[IofCompleteRequest]
- + pop edi
- + mov eax, esi
- + pop esi
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +; ---------------------------------------------------------------------------
- +
- +loc_32B05:
- + cmp dword ptr [ebp-4], 1
- + jz short loc_32B11
- + cmp dword ptr [ebp-4], 3
- + jnz short loc_32AEB
- +
- +loc_32B11:
- + push dword ptr [ebp+8]
- + call IsPciBus
- + test al, al
- + jz short loc_32AEB
- + push dword ptr [ebp+0Ch]
- + push dword ptr [ebp+8]
- + call TranslateEjectInterface
- +
- +loc_32B28:
- + mov esi, eax
- + jmp loc_32C0B
- +
- +loc_32B2F:
- + mov eax, offset GUID_PCI_BUS_INTERFACE_STANDARD
- + cmp edi, eax
- + jz short loc_32B4B
- + push 10h
- + push eax
- + push edi
- + call esi
- + sub eax, 10h
- + neg eax
- + sbb eax, eax
- + inc eax
- + mov [ebp-0Ch], eax
- + jz short loc_32B64
- +
- +loc_32B4B:
- + push dword ptr [ebp+8]
- + call IsPciBus
- + test al, al
- + jz short loc_32AEB
- + push dword ptr [ebp+0Ch]
- + push dword ptr [ebp+8]
- + call PciBusEjectInterface
- + jmp short loc_32B28
- +
- +loc_32B64:
- + mov eax, offset GUID_BUS_INTERFACE_STANDARD
- + cmp edi, eax
- + jz short loc_32B80
- + push 10h
- + push eax
- + push edi
- + call esi
- + sub eax, 10h
- + neg eax
- + sbb eax, eax
- + inc eax
- + mov [ebp-0Ch], eax
- + jz short loc_32BBD
- +
- +loc_32B80:
- + mov eax, [ebp+0Ch]
- + mov dword ptr [eax+18h], 0C00002B9h
- + mov eax, [ebp-8]
- + mov eax, [eax+13Ch]
- + test eax, eax
- + jz loc_32AEB
- + mov eax, [eax+130h]
- + test eax, eax
- + jz loc_32AEB
- + push 0
- + push ebx
- + push eax
- + call ACPIInternalSendSynchronousIrp
- + mov ecx, [ebp+0Ch]
- + mov [ecx+18h], eax
- + jmp loc_32AEB
- +
- +loc_32BBD:
- + mov eax, offset GUID_ARBITER_INTERFACE_STANDARD
- + cmp edi, eax
- + jz short loc_32BDD
- + push 10h
- + push eax
- + push edi
- + call esi
- + sub eax, 10h
- + neg eax
- + sbb eax, eax
- + inc eax
- + mov [ebp-0Ch], eax
- + jz loc_32AEB
- +
- +loc_32BDD:
- + mov edx, [ebp-8]
- + mov ecx, [edx+4]
- + and ecx, 20h
- + xor eax, eax
- + or eax, ecx
- + jz loc_32AEB
- + cmp byte ptr [edx+64h], 0
- + jz loc_32AEB
- + mov edi, [ebp+0Ch]
- + push edi
- + push dword ptr [ebp+8]
- + call AcpiArblibEjectInterface
- + mov esi, eax
- + mov [edi+18h], esi
- +
- +loc_32C0B:
- + cmp esi, 0C00000BBh
- + jz loc_32AEB
- +
- +loc_32C17:
- + mov eax, [ebp+0Ch]
- + mov [eax+18h], esi
- + jmp loc_32AF1
- +}
- +}
- +
- +#endif
- +
- NTSTATUS
- ACPIBusIrpQueryPnpDeviceState(
- IN PDEVICE_OBJECT DeviceObject,
- @@ -2206,28 +2437,27 @@
- // Container objects do not claim resources. So, don't even bother
- // trying to obtain a _CRS
- //
- - if (!(deviceExtension->Flags & DEV_CAP_CONTAINER)) {
- -
- - //
- - // Here we try to find the current resource set
- - //
- - status = ACPIGetBufferSync(
- - deviceExtension,
- - PACKED_CRS,
- - &crsBuf,
- - &crsBufSize
- - );
- + //if (!(deviceExtension->Flags & DEV_CAP_CONTAINER)) {
- - } else {
- + //
- + // Here we try to find the current resource set
- + //
- + status = ACPIGetBufferSync(
- + deviceExtension,
- + PACKED_CRS,
- + &crsBuf,
- + &crsBufSize
- + );
- - //
- - // This is the status code returned if there is no _CRS. It actually
- - // doesn't matter what code we use since in the failure case, we
- - // should return whatever code was already present in the IRP
- - //
- - status = STATUS_OBJECT_NAME_NOT_FOUND;
- + //} else {
- + // //
- + // // This is the status code returned if there is no _CRS. It actually
- + // // doesn't matter what code we use since in the failure case, we
- + // // should return whatever code was already present in the IRP
- + // //
- + // status = STATUS_OBJECT_NAME_NOT_FOUND;
- + //}
- - }
- if (!NT_SUCCESS(status)) {
- //
- @@ -2249,7 +2479,8 @@
- //
- // Build a IO_RESOURCE_REQUIREMENT_LISTS
- //
- - status = PnpBiosResourcesToNtResources(
- + status = PnpDeviceBiosResourcesToNtResources(
- + deviceExtension,
- crsBuf,
- (deviceExtension->Flags & DEV_CAP_PCI ?
- PNP_BIOS_TO_IO_NO_CONSUMED_RESOURCES : 0),
- @@ -2460,33 +2691,33 @@
- // claim resources. Rather, they are used to specify a resource
- // translation
- //
- - if (!(deviceExtension->Flags & DEV_CAP_CONTAINER)) {
- + //if (!(deviceExtension->Flags & DEV_CAP_CONTAINER)) {
- - //
- - // Fetch the buffers, as appropriate
- - //
- - crsStat = ACPIGetBufferSync(
- - deviceExtension,
- - PACKED_CRS,
- - &crsBuf,
- - &crsBufSize
- - );
- - prsStat = ACPIGetBufferSync(
- - deviceExtension,
- - PACKED_PRS,
- - &prsBuf,
- - &prsBufSize
- - );
- + //
- + // Fetch the buffers, as appropriate
- + //
- + crsStat = ACPIGetBufferSync(
- + deviceExtension,
- + PACKED_CRS,
- + &crsBuf,
- + &crsBufSize
- + );
- + prsStat = ACPIGetBufferSync(
- + deviceExtension,
- + PACKED_PRS,
- + &prsBuf,
- + &prsBufSize
- + );
- - } else {
- + //} else {
- - //
- - // Pretend that there is no _CRS/_PRS present
- - //
- - crsStat = STATUS_OBJECT_NAME_NOT_FOUND;
- - prsStat = STATUS_OBJECT_NAME_NOT_FOUND;
- + // //
- + // // Pretend that there is no _CRS/_PRS present
- + // //
- + // crsStat = STATUS_OBJECT_NAME_NOT_FOUND;
- + // prsStat = STATUS_OBJECT_NAME_NOT_FOUND;
- - }
- + //}
- //
- // If there is a _CRS, then remember to clear the irp-generated status
- @@ -2524,7 +2755,8 @@
- // Our first step is to try to use these resources to build the
- // information...
- //
- - status = PnpBiosResourcesToNtResources(
- + status = PnpDeviceBiosResourcesToNtResources(
- + deviceExtension,
- prsBuf,
- 0,
- &resList
- @@ -2560,7 +2792,8 @@
- //
- if (!NT_SUCCESS(status) && NT_SUCCESS(crsStat) ) {
- - status = PnpBiosResourcesToNtResources(
- + status = PnpDeviceBiosResourcesToNtResources(
- + deviceExtension,
- crsBuf,
- (deviceExtension->Flags & DEV_CAP_PCI ?
- PNP_BIOS_TO_IO_NO_CONSUMED_RESOURCES : 0),
- @@ -3374,6 +3607,9 @@
- PDEVICE_EXTENSION deviceExtension;
- PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation( Irp );
- UCHAR minorFunction = irpStack->MinorFunction;
- + ACPI_ARBITER_INSTANCE **arbiter;
- + ULONG i;
- + PDEVICE_CAPABILITIES capabilities;
- PAGED_CODE();
- @@ -3411,6 +3647,20 @@
- }
- + if (deviceExtension->Flags & DEV_CAP_CONTAINER &&
- + deviceExtension->Module.ArbitersNeeded) {
- + capabilities = irpStack->Parameters.DeviceCapabilities.Capabilities; // unknow union, set to random
- + arbiter = deviceExtension->Module.Arbiters;
- + for (i = 0; i < 3; i++) {
- + status = AcpiArblibCommitResources(*arbiter, (PVOID) capabilities);
- + if (!NT_SUCCESS(status))
- + return status;
- +
- + (*arbiter)->SomeField = TRUE;
- + arbiter++;
- + }
- + }
- +
- //
- // Pass the real work off to this function
- //
- @@ -3421,6 +3671,7 @@
- Irp,
- Irp
- );
- +
- if (NT_SUCCESS(status)) {
- return STATUS_PENDING;
- diff --strip-trailing-cr -ur ./driver/nt/dat.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/dat.c"
- --- ./driver/nt/dat.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/dat.c" 2022-04-16 11:16:57.427734300 +0500
- @@ -657,7 +657,7 @@
- // Any device in this table is considered to be 'special'
- //
- INTERNAL_DEVICE_TABLE AcpiInternalDeviceTable[] = {
- - "ACPI0006", &AcpiGenericBusIrpDispatch,
- + "ACPI0004", &AcpiGenericBusIrpDispatch,
- "FixedButton", &AcpiFixedButtonIrpDispatch,
- "PNP0000", &AcpiRawDeviceIrpDispatch,
- "PNP0001", &AcpiRawDeviceIrpDispatch,
- @@ -703,7 +703,7 @@
- INTERNAL_DEVICE_FLAG_TABLE AcpiInternalDeviceFlagTable[] = {
- "CPQB01D", DEV_CAP_START_IN_D3,
- "IBM3760", DEV_CAP_START_IN_D3,
- - "ACPI0006", DEV_MASK_INTERNAL_BUS | DEV_CAP_CONTAINER,
- + "ACPI0004", DEV_MASK_INTERNAL_BUS | DEV_CAP_CONTAINER,
- "PNP0000", DEV_CAP_PIC_DEVICE | DEV_MASK_INTERNAL_DEVICE,
- "PNP0001", DEV_CAP_PIC_DEVICE | DEV_MASK_INTERNAL_DEVICE,
- "PNP0002", DEV_MASK_INTERNAL_DEVICE,
- diff --strip-trailing-cr -ur ./driver/nt/debug.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/debug.c"
- --- ./driver/nt/debug.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/debug.c" 2022-04-03 20:19:40.000000000 +0500
- @@ -81,6 +81,16 @@
- KeBugCheckEx (ACPI_DRIVER_INTERNAL, 0x1, Bugcode, 0, 0);
- }
- +VOID
- +_ACPIInternalErrorEx(
- + IN ULONG Bugcode0,
- + IN ULONG_PTR Bugcode1,
- + IN ULONG_PTR Bugcode2
- + )
- +{
- + KeBugCheckEx (ACPI_DRIVER_INTERNAL, 0x2, Bugcode0, Bugcode1, Bugcode2);
- +}
- +
- #if DBG
- VOID
- ACPIDebugPrint(
- diff --strip-trailing-cr -ur ./driver/nt/debug.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/debug.h"
- --- ./driver/nt/debug.h 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/debug.h" 2022-04-03 20:18:58.000000000 +0500
- @@ -53,6 +53,13 @@
- IN ULONG Bugcode
- );
- + VOID
- + _ACPIInternalErrorEx(
- + IN ULONG Bugcode0,
- + IN ULONG_PTR Bugcode1,
- + IN ULONG_PTR Bugcode2
- + );
- +
- #if DBG
- VOID
- ACPIDebugResourceDescriptor(
- diff --strip-trailing-cr -ur ./driver/nt/detect.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/detect.c"
- --- ./driver/nt/detect.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/detect.c" 2022-05-09 18:24:10.759765600 +0500
- @@ -955,13 +955,14 @@
- "ACPIDetectDuplicateHID - matches with %08lx\n",
- childExtension
- ) );
- - KeBugCheckEx(
- - ACPI_BIOS_ERROR,
- - ACPI_REQUIRED_METHOD_NOT_PRESENT,
- - (ULONG_PTR) DeviceExtension,
- - PACKED_UID,
- - 0
- - );
- +
- + //KeBugCheckEx(
- + // ACPI_BIOS_ERROR,
- + // ACPI_REQUIRED_METHOD_NOT_PRESENT,
- + // (ULONG_PTR) DeviceExtension,
- + // PACKED_UID,
- + // 0
- + // );
- //
- // Make sure to only muck with the DeviceExtension UID if it doesn't
- @@ -974,7 +975,7 @@
- //
- DeviceExtension->InstanceID = ExAllocatePoolWithTag(
- NonPagedPool,
- - 9 * sizeof(UCHAR),
- + 5 * sizeof(UCHAR),
- ACPI_STRING_POOLTAG
- );
- if (DeviceExtension->InstanceID == NULL) {
- @@ -987,8 +988,8 @@
- ACPIInternalError( ACPI_DETECT );
- }
- - RtlZeroMemory( DeviceExtension->InstanceID, 9 * sizeof(UCHAR) );
- - sprintf( DeviceExtension->InstanceID, "%lx", DeviceExtension->AcpiObject->dwNameSeg );
- + RtlZeroMemory( DeviceExtension->InstanceID, 5 * sizeof(UCHAR) );
- + sprintf( DeviceExtension->InstanceID, "%.4s", DeviceExtension->AcpiObject->dwNameSeg );
- //
- // Remember that we have a fixed uid
- @@ -1012,7 +1013,7 @@
- //
- childExtension->InstanceID = ExAllocatePoolWithTag(
- NonPagedPool,
- - 9 * sizeof(UCHAR),
- + 5 * sizeof(UCHAR),
- ACPI_STRING_POOLTAG
- );
- if (childExtension->InstanceID == NULL) {
- @@ -1025,8 +1026,8 @@
- ACPIInternalError( ACPI_DETECT );
- }
- - RtlZeroMemory( childExtension->InstanceID, 9 * sizeof(UCHAR) );
- - sprintf( childExtension->InstanceID, "%lx", childExtension->AcpiObject->dwNameSeg );
- + RtlZeroMemory( childExtension->InstanceID, 5 * sizeof(UCHAR) );
- + sprintf( childExtension->InstanceID, "%.4s", childExtension->AcpiObject->dwNameSeg );
- //
- // Update the flags for both devices to indicate the fixed UID
- diff --strip-trailing-cr -ur ./driver/nt/devpower.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/devpower.c"
- --- ./driver/nt/devpower.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/devpower.c" 2022-04-04 20:23:40.000000000 +0500
- @@ -1170,7 +1170,7 @@
- );
- }
- - return STATUS_INSUFFICIENT_RESOURCES;
- + return STATUS_MORE_PROCESSING_REQUIRED;
- }
- @@ -3547,7 +3547,7 @@
- deviceExtension,
- ACPIDeviceCompleteGenericPhase,
- PowerRequest,
- - &(resultData->uipDataValue),
- + &(resultData->dwDataValue),
- &(resultData->dwDataLen)
- );
- ACPIDevPrint( (
- @@ -3613,7 +3613,7 @@
- // If the bit isn't set as being present, then we must abort this
- // request
- //
- - if (!(resultData->uipDataValue & STA_STATUS_PRESENT) ) {
- + if (!(resultData->dwDataValue & STA_STATUS_PRESENT) ) {
- //
- // The next work done phase is WORK_DONE_FAILURE. This allows the
- @@ -3753,7 +3753,7 @@
- //
- RtlZeroMemory( &(PowerRequest->ResultData), sizeof(OBJDATA) );
- PowerRequest->ResultData.dwDataType = OBJTYPE_INTDATA;
- - PowerRequest->ResultData.uipDataValue = 0;
- + PowerRequest->ResultData.dwDataValue = 0;
- //
- @@ -4006,7 +4006,7 @@
- // case we want to approximate the behaviour of the real _STA...
- //
- resultData->dwDataType = OBJTYPE_INTDATA;
- - resultData->uipDataValue = STA_STATUS_PRESENT;
- + resultData->dwDataValue = STA_STATUS_PRESENT;
- status = STATUS_SUCCESS;
- }
- @@ -4285,7 +4285,7 @@
- POWER_ACTION systemAction;
- SYSTEM_POWER_STATE systemState;
- SYSTEM_POWER_STATE wakeFromState;
- - ULONG hibernateCount = 0;
- + ULONG hibernateCount; // = 0;
- //
- // The next stage after this one is STEP_1
- @@ -4503,7 +4503,7 @@
- //
- RtlZeroMemory( &objData, sizeof(OBJDATA) );
- objData.dwDataType = OBJTYPE_INTDATA;
- - objData.uipDataValue = ACPIDeviceMapACPIPowerState(
- + objData.dwDataValue = ACPIDeviceMapACPIPowerState(
- wakeFromState
- );
- @@ -4712,7 +4712,7 @@
- } // ACPIDevicePowerProcessPhase2SystemSubPhase3
- NTSTATUS
- -ACPIDevicePowerProcessPhase3(
- +ACPIDevicePowerProcessPhase3_rtm(
- VOID
- )
- /*++
- @@ -5059,6 +5059,214 @@
- } // ACPIPowerProcessPhase3
- +
- +#ifdef_X86_
- +
- +NTSTATUS __declspec(naked)
- +ACPIDevicePowerProcessPhase3(
- + VOID
- + ) {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 18h
- + push ebx
- + push esi
- + mov ebx, offset AcpiPowerLock
- + push edi
- + mov ecx, ebx
- + mov byte ptr [ebp-1], 0
- + call dword ptr [KefAcquireSpinLockAtDpcLevel]
- + mov esi, dword ptr [AcpiPowerNodeList]
- + mov eax, offset AcpiPowerNodeList
- + cmp esi, eax
- + jz loc_160F6
- + jmp short loc_15FEC
- +
- +loc_15FE9:
- + mov esi, [ebp-0Ch]
- +
- +loc_15FEC:
- + mov eax, [esi]
- + mov [ebp-0Ch], eax
- + mov eax, [esi+8]
- + and eax, 2
- + xor ecx, ecx
- + or eax, ecx
- + jz loc_160E8
- + push 3
- + push 4
- + lea ecx, [esi+28h]
- + pop edx
- + call dword ptr [InterlockedCompareExchange]
- + cmp eax, 3
- + jnz loc_160E8
- + and dword ptr [ebp-8], 0
- + lea eax, [esi+20h]
- + mov edi, [eax]
- + jmp short loc_16062
- +
- +loc_16023:
- + lea eax, [edi-18h]
- + mov edi, [edi]
- + mov [ebp-14h], eax
- + mov eax, [eax+14h]
- + push 0
- + lea ecx, [eax+0F0h]
- + xor edx, edx
- + mov [ebp-10h], eax
- + call dword ptr [InterlockedCompareExchange]
- + mov ecx, [ebp-10h]
- + mov edx, [ecx+0ECh]
- + mov ecx, [ebp-14h]
- + cmp edx, [ecx+0Ch]
- + jz short loc_1605C
- + test eax, eax
- + jz short loc_1605F
- + cmp byte ptr [ecx+10h], 0
- + jz short loc_1605F
- +
- +loc_1605C:
- + inc dword ptr [ebp-8]
- +
- +loc_1605F:
- + lea eax, [esi+20h]
- +
- +loc_16062:
- + cmp edi, eax
- + jnz short loc_16023
- + mov edx, [ebp-8]
- + lea ecx, [esi+10h]
- + call dword ptr [InterlockedExchange]
- + mov eax, [esi+0Ch]
- + mov ecx, [esi+8]
- + mov [ebp-14h], eax
- + mov eax, ecx
- + and eax, 440h
- + xor edx, edx
- + or eax, edx
- + jnz short loc_160E8
- + and ecx, 220h
- + xor eax, eax
- + xor edi, edi
- + or ecx, eax
- + jnz short loc_1609B
- + cmp [ebp-8], edi
- + jz short loc_160E8
- +
- +loc_1609B:
- + xor edx, edx
- + push 4
- + inc edx
- + lea ecx, [esi+28h]
- + call dword ptr [InterlockedCompareExchange]
- + mov ecx, ebx
- + call dword ptr [KefReleaseSpinLockFromDpcLevel]
- + push esi
- + push offset ACPIDeviceCompletePhase3On
- + push edi
- + push edi
- + push edi
- + push dword ptr [esi+2Ch]
- + call AMLIAsyncEvalObject
- + add esp, 18h
- + cmp eax, 103h
- + jz short loc_160DC
- + push esi
- + push edi
- + push eax
- + push dword ptr [esi+2Ch]
- + call ACPIDeviceCompletePhase3On
- + add esp, 10h
- + jmp short loc_160E0
- +
- +loc_160DC:
- + mov byte ptr [ebp-1], 1
- +
- +loc_160E0:
- + mov ecx, ebx
- + call dword ptr [KefAcquireSpinLockAtDpcLevel]
- +
- +loc_160E8:
- + mov eax, offset AcpiPowerNodeList
- + cmp [ebp-0Ch], eax
- + jnz loc_15FE9
- +
- +loc_160F6:
- + mov edi, dword ptr [AcpiPowerNodeList+4] ; Blink
- + cmp edi, eax
- + jz short loc_16178
- +
- +loc_16100:
- + mov esi, edi
- + mov eax, [esi+8]
- + mov edi, [edi+4]
- + and eax, 2
- + xor ecx, ecx
- + or eax, ecx
- + jz short loc_16170
- + xor edx, edx
- + push 4
- + lea ecx, [esi+28h]
- + inc edx
- + call dword ptr [InterlockedCompareExchange]
- + cmp eax, 4
- + jz short loc_1612E
- + test eax, eax
- + jz short loc_16170
- + mov byte ptr [ebp-1], 1
- + jmp short loc_16170
- +
- +loc_1612E:
- + mov ecx, ebx
- + call dword ptr [KefReleaseSpinLockFromDpcLevel]
- + push esi
- + push offset ACPIDeviceCompletePhase3Off
- + xor eax, eax
- + push eax
- + push eax
- + push eax
- + push dword ptr [esi+30h]
- + call AMLIAsyncEvalObject
- + add esp, 18h
- + cmp eax, 103h
- + jz short loc_16164
- + push esi
- + push 0
- + push eax
- + push dword ptr [esi+30h]
- + call ACPIDeviceCompletePhase3Off
- + add esp, 10h
- + jmp short loc_16168
- +
- +loc_16164:
- + mov byte ptr [ebp-1], 1
- +
- +loc_16168:
- + mov ecx, ebx
- + call dword ptr [KefAcquireSpinLockAtDpcLevel]
- +
- +loc_16170:
- + cmp edi, offset AcpiPowerNodeList
- + jnz short loc_16100
- +
- +loc_16178:
- + mov ecx, ebx
- + call dword ptr [KefReleaseSpinLockFromDpcLevel]
- + mov al, [ebp-1]
- + neg al
- + pop edi
- + pop esi
- + pop ebx
- + sbb eax, eax
- + and eax, 103h
- + _emit 0xc9 ; "leave" opcode
- + retn
- +}
- +}
- +
- +#endif
- +
- NTSTATUS
- ACPIDevicePowerProcessPhase4(
- VOID
- @@ -5578,11 +5786,11 @@
- //
- if (flags & DEVICE_REQUEST_LOCK_DEVICE) {
- - objData.uipDataValue = 1; // Lock the device
- + objData.dwDataValue = 1; // Lock the device
- } else if (flags & DEVICE_REQUEST_UNLOCK_DEVICE) {
- - objData.uipDataValue = 0; // Unlock the device
- + objData.dwDataValue = 0; // Unlock the device
- } else {
- @@ -5682,7 +5890,7 @@
- deviceExtension,
- ACPIDeviceCompleteGenericPhase,
- PowerRequest,
- - &(resultData->uipDataValue),
- + &(resultData->dwDataValue),
- &(resultData->dwDataLen)
- );
- ACPIDevPrint( (
- @@ -5754,9 +5962,9 @@
- // First things first --- we just ran _STA (or faked it), so we
- // must check the return data
- //
- - if (!(resultData->uipDataValue & STA_STATUS_PRESENT) ||
- - !(resultData->uipDataValue & STA_STATUS_WORKING_OK) ||
- - ( !(resultData->uipDataValue & STA_STATUS_ENABLED) &&
- + if (!(resultData->dwDataValue & STA_STATUS_PRESENT) ||
- + !(resultData->dwDataValue & STA_STATUS_WORKING_OK) ||
- + ( !(resultData->dwDataValue & STA_STATUS_ENABLED) &&
- !(deviceExtension->Flags & DEV_TYPE_FILTER) ) ) {
- //
- @@ -5958,7 +6166,7 @@
- // Remember that AMLI doesn't use our definitions, so we will
- // have to normalize the S value
- //
- - objData.uipDataValue = ACPIDeviceMapACPIPowerState( systemState );
- + objData.dwDataValue = ACPIDeviceMapACPIPowerState( systemState );
- //
- // Safely run the control method
- @@ -6070,21 +6278,21 @@
- switch (systemState) {
- case PowerSystemWorking:
- - objData.uipDataValue = 1;
- + objData.dwDataValue = 1;
- break;
- case PowerSystemHibernate:
- - objData.uipDataValue = 4;
- + objData.dwDataValue = 4;
- break;
- case PowerSystemSleeping1:
- case PowerSystemSleeping2:
- case PowerSystemSleeping3:
- - objData.uipDataValue = 3;
- + objData.dwDataValue = 3;
- break;
- default:
- - objData.uipDataValue = 0;
- + objData.dwDataValue = 0;
- }
- diff --strip-trailing-cr -ur ./driver/nt/get.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/get.c"
- --- ./driver/nt/get.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/get.c" 2022-04-06 12:42:32.000000000 +0500
- @@ -160,7 +160,7 @@
- if ( (Flags & GET_EVAL_SIMPLE_INTEGER) ) {
- argument.dwDataType = OBJTYPE_INTDATA;
- - argument.uipDataValue = ( (ULONG_PTR) SimpleArgument );
- + argument.dwDataValue = ( (ULONG)(ULONG_PTR) SimpleArgument );
- } else if ( (Flags & GET_EVAL_SIMPLE_STRING) ) {
- @@ -410,7 +410,7 @@
- //
- // Set the value for the address
- //
- - *( (PULONG) Buffer) = (ULONG)Result->uipDataValue;
- + *( (PULONG) Buffer) = (ULONG)Result->dwDataValue;
- }
- @@ -1371,7 +1371,7 @@
- //
- // Convert the packed string
- //
- - ACPIAmliDoubleToName( buffer+5, (ULONG)Result->uipDataValue, FALSE );
- + ACPIAmliDoubleToName( buffer+5, (ULONG)Result->dwDataValue, FALSE );
- //
- // Done
- @@ -1635,7 +1635,7 @@
- //
- // Convert the packed string
- //
- - ACPIAmliDoubleToNameWide( buffer+5, (ULONG)Result->uipDataValue, FALSE );
- + ACPIAmliDoubleToNameWide( buffer+5, (ULONG)Result->dwDataValue, FALSE );
- //
- // Done
- @@ -1858,7 +1858,7 @@
- //
- // Get the real result
- //
- - deviceStatus = (ULONG)Result->uipDataValue;
- + deviceStatus = (ULONG)Result->dwDataValue;
- } else {
- @@ -1888,7 +1888,7 @@
- //
- // Get the real result
- //
- - deviceStatus = (ULONG)Result->uipDataValue;
- + deviceStatus = (ULONG)Result->dwDataValue;
- goto ACPIGetConvertToDevicePresenceExit2;
- }
- @@ -1937,7 +1937,8 @@
- return STATUS_SUCCESS;
- }
- -
- +
- +#ifdef _X86_
- NTSTATUS
- ACPIGetConvertToHardwareID(
- IN PDEVICE_EXTENSION DeviceExtension,
- @@ -1995,6 +1996,11 @@
- &buffer,
- &memSize
- );
- +
- + if (!NT_SUCCESS(status)) {
- + return status;
- + }
- +
- goto ACPIGetConvertToHardwareIDSuccessExit;
- } else if (!(Flags & GET_PROP_NSOBJ_INTERFACE) &&
- @@ -2112,7 +2118,7 @@
- //
- // Convert the packed string for the PNP ID
- //
- - ACPIAmliDoubleToName( tempString, (ULONG)Result->uipDataValue, FALSE );
- + ACPIAmliDoubleToName( tempString, (ULONG)Result->dwDataValue, FALSE );
- //
- // Done
- @@ -2279,6 +2285,11 @@
- &buffer,
- &memSize
- );
- +
- + if (!NT_SUCCESS(status)) {
- + return status;
- + }
- +
- goto ACPIGetConvertToHardwareIDWideSuccessExit;
- } else if (!(Flags & GET_PROP_NSOBJ_INTERFACE) &&
- @@ -2396,7 +2407,7 @@
- //
- // Convert the packed string for the PNP ID
- //
- - ACPIAmliDoubleToName( tempString, (ULONG)Result->uipDataValue, FALSE );
- + ACPIAmliDoubleToName( tempString, (ULONG)Result->dwDataValue, FALSE );
- //
- // Done
- @@ -2507,6 +2518,8 @@
- return status;
- }
- +#endif // _X86_
- +
- NTSTATUS
- ACPIGetConvertToInstanceID(
- IN PDEVICE_EXTENSION DeviceExtension,
- @@ -2664,7 +2677,7 @@
- //
- // Print the string
- //
- - sprintf( buffer, "%lx", Result->uipDataValue );
- + sprintf( buffer, "%lx", Result->dwDataValue );
- //
- // Done
- @@ -2836,7 +2849,7 @@
- //
- // Print the string
- //
- - swprintf( buffer, L"%lx", Result->uipDataValue );
- + swprintf( buffer, L"%lx", Result->dwDataValue );
- //
- // Done
- @@ -2885,7 +2898,7 @@
- //
- // Print the string
- //
- - swprintf( buffer, L"%lx", Result->uipDataValue );
- + swprintf( buffer, L"%lx", Result->dwDataValue );
- //
- // Done
- @@ -3108,7 +3121,7 @@
- //
- // Convert the packed string
- //
- - ACPIAmliDoubleToName( buffer, (ULONG)Result->uipDataValue, TRUE );
- + ACPIAmliDoubleToName( buffer, (ULONG)Result->dwDataValue, TRUE );
- //
- // Done
- @@ -3347,7 +3360,7 @@
- //
- // Convert the packed string
- //
- - ACPIAmliDoubleToNameWide( buffer, (ULONG)Result->uipDataValue, TRUE );
- + ACPIAmliDoubleToNameWide( buffer, (ULONG)Result->dwDataValue, TRUE );
- //
- // Done
- @@ -3487,7 +3500,7 @@
- //
- // Convert to string
- //
- - swprintf( buffer, L"%X", (ULONG)Result->uipDataValue );
- + swprintf( buffer, L"%X", (ULONG)Result->dwDataValue );
- *(Buffer) = buffer;
- if (BufferSize != NULL) {
- @@ -3712,7 +3725,7 @@
- }
- NTSTATUS
- -ACPIGetProcessorID(
- +ACPIGetProcessorID_rtm(
- IN PDEVICE_EXTENSION DeviceExtension,
- IN NTSTATUS Status,
- IN POBJDATA Result,
- @@ -3933,9 +3946,10 @@
- return STATUS_SUCCESS;
- }
- -
- +
- +
- NTSTATUS
- -ACPIGetProcessorIDWide(
- +ACPIGetProcessorIDWide_rtm(
- IN PDEVICE_EXTENSION DeviceExtension,
- IN NTSTATUS Status,
- IN POBJDATA Result,
- @@ -4154,6 +4168,607 @@
- //
- return STATUS_SUCCESS;
- }
- +
- +char asmStrStrName[] = "%s%s";
- +WCHAR asmSTRSTRBIGName[] = L"%S%S";
- +char asmModelName[] = "Model";
- +char asmFamilyName[] = "Family";
- +char asmACPISlashName[] = "ACPI\\\0\0\0";
- +char asmStarName[] = "*\0\0\0";
- +
- +#ifdef_X86_
- +
- +NTSTATUS __declspec(naked)
- +ACPIGetProcessorID(
- + IN PDEVICE_EXTENSION DeviceExtension,
- + IN NTSTATUS Status,
- + IN POBJDATA Result,
- + IN ULONG Flags,
- + OUT PVOID *Buffer,
- + OUT ULONG *BufferSize
- + ){
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 28h
- + mov eax, __security_cookie
- + push ebx
- + push esi
- + mov [ebp-4], eax
- + mov eax, [ebp+18h]
- + push edi
- + mov [ebp-24h], eax
- + mov eax, [ebp+1Ch]
- + mov esi, offset asmACPISlashName
- + lea edi, [ebp-0Ch]
- + movsd
- + mov [ebp-20h], eax
- + mov ax, word ptr [asmStarName]
- + movsw
- + mov [ebp-14h], ax
- + mov eax, dword ptr[AcpiProcessorString+4] ; AcpiProcessorString.Buffer
- + xor edi, edi
- + mov [ebp-10h], edi
- + mov [ebp-1Ch], edi
- + lea ecx, [eax+1]
- +
- +loc_18D6C:
- + mov dl, [eax]
- + inc eax
- + test dl, dl
- + jnz short loc_18D6C
- + sub eax, ecx
- + mov ecx, eax
- + lea eax, [ebp-0Ch]
- + lea esi, [eax+1]
- +
- +loc_18D7D:
- + mov dl, [eax]
- + inc eax
- + test dl, dl
- + jnz short loc_18D7D
- + sub eax, esi
- + lea esi, [eax+ecx+1]
- + mov eax, [ebp+14h]
- + and eax, 40h
- + mov [ebp-18h], esi
- + mov [ebp-28h], eax
- + jz loc_18E5D
- + push 53706341h
- + push esi
- + push edi
- + call dword ptr [ExAllocatePoolWithTag]
- + mov ebx, eax
- + cmp ebx, edi
- + mov [ebp-10h], ebx
- + jz loc_18E98
- + mov ecx, esi
- + mov edx, ecx
- + shr ecx, 2
- + xor eax, eax
- + mov edi, ebx
- + rep stosd
- + mov ecx, edx
- + and ecx, 3
- + rep stosb
- + mov eax, dword ptr[AcpiProcessorString+4] ; AcpiProcessorString.Buffer
- + mov edx, ebx
- +
- +loc_18DD1:
- + mov cl, [eax]
- + inc eax
- + mov [edx], cl
- + inc edx
- + test cl, cl
- + jnz short loc_18DD1
- + mov edi, dword ptr [strstr]
- + push offset asmModelName
- + push ebx
- + call edi
- + push offset asmFamilyName
- + push ebx
- + mov [ebp-1Ch], eax
- + call edi
- + add esp, 10h
- + cmp dword ptr [ebp-1Ch], 0
- + jz loc_18EA2
- + test eax, eax
- + jz loc_18EA2
- + lea ecx, [ebp-0Ch]
- + lea edi, [ecx+1]
- +
- +loc_18E0F:
- + mov dl, [ecx]
- + inc ecx
- + test dl, dl
- + jnz short loc_18E0F
- + sub ecx, edi
- + mov [ebp-18h], ecx
- + lea ecx, [ebp-14h]
- + lea edx, [ecx+1]
- +
- +loc_18E21:
- + mov bl, [ecx]
- + inc ecx
- + test bl, bl
- + jnz short loc_18E21
- + sub ecx, edx
- + mov edx, [ebp-1Ch]
- + lea edi, [edx+1]
- +
- +loc_18E30:
- + mov bl, [edx]
- + inc edx
- + test bl, bl
- + jnz short loc_18E30
- + sub edx, edi
- + lea edi, [eax+1]
- +
- +loc_18E3C:
- + mov bl, [eax]
- + inc eax
- + test bl, bl
- + jnz short loc_18E3C
- + sub eax, edi
- + mov edi, eax
- + lea eax, [ecx+esi*2]
- + add eax, [ebp-18h]
- + add edi, edx
- + shl edi, 1
- + lea eax, [eax+eax*2]
- + sub eax, edi
- + mov [ebp-18h], eax
- + mov esi, eax
- + xor edi, edi
- +
- +loc_18E5D:
- + mov eax, [ebp+14h]
- + shr eax, 1Ch
- + push 53706341h
- + not eax
- + push esi
- + and eax, 1
- + push eax
- + call dword ptr [ExAllocatePoolWithTag]
- + mov ebx, eax
- + cmp ebx, edi
- + jnz short loc_18EB5
- + mov eax, [ebp-24h]
- + mov [eax], edi
- + mov eax, [ebp-20h]
- + cmp eax, edi
- + jz short loc_18E89
- + mov [eax], edi
- +
- +loc_18E89:
- + cmp [ebp-10h], edi
- + jz short loc_18E98
- + push edi
- + push dword ptr [ebp-10h]
- + call dword ptr [ExFreePoolWithTag]
- +
- +loc_18E98:
- + mov eax, 0C000009Ah
- + jmp loc_18FB1
- +
- +loc_18EA2:
- + push 0
- + push ebx
- + call dword ptr [ExFreePoolWithTag]
- + mov eax, 0C0000001h
- + jmp loc_18FB1
- +
- +loc_18EB5: ; ACPIGetProcessorID(x,x,x,x,x,x)+151j
- + mov ecx, esi
- + mov edx, ecx
- + shr ecx, 2
- + xor eax, eax
- + mov edi, ebx
- + rep stosd
- + mov ecx, edx
- + and ecx, 3
- + test byte ptr [ebp+14h], 20h
- + rep stosb
- + jz short loc_18EED
- + push dword ptr[AcpiProcessorString+4] ; AcpiProcessorString.Buffer
- + lea eax, [ebp-0Ch]
- + push eax
- + push offset asmStrStrName
- + push ebx
- + call dword ptr [sprintf]
- + add esp, 10h
- + jmp loc_18F8D
- +
- +loc_18EED:
- + cmp dword ptr [ebp-28h], 0
- + jz loc_18F8D
- + push dword ptr [ebp-10h]
- + mov esi, dword ptr [sprintf]
- + lea eax, [ebp-0Ch]
- + push eax
- + push offset asmStrStrName
- + push ebx
- + call esi
- + push dword ptr [ebp-10h]
- + mov edi, eax
- + lea eax, [ebp-14h]
- + push eax
- + inc edi
- + lea eax, [ebx+edi]
- + push offset asmStrStrName
- + push eax
- + call esi
- + push dword ptr [ebp-10h]
- + add edi, eax
- + mov eax, [ebp-1Ch]
- + mov byte ptr [eax-1], 0
- + lea eax, [ebp-0Ch]
- + push eax
- + inc edi
- + lea eax, [ebx+edi]
- + push offset asmStrStrName
- + push eax
- + call esi
- + push dword ptr [ebp-10h]
- + lea edi, [edi+eax+1]
- + lea eax, [ebp-14h]
- + push eax
- + lea eax, [ebx+edi]
- + push offset asmStrStrName
- + push eax
- + call esi
- + add edi, eax
- + mov eax, [ebp-1Ch]
- + add esp, 40h
- + push dword ptr [ebp-10h]
- + mov byte ptr [eax-1], 0
- + lea eax, [ebp-0Ch]
- + push eax
- + inc edi
- + lea eax, [ebx+edi]
- + push offset asmStrStrName
- + push eax
- + call esi
- + push dword ptr [ebp-10h]
- + lea ecx, [ebp-14h]
- + push ecx
- + lea eax, [edi+eax+1]
- + add eax, ebx
- + push offset asmStrStrName
- + push eax
- + call esi
- + mov esi, [ebp-18h]
- + add esp, 20h
- +
- +loc_18F8D:
- + cmp dword ptr [ebp-10h], 0
- + jz short loc_18F9E
- + push 0
- + push dword ptr [ebp-10h]
- + call dword ptr [ExFreePoolWithTag]
- +
- +loc_18F9E:
- + mov eax, [ebp-24h]
- + mov [eax], ebx
- + mov eax, [ebp-20h]
- + test eax, eax
- + jz short loc_18FAF
- + lea ecx, [esi+esi]
- + mov [eax], ecx
- +
- +loc_18FAF:
- + xor eax, eax
- +
- +loc_18FB1:
- + mov ecx, [ebp-4]
- + pop edi
- + pop esi
- + pop ebx
- + call __security_check_cookie
- + _emit 0xc9 ; "leave" opcode
- + retn 18h
- +}
- +}
- +
- +
- +NTSTATUS __declspec(naked)
- +ACPIGetProcessorIDWide(
- + IN PDEVICE_EXTENSION DeviceExtension,
- + IN NTSTATUS Status,
- + IN POBJDATA Result,
- + IN ULONG Flags,
- + OUT PVOID *Buffer,
- + OUT ULONG *BufferSize
- + ){
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 2Ch
- + mov eax, __security_cookie
- + push ebx
- + push esi
- + mov [ebp-4], eax
- + mov eax, [ebp+18h]
- + push edi
- + mov [ebp-24h], eax
- + mov eax, [ebp+1Ch]
- + mov esi, offset asmACPISlashName
- + lea edi, [ebp-0Ch]
- + movsd
- + mov [ebp-28h], eax
- + mov ax, word ptr [asmStarName]
- + movsw
- + xor edi, edi
- + mov [ebp-14h], ax
- + mov eax, dword ptr[AcpiProcessorString+4] ; AcpiProcessorString.Buffer
- + mov [ebp-10h], edi
- + mov [ebp-18h], edi
- + mov [ebp-1Ch], edi
- + lea ecx, [eax+1]
- +
- +loc_1907B:
- + mov dl, [eax]
- + inc eax
- + test dl, dl
- + jnz short loc_1907B
- + sub eax, ecx
- + mov ecx, eax
- + lea eax, [ebp-0Ch]
- + lea esi, [eax+1]
- +
- +loc_1908C:
- + mov dl, [eax]
- + inc eax
- + test dl, dl
- + jnz short loc_1908C
- + sub eax, esi
- + lea ebx, [eax+ecx+1]
- + mov eax, [ebp+14h]
- + and eax, 40h
- + mov [ebp-2Ch], eax
- + jz loc_19172
- + push 53706341h
- + push ebx
- + push edi
- + call dword ptr [ExAllocatePoolWithTag]
- + mov esi, eax
- + cmp esi, edi
- + mov [ebp-10h], esi
- + jz loc_191B3
- + mov ecx, ebx
- + mov edx, ecx
- + shr ecx, 2
- + xor eax, eax
- + mov edi, esi
- + rep stosd
- + mov ecx, edx
- + and ecx, 3
- + rep stosb
- + mov eax, dword ptr[AcpiProcessorString+4] ; AcpiProcessorString.Buffer
- + mov edx, esi
- +
- +loc_190DD:
- + mov cl, [eax]
- + inc eax
- + mov [edx], cl
- + inc edx
- + test cl, cl
- + jnz short loc_190DD
- + mov edi, dword ptr [strstr]
- + push offset asmModelName
- + push esi
- + call edi
- + push offset asmFamilyName
- + push esi
- + mov [ebp-18h], eax
- + call edi
- + mov [ebp-1Ch], eax
- + xor eax, eax
- + add esp, 10h
- + cmp [ebp-18h], eax
- + jz loc_191BD
- + cmp [ebp-1Ch], eax
- + jz loc_191BD
- + lea eax, [ebp-0Ch]
- + lea edx, [eax+1]
- +
- +loc_19120:
- + mov cl, [eax]
- + inc eax
- + test cl, cl
- + jnz short loc_19120
- + sub eax, edx
- + mov [ebp-20h], eax
- + lea eax, [ebp-14h]
- + lea esi, [eax+1]
- +
- +loc_19132:
- + mov cl, [eax]
- + inc eax
- + test cl, cl
- + jnz short loc_19132
- + sub eax, esi
- + mov edx, eax
- + mov eax, [ebp-18h]
- + lea esi, [eax+1]
- +
- +loc_19143:
- + mov cl, [eax]
- + inc eax
- + test cl, cl
- + jnz short loc_19143
- + sub eax, esi
- + mov esi, eax
- + mov eax, [ebp-1Ch]
- + lea edi, [eax+1]
- +
- +loc_19154:
- + mov cl, [eax]
- + inc eax
- + test cl, cl
- + jnz short loc_19154
- + sub eax, edi
- + mov ecx, eax
- + lea eax, [edx+ebx*2]
- + add eax, [ebp-20h]
- + add ecx, esi
- + lea eax, [eax+eax*2]
- + shl ecx, 1
- + mov ebx, eax
- + sub ebx, ecx
- + xor edi, edi
- +
- +loc_19172:
- + mov eax, [ebp+14h]
- + shr eax, 1Ch
- + push 53706341h
- + lea esi, [ebx+ebx]
- + not eax
- + push esi
- + and eax, 1
- + push eax
- + mov [ebp-20h], esi
- + call dword ptr [ExAllocatePoolWithTag]
- + mov ebx, eax
- + cmp ebx, edi
- + jnz short loc_191CF
- + mov eax, [ebp-24h]
- + mov [eax], edi
- + mov eax, [ebp-28h]
- + cmp eax, edi
- + jz short loc_191A4
- + mov [eax], edi
- +
- +loc_191A4:
- + cmp [ebp-10h], edi
- + jz short loc_191B3
- + push edi
- + push dword ptr [ebp-10h]
- + call dword ptr [ExFreePoolWithTag]
- +
- +loc_191B3:
- + mov eax, 0C000009Ah
- + jmp loc_192C9
- +
- +loc_191BD:
- + push eax
- + push esi
- + call dword ptr [ExFreePoolWithTag]
- + mov eax, 0C0000001h
- + jmp loc_192C9
- +
- +loc_191CF:
- + mov ecx, esi
- + mov edx, ecx
- + shr ecx, 2
- + xor eax, eax
- + mov edi, ebx
- + rep stosd
- + mov ecx, edx
- + and ecx, 3
- + test byte ptr [ebp+14h], 20h
- + rep stosb
- + jz short loc_19207
- + push dword ptr[AcpiProcessorString+4] ; AcpiProcessorString.Buffer
- + lea eax, [ebp-0Ch]
- + push eax
- + push offset asmSTRSTRBIGName
- + push ebx
- + call dword ptr [swprintf]
- + add esp, 10h
- + jmp loc_192A8
- +
- +loc_19207:
- + cmp dword ptr [ebp-2Ch], 0
- + jz loc_192A8
- + push dword ptr [ebp-10h]
- + mov esi, dword ptr [swprintf]
- + lea eax, [ebp-0Ch]
- + push eax
- + push offset asmSTRSTRBIGName
- + push ebx
- + call esi
- + push dword ptr [ebp-10h]
- + mov edi, eax
- + lea eax, [ebp-14h]
- + push eax
- + inc edi
- + lea eax, [ebx+edi*2]
- + push offset asmSTRSTRBIGName
- + push eax
- + call esi
- + push dword ptr [ebp-10h]
- + add edi, eax
- + mov eax, [ebp-18h]
- + mov byte ptr [eax-1], 0
- + lea eax, [ebp-0Ch]
- + push eax
- + inc edi
- + lea eax, [ebx+edi*2]
- + push offset asmSTRSTRBIGName
- + push eax
- + call esi
- + push dword ptr [ebp-10h]
- + lea edi, [edi+eax+1]
- + lea eax, [ebp-14h]
- + push eax
- + lea eax, [ebx+edi*2]
- + push offset asmSTRSTRBIGName
- + push eax
- + call esi
- + add edi, eax
- + mov eax, [ebp-1Ch]
- + add esp, 40h
- + push dword ptr [ebp-10h]
- + mov byte ptr [eax-1], 0
- + lea eax, [ebp-0Ch]
- + push eax
- + inc edi
- + lea eax, [ebx+edi*2]
- + push offset asmSTRSTRBIGName
- + push eax
- + call esi ;
- + push dword ptr [ebp-10h]
- + lea ecx, [ebp-14h]
- + push ecx
- + lea eax, [edi+eax+1]
- + lea eax, [ebx+eax*2]
- + push offset asmSTRSTRBIGName
- + push eax
- + call esi ;
- + mov esi, [ebp-20h]
- + add esp, 20h
- +
- +loc_192A8:
- + cmp dword ptr [ebp-10h], 0
- + jz short loc_192B9
- + push 0
- + push dword ptr [ebp-10h]
- + call dword ptr [ExFreePoolWithTag]
- +
- +loc_192B9:
- + mov eax, [ebp-24h]
- + mov [eax], ebx
- + mov eax, [ebp-28h]
- + test eax, eax
- + jz short loc_192C7
- + mov [eax], esi
- +
- +loc_192C7:
- + xor eax, eax
- +
- +loc_192C9:
- + mov ecx, [ebp-4]
- + pop edi
- + pop esi
- + pop ebx
- + call __security_check_cookie
- + _emit 0xc9 ; "leave" opcode
- + retn 18h
- +}
- +}
- +
- +#endif // _X86_
- NTSTATUS
- ACPIGetProcessorStatus(
- @@ -4768,7 +5383,7 @@
- //
- // Set the value to what we should return
- //
- - *( (PULONG) (request->Buffer) ) = (ULONG)Result->uipDataValue;
- + *( (PULONG) (request->Buffer) ) = (ULONG)Result->dwDataValue;
- if (request->BufferSize != NULL) {
- *(request->BufferSize) = sizeof(ULONG);
- diff --strip-trailing-cr -ur ./driver/nt/init.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/init.c"
- --- ./driver/nt/init.c 2003-02-26 17:15:50.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/init.c" 2022-04-03 00:32:28.000000000 +0500
- @@ -1013,6 +1013,8 @@
- PCM_RESOURCE_LIST cmResourceList;
- PDEVICE_OBJECT deviceObject = NULL;
- PDEVICE_OBJECT targetObject = NULL;
- + ACPI_ARBITER_INSTANCE **arbiter;
- + ULONG i;
- //
- // We require the spinlock for parts of this
- @@ -1069,6 +1071,16 @@
- deviceObject->DeviceExtension = NULL;
- DeviceExtension->DeviceObject = NULL;
- + if (DeviceExtension->Flags & DEV_CAP_CONTAINER &&
- + DeviceExtension->Module.ArbitersNeeded) {
- + arbiter = DeviceExtension->Module.Arbiters;
- + for (i = 0; i < 3; i++) {
- + AcpiArblibFreeArbiterInstance(*arbiter);
- + *arbiter = NULL;
- + arbiter++;
- + }
- + }
- +
- //
- // The reference count should have value > 0
- //
- @@ -1628,7 +1640,8 @@
- PNSOBJ workObject;
- POWER_STATE state;
- ULONG deviceStatus;
- -
- + ACPI_ARBITER_INSTANCE **arbiter;
- + int i;
- PAGED_CODE();
- //
- @@ -1663,6 +1676,16 @@
- }
- + if (DeviceExtension->Flags & DEV_CAP_CONTAINER &&
- + DeviceExtension->Module.ArbitersNeeded) {
- + arbiter = DeviceExtension->Module.Arbiters;
- + for (i = 0; i < 3; i++) {
- + (*arbiter)->SomeField = FALSE;
- + arbiter++;
- + }
- + }
- +
- +
- //
- // Nothing to stop...
- //
- diff --strip-trailing-cr -ur ./driver/nt/internal.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/internal.c"
- --- ./driver/nt/internal.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/internal.c" 2022-04-03 20:18:42.000000000 +0500
- @@ -304,6 +304,14 @@
- //
- deviceExtension = DeviceObject->DeviceExtension;
- + if ( deviceExtension &&
- + deviceExtension->Signature != '_SGP' ) {
- + _ACPIInternalErrorEx(0x00090147,
- + (ULONG_PTR)DeviceObject,
- + (ULONG_PTR)deviceExtension);
- + }
- +
- +
- #if 0
- //
- // Is this a surprise removed device extension?
- diff --strip-trailing-cr -ur ./driver/nt/interupt.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/interupt.c"
- --- ./driver/nt/interupt.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/interupt.c" 2022-04-04 04:51:50.000000000 +0500
- @@ -711,7 +711,7 @@
- // behind our back. The way that we can correct this problem is by
- // forcing a check of the GPEs...
- //
- - if (!IntStatus) {
- + if ( !(AcpiOverrideAttributes & ACPI_OVERRIDE_GPE_PENDING) && !IntStatus ) {
- IntStatus |= PM1_GPE_PENDING;
- diff --strip-trailing-cr -ur ./driver/nt/irqarb.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/irqarb.c"
- --- ./driver/nt/irqarb.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/irqarb.c" 2022-04-16 10:26:14.839843700 +0500
- @@ -3531,8 +3531,24 @@
- }
- }
- - ASSERT(PciInterfacesInstantiated);
- + // BSOD 0x7E(c0000005, ...) AcpiArbCrackPRT() two workarounds:
- + // 1) pci.sys presence check
- + // 2) not PCI device type check
- + if (0) {
- + if (!PciInterfacesInstantiated) {
- + return STATUS_NOT_FOUND;
- + }
- + } else {
- + if (Pdo->DriverObject == AcpiDriverObject) {
- + status = ACPIInternalIsPci(Pdo);
- + if (NT_SUCCESS(status))
- + if ( (((PDEVICE_EXTENSION)Pdo->DeviceExtension)->Flags & DEV_CAP_PCI_DEVICE) == 0 )
- + return STATUS_NOT_FOUND;
- + }
- + }
- + ASSERT(PciInterfacesInstantiated);
- +
- *LinkNode = NULL;
- pciInterface = ((PARBITER_EXTENSION)AcpiArbiter.ArbiterState.Extension)->InterruptRouting;
- @@ -3750,9 +3766,9 @@
- 0,
- &adrData))) {
- - if (pciSlot.u.bits.DeviceNumber == (adrData.uipDataValue >> 16)) {
- + if (pciSlot.u.bits.DeviceNumber == (adrData.dwDataValue >> 16)) {
- - if ((adrData.uipDataValue & 0xffff) != 0xffff) {
- + if ((adrData.dwDataValue & 0xffff) != 0xffff) {
- ////
- //// An _ADR in a _PRT must be of the form xxxxFFFF,
- //// which means that the PCI Device Number is specified,
- @@ -3766,14 +3782,14 @@
- // ACPI_PRT_HAS_INVALID_FUNCTION_NUMBERS,
- // (ULONG_PTR)prtObj,
- // prtElement,
- - // adrData.uipDataValue);
- + // adrData.dwDataValue);
- - DEBUG_PRINT(0, ("PRT entry has ambiguous address %x\n", adrData.uipDataValue));
- + DEBUG_PRINT(0, ("PRT entry has ambiguous address %x\n", adrData.dwDataValue));
- status = STATUS_INVALID_PARAMETER;
- - pciSlot.u.bits.DeviceNumber = (ULONG)(adrData.uipDataValue >> 16) & 0xffff;
- - pciSlot.u.bits.FunctionNumber = (ULONG)(adrData.uipDataValue & 0xffff);
- + pciSlot.u.bits.DeviceNumber = (ULONG)(adrData.dwDataValue >> 16) & 0xffff;
- + pciSlot.u.bits.FunctionNumber = (ULONG)(adrData.dwDataValue & 0xffff);
- AMLIFreeDataBuffs(&adrData, 1);
- AMLIFreeDataBuffs(&prtData, 1);
- goto AcpiArbCrackPRTError;
- @@ -3795,7 +3811,7 @@
- 1,
- &pinData))) {
- - if (pinData.uipDataValue == interruptPin) {
- + if (pinData.dwDataValue == interruptPin) {
- //
- // This is the package that describes the link node we
- // are interested in. Get the name of the link node.
- @@ -3868,7 +3884,7 @@
- // We have an integer which describes the "Global System Interrupt Vector"
- // that this PCI device will trigger.
- //
- - *Vector = (ULONG)indexData.uipDataValue;
- + *Vector = (ULONG)indexData.dwDataValue;
- status = STATUS_SUCCESS;
- @@ -4993,7 +5009,7 @@
- }
- } else {
- -
- + if (0) { // BSOD 0xA5 (0x10006, ...) workaround, missing _DIS method for "PNP0C0F" (PCI Interrupt Link Devices)
- //
- // Link nodes must be disablable.
- //
- @@ -5003,6 +5019,7 @@
- (ULONG_PTR)context->RootDevice,
- 0,
- 0);
- + }
- }
- }
- }
- diff --strip-trailing-cr -ur ./driver/nt/match.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/match.c"
- --- ./driver/nt/match.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/match.c" 2022-04-04 21:11:12.000000000 +0500
- @@ -501,7 +501,7 @@
- //
- // Does the minimum address match?
- //
- - if (((KdComPortInUse != NULL) && (baseAddress == kdBaseAddr)) ||
- + if (((kdBaseAddr != NULL) && (baseAddress == kdBaseAddr)) ||
- ((headlessBaseAddress != NULL) && (baseAddress == headlessBaseAddress))) {
- //
- Only in c:\ACPI\ACPI_W2003\Base\busdrv\acpi/driver/nt: obj
- diff --strip-trailing-cr -ur ./driver/nt/osnotify.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/osnotify.c"
- --- ./driver/nt/osnotify.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/osnotify.c" 2022-04-04 02:40:34.000000000 +0500
- @@ -723,7 +723,7 @@
- NTSTATUS
- EXPORT
- -OSNotifyDeviceCheck(
- +OSNotifyDeviceCheck_rtm(
- IN PNSOBJ AcpiObject
- )
- /*++
- @@ -828,6 +828,88 @@
- return STATUS_SUCCESS;
- }
- +
- +#ifdef_X86_
- +
- +NTSTATUS __declspec(naked)
- +EXPORT
- +OSNotifyDeviceCheck(
- + IN PNSOBJ AcpiObject
- + ) {
- +_asm {
- + push ebp
- + mov ebp, esp
- + push dword ptr [ebp+8]
- + call ACPIDockIsDockDevice
- + test al, al
- + jz short loc_1DACB
- + pop ebp
- + jmp OSNotifyDeviceEject
- +
- +loc_1DACB:
- + push ebx
- + push esi
- + mov esi, offset AcpiDeviceTreeLock
- + mov ecx, esi
- + call dword ptr [KfAcquireSpinLock]
- + mov ecx, [ebp+8]
- + mov bl, al
- + xor edx, edx
- +
- +loc_1DAE1:
- + mov eax, [ecx+30h]
- + cmp eax, edx
- + mov ecx, [ecx+8]
- + jz short loc_1DAFA
- + cmp dword ptr [eax+8], 5F534750h
- + jz short loc_1DAF6
- + xor eax, eax
- +
- +loc_1DAF6:
- + cmp eax, edx
- + jnz short loc_1DB02
- +
- +loc_1DAFA:
- + cmp ecx, edx
- + jnz short loc_1DAE1
- + cmp eax, edx
- + jz short loc_1DB2C
- +
- +loc_1DB02:
- + mov ecx, [eax+13Ch]
- + jmp short loc_1DB19
- +
- +loc_1DB0A:
- + mov eax, [ecx]
- + and eax, 8
- + or eax, edx
- + jz short loc_1DB1F
- + mov ecx, [ecx+13Ch]
- +
- +loc_1DB19:
- + cmp ecx, edx
- + jnz short loc_1DB0A
- + jmp short loc_1DB2C
- +
- +loc_1DB1F:
- + push edx
- + push dword ptr [ecx+138h]
- + call dword ptr [IoInvalidateDeviceRelations]
- +
- +loc_1DB2C:
- + mov ecx, esi
- + mov dl, bl
- + call dword ptr [KfReleaseSpinLock]
- + pop esi
- + xor eax, eax
- + pop ebx
- + pop ebp
- + retn
- +}
- +}
- +
- +#endif
- +
- NTSTATUS
- EXPORT
- OSNotifyDeviceEnum(
- diff --strip-trailing-cr -ur ./driver/nt/pch.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/pch.h"
- --- ./driver/nt/pch.h 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/pch.h" 2022-04-16 10:41:03.298828100 +0500
- @@ -59,6 +59,7 @@
- //
- // These are the global include files for this project
- //
- +#include "arblib.h"
- #include "acpitabl.h"
- #include "amli.h"
- #include "aml.h"
- @@ -127,12 +128,11 @@
- #include "wmilog.h"
- #include "worker.h"
- -
- //
- // Make sure to have the correct tag
- //
- #ifdef ExAllocatePool
- #undef ExAllocatePool
- -#endif
- + #endif
- #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,'ipcA')
- diff --strip-trailing-cr -ur ./driver/nt/pciopregion.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/pciopregion.c"
- --- ./driver/nt/pciopregion.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/pciopregion.c" 2022-04-07 00:15:50.944335900 +0500
- @@ -1119,8 +1119,8 @@
- pciConfig = (PPCI_COMMON_CONFIG)buffer;
- - if (pciConfig->HeaderType != PCI_BRIDGE_TYPE) {
- -
- + if ((PCI_CONFIGURATION_TYPE(pciConfig) != PCI_BRIDGE_TYPE) &&
- + (PCI_CONFIGURATION_TYPE(pciConfig) != PCI_CARDBUS_BRIDGE_TYPE)) {
- //
- // Make a guess that the bus number was 0.
- //
- @@ -1133,6 +1133,7 @@
- // the secondary PCI bus and exit.
- //
- *state->Bus = pciConfig->u.type1.SecondaryBus;
- + HalSetMaxLegacyPciBusNumber(*state->Bus);
- status = STATUS_SUCCESS;
- goto GetPciAddressWorkerExit;
- @@ -1253,6 +1254,17 @@
- {
- PIS_PCI_DEVICE_STATE state;
- NTSTATUS status;
- + PDEVICE_EXTENSION DeviceExtension;
- +
- + DeviceExtension = (PDEVICE_EXTENSION) AcpiObject->Context;
- +
- + if ( DeviceExtension &&
- + ((DeviceExtension->Flags & DEV_CAP_PCI_DEVICE) ||
- + (DeviceExtension->Flags & DEV_CAP_PCI)) ) {
- + *Result = TRUE;
- + return STATUS_SUCCESS;
- + }
- +
- state = ExAllocatePoolWithTag(NonPagedPool, sizeof(IS_PCI_DEVICE_STATE), ACPI_INTERFACE_POOLTAG);
- @@ -1431,6 +1443,7 @@
- }
- if (state->Cid) {
- + ACPIConvertStringDelimitation(state->Cid, ' ');
- if (strstr(state->Cid, PCI_PNP_ID)) {
- //
- @@ -1540,6 +1553,7 @@
- } IS_PCI_BUS_STATE, *PIS_PCI_BUS_STATE;
- +#pragma auto_inline (off) // disable IsPciBusAsyncc inlinig to match x64 5.2.3790.3959 (srv03_sp2_rtm.070216-1710)
- NTSTATUS
- IsPciBusAsync(
- IN PNSOBJ AcpiObject,
- @@ -1570,6 +1584,15 @@
- --*/
- {
- PIS_PCI_BUS_STATE state;
- + PDEVICE_EXTENSION DeviceExtension;
- +
- + DeviceExtension = (PDEVICE_EXTENSION) AcpiObject->Context;
- +
- + if (DeviceExtension &&
- + (DeviceExtension->Flags & DEV_CAP_PCI)) {
- + *Result = TRUE;
- + return STATUS_SUCCESS;
- + }
- state = ExAllocatePoolWithTag(NonPagedPool, sizeof(IS_PCI_BUS_STATE), ACPI_INTERFACE_POOLTAG);
- @@ -1579,11 +1602,11 @@
- RtlZeroMemory(state, sizeof(IS_PCI_BUS_STATE));
- - state->AcpiObject = AcpiObject;
- + state->RunCompletion = INITIAL_RUN_COMPLETION;
- state->CompletionHandler = CompletionHandler;
- state->CompletionContext = CompletionContext;
- + state->AcpiObject = AcpiObject;
- state->Result = Result;
- - state->RunCompletion = INITIAL_RUN_COMPLETION;
- *Result = FALSE;
- @@ -1592,6 +1615,7 @@
- NULL,
- (PVOID)state);
- }
- +#pragma auto_inline (on)
- NTSTATUS
- EXPORT
- @@ -1710,6 +1734,7 @@
- }
- if (state->Cid) {
- + ACPIConvertStringDelimitation(state->Cid, ' ');
- if (strstr(state->Cid, PCI_PNP_ID)) {
- //
- @@ -1843,38 +1868,48 @@
- Notes:
- --*/
- +
- {
- +#ifdef _X86_ // match x32 5.2.3790.3959 (srv03_sp2_rtm.070216-1710)
- + return IsPciBusExtension(ACPIInternalGetDeviceExtension(DeviceObject));
- +
- +#else // match x64 5.2.3790.3959 (srv03_sp2_rtm.070216-1710)
- AMLISUPP_CONTEXT_PASSIVE getDataContext;
- - PDEVICE_EXTENSION devExt = ACPIInternalGetDeviceExtension(DeviceObject);
- - NTSTATUS status;
- - BOOLEAN result = FALSE;
- + PNSOBJ AcpiObject = ACPIInternalGetDeviceExtension(DeviceObject)->AcpiObject;
- + NTSTATUS status;
- + BOOLEAN result = FALSE;
- + PDEVICE_EXTENSION devExt2;
- PAGED_CODE();
- +
- + devExt2 = (PDEVICE_EXTENSION)AcpiObject->Context;
- - ASSERT(devExt->Signature == ACPI_SIGNATURE);
- + if (devExt2 &&
- + (devExt2->Flags & DEV_CAP_PCI)) {
- + return TRUE;
- + }
- KeInitializeEvent(&getDataContext.Event, SynchronizationEvent, FALSE);
- getDataContext.Status = STATUS_NOT_FOUND;
- - if (!(devExt->Flags & DEV_PROP_NO_OBJECT) ) {
- -
- - status = IsPciBusAsync( devExt->AcpiObject,
- - AmlisuppCompletePassive,
- - (PVOID)&getDataContext,
- - &result );
- -
- - if (status == STATUS_PENDING) {
- + status = IsPciBusAsync( AcpiObject,
- + AmlisuppCompletePassive,
- + (PVOID)&getDataContext,
- + &result );
- - KeWaitForSingleObject(&getDataContext.Event,
- - Executive,
- - KernelMode,
- - FALSE,
- - NULL);
- - }
- + if (status == STATUS_PENDING) {
- + KeWaitForSingleObject(&getDataContext.Event,
- + Executive,
- + KernelMode,
- + FALSE,
- + NULL);
- }
- +
- return result;
- +#endif
- }
- +
- BOOLEAN
- IsPciBusExtension(
- @@ -1899,6 +1934,10 @@
- --*/
- {
- + return IsNsobjPciBus(DeviceExtension->AcpiObject);
- +}
- +
- +/*
- AMLISUPP_CONTEXT_PASSIVE getDataContext;
- NTSTATUS status;
- BOOLEAN result = FALSE;
- @@ -1935,6 +1974,7 @@
- }
- return result;
- }
- +*/
- BOOLEAN
- IsNsobjPciBus(
- @@ -1962,9 +2002,17 @@
- AMLISUPP_CONTEXT_PASSIVE getDataContext;
- NTSTATUS status;
- BOOLEAN result = FALSE;
- + PDEVICE_EXTENSION DeviceExtension;
- PAGED_CODE();
- + DeviceExtension = (PDEVICE_EXTENSION) Device->Context;
- +
- + if (DeviceExtension &&
- + (DeviceExtension->Flags & DEV_CAP_PCI)) {
- + return TRUE;
- + }
- +
- KeInitializeEvent(&getDataContext.Event, SynchronizationEvent, FALSE);
- getDataContext.Status = STATUS_NOT_FOUND;
- @@ -1981,7 +2029,7 @@
- FALSE,
- NULL);
- - status = getDataContext.Status;
- + //status = getDataContext.Status;
- }
- return result;
- @@ -2193,9 +2241,9 @@
- RtlZeroMemory(objdata, sizeof(objdata));
- objdata[0].dwDataType = OBJTYPE_INTDATA;
- - objdata[0].uipDataValue = REGSPACE_PCICFG;
- + objdata[0].dwDataValue = REGSPACE_PCICFG;
- objdata[1].dwDataType = OBJTYPE_INTDATA;
- - objdata[1].uipDataValue = (Enable ? CONNECT_HANDLER : DISCONNECT_HANDLER );
- + objdata[1].dwDataValue = (Enable ? CONNECT_HANDLER : DISCONNECT_HANDLER );
- status = AMLIEvalNameSpaceObject(
- regMethod,
- diff --strip-trailing-cr -ur ./driver/nt/rangesup.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/rangesup.c"
- --- ./driver/nt/rangesup.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/rangesup.c" 2022-04-04 01:40:00.000000000 +0500
- @@ -2325,8 +2325,9 @@
- //
- // Do we errors?
- //
- - if (bugCheck) {
- + if (0) { // BSOD 0xA5 (0x02, ...) workaround, ACPI vs E820 mem ranges conflict
- + //if (bugCheck) {
- ACPIPrint( (
- ACPI_PRINT_CRITICAL,
- "ACPI:\n"
- diff --strip-trailing-cr -ur ./driver/nt/res_bios.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/res_bios.c"
- --- ./driver/nt/res_bios.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/res_bios.c" 2022-04-27 21:40:32.335937500 +0500
- @@ -53,6 +53,7 @@
- #pragma alloc_text(PAGE,PnpiUpdateResourceList)
- #pragma alloc_text(PAGE,PnpBiosResourcesToNtResources)
- #pragma alloc_text(PAGE,PnpIoResourceListToCmResourceList)
- +#pragma alloc_text(PAGE,PnpDeviceBiosResourcesToNtResources)
- #endif
- @@ -85,11 +86,18 @@
- ASSERT(Descriptor->u.BusNumber.Length > 0);
- }
- -VOID
- -PnpiBiosAddressHandleGlobalFlags(
- - IN PVOID Buffer,
- - IN PIO_RESOURCE_DESCRIPTOR Descriptor
- - )
- +//VOID
- +//PnpiBiosAddressHandleGlobalFlags(
- +// IN PVOID Buffer,
- +// IN PIO_RESOURCE_DESCRIPTOR Descriptor
- +// )
- +NTSTATUS
- + PnpiBiosAddressHandleGlobalFlags(
- + IN PVOID Buffer,
- + IN PIO_RESOURCE_LIST Array[],
- + IN ULONG ArrayIndex,
- + IN PIO_RESOURCE_DESCRIPTOR Descriptor
- + )
- /*++
- Routine Descriptoin:
- @@ -112,13 +120,15 @@
- ULONG newValue;
- ULONG oldValue;
- ULONG bound;
- + NTSTATUS status;
- PAGED_CODE();
- //
- // If the resource is marked as being consumed only, then it is
- // exclusive, otherwise, it is shared
- //
- - if (buffer->GFlag & PNP_ADDRESS_FLAG_CONSUMED_ONLY) {
- + if ((AcpiOverrideAttributes & ACPI_OVERRIDE_DEVICE_EXCLUSIVE) ||
- + buffer->GFlag & PNP_ADDRESS_FLAG_CONSUMED_ONLY) {
- Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
- @@ -192,6 +202,19 @@
- }
- + if (!(buffer->GFlag & PNP_ADDRESS_FLAG_CONSUMED_ONLY)) {
- + status = PnpiUpdateResourceList( & (Array[ArrayIndex]), &Descriptor );
- +
- + if (!NT_SUCCESS(status)) {
- + return status;
- + }
- +
- + RtlZeroMemory(Descriptor, sizeof(IO_RESOURCE_DESCRIPTOR));
- + Descriptor->Type = CmResourceTypeDevicePrivate;
- + Descriptor->Flags = CM_RESOURCE_MEMORY_READ_ONLY;
- + }
- +
- + return STATUS_SUCCESS;
- }
- VOID
- @@ -633,7 +656,11 @@
- //
- // Handle global flags
- //
- - PnpiBiosAddressHandleGlobalFlags( buffer, rangeDescriptor );
- + //PnpiBiosAddressHandleGlobalFlags( buffer, rangeDescriptor );
- + status = PnpiBiosAddressHandleGlobalFlags(buffer, Array, ArrayIndex, rangeDescriptor);
- + if (!NT_SUCCESS(status)) {
- + return status;
- + }
- return STATUS_SUCCESS;
- }
- @@ -976,7 +1003,11 @@
- //
- // Handle global flags
- //
- - PnpiBiosAddressHandleGlobalFlags( buffer, rangeDescriptor );
- + //PnpiBiosAddressHandleGlobalFlags( buffer, rangeDescriptor );
- + status = PnpiBiosAddressHandleGlobalFlags(buffer, Array, ArrayIndex, rangeDescriptor);
- + if (!NT_SUCCESS(status)) {
- + return status;
- + }
- return STATUS_SUCCESS;
- }
- @@ -1164,7 +1195,8 @@
- }
- - if (length > MAXULONG) {
- + if (length > MAXULONG &&
- + (buffer->RFlag != PNP_ADDRESS_MEMORY_TYPE)) { // BSOD A5(0x14,...) workaround, Win7 fix
- ACPIPrint( (
- ACPI_PRINT_CRITICAL,
- @@ -1172,7 +1204,7 @@
- length
- ) );
- - if ((!(AcpiOverrideAttributes & ACPI_OVERRIDE_DELL_MAXULONG_BUGCHECK)) || (childMin < MAXULONG)) {
- + if ((!(AcpiOverrideAttributes & ACPI_OVERRIDE_IGNORE_QWORD_LENGTH)) || (childMin < MAXULONG)) {
- //
- // We can go no further
- //
- @@ -1323,7 +1355,11 @@
- //
- // Handle global flags
- //
- - PnpiBiosAddressHandleGlobalFlags( buffer, rangeDescriptor );
- + //PnpiBiosAddressHandleGlobalFlags( buffer, rangeDescriptor );
- + status = PnpiBiosAddressHandleGlobalFlags(buffer, Array, ArrayIndex, rangeDescriptor);
- + if (!NT_SUCCESS(status)) {
- + return status;
- + }
- return STATUS_SUCCESS;
- }
- @@ -2911,7 +2947,112 @@
- return STATUS_SUCCESS;
- }
- -
- +
- +#ifdef_X86_
- +NTSTATUS __declspec(naked)
- +PnpDeviceBiosResourcesToNtResources (
- + IN PDEVICE_EXTENSION DeviceExtension,
- + IN PUCHAR BiosData,
- + IN ULONG Flags,
- + OUT PIO_RESOURCE_REQUIREMENTS_LIST *List
- + ) {
- +__asm {
- + push ebp
- + mov ebp, esp
- + push esi
- + mov esi, [ebp+14h]
- + push esi
- + push dword ptr [ebp+10h]
- + push dword ptr [ebp+0Ch]
- + call PnpBiosResourcesToNtResources
- + test eax, eax
- + mov [ebp+0Ch], eax
- + jl loc_1F482
- + cmp dword ptr [esi], 0
- + jz loc_1F482
- + push ebx
- + mov ebx, [ebp+8]
- + push edi
- + mov edi, offset AcpiDeviceTreeLock
- + mov ecx, edi
- + mov byte ptr [ebp+13h], 0
- + call dword ptr [KfAcquireSpinLock]
- + jmp short loc_1F421
- +
- +loc_1F40F:
- + mov esi, [ebx+4]
- + and esi, 20h
- + xor ecx, ecx
- + or ecx, esi
- + jnz short loc_1F427
- + mov ebx, [ebx+13Ch]
- +
- +loc_1F421:
- + test ebx, ebx
- + jnz short loc_1F40F
- + jmp short loc_1F42B
- +
- +loc_1F427:
- + mov byte ptr [ebp+13h], 1
- +
- +loc_1F42B:
- + mov dl, al
- + mov ecx, edi
- + call dword ptr [KfReleaseSpinLock]
- + cmp byte ptr [ebp+13h], 0
- + pop edi
- + pop ebx
- + jz short loc_1F47F
- + mov eax, [ebp+14h]
- + mov eax, [eax]
- + mov ecx, [eax+1Ch]
- + add eax, 20h
- + test ecx, ecx
- + jbe short loc_1F47F
- + mov esi, ecx
- +
- +loc_1F44E:
- + lea ecx, [eax+8]
- + mov eax, [eax+4]
- + shl eax, 5
- + add eax, ecx
- + jmp short loc_1F478
- +
- +loc_1F45B:
- + movzx edx, byte ptr [ecx+1]
- + dec edx
- + jz short loc_1F46B
- + dec edx
- + dec edx
- + jz short loc_1F46B
- + sub edx, 3
- + jnz short loc_1F475
- +
- +loc_1F46B:
- + cmp byte ptr [ecx+2], 3
- + jnz short loc_1F475
- + mov byte ptr [ecx+2], 1
- +
- +loc_1F475:
- + add ecx, 20h
- +
- +loc_1F478:
- + cmp ecx, eax
- + jb short loc_1F45B
- + dec esi
- + jnz short loc_1F44E
- +
- +loc_1F47F:
- + mov eax, [ebp+0Ch]
- +
- +loc_1F482:
- + pop esi
- + pop ebp
- + retn 10h
- +}
- +}
- +#endif
- +
- NTSTATUS
- PnpIoResourceListToCmResourceList(
- IN PIO_RESOURCE_REQUIREMENTS_LIST IoList,
- diff --strip-trailing-cr -ur ./driver/nt/res_bios.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/res_bios.h"
- --- ./driver/nt/res_bios.h 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/res_bios.h" 2022-04-02 17:50:00.000000000 +0500
- @@ -294,9 +294,16 @@
- IN PIO_RESOURCE_DESCRIPTOR Descriptor
- );
- - VOID
- + /*VOID
- + PnpiBiosAddressHandleGlobalFlags(
- + IN PVOID Buffer,
- + IN PIO_RESOURCE_DESCRIPTOR Descriptor
- + );*/
- + NTSTATUS
- PnpiBiosAddressHandleGlobalFlags(
- IN PVOID Buffer,
- + IN PIO_RESOURCE_LIST Array[],
- + IN ULONG ArrayIndex,
- IN PIO_RESOURCE_DESCRIPTOR Descriptor
- );
- @@ -417,7 +424,15 @@
- PnpBiosResourcesToNtResources (
- IN PUCHAR BiosData,
- IN ULONG Flags,
- - OUT PIO_RESOURCE_REQUIREMENTS_LIST *List
- + OUT PIO_RESOURCE_REQUIREMENTS_LIST *List
- + );
- +
- + NTSTATUS
- + PnpDeviceBiosResourcesToNtResources (
- + IN PDEVICE_EXTENSION DeviceExtension,
- + IN PUCHAR BiosData,
- + IN ULONG Flags,
- + OUT PIO_RESOURCE_REQUIREMENTS_LIST *List
- );
- NTSTATUS
- diff --strip-trailing-cr -ur ./driver/nt/root.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/root.c"
- --- ./driver/nt/root.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/root.c" 2022-04-03 20:12:30.000000000 +0500
- @@ -142,8 +142,9 @@
- --*/
- {
- PKEVENT event = (PKEVENT) Context;
- -#if DBG
- PDEVICE_EXTENSION deviceExtension = ACPIInternalGetDeviceExtension(DeviceObject);
- +
- +#if DBG
- PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation( Irp );
- if (deviceExtension != NULL) {
- @@ -1031,6 +1032,8 @@
- ACPIWmiUnRegisterLog(DeviceObject);
- #endif // WMI_TRACING
- + ACPIInitializeKernelTableHandler(0, DeviceObject->DriverObject);
- +
- //
- // Delete the useless set of resources
- //
- diff --strip-trailing-cr -ur ./driver/nt/sources "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/sources"
- --- ./driver/nt/sources 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/sources" 2022-04-04 02:58:04.000000000 +0500
- @@ -74,4 +74,7 @@
- wake.c \
- wmilog.c \
- wmilog.mof \
- - worker.c
- + worker.c \
- + arblib.c
- +
- +AMD64_SOURCES= amd64\amd64_helpers.asm
- \ No newline at end of file
- diff --strip-trailing-cr -ur ./driver/nt/thermal.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/thermal.c"
- --- ./driver/nt/thermal.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/thermal.c" 2022-04-04 04:02:02.000000000 +0500
- @@ -1044,7 +1044,18 @@
- // NOTE - Synchronize with thread getting this data
- *InstanceLengthArray = sizeNeeded;
- - RtlCopyMemory(wmiThermalInfo, thermalInfo, sizeNeeded);
- + wmiThermalInfo->ThermalStamp = info->Info.ThermalStamp;
- + wmiThermalInfo->ThermalConstant1 = info->Info.ThermalConstant1;
- + wmiThermalInfo->ThermalConstant2 = info->Info.ThermalConstant2;
- + wmiThermalInfo->Processors = 0;
- + wmiThermalInfo->SamplingPeriod = info->Info.SamplingPeriod;
- + wmiThermalInfo->CurrentTemperature = info->Info.CurrentTemperature;
- + wmiThermalInfo->PassiveTripPoint = info->Info.PassiveTripPoint;
- + wmiThermalInfo->CriticalTripPoint = info->Info.CriticalTripPoint;
- + wmiThermalInfo->ActiveTripPointCount = info->Info.ActiveTripPointCount;
- + RtlCopyMemory(&wmiThermalInfo->ActiveTripPoint,
- + &thermalInfo->ActiveTripPoint,
- + sizeof(wmiThermalInfo->ActiveTripPoint));
- status = STATUS_SUCCESS;
- } else {
- @@ -1312,7 +1323,7 @@
- ASSERT (Result->dwDataType == OBJTYPE_INTDATA);
- Thrm = deviceExtension->Thermal.Info;
- - Thrm->Info.CurrentTemperature = (ULONG)Result->uipDataValue;
- + Thrm->Info.CurrentTemperature = (ULONG)Result->dwDataValue;
- AMLIFreeDataBuffs (Result, 1);
- ACPIThermalPrint( (
- diff --strip-trailing-cr -ur ./driver/nt/wake.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/wake.c"
- --- ./driver/nt/wake.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/nt/wake.c" 2022-04-04 04:02:02.000000000 +0500
- @@ -297,7 +297,7 @@
- //
- RtlZeroMemory( &pswData, sizeof(OBJDATA) );
- pswData.dwDataType = OBJTYPE_INTDATA;
- - pswData.uipDataValue = 0;
- + pswData.dwDataValue = 0;
- //
- // Run the control method
- @@ -648,7 +648,7 @@
- //
- RtlZeroMemory( &pswData, sizeof(OBJDATA) );
- pswData.dwDataType = OBJTYPE_INTDATA;
- - pswData.uipDataValue = (Enable ? 1 : 0);
- + pswData.dwDataValue = (Enable ? 1 : 0);
- //
- // Run the control method
- @@ -811,6 +811,11 @@
- }
- //
- + // We can release the lock now
- + //
- + KeReleaseSpinLock( &AcpiPowerLock, oldIrql );
- +
- + //
- // If we own the PCI PME pin for this device, the make sure to clear the
- // status and either enable it --- we enable the PME pin after we have
- // turned on the _PSW, and we disable the PME pin before we turn off
- @@ -827,6 +832,11 @@
- }
- //
- + // Acquire the spinlock
- + //
- + KeAcquireSpinLock( &AcpiPowerLock, &oldIrql );
- +
- + //
- // Are the any items on the list?
- //
- if (!IsListEmpty( &(deviceExtension->PowerInfo.WakeSupportList) ) ) {
- @@ -873,7 +883,7 @@
- RtlZeroMemory( &pswData, sizeof(OBJDATA) );
- pswData.dwDataType = OBJTYPE_INTDATA;
- - pswData.uipDataValue = (nextContext->Enable ? 1 : 0);
- + pswData.dwDataValue = (nextContext->Enable ? 1 : 0);
- //
- // If we own the PCI PME pin for this device, the make sure to clear the
- diff --strip-trailing-cr -ur ./driver/shared/acpictl.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpictl.c"
- --- ./driver/shared/acpictl.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpictl.c" 2022-04-04 04:05:08.000000000 +0500
- @@ -357,7 +357,7 @@
- Argument->Type = ACPI_METHOD_ARGUMENT_INTEGER;
- Argument->DataLength = sizeof(ULONG);
- - Argument->Argument = (ULONG) ObjectData->uipDataValue;
- + Argument->Argument = (ULONG) ObjectData->dwDataValue;
- } else if (ObjectData->dwDataType == OBJTYPE_STRDATA ||
- ObjectData->dwDataType == OBJTYPE_BUFFDATA) {
- @@ -956,7 +956,7 @@
- integerBuffer = (PACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER) inputBuffer;
- argumentData->dwDataType = OBJTYPE_INTDATA;
- - argumentData->uipDataValue = integerBuffer->IntegerArgument;
- + argumentData->dwDataValue = integerBuffer->IntegerArgument;
- } else {
- @@ -1010,7 +1010,7 @@
- if (methodArgument->Type == ACPI_METHOD_ARGUMENT_INTEGER) {
- (argumentData[i]).dwDataType = OBJTYPE_INTDATA;
- - (argumentData[i]).uipDataValue = methodArgument->Argument;
- + (argumentData[i]).dwDataValue = methodArgument->Argument;
- } else {
- diff --strip-trailing-cr -ur ./driver/shared/acpiinit.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpiinit.c"
- --- ./driver/shared/acpiinit.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpiinit.c" 2022-04-04 00:03:48.000000000 +0500
- @@ -54,7 +54,820 @@
- //
- ULONG AMLIMaxCTObjs;
- -
- +extern ULONG g_AmliHookEnabled;
- +
- +char SimulatorRegEntry[]="\\Registry\\Machine\\System\\CurrentControlSet\\Services\\ACPI\\Parameters\\Simulator\\Tables";
- +char asmFormat1Name[] = "%08lx";
- +
- +
- +#ifdef_X86_
- +
- +VOID __declspec(naked)
- +ACPIRegReadEntireSimulatorAcpiTable() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 2Ch
- + mov eax, __security_cookie
- + push ebx
- + push esi
- + mov esi, [ebp+8]
- + push edi
- + mov edi, [ebp+0Ch]
- + push 53637041h
- + mov ebx, 2000h
- + mov [ebp-4], eax
- + mov eax, [edi]
- + push ebx
- + push 1
- + mov [ebp-2Ch], esi
- + mov [ebp-28h], edi
- + mov [ebp-1Ch], eax
- + call dword ptr[ExAllocatePoolWithTag]
- + test eax, eax
- + mov [ebp-18h], eax
- + jnz short loc_2C89C
- + mov eax, 0C000009Ah
- + jmp loc_2C9CA
- +
- +loc_2C89C:
- + and dword ptr [ebp-24h], 0
- + push 0
- + lea eax, [ebp-10h]
- + push offset asmFormat1Name
- + push eax
- + call sprintf
- + add esp, 0Ch
- + lea eax, [ebp-14h]
- + push eax
- + push dword ptr [ebp-18h]
- + mov [ebp-14h], ebx
- + push esi
- + jmp loc_2C99C
- +
- +loc_2C8C3:
- + cmp dword ptr [ebp-14h], 8
- + jb loc_2C9B1
- + and dword ptr [ebp-20h], 0
- + cmp dword ptr [ebp-14h], 0
- + jbe loc_2C974
- +
- +loc_2C8DB:
- + mov ecx, [ebp-18h]
- + mov eax, [ebp-20h]
- + lea ebx, [eax+ecx]
- + mov ecx, [ebx+4]
- + test ecx, ecx
- + jnz short loc_2C946
- + mov eax, [ebx]
- + mov esi, [ebp-1Ch]
- + cmp eax, [esi+4]
- + jz short loc_2C95E
- + push 74706341h
- + push eax
- + push ecx
- + call dword ptr[ExAllocatePoolWithTag]
- + test eax, eax
- + mov [ebp-1Ch], eax
- + jz loc_2C9B8
- + mov ecx, [ebx]
- + mov edx, [esi+4]
- + cmp ecx, edx
- + jb short loc_2C918
- + mov ecx, edx
- +
- +loc_2C918:
- + mov esi, [edi]
- + mov edx, ecx
- + shr ecx, 2
- + mov edi, eax
- + rep movsd
- + mov ecx, edx
- + and ecx, 3
- + rep movsb
- + mov esi, [ebp-28h]
- + mov ecx, [esi]
- + test ecx, ecx
- + jz short loc_2C93F
- + push 0
- + push ecx
- + call dword ptr[ExFreePoolWithTag]
- + mov eax, [ebp-1Ch]
- +
- +loc_2C93F:
- + mov [esi], eax
- + mov [ebp-1Ch], eax
- + jmp short loc_2C95B
- +
- +loc_2C946:
- + mov edi, [edi]
- + add edi, [ebx]
- + mov eax, ecx
- + shr ecx, 2
- + lea esi, [ebx+8]
- + rep movsd
- + mov ecx, eax
- + and ecx, 3
- + rep movsb
- +
- +loc_2C95B:
- + mov edi, [ebp-28h]
- +
- +loc_2C95E:
- + mov ecx, [ebp-20h]
- + mov eax, [ebx+4]
- + lea eax, [ecx+eax+8]
- + cmp eax, [ebp-14h]
- + mov [ebp-20h], eax
- + jb loc_2C8DB
- +
- +loc_2C974:
- + inc dword ptr [ebp-24h]
- + push dword ptr [ebp-24h]
- + lea eax, [ebp-10h]
- + push offset asmFormat1Name
- + push eax
- + call sprintf
- + add esp, 0Ch
- + lea eax, [ebp-14h]
- + push eax
- + push dword ptr [ebp-18h]
- + mov dword ptr [ebp-14h], 2000h
- + push dword ptr [ebp-2Ch]
- +
- +loc_2C99C:
- + lea eax, [ebp-10h]
- + push eax
- + call OSReadRegValue
- + test eax, eax
- + jge loc_2C8C3
- + xor esi, esi
- + jmp short loc_2C9BD
- +
- +loc_2C9B1:
- + mov eax, 0C0000001h
- + jmp short loc_2C9CA
- +
- +loc_2C9B8:
- + mov esi, 0C000009Ah
- +
- +loc_2C9BD:
- + push 0
- + push dword ptr [ebp-18h]
- + call dword ptr[ExFreePoolWithTag]
- + mov eax, esi
- +
- +loc_2C9CA:
- + mov ecx, [ebp-4]
- + pop edi
- + pop esi
- + pop ebx
- + call __security_check_cookie
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +ACPIRegGetTableFromSimulatorRegistryEntry() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 10h
- + mov eax, [ebp+8]
- + mov eax, [eax]
- + and dword ptr [ebp-0Ch], 0
- + and dword ptr [ebp-8], 0
- + push ebx
- + push 53637041h
- + push 6Ah
- + push 1
- + mov byte ptr [ebp-1], 0
- + mov [ebp-10h], eax
- + call dword ptr[ExAllocatePoolWithTag]
- + mov ebx, eax
- + test ebx, ebx
- + jnz short loc_2CBD9
- + xor al, al
- + jmp loc_2CC86
- +
- +loc_2CBD9:
- + push esi
- + push edi
- + push 1Ah
- + pop ecx
- + xor eax, eax
- + mov edi, ebx
- + rep stosd
- + push 15h
- + stosw
- + pop ecx
- + mov esi, offset SimulatorRegEntry
- + mov edi, ebx
- + rep movsd
- + mov esi, [ebp-10h]
- + push 4
- + push esi
- + lea eax, [ebx+55h]
- + push eax
- + mov byte ptr [ebx+54h], 5Ch
- + call ACPIRegLocalCopyString
- + push 6
- + lea ecx, [esi+0Ah]
- + mov byte ptr [eax], 5Ch
- + push ecx
- + inc eax
- + push eax
- + call ACPIRegLocalCopyString
- + push 8
- + lea ecx, [esi+10h]
- + mov byte ptr [eax], 5Ch
- + push ecx
- + inc eax
- + push eax
- + call ACPIRegLocalCopyString
- + mov byte ptr [eax], 0
- + lea eax, [ebp-8]
- + push eax
- + xor edi, edi
- + push edi
- + push ebx
- + call OSOpenHandle
- + test eax, eax
- + jl short loc_2CC5F
- + push dword ptr [esi+18h]
- + lea eax, [ebp-0Ch]
- + push eax
- + push dword ptr [ebp-8]
- + call OSOpenLargestSubkey
- + test eax, eax
- + jl short loc_2CC5F
- + push dword ptr [ebp+8]
- + push dword ptr [ebp-0Ch]
- + call ACPIRegReadEntireSimulatorAcpiTable
- + test eax, eax
- + jl short loc_2CC5F
- + mov byte ptr [ebp-1], 1
- +
- +loc_2CC5F:
- + push edi
- + push ebx
- + call dword ptr[ExFreePoolWithTag]
- + cmp [ebp-8], edi
- + jz short loc_2CC74
- + push dword ptr [ebp-8]
- + call OSCloseHandle
- +
- +loc_2CC74:
- + cmp [ebp-0Ch], edi
- + pop edi
- + pop esi
- + jz short loc_2CC83
- + push dword ptr [ebp-0Ch]
- + call OSCloseHandle
- +
- +loc_2CC83:
- + mov al, [ebp-1]
- +
- +loc_2CC86:
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 4
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +ACPIMapNamedTable() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 28h
- + mov edx, AcpiInformation
- + xor eax, eax
- + push esi
- + mov [ebp-0Ch], eax
- + mov ecx, [edx]
- + cmp dword ptr [ecx], 54445358h
- + mov ecx, [ecx+4]
- + push edi
- + push 24h
- + mov byte ptr [ebp-3], 0
- + mov byte ptr [ebp-4], 0
- + mov byte ptr [ebp-2], 0
- + mov [ebp-14h], eax
- + mov [ebp-20h], eax
- + pop esi
- + jnz short loc_2C0A0
- + cmp ecx, esi
- + jnb short loc_2C095
- + mov esi, ecx
- +
- +loc_2C095:
- + sub ecx, esi
- + shr ecx, 3
- + mov byte ptr [ebp-2], 1
- + jmp short loc_2C0AB
- +
- +loc_2C0A0:
- + cmp ecx, esi
- + jnb short loc_2C0A6
- + mov esi, ecx
- +
- +loc_2C0A6:
- + sub ecx, esi
- + shr ecx, 2
- +
- +loc_2C0AB:
- + cmp ecx, eax
- + mov [ebp-8], ecx
- + jnz short loc_2C0BC
- + mov edi, 0C0140019h
- + jmp loc_2C2F7
- +
- +loc_2C0BC:
- + xor ecx, ecx
- + cmp [ebp-8], eax
- + push ebx
- + mov [ebp-1Ch], ecx
- + jbe loc_2C201
- + mov dword ptr [ebp-18h], 24h
- + jmp short loc_2C0DA
- +
- +loc_2C0D4:
- + mov edx, AcpiInformation
- +
- +loc_2C0DA:
- + cmp byte ptr [ebp-2], 0
- + mov eax, [edx]
- + jz short loc_2C0EF
- + mov ebx, [eax+ecx*8+24h]
- + mov eax, [eax+ecx*8+28h]
- + mov [ebp-24h], eax
- + jmp short loc_2C0F9
- +
- +loc_2C0EF:
- + mov ecx, [ebp-18h]
- + mov ebx, [ecx+eax]
- + and dword ptr [ebp-24h], 0
- +
- +loc_2C0F9:
- + push 0
- + push 24h
- + push dword ptr [ebp-24h]
- + push ebx
- + call dword ptr[MmMapIoSpace]
- + test eax, eax
- + mov [ebp-0Ch], eax
- + jz loc_2C1E3
- + mov ecx, [ebp+8]
- + cmp [eax], ecx
- + jnz short loc_2C195
- + mov edi, [ebp+0Ch]
- + test edi, edi
- + mov byte ptr [ebp-1], 1
- + jz short loc_2C156
- + lea esi, [eax+0Ah]
- +
- +loc_2C127:
- + mov dl, [edi]
- + mov cl, dl
- + cmp dl, [esi]
- + jnz short loc_2C149
- + test cl, cl
- + jz short loc_2C145
- + mov dl, [edi+1]
- + mov cl, dl
- + cmp dl, [esi+1]
- + jnz short loc_2C149
- + inc edi
- + inc edi
- + inc esi
- + inc esi
- + test cl, cl
- + jnz short loc_2C127
- +
- +loc_2C145:
- + xor ecx, ecx
- + jmp short loc_2C14E
- +
- +loc_2C149:
- + sbb ecx, ecx
- + sbb ecx, 0FFFFFFFFh
- +
- +loc_2C14E:
- + test ecx, ecx
- + jz short loc_2C156
- + mov byte ptr [ebp-1], 0
- +
- +loc_2C156:
- + mov edi, [ebp+10h]
- + test edi, edi
- + jz short loc_2C18F
- + lea esi, [eax+10h]
- +
- +loc_2C160:
- + mov dl, [edi]
- + mov cl, dl
- + cmp dl, [esi]
- + jnz short loc_2C182
- + test cl, cl
- + jz short loc_2C17E
- + mov dl, [edi+1]
- + mov cl, dl
- + cmp dl, [esi+1]
- + jnz short loc_2C182
- + inc edi
- + inc edi
- + inc esi
- + inc esi
- + test cl, cl
- + jnz short loc_2C160
- +
- +loc_2C17E:
- + xor ecx, ecx
- + jmp short loc_2C187
- +
- +loc_2C182:
- + sbb ecx, ecx
- + sbb ecx, 0FFFFFFFFh
- +
- +loc_2C187:
- + test ecx, ecx
- + jz short loc_2C18F
- + mov byte ptr [ebp-1], 0
- +
- +loc_2C18F:
- + cmp byte ptr [ebp-1], 0
- + jnz short loc_2C1BC
- +
- +loc_2C195:
- + push 24h
- + push eax
- + call dword ptr[MmUnmapIoSpace]
- + mov ecx, [ebp-1Ch]
- + add dword ptr [ebp-18h], 4
- + xor eax, eax
- + inc ecx
- + cmp ecx, [ebp-8]
- + mov [ebp-10h], eax
- + mov [ebp-0Ch], eax
- + mov [ebp-1Ch], ecx
- + jb loc_2C0D4
- + jmp short loc_2C20B
- +
- +loc_2C1BC:
- + mov esi, [eax+4]
- + push 24h
- + push eax
- + mov [ebp-14h], esi
- + call dword ptr[MmUnmapIoSpace]
- + and dword ptr [ebp-10h], 0
- + push 0
- + push esi
- + push dword ptr [ebp-24h]
- + push ebx
- + call dword ptr[MmMapIoSpace]
- + test eax, eax
- + mov [ebp-0Ch], eax
- + jnz short loc_2C1ED
- +
- +loc_2C1E3:
- + mov edi, 0C0140019h
- + jmp loc_2C2C4
- +
- +loc_2C1ED:
- + push 1
- + lea eax, [ebp-0Ch]
- + push eax
- + call ACPIRegReadAMLRegistryEntry
- + mov [ebp-3], al
- + mov eax, [ebp-0Ch]
- + mov [ebp-10h], eax
- +
- +loc_2C201:
- + cmp dword ptr [ebp-10h], 0
- + jnz loc_2C294
- +
- +loc_2C20B:
- + xor ebx, ebx
- + cmp g_AmliHookEnabled, ebx
- + jz short loc_2C28A
- + push 74706341h
- + push 24h
- + pop esi
- + push esi
- + push ebx
- + mov [ebp-8], ebx
- + call dword ptr[ExAllocatePoolWithTag]
- + mov edi, eax
- + cmp edi, ebx
- + mov [ebp-8], edi
- + jz short loc_2C287
- + xor eax, eax
- + push 9
- + pop ecx
- + rep stosd
- + mov eax, [ebp-8]
- + mov ecx, [ebp+8]
- + mov [eax], ecx
- + mov eax, [ebp-8]
- + mov [eax+4], esi
- + mov eax, [ebp+0Ch]
- + cmp eax, ebx
- + jz short loc_2C255
- + mov eax, [eax]
- + mov ecx, [ebp-8]
- + mov [ecx+0Ah], eax
- +
- +loc_2C255:
- + mov eax, [ebp+10h]
- + cmp eax, ebx
- + jz short loc_2C26D
- + mov ecx, [eax]
- + mov edx, [ebp-8]
- + mov [edx+10h], ecx
- + mov eax, [eax+4]
- + mov ecx, [ebp-8]
- + mov [ecx+14h], eax
- +
- +loc_2C26D:
- + lea eax, [ebp-8]
- + push eax
- + call ACPIRegGetTableFromSimulatorRegistryEntry
- + test al, al
- + mov [ebp-4], al
- + jz short loc_2C287
- + mov eax, [ebp-8]
- + cmp eax, ebx
- + mov [ebp-10h], eax
- + jnz short loc_2C291
- +
- +loc_2C287:
- + mov eax, [ebp-0Ch]
- +
- +loc_2C28A:
- + mov edi, 0C0000225h
- + jmp short loc_2C2C4
- +
- +loc_2C291:
- + mov eax, [ebp-0Ch]
- +
- +loc_2C294:
- + mov esi, [ebp-10h]
- + mov ecx, [esi+4]
- + mov edx, [ebp+18h]
- + cmp [edx], ecx
- + mov [ebp-14h], ecx
- + jnb short loc_2C2AB
- + mov edi, 0C0000023h
- + jmp short loc_2C2C2
- +
- +loc_2C2AB:
- + mov edi, [ebp+14h]
- + mov ebx, ecx
- + shr ecx, 2
- + rep movsd
- + mov ecx, ebx
- + and ecx, 3
- + rep movsb
- + mov ecx, [ebp-14h]
- + mov edi, [ebp-20h]
- +
- +loc_2C2C2:
- + mov [edx], ecx
- +
- +loc_2C2C4:
- + mov esi, dword ptr[ExFreePoolWithTag]
- + xor ebx, ebx
- + cmp eax, ebx
- + jz short loc_2C2E5
- + cmp [ebp-3], bl
- + jz short loc_2C2DB
- + push ebx
- + push eax
- + call esi
- + jmp short loc_2C2E5
- +
- +loc_2C2DB:
- + push dword ptr [ebp-14h]
- + push eax
- + call dword ptr[MmUnmapIoSpace]
- +
- +loc_2C2E5:
- + cmp byte ptr [ebp-4], 0
- + jz short loc_2C2F6
- + cmp [ebp-10h], ebx
- + jz short loc_2C2F6
- + push ebx
- + push dword ptr [ebp-10h]
- + call esi
- +
- +loc_2C2F6:
- + pop ebx
- +
- +loc_2C2F7:
- + mov eax, edi
- + pop edi
- + pop esi
- + _emit 0xc9 ; "leave" opcode
- + retn 14h
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +ACPIEnumerateTables() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 0Ch
- + mov eax, AcpiInformation
- + mov eax, [eax]
- + and dword ptr [ebp-0Ch], 0
- + and dword ptr [ebp-8], 0
- + cmp dword ptr [eax], 54445358h
- + mov eax, [eax+4]
- + push ebx
- + push esi
- + push edi
- + push 24h
- + mov byte ptr [ebp-1], 0
- + pop ecx
- + jnz short loc_2C341
- + cmp eax, ecx
- + jnb short loc_2C336
- + mov ecx, eax
- +
- +loc_2C336:
- + sub eax, ecx
- + shr eax, 3
- + mov byte ptr [ebp-1], 1
- + jmp short loc_2C34C
- +
- +loc_2C341:
- + cmp eax, ecx
- + jnb short loc_2C347
- + mov ecx, eax
- +
- +loc_2C347:
- + sub eax, ecx
- + shr eax, 2
- +
- +loc_2C34C:
- + mov ebx, eax
- + test ebx, ebx
- + jz loc_2C3EE
- + mov ecx, [ebp+0Ch]
- + shl eax, 2
- + test ecx, ecx
- + mov [ebp-0Ch], eax
- + jz loc_2C3F7
- + mov ecx, [ecx]
- + cmp ecx, eax
- + jnb short loc_2C379
- + mov dword ptr [ebp-8], 0C0000023h
- + jmp loc_2C3FE
- +
- +loc_2C379:
- + mov esi, [ebp+8]
- + mov edx, ecx
- + shr ecx, 2
- + xor eax, eax
- + mov edi, esi
- + rep stosd
- + mov ecx, edx
- + and ecx, 3
- + rep stosb
- + xor edi, edi
- + test ebx, ebx
- + jbe short loc_2C3FE
- + mov dword ptr [ebp+8], 24h
- + sub [ebp+8], esi
- +
- +loc_2C39E:
- + cmp byte ptr [ebp-1], 0
- + jz short loc_2C3B5
- + mov eax, AcpiInformation
- + mov ecx, [eax]
- + mov eax, [ecx+edi*8+24h]
- + mov ecx, [ecx+edi*8+28h]
- + jmp short loc_2C3C7
- +
- +loc_2C3B5:
- + mov eax, [ebp+8]
- + mov ecx, AcpiInformation
- + mov ecx, [ecx]
- + add eax, esi
- + mov eax, [eax+ecx]
- + xor ecx, ecx
- +
- +loc_2C3C7:
- + push 0
- + push 24h
- + push ecx
- + push eax
- + call dword ptr[MmMapIoSpace]
- + test eax, eax
- + jz short loc_2C3EE
- + mov ecx, [eax]
- + push 24h
- + push eax
- + mov [esi], ecx
- + call dword ptr[MmUnmapIoSpace]
- + inc edi
- + add esi, 4
- + cmp edi, ebx
- + jb short loc_2C39E
- + jmp short loc_2C3FE
- +
- +loc_2C3EE:
- + mov dword ptr [ebp-8], 0C0140019h
- + jmp short loc_2C3FE
- +
- +loc_2C3F7:
- + mov dword ptr [ebp-8], 0C000000Dh
- +
- +loc_2C3FE:
- + mov eax, [ebp-0Ch]
- + mov ecx, [ebp+0Ch]
- + pop edi
- + pop esi
- + mov [ecx], eax
- + mov eax, [ebp-8]
- + pop ebx
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +ACPIEnumMapTableHandler() {
- +_asm {
- + push ebp
- + mov ebp, esp
- + mov eax, [ebp+8]
- + mov ecx, [eax+4]
- + xor edx, edx
- + sub ecx, edx
- + jz short loc_2C445
- + dec ecx
- + jz short loc_2C431
- + mov eax, 0C0000002h
- + pop ebp
- + retn
- +
- +loc_2C431:
- + lea ecx, [eax+0Ch]
- + push ecx
- + lea ecx, [eax+10h]
- + push ecx
- + push edx
- + push edx
- + push dword ptr [eax+8]
- + call ACPIMapNamedTable
- + pop ebp
- + retn
- +
- +loc_2C445:
- + lea ecx, [eax+0Ch]
- + push ecx
- + add eax, 10h
- + push eax
- + call ACPIEnumerateTables
- + pop ebp
- + retn
- +}
- +}
- +
- +
- +VOID __declspec(naked)
- +ACPIInitializeKernelTableHandler(BOOLEAN mode, PDRIVER_OBJECT DrvObj) {
- +_asm {
- + push ebp
- + mov ebp, esp
- + sub esp, 10h
- + mov al, [ebp+8]
- + mov [ebp-0Ch], al
- + mov eax, [ebp+0Ch]
- + mov [ebp-4], eax
- + push 010h
- + lea eax, [ebp-10h]
- + push eax
- + push 04Bh
- + mov dword ptr [ebp-10h], 'ACPI'
- + mov dword ptr [ebp-8], offset ACPIEnumMapTableHandler
- + call DWORD PTR [ZwSetSystemInformation]
- + _emit 0xc9 ; "leave" opcode
- + retn 8
- +}
- +}
- +
- +#endif // _X86_
- +
- +
- BOOLEAN
- ACPIInitialize(
- PVOID Context
- @@ -299,6 +1112,7 @@
- }
- + ACPIInitializeKernelTableHandler(TRUE, ((PDEVICE_OBJECT)Context)->DriverObject);
- return (TRUE);
- }
- @@ -677,4 +1491,3 @@
- return (pblk);
- }
- -
- diff --strip-trailing-cr -ur ./driver/shared/acpiinit.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpiinit.h"
- --- ./driver/shared/acpiinit.h 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpiinit.h" 2022-04-02 19:19:42.000000000 +0500
- @@ -55,4 +55,9 @@
- IN UCHAR Processor
- );
- + VOID
- + ACPIInitializeKernelTableHandler(
- + IN BOOLEAN mode,
- + IN PDRIVER_OBJECT DrvObj
- + );
- #endif
- diff --strip-trailing-cr -ur ./driver/shared/acpioprg.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpioprg.c"
- --- ./driver/shared/acpioprg.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpioprg.c" 2022-04-06 23:35:48.739257800 +0500
- @@ -119,6 +119,10 @@
- HostDevice = NSGETPARENT(pnsOpRegion);
- + while (HostDevice && NSGETOBJTYPE(HostDevice) == OBJTYPE_METHOD) {
- + HostDevice = NSGETPARENT(HostDevice);
- + }
- +
- ACPIPrint( (
- ACPI_PRINT_IO,
- "OpRegion Access on region %x device %x\n",
- @@ -298,9 +302,9 @@
- //
- RtlZeroMemory( regArgs, sizeof(OBJDATA) * 2 );
- regArgs[0].dwDataType = OBJTYPE_INTDATA;
- - regArgs[0].uipDataValue = RegionSpace;
- + regArgs[0].dwDataValue = RegionSpace;
- regArgs[1].dwDataType = OBJTYPE_INTDATA;
- - regArgs[1].uipDataValue = 1;
- + regArgs[1].dwDataValue = 1;
- //
- // Eval the request. We can do this asynchronously since we don't actually
- @@ -357,9 +361,9 @@
- //
- RtlZeroMemory( regArgs, sizeof(OBJDATA) * 2 );
- regArgs[0].dwDataType = OBJTYPE_INTDATA;
- - regArgs[0].uipDataValue = HandlerNode->RegionSpace;
- + regArgs[0].dwDataValue = HandlerNode->RegionSpace;
- regArgs[1].dwDataType = OBJTYPE_INTDATA;
- - regArgs[1].uipDataValue = 0;
- + regArgs[1].dwDataValue = 0;
- //
- // Eval the request. We don't care what it returns, but we must do
- diff --strip-trailing-cr -ur ./driver/shared/acpisi.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpisi.c"
- --- ./driver/shared/acpisi.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/acpisi.c" 2022-04-04 04:05:08.000000000 +0500
- @@ -41,7 +41,7 @@
- ) );
- Arg0.dwfData = 0;
- - Arg0.uipDataValue = Value;
- + Arg0.dwDataValue = Value;
- Arg0.dwDataType = OBJTYPE_INTDATA;
- Arg0.dwDataLen = 0;
- Arg0.pbDataBuff = NULL;
- @@ -60,7 +60,7 @@
- ) );
- Arg0.dwfData = 0;
- - Arg0.uipDataValue = Value;
- + Arg0.dwDataValue = Value;
- Arg0.dwDataType = OBJTYPE_INTDATA;
- Arg0.dwDataLen = 0;
- Arg0.pbDataBuff = NULL;
- diff --strip-trailing-cr -ur ./driver/shared/loaddsdt.c "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/loaddsdt.c"
- --- ./driver/shared/loaddsdt.c 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/loaddsdt.c" 2022-04-02 20:10:24.000000000 +0500
- @@ -131,8 +131,13 @@
- rsdtPointer
- ) );
- ACPIBreakPoint();
- - goto RsdtDone;
- + //
- + // Give back a PTE now that we're done with the rsdtPointer.
- + //
- + MmUnmapIoSpace(rsdtPointer, sizeof(DESCRIPTION_HEADER));
- +
- + goto RsdtDone;
- }
- //
- @@ -152,17 +157,17 @@
- //
- // did we find the right rsdt buffer?
- //
- - if (rsdtBuffer == NULL) {
- + //if (rsdtBuffer == NULL) {
- - ACPIPrint( (
- - ACPI_PRINT_CRITICAL,
- - "ACPILoadFindRsdt: Cannot Map RSDT Pointer 0x%08lx\n",
- - rsdpMulti->RsdtAddress.LowPart
- - ) );
- - ACPIBreakPoint();
- - goto RsdtDone;
- + // ACPIPrint( (
- + // ACPI_PRINT_CRITICAL,
- + // "ACPILoadFindRsdt: Cannot Map RSDT Pointer 0x%08lx\n",
- + // rsdpMulti->RsdtAddress.LowPart
- + // ) );
- + // ACPIBreakPoint();
- + // goto RsdtDone;
- - }
- + //}
- RsdtDone:
- //
- Only in c:\ACPI\ACPI_W2003\Base\busdrv\acpi/driver/shared: obj
- diff --strip-trailing-cr -ur ./driver/shared/pch.h "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/pch.h"
- --- ./driver/shared/pch.h 2003-02-26 17:15:52.000000000 +0500
- +++ "c:\\ACPI\\ACPI_W2003\\Base\\busdrv\\acpi/driver/shared/pch.h" 2022-04-04 00:11:14.000000000 +0500
- @@ -57,6 +57,7 @@
- //
- // These are the global include files for this project
- //
- +#include "arblib.h"
- #include "acpitabl.h"
- #include "amli.h"
- #include "aml.h"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement