use own implementation for CopyMem and SetMem instead of BIOS

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-02-14 07:15:10 +03:00
parent 51f6ffc688
commit 82347b1e8d
23 changed files with 96 additions and 79 deletions

View File

@ -107,7 +107,7 @@ InitializeInterruptRedirection (
//
// Copy code to legacy region
//
gBS->CopyMem ((VOID *)(UINTN)LegacyRegionBase, (VOID *)&InterruptRedirectionCode[0], sizeof (InterruptRedirectionCode));
CopyMem ((VOID *)(UINTN)LegacyRegionBase, (VOID *)&InterruptRedirectionCode[0], sizeof (InterruptRedirectionCode));
//
// Get VectorBase, it should be 0x68
@ -156,7 +156,7 @@ LegacyBiosInt86 (
BOOLEAN Ret;
UINT16 *Stack16;
gBS->SetMem (&ThunkRegSet, sizeof (ThunkRegSet), 0);
SetMem(&ThunkRegSet, sizeof (ThunkRegSet), 0);
ThunkRegSet.E.EFLAGS.Bits.Reserved_0 = 1;
ThunkRegSet.E.EFLAGS.Bits.Reserved_1 = 0;
ThunkRegSet.E.EFLAGS.Bits.Reserved_2 = 0;
@ -226,7 +226,7 @@ LegacyBiosInt86 (
Regs->E.DS = ThunkRegSet.E.DS;
Regs->E.ES = ThunkRegSet.E.ES;
gBS->CopyMem (&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
CopyMem (&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
Ret = (BOOLEAN) (Regs->E.EFLAGS.Bits.CF == 1);

View File

@ -681,7 +681,7 @@ BiosVideoChildHandleUninstall (
return Status;
}
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
//
// Set the 80x25 Text VGA Mode
@ -916,7 +916,7 @@ ParseEdidData (
}
ValidNumber = 0;
gBS->SetMem (ValidEdidTiming, sizeof (VESA_BIOS_EXTENSIONS_VALID_EDID_TIMING), 0);
SetMem(ValidEdidTiming, sizeof (VESA_BIOS_EXTENSIONS_VALID_EDID_TIMING), 0);
if ((EdidDataBlock->EstablishedTimings[0] != 0) ||
(EdidDataBlock->EstablishedTimings[1] != 0) ||
@ -1169,9 +1169,9 @@ BiosVideoCheckForVbe (
// Desc: determine whether VESA BIOS extensions are present and the capabilities
// supported by the display adapter
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_CONTROLLER_INFORMATION;
gBS->SetMem (BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0);
BiosVideoPrivate->VbeInformationBlock->VESASignature = VESA_BIOS_EXTENSIONS_VBE2_SIGNATURE;
Regs.E.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeInformationBlock);
@ -1215,7 +1215,7 @@ BiosVideoCheckForVbe (
// ES:DI buffer filled
// 01h failed (e.g. non-DDC monitor)
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_EDID;
Regs.X.BX = 1;
Regs.X.CX = 0;
@ -1245,7 +1245,7 @@ BiosVideoCheckForVbe (
if (EFI_ERROR (Status)) {
goto Done;
}
gBS->CopyMem (
CopyMem (
BiosVideoPrivate->EdidDiscovered.Edid,
BiosVideoPrivate->VbeEdidDataBlock,
VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE
@ -1260,7 +1260,7 @@ BiosVideoCheckForVbe (
if (EFI_ERROR (Status)) {
goto Done;
}
gBS->CopyMem (
CopyMem (
BiosVideoPrivate->EdidActive.Edid,
BiosVideoPrivate->VbeEdidDataBlock,
VESA_BIOS_EXTENSIONS_EDID_BLOCK_SIZE
@ -1308,10 +1308,10 @@ BiosVideoCheckForVbe (
// 01h failed
// Desc: determine the attributes of the specified video mode
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_MODE_INFORMATION;
Regs.X.CX = *ModeNumberPtr;
gBS->SetMem (BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0);
Regs.E.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
@ -1771,7 +1771,7 @@ BiosVideoGraphicsOutputSetMode (
//
// Clear all registers
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
if (ModeData->VbeModeNumber < 0x100) {
//
@ -1810,7 +1810,7 @@ BiosVideoGraphicsOutputSetMode (
//
Regs.X.AX = VESA_BIOS_EXTENSIONS_SET_MODE;
Regs.X.BX = (UINT16) (ModeData->VbeModeNumber | VESA_BIOS_EXTENSIONS_MODE_NUMBER_LINEAR_FRAME_BUFFER);
gBS->SetMem (BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0);
Regs.E.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
@ -2852,7 +2852,7 @@ BiosVideoVgaMiniPortSetMode (
//
BiosVideoPrivate = BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS (This);
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
switch (ModeNumber) {
case 0:

View File

@ -520,7 +520,7 @@ BiosVideoChildHandleInstall (
BiosVideoPrivate->PciIo = ParentPciIo;
//Slice
// IA32_REGISTER_SET Regs;
// gBS->SetMem (&Regs, sizeof (Regs), 0);
// SetMem(&Regs, sizeof (Regs), 0);
// Regs.H.AH = 0x00;
// Regs.H.AL = 0x94; //0x83; bit 7 HiColor DAC
// 02h = T 80x25 8x8 640x200 16gray 4 B800 CGA,PCjr,Tandy

View File

@ -156,7 +156,7 @@ LegacyBiosInt86 (
BOOLEAN Ret;
UINT16 *Stack16;
gBS->SetMem (&ThunkRegSet, sizeof (ThunkRegSet), 0);
SetMem(&ThunkRegSet, sizeof (ThunkRegSet), 0);
ThunkRegSet.E.EFLAGS.Bits.Reserved_0 = 1;
ThunkRegSet.E.EFLAGS.Bits.Reserved_1 = 0;
ThunkRegSet.E.EFLAGS.Bits.Reserved_2 = 0;
@ -226,7 +226,7 @@ LegacyBiosInt86 (
Regs->E.DS = ThunkRegSet.E.DS;
Regs->E.ES = ThunkRegSet.E.ES;
gBS->CopyMem (&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
CopyMem (&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
Ret = (BOOLEAN) (Regs->E.EFLAGS.Bits.CF == 1);

View File

@ -964,7 +964,7 @@ Return
// AH = status 00h successful
// BX = video mode (see #0082,#0083)
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = 0x4F03;
LegacyBiosInt86 (0x10, &Regs);
if (Regs.X.AX == 0x004F) {
@ -977,7 +977,7 @@ Return
// AL = display mode (see #0009 at AH=00h)
// BH = active page (see AH=05h)
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.H.AH = 0x0F;
LegacyBiosInt86 (0x10, &Regs);
OriginalVideoMode = Regs.H.AL;
@ -1000,7 +1000,7 @@ Return
// 3Fh mode 6
// AL = CRT controller mode byte (Phoenix 386 BIOS v1.10)
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.H.AH = 0x00;
Regs.H.AL = (UINT8) NewVideoMode;
LegacyBiosInt86 (0x10, &Regs);
@ -1011,7 +1011,7 @@ Return
// BL = block to load
// Return:Nothing
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.H.AH = 0x11;
Regs.H.AL = 0x14;
Regs.H.BL = 0;
@ -1028,7 +1028,7 @@ Return
// 00h successful
// 01h failed
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = 0x4F02;
Regs.X.BX = NewVideoMode;
LegacyBiosInt86 (0x10, &Regs);
@ -1359,7 +1359,7 @@ VOID BiosPutC(CHAR8 ch)
{
EFI_IA32_REGISTER_SET Regs;
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.H.AH = 0x0e;
Regs.H.AL = ch;
Regs.H.BL = 0x0F; /* foreground white */

View File

@ -96,10 +96,10 @@ HdaControllerStreamPollTimerHandler(
// Copy data to DMA buffer.
if (HdaSourceLength < HDA_BDL_BLOCKSIZE)
gBS->SetMem(HdaStream->BufferData + (HdaNextBlock * HDA_BDL_BLOCKSIZE), HDA_BDL_BLOCKSIZE, 0);
gBS->CopyMem(HdaStream->BufferData + (HdaNextBlock * HDA_BDL_BLOCKSIZE), HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaSourceLength);
CopyMem(HdaStream->BufferData + (HdaNextBlock * HDA_BDL_BLOCKSIZE), HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaSourceLength);
} else { // Input stream (copy data from).
// Copy data from DMA buffer.
gBS->CopyMem(HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaStream->BufferData + (HdaNextBlock * HDA_BDL_BLOCKSIZE), HdaSourceLength);
CopyMem(HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaStream->BufferData + (HdaNextBlock * HDA_BDL_BLOCKSIZE), HdaSourceLength);
}
// Increase source position.
@ -367,7 +367,7 @@ HdaControllerScanCodecs(
HdaIoDevicePathNode.Header.Length[0] = (UINT8)(sizeof(EFI_HDA_IO_DEVICE_PATH));
HdaIoDevicePathNode.Header.Length[1] = (UINT8)((sizeof(EFI_HDA_IO_DEVICE_PATH)) >> 8);
HdaIoDevicePathNode.Guid = gEfiHdaIoDevicePathGuid;
// gBS->CopyMem((VOID*)&HdaIoDevicePathNode.Guid, (VOID*)&gEfiHdaIoDevicePathGuid, sizeof(EFI_GUID));
// CopyMem((VOID*)&HdaIoDevicePathNode.Guid, (VOID*)&gEfiHdaIoDevicePathGuid, sizeof(EFI_GUID));
HdaIoDevicePathNode.Address = i;
HdaControllerDev->HdaIoChildren[i].DevicePath = AppendDevicePathNode(HdaControllerDev->DevicePath, (EFI_DEVICE_PATH_PROTOCOL*)&HdaIoDevicePathNode);
if (HdaControllerDev->HdaIoChildren[i].DevicePath == NULL) {

View File

@ -406,7 +406,7 @@ HdaControllerHdaIoStartStream(
HdaStreamDmaRemainingLength = HDA_BDL_BLOCKSIZE - (HdaStreamDmaPos - (HdaStreamCurrentBlock * HDA_BDL_BLOCKSIZE));
if ((HdaStream->BufferSourcePosition + HdaStreamDmaRemainingLength) > BufferLength)
HdaStreamDmaRemainingLength = BufferLength;
gBS->CopyMem(HdaStream->BufferData + HdaStreamDmaPos, HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaStreamDmaRemainingLength);
CopyMem(HdaStream->BufferData + HdaStreamDmaPos, HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaStreamDmaRemainingLength);
HdaStream->BufferSourcePosition += HdaStreamDmaRemainingLength;
// DEBUG((DEBUG_INFO, "%u (0x%X) bytes written to 0x%X (block %u of %u)\n", HdaStreamDmaRemainingLength, HdaStreamDmaRemainingLength,
// HdaStream->BufferData + HdaStreamDmaPos, HdaStreamCurrentBlock, HDA_BDL_ENTRY_COUNT));
@ -416,7 +416,7 @@ HdaControllerHdaIoStartStream(
HdaStreamDmaRemainingLength = HDA_BDL_BLOCKSIZE;
if ((HdaStream->BufferSourcePosition + HdaStreamDmaRemainingLength) > BufferLength)
HdaStreamDmaRemainingLength = BufferLength;
gBS->CopyMem(HdaStream->BufferData + (HdaStreamNextBlock * HDA_BDL_BLOCKSIZE), HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaStreamDmaRemainingLength);
CopyMem(HdaStream->BufferData + (HdaStreamNextBlock * HDA_BDL_BLOCKSIZE), HdaStream->BufferSource + HdaStream->BufferSourcePosition, HdaStreamDmaRemainingLength);
HdaStream->BufferSourcePosition += HdaStreamDmaRemainingLength;
// DEBUG((DEBUG_INFO, "%u (0x%X) bytes written to 0x%X (block %u of %u)\n", HdaStreamDmaRemainingLength, HdaStreamDmaRemainingLength,
// HdaStream->BufferData + (HdaStreamNextBlock * HDA_BDL_BLOCKSIZE), HdaStreamNextBlock, HDA_BDL_ENTRY_COUNT));

View File

@ -106,7 +106,7 @@ InitializeInterruptRedirection (
//
// Copy code to legacy region
//
gBS->CopyMem ((VOID *)(UINTN)LegacyRegionBase, (VOID *)&InterruptRedirectionCode[0], sizeof (InterruptRedirectionCode));
CopyMem ((VOID *)(UINTN)LegacyRegionBase, (VOID *)&InterruptRedirectionCode[0], sizeof (InterruptRedirectionCode));
//
// Get VectorBase, it should be 0x68
@ -156,7 +156,7 @@ LegacyBiosInt86 (
BOOLEAN Ret;
UINT16 *Stack16;
gBS->SetMem (&ThunkRegSet, sizeof (ThunkRegSet), 0);
SetMem (&ThunkRegSet, sizeof (ThunkRegSet), 0);
ThunkRegSet.E.EFLAGS.Bits.Reserved_0 = 1;
ThunkRegSet.E.EFLAGS.Bits.Reserved_1 = 0;
ThunkRegSet.E.EFLAGS.Bits.Reserved_2 = 0;
@ -226,7 +226,7 @@ LegacyBiosInt86 (
Regs->E.DS = ThunkRegSet.E.DS;
Regs->E.ES = ThunkRegSet.E.ES;
gBS->CopyMem (&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
CopyMem (&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
Ret = (BOOLEAN) (Regs->E.EFLAGS.Bits.CF == 1);

View File

@ -613,7 +613,7 @@ LegacyBiosInstall (
// Initialize region from 0x0000 to 4k. This initializes interrupt vector
// range.
//
// gBS->SetMem ((VOID *) ClearPtr, 0x400, INITIAL_VALUE_BELOW_1K);
// SetMem((VOID *) ClearPtr, 0x400, INITIAL_VALUE_BELOW_1K);
// ZeroMem ((VOID *) ((UINTN)ClearPtr + 0x400), 0xC00);
//

View File

@ -728,7 +728,7 @@ BiosVideoChildHandleInstall (
if ((RemainingDevicePath == NULL) || (!IsDevicePathEnd (RemainingDevicePath))) {
if (RemainingDevicePath == NULL) {
// DBG("null RemainingDevicePath\n");
gBS->SetMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH), 0);
SetMem(&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH), 0);
AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH;
AcpiDeviceNode.Header.SubType = ACPI_ADR_DP;
AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0);
@ -1490,7 +1490,7 @@ BiosVideoCheckForVbe (
return Status;
}
gBS->SetMem (&ValidEdidTiming, sizeof (VESA_BIOS_EXTENSIONS_VALID_EDID_TIMING), 0);
SetMem(&ValidEdidTiming, sizeof (VESA_BIOS_EXTENSIONS_VALID_EDID_TIMING), 0);
//
// Fill in the VBE related data structures
@ -1521,9 +1521,9 @@ BiosVideoCheckForVbe (
// Desc: determine whether VESA BIOS extensions are present and the capabilities
// supported by the display adapter
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_CONTROLLER_INFORMATION;
gBS->SetMem (BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0);
BiosVideoPrivate->VbeInformationBlock->VESASignature = VESA_BIOS_EXTENSIONS_VBE2_SIGNATURE;
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeInformationBlock);
@ -1613,7 +1613,7 @@ BiosVideoCheckForVbe (
// 01h failed (e.g. non-DDC monitor)
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_EDID;
Regs.X.BX = 1;
Regs.X.CX = 0;
@ -1715,10 +1715,10 @@ BiosVideoCheckForVbe (
// 01h failed
// Desc: determine the attributes of the specified video mode
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_MODE_INFORMATION;
Regs.X.CX = VbeModeNumber;
gBS->SetMem (BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0);
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
@ -2198,7 +2198,7 @@ BiosVideoSetModeWorker (
//
// Clear all registers
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
if (ModeData->VbeModeNumber < 0x100) {
//
@ -2228,7 +2228,7 @@ BiosVideoSetModeWorker (
//
Regs.X.AX = VESA_BIOS_EXTENSIONS_SET_MODE;
Regs.X.BX = (UINT16) (ModeData->VbeModeNumber | VESA_BIOS_EXTENSIONS_MODE_NUMBER_LINEAR_FRAME_BUFFER);
gBS->SetMem (BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0);
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
BiosVideoPrivate->LegacyBios->Int86 (BiosVideoPrivate->LegacyBios, 0x10, &Regs);
@ -2629,7 +2629,7 @@ BiosVideoVbeBltWorker (
VbeBuffer = ((UINT8 *) VbeFrameBuffer + DstY * BytesPerScanLine + DestinationX * VbePixelWidth);
VbeBuffer1 = ((UINT8 *) VbeFrameBuffer + SrcY * BytesPerScanLine + SourceX * VbePixelWidth);
gBS->CopyMem (
CopyMem (
VbeBuffer,
VbeBuffer1,
TotalBytes
@ -2676,7 +2676,7 @@ BiosVideoVbeBltWorker (
VbeBuffer = (UINT8 *) ((UINTN) VbeFrameBuffer + (DestinationY * BytesPerScanLine) + DestinationX * VbePixelWidth);
for (DstY = DestinationY + 1; DstY < (Height + DestinationY); DstY++) {
gBS->CopyMem (
CopyMem (
(VOID *) ((UINTN) VbeFrameBuffer + (DstY * BytesPerScanLine) + DestinationX * VbePixelWidth),
VbeBuffer,
TotalBytes

View File

@ -733,7 +733,7 @@ BiosVideoChildHandleInstall (
if ((RemainingDevicePath == NULL) || (!IsDevicePathEnd (RemainingDevicePath))) {
if (RemainingDevicePath == NULL) {
// DBG("null RemainingDevicePath\n");
gBS->SetMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH), 0);
SetMem(&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH), 0);
AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH;
AcpiDeviceNode.Header.SubType = ACPI_ADR_DP;
AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0);
@ -1495,7 +1495,7 @@ BiosVideoCheckForVbe (
return Status;
}
gBS->SetMem (&ValidEdidTiming, sizeof (VESA_BIOS_EXTENSIONS_VALID_EDID_TIMING), 0);
SetMem(&ValidEdidTiming, sizeof (VESA_BIOS_EXTENSIONS_VALID_EDID_TIMING), 0);
//
// Fill in the VBE related data structures
@ -1526,9 +1526,9 @@ BiosVideoCheckForVbe (
// Desc: determine whether VESA BIOS extensions are present and the capabilities
// supported by the display adapter
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_CONTROLLER_INFORMATION;
gBS->SetMem (BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK), 0);
BiosVideoPrivate->VbeInformationBlock->VESASignature = VESA_BIOS_EXTENSIONS_VBE2_SIGNATURE;
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeInformationBlock);
@ -1618,7 +1618,7 @@ BiosVideoCheckForVbe (
// 01h failed (e.g. non-DDC monitor)
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_EDID;
Regs.X.BX = 1;
Regs.X.CX = 0;
@ -1720,10 +1720,10 @@ BiosVideoCheckForVbe (
// 01h failed
// Desc: determine the attributes of the specified video mode
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_MODE_INFORMATION;
Regs.X.CX = VbeModeNumber;
gBS->SetMem (BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeModeInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK), 0);
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeModeInformationBlock);
@ -2203,7 +2203,7 @@ BiosVideoSetModeWorker (
//
// Clear all registers
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem(&Regs, sizeof (Regs), 0);
if (ModeData->VbeModeNumber < 0x100) {
//
@ -2233,7 +2233,7 @@ BiosVideoSetModeWorker (
//
Regs.X.AX = VESA_BIOS_EXTENSIONS_SET_MODE;
Regs.X.BX = (UINT16) (ModeData->VbeModeNumber | VESA_BIOS_EXTENSIONS_MODE_NUMBER_LINEAR_FRAME_BUFFER);
gBS->SetMem (BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0);
SetMem(BiosVideoPrivate->VbeCrtcInformationBlock, sizeof (VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK), 0);
Regs.X.ES = EFI_SEGMENT ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
Regs.X.DI = EFI_OFFSET ((UINTN) BiosVideoPrivate->VbeCrtcInformationBlock);
BiosVideoPrivate->LegacyBios->Int86 (BiosVideoPrivate->LegacyBios, 0x10, &Regs);
@ -2634,7 +2634,7 @@ BiosVideoVbeBltWorker (
VbeBuffer = ((UINT8 *) VbeFrameBuffer + DstY * BytesPerScanLine + DestinationX * VbePixelWidth);
VbeBuffer1 = ((UINT8 *) VbeFrameBuffer + SrcY * BytesPerScanLine + SourceX * VbePixelWidth);
gBS->CopyMem (
CopyMem (
VbeBuffer,
VbeBuffer1,
TotalBytes
@ -2681,7 +2681,7 @@ BiosVideoVbeBltWorker (
VbeBuffer = (UINT8 *) ((UINTN) VbeFrameBuffer + (DestinationY * BytesPerScanLine) + DestinationX * VbePixelWidth);
for (DstY = DestinationY + 1; DstY < (Height + DestinationY); DstY++) {
gBS->CopyMem (
CopyMem (
(VOID *) ((UINTN) VbeFrameBuffer + (DstY * BytesPerScanLine) + DestinationX * VbePixelWidth),
VbeBuffer,
TotalBytes

View File

@ -52,6 +52,6 @@ InternalMemSetMem (
IN UINT8 Value
)
{
gBS->SetMem (Buffer, Size, Value);
SetMem(Buffer, Size, Value);
return Buffer;
}

View File

@ -97,7 +97,7 @@ InstallBsOverrides (
//
Status = AllocatePagesFromTop (EfiBootServicesData, PageNum, &UmmHeap, !gDumpMemArgPresent);
if (!EFI_ERROR (Status)) {
gBS->SetMem ((VOID *)UmmHeap, APTIOFIX_CUSTOM_POOL_ALLOCATOR_SIZE, 0);
SetMem((VOID *)UmmHeap, APTIOFIX_CUSTOM_POOL_ALLOCATOR_SIZE, 0);
UmmSetHeap ((VOID *)UmmHeap);
mStoredAllocatePool = gBS->AllocatePool;

View File

@ -163,7 +163,7 @@ DecodeImageData (//IN APPLE_IMAGE_CODEC_PROTOCOL* This,
*RawImageDataSize = (UINT32)(Image->Width * Image->Height * sizeof(EFI_UGA_PIXEL));
Status = gBS->AllocatePool(EfiBootServicesData, *RawImageDataSize, (VOID **)RawImageData);
if (!EFI_ERROR(Status)) {
gBS->CopyMem(*RawImageData, (VOID*)Image->PixelData, *RawImageDataSize);
CopyMem(*RawImageData, (VOID*)Image->PixelData, *RawImageDataSize);
}
DBG("EFI_SUCCESS, RawImageDataSize=%d\n", *RawImageDataSize);

View File

@ -301,7 +301,7 @@ ReadKeyState (APPLE_KEY_STATE_PROTOCOL* This,
Status = EFI_SUCCESS;
if (Keys != NULL) {
gBS->CopyMem((VOID *)Keys, (VOID *)Aggregator->KeyBuffer, (DbNoKeyStrokes * sizeof(APPLE_KEY)));
CopyMem((VOID *)Keys, (VOID *)Aggregator->KeyBuffer, (DbNoKeyStrokes * sizeof(APPLE_KEY)));
}
return Status;

View File

@ -323,7 +323,7 @@ FvReadSection (
*BufferSize = sizeof(PointerImage1x);
Status = gBS->AllocatePool(EfiBootServicesData, *BufferSize, (VOID **)Buffer);
if (!EFI_ERROR(Status)) {
gBS->CopyMem(*Buffer, &PointerImage1x, *BufferSize);
CopyMem(*Buffer, &PointerImage1x, *BufferSize);
}
*AuthenticationStatus = 0;
return Status;
@ -331,7 +331,7 @@ FvReadSection (
*BufferSize = sizeof(PointerImage2x);
Status = gBS->AllocatePool(EfiBootServicesData, *BufferSize, (VOID **)Buffer);
if (!EFI_ERROR(Status)) {
gBS->CopyMem(*Buffer, &PointerImage2x, *BufferSize);
CopyMem(*Buffer, &PointerImage2x, *BufferSize);
}
*AuthenticationStatus = 0;
return Status;
@ -339,7 +339,7 @@ FvReadSection (
*BufferSize = sizeof(GuidList);
Status = gBS->AllocatePool(EfiBootServicesData, *BufferSize, (VOID **)Buffer);
if (!EFI_ERROR(Status)) {
gBS->CopyMem(*Buffer, &GuidList, *BufferSize);
CopyMem(*Buffer, &GuidList, *BufferSize);
}
*AuthenticationStatus = 0;
return Status;

View File

@ -9,6 +9,7 @@
#include <Protocol/MsgLog.h>
#include <Library/PrintLib.h>
#include <Library/BaseMemoryLib.h>
MESSAGE_LOG_PROTOCOL MsgLogProtocol;
EFI_HANDLE mHandle = NULL;
@ -86,7 +87,7 @@ MsgLogEntrypoint (
return Status;
}
// Print(L"MsgLogProtocol installed!\n");
gBS->SetMem (tmp, BOOTER_LOG_SIZE, 0);
SetMem(tmp, BOOTER_LOG_SIZE, 0);
MsgLogProtocol.Log = tmp;
MsgLogProtocol.Cursor = tmp;
MsgLogProtocol.SizeOfLog = 0;

View File

@ -291,7 +291,7 @@ OvrLoadImage(IN BOOLEAN BootPolicy,
if (SrcBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
gBS->CopyMem(SrcBuffer, (UINT8 *)SourceBuffer + FatArch->Offset, SourceSize);
CopyMem(SrcBuffer, (UINT8 *)SourceBuffer + FatArch->Offset, SourceSize);
FreeSrcBuffer = TRUE;
} else {

View File

@ -439,6 +439,15 @@ UINT8 pnlf[] = {
0x08, 0x5F, 0x55, 0x49, 0x44, 0x0A, 0x0A, // Name (_UID, 0x0A)
0x08, 0x5F, 0x53, 0x54, 0x41, 0x0A, 0x0B // Name (_STA, 0x0B)
};
//Scope (_SB.PCI0.LPCB)
UINT8 pnlfLPC[] = {
0x10, 0x3e, 0x2f, 0x03, 0x5f, 0x53, 0x42, 0x5f, 0x50, 0x43, 0x49, 0x30, 0x4c, 0x50, 0x43, 0x42,
0x5b, 0x82, 0x2d, 0x50, 0x4e, 0x4c, 0x46, 0x08, 0x5f, 0x48, 0x49,
0x44, 0x0c, 0x06, 0x10, 0x00, 0x02, 0x08, 0x5f, 0x43, 0x49, 0x44, 0x0d,
0x62, 0x61, 0x63, 0x6b, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x00, 0x08, 0x5f,
0x55, 0x49, 0x44, 0x0a, 0x0a, 0x08, 0x5f, 0x53, 0x54, 0x41, 0x0a, 0x0b
};
UINT8 app2[] = { //Name (_HID, EisaId("APP0002"))
0x08, 0x5F, 0x48, 0x49, 0x44, 0x0C, 0x06, 0x10, 0x00, 0x02

View File

@ -185,7 +185,7 @@ EFI_STATUS BiosReadSectorsFromDrive(UINT8 DriveNum, UINT64 Lba, UINTN NumSectors
Dap->lba = Lba;
// set registers
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem (&Regs, sizeof (Regs), 0);
// first reset disk controller as the controller seems to be in an undefined state sometimes
DBG("Reset disk controller: %x\n", DriveNum);
@ -466,7 +466,7 @@ EFI_STATUS bootMBR(REFIT_VOLUME* volume)
UINT8 BiosDriveNum;
//UINTN LogSize;
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem (&Regs, sizeof (Regs), 0);
addrEnablePaging(0);
Status = gBS->LocateProtocol(&gEfiLegacy8259ProtocolGuid, NULL, (VOID**)&gLegacy8259);
@ -612,7 +612,7 @@ EFI_STATUS bootPBRtest(REFIT_VOLUME* volume)
EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *Facs = NULL;
IA32_REGISTER_SET Regs;
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem (&Regs, sizeof (Regs), 0);
addrEnablePaging(0);
//
// find the partition device path node
@ -936,7 +936,7 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset)
// prepare 16bit regs:
// DX = BIOS drive num
//
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem (&Regs, sizeof (Regs), 0);
Regs.X.DX = BiosDriveNum;
// set up SI to partition table entry, some boot1 boot code (such a boot1f32 and boot1h) depend on it
@ -1099,7 +1099,7 @@ VOID DumpBiosMemoryMap()
IA32_REGISTER_SET Regs;
UINT8* BiosMap = (UINT8*)(UINTN)0x7C00;
gBS->SetMem (&Regs, sizeof (Regs), 0);
SetMem (&Regs, sizeof (Regs), 0);
addrEnablePaging(0);
Status = gBS->LocateProtocol(&gEfiLegacy8259ProtocolGuid, NULL, (VOID**)&gLegacy8259);

View File

@ -320,7 +320,7 @@ ParseACPIName(CHAR8 *String)
}
// extend by '_' up to 4 symbols
if (j < 4) {
gBS->SetMem(List->Name + j, 4 - j, '_');
SetMem(List->Name + j, 4 - j, '_');
}
List->Name[4] = '\0';
// }

View File

@ -83,8 +83,12 @@ void* lodepng_realloc(void* ptr, size_t new_size)
return new_p+1;
}
#define memcpy(dest,source,count) gBS->CopyMem(dest,source,(UINTN)(count))
#define memset(dest,ch,count) gBS->SetMem(dest,(UINTN)(count),(UINT8)(ch))
//#define memcpy(dest,source,count) gBS->CopyMem(dest,source,(UINTN)(count))
//#define memset(dest,ch,count) gBS->SetMem(dest,(UINTN)(count),(UINT8)(ch))
#define memcpy(dest,source,count) CopyMem(dest,(void*)source,(UINTN)(count))
#define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
//MODSNI ^
@ -2668,7 +2672,8 @@ unsigned lodepng_color_mode_copy(LodePNGColorMode* dest, const LodePNGColorMode*
{
size_t i;
lodepng_color_mode_cleanup(dest);
*dest = *source;
// *dest = *source;
CopyMem(dest, source, sizeof (LodePNGColorMode));
if(source->palette)
{
dest->palette = (unsigned char*)lodepng_malloc(1024);
@ -3023,7 +3028,8 @@ void lodepng_info_cleanup(LodePNGInfo* info)
unsigned lodepng_info_copy(LodePNGInfo* dest, const LodePNGInfo* source)
{
lodepng_info_cleanup(dest);
*dest = *source;
// *dest = *source;
CopyMem(dest, source, sizeof (LodePNGInfo));
lodepng_color_mode_init(&dest->color);
CERROR_TRY_RETURN(lodepng_color_mode_copy(&dest->color, &source->color));
@ -4907,7 +4913,8 @@ void lodepng_state_cleanup(LodePNGState* state)
void lodepng_state_copy(LodePNGState* dest, const LodePNGState* source)
{
lodepng_state_cleanup(dest);
*dest = *source;
// *dest = *source;
CopyMem(dest, source, sizeof (LodePNGState));
lodepng_color_mode_init(&dest->info_raw);
lodepng_info_init(&dest->info_png);
dest->error = lodepng_color_mode_copy(&dest->info_raw, &source->info_raw); if(dest->error) return;

View File

@ -1325,7 +1325,7 @@ static void nsvg__rasterizeSortedEdges(NSVGrasterizer *r,
int xmin, xmax;
for (y = 0; y < r->height; y++) {
gBS->SetMem(r->scanline, r->width, 0);
SetMem(r->scanline, r->width, 0);
xmin = r->width;
xmax = 0;
for (s = 0; s < NSVG__SUBSAMPLES; ++s) {
@ -1516,7 +1516,7 @@ static void nsvg__initPaint(NSVGcachedPaint* cache, NSVGpaint* paint, NSVGshape*
//for (i = 0; i < 256; i++) {
// cache->colors[i] = 0;
//}
gBS->SetMem(cache->colors, sizeof(cache->colors), 0);
SetMem(cache->colors, sizeof(cache->colors), 0);
} else if (grad->nstops == 1) {
for (i = 0; i < 256; i++) {
cache->colors[i] = nsvg__applyOpacity(grad->stops[i].color, opacity);
@ -1677,7 +1677,7 @@ static void renderShape(NSVGrasterizer* r,
NSVGedge *e = NULL;
NSVGcachedPaint cache;
int i;
gBS->SetMem(&cache, sizeof(NSVGcachedPaint), 0);
SetMem(&cache, sizeof(NSVGcachedPaint), 0);
if (shape->fill.type != NSVG_PAINT_NONE) {
nsvg__resetPool(r);
@ -1749,7 +1749,7 @@ void nsvg__rasterizeClipPaths(
} else {
r->stencil = (unsigned char*)ReallocatePool(oldSize, r->stencilSize * clipPathCount, r->stencil);
if (r->stencil == NULL) return;
gBS->SetMem(r->stencil, r->stencilSize * clipPathCount, 0);
SetMem(r->stencil, r->stencilSize * clipPathCount, 0);
}
clipPath = image->clipPaths;