diff --git a/Nt32Pkg/BootModePei/BootModePei.c b/Nt32Pkg/BootModePei/BootModePei.c
deleted file mode 100644
index 6de0774820..0000000000
--- a/Nt32Pkg/BootModePei/BootModePei.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- BootMode.c
-
-Abstract:
-
- Tiano PEIM to provide the platform support functionality within Windows
-
-**/
-
-
-
-//
-// The package level header files this module uses
-//
-#include
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-#include
-//
-// The Library classes this module consumes
-//
-#include
-#include
-
-
-//
-// Module globals
-//
-EFI_PEI_PPI_DESCRIPTOR mPpiListBootMode = {
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gEfiPeiMasterBootModePpiGuid,
- NULL
-};
-
-EFI_PEI_PPI_DESCRIPTOR mPpiListRecoveryBootMode = {
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gEfiPeiBootInRecoveryModePpiGuid,
- NULL
-};
-
-EFI_STATUS
-EFIAPI
-InitializeBootMode (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Peform the boot mode determination logic
-
-Arguments:
-
- FileHandle - Handle of the file being invoked.
- PeiServices - Describes the list of possible PEI Services.
-
-Returns:
-
- Status - EFI_SUCCESS if the boot mode could be set
-
---*/
-{
- EFI_STATUS Status;
- UINTN BootMode;
-
- DEBUG ((EFI_D_ERROR, "NT32 Boot Mode PEIM Loaded\n"));
-
- //
- // Let's assume things are OK if not told otherwise
- // Should we read an environment variable in order to easily change this?
- //
- BootMode = BOOT_WITH_FULL_CONFIGURATION;
-
- Status = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);
- ASSERT_EFI_ERROR (Status);
-
- Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);
- ASSERT_EFI_ERROR (Status);
-
- if (BootMode == BOOT_IN_RECOVERY_MODE) {
- Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);
- ASSERT_EFI_ERROR (Status);
- }
-
- return Status;
-}
diff --git a/Nt32Pkg/BootModePei/BootModePei.inf b/Nt32Pkg/BootModePei/BootModePei.inf
deleted file mode 100644
index 2579b34d5a..0000000000
--- a/Nt32Pkg/BootModePei/BootModePei.inf
+++ /dev/null
@@ -1,45 +0,0 @@
-## @file
-# Component description file for BootMode module
-#
-# This module provides platform specific function to detect boot mode.
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BootMode
- FILE_GUID = B7611005-1F26-45ba-A3DB-01F39DDB2785
- MODULE_TYPE = PEIM
- VERSION_STRING = 1.0
-
- ENTRY_POINT = InitializeBootMode
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- BootModePei.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
-
-
-[LibraryClasses]
- PeimEntryPoint
- DebugLib
-
-
-[Ppis]
- gEfiPeiMasterBootModePpiGuid # PPI ALWAYS_PRODUCED
- gEfiPeiBootInRecoveryModePpiGuid # PPI SOMETIMES_PRODUCED
-
-[depex]
- TRUE
diff --git a/Nt32Pkg/CpuRuntimeDxe/Cpu.c b/Nt32Pkg/CpuRuntimeDxe/Cpu.c
deleted file mode 100644
index 8bf93ae607..0000000000
--- a/Nt32Pkg/CpuRuntimeDxe/Cpu.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- Cpu.c
-
-Abstract:
-
- NT Emulation Architectural Protocol Driver as defined in Tiano.
- This CPU module abstracts the interrupt subsystem of a platform and
- the CPU-specific setjump/long pair. Other services are not implemented
- in this driver.
-
-**/
-
-
-#include "CpuDriver.h"
-
-UINT64 mTimerPeriod;
-
-CPU_ARCH_PROTOCOL_PRIVATE mCpuTemplate = {
- CPU_ARCH_PROT_PRIVATE_SIGNATURE,
- NULL,
- {
- WinNtFlushCpuDataCache,
- WinNtEnableInterrupt,
- WinNtDisableInterrupt,
- WinNtGetInterruptState,
- WinNtInit,
- WinNtRegisterInterruptHandler,
- WinNtGetTimerValue,
- WinNtSetMemoryAttributes,
- 1,
- 4
- },
- {
- CpuMemoryServiceRead,
- CpuMemoryServiceWrite,
- CpuIoServiceRead,
- CpuIoServiceWrite
- },
- 0,
- TRUE
-};
-
-#define EFI_CPU_DATA_MAXIMUM_LENGTH 0x100
-
-
-
-//
-// Service routines for the driver
-//
-EFI_STATUS
-EFIAPI
-WinNtFlushCpuDataCache (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length,
- IN EFI_CPU_FLUSH_TYPE FlushType
- )
-/*++
-
-Routine Description:
-
- This routine would provide support for flushing the CPU data cache.
- In the case of NT emulation environment, this flushing is not necessary and
- is thus not implemented.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
- Start adddress in memory to flush
- Length of memory to flush
- Flush type
-
-Returns:
-
- Status
- EFI_SUCCESS
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: FlushType - add argument and description to function comment
-// TODO: EFI_UNSUPPORTED - add return value to function comment
-{
- if (FlushType == EfiCpuFlushTypeWriteBackInvalidate) {
- //
- // Only WB flush is supported. We actually need do nothing on NT emulator
- // environment. Classify this to follow EFI spec
- //
- return EFI_SUCCESS;
- }
- //
- // Other flush types are not supported by NT emulator
- //
- return EFI_UNSUPPORTED;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtEnableInterrupt (
- IN EFI_CPU_ARCH_PROTOCOL *This
- )
-/*++
-
-Routine Description:
-
- This routine provides support for emulation of the interrupt enable of the
- the system. For our purposes, CPU enable is just a BOOLEAN that the Timer
- Architectural Protocol observes in order to defer behaviour while in its
- emulated interrupt, or timer tick.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
-
-Returns:
-
- Status
- EFI_SUCCESS
-
---*/
-// TODO: This - add argument and description to function comment
-{
- CPU_ARCH_PROTOCOL_PRIVATE *Private;
-
- Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);
- Private->InterruptState = TRUE;
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtDisableInterrupt (
- IN EFI_CPU_ARCH_PROTOCOL *This
- )
-/*++
-
-Routine Description:
-
- This routine provides support for emulation of the interrupt disable of the
- the system. For our purposes, CPU enable is just a BOOLEAN that the Timer
- Architectural Protocol observes in order to defer behaviour while in its
- emulated interrupt, or timer tick.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
-
-Returns:
-
- Status
- EFI_SUCCESS
-
---*/
-// TODO: This - add argument and description to function comment
-{
- CPU_ARCH_PROTOCOL_PRIVATE *Private;
-
- Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);
- Private->InterruptState = FALSE;
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtGetInterruptState (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- OUT BOOLEAN *State
- )
-/*++
-
-Routine Description:
-
- This routine provides support for emulation of the interrupt disable of the
- the system. For our purposes, CPU enable is just a BOOLEAN that the Timer
- Architectural Protocol observes in order to defer behaviour while in its
- emulated interrupt, or timer tick.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
-
-Returns:
-
- Status
- EFI_SUCCESS
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: State - add argument and description to function comment
-// TODO: EFI_INVALID_PARAMETER - add return value to function comment
-{
- CPU_ARCH_PROTOCOL_PRIVATE *Private;
-
- if (State == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);
- *State = Private->InterruptState;
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtInit (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_CPU_INIT_TYPE InitType
- )
-/*++
-
-Routine Description:
-
- This routine would support generation of a CPU INIT. At
- present, this code does not provide emulation.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
- INIT Type
-
-Returns:
-
- Status
- EFI_UNSUPPORTED - not yet implemented
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: InitType - add argument and description to function comment
-{
- return EFI_UNSUPPORTED;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtRegisterInterruptHandler (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_EXCEPTION_TYPE InterruptType,
- IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
- )
-/*++
-
-Routine Description:
-
- This routine would support registration of an interrupt handler. At
- present, this code does not provide emulation.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
- Pointer to interrupt handlers
- Interrupt type
-
-Returns:
-
- Status
- EFI_UNSUPPORTED - not yet implemented
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: InterruptType - add argument and description to function comment
-// TODO: InterruptHandler - add argument and description to function comment
-{
-
- //
- // Do parameter checking for EFI spec conformance
- //
- if (InterruptType < 0 || InterruptType > 0xff) {
- return EFI_UNSUPPORTED;
- }
- //
- // Do nothing for Nt32 emulation
- //
- return EFI_UNSUPPORTED;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtGetTimerValue (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN UINT32 TimerIndex,
- OUT UINT64 *TimerValue,
- OUT UINT64 *TimerPeriod OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine would support querying of an on-CPU timer. At present,
- this code does not provide timer emulation.
-
-Arguments:
-
- This - Pointer to CPU Architectural Protocol interface
- TimerIndex - Index of given CPU timer
- TimerValue - Output of the timer
- TimerPeriod - Output of the timer period
-
-Returns:
-
- EFI_UNSUPPORTED - not yet implemented
- EFI_INVALID_PARAMETER - TimeValue is NULL
-
---*/
-{
- if (TimerValue == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (TimerIndex != 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- gWinNt->QueryPerformanceCounter ((LARGE_INTEGER *)TimerValue);
-
- if (TimerPeriod != NULL) {
- *TimerPeriod = mTimerPeriod;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtSetMemoryAttributes (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN UINT64 Attributes
- )
-/*++
-
-Routine Description:
-
- This routine would support querying of an on-CPU timer. At present,
- this code does not provide timer emulation.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
- Start address of memory region
- The size in bytes of the memory region
- The bit mask of attributes to set for the memory region
-
-Returns:
-
- Status
- EFI_UNSUPPORTED - not yet implemented
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: BaseAddress - add argument and description to function comment
-// TODO: Length - add argument and description to function comment
-// TODO: Attributes - add argument and description to function comment
-// TODO: EFI_INVALID_PARAMETER - add return value to function comment
-{
- //
- // Check for invalid parameter for Spec conformance
- //
- if (Length == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Do nothing for Nt32 emulation
- //
- return EFI_UNSUPPORTED;
-}
-
-
-
-/**
- Logs SMBIOS record.
-
- @param Smbios Pointer to SMBIOS protocol instance.
- @param Buffer Pointer to the data buffer.
-
-**/
-VOID
-LogSmbiosData (
- IN EFI_SMBIOS_PROTOCOL *Smbios,
- IN UINT8 *Buffer
- )
-{
- EFI_STATUS Status;
- EFI_SMBIOS_HANDLE SmbiosHandle;
-
- SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
- Status = Smbios->Add (
- Smbios,
- NULL,
- &SmbiosHandle,
- (EFI_SMBIOS_TABLE_HEADER*)Buffer
- );
- ASSERT_EFI_ERROR (Status);
-}
-
-
-VOID
-CpuUpdateSmbios (
- VOID
- )
-/*++
-
-Routine Description:
- This function will log processor version and frequency data to Smbios.
-
-Arguments:
- Event - Event whose notification function is being invoked.
- Context - Pointer to the notification function's context.
-
-Returns:
- None.
-
---*/
-{
- EFI_STATUS Status;
- UINT32 TotalSize;
- EFI_SMBIOS_PROTOCOL *Smbios;
- EFI_HII_HANDLE HiiHandle;
- STRING_REF Token;
- UINTN CpuVerStrLen;
- EFI_STRING CpuVerStr;
- SMBIOS_TABLE_TYPE4 *SmbiosRecord;
- CHAR8 *OptionalStrStart;
-
- //
- // Locate Smbios protocol.
- //
- Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&Smbios);
-
- if (EFI_ERROR (Status)) {
- return;
- }
-
- //
- // Initialize strings to HII database
- //
- HiiHandle = HiiAddPackages (
- &gEfiCallerIdGuid,
- NULL,
- CpuStrings,
- NULL
- );
- ASSERT (HiiHandle != NULL);
-
- Token = STRING_TOKEN (STR_PROCESSOR_VERSION);
- CpuVerStr = HiiGetPackageString(&gEfiCallerIdGuid, Token, NULL);
- CpuVerStrLen = StrLen(CpuVerStr);
- ASSERT (CpuVerStrLen <= SMBIOS_STRING_MAX_LENGTH);
-
-
- TotalSize = (UINT32)(sizeof(SMBIOS_TABLE_TYPE4) + CpuVerStrLen + 1 + 1);
- SmbiosRecord = AllocatePool(TotalSize);
- ZeroMem(SmbiosRecord, TotalSize);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE4);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- //
- // Processor version is the 1st string.
- //
- SmbiosRecord->ProcessorVersion = 1;
- //
- // Store CPU frequency data record to data hub - It's an emulator so make up a value
- //
- SmbiosRecord->CurrentSpeed = 1234;
-
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- UnicodeStrToAsciiStr(CpuVerStr, OptionalStrStart);
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- LogSmbiosData(Smbios, (UINT8 *) SmbiosRecord);
- FreePool (SmbiosRecord);
-
-}
-
-
-
-EFI_STATUS
-EFIAPI
-InitializeCpu (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Initialize the state information for the CPU Architectural Protocol
-
-Arguments:
-
- ImageHandle of the loaded driver
- Pointer to the System Table
-
-Returns:
-
- Status
-
- EFI_SUCCESS - protocol instance can be published
- EFI_OUT_OF_RESOURCES - cannot allocate protocol data structure
- EFI_DEVICE_ERROR - cannot create the thread
-
---*/
-{
- EFI_STATUS Status;
- UINT64 Frequency;
-
- //
- // Retrieve the frequency of the performance counter in Hz.
- //
- gWinNt->QueryPerformanceFrequency ((LARGE_INTEGER *)&Frequency);
-
- //
- // Convert frequency in Hz to a clock period in femtoseconds.
- //
- mTimerPeriod = DivU64x64Remainder (1000000000000000, Frequency, NULL);
-
- CpuUpdateSmbios ();
-
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mCpuTemplate.Handle,
- &gEfiCpuArchProtocolGuid, &mCpuTemplate.Cpu,
- &gEfiCpuIo2ProtocolGuid, &mCpuTemplate.CpuIo,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
diff --git a/Nt32Pkg/CpuRuntimeDxe/CpuDriver.h b/Nt32Pkg/CpuRuntimeDxe/CpuDriver.h
deleted file mode 100644
index 94f8eb459c..0000000000
--- a/Nt32Pkg/CpuRuntimeDxe/CpuDriver.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- CpuDriver.h
-
-Abstract:
-
- NT Emulation Architectural Protocol Driver as defined in Tiano.
-
-**/
-
-#ifndef _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_
-#define _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-extern UINT8 CpuStrings[];
-
-//
-// Internal Data Structures
-//
-#define CPU_ARCH_PROT_PRIVATE_SIGNATURE SIGNATURE_32 ('c', 'a', 'p', 'd')
-
-typedef struct {
- UINTN Signature;
- EFI_HANDLE Handle;
-
- EFI_CPU_ARCH_PROTOCOL Cpu;
- EFI_CPU_IO2_PROTOCOL CpuIo;
-
- //
- // Local Data for CPU interface goes here
- //
- CRITICAL_SECTION NtCriticalSection;
- BOOLEAN InterruptState;
-
-} CPU_ARCH_PROTOCOL_PRIVATE;
-
-#define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \
- CR (a, \
- CPU_ARCH_PROTOCOL_PRIVATE, \
- Cpu, \
- CPU_ARCH_PROT_PRIVATE_SIGNATURE \
- )
-
-EFI_STATUS
-EFIAPI
-CpuMemoryServiceRead (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- );
-
-EFI_STATUS
-EFIAPI
-CpuMemoryServiceWrite (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- );
-
-EFI_STATUS
-EFIAPI
-CpuIoServiceRead (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 UserAddress,
- IN UINTN Count,
- IN OUT VOID *UserBuffer
- );
-
-EFI_STATUS
-EFIAPI
-CpuIoServiceWrite (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 UserAddress,
- IN UINTN Count,
- IN OUT VOID *UserBuffer
- );
-
-
-EFI_STATUS
-EFIAPI
-InitializeCpu (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-EFI_STATUS
-EFIAPI
-WinNtFlushCpuDataCache (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length,
- IN EFI_CPU_FLUSH_TYPE FlushType
- );
-
-EFI_STATUS
-EFIAPI
-WinNtEnableInterrupt (
- IN EFI_CPU_ARCH_PROTOCOL *This
- );
-
-EFI_STATUS
-EFIAPI
-WinNtDisableInterrupt (
- IN EFI_CPU_ARCH_PROTOCOL *This
- );
-
-EFI_STATUS
-EFIAPI
-WinNtGetInterruptState (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- OUT BOOLEAN *State
- );
-
-EFI_STATUS
-EFIAPI
-WinNtInit (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_CPU_INIT_TYPE InitType
- );
-
-EFI_STATUS
-EFIAPI
-WinNtRegisterInterruptHandler (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_EXCEPTION_TYPE InterruptType,
- IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
- );
-
-EFI_STATUS
-EFIAPI
-WinNtGetTimerValue (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN UINT32 TimerIndex,
- OUT UINT64 *TimerValue,
- OUT UINT64 *TimerPeriod OPTIONAL
- );
-
-EFI_STATUS
-EFIAPI
-WinNtSetMemoryAttributes (
- IN EFI_CPU_ARCH_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN UINT64 Attributes
- );
-
-
-
-
-
-
-#endif
diff --git a/Nt32Pkg/CpuRuntimeDxe/CpuIo.c b/Nt32Pkg/CpuRuntimeDxe/CpuIo.c
deleted file mode 100644
index 4809f9c00d..0000000000
--- a/Nt32Pkg/CpuRuntimeDxe/CpuIo.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- CpuIo.c
-
-Abstract:
-
- This is the code that publishes the CPU I/O Protocol.
- The intent herein is to have a single I/O service that can load
- as early as possible, extend into runtime, and be layered upon by
- the implementations of architectural protocols and the PCI Root
- Bridge I/O Protocol.
-
-**/
-
-#include
-
-#define IA32_MAX_IO_ADDRESS 0xFFFF
-#define IA32_MAX_MEM_ADDRESS 0xFFFFFFFF
-
-EFI_STATUS
-CpuIoCheckAddressRange (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer,
- IN UINT64 Limit
- );
-
-EFI_STATUS
-EFIAPI
-CpuMemoryServiceRead (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Perform the Memory Access Read service for the CPU I/O Protocol
-
-Arguments:
-
- Pointer to an instance of the CPU I/O Protocol
- Width of the Memory Access
- Address of the Memory access
- Count of the number of accesses to perform
- Pointer to the buffer to read or write from memory
-
-Returns:
-
- Status
-
- EFI_SUCCESS - The data was read from or written to the EFI
- System.
- EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
- EFI_INVALID_PARAMETER - Buffer is NULL.
- EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width,
- and Count is not valid for this EFI System.
-
---*/
-// TODO: This - add argument and description to function comment
-{
- EFI_STATUS Status;
-
- if (!Buffer) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Do nothing for Nt32 version
- //
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EFIAPI
-CpuMemoryServiceWrite (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Perform the Memory Access Read service for the CPU I/O Protocol
-
-Arguments:
-
- Pointer to an instance of the CPU I/O Protocol
- Width of the Memory Access
- Address of the Memory access
- Count of the number of accesses to perform
- Pointer to the buffer to read or write from memory
-
-Returns:
-
- Status
-
- EFI_SUCCESS - The data was read from or written to the EFI System.
- EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
- EFI_INVALID_PARAMETER - Buffer is NULL.
- EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width, and
- Count is not valid for this EFI System.
-
---*/
-// TODO: This - add argument and description to function comment
-{
- EFI_STATUS Status;
-
- if (!Buffer) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Do nothing for Nt32 version
- //
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EFIAPI
-CpuIoServiceRead (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 UserAddress,
- IN UINTN Count,
- IN OUT VOID *UserBuffer
- )
-/*++
-
-Routine Description:
-
- This is the service that implements the I/O read
-
-Arguments:
-
- Pointer to an instance of the CPU I/O Protocol
- Width of the Memory Access
- Address of the I/O access
- Count of the number of accesses to perform
- Pointer to the buffer to read or write from I/O space
-
-Returns:
-
- Status
- EFI_SUCCESS - The data was read from or written to the EFI System.
- EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
- EFI_INVALID_PARAMETER - Buffer is NULL.
- EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width, and
- Count is not valid for this EFI System.
---*/
-// TODO: This - add argument and description to function comment
-// TODO: UserAddress - add argument and description to function comment
-// TODO: UserBuffer - add argument and description to function comment
-{
- UINTN Address;
- EFI_STATUS Status;
-
- if (!UserBuffer) {
- return EFI_INVALID_PARAMETER;
- }
-
- Address = (UINTN) UserAddress;
-
- if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = CpuIoCheckAddressRange (Width, Address, Count, UserBuffer, IA32_MAX_IO_ADDRESS);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Do nothing for Nt32 version
- //
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EFIAPI
-CpuIoServiceWrite (
- IN EFI_CPU_IO2_PROTOCOL *This,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 UserAddress,
- IN UINTN Count,
- IN OUT VOID *UserBuffer
- )
-/*++
-
-Routine Description:
-
-
- This is the service that implements the I/O Write
-
-Arguments:
-
- Pointer to an instance of the CPU I/O Protocol
- Width of the Memory Access
- Address of the I/O access
- Count of the number of accesses to perform
- Pointer to the buffer to read or write from I/O space
-
-Returns:
-
- Status
-
- Status
- EFI_SUCCESS - The data was read from or written to the EFI System.
- EFI_INVALID_PARAMETER - Width is invalid for this EFI System.
- EFI_INVALID_PARAMETER - Buffer is NULL.
- EFI_UNSUPPORTED - The Buffer is not aligned for the given Width.
- EFI_UNSUPPORTED - The address range specified by Address, Width, and
- Count is not valid for this EFI System.
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: UserAddress - add argument and description to function comment
-// TODO: UserBuffer - add argument and description to function comment
-{
- UINTN Address;
- EFI_STATUS Status;
-
- if (!UserBuffer) {
- return EFI_INVALID_PARAMETER;
- }
-
- Address = (UINTN) UserAddress;
-
- if ((Width < 0) || (Width >= EfiCpuIoWidthMaximum)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = CpuIoCheckAddressRange (Width, Address, Count, UserBuffer, IA32_MAX_IO_ADDRESS);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Do nothing for Nt32 version
- //
- return EFI_UNSUPPORTED;
-}
-
-
-EFI_STATUS
-CpuIoCheckAddressRange (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer,
- IN UINT64 Limit
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Width - TODO: add argument description
- Address - TODO: add argument description
- Count - TODO: add argument description
- Buffer - TODO: add argument description
- Limit - TODO: add argument description
-
-Returns:
-
- EFI_UNSUPPORTED - TODO: Add description for return value
- EFI_UNSUPPORTED - TODO: Add description for return value
- EFI_UNSUPPORTED - TODO: Add description for return value
- EFI_SUCCESS - TODO: Add description for return value
-
---*/
-{
- UINTN AlignMask;
-
- if (Address > Limit) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // For FiFo type, the target address won't increase during the access, so treat count as 1
- //
- if (Width >= EfiCpuIoWidthFifoUint8 && Width <= EfiCpuIoWidthFifoUint64) {
- Count = 1;
- }
-
- Width = (EFI_CPU_IO_PROTOCOL_WIDTH)(Width & 0x03);
- if (Address - 1 + ((UINTN)1 << Width) * Count > Limit) {
- return EFI_UNSUPPORTED;
- }
-
- AlignMask = ((UINTN)1 << Width) - 1;
- if ((UINTN) Buffer & AlignMask) {
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-
diff --git a/Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf b/Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf
deleted file mode 100644
index c55b628031..0000000000
--- a/Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file
-# Component description file for Cpu module.
-#
-# This CPU module abstracts the interrupt subsystem of a platform and the CPU-specific setjump-long pair.
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = Cpu
- FILE_GUID = ee993080-5197-4d4e-b63c-f1f7413e33ce
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = InitializeCpu
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- CpuIo.c
- Cpu.c
- CpuDriver.h
- Strings.uni
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- Nt32Pkg/Nt32Pkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- MemoryAllocationLib
- BaseMemoryLib
- UefiDriverEntryPoint
- DebugLib
- HiiLib
- WinNtLib
-
-[Protocols]
- gEfiWinNtIoProtocolGuid # PROTOCOL_NOTIFY SOMETIMES_CONSUMED
- gEfiSmbiosProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
- gEfiWinNtIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiCpuIo2ProtocolGuid # PROTOCOL ALWAYS_PRODUCED
- gEfiCpuArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
-
-[Depex]
- gEfiSmbiosProtocolGuid
diff --git a/Nt32Pkg/CpuRuntimeDxe/Strings.uni b/Nt32Pkg/CpuRuntimeDxe/Strings.uni
deleted file mode 100644
index 0b3a6120da..0000000000
--- a/Nt32Pkg/CpuRuntimeDxe/Strings.uni
+++ /dev/null
@@ -1,24 +0,0 @@
-// *++
-//
-// Copyright (c) 2006, Intel Corporation. All rights reserved.
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// Module Name:
-//
-// Strings.uni
-//
-// Abstract:
-//
-// String definition
-// Revision History:
-//
-// --*/
-
-/=#
-
-#langdef en-US "English"
-#langdef fr-FR "Français"
-
-
-#string STR_PROCESSOR_VERSION #language en-US "NT32 Emulated Processor"
- #language fr-FR "Processeur Émulé par NT32"
\ No newline at end of file
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c b/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c
deleted file mode 100644
index 4af535d925..0000000000
--- a/Nt32Pkg/FvbServicesRuntimeDxe/FWBlockService.c
+++ /dev/null
@@ -1,1372 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- FWBlockService.c
-
-Abstract:
-
-Revision History
-
-**/
-
-//
-// The package level header files this module uses
-//
-#include
-#include
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-#include
-#include
-//
-// The Library classes this module consumes
-//
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "FWBlockService.h"
-
-#define EFI_FVB2_STATUS (EFI_FVB2_READ_STATUS | EFI_FVB2_WRITE_STATUS | EFI_FVB2_LOCK_STATUS)
-
-ESAL_FWB_GLOBAL *mFvbModuleGlobal;
-
-FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate = {
- {
- {
- HARDWARE_DEVICE_PATH,
- HW_MEMMAP_DP,
- {
- (UINT8)(sizeof (MEMMAP_DEVICE_PATH)),
- (UINT8)(sizeof (MEMMAP_DEVICE_PATH) >> 8)
- }
- },
- EfiMemoryMappedIO,
- (EFI_PHYSICAL_ADDRESS) 0,
- (EFI_PHYSICAL_ADDRESS) 0,
- },
- {
- END_DEVICE_PATH_TYPE,
- END_ENTIRE_DEVICE_PATH_SUBTYPE,
- {
- END_DEVICE_PATH_LENGTH,
- 0
- }
- }
-};
-
-FV_PIWG_DEVICE_PATH mFvPIWGDevicePathTemplate = {
- {
- {
- MEDIA_DEVICE_PATH,
- MEDIA_PIWG_FW_VOL_DP,
- {
- (UINT8)(sizeof (MEDIA_FW_VOL_DEVICE_PATH)),
- (UINT8)(sizeof (MEDIA_FW_VOL_DEVICE_PATH) >> 8)
- }
- },
- { 0 }
- },
- {
- END_DEVICE_PATH_TYPE,
- END_ENTIRE_DEVICE_PATH_SUBTYPE,
- {
- END_DEVICE_PATH_LENGTH,
- 0
- }
- }
-};
-
-EFI_FW_VOL_BLOCK_DEVICE mFvbDeviceTemplate = {
- FVB_DEVICE_SIGNATURE,
- NULL,
- 0,
- {
- FvbProtocolGetAttributes,
- FvbProtocolSetAttributes,
- FvbProtocolGetPhysicalAddress,
- FvbProtocolGetBlockSize,
- FvbProtocolRead,
- FvbProtocolWrite,
- FvbProtocolEraseBlocks,
- NULL
- }
-};
-
-
-
-VOID
-EFIAPI
-FvbVirtualddressChangeEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Fixup internal data so that EFI and SAL can be call in virtual mode.
- Call the passed in Child Notify event and convert the mFvbModuleGlobal
- date items to there virtual address.
-
- mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] - Physical copy of instance data
- mFvbModuleGlobal->FvInstance[FVB_VIRTUAL] - Virtual pointer to common
- instance data.
-
-Arguments:
-
- (Standard EFI notify event - EFI_EVENT_NOTIFY)
-
-Returns:
-
- None
-
---*/
-{
- EFI_FW_VOL_INSTANCE *FwhInstance;
- UINTN Index;
-
- EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal->FvInstance[FVB_VIRTUAL]);
-
- //
- // Convert the base address of all the instances
- //
- Index = 0;
- FwhInstance = mFvbModuleGlobal->FvInstance[FVB_PHYSICAL];
- while (Index < mFvbModuleGlobal->NumFv) {
- EfiConvertPointer (0x0, (VOID **) &FwhInstance->FvBase[FVB_VIRTUAL]);
- FwhInstance = (EFI_FW_VOL_INSTANCE *)
- (
- (UINTN) ((UINT8 *) FwhInstance) + FwhInstance->VolumeHeader.HeaderLength +
- (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))
- );
- Index++;
- }
-
- EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL]);
- EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal);
-}
-
-EFI_STATUS
-GetFvbInstance (
- IN UINTN Instance,
- IN ESAL_FWB_GLOBAL *Global,
- OUT EFI_FW_VOL_INSTANCE **FwhInstance,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Retrieves the physical address of a memory mapped FV
-
-Arguments:
- Instance - The FV instance whose base address is going to be
- returned
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- FwhInstance - The EFI_FW_VOL_INSTANCE fimrware instance structure
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - Successfully returns
- EFI_INVALID_PARAMETER - Instance not found
-
---*/
-{
- EFI_FW_VOL_INSTANCE *FwhRecord;
-
- if (Instance >= Global->NumFv) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Find the right instance of the FVB private data
- //
- FwhRecord = Global->FvInstance[Virtual];
- while (Instance > 0) {
- FwhRecord = (EFI_FW_VOL_INSTANCE *)
- (
- (UINTN) ((UINT8 *) FwhRecord) + FwhRecord->VolumeHeader.HeaderLength +
- (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))
- );
- Instance--;
- }
-
- *FwhInstance = FwhRecord;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FvbGetPhysicalAddress (
- IN UINTN Instance,
- OUT EFI_PHYSICAL_ADDRESS *Address,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Retrieves the physical address of a memory mapped FV
-
-Arguments:
- Instance - The FV instance whose base address is going to be
- returned
- Address - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
- that on successful return, contains the base address
- of the firmware volume.
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - Successfully returns
- EFI_INVALID_PARAMETER - Instance not found
-
---*/
-{
- EFI_FW_VOL_INSTANCE *FwhInstance;
- EFI_STATUS Status;
-
- //
- // Find the right instance of the FVB private data
- //
- Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);
- ASSERT_EFI_ERROR (Status);
- *Address = FwhInstance->FvBase[Virtual];
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FvbGetVolumeAttributes (
- IN UINTN Instance,
- OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Retrieves attributes, insures positive polarity of attribute bits, returns
- resulting attributes in output parameter
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- returned
- Attributes - Output buffer which contains attributes
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - Successfully returns
- EFI_INVALID_PARAMETER - Instance not found
-
---*/
-{
- EFI_FW_VOL_INSTANCE *FwhInstance;
- EFI_STATUS Status;
-
- //
- // Find the right instance of the FVB private data
- //
- Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);
- ASSERT_EFI_ERROR (Status);
- *Attributes = FwhInstance->VolumeHeader.Attributes;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FvbGetLbaAddress (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- OUT UINTN *LbaAddress,
- OUT UINTN *LbaLength,
- OUT UINTN *NumOfBlocks,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Retrieves the starting address of an LBA in an FV
-
-Arguments:
- Instance - The FV instance which the Lba belongs to
- Lba - The logical block address
- LbaAddress - On output, contains the physical starting address
- of the Lba
- LbaLength - On output, contains the length of the block
- NumOfBlocks - A pointer to a caller allocated UINTN in which the
- number of consecutive blocks starting with Lba is
- returned. All blocks in this range have a size of
- BlockSize
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - Successfully returns
- EFI_INVALID_PARAMETER - Instance not found
-
---*/
-{
- UINT32 NumBlocks;
- UINT32 BlockLength;
- UINTN Offset;
- EFI_LBA StartLba;
- EFI_LBA NextLba;
- EFI_FW_VOL_INSTANCE *FwhInstance;
- EFI_FV_BLOCK_MAP_ENTRY *BlockMap;
- EFI_STATUS Status;
-
- //
- // Find the right instance of the FVB private data
- //
- Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);
- ASSERT_EFI_ERROR (Status);
-
- StartLba = 0;
- Offset = 0;
- BlockMap = &(FwhInstance->VolumeHeader.BlockMap[0]);
-
- //
- // Parse the blockmap of the FV to find which map entry the Lba belongs to
- //
- while (TRUE) {
- NumBlocks = BlockMap->NumBlocks;
- BlockLength = BlockMap->Length;
-
- if (NumBlocks == 0 || BlockLength == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- NextLba = StartLba + NumBlocks;
-
- //
- // The map entry found
- //
- if (Lba >= StartLba && Lba < NextLba) {
- Offset = Offset + (UINTN) MultU64x32 ((Lba - StartLba), BlockLength);
- if (LbaAddress != NULL) {
- *LbaAddress = FwhInstance->FvBase[Virtual] + Offset;
- }
-
- if (LbaLength != NULL) {
- *LbaLength = BlockLength;
- }
-
- if (NumOfBlocks != NULL) {
- *NumOfBlocks = (UINTN) (NextLba - Lba);
- }
-
- return EFI_SUCCESS;
- }
-
- StartLba = NextLba;
- Offset = Offset + NumBlocks * BlockLength;
- BlockMap++;
- }
-}
-
-EFI_STATUS
-FvbReadBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN BlockOffset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Reads specified number of bytes into a buffer from the specified block
-
-Arguments:
- Instance - The FV instance to be read from
- Lba - The logical block address to be read from
- BlockOffset - Offset into the block at which to begin reading
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes read
- Buffer - Pointer to a caller allocated buffer that will be
- used to hold the data read
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - The firmware volume was read successfully and
- contents are in Buffer
- EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,
- NumBytes contains the total number of bytes returned
- in Buffer
- EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state
- EFI_DEVICE_ERROR - The block device is not functioning correctly and
- could not be read
- EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL
-
---*/
-{
- EFI_FVB_ATTRIBUTES_2 Attributes;
- UINTN LbaAddress;
- UINTN LbaLength;
- EFI_STATUS Status;
-
- //
- // Check for invalid conditions
- //
- if ((NumBytes == NULL) || (Buffer == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (*NumBytes == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // Check if the FV is read enabled
- //
- FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);
-
- if ((Attributes & EFI_FVB2_READ_STATUS) == 0) {
- return EFI_ACCESS_DENIED;
- }
- //
- // Perform boundary checks and adjust NumBytes
- //
- if (BlockOffset > LbaLength) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (LbaLength < (*NumBytes + BlockOffset)) {
- *NumBytes = (UINT32) (LbaLength - BlockOffset);
- Status = EFI_BAD_BUFFER_SIZE;
- }
-
- CopyMem (Buffer, (UINT8 *) (LbaAddress + BlockOffset), (UINTN) (*NumBytes));
-
- return Status;
-}
-
-EFI_STATUS
-FvbWriteBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN BlockOffset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Writes specified number of bytes from the input buffer to the block
-
-Arguments:
- Instance - The FV instance to be written to
- Lba - The starting logical block index to write to
- BlockOffset - Offset into the block at which to begin writing
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes actually written
- Buffer - Pointer to a caller allocated buffer that contains
- the source for the write
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - The firmware volume was written successfully
- EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,
- NumBytes contains the total number of bytes
- actually written
- EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
- EFI_DEVICE_ERROR - The block device is not functioning correctly and
- could not be written
- EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL
-
---*/
-{
- EFI_FVB_ATTRIBUTES_2 Attributes;
- UINTN LbaAddress;
- UINTN LbaLength;
- EFI_STATUS Status;
-
- //
- // Check for invalid conditions
- //
- if ((NumBytes == NULL) || (Buffer == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (*NumBytes == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // Check if the FV is write enabled
- //
- FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);
-
- if ((Attributes & EFI_FVB2_WRITE_STATUS) == 0) {
- return EFI_ACCESS_DENIED;
- }
- //
- // Perform boundary checks and adjust NumBytes
- //
- if (BlockOffset > LbaLength) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (LbaLength < (*NumBytes + BlockOffset)) {
- *NumBytes = (UINT32) (LbaLength - BlockOffset);
- Status = EFI_BAD_BUFFER_SIZE;
- }
- //
- // Write data
- //
- CopyMem ((UINT8 *) (LbaAddress + BlockOffset), Buffer, (UINTN) (*NumBytes));
-
- return Status;
-}
-
-EFI_STATUS
-FvbEraseBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Erases and initializes a firmware volume block
-
-Arguments:
- Instance - The FV instance to be erased
- Lba - The logical block index to be erased
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - The erase request was successfully completed
- EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
- EFI_DEVICE_ERROR - The block device is not functioning correctly and
- could not be written. Firmware device may have been
- partially erased
- EFI_INVALID_PARAMETER - Instance not found
-
---*/
-{
-
- EFI_FVB_ATTRIBUTES_2 Attributes;
- UINTN LbaAddress;
- UINTN LbaLength;
- EFI_STATUS Status;
- UINT8 Data;
-
- //
- // Check if the FV is write enabled
- //
- FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);
-
- if ((Attributes & EFI_FVB2_WRITE_STATUS) == 0) {
- return EFI_ACCESS_DENIED;
- }
- //
- // Get the starting address of the block for erase.
- //
- Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if ((Attributes & EFI_FVB2_ERASE_POLARITY) != 0) {
- Data = 0xFF;
- } else {
- Data = 0x0;
- }
-
- SetMem ((UINT8 *) LbaAddress, LbaLength, Data);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-FvbSetVolumeAttributes (
- IN UINTN Instance,
- IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Modifies the current settings of the firmware volume according to the
- input parameter, and returns the new setting of the volume
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- modified
- Attributes - On input, it is a pointer to EFI_FVB_ATTRIBUTES_2
- containing the desired firmware volume settings.
- On successful return, it contains the new settings
- of the firmware volume
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - Successfully returns
- EFI_ACCESS_DENIED - The volume setting is locked and cannot be modified
- EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are
- in conflict with the capabilities as declared in the
- firmware volume header
-
---*/
-{
- EFI_FW_VOL_INSTANCE *FwhInstance;
- EFI_FVB_ATTRIBUTES_2 OldAttributes;
- EFI_FVB_ATTRIBUTES_2 *AttribPtr;
- UINT32 Capabilities;
- UINT32 OldStatus;
- UINT32 NewStatus;
- EFI_STATUS Status;
- EFI_FVB_ATTRIBUTES_2 UnchangedAttributes;
-
- //
- // Find the right instance of the FVB private data
- //
- Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);
- ASSERT_EFI_ERROR (Status);
-
- AttribPtr = (EFI_FVB_ATTRIBUTES_2 *) &(FwhInstance->VolumeHeader.Attributes);
- OldAttributes = *AttribPtr;
- Capabilities = OldAttributes & (EFI_FVB2_READ_DISABLED_CAP | \
- EFI_FVB2_READ_ENABLED_CAP | \
- EFI_FVB2_WRITE_DISABLED_CAP | \
- EFI_FVB2_WRITE_ENABLED_CAP | \
- EFI_FVB2_LOCK_CAP \
- );
- OldStatus = OldAttributes & EFI_FVB2_STATUS;
- NewStatus = *Attributes & EFI_FVB2_STATUS;
-
- UnchangedAttributes = EFI_FVB2_READ_DISABLED_CAP | \
- EFI_FVB2_READ_ENABLED_CAP | \
- EFI_FVB2_WRITE_DISABLED_CAP | \
- EFI_FVB2_WRITE_ENABLED_CAP | \
- EFI_FVB2_LOCK_CAP | \
- EFI_FVB2_STICKY_WRITE | \
- EFI_FVB2_MEMORY_MAPPED | \
- EFI_FVB2_ERASE_POLARITY | \
- EFI_FVB2_READ_LOCK_CAP | \
- EFI_FVB2_WRITE_LOCK_CAP | \
- EFI_FVB2_ALIGNMENT;
-
- //
- // Some attributes of FV is read only can *not* be set
- //
- if ((OldAttributes & UnchangedAttributes) ^ (*Attributes & UnchangedAttributes)) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // If firmware volume is locked, no status bit can be updated
- //
- if (OldAttributes & EFI_FVB2_LOCK_STATUS) {
- if (OldStatus ^ NewStatus) {
- return EFI_ACCESS_DENIED;
- }
- }
- //
- // Test read disable
- //
- if ((Capabilities & EFI_FVB2_READ_DISABLED_CAP) == 0) {
- if ((NewStatus & EFI_FVB2_READ_STATUS) == 0) {
- return EFI_INVALID_PARAMETER;
- }
- }
- //
- // Test read enable
- //
- if ((Capabilities & EFI_FVB2_READ_ENABLED_CAP) == 0) {
- if (NewStatus & EFI_FVB2_READ_STATUS) {
- return EFI_INVALID_PARAMETER;
- }
- }
- //
- // Test write disable
- //
- if ((Capabilities & EFI_FVB2_WRITE_DISABLED_CAP) == 0) {
- if ((NewStatus & EFI_FVB2_WRITE_STATUS) == 0) {
- return EFI_INVALID_PARAMETER;
- }
- }
- //
- // Test write enable
- //
- if ((Capabilities & EFI_FVB2_WRITE_ENABLED_CAP) == 0) {
- if (NewStatus & EFI_FVB2_WRITE_STATUS) {
- return EFI_INVALID_PARAMETER;
- }
- }
- //
- // Test lock
- //
- if ((Capabilities & EFI_FVB2_LOCK_CAP) == 0) {
- if (NewStatus & EFI_FVB2_LOCK_STATUS) {
- return EFI_INVALID_PARAMETER;
- }
- }
-
- *AttribPtr = (*AttribPtr) & (0xFFFFFFFF & (~EFI_FVB2_STATUS));
- *AttribPtr = (*AttribPtr) | NewStatus;
- *Attributes = *AttribPtr;
-
- return EFI_SUCCESS;
-}
-//
-// FVB protocol APIs
-//
-EFI_STATUS
-EFIAPI
-FvbProtocolGetPhysicalAddress (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- OUT EFI_PHYSICAL_ADDRESS *Address
- )
-/*++
-
-Routine Description:
-
- Retrieves the physical address of the device.
-
-Arguments:
-
- This - Calling context
- Address - Output buffer containing the address.
-
-Returns:
-
-Returns:
- EFI_SUCCESS - Successfully returns
-
---*/
-{
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
-
- FvbDevice = FVB_DEVICE_FROM_THIS (This);
-
- return FvbGetPhysicalAddress (FvbDevice->Instance, Address, mFvbModuleGlobal, EfiGoneVirtual ());
-}
-
-EFI_STATUS
-EFIAPI
-FvbProtocolGetBlockSize (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN CONST EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumOfBlocks
- )
-/*++
-
-Routine Description:
- Retrieve the size of a logical block
-
-Arguments:
- This - Calling context
- Lba - Indicates which block to return the size for.
- BlockSize - A pointer to a caller allocated UINTN in which
- the size of the block is returned
- NumOfBlocks - a pointer to a caller allocated UINTN in which the
- number of consecutive blocks starting with Lba is
- returned. All blocks in this range have a size of
- BlockSize
-
-Returns:
- EFI_SUCCESS - The firmware volume was read successfully and
- contents are in Buffer
-
---*/
-{
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
-
- FvbDevice = FVB_DEVICE_FROM_THIS (This);
-
- return FvbGetLbaAddress (
- FvbDevice->Instance,
- Lba,
- NULL,
- BlockSize,
- NumOfBlocks,
- mFvbModuleGlobal,
- EfiGoneVirtual ()
- );
-}
-
-EFI_STATUS
-EFIAPI
-FvbProtocolGetAttributes (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- OUT EFI_FVB_ATTRIBUTES_2 *Attributes
- )
-/*++
-
-Routine Description:
- Retrieves Volume attributes. No polarity translations are done.
-
-Arguments:
- This - Calling context
- Attributes - output buffer which contains attributes
-
-Returns:
- EFI_SUCCESS - Successfully returns
-
---*/
-{
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
-
- FvbDevice = FVB_DEVICE_FROM_THIS (This);
-
- return FvbGetVolumeAttributes (FvbDevice->Instance, Attributes, mFvbModuleGlobal, EfiGoneVirtual ());
-}
-
-EFI_STATUS
-EFIAPI
-FvbProtocolSetAttributes (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
- )
-/*++
-
-Routine Description:
- Sets Volume attributes. No polarity translations are done.
-
-Arguments:
- This - Calling context
- Attributes - output buffer which contains attributes
-
-Returns:
- EFI_SUCCESS - Successfully returns
-
---*/
-{
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
-
- FvbDevice = FVB_DEVICE_FROM_THIS (This);
-
- return FvbSetVolumeAttributes (FvbDevice->Instance, Attributes, mFvbModuleGlobal, EfiGoneVirtual ());
-}
-
-EFI_STATUS
-EFIAPI
-FvbProtocolEraseBlocks (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- ...
- )
-/*++
-
-Routine Description:
-
- The EraseBlock() function erases one or more blocks as denoted by the
- variable argument list. The entire parameter list of blocks must be verified
- prior to erasing any blocks. If a block is requested that does not exist
- within the associated firmware volume (it has a larger index than the last
- block of the firmware volume), the EraseBlock() function must return
- EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
-
-Arguments:
- This - Calling context
- ... - Starting LBA followed by Number of Lba to erase.
- a -1 to terminate the list.
-
-Returns:
- EFI_SUCCESS - The erase request was successfully completed
- EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
- EFI_DEVICE_ERROR - The block device is not functioning correctly and
- could not be written. Firmware device may have been
- partially erased
-
---*/
-{
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
- EFI_FW_VOL_INSTANCE *FwhInstance;
- UINTN NumOfBlocks;
- VA_LIST args;
- EFI_LBA StartingLba;
- UINTN NumOfLba;
- EFI_STATUS Status;
-
- FvbDevice = FVB_DEVICE_FROM_THIS (This);
-
- Status = GetFvbInstance (FvbDevice->Instance, mFvbModuleGlobal, &FwhInstance, EfiGoneVirtual ());
- ASSERT_EFI_ERROR (Status);
-
- NumOfBlocks = FwhInstance->NumOfBlocks;
-
- VA_START (args, This);
-
- do {
- StartingLba = VA_ARG (args, EFI_LBA);
- if (StartingLba == EFI_LBA_LIST_TERMINATOR) {
- break;
- }
-
- NumOfLba = VA_ARG (args, UINTN);
-
- //
- // Check input parameters
- //
- if ((NumOfLba == 0) || ((StartingLba + NumOfLba) > NumOfBlocks)) {
- VA_END (args);
- return EFI_INVALID_PARAMETER;
- }
- } while (1);
-
- VA_END (args);
-
- VA_START (args, This);
- do {
- StartingLba = VA_ARG (args, EFI_LBA);
- if (StartingLba == EFI_LBA_LIST_TERMINATOR) {
- break;
- }
-
- NumOfLba = VA_ARG (args, UINTN);
-
- while (NumOfLba > 0) {
- Status = FvbEraseBlock (FvbDevice->Instance, StartingLba, mFvbModuleGlobal, EfiGoneVirtual ());
- if (EFI_ERROR (Status)) {
- VA_END (args);
- return Status;
- }
-
- StartingLba++;
- NumOfLba--;
- }
-
- } while (1);
-
- VA_END (args);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-FvbProtocolWrite (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
-
- Writes data beginning at Lba:Offset from FV. The write terminates either
- when *NumBytes of data have been written, or when a block boundary is
- reached. *NumBytes is updated to reflect the actual number of bytes
- written. The write opertion does not include erase. This routine will
- attempt to write only the specified bytes. If the writes do not stick,
- it will return an error.
-
-Arguments:
- This - Calling context
- Lba - Block in which to begin write
- Offset - Offset in the block at which to begin write
- NumBytes - On input, indicates the requested write size. On
- output, indicates the actual number of bytes written
- Buffer - Buffer containing source data for the write.
-
-Returns:
- EFI_SUCCESS - The firmware volume was written successfully
- EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,
- NumBytes contains the total number of bytes
- actually written
- EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
- EFI_DEVICE_ERROR - The block device is not functioning correctly and
- could not be written
- EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL
-
---*/
-{
-
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
-
- FvbDevice = FVB_DEVICE_FROM_THIS (This);
-
- return FvbWriteBlock (FvbDevice->Instance, (EFI_LBA)Lba, (UINTN)Offset, NumBytes, (UINT8 *)Buffer, mFvbModuleGlobal, EfiGoneVirtual ());
-}
-
-EFI_STATUS
-EFIAPI
-FvbProtocolRead (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN CONST EFI_LBA Lba,
- IN CONST UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
-
- Reads data beginning at Lba:Offset from FV. The Read terminates either
- when *NumBytes of data have been read, or when a block boundary is
- reached. *NumBytes is updated to reflect the actual number of bytes
- written. The write opertion does not include erase. This routine will
- attempt to write only the specified bytes. If the writes do not stick,
- it will return an error.
-
-Arguments:
- This - Calling context
- Lba - Block in which to begin Read
- Offset - Offset in the block at which to begin Read
- NumBytes - On input, indicates the requested write size. On
- output, indicates the actual number of bytes Read
- Buffer - Buffer containing source data for the Read.
-
-Returns:
- EFI_SUCCESS - The firmware volume was read successfully and
- contents are in Buffer
- EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,
- NumBytes contains the total number of bytes returned
- in Buffer
- EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state
- EFI_DEVICE_ERROR - The block device is not functioning correctly and
- could not be read
- EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL
-
---*/
-{
-
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
-
- FvbDevice = FVB_DEVICE_FROM_THIS (This);
-
- return FvbReadBlock (FvbDevice->Instance, Lba, Offset, NumBytes, Buffer, mFvbModuleGlobal, EfiGoneVirtual ());
-}
-
-EFI_STATUS
-ValidateFvHeader (
- EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader
- )
-/*++
-
-Routine Description:
- Check the integrity of firmware volume header
-
-Arguments:
- FwVolHeader - A pointer to a firmware volume header
-
-Returns:
- EFI_SUCCESS - The firmware volume is consistent
- EFI_NOT_FOUND - The firmware volume has corrupted. So it is not an FV
-
---*/
-{
- //
- // Verify the header revision, header signature, length
- // Length of FvBlock cannot be 2**64-1
- // HeaderLength cannot be an odd number
- //
- if ((FwVolHeader->Revision != EFI_FVH_REVISION) ||
- (FwVolHeader->Signature != EFI_FVH_SIGNATURE) ||
- (FwVolHeader->FvLength == ((UINTN) -1)) ||
- ((FwVolHeader->HeaderLength & 0x01) != 0)
- ) {
- return EFI_NOT_FOUND;
- }
-
- //
- // Verify the header checksum
- //
- if (CalculateCheckSum16 ((UINT16 *) FwVolHeader, FwVolHeader->HeaderLength) != 0) {
- return EFI_NOT_FOUND;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-FvbInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
- This function does common initialization for FVB services
-
-Arguments:
-
-Returns:
-
---*/
-{
- EFI_STATUS Status;
- EFI_FW_VOL_INSTANCE *FwhInstance;
- EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;
- EFI_DXE_SERVICES *DxeServices;
- EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor;
- UINT32 BufferSize;
- EFI_FV_BLOCK_MAP_ENTRY *PtrBlockMapEntry;
- EFI_HANDLE FwbHandle;
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
- EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *OldFwbInterface;
- UINT32 MaxLbaSize;
- EFI_PHYSICAL_ADDRESS BaseAddress;
- UINT64 Length;
- UINTN NumOfBlocks;
- EFI_PEI_HOB_POINTERS FvHob;
-
- //
- // Get the DXE services table
- //
- DxeServices = gDS;
-
- //
- // Allocate runtime services data for global variable, which contains
- // the private data of all firmware volume block instances
- //
- mFvbModuleGlobal = AllocateRuntimePool (sizeof (ESAL_FWB_GLOBAL));
- ASSERT (mFvbModuleGlobal != NULL);
-
- //
- // Calculate the total size for all firmware volume block instances
- //
- BufferSize = 0;
-
- FvHob.Raw = GetHobList ();
- while ((FvHob.Raw = GetNextHob (EFI_HOB_TYPE_FV, FvHob.Raw)) != NULL) {
- BaseAddress = FvHob.FirmwareVolume->BaseAddress;
- Length = FvHob.FirmwareVolume->Length;
- //
- // Check if it is a "real" flash
- //
- Status = DxeServices->GetMemorySpaceDescriptor (
- BaseAddress,
- &Descriptor
- );
- if (EFI_ERROR (Status)) {
- break;
- }
-
- if (Descriptor.GcdMemoryType != EfiGcdMemoryTypeMemoryMappedIo) {
- FvHob.Raw = GET_NEXT_HOB (FvHob);
- continue;
- }
-
- FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
- Status = ValidateFvHeader (FwVolHeader);
- if (EFI_ERROR (Status)) {
- //
- // Get FvbInfo
- //
- Status = GetFvbInfo (Length, &FwVolHeader);
- if (EFI_ERROR (Status)) {
- FvHob.Raw = GET_NEXT_HOB (FvHob);
- continue;
- }
- }
-
- BufferSize += (sizeof (EFI_FW_VOL_INSTANCE) + FwVolHeader->HeaderLength - sizeof (EFI_FIRMWARE_VOLUME_HEADER));
- FvHob.Raw = GET_NEXT_HOB (FvHob);
- }
-
- //
- // Only need to allocate once. There is only one copy of physical memory for
- // the private data of each FV instance. But in virtual mode or in physical
- // mode, the address of the the physical memory may be different.
- //
- mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] = AllocateRuntimePool (BufferSize);
- ASSERT (mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] != NULL);
-
- //
- // Make a virtual copy of the FvInstance pointer.
- //
- FwhInstance = mFvbModuleGlobal->FvInstance[FVB_PHYSICAL];
- mFvbModuleGlobal->FvInstance[FVB_VIRTUAL] = FwhInstance;
-
- mFvbModuleGlobal->NumFv = 0;
- MaxLbaSize = 0;
-
- FvHob.Raw = GetHobList ();
- while (NULL != (FvHob.Raw = GetNextHob (EFI_HOB_TYPE_FV, FvHob.Raw))) {
- BaseAddress = FvHob.FirmwareVolume->BaseAddress;
- Length = FvHob.FirmwareVolume->Length;
- //
- // Check if it is a "real" flash
- //
- Status = DxeServices->GetMemorySpaceDescriptor (
- BaseAddress,
- &Descriptor
- );
- if (EFI_ERROR (Status)) {
- break;
- }
-
- if (Descriptor.GcdMemoryType != EfiGcdMemoryTypeMemoryMappedIo) {
- FvHob.Raw = GET_NEXT_HOB (FvHob);
- continue;
- }
-
- FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
- Status = ValidateFvHeader (FwVolHeader);
- if (EFI_ERROR (Status)) {
- //
- // Get FvbInfo to provide in FwhInstance.
- //
- Status = GetFvbInfo (Length, &FwVolHeader);
- if (EFI_ERROR (Status)) {
- FvHob.Raw = GET_NEXT_HOB (FvHob);
- continue;
- }
- //
- // Write healthy FV header back.
- //
- CopyMem (
- (VOID *) (UINTN) BaseAddress,
- (VOID *) FwVolHeader,
- FwVolHeader->HeaderLength
- );
- }
-
- FwhInstance->FvBase[FVB_PHYSICAL] = (UINTN) BaseAddress;
- FwhInstance->FvBase[FVB_VIRTUAL] = (UINTN) BaseAddress;
-
- CopyMem ((UINTN *) &(FwhInstance->VolumeHeader), (UINTN *) FwVolHeader, FwVolHeader->HeaderLength);
- FwVolHeader = &(FwhInstance->VolumeHeader);
- EfiInitializeLock (&(FwhInstance->FvbDevLock), TPL_HIGH_LEVEL);
-
- NumOfBlocks = 0;
-
- for (PtrBlockMapEntry = FwVolHeader->BlockMap; PtrBlockMapEntry->NumBlocks != 0; PtrBlockMapEntry++) {
- //
- // Get the maximum size of a block.
- //
- if (MaxLbaSize < PtrBlockMapEntry->Length) {
- MaxLbaSize = PtrBlockMapEntry->Length;
- }
-
- NumOfBlocks = NumOfBlocks + PtrBlockMapEntry->NumBlocks;
- }
- //
- // The total number of blocks in the FV.
- //
- FwhInstance->NumOfBlocks = NumOfBlocks;
-
- //
- // Add a FVB Protocol Instance
- //
- FvbDevice = AllocateRuntimePool (sizeof (EFI_FW_VOL_BLOCK_DEVICE));
- ASSERT (FvbDevice != NULL);
-
- CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE));
-
- FvbDevice->Instance = mFvbModuleGlobal->NumFv;
- mFvbModuleGlobal->NumFv++;
-
-
- //
- // Set up the devicepath
- //
- if (FwVolHeader->ExtHeaderOffset == 0) {
- //
- // FV does not contains extension header, then produce MEMMAP_DEVICE_PATH
- //
- FvbDevice->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
- ((FV_MEMMAP_DEVICE_PATH *) FvbDevice->DevicePath)->MemMapDevPath.StartingAddress = BaseAddress;
- ((FV_MEMMAP_DEVICE_PATH *) FvbDevice->DevicePath)->MemMapDevPath.EndingAddress = BaseAddress + FwVolHeader->FvLength - 1;
- } else {
- FvbDevice->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
- CopyGuid (
- &((FV_PIWG_DEVICE_PATH *)FvbDevice->DevicePath)->FvDevPath.FvName,
- (GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)
- );
- }
- //
- // Find a handle with a matching device path that has supports FW Block protocol
- //
- Status = gBS->LocateDevicePath (&gEfiFirmwareVolumeBlockProtocolGuid, &FvbDevice->DevicePath, &FwbHandle);
- if (EFI_ERROR (Status)) {
- //
- // LocateDevicePath fails so install a new interface and device path
- //
- FwbHandle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
- &FwbHandle,
- &gEfiFirmwareVolumeBlockProtocolGuid,
- &FvbDevice->FwVolBlockInstance,
- &gEfiDevicePathProtocolGuid,
- FvbDevice->DevicePath,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
- } else if (IsDevicePathEnd (FvbDevice->DevicePath)) {
- //
- // Device allready exists, so reinstall the FVB protocol
- //
- Status = gBS->HandleProtocol (
- FwbHandle,
- &gEfiFirmwareVolumeBlockProtocolGuid,
- (VOID**)&OldFwbInterface
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->ReinstallProtocolInterface (
- FwbHandle,
- &gEfiFirmwareVolumeBlockProtocolGuid,
- OldFwbInterface,
- &FvbDevice->FwVolBlockInstance
- );
- ASSERT_EFI_ERROR (Status);
-
- } else {
- //
- // There was a FVB protocol on an End Device Path node
- //
- ASSERT (FALSE);
- }
-
- FwhInstance = (EFI_FW_VOL_INSTANCE *)
- (
- (UINTN) ((UINT8 *) FwhInstance) + FwVolHeader->HeaderLength +
- (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))
- );
-
- FvHob.Raw = GET_NEXT_HOB (FvHob);
- }
-
- return EFI_SUCCESS;
-}
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FvbInfo.c b/Nt32Pkg/FvbServicesRuntimeDxe/FvbInfo.c
deleted file mode 100644
index 1b4d082828..0000000000
--- a/Nt32Pkg/FvbServicesRuntimeDxe/FvbInfo.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- FvbInfo.c
-
-Abstract:
-
- Defines data structure that is the volume header found.These data is intent
- to decouple FVB driver with FV header.
-
-**/
-
-//
-// The package level header files this module uses
-//
-#include
-#include
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-#include
-#include
-#include
-#include
-//
-// The Library classes this module consumes
-//
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-typedef struct {
- UINT64 FvLength;
- EFI_FIRMWARE_VOLUME_HEADER FvbInfo;
- //
- // EFI_FV_BLOCK_MAP_ENTRY ExtraBlockMap[n];//n=0
- //
- EFI_FV_BLOCK_MAP_ENTRY End[1];
-} EFI_FVB_MEDIA_INFO;
-
-EFI_FVB_MEDIA_INFO mPlatformFvbMediaInfo[] = {
- //
- // Recovery BOIS FVB
- //
- {
- FixedPcdGet32 (PcdWinNtFlashFvRecoverySize),
- {
- {
- 0,
- }, // ZeroVector[16]
- EFI_FIRMWARE_FILE_SYSTEM2_GUID,
- FixedPcdGet32 (PcdWinNtFlashFvRecoverySize),
- EFI_FVH_SIGNATURE,
- EFI_FVB2_MEMORY_MAPPED |
- EFI_FVB2_READ_ENABLED_CAP |
- EFI_FVB2_READ_STATUS |
- EFI_FVB2_WRITE_ENABLED_CAP |
- EFI_FVB2_WRITE_STATUS |
- EFI_FVB2_ERASE_POLARITY |
- EFI_FVB2_ALIGNMENT_16,
- sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),
- 0xE947, // CheckSum
- 0, // ExtHeaderOffset
- {
- 0,
- }, // Reserved[1]
- 2, // Revision
- {
- FixedPcdGet32 (PcdWinNtFlashFvRecoverySize)/FixedPcdGet32 (PcdWinNtFirmwareBlockSize),
- FixedPcdGet32 (PcdWinNtFirmwareBlockSize),
- }
- },
- {
- 0,
- 0
- }
- },
- //
- // Systen NvStorage FVB
- //
- {
- FixedPcdGet32 (PcdFlashNvStorageVariableSize) +
- FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) +
- FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) +
- FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize),
- {
- {
- 0,
- }, // ZeroVector[16]
- EFI_SYSTEM_NV_DATA_FV_GUID,
- FixedPcdGet32 (PcdFlashNvStorageVariableSize) +
- FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) +
- FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) +
- FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize),
- EFI_FVH_SIGNATURE,
- EFI_FVB2_MEMORY_MAPPED |
- EFI_FVB2_READ_ENABLED_CAP |
- EFI_FVB2_READ_STATUS |
- EFI_FVB2_WRITE_ENABLED_CAP |
- EFI_FVB2_WRITE_STATUS |
- EFI_FVB2_ERASE_POLARITY |
- EFI_FVB2_ALIGNMENT_16,
- sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),
- 0xFBFF, // CheckSum
- 0, // ExtHeaderOffset
- {
- 0,
- }, // Reserved[1]
- 2, // Revision
- {
- (FixedPcdGet32 (PcdFlashNvStorageVariableSize) +
- FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) +
- FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) +
- FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize)) / FixedPcdGet32 (PcdWinNtFirmwareBlockSize),
- FixedPcdGet32 (PcdWinNtFirmwareBlockSize),
- }
- },
- {
- 0,
- 0
- }
- }
-};
-
-EFI_STATUS
-GetFvbInfo (
- IN UINT64 FvLength,
- OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo
- )
-{
- UINTN Index;
-
- for (Index = 0; Index < sizeof (mPlatformFvbMediaInfo) / sizeof (EFI_FVB_MEDIA_INFO); Index += 1) {
- if (mPlatformFvbMediaInfo[Index].FvLength == FvLength) {
- *FvbInfo = &mPlatformFvbMediaInfo[Index].FvbInfo;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf b/Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
deleted file mode 100644
index 1d7c86f9c7..0000000000
--- a/Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
+++ /dev/null
@@ -1,75 +0,0 @@
-## @file
-# Component description file for Nt32 Fimware Volume Block DXE driver module.
-#
-# This DXE runtime driver implements and produces the Fimware Volue Block Protocol on
-# NT32 emulator.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = FvbServicesRuntimeDxe
- FILE_GUID = BDFE5FAA-2A35-44bb-B17A-8084D4E2B9E9
- MODULE_TYPE = DXE_RUNTIME_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = FvbInitialize
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- FvbInfo.c
- FwBlockService.h
- FWBlockService.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- MemoryAllocationLib
- BaseMemoryLib
- HobLib
- DebugLib
- UefiRuntimeLib
- DxeServicesTableLib
- BaseLib
- UefiDriverEntryPoint
- UefiLib
- PcdLib
-
-[Guids]
- gEfiEventVirtualAddressChangeGuid # ALWAYS_CONSUMED Create Event: EVENT_GROUP_GUID
-
-[Protocols]
- gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL ALWAYS_PRODUCED
- gEfiDevicePathProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
-
-[FixedPcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareBlockSize
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogSize
-
-[Pcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoveryBase
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogBase
-
-[Depex]
- TRUE
-
diff --git a/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h b/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h
deleted file mode 100644
index cdf6b1f583..0000000000
--- a/Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- FwBlockService.h
-
-Abstract:
-
- Firmware volume block driver for Intel Firmware Hub (FWH) device
-
-**/
-
-#ifndef _FW_BLOCK_SERVICE_H
-#define _FW_BLOCK_SERVICE_H
-
-//
-// BugBug: Add documentation here for data structure!!!!
-//
-#define FVB_PHYSICAL 0
-#define FVB_VIRTUAL 1
-
-typedef struct {
- EFI_LOCK FvbDevLock;
- UINTN FvBase[2];
- UINTN NumOfBlocks;
- EFI_FIRMWARE_VOLUME_HEADER VolumeHeader;
-} EFI_FW_VOL_INSTANCE;
-
-typedef struct {
- UINT32 NumFv;
- EFI_FW_VOL_INSTANCE *FvInstance[2];
- UINT8 *FvbScratchSpace[2];
-} ESAL_FWB_GLOBAL;
-
-//
-// Fvb Protocol instance data
-//
-#define FVB_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)
-#define FVB_EXTEND_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE, FvbExtension, FVB_DEVICE_SIGNATURE)
-#define FVB_DEVICE_SIGNATURE SIGNATURE_32 ('F', 'V', 'B', 'N')
-
-typedef struct {
- MEDIA_FW_VOL_DEVICE_PATH FvDevPath;
- EFI_DEVICE_PATH_PROTOCOL EndDevPath;
-} FV_PIWG_DEVICE_PATH;
-
-typedef struct {
- MEMMAP_DEVICE_PATH MemMapDevPath;
- EFI_DEVICE_PATH_PROTOCOL EndDevPath;
-} FV_MEMMAP_DEVICE_PATH;
-
-typedef struct {
- UINTN Signature;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- UINTN Instance;
- EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL FwVolBlockInstance;
-} EFI_FW_VOL_BLOCK_DEVICE;
-
-EFI_STATUS
-GetFvbInfo (
- IN UINT64 FvLength,
- OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo
- );
-
-EFI_STATUS
-FvbReadBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN BlockOffset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- );
-
-EFI_STATUS
-FvbWriteBlock (
- IN UINTN Instance,
- IN CONST EFI_LBA Lba,
- IN CONST UINTN BlockOffset,
- IN OUT UINTN *NumBytes,
- IN CONST UINT8 *Buffer,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- );
-
-EFI_STATUS
-FvbEraseBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- );
-
-EFI_STATUS
-FvbSetVolumeAttributes (
- IN UINTN Instance,
- IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- );
-
-EFI_STATUS
-FvbGetVolumeAttributes (
- IN UINTN Instance,
- OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- );
-
-EFI_STATUS
-FvbGetPhysicalAddress (
- IN UINTN Instance,
- OUT EFI_PHYSICAL_ADDRESS *Address,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- );
-
-EFI_STATUS
-EFIAPI
-FvbInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-VOID
-EFIAPI
-FvbClassAddressChangeEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-EFI_STATUS
-FvbGetLbaAddress (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- OUT UINTN *LbaAddress,
- OUT UINTN *LbaLength,
- OUT UINTN *NumOfBlocks,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- );
-
-//
-// Protocol APIs
-//
-EFI_STATUS
-EFIAPI
-FvbProtocolGetAttributes (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- OUT EFI_FVB_ATTRIBUTES_2 *Attributes
- );
-
-EFI_STATUS
-EFIAPI
-FvbProtocolSetAttributes (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
- );
-
-EFI_STATUS
-EFIAPI
-FvbProtocolGetPhysicalAddress (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- OUT EFI_PHYSICAL_ADDRESS *Address
- );
-
-EFI_STATUS
-EFIAPI
-FvbProtocolGetBlockSize (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN CONST EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumOfBlocks
- );
-
-EFI_STATUS
-EFIAPI
-FvbProtocolRead (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN CONST EFI_LBA Lba,
- IN CONST UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- );
-
-EFI_STATUS
-EFIAPI
-FvbProtocolWrite (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- );
-
-EFI_STATUS
-EFIAPI
-FvbProtocolEraseBlocks (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
- ...
- );
-
-#endif
diff --git a/Nt32Pkg/Include/Common/WinNTInclude.h b/Nt32Pkg/Include/Common/WinNTInclude.h
deleted file mode 100644
index 345d15d376..0000000000
--- a/Nt32Pkg/Include/Common/WinNTInclude.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
- WinNtLib.h
-
-Abstract:
- Public include file for the WinNt Library
-
-**/
-
-#ifndef __WIN_NT_INCLUDE_H__
-#define __WIN_NT_INCLUDE_H__
-
-//
-// Win32 include files do not compile clean with /W4, so we use the warning
-// pragma to suppress the warnings for Win32 only. This way our code can stil
-// compile at /W4 (highest warning level) with /WX (warnings cause build
-// errors).
-//
-#pragma warning(disable : 4115)
-#pragma warning(disable : 4201)
-#pragma warning(disable : 4028)
-#pragma warning(disable : 4133)
-
-#define GUID _WINNT_DUP_GUID_____
-#define _LIST_ENTRY _WINNT_DUP_LIST_ENTRY_FORWARD
-#define LIST_ENTRY _WINNT_DUP_LIST_ENTRY
-#if defined (MDE_CPU_IA32) && (_MSC_VER < 1800)
-#define InterlockedIncrement _WINNT_DUP_InterlockedIncrement
-#define InterlockedDecrement _WINNT_DUP_InterlockedDecrement
-#define InterlockedCompareExchange64 _WINNT_DUP_InterlockedCompareExchange64
-#endif
-#undef UNALIGNED
-#undef CONST
-#undef VOID
-#undef DEBUG_EVENT
-
-// WQBugBug: This typedef is to make "windows.h" buildable.
-// It should be removed after the root cause why
-// size_t is undefined when go into the line below is found.
-#if defined (MDE_CPU_IA32)
-typedef UINT32 size_t ;
-#endif
-
-#include "windows.h"
-
-#undef GUID
-#undef _LIST_ENTRY
-#undef LIST_ENTRY
-#undef InterlockedIncrement
-#undef InterlockedDecrement
-#undef InterlockedCompareExchange64
-#undef InterlockedCompareExchangePointer
-#undef CreateEventEx
-
-#define VOID void
-
-//
-// Prevent collisions with Windows API name macros that deal with Unicode/Not issues
-//
-#undef LoadImage
-#undef CreateEvent
-
-//
-// Set the warnings back on as the EFI code must be /W4.
-//
-#pragma warning(default : 4115)
-#pragma warning(default : 4201)
-
-
-#endif
diff --git a/Nt32Pkg/Include/Guid/WinNtSystemConfig.h b/Nt32Pkg/Include/Guid/WinNtSystemConfig.h
deleted file mode 100644
index 975de36e42..0000000000
--- a/Nt32Pkg/Include/Guid/WinNtSystemConfig.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/**@file
- Setup Variable data structure for NT32 platform.
-
-Copyright (c) 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-
-**/
-
-#ifndef __WIN_NT_SYSTEM_CONFIGUE_H__
-#define __WIN_NT_SYSTEM_CONFIGUE_H__
-
-#define EFI_WIN_NT_SYSTEM_CONFIG_GUID \
- { 0xb347f047, 0xaf8c, 0x490e, { 0xac, 0x07, 0x0a, 0xa9, 0xb7, 0xe5, 0x38, 0x58 }}
-
-#pragma pack(1)
-typedef struct {
- //
- // Console output mode
- //
- UINT32 ConOutColumn;
- UINT32 ConOutRow;
-} WIN_NT_SYSTEM_CONFIGURATION;
-#pragma pack()
-
-
-extern EFI_GUID gEfiWinNtSystemConfigGuid;
-
-#endif
diff --git a/Nt32Pkg/Include/Library/WinNtLib.h b/Nt32Pkg/Include/Library/WinNtLib.h
deleted file mode 100644
index a3e3152b23..0000000000
--- a/Nt32Pkg/Include/Library/WinNtLib.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/** @file
- Public include file for the WinNt Library
-
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __WIN_NT_LIB_H__
-#define __WIN_NT_LIB_H__
-
-#include
-
-extern EFI_WIN_NT_THUNK_PROTOCOL *gWinNt;
-
-#endif
diff --git a/Nt32Pkg/Include/Ppi/NtAutoscan.h b/Nt32Pkg/Include/Ppi/NtAutoscan.h
deleted file mode 100644
index 130112ad13..0000000000
--- a/Nt32Pkg/Include/Ppi/NtAutoscan.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- NtAutoscan.h
-
-Abstract:
-
-Nt Autoscan PPI
-
-**/
-
-#ifndef __NT_PEI_AUTOSCAN_H__
-#define __NT_PEI_AUTOSCAN_H__
-
-#include
-
-#define PEI_NT_AUTOSCAN_PPI_GUID \
- { \
- 0xdce384d, 0x7c, 0x4ba5, {0x94, 0xbd, 0xf, 0x6e, 0xb6, 0x4d, 0x2a, 0xa9 } \
- }
-
-typedef
-EFI_STATUS
-(EFIAPI *PEI_NT_AUTOSCAN) (
- IN UINTN Index,
- OUT EFI_PHYSICAL_ADDRESS * MemoryBase,
- OUT UINT64 *MemorySize
- );
-
-/*++
-
-Routine Description:
- This service is called from Index == 0 until it returns EFI_UNSUPPORTED.
- It allows discontinuous memory regions to be supported by the emulator.
- It uses gSystemMemory[] and gSystemMemoryCount that were created by
- parsing the Windows environment variable EFI_MEMORY_SIZE.
- The size comes from the varaible and the address comes from the call to
- WinNtOpenFile.
-
-Arguments:
- Index - Which memory region to use
- MemoryBase - Return Base address of memory region
- MemorySize - Return size in bytes of the memory region
-
-Returns:
- EFI_SUCCESS - If memory region was mapped
- EFI_UNSUPPORTED - If Index is not supported
-
---*/
-typedef struct {
- PEI_NT_AUTOSCAN NtAutoScan;
-} PEI_NT_AUTOSCAN_PPI;
-
-extern EFI_GUID gPeiNtAutoScanPpiGuid;
-
-#endif
diff --git a/Nt32Pkg/Include/Ppi/NtFwh.h b/Nt32Pkg/Include/Ppi/NtFwh.h
deleted file mode 100644
index 711d44d694..0000000000
--- a/Nt32Pkg/Include/Ppi/NtFwh.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- NtFwh.h
-
-Abstract:
-
- WinNt FWH PPI as defined in Tiano
-
-**/
-
-#ifndef __NT_PEI_FWH_H__
-#define __NT_PEI_FWH_H__
-
-#include
-
-#define NT_FWH_PPI_GUID \
- { \
- 0x4e76928f, 0x50ad, 0x4334, {0xb0, 0x6b, 0xa8, 0x42, 0x13, 0x10, 0x8a, 0x57 } \
- }
-
-typedef
-EFI_STATUS
-(EFIAPI *NT_FWH_INFORMATION) (
- IN UINTN Index,
- IN OUT EFI_PHYSICAL_ADDRESS * FdBase,
- IN OUT UINT64 *FdSize
- );
-
-/*++
-
-Routine Description:
- Return the FD Size and base address. Since the FD is loaded from a
- file into Windows memory only the SEC will know it's address.
-
-Arguments:
- Index - Which FD, starts at zero.
- FdSize - Size of the FD in bytes
- FdBase - Start address of the FD. Assume it points to an FV Header
-
-Returns:
- EFI_SUCCESS - Return the Base address and size of the FV
- EFI_UNSUPPORTED - Index does nto map to an FD in the system
-
---*/
-typedef struct {
- NT_FWH_INFORMATION NtFwh;
-} NT_FWH_PPI;
-
-extern EFI_GUID gNtFwhPpiGuid;
-
-#endif
diff --git a/Nt32Pkg/Include/Ppi/NtPeiLoadFile.h b/Nt32Pkg/Include/Ppi/NtPeiLoadFile.h
deleted file mode 100644
index c961e35c4e..0000000000
--- a/Nt32Pkg/Include/Ppi/NtPeiLoadFile.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- NtPeiLoadFile.h
-
-Abstract:
-
- WinNt Load File PPI.
-
- When the PEI core is done it calls the DXE IPL via PPI
-
-**/
-
-#ifndef __NT_PEI_LOAD_FILE_H__
-#define __NT_PEI_LOAD_FILE_H__
-
-#include
-
-#define NT_PEI_LOAD_FILE_GUID \
- { \
- 0xfd0c65eb, 0x405, 0x4cd2, {0x8a, 0xee, 0xf4, 0x0, 0xef, 0x13, 0xba, 0xc2 } \
- }
-
-typedef
-EFI_STATUS
-(EFIAPI *NT_PEI_LOAD_FILE) (
- VOID *Pe32Data,
- EFI_PHYSICAL_ADDRESS *ImageAddress,
- UINT64 *ImageSize,
- EFI_PHYSICAL_ADDRESS *EntryPoint
- );
-
-/*++
-
-Routine Description:
- Loads and relocates a PE/COFF image into memory.
-
-Arguments:
- Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated
- ImageAddress - The base address of the relocated PE/COFF image
- ImageSize - The size of the relocated PE/COFF image
- EntryPoint - The entry point of the relocated PE/COFF image
-
-Returns:
- EFI_SUCCESS - The file was loaded and relocated
- EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file
-
---*/
-typedef struct {
- NT_PEI_LOAD_FILE PeiLoadFileService;
-} NT_PEI_LOAD_FILE_PPI;
-
-extern EFI_GUID gNtPeiLoadFilePpiGuid;
-
-#endif
diff --git a/Nt32Pkg/Include/Ppi/NtThunk.h b/Nt32Pkg/Include/Ppi/NtThunk.h
deleted file mode 100644
index a585bfb0b2..0000000000
--- a/Nt32Pkg/Include/Ppi/NtThunk.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- NtThunk.h
-
-Abstract:
-
- WinNt Thunk interface PPI
-
-**/
-
-#ifndef __NT_PEI_WIN_NT_THUNK_H__
-#define __NT_PEI_WIN_NT_THUNK_H__
-
-#include
-
-#define PEI_NT_THUNK_PPI_GUID \
- { \
- 0x98c281e5, 0xf906, 0x43dd, {0xa9, 0x2b, 0xb0, 0x3, 0xbf, 0x27, 0x65, 0xda } \
- }
-
-typedef
-VOID *
-(EFIAPI *PEI_NT_THUNK_INTERFACE) (
- VOID
- );
-
-/*++
-
-Routine Description:
- Export of EFI_WIN_NT_THUNK_PROTOCOL from the Windows SEC.
-
-Arguments:
- InterfaceBase - Address of the EFI_WIN_NT_THUNK_PROTOCOL
-
-Returns:
- EFI_SUCCESS - Data returned
-
---*/
-typedef struct {
- PEI_NT_THUNK_INTERFACE NtThunk;
-} PEI_NT_THUNK_PPI;
-
-extern EFI_GUID gPeiNtThunkPpiGuid;
-
-#endif
diff --git a/Nt32Pkg/Include/Protocol/WinNtIo.h b/Nt32Pkg/Include/Protocol/WinNtIo.h
deleted file mode 100644
index 00a71287c6..0000000000
--- a/Nt32Pkg/Include/Protocol/WinNtIo.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- WinNtIo.h
-
-Abstract:
-
-**/
-
-#ifndef __WIN_NT_IO_H__
-#define __WIN_NT_IO_H__
-
-#include
-
-#define EFI_WIN_NT_IO_PROTOCOL_GUID \
- { 0x96eb4ad6, 0xa32a, 0x11d4, { 0xbc, 0xfd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
-
-extern EFI_GUID gEfiWinNtIoProtocolGuid;
-
-typedef struct {
- EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;
- EFI_GUID *TypeGuid;
- CHAR16 *EnvString;
- UINT16 InstanceNumber;
-} EFI_WIN_NT_IO_PROTOCOL;
-
-//
-// The following GUIDs are used in EFI_WIN_NT_IO_PROTOCOL_GUID
-// Device paths. They map 1:1 with NT envirnment variables. The variables
-// define what virtual hardware the emulator/WinNtBusDriver will produce.
-//
-//
-// EFI_WIN_NT_VIRTUAL_DISKS
-//
-#define EFI_WIN_NT_VIRTUAL_DISKS_GUID \
- { \
- 0xc95a928, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtVirtualDisksGuid;
-
-//
-// EFI_WIN_NT_PHYSICAL_DISKS
-//
-#define EFI_WIN_NT_PHYSICAL_DISKS_GUID \
- { \
- 0xc95a92f, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtPhysicalDisksGuid;
-
-//
-// EFI_WIN_NT_FILE_SYSTEM
-//
-#define EFI_WIN_NT_FILE_SYSTEM_GUID \
- { \
- 0xc95a935, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtFileSystemGuid;
-
-//
-// EFI_WIN_NT_SERIAL_PORT
-//
-#define EFI_WIN_NT_SERIAL_PORT_GUID \
- { \
- 0xc95a93d, 0xa006, 0x11d4, {0xbc, 0xfa, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtSerialPortGuid;
-
-//
-// EFI_WIN_NT_UGA
-//
-#define EFI_WIN_NT_UGA_GUID \
- { \
- 0xab248e99, 0xabe1, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtUgaGuid;
-
-//
-// EFI_WIN_NT_GOP
-//
-#define EFI_WIN_NT_GOP_GUID \
- { \
- 0x4e11e955, 0xccca, 0x11d4, 0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 \
- }
-
-extern EFI_GUID gEfiWinNtGopGuid;
-
-//
-// EFI_WIN_NT_CONSOLE
-//
-#define EFI_WIN_NT_CONSOLE_GUID \
- { \
- 0xba73672c, 0xa5d3, 0x11d4, {0xbd, 0x0, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtConsoleGuid;
-
-//
-// EFI_WIN_NT_MEMORY
-//
-#define EFI_WIN_NT_MEMORY_GUID \
- { \
- 0x99042912, 0x122a, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtMemoryGuid;
-
-//
-// EFI_WIN_NT_CPU_MODEL
-//
-#define EFI_WIN_NT_CPU_MODEL_GUID \
- { \
- 0xbee9b6ce, 0x2f8a, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtCPUModelGuid;
-
-//
-// EFI_WIN_NT_CPU_SPEED
-//
-#define EFI_WIN_NT_CPU_SPEED_GUID \
- { \
- 0xd4f29055, 0xe1fb, 0x11d4, {0xbd, 0xd, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
- }
-
-extern EFI_GUID gEfiWinNtCPUSpeedGuid;
-
-//
-// EFI_WIN_NT_PASS_THROUGH
-//
-#define EFI_WIN_NT_PASS_THROUGH_GUID \
- { \
- 0xcc664eb8, 0x3c24, 0x4086, {0xb6, 0xf6, 0x34, 0xe8, 0x56, 0xbc, 0xe3, 0x6e } \
- }
-
-extern EFI_GUID gEfiWinNtPassThroughGuid;
-
-#endif
diff --git a/Nt32Pkg/Include/Protocol/WinNtThunk.h b/Nt32Pkg/Include/Protocol/WinNtThunk.h
deleted file mode 100644
index 847f67b21d..0000000000
--- a/Nt32Pkg/Include/Protocol/WinNtThunk.h
+++ /dev/null
@@ -1,1287 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- WinNtThunk.h
-
-Abstract:
-
- This protocol allows an EFI driver (DLL) in the NT emulation envirnment
- to make Win32 API calls.
-
- NEVER make a Win32 call directly, always make the call via this protocol.
-
- There are no This pointers on the protocol member functions as they map
- exactly into Win32 system calls.
-
- YOU MUST include EfiWinNT.h in place of Efi.h to make this file compile.
-
-**/
-
-#ifndef __WIN_NT_THUNK_H__
-#define __WIN_NT_THUNK_H__
-
-#include
-
-#define EFI_WIN_NT_THUNK_PROTOCOL_GUID \
- { 0x58c518b1, 0x76f3, 0x11d4, { 0xbc, 0xea, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtSleep) (
- DWORD Milliseconds
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtSuspendThread) (
- HANDLE hThread
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtGetCurrentThread) (
- VOID
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtGetCurrentThreadId) (
- VOID
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtGetCurrentProcess) (
- VOID
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtCreateThread) (
- LPSECURITY_ATTRIBUTES lpThreadAttributes,
- DWORD dwStackSize,
- LPTHREAD_START_ROUTINE lpStartAddress,
- LPVOID lpParameter,
- DWORD dwCreationFlags,
- LPDWORD lpThreadId
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtTerminateThread) (
- HANDLE hThread,
- DWORD dwExitCode
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSendMessage) (
- HWND hWnd,
- UINT Msg,
- WPARAM wParam,
- LPARAM lParam
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtExitThread) (
- DWORD dwExitCode
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtResumeThread) (
- HANDLE hThread
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetThreadPriority) (
- HANDLE hThread,
- INTN nPriority
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtInitializeCriticalSection) (
- LPCRITICAL_SECTION lpCriticalSection
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtDeleteCriticalSection) (
- LPCRITICAL_SECTION lpCriticalSection
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtEnterCriticalSection) (
- LPCRITICAL_SECTION lpCriticalSection
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtLeaveCriticalSection) (
- LPCRITICAL_SECTION lpCriticalSection
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtTlsAlloc) (
- VOID
- );
-
-typedef
-WINBASEAPI
-LPVOID
-(WINAPI *WinNtTlsGetValue) (
- DWORD dwTlsIndex
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtTlsSetValue) (
- DWORD dwTlsIndex,
- LPVOID lpTlsValue
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtTlsFree) (
- DWORD dwTlsIndex
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtCreateSemaphore) (
- LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
- LONG lInitialCount,
- LONG lMaximumCount,
- LPCWSTR lpName
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtWaitForSingleObject) (
- HANDLE hHandle,
- DWORD dwMilliseconds
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtReleaseSemaphore) (
- HANDLE hSemaphore,
- LONG lReleaseCount,
- LPLONG lpPreviousCount
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtDuplicateHandle) (
- HANDLE hSourceProcessHandle,
- HANDLE hSourceHandle,
- HANDLE hTargetProcessHandle,
- LPHANDLE lpTargetHandle,
- DWORD dwDesiredAccess,
- BOOL bInheritHandle,
- DWORD dwOptions
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtCreateConsoleScreenBuffer) (
- DWORD DesiredAccess,
- DWORD ShareMode,
- CONST SECURITY_ATTRIBUTES *SecurityAttributes,
- DWORD Flags,
- LPVOID ScreenBufferData
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetConsoleScreenBufferSize) (
- HANDLE ConsoleOutput,
- COORD Size
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetConsoleActiveScreenBuffer) (
- HANDLE ConsoleOutput
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFillConsoleOutputAttribute) (
- HANDLE ConsoleOutput,
- WORD Attribute,
- DWORD Length,
- COORD WriteCoord,
- LPDWORD NumberOfAttrsWritten
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFillConsoleOutputCharacter) (
- HANDLE ConsoleOutput,
- TCHAR Character,
- DWORD Length,
- COORD WriteCoord,
- LPDWORD NumberOfCharsWritten
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtWriteConsoleOutput) (
- HANDLE ConsoleOutput,
- CONST CHAR_INFO *Buffer,
- COORD BufferSize,
- COORD BufferCoord,
- PSMALL_RECT WriteRegion
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtScrollConsoleScreenBuffer) (
- HANDLE ConsoleOutput,
- CONST SMALL_RECT *ScrollRectangle,
- CONST SMALL_RECT *ClipRectangle,
- COORD DestinationOrigin,
- CONST CHAR_INFO *Fill
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetConsoleTitleW) (
- LPCTSTR ConsoleTitle
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtGetConsoleCursorInfo) (
- HANDLE ConsoleOutput,
- PCONSOLE_CURSOR_INFO ConsoleCursorInfo
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetConsoleCursorInfo) (
- HANDLE ConsoleOutput,
- CONST CONSOLE_CURSOR_INFO *ConsoleCursorInfo
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetPriorityClass) (
- HANDLE Process,
- DWORD PriorityClass
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtWriteConsoleInput) (
- HANDLE ConsoleInput,
- CONST INPUT_RECORD *Buffer,
- DWORD Legnth,
- LPDWORD NumberOfEventsWritten
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtGetNumberOfConsoleInputEvents) (
- HANDLE ConsoleInput,
- LPDWORD NumberOfEvents
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtGetStdHandle) (
- DWORD StdHandle
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtReadConsoleInput) (
- HANDLE ConsoleInput,
- PINPUT_RECORD Buffer,
- DWORD Length,
- LPDWORD NumberOfEventsRead
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtPeekConsoleInput) (
- HANDLE ConsoleInput,
- PINPUT_RECORD Buffer,
- DWORD Length,
- LPDWORD NumberOfEventsRead
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetConsoleCursorPosition) (
- HANDLE ConsoleInput,
- COORD CursorPosition
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtCreateFile) (
- LPCWSTR FileName,
- DWORD DesiredAccess,
- DWORD SharedMode,
- LPSECURITY_ATTRIBUTES SecurityAttributes,
- DWORD CreationDisposition,
- DWORD FlagsAndAttributes,
- HANDLE TemplateFile
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtDeviceIoControl) (
- HANDLE DeviceHandle,
- DWORD IoControlCode,
- LPVOID InBuffer,
- DWORD InBufferSize,
- LPVOID OutBuffer,
- DWORD OutBufferSize,
- LPDWORD BytesReturned,
- LPOVERLAPPED Overlapped
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtCreateDirectory) (
- LPCWSTR PathName,
- LPSECURITY_ATTRIBUTES SecurityAttributes
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtRemoveDirectory) (
- LPCWSTR PathName
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtGetFileAttributes) (
- LPCWSTR FileName
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetFileAttributes) (
- LPCWSTR FileName,
- DWORD FileAttributes
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtCreateFileMapping) (
- HANDLE FileHandle,
- LPSECURITY_ATTRIBUTES Attributes,
- DWORD Protect,
- DWORD MaximumSizeHigh,
- DWORD MaximumSizeLow,
- LPCTSTR Name
- );
-
-typedef
-WINBASEAPI
-LPVOID
-(WINAPI *WinNtMapViewOfFileEx) (
- HANDLE FileHandle,
- DWORD DesiredAccess,
- DWORD FileOffsetHigh,
- DWORD FileOffsetLow,
- DWORD NumberOfBytesToMap,
- LPVOID BaseAddress
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtGetEnvironmentVariable) (
- LPCTSTR Name,
- LPTSTR Buffer,
- DWORD Size
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtCloseHandle) (
- HANDLE Object
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtSetFilePointer) (
- HANDLE FileHandle,
- LONG DistanceToMove,
- PLONG DistanceToHoveHigh,
- DWORD MoveMethod
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetEndOfFile) (
- HANDLE FileHandle
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtReadFile) (
- HANDLE FileHandle,
- LPVOID Buffer,
- DWORD NumberOfBytesToRead,
- LPDWORD NumberOfBytesRead,
- LPOVERLAPPED Overlapped
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtWriteFile) (
- HANDLE FileHandle,
- LPCVOID Buffer,
- DWORD NumberOfBytesToWrite,
- LPDWORD NumberOfBytesWritten,
- LPOVERLAPPED Overlapped
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtGetFileInformationByHandle) (
- HANDLE FileHandle,
- BY_HANDLE_FILE_INFORMATION *FileInfo
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtGetDiskFreeSpace) (
- LPCTSTR RootPathName,
- LPDWORD SectorsPerCluster,
- LPDWORD BytesPerSector,
- LPDWORD NumberOfFreeClusters,
- LPDWORD TotalNumberOfClusters
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtGetDiskFreeSpaceEx) (
- LPCTSTR DirectoryName,
- PULARGE_INTEGER FreeBytesAvailable,
- PULARGE_INTEGER TotalNumberOfBytes,
- PULARGE_INTEGER TotoalNumberOfFreeBytes
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtMoveFile) (
- LPCTSTR ExistingFileName,
- LPCTSTR NewFileName
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetFileTime) (
- HANDLE FileHandle,
- FILETIME *CreationTime,
- FILETIME *LastAccessTime,
- FILETIME *LastWriteTime
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSystemTimeToFileTime) (
- SYSTEMTIME * SystemTime,
- FILETIME * FileTime
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtDeleteFile) (
- LPCTSTR FileName
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFlushFileBuffers) (
- HANDLE
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtGetLastError) (
- VOID
- );
-
-typedef
-WINBASEAPI
-UINT
-(WINAPI *WinNtSetErrorMode) (
- UINT Mode
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtGetTickCount) (
- VOID
- );
-
-typedef
-WINBASEAPI
-HMODULE
-(WINAPI *WinNtLoadLibraryEx) (
- LPCTSTR LibFileName,
- HANDLE FileHandle,
- DWORD Flags
- );
-
-typedef
-WINBASEAPI
-FARPROC
-(WINAPI *WinNtGetProcAddress) (
- HMODULE Module,
- LPCSTR ProcName
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtGetTimeZoneInformation) (
- LPTIME_ZONE_INFORMATION timeZoneInformation
- );
-
-typedef
-WINBASEAPI
-MMRESULT
-(WINAPI *WinNttimeSetEvent) (
- UINT uDelay,
- UINT uResolution,
- LPTIMECALLBACK lpTimeProc,
- DWORD_PTR dwUser,
- UINT fuEvent
- );
-
-typedef
-WINBASEAPI
-MMRESULT
-(WINAPI *WinNttimeKillEvent) (
- UINT uTimerID
- );
-
-typedef
-WINBASEAPI
-DWORD
-(WINAPI *WinNtSetTimeZoneInformation) (
- LPTIME_ZONE_INFORMATION timeZoneInformation
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtGetSystemTime) (
- LPSYSTEMTIME SystemTime
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetSystemTime) (
- CONST SYSTEMTIME *SystemTime
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtGetLocalTime) (
- LPSYSTEMTIME SystemTime
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetLocalTime) (
- CONST SYSTEMTIME *SystemTime
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtLocalFileTimeToFileTime) (
- CONST FILETIME *LocalFileTime,
- LPFILETIME FileTime
- );
-
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFileTimeToLocalFileTime) (
- CONST FILETIME *FileTime,
- LPFILETIME LocalFileTime
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFileTimeToSystemTime) (
- CONST FILETIME *FileTime,
- LPSYSTEMTIME SystemTime
- );
-
-typedef
-WINBASEAPI
-HANDLE
-(WINAPI *WinNtFindFirstFile) (
- LPCTSTR FileName,
- LPWIN32_FIND_DATA FindFileData
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFindNextFile) (
- HANDLE FindFile,
- LPWIN32_FIND_DATA FindFileData
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFindClose) (
- HANDLE FindFile
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtGetCommState) (
- HANDLE FileHandle,
- LPDCB DCB
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetCommState) (
- HANDLE FileHandle,
- LPDCB DCB
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetCommState) (
- HANDLE FileHandle,
- LPDCB DCB
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtSetCommTimeouts) (
- HANDLE FileHandle,
- LPCOMMTIMEOUTS CommTimeouts
- );
-
-typedef
-WINBASEAPI
-VOID
-(WINAPI *WinNtExitProcess) (
- UINT uExitCode // exit code for all threads
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtPurgeComm) (
- HANDLE FileHandle,
- DWORD Flags
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtEscapeCommFunction) (
- HANDLE FileHandle,
- DWORD Func
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtGetCommModemStatus) (
- HANDLE FileHandle,
- LPDWORD ModemStat
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtClearCommError) (
- HANDLE FileHandle,
- LPDWORD Errors,
- LPCOMSTAT Stat
- );
-
-typedef
-WINUSERAPI
-INT32
-(WINAPIV *WinNtSprintf) (
- LPWSTR Buffer,
- size_t Count,
- LPCWSTR String,
- ...
- );
-
-typedef
-WINUSERAPI
-HWND
-(WINAPI *WinNtGetDesktopWindow) (
- VOID
- );
-
-typedef
-WINUSERAPI
-HWND
-(WINAPI *WinNtGetForegroundWindow) (
- VOID
- );
-
-typedef
-WINUSERAPI
-HWND
-(WINAPI *WinNtCreateWindowEx) (
- DWORD dwExStyle,
- LPCTSTR lpClassName,
- LPCTSTR lpWindowName,
- DWORD dwStyle,
- INT32 x,
- INT32 y,
- INT32 nWidth,
- INT32 nHeight,
- HWND hWndParent,
- HMENU hMenu,
- HINSTANCE hInstance,
- LPVOID *lpParam
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtUpdateWindow) (
- HWND hWnd
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtShowWindow) (
- HWND hWnd,
- INT32 nCmdShow
- );
-
-typedef
-WINGDIAPI
-BOOL
-(WINAPI *WinNtDestroyWindow) (
- HWND hWnd
- );
-
-typedef
-WINUSERAPI
-HDC
-(WINAPI *WinNtGetWindowDC) (
- HWND hWnd
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtGetClientRect) (
- HWND hWnd,
- LPRECT lpRect
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtAdjustWindowRect) (
- LPRECT lpRect,
- DWORD dwStyle,
- BOOL bMenu
- );
-
-typedef
-WINGDIAPI
-INT32
-(WINAPI *WinNtSetDIBitsToDevice) (
- HDC,
- INT32,
- INT32,
- DWORD,
- DWORD,
- INT32,
- INT32,
- UINT,
- UINT,
- CONST VOID *,
- CONST BITMAPINFO *,
- UINT
- );
-
-typedef
-WINGDIAPI
-BOOL
-(WINAPI *WinNtBitBlt) (
- HDC,
- INT32,
- INT32,
- INT32,
- INT32,
- HDC,
- INT32,
- INT32,
- DWORD
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtInvalidateRect) (
- HWND hWnd,
- CONST RECT *lpRect,
- BOOL bErase
- );
-
-typedef
-WINUSERAPI
-HDC
-(WINAPI *WinNtGetDC) (
- HWND hWnd
- );
-
-typedef
-WINUSERAPI
-INT32
-(WINAPI *WinNtReleaseDC) (
- HWND hWnd,
- HDC hDC
- );
-
-typedef
-WINUSERAPI
-ATOM
-(WINAPI *WinNtRegisterClassEx) (
- CONST WNDCLASSEX *
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtUnregisterClass) (
- LPCTSTR lpClassName,
- HINSTANCE hInstance
- );
-
-typedef
-WINUSERAPI
-HDC
-(WINAPI *WinNtBeginPaint) (
- HWND hWnd,
- LPPAINTSTRUCT lpPaint
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtEndPaint) (
- HWND hWnd,
- CONST PAINTSTRUCT *lpPaint
- );
-
-typedef
-WINUSERAPI
-VOID
-(WINAPI *WinNtPostQuitMessage) (
- INT32 nExitCode
- );
-
-typedef
-WINUSERAPI
-LRESULT
-(WINAPI *WinNtDefWindowProc) (
- HWND hWnd,
- UINT Msg,
- WPARAM wParam,
- LPARAM lParam
- );
-
-typedef
-WINUSERAPI
-HICON
-(WINAPI *WinNtLoadIcon) (
- HINSTANCE hInstance,
- LPCTSTR lpIconName
- );
-
-typedef
-WINUSERAPI
-HCURSOR
-(WINAPI *WinNtLoadCursor) (
- HINSTANCE hInstance,
- LPCTSTR lpCursorName
- );
-
-typedef
-WINGDIAPI
-HGDIOBJ
-(WINAPI *WinNtGetStockObject) (
- INT32
- );
-
-typedef
-WINGDIAPI
-BOOL
-(WINAPI *WinNtSetViewportOrgEx) (
- HDC,
- INT32,
- INT32,
- LPPOINT
- );
-
-typedef
-WINGDIAPI
-BOOL
-(WINAPI *WinNtSetWindowOrgEx) (
- HDC,
- INT32,
- INT32,
- LPPOINT
- );
-typedef
-WINGDIAPI
-BOOL
-(WINAPI *WinNtMoveWindow) (
- HWND,
- INT32,
- INT32,
- INT32,
- INT32,
- BOOL
- );
-
-typedef
-WINGDIAPI
-BOOL
-(WINAPI *WinNtGetWindowRect) (
- HWND,
- LPRECT
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtGetMessage) (
- LPMSG lpMsg,
- HWND hWnd,
- UINT wMsgFilterMin,
- UINT wMsgFilterMax
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtTranslateMessage) (
- CONST MSG *lpMsg
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtDispatchMessage) (
- CONST MSG *lpMsg
- );
-
-typedef
-WINUSERAPI
-HANDLE
-(WINAPI *WinNtGetProcessHeap) ();
-
-typedef
-WINUSERAPI
-LPVOID
-(WINAPI *WinNtHeapAlloc) (
- HANDLE hHeap,
- DWORD dwFlags,
- SIZE_T dwBytes
- );
-
-typedef
-WINUSERAPI
-BOOL
-(WINAPI *WinNtHeapFree) (
- HANDLE hHeap,
- DWORD dwFlags,
- LPVOID lpMem
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtFreeLibrary) (
- HANDLE ModHandle
- );
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtQueryPerformanceCounter) (
- LARGE_INTEGER *PerformanceCount
- );
-
-typedef
-WINBASEAPI
-BOOL
-(WINAPI *WinNtQueryPerformanceFrequency) (
- LARGE_INTEGER *Frequency
- );
-//
-//
-//
-
-#define EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE SIGNATURE_32 ('N', 'T', 'T', 'T')
-
-typedef struct {
- UINT64 Signature;
-
- //
- // Win32 Process APIs
- //
- WinNtGetProcAddress GetProcAddress;
- WinNtGetTickCount GetTickCount;
- WinNtLoadLibraryEx LoadLibraryEx;
- WinNtFreeLibrary FreeLibrary;
-
- WinNtSetPriorityClass SetPriorityClass;
- WinNtSetThreadPriority SetThreadPriority;
- WinNtSleep Sleep;
-
- WinNtSuspendThread SuspendThread;
- WinNtGetCurrentThread GetCurrentThread;
- WinNtGetCurrentThreadId GetCurrentThreadId;
- WinNtGetCurrentProcess GetCurrentProcess;
- WinNtCreateThread CreateThread;
- WinNtTerminateThread TerminateThread;
- WinNtSendMessage SendMessage;
- WinNtExitThread ExitThread;
- WinNtResumeThread ResumeThread;
- WinNtDuplicateHandle DuplicateHandle;
-
- //
- // Wint32 Mutex primitive
- //
- WinNtInitializeCriticalSection InitializeCriticalSection;
- WinNtEnterCriticalSection EnterCriticalSection;
- WinNtLeaveCriticalSection LeaveCriticalSection;
- WinNtDeleteCriticalSection DeleteCriticalSection;
- WinNtTlsAlloc TlsAlloc;
- WinNtTlsFree TlsFree;
- WinNtTlsSetValue TlsSetValue;
- WinNtTlsGetValue TlsGetValue;
- WinNtCreateSemaphore CreateSemaphore;
- WinNtWaitForSingleObject WaitForSingleObject;
- WinNtReleaseSemaphore ReleaseSemaphore;
-
- //
- // Win32 Console APIs
- //
- WinNtCreateConsoleScreenBuffer CreateConsoleScreenBuffer;
- WinNtFillConsoleOutputAttribute FillConsoleOutputAttribute;
- WinNtFillConsoleOutputCharacter FillConsoleOutputCharacter;
- WinNtGetConsoleCursorInfo GetConsoleCursorInfo;
- WinNtGetNumberOfConsoleInputEvents GetNumberOfConsoleInputEvents;
- WinNtPeekConsoleInput PeekConsoleInput;
- WinNtScrollConsoleScreenBuffer ScrollConsoleScreenBuffer;
- WinNtReadConsoleInput ReadConsoleInput;
-
- WinNtSetConsoleActiveScreenBuffer SetConsoleActiveScreenBuffer;
- WinNtSetConsoleCursorInfo SetConsoleCursorInfo;
- WinNtSetConsoleCursorPosition SetConsoleCursorPosition;
- WinNtSetConsoleScreenBufferSize SetConsoleScreenBufferSize;
- WinNtSetConsoleTitleW SetConsoleTitleW;
- WinNtWriteConsoleInput WriteConsoleInput;
- WinNtWriteConsoleOutput WriteConsoleOutput;
-
- //
- // Win32 File APIs
- //
- WinNtCreateFile CreateFile;
- WinNtDeviceIoControl DeviceIoControl;
- WinNtCreateDirectory CreateDirectory;
- WinNtRemoveDirectory RemoveDirectory;
- WinNtGetFileAttributes GetFileAttributes;
- WinNtSetFileAttributes SetFileAttributes;
- WinNtCreateFileMapping CreateFileMapping;
- WinNtCloseHandle CloseHandle;
- WinNtDeleteFile DeleteFile;
- WinNtFindFirstFile FindFirstFile;
- WinNtFindNextFile FindNextFile;
- WinNtFindClose FindClose;
- WinNtFlushFileBuffers FlushFileBuffers;
- WinNtGetEnvironmentVariable GetEnvironmentVariable;
- WinNtGetLastError GetLastError;
- WinNtSetErrorMode SetErrorMode;
- WinNtGetStdHandle GetStdHandle;
- WinNtMapViewOfFileEx MapViewOfFileEx;
- WinNtReadFile ReadFile;
- WinNtSetEndOfFile SetEndOfFile;
- WinNtSetFilePointer SetFilePointer;
- WinNtWriteFile WriteFile;
- WinNtGetFileInformationByHandle GetFileInformationByHandle;
- WinNtGetDiskFreeSpace GetDiskFreeSpace;
- WinNtGetDiskFreeSpaceEx GetDiskFreeSpaceEx;
- WinNtMoveFile MoveFile;
- WinNtSetFileTime SetFileTime;
- WinNtSystemTimeToFileTime SystemTimeToFileTime;
-
- //
- // Win32 Time APIs
- //
- WinNtLocalFileTimeToFileTime LocalFileTimeToFileTime;
- WinNtFileTimeToLocalFileTime FileTimeToLocalFileTime;
- WinNtFileTimeToSystemTime FileTimeToSystemTime;
- WinNtGetSystemTime GetSystemTime;
- WinNtSetSystemTime SetSystemTime;
- WinNtGetLocalTime GetLocalTime;
- WinNtSetLocalTime SetLocalTime;
- WinNtGetTimeZoneInformation GetTimeZoneInformation;
- WinNtSetTimeZoneInformation SetTimeZoneInformation;
- WinNttimeSetEvent timeSetEvent;
- WinNttimeKillEvent timeKillEvent;
-
- //
- // Win32 Serial APIs
- //
- WinNtClearCommError ClearCommError;
- WinNtEscapeCommFunction EscapeCommFunction;
- WinNtGetCommModemStatus GetCommModemStatus;
- WinNtGetCommState GetCommState;
- WinNtSetCommState SetCommState;
- WinNtPurgeComm PurgeComm;
- WinNtSetCommTimeouts SetCommTimeouts;
-
- WinNtExitProcess ExitProcess;
-
- WinNtSprintf SPrintf;
-
- WinNtGetDesktopWindow GetDesktopWindow;
- WinNtGetForegroundWindow GetForegroundWindow;
- WinNtCreateWindowEx CreateWindowEx;
- WinNtShowWindow ShowWindow;
- WinNtUpdateWindow UpdateWindow;
- WinNtDestroyWindow DestroyWindow;
- WinNtInvalidateRect InvalidateRect;
- WinNtGetWindowDC GetWindowDC;
- WinNtGetClientRect GetClientRect;
- WinNtAdjustWindowRect AdjustWindowRect;
- WinNtSetDIBitsToDevice SetDIBitsToDevice;
- WinNtBitBlt BitBlt;
- WinNtGetDC GetDC;
- WinNtReleaseDC ReleaseDC;
- WinNtRegisterClassEx RegisterClassEx;
- WinNtUnregisterClass UnregisterClass;
-
- WinNtBeginPaint BeginPaint;
- WinNtEndPaint EndPaint;
- WinNtPostQuitMessage PostQuitMessage;
- WinNtDefWindowProc DefWindowProc;
- WinNtLoadIcon LoadIcon;
- WinNtLoadCursor LoadCursor;
- WinNtGetStockObject GetStockObject;
- WinNtSetViewportOrgEx SetViewportOrgEx;
- WinNtSetWindowOrgEx SetWindowOrgEx;
- WinNtMoveWindow MoveWindow;
- WinNtGetWindowRect GetWindowRect;
-
- WinNtGetMessage GetMessage;
- WinNtTranslateMessage TranslateMessage;
- WinNtDispatchMessage DispatchMessage;
-
- WinNtGetProcessHeap GetProcessHeap;
- WinNtHeapAlloc HeapAlloc;
- WinNtHeapFree HeapFree;
-
- WinNtQueryPerformanceCounter QueryPerformanceCounter;
- WinNtQueryPerformanceFrequency QueryPerformanceFrequency;
-
-} EFI_WIN_NT_THUNK_PROTOCOL;
-
-extern EFI_GUID gEfiWinNtThunkProtocolGuid;
-
-#endif
diff --git a/Nt32Pkg/Include/WinNtDxe.h b/Nt32Pkg/Include/WinNtDxe.h
deleted file mode 100644
index c57ab93f68..0000000000
--- a/Nt32Pkg/Include/WinNtDxe.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
- WinNtLib.h
-
-Abstract:
- Public include file for the WinNt Library
-
-**/
-
-#ifndef __WIN_NT_DXE_H__
-#define __WIN_NT_DXE_H__
-
-//
-// This forces Windows.h WIN32 include file to be included
-// it's needed for WinNtThunk.h
-// WinNtIo.h depends on WinNtThunk.h
-//
-#include
-#endif
diff --git a/Nt32Pkg/Include/WinNtPeim.h b/Nt32Pkg/Include/WinNtPeim.h
deleted file mode 100644
index 57d66a2629..0000000000
--- a/Nt32Pkg/Include/WinNtPeim.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
- WinNtLib.h
-
-Abstract:
- Public include file for the WinNt Library
-
-**/
-
-#ifndef __WIN_NT_PEIM_H__
-#define __WIN_NT_PEIM_H__
-
-//
-// This forces Windows.h WIN32 include file to be included
-// it's needed for WinNtThunk.h
-//
-#include
-
-#include
-
-#endif
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf
deleted file mode 100644
index dd98ba1ede..0000000000
--- a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf
+++ /dev/null
@@ -1,45 +0,0 @@
-## @file
-# Memory Status Code Library for UEFI drivers
-#
-# Lib to provide memory journal status code reporting Routines
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = DxeNt32OemHookStatusCodeLib
- FILE_GUID = EF172A23-C7C5-47b7-B24E-D10DFE15540F
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = OemHookStatusCodeLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-# HOB Guid C Name: gEfiWinNtThunkProtocolGuid Hob Type: GUID_EXTENSION
-#
-
-[Sources]
- Nt32OemHookStatusCodeLib.c
-
-
-[Packages]
- Nt32Pkg/Nt32Pkg.dec
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- ReportStatusCodeLib
- BaseMemoryLib
- PrintLib
- HobLib
- DebugLib
-
-[Protocols]
- gEfiWinNtThunkProtocolGuid # ALWAYS_CONSUMED
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c
deleted file mode 100644
index a69dc338b3..0000000000
--- a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/** @file
- OEM hook status code library functions with no library constructor/destructor
-
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
- Module Name: Nt32OemHookStatusCodeLib.c
-
-**/
-
-//
-// The package level header files this module uses
-//
-#include
-
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-#include
-#include
-//
-// The Library classes this module consumes
-//
-#include
-#include
-#include
-#include
-#include
-#include
-
-//
-// Cache of WinNtThunk protocol
-//
-EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;
-
-//
-// Cache of standard output handle .
-//
-HANDLE mStdOut;
-
-/**
-
- Initialize OEM status code device .
-
- @return Always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-OemHookStatusCodeInitialize (
- VOID
- )
-{
- EFI_HOB_GUID_TYPE *GuidHob;
-
- //
- // Retrieve WinNtThunkProtocol from GUID'ed HOB
- //
- GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);
- ASSERT (GuidHob != NULL);
- mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));
- ASSERT (mWinNt != NULL);
-
- //
- // Cache standard output handle.
- //
- mStdOut = mWinNt->GetStdHandle (STD_OUTPUT_HANDLE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Report status code to OEM device.
-
- @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
-
- @param Value Describes the current status of a hardware or software entity.
- This included information about the class and subclass that is used to classify the entity
- as well as an operation. For progress codes, the operation is the current activity.
- For error codes, it is the exception. For debug codes, it is not defined at this time.
- Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
- Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
-
- @param Instance The enumeration of a hardware or software entity within the system.
- A system may contain multiple entities that match a class/subclass pairing.
- The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
- not meaningful, or not relevant. Valid instance numbers start with 1.
-
-
- @param CallerId This optional parameter may be used to identify the caller.
- This parameter allows the status code driver to apply different rules to different callers.
- Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
-
-
- @param Data This optional parameter may be used to pass additional data
-
- @return The function always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-OemHookStatusCodeReport (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID *CallerId, OPTIONAL
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-{
- CHAR8 *Filename;
- CHAR8 *Description;
- CHAR8 *Format;
- CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
- UINT32 ErrorLevel;
- UINT32 LineNumber;
- UINTN CharCount;
- BASE_LIST Marker;
-
- Buffer[0] = '\0';
-
- if (Data != NULL &&
- ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {
- //
- // Print ASSERT() information into output buffer.
- //
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "\n\rASSERT!: %a (%d): %a\n\r",
- Filename,
- LineNumber,
- Description
- );
-
- //
- // Callout to standard output.
- //
- mWinNt->WriteFile (
- mStdOut,
- Buffer,
- (DWORD)CharCount,
- (LPDWORD)&CharCount,
- NULL
- );
-
- return EFI_SUCCESS;
-
- } else if (Data != NULL &&
- ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
- //
- // Print DEBUG() information into output buffer.
- //
- CharCount = AsciiBSPrint (
- Buffer,
- sizeof (Buffer),
- Format,
- Marker
- );
- } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
- //
- // Print ERROR information into output buffer.
- //
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "ERROR: C%x:V%x I%x",
- CodeType,
- Value,
- Instance
- );
-
- //
- // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
- //
-
- if (CallerId != NULL) {
- CharCount += AsciiSPrint (
- &Buffer[CharCount - 1],
- (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
- " %g",
- CallerId
- );
- }
-
- if (Data != NULL) {
- CharCount += AsciiSPrint (
- &Buffer[CharCount - 1],
- (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
- " %p",
- Data
- );
- }
-
- CharCount += AsciiSPrint (
- &Buffer[CharCount - 1],
- (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
- "\n\r"
- );
- } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "PROGRESS CODE: V%x I%x\n\r",
- Value,
- Instance
- );
- } else {
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "Undefined: C%x:V%x I%x\n\r",
- CodeType,
- Value,
- Instance
- );
- }
-
- //
- // Callout to standard output.
- //
- mWinNt->WriteFile (
- mStdOut,
- Buffer,
- (DWORD)CharCount,
- (LPDWORD)&CharCount,
- NULL
- );
-
- return EFI_SUCCESS;
-}
-
diff --git a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c b/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c
deleted file mode 100644
index 82bbbdef4c..0000000000
--- a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- PeiNt32PeCoffExtraActionLib.c
-
-Abstract:
-
- Provides services to perform additional actions to relocate and unload
- PE/Coff image for NT32 environment specific purpose such as souce level debug.
- This version only works for DXE phase
-
-
-**/
-//
-// The package level header files this module uses
-//
-#include
-
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#define MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE 0x100
-
-typedef struct {
- CHAR8 *PdbPointer;
- VOID *ModHandle;
-} PDB_NAME_TO_MOD_HANDLE;
-
-
-//
-// Cache of WinNtThunk protocol
-//
-EFI_WIN_NT_THUNK_PROTOCOL *mWinNt = NULL;
-
-//
-// An Array to hold the ModHandle
-//
-PDB_NAME_TO_MOD_HANDLE *mPdbNameModHandleArray = NULL;
-UINTN mPdbNameModHandleArraySize = 0;
-
-
-/**
- The constructor function gets the pointer of the WinNT thunk functions
- It will ASSERT() if NT thunk protocol is not installed.
-
- @retval EFI_SUCCESS WinNT thunk protocol is found and cached.
-
-**/
-EFI_STATUS
-EFIAPI
-Nt32PeCoffGetWinNtThunkStucture (
- VOID
- )
-{
- EFI_HOB_GUID_TYPE *GuidHob;
-
- //
- // Retrieve WinNtThunkProtocol from GUID'ed HOB
- //
- GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);
- ASSERT (GuidHob != NULL);
- mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));
- ASSERT (mWinNt != NULL);
-
-
- return EFI_SUCCESS;
-}
-
-/**
- Convert the passed in Ascii string to Unicode.
-
- This function Convert the passed in Ascii string to Unicode.Optionally return
- the length of the strings..
-
- @param AsciiString Pointer to an AscII string
- @param StrLen Length of string
-
- @return Pointer to malloc'ed Unicode version of Ascii
-
-**/
-CHAR16 *
-AsciiToUnicode (
- IN CHAR8 *Ascii,
- IN UINTN *StrLen OPTIONAL
- )
-{
- UINTN Index;
- CHAR16 *Unicode;
-
- //
- // Allocate a buffer for unicode string
- //
- for (Index = 0; Ascii[Index] != '\0'; Index++)
- ;
- Unicode = mWinNt->HeapAlloc ( mWinNt->GetProcessHeap (),
- HEAP_ZERO_MEMORY,
- ((Index + 1) * sizeof (CHAR16))
- );
- if (Unicode == NULL) {
- return NULL;
- }
-
- for (Index = 0; Ascii[Index] != '\0'; Index++) {
- Unicode[Index] = (CHAR16) Ascii[Index];
- }
-
- Unicode[Index] = '\0';
-
- if (StrLen != NULL) {
- *StrLen = Index;
- }
-
- return Unicode;
-}
-/**
- Store the ModHandle in an array indexed by the Pdb File name.
- The ModHandle is needed to unload the image.
-
-
- @param ImageContext - Input data returned from PE Laoder Library. Used to find the
- .PDB file name of the PE Image.
- @param ModHandle - Returned from LoadLibraryEx() and stored for call to
- FreeLibrary().
-
- @return return EFI_SUCCESS when ModHandle was stored.
-
---*/
-EFI_STATUS
-AddModHandle (
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN VOID *ModHandle
- )
-
-{
- UINTN Index;
- PDB_NAME_TO_MOD_HANDLE *Array;
- UINTN PreviousSize;
- PDB_NAME_TO_MOD_HANDLE *TempArray;
- HANDLE Handle;
-
- //
- // Return EFI_ALREADY_STARTED if this DLL has already been loaded
- //
- Array = mPdbNameModHandleArray;
- for (Index = 0; Index < mPdbNameModHandleArraySize; Index++, Array++) {
- if (Array->PdbPointer != NULL && Array->ModHandle == ModHandle) {
- return EFI_ALREADY_STARTED;
- }
- }
-
- Array = mPdbNameModHandleArray;
- for (Index = 0; Index < mPdbNameModHandleArraySize; Index++, Array++) {
- if (Array->PdbPointer == NULL) {
- //
- // Make a copy of the stirng and store the ModHandle
- //
- Handle = mWinNt->GetProcessHeap ();
- Array->PdbPointer = mWinNt->HeapAlloc ( Handle,
- HEAP_ZERO_MEMORY,
- AsciiStrLen (ImageContext->PdbPointer) + 1
- );
-
- ASSERT (Array->PdbPointer != NULL);
-
- AsciiStrCpy (Array->PdbPointer, ImageContext->PdbPointer);
- Array->ModHandle = ModHandle;
- return EFI_SUCCESS;
- }
- }
-
- //
- // No free space in mPdbNameModHandleArray so grow it by
- // MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE entires.
- //
- PreviousSize = mPdbNameModHandleArraySize * sizeof (PDB_NAME_TO_MOD_HANDLE);
- mPdbNameModHandleArraySize += MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE;
- //
- // re-allocate a new buffer and copy the old values to the new locaiton.
- //
- TempArray = mWinNt->HeapAlloc ( mWinNt->GetProcessHeap (),
- HEAP_ZERO_MEMORY,
- mPdbNameModHandleArraySize * sizeof (PDB_NAME_TO_MOD_HANDLE)
- );
-
- CopyMem ((VOID *) (UINTN) TempArray, (VOID *) (UINTN)mPdbNameModHandleArray, PreviousSize);
-
- mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, mPdbNameModHandleArray);
-
- mPdbNameModHandleArray = TempArray;
- if (mPdbNameModHandleArray == NULL) {
- ASSERT (FALSE);
- return EFI_OUT_OF_RESOURCES;
- }
-
-
- return AddModHandle (ImageContext, ModHandle);
-}
-/**
- Return the ModHandle and delete the entry in the array.
-
-
- @param ImageContext - Input data returned from PE Laoder Library. Used to find the
- .PDB file name of the PE Image.
-
- @return
- ModHandle - ModHandle assoicated with ImageContext is returned
- NULL - No ModHandle associated with ImageContext
-
-**/
-VOID *
-RemoveModeHandle (
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- UINTN Index;
- PDB_NAME_TO_MOD_HANDLE *Array;
-
- if (ImageContext->PdbPointer == NULL) {
- //
- // If no PDB pointer there is no ModHandle so return NULL
- //
- return NULL;
- }
-
- Array = mPdbNameModHandleArray;
- for (Index = 0; Index < mPdbNameModHandleArraySize; Index++, Array++) {
- if ((Array->PdbPointer != NULL) && (AsciiStrCmp(Array->PdbPointer, ImageContext->PdbPointer) == 0)) {
- //
- // If you find a match return it and delete the entry
- //
- mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, Array->PdbPointer);
- Array->PdbPointer = NULL;
- return Array->ModHandle;
- }
- }
-
- return NULL;
-}
-
-/**
- Performs additional actions after a PE/COFF image has been loaded and relocated.
-
- For NT32, this function load symbols to support source level debugging.
-
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the
- PE/COFF image that has already been loaded and relocated.
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderRelocateImageExtraAction (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- EFI_STATUS Status;
- VOID *DllEntryPoint;
- CHAR16 *DllFileName;
- HMODULE Library;
- UINTN Index;
-
- ASSERT (ImageContext != NULL);
-
- if (mWinNt == NULL) {
- Nt32PeCoffGetWinNtThunkStucture ();
- }
-
- //
- // If we load our own PE COFF images the Windows debugger can not source
- // level debug our code. If a valid PDB pointer exists usw it to load
- // the *.dll file as a library using Windows* APIs. This allows
- // source level debug. The image is still loaded and relocated
- // in the Framework memory space like on a real system (by the code above),
- // but the entry point points into the DLL loaded by the code bellow.
- //
-
- DllEntryPoint = NULL;
-
- //
- // Load the DLL if it's not an EBC image.
- //
- if ((ImageContext->PdbPointer != NULL) &&
- (ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {
- //
- // Convert filename from ASCII to Unicode
- //
- DllFileName = AsciiToUnicode (ImageContext->PdbPointer, &Index);
-
- //
- // Check that we have a valid filename
- //
- if (Index < 5 || DllFileName[Index - 4] != '.') {
- mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);
-
- //
- // Never return an error if PeCoffLoaderRelocateImage() succeeded.
- // The image will run, but we just can't source level debug. If we
- // return an error the image will not run.
- //
- return;
- }
- //
- // Replace .PDB with .DLL on the filename
- //
- DllFileName[Index - 3] = 'D';
- DllFileName[Index - 2] = 'L';
- DllFileName[Index - 1] = 'L';
-
- //
- // Load the .DLL file into the user process's address space for source
- // level debug
- //
- Library = mWinNt->LoadLibraryEx (DllFileName, NULL, DONT_RESOLVE_DLL_REFERENCES);
- if (Library != NULL) {
- //
- // InitializeDriver is the entry point we put in all our EFI DLL's. The
- // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() suppresses the
- // normal DLL entry point of DllMain, and prevents other modules that are
- // referenced in side the DllFileName from being loaded. There is no error
- // checking as the we can point to the PE32 image loaded by Tiano. This
- // step is only needed for source level debugging
- //
- DllEntryPoint = (VOID *) (UINTN) mWinNt->GetProcAddress (Library, "InitializeDriver");
-
- }
-
- if ((Library != NULL) && (DllEntryPoint != NULL)) {
- Status = AddModHandle (ImageContext, Library);
- if (Status == EFI_ALREADY_STARTED) {
- //
- // If the DLL has already been loaded before, then this instance of the DLL can not be debugged.
- //
- ImageContext->PdbPointer = NULL;
- DEBUG ((EFI_D_ERROR, "WARNING: DLL already loaded. No source level debug %s. \n", DllFileName));
- } else {
- //
- // This DLL is not already loaded, so source level debugging is supported.
- //
- ImageContext->EntryPoint = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;
- DEBUG ((EFI_D_INFO, "LoadLibraryEx (%s,\n NULL, DONT_RESOLVE_DLL_REFERENCES)\n", DllFileName));
- }
- } else {
- //
- // This DLL does not support source level debugging at all.
- //
- DEBUG ((EFI_D_ERROR, "WARNING: No source level debug %s. \n", DllFileName));
- }
-
- mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);
- }
-
- //
- // Never return an error if PeCoffLoaderRelocateImage() succeeded.
- // The image will run, but we just can't source level debug. If we
- // return an error the image will not run.
- //
- return;
-}
-
-/**
- Performs additional actions just before a PE/COFF image is unloaded. Any resources
- that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
-
- For NT32, this function unloads symbols for source level debugging.
-
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the
- PE/COFF image that is being unloaded.
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderUnloadImageExtraAction (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- VOID *ModHandle;
-
- ASSERT (ImageContext != NULL);
-
- ModHandle = RemoveModeHandle (ImageContext);
- if (ModHandle != NULL) {
- mWinNt->FreeLibrary (ModHandle);
- }
- return;
-}
diff --git a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf b/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf
deleted file mode 100644
index d81517a4a2..0000000000
--- a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf
+++ /dev/null
@@ -1,40 +0,0 @@
-## @file
-# PeCoff extra action libary for DXE phase that run NT32 emulator.
-#
-# Lib to provide memory journal status code reporting Routines
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = DxeNt32PeCoffExtraActionLib
- FILE_GUID = 23AF9A54-3D7C-444d-8318-E9CF752DA349
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PeCoffExtraActionLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_DRIVER
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- DxeNt32PeCoffExtraActionLib.c
-
-[Packages]
- Nt32Pkg/Nt32Pkg.dec
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- DebugLib
- HobLib
- BaseMemoryLib
-
-[Protocols]
- gEfiWinNtThunkProtocolGuid # ALWAYS_CONSUMED
-
diff --git a/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf b/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf
deleted file mode 100644
index 47430e86b9..0000000000
--- a/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf
+++ /dev/null
@@ -1,42 +0,0 @@
-## @file
-# A library to produce the global variable 'gWinNt'
-#
-# This library contains a single global variable 'gWinNt' along with a constructor to initialize that global.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = DxeWinNtLib
- FILE_GUID = f6b5871d-5226-41b3-a569-3ff893fdc7bc
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = WinNtLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
-
- CONSTRUCTOR = WinNtLibConstructor
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-# HOB Guid C Name: gEfiWinNtThunkProtocolGuid Hob Type: GUID_EXTENSION
-#
-
-[Sources]
- WinNtLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- HobLib
- DebugLib
-
-[Protocols]
- gEfiWinNtThunkProtocolGuid # Used as HOB in the code.
-
diff --git a/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c b/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c
deleted file mode 100644
index 55d6f9c231..0000000000
--- a/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- WinNtLib.c
-
-Abstract:
-
- WinNt Library
-
-**/
-
-#include
-#include
-#include
-#include
-#include
-
-
-EFI_WIN_NT_THUNK_PROTOCOL *gWinNt;
-
-EFI_STATUS
-WinNtLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
---*/
-{
- EFI_HOB_GUID_TYPE *GuidHob;
-
- GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);
- ASSERT (GuidHob != NULL);
- gWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));
- ASSERT (gWinNt != NULL);
- return EFI_SUCCESS;
-}
diff --git a/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf b/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf
deleted file mode 100644
index 011c9d64ed..0000000000
--- a/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf
+++ /dev/null
@@ -1,38 +0,0 @@
-## @file
-# Component description file for the EdkNt32PeiPeCoffGetEntryPointLib library.
-#
-# PeCoffGetEntryPointLib library class for NT32 instance implemented by use NTPeiLoadFile PPI.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = EdkNt32PeiPeCoffGetEntryPointLib
- FILE_GUID = 434b164e-5fa6-4a3d-bc04-02da2a4eeb26
- MODULE_TYPE = PEIM
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PeCoffGetEntryPointLib|PEI_CORE PEIM SEC
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- PeCoffGetEntryPoint.c
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- PeiServicesLib
-
-[Ppis]
- gNtPeiLoadFilePpiGuid # PPI ALWAYS_CONSUMED
-
diff --git a/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c b/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
deleted file mode 100644
index 58a88a4569..0000000000
--- a/Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- PeCoffGetEntryPoint.c
-
-Abstract:
-
- Tiano PE/COFF loader
-
-Revision History
-
-**/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetEntryPoint (
- IN VOID *Pe32Data,
- IN OUT VOID **EntryPoint
- )
-/*++
-
-Routine Description:
-
- Loads a PE/COFF image into memory, this is not follow the original purpose of
- PeCoffGetEntryPoint library class. But it's ok that Unix package not run on a real
- platform and this is for source level debug.
-
-Arguments:
-
- Pe32Data - Pointer to a PE/COFF Image
-
- EntryPoint - Pointer to the entry point of the PE/COFF image
-
-Returns:
-
- EFI_SUCCESS if the EntryPoint was returned
- EFI_INVALID_PARAMETER if the EntryPoint could not be found from Pe32Data
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
- NT_PEI_LOAD_FILE_PPI *PeiNtService;
- EFI_PHYSICAL_ADDRESS ImageAddress;
- UINT64 ImageSize;
- EFI_PHYSICAL_ADDRESS ImageEntryPoint;
-
- ASSERT (Pe32Data != NULL);
- ASSERT (EntryPoint != NULL);
-
- Status = PeiServicesLocatePpi (
- &gNtPeiLoadFilePpiGuid,
- 0,
- &PpiDescriptor,
- (VOID**)&PeiNtService
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = PeiNtService->PeiLoadFileService (
- Pe32Data,
- &ImageAddress,
- &ImageSize,
- &ImageEntryPoint
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;
- return Status;
-}
-
-/**
- Returns the machine type of PE/COFF image.
- This is copied from MDE BasePeCoffGetEntryPointLib, the code should be sync with it.
- The reason is NT32 package needs to load the image to memory to support source
- level debug.
-
-
- @param Pe32Data Pointer to a PE/COFF header
-
- @return Machine type or zero if not a valid iamge
-
-**/
-UINT16
-EFIAPI
-PeCoffLoaderGetMachineType (
- IN VOID *Pe32Data
- )
-{
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DOS_HEADER *DosHdr;
-
- ASSERT (Pe32Data != NULL);
-
- DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
-
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- return Hdr.Te->Machine;
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- return Hdr.Pe32->FileHeader.Machine;
- }
-
- return 0x0000;
-}
-
-/**
- Returns a pointer to the PDB file name for a PE/COFF image that has been
- loaded into system memory with the PE/COFF Loader Library functions.
-
- Returns the PDB file name for the PE/COFF image specified by Pe32Data. If
- the PE/COFF image specified by Pe32Data is not a valid, then NULL is
- returned. If the PE/COFF image specified by Pe32Data does not contain a
- debug directory entry, then NULL is returned. If the debug directory entry
- in the PE/COFF image specified by Pe32Data does not contain a PDB file name,
- then NULL is returned.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return The PDB file name for the PE/COFF image specified by Pe32Data or NULL
- if it cannot be retrieved.
-
-**/
-VOID *
-EFIAPI
-PeCoffLoaderGetPdbPointer (
- IN VOID *Pe32Data
- )
-{
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINTN DirCount;
- VOID *CodeViewEntryPointer;
- INTN TEImageAdjust;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
-
- ASSERT (Pe32Data != NULL);
-
- TEImageAdjust = 0;
- DirectoryEntry = NULL;
- DebugEntry = NULL;
- NumberOfRvaAndSizes = 0;
-
- DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
-
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- if (Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {
- DirectoryEntry = &Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];
- TEImageAdjust = sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) Hdr.Te +
- Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +
- TEImageAdjust);
- }
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- //
- // NOTE: We use Machine field to identify PE32/PE32+, instead of Magic.
- // It is due to backward-compatibility, for some system might
- // generate PE32+ image with PE32 Magic.
- //
- switch (Hdr.Pe32->FileHeader.Machine) {
- case IMAGE_FILE_MACHINE_I386:
- //
- // Assume PE32 image with IA32 Machine field.
- //
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- break;
- case IMAGE_FILE_MACHINE_X64:
- case IMAGE_FILE_MACHINE_IA64:
- //
- // Assume PE32+ image with X64 or IA64 Machine field
- //
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- break;
- default:
- //
- // For unknow Machine field, use Magic in optional Header
- //
- Magic = Hdr.Pe32->OptionalHeader.Magic;
- }
-
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
- } else if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- //
- // Use PE32+ offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
- }
-
- if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- DirectoryEntry = NULL;
- DebugEntry = NULL;
- }
- } else {
- return NULL;
- }
-
- if (DebugEntry == NULL || DirectoryEntry == NULL) {
- return NULL;
- }
-
- for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {
- if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- if (DebugEntry->SizeOfData > 0) {
- CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + ((UINTN)Pe32Data) + (UINTN)TEImageAdjust);
- switch (* (UINT32 *) CodeViewEntryPointer) {
- case CODEVIEW_SIGNATURE_NB10:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));
- case CODEVIEW_SIGNATURE_RSDS:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY));
- case CODEVIEW_SIGNATURE_MTOC:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY));
- break;
- default:
- break;
- }
- }
- }
- }
-
- return NULL;
-}
-
-/**
- Returns the size of the PE/COFF headers
-
- Returns the size of the PE/COFF header specified by Pe32Data.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return Size of PE/COFF header in bytes or zero if not a valid image.
-
-**/
-UINT32
-EFIAPI
-PeCoffGetSizeOfHeaders (
- IN VOID *Pe32Data
- )
-{
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- UINTN SizeOfHeaders;
-
- ASSERT (Pe32Data != NULL);
-
- DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
-
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;
- } else {
- SizeOfHeaders = 0;
- }
-
- return (UINT32) SizeOfHeaders;
-}
-
diff --git a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c
deleted file mode 100644
index e7c2df046a..0000000000
--- a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/** @file
- OEM hook status code library functions with no library constructor/destructor
-
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
- Module Name: Nt32OemHookStatusCodeLib.c
-
-**/
-
-//
-// The package level header files this module uses
-//
-#include
-
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-#include
-#include
-//
-// The Library classes this module consumes
-//
-#include
-#include
-#include
-#include
-#include
-#include
-
-//
-// Cache of WinNtThunk protocol
-//
-EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;
-
-//
-// Cache of standard output handle .
-//
-HANDLE mStdOut;
-
-/**
-
- Initialize OEM status code device .
-
- @return Always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-OemHookStatusCodeInitialize (
- VOID
- )
-{
- PEI_NT_THUNK_PPI *NtThunkPpi;
- EFI_STATUS Status;
-
-
- //
- // Locate NtThunkPpi for retrieving standard output handle
- //
- Status = PeiServicesLocatePpi (
- &gPeiNtThunkPpiGuid,
- 0,
- NULL,
- (VOID **) &NtThunkPpi
- );
-
- ASSERT_EFI_ERROR (Status);
-
- mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *) NtThunkPpi->NtThunk ();
-
-
- //
- // Cache standard output handle.
- //
- mStdOut = mWinNt->GetStdHandle (STD_OUTPUT_HANDLE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Report status code to OEM device.
-
- @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
-
- @param Value Describes the current status of a hardware or software entity.
- This included information about the class and subclass that is used to classify the entity
- as well as an operation. For progress codes, the operation is the current activity.
- For error codes, it is the exception. For debug codes, it is not defined at this time.
- Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
- Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
-
- @param Instance The enumeration of a hardware or software entity within the system.
- A system may contain multiple entities that match a class/subclass pairing.
- The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
- not meaningful, or not relevant. Valid instance numbers start with 1.
-
-
- @param CallerId This optional parameter may be used to identify the caller.
- This parameter allows the status code driver to apply different rules to different callers.
- Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
-
-
- @param Data This optional parameter may be used to pass additional data
-
- @return The function always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-OemHookStatusCodeReport (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID *CallerId, OPTIONAL
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-{
- CHAR8 *Filename;
- CHAR8 *Description;
- CHAR8 *Format;
- CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
- UINT32 ErrorLevel;
- UINT32 LineNumber;
- UINTN CharCount;
- BASE_LIST Marker;
-
- Buffer[0] = '\0';
-
- if (Data != NULL &&
- ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {
- //
- // Print ASSERT() information into output buffer.
- //
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "\n\rASSERT!: %a (%d): %a\n\r",
- Filename,
- LineNumber,
- Description
- );
-
- //
- // Callout to standard output.
- //
- mWinNt->WriteFile (
- mStdOut,
- Buffer,
- (DWORD)CharCount,
- (LPDWORD)&CharCount,
- NULL
- );
-
- return EFI_SUCCESS;
-
- } else if (Data != NULL &&
- ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
- //
- // Print DEBUG() information into output buffer.
- //
- CharCount = AsciiBSPrint (
- Buffer,
- sizeof (Buffer),
- Format,
- Marker
- );
- } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
- //
- // Print ERROR information into output buffer.
- //
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "ERROR: C%x:V%x I%x",
- CodeType,
- Value,
- Instance
- );
-
- //
- // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
- //
-
- if (CallerId != NULL) {
- CharCount += AsciiSPrint (
- &Buffer[CharCount - 1],
- (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
- " %g",
- CallerId
- );
- }
-
- if (Data != NULL) {
- CharCount += AsciiSPrint (
- &Buffer[CharCount - 1],
- (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
- " %p",
- Data
- );
- }
-
- CharCount += AsciiSPrint (
- &Buffer[CharCount - 1],
- (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
- "\n\r"
- );
- } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "PROGRESS CODE: V%x I%x\n\r",
- Value,
- Instance
- );
- } else {
- CharCount = AsciiSPrint (
- Buffer,
- sizeof (Buffer),
- "Undefined: C%x:V%x I%x\n\r",
- CodeType,
- Value,
- Instance
- );
- }
-
- //
- // Callout to standard output.
- //
- mWinNt->WriteFile (
- mStdOut,
- Buffer,
- (DWORD)CharCount,
- (LPDWORD)&CharCount,
- NULL
- );
-
- return EFI_SUCCESS;
-}
-
diff --git a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf b/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf
deleted file mode 100644
index 5df74af95f..0000000000
--- a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf
+++ /dev/null
@@ -1,44 +0,0 @@
-## @file
-# Memory Status Code Library for UEFI drivers
-#
-# Lib to provide memory journal status code reporting Routines
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PeiNt32OemHookStatusCodeLib
- FILE_GUID = 0C2070F9-02A7-4e8e-B584-84EA922363FB
- MODULE_TYPE = PEIM
- VERSION_STRING = 1.0
- LIBRARY_CLASS = OemHookStatusCodeLib|PEIM
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- Nt32OemHookStatusCodeLib.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- PeiServicesLib
- ReportStatusCodeLib
- BaseMemoryLib
- PrintLib
- DebugLib
-
-[Ppis]
- gPeiNtThunkPpiGuid # PPI ALWAYS_CONSUMED
-
diff --git a/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c b/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c
deleted file mode 100644
index 1035b92a10..0000000000
--- a/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- PeiNt32PeCoffExtraActionLib.c
-
-Abstract:
-
- Provides services to perform additional actions to relocate and unload
- PE/Coff image for NT32 environment specific purpose such as souce level debug.
- This version only works for PEI phase
-
-
-**/
-//
-// The package level header files this module uses
-//
-#include
-#include
-
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-//
-// Cache of WinNtThunk protocol
-//
-EFI_WIN_NT_THUNK_PROTOCOL *mWinNt = NULL;
-
-/**
- The function caches the pointer of the WinNT thunk functions
- It will ASSERT() if NT thunk ppi is not installed.
-
- @retval EFI_SUCCESS WinNT thunk protocol is found and cached.
-
-**/
-EFI_STATUS
-EFIAPI
-Nt32PeCoffGetWinNtThunkStucture (
- )
-{
- PEI_NT_THUNK_PPI *NtThunkPpi;
- EFI_STATUS Status;
-
-
- //
- // Locate NtThunkPpi for retrieving standard output handle
- //
- Status = PeiServicesLocatePpi (
- &gPeiNtThunkPpiGuid,
- 0,
- NULL,
- (VOID **) &NtThunkPpi
- );
-
- ASSERT_EFI_ERROR (Status);
-
- mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *) NtThunkPpi->NtThunk ();
-
- return EFI_SUCCESS;
-}
-
-/**
- Convert the passed in Ascii string to Unicode.
-
- This function Convert the passed in Ascii string to Unicode.Optionally return
- the length of the strings..
-
- @param AsciiString Pointer to an AscII string
- @param StrLen Length of string
-
- @return Pointer to malloc'ed Unicode version of Ascii
-
-**/
-CHAR16 *
-AsciiToUnicode (
- IN CHAR8 *Ascii,
- IN UINTN *StrLen OPTIONAL
- )
-{
- UINTN Index;
- CHAR16 *Unicode;
-
- //
- // Allocate a buffer for unicode string
- //
- for (Index = 0; Ascii[Index] != '\0'; Index++)
- ;
- Unicode = mWinNt->HeapAlloc ( mWinNt->GetProcessHeap (),
- HEAP_ZERO_MEMORY,
- ((Index + 1) * sizeof (CHAR16))
- );
- if (Unicode == NULL) {
- return NULL;
- }
-
- for (Index = 0; Ascii[Index] != '\0'; Index++) {
- Unicode[Index] = (CHAR16) Ascii[Index];
- }
-
- Unicode[Index] = '\0';
-
- if (StrLen != NULL) {
- *StrLen = Index;
- }
-
- return Unicode;
-}
-
-/**
- Performs additional actions after a PE/COFF image has been loaded and relocated.
-
- For NT32, this function load symbols to support source level debugging.
-
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the
- PE/COFF image that has already been loaded and relocated.
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderRelocateImageExtraAction (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- VOID *DllEntryPoint;
- CHAR16 *DllFileName;
- HMODULE Library;
- UINTN Index;
-
- ASSERT (ImageContext != NULL);
-
- if (mWinNt == NULL) {
- Nt32PeCoffGetWinNtThunkStucture ();
- }
- //
- // If we load our own PE COFF images the Windows debugger can not source
- // level debug our code. If a valid PDB pointer exists usw it to load
- // the *.dll file as a library using Windows* APIs. This allows
- // source level debug. The image is still loaded and relocated
- // in the Framework memory space like on a real system (by the code above),
- // but the entry point points into the DLL loaded by the code bellow.
- //
-
- DllEntryPoint = NULL;
-
- //
- // Load the DLL if it's not an EBC image.
- //
- if ((ImageContext->PdbPointer != NULL) &&
- (ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {
- //
- // Convert filename from ASCII to Unicode
- //
- DllFileName = AsciiToUnicode (ImageContext->PdbPointer, &Index);
-
- //
- // Check that we have a valid filename
- //
- if (Index < 5 || DllFileName[Index - 4] != '.') {
- mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);
-
- //
- // Never return an error if PeCoffLoaderRelocateImage() succeeded.
- // The image will run, but we just can't source level debug. If we
- // return an error the image will not run.
- //
- return;
- }
- //
- // Replace .PDB with .DLL on the filename
- //
- DllFileName[Index - 3] = 'D';
- DllFileName[Index - 2] = 'L';
- DllFileName[Index - 1] = 'L';
-
- //
- // Load the .DLL file into the user process's address space for source
- // level debug
- //
- Library = mWinNt->LoadLibraryEx (DllFileName, NULL, DONT_RESOLVE_DLL_REFERENCES);
- if (Library != NULL) {
- //
- // InitializeDriver is the entry point we put in all our EFI DLL's. The
- // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() suppresses the
- // normal DLL entry point of DllMain, and prevents other modules that are
- // referenced in side the DllFileName from being loaded. There is no error
- // checking as the we can point to the PE32 image loaded by Tiano. This
- // step is only needed for source level debugging
- //
- DllEntryPoint = (VOID *) (UINTN) mWinNt->GetProcAddress (Library, "InitializeDriver");
-
- }
-
- if ((Library != NULL) && (DllEntryPoint != NULL)) {
- ImageContext->EntryPoint = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;
- DEBUG ((EFI_D_INFO, "LoadLibraryEx (%s,\n NULL, DONT_RESOLVE_DLL_REFERENCES)\n", DllFileName));
- } else {
- DEBUG ((EFI_D_ERROR, "WARNING: No source level debug %s. \n", DllFileName));
- }
-
- mWinNt->HeapFree (mWinNt->GetProcessHeap (), 0, DllFileName);
- }
-
- //
- // Never return an error if PeCoffLoaderRelocateImage() succeeded.
- // The image will run, but we just can't source level debug. If we
- // return an error the image will not run.
- //
- return;
-}
-
-/**
- Performs additional actions just before a PE/COFF image is unloaded. Any resources
- that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.
-
- For NT32, this function unloads symbols for source level debugging.
-
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the
- PE/COFF image that is being unloaded.
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderUnloadImageExtraAction (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- ASSERT (ImageContext != NULL);
-}
diff --git a/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf b/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf
deleted file mode 100644
index 8b6bd91a86..0000000000
--- a/Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf
+++ /dev/null
@@ -1,39 +0,0 @@
-## @file
-# PeCoff extra action libary for Pei phase that run NT32 emulator.
-#
-# Lib to provide memory journal status code reporting Routines
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PeiNt32PeCoffExtraActionLib
- FILE_GUID = 057C712A-84F0-4f4a-94CB-713EEF002E2F
- MODULE_TYPE = PEIM
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PeCoffExtraActionLib|PEI_CORE PEIM
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- PeiNt32PeCoffExtraActionLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- BaseLib
- PeiServicesLib
- DebugLib
-
-[Ppis]
- gPeiNtThunkPpiGuid # PPI ALWAYS_CONSUMED
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c b/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
deleted file mode 100644
index df0d56a369..0000000000
--- a/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/** @file
- Perform the platform memory test
-
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "PlatformBootManager.h"
-
-EFI_HII_HANDLE gStringPackHandle = NULL;
-EFI_GUID mPlatformBootManagerStringPackGuid = {
- 0x154dd51, 0x9079, 0x4a10, { 0x89, 0x5c, 0x9c, 0x7, 0x72, 0x81, 0x57, 0x88 }
- };
-// extern UINT8 BdsDxeStrings[];
-
-//
-// BDS Platform Functions
-//
-
-/**
- Perform the memory test base on the memory test intensive level,
- and update the memory resource.
-
- @param Level The memory test intensive level.
-
- @retval EFI_STATUS Success test all the system memory and update
- the memory resource
-
-**/
-EFI_STATUS
-PlatformBootManagerMemoryTest (
- IN EXTENDMEM_COVERAGE_LEVEL Level
- )
-{
- EFI_STATUS Status;
- EFI_STATUS KeyStatus;
- EFI_STATUS InitStatus;
- EFI_STATUS ReturnStatus;
- BOOLEAN RequireSoftECCInit;
- EFI_GENERIC_MEMORY_TEST_PROTOCOL *GenMemoryTest;
- UINT64 TestedMemorySize;
- UINT64 TotalMemorySize;
- UINTN TestPercent;
- UINT64 PreviousValue;
- BOOLEAN ErrorOut;
- BOOLEAN TestAbort;
- EFI_INPUT_KEY Key;
- CHAR16 StrPercent[80];
- CHAR16 *StrTotalMemory;
- CHAR16 *Pos;
- CHAR16 *TmpStr;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;
- UINT32 TempData;
- UINTN StrTotalMemorySize;
-
- ReturnStatus = EFI_SUCCESS;
- ZeroMem (&Key, sizeof (EFI_INPUT_KEY));
-
- StrTotalMemorySize = 128;
- Pos = AllocateZeroPool (StrTotalMemorySize);
- ASSERT (Pos != NULL);
-
- if (gStringPackHandle == NULL) {
- gStringPackHandle = HiiAddPackages (
- &mPlatformBootManagerStringPackGuid,
- gImageHandle,
- PlatformBootManagerLibStrings,
- NULL
- );
- ASSERT (gStringPackHandle != NULL);
- }
-
- StrTotalMemory = Pos;
-
- TestedMemorySize = 0;
- TotalMemorySize = 0;
- PreviousValue = 0;
- ErrorOut = FALSE;
- TestAbort = FALSE;
-
- SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
- SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
- SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
-
- RequireSoftECCInit = FALSE;
-
- Status = gBS->LocateProtocol (
- &gEfiGenericMemTestProtocolGuid,
- NULL,
- (VOID **) &GenMemoryTest
- );
- if (EFI_ERROR (Status)) {
- FreePool (Pos);
- return EFI_SUCCESS;
- }
-
- InitStatus = GenMemoryTest->MemoryTestInit (
- GenMemoryTest,
- Level,
- &RequireSoftECCInit
- );
- if (InitStatus == EFI_NO_MEDIA) {
- //
- // The PEI codes also have the relevant memory test code to check the memory,
- // it can select to test some range of the memory or all of them. If PEI code
- // checks all the memory, this BDS memory test will has no not-test memory to
- // do the test, and then the status of EFI_NO_MEDIA will be returned by
- // "MemoryTestInit". So it does not need to test memory again, just return.
- //
- FreePool (Pos);
- return EFI_SUCCESS;
- }
-
- if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
- TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_ESC_TO_SKIP_MEM_TEST), NULL);
-
- if (TmpStr != NULL) {
- PrintXY (10, 10, NULL, NULL, TmpStr);
- FreePool (TmpStr);
- }
- } else {
- DEBUG ((EFI_D_INFO, "Enter memory test.\n"));
- }
- do {
- Status = GenMemoryTest->PerformMemoryTest (
- GenMemoryTest,
- &TestedMemorySize,
- &TotalMemorySize,
- &ErrorOut,
- TestAbort
- );
- if (ErrorOut && (Status == EFI_DEVICE_ERROR)) {
- TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_SYSTEM_MEM_ERROR), NULL);
- if (TmpStr != NULL) {
- PrintXY (10, 10, NULL, NULL, TmpStr);
- FreePool (TmpStr);
- }
-
- ASSERT (0);
- }
-
- if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
- TempData = (UINT32) DivU64x32 (TotalMemorySize, 16);
- TestPercent = (UINTN) DivU64x32 (
- DivU64x32 (MultU64x32 (TestedMemorySize, 100), 16),
- TempData
- );
- if (TestPercent != PreviousValue) {
- UnicodeValueToStringS (StrPercent, sizeof (StrPercent), 0, TestPercent, 0);
- TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_MEMORY_TEST_PERCENT), NULL);
- if (TmpStr != NULL) {
- //
- // TmpStr size is 64, StrPercent is reserved to 16.
- //
- StrnCatS (
- StrPercent,
- sizeof (StrPercent) / sizeof (CHAR16),
- TmpStr,
- sizeof (StrPercent) / sizeof (CHAR16) - StrLen (StrPercent) - 1
- );
- PrintXY (10, 10, NULL, NULL, StrPercent);
- FreePool (TmpStr);
- }
-
- TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_PERFORM_MEM_TEST), NULL);
- if (TmpStr != NULL) {
- BootLogoUpdateProgress (
- Foreground,
- Background,
- TmpStr,
- Color,
- TestPercent,
- (UINTN) PreviousValue
- );
- FreePool (TmpStr);
- }
- }
-
- PreviousValue = TestPercent;
- } else {
- DEBUG ((EFI_D_INFO, "Perform memory test (ESC to skip).\n"));
- }
-
- if (!PcdGetBool (PcdConInConnectOnDemand)) {
- KeyStatus = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- if (!EFI_ERROR (KeyStatus) && (Key.ScanCode == SCAN_ESC)) {
- if (!RequireSoftECCInit) {
- if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
- TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_PERFORM_MEM_TEST), NULL);
- if (TmpStr != NULL) {
- BootLogoUpdateProgress (
- Foreground,
- Background,
- TmpStr,
- Color,
- 100,
- (UINTN) PreviousValue
- );
- FreePool (TmpStr);
- }
-
- PrintXY (10, 10, NULL, NULL, L"100");
- }
- Status = GenMemoryTest->Finished (GenMemoryTest);
- goto Done;
- }
-
- TestAbort = TRUE;
- }
- }
- } while (Status != EFI_NOT_FOUND);
-
- Status = GenMemoryTest->Finished (GenMemoryTest);
-
-Done:
- if (!FeaturePcdGet(PcdBootlogoOnlyEnable)) {
- UnicodeValueToStringS (StrTotalMemory, StrTotalMemorySize, COMMA_TYPE, TotalMemorySize, 0);
- if (StrTotalMemory[0] == L',') {
- StrTotalMemory++;
- StrTotalMemorySize -= sizeof (CHAR16);
- }
-
- TmpStr = HiiGetString (gStringPackHandle, STRING_TOKEN (STR_MEM_TEST_COMPLETED), NULL);
- if (TmpStr != NULL) {
- StrnCatS (
- StrTotalMemory,
- StrTotalMemorySize / sizeof (CHAR16),
- TmpStr,
- StrTotalMemorySize / sizeof (CHAR16) - StrLen (StrTotalMemory) - 1
- );
- FreePool (TmpStr);
- }
-
- PrintXY (10, 10, NULL, NULL, StrTotalMemory);
- BootLogoUpdateProgress (
- Foreground,
- Background,
- StrTotalMemory,
- Color,
- 100,
- (UINTN) PreviousValue
- );
-
- } else {
- DEBUG ((EFI_D_INFO, "%d bytes of system memory tested OK\r\n", TotalMemorySize));
- }
-
- FreePool (Pos);
- return ReturnStatus;
-}
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
deleted file mode 100644
index 5967db1391..0000000000
--- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/** @file
- This file include all platform action which can be customized
- by IBV/OEM.
-
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "PlatformBootManager.h"
-
-EFI_GUID mBootMenuFile = {
- 0xEEC25BDC, 0x67F2, 0x4D95, { 0xB1, 0xD5, 0xF8, 0x1B, 0x20, 0x39, 0xD1, 0x1D }
-};
-
-/**
- Perform the platform diagnostic, such like test memory. OEM/IBV also
- can customize this function to support specific platform diagnostic.
-
- @param MemoryTestLevel The memory test intensive level
- @param QuietBoot Indicate if need to enable the quiet boot
-
-**/
-VOID
-PlatformBootManagerDiagnostics (
- IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel,
- IN BOOLEAN QuietBoot
- )
-{
- EFI_STATUS Status;
-
- //
- // Here we can decide if we need to show
- // the diagnostics screen
- // Notes: this quiet boot code should be remove
- // from the graphic lib
- //
- if (QuietBoot) {
- BootLogoEnableLogo ();
-
- //
- // Perform system diagnostic
- //
- Status = PlatformBootManagerMemoryTest (MemoryTestLevel);
- if (EFI_ERROR (Status)) {
- BootLogoDisableLogo ();
- }
-
- return;
- }
-
- //
- // Perform system diagnostic
- //
- Status = PlatformBootManagerMemoryTest (MemoryTestLevel);
-}
-
-/**
- Do the platform specific action before the console is connected.
-
- Such as:
- Update console variable;
- Register new Driver#### or Boot####;
- Signal ReadyToLock event.
-**/
-VOID
-EFIAPI
-PlatformBootManagerBeforeConsole (
- VOID
- )
-{
- UINTN Index;
- EFI_STATUS Status;
- WIN_NT_SYSTEM_CONFIGURATION *Configuration;
-
- GetVariable2 (L"Setup", &gEfiWinNtSystemConfigGuid, (VOID **) &Configuration, NULL);
- if (Configuration != NULL) {
- //
- // SetupVariable is corrupt
- //
- Configuration->ConOutRow = PcdGet32 (PcdConOutColumn);
- Configuration->ConOutColumn = PcdGet32 (PcdConOutRow);
-
- Status = gRT->SetVariable (
- L"Setup",
- &gEfiWinNtSystemConfigGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof (WIN_NT_SYSTEM_CONFIGURATION),
- Configuration
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "Failed to save Setup Variable to non-volatile storage, Status = %r\n", Status));
- }
- FreePool (Configuration);
- }
-
- //
- // Update the ocnsole variables.
- //
- for (Index = 0; gPlatformConsole[Index].DevicePath != NULL; Index++) {
- if ((gPlatformConsole[Index].ConnectType & CONSOLE_IN) == CONSOLE_IN) {
- EfiBootManagerUpdateConsoleVariable (ConIn, gPlatformConsole[Index].DevicePath, NULL);
- }
-
- if ((gPlatformConsole[Index].ConnectType & CONSOLE_OUT) == CONSOLE_OUT) {
- EfiBootManagerUpdateConsoleVariable (ConOut, gPlatformConsole[Index].DevicePath, NULL);
- }
-
- if ((gPlatformConsole[Index].ConnectType & STD_ERROR) == STD_ERROR) {
- EfiBootManagerUpdateConsoleVariable (ErrOut, gPlatformConsole[Index].DevicePath, NULL);
- }
- }
-
- //
- // From PI spec vol2:
- // Prior to invoking any UEFI drivers, applications, or connecting consoles,
- // the platform should signal the event EFI_END_OF_DXE_EVENT_GUID
- //
- EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
-
- //
- // Dispatch deferred images after EndOfDxe event.
- //
- EfiBootManagerDispatchDeferredImages ();
-}
-
-/**
- Returns the priority number.
-
- @param BootOption
-**/
-UINTN
-BootOptionPriority (
- CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
- )
-{
- //
- // Make sure Shell is first
- //
- if (StrCmp (BootOption->Description, L"UEFI Shell") == 0) {
- return 0;
- }
- return 100;
-}
-
-INTN
-EFIAPI
-CompareBootOption (
- CONST EFI_BOOT_MANAGER_LOAD_OPTION *Left,
- CONST EFI_BOOT_MANAGER_LOAD_OPTION *Right
- )
-{
- return BootOptionPriority (Left) - BootOptionPriority (Right);
-}
-
-/**
- Generate device path include the input file guid info.
-
- @param FileGuid Input file guid for the BootManagerMenuApp.
-
- @retval DevicePath for BootManagerMenuApp.
-**/
-EFI_DEVICE_PATH *
-FvFilePath (
- EFI_GUID *FileGuid
- )
-{
-
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;
-
- EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);
-
- Status = gBS->HandleProtocol (
- gImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
-
- return AppendDevicePathNode (
- DevicePathFromHandle (LoadedImage->DeviceHandle),
- (EFI_DEVICE_PATH_PROTOCOL *) &FileNode
- );
-}
-
-/**
- Create one boot option for BootManagerMenuApp.
-
- @param FileGuid Input file guid for the BootManagerMenuApp.
- @param Description Description of the BootManagerMenuApp boot option.
- @param Position Position of the new load option to put in the ****Order variable.
- @param IsBootCategory Whether this is a boot category.
-
-
- @retval OptionNumber Return the option number info.
-
-**/
-UINTN
-RegisterBootManagerMenuAppBootOption (
- EFI_GUID *FileGuid,
- CHAR16 *Description,
- UINTN Position,
- BOOLEAN IsBootCategory
- )
-{
- EFI_STATUS Status;
- EFI_BOOT_MANAGER_LOAD_OPTION NewOption;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- UINTN OptionNumber;
-
- DevicePath = FvFilePath (FileGuid);
- Status = EfiBootManagerInitializeLoadOption (
- &NewOption,
- LoadOptionNumberUnassigned,
- LoadOptionTypeBoot,
- IsBootCategory ? LOAD_OPTION_ACTIVE : LOAD_OPTION_CATEGORY_APP,
- Description,
- DevicePath,
- NULL,
- 0
- );
- ASSERT_EFI_ERROR (Status);
- FreePool (DevicePath);
-
- Status = EfiBootManagerAddLoadOptionVariable (&NewOption, Position);
- ASSERT_EFI_ERROR (Status);
-
- OptionNumber = NewOption.OptionNumber;
-
- EfiBootManagerFreeLoadOption (&NewOption);
-
- return OptionNumber;
-}
-
-/**
- Check if it's a Device Path pointing to BootManagerMenuApp.
-
- @param DevicePath Input device path.
-
- @retval TRUE The device path is BootManagerMenuApp File Device Path.
- @retval FALSE The device path is NOT BootManagerMenuApp File Device Path.
-**/
-BOOLEAN
-IsBootManagerMenuAppFilePath (
- EFI_DEVICE_PATH_PROTOCOL *DevicePath
-)
-{
- EFI_HANDLE FvHandle;
- VOID *NameGuid;
- EFI_STATUS Status;
-
- Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &DevicePath, &FvHandle);
- if (!EFI_ERROR (Status)) {
- NameGuid = EfiGetNameGuidFromFwVolDevicePathNode ((CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) DevicePath);
- if (NameGuid != NULL) {
- return CompareGuid (NameGuid, &mBootMenuFile);
- }
- }
-
- return FALSE;
-}
-
-/**
- Return the boot option number to the BootManagerMenuApp.
-
- If not found it in the current boot option, create a new one.
-
- @retval OptionNumber Return the boot option number to the BootManagerMenuApp.
-
-**/
-UINTN
-GetBootManagerMenuAppOption (
- VOID
- )
-{
- UINTN BootOptionCount;
- EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;
- UINTN Index;
- UINTN OptionNumber;
-
- OptionNumber = 0;
-
- BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
-
- for (Index = 0; Index < BootOptionCount; Index++) {
- if (IsBootManagerMenuAppFilePath (BootOptions[Index].FilePath)) {
- OptionNumber = BootOptions[Index].OptionNumber;
- break;
- }
- }
-
- EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
-
- if (Index >= BootOptionCount) {
- //
- // If not found the BootManagerMenuApp, create it.
- //
- OptionNumber = (UINT16) RegisterBootManagerMenuAppBootOption (&mBootMenuFile, L"UEFI BootManagerMenuApp", (UINTN) -1, FALSE);
- }
-
- return OptionNumber;
-}
-
-/**
- Do the platform specific action after the console is connected.
-
- Such as:
- Dynamically switch output mode;
- Signal console ready platform customized event;
- Run diagnostics like memory testing;
- Connect certain devices;
- Dispatch aditional option roms.
-**/
-VOID
-EFIAPI
-PlatformBootManagerAfterConsole (
- VOID
- )
-{
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL White;
- EFI_INPUT_KEY Enter;
- EFI_INPUT_KEY F2;
- EFI_INPUT_KEY F7;
- EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
- UINTN OptionNumber;
-
- Black.Blue = Black.Green = Black.Red = Black.Reserved = 0;
- White.Blue = White.Green = White.Red = White.Reserved = 0xFF;
-
- EfiBootManagerConnectAll ();
- EfiBootManagerRefreshAllBootOption ();
-
- //
- // Register ENTER as CONTINUE key
- //
- Enter.ScanCode = SCAN_NULL;
- Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;
- EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);
- //
- // Map F2 to Boot Manager Menu
- //
- F2.ScanCode = SCAN_F2;
- F2.UnicodeChar = CHAR_NULL;
- EfiBootManagerGetBootManagerMenu (&BootOption);
- EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumber, 0, &F2, NULL);
-
- //
- // 3. Boot Device List menu
- //
- F7.ScanCode = SCAN_F7;
- F7.UnicodeChar = CHAR_NULL;
- OptionNumber = GetBootManagerMenuAppOption ();
- EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)OptionNumber, 0, &F7, NULL);
-
- //
- // Make Shell as the first boot option
- //
- EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, (SORT_COMPARE) CompareBootOption);
-
- PlatformBootManagerDiagnostics (QUICK, TRUE);
-
- PrintXY (10, 10, &White, &Black, L"F2 to enter Setup. ");
- PrintXY (10, 30, &White, &Black, L"F7 to enter Boot Manager Menu.");
- PrintXY (10, 50, &White, &Black, L"Enter to boot directly.");
-}
-
-/**
- This function is called each second during the boot manager waits the timeout.
-
- @param TimeoutRemain The remaining timeout.
-**/
-VOID
-EFIAPI
-PlatformBootManagerWaitCallback (
- UINT16 TimeoutRemain
- )
-{
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;
- UINT16 Timeout;
-
- Timeout = PcdGet16 (PcdPlatformBootTimeOut);
-
- Black.Raw = 0x00000000;
- White.Raw = 0x00FFFFFF;
-
- BootLogoUpdateProgress (
- White.Pixel,
- Black.Pixel,
- L"Start boot option",
- White.Pixel,
- (Timeout - TimeoutRemain) * 100 / Timeout,
- 0
- );
-}
-
-/**
- The function is called when no boot option could be launched,
- including platform recovery options and options pointing to applications
- built into firmware volumes.
-
- If this function returns, BDS attempts to enter an infinite loop.
-**/
-VOID
-EFIAPI
-PlatformBootManagerUnableToBoot (
- VOID
- )
-{
- return;
-}
-
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.h b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.h
deleted file mode 100644
index 06822d104f..0000000000
--- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/**@file
- Head file for BDS Platform specific code
-
-Copyright (c) 2015, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _PLATFORM_BOOT_MANAGER_H
-#define _PLATFORM_BOOT_MANAGER_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- UINTN ConnectType;
-} PLATFORM_CONSOLE_CONNECT_ENTRY;
-
-extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[];
-
-#define gEndEntire \
- { \
- END_DEVICE_PATH_TYPE,\
- END_ENTIRE_DEVICE_PATH_SUBTYPE,\
- END_DEVICE_PATH_LENGTH,\
- 0\
- }
-
-#define CONSOLE_OUT BIT0
-#define CONSOLE_IN BIT1
-#define STD_ERROR BIT2
-
-typedef struct {
- VENDOR_DEVICE_PATH VendorDevicePath;
- UINT32 Instance;
-} WIN_NT_VENDOR_DEVICE_PATH_NODE;
-
-//
-// Below is the platform console device path
-//
-typedef struct {
- VENDOR_DEVICE_PATH NtBus;
- WIN_NT_VENDOR_DEVICE_PATH_NODE SerialDevice;
- UART_DEVICE_PATH Uart;
- VENDOR_DEVICE_PATH TerminalType;
- EFI_DEVICE_PATH_PROTOCOL End;
-} NT_ISA_SERIAL_DEVICE_PATH;
-
-typedef struct {
- VENDOR_DEVICE_PATH NtBus;
- WIN_NT_VENDOR_DEVICE_PATH_NODE NtGopDevice;
- EFI_DEVICE_PATH_PROTOCOL End;
-} NT_PLATFORM_GOP_DEVICE_PATH;
-
-/**
- Use SystemTable Conout to stop video based Simple Text Out consoles from going
- to the video device. Put up LogoFile on every video device that is a console.
-
- @param[in] LogoFile File name of logo to display on the center of the screen.
-
- @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.
- @retval EFI_UNSUPPORTED Logo not found
-
-**/
-EFI_STATUS
-PlatformBootManagerEnableQuietBoot (
- IN EFI_GUID *LogoFile
- );
-
-/**
- Use SystemTable Conout to turn on video based Simple Text Out consoles. The
- Simple Text Out screens will now be synced up with all non video output devices
-
- @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
-
-**/
-EFI_STATUS
-PlatformBootManagerDisableQuietBoot (
- VOID
- );
-
-/**
- Perform the memory test base on the memory test intensive level,
- and update the memory resource.
-
- @param Level The memory test intensive level.
-
- @retval EFI_STATUS Success test all the system memory and update
- the memory resource
-
-**/
-EFI_STATUS
-PlatformBootManagerMemoryTest (
- IN EXTENDMEM_COVERAGE_LEVEL Level
- );
-
-/**
-
- Show progress bar with title above it. It only works in Graphics mode.
-
-
- @param TitleForeground Foreground color for Title.
- @param TitleBackground Background color for Title.
- @param Title Title above progress bar.
- @param ProgressColor Progress bar color.
- @param Progress Progress (0-100)
- @param PreviousValue The previous value of the progress.
-
- @retval EFI_STATUS Success update the progress bar
-
-**/
-EFI_STATUS
-PlatformBootManagerShowProgress (
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,
- IN CHAR16 *Title,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,
- IN UINTN Progress,
- IN UINTN PreviousValue
- );
-
-#endif // _PLATFORM_BOOT_MANAGER_H
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
deleted file mode 100644
index 343bd7864b..0000000000
--- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ /dev/null
@@ -1,69 +0,0 @@
-## @file
-# Include all platform action which can be customized by IBV/OEM.
-#
-# Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PlatformBootManagerLib
- FILE_GUID = F0D9063A-DADB-4185-85E2-D7ACDA93F7A6
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PlatformBootManagerLib|DXE_DRIVER
-
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- PlatformData.c
- PlatformBootManager.c
- PlatformBootManager.h
- MemoryTest.c
- Strings.uni
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- BaseLib
- UefiBootServicesTableLib
- UefiRuntimeServicesTableLib
- UefiLib
- UefiBootManagerLib
- PcdLib
- DxeServicesLib
- MemoryAllocationLib
- DevicePathLib
- HiiLib
- PrintLib
- BootLogoLib
-
-[Guids]
- gEfiWinNtSystemConfigGuid
- gEfiEndOfDxeEventGroupGuid
-
-[Protocols]
- gEfiGenericMemTestProtocolGuid ## CONSUMES
- gEfiGraphicsOutputProtocolGuid ## CONSUMES
- gEfiUgaDrawProtocolGuid ## CONSUMES
- gEfiBootLogoProtocolGuid ## CONSUMES
- gEfiFirmwareVolume2ProtocolGuid ## CONSUMES
-
-[Pcd]
- gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
- gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformData.c b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformData.c
deleted file mode 100644
index 8ab53b4e39..0000000000
--- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformData.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/**@file
- Defined the platform specific device path which will be filled to
- ConIn/ConOut variables.
-
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#include "PlatformBootManager.h"
-
-//
-// Platform specific keyboard device path
-//
-NT_PLATFORM_GOP_DEVICE_PATH gGopDevicePath0 = {
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
- EFI_WIN_NT_THUNK_PROTOCOL_GUID
- },
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),
- (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),
- EFI_WIN_NT_GOP_GUID,
- 0
- },
- gEndEntire
-};
-
-NT_PLATFORM_GOP_DEVICE_PATH gGopDevicePath1 = {
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
- EFI_WIN_NT_THUNK_PROTOCOL_GUID
- },
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),
- (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),
- EFI_WIN_NT_GOP_GUID,
- 1
- },
- gEndEntire
-};
-
-//
-// Platform specific serial device path
-//
-NT_ISA_SERIAL_DEVICE_PATH gNtSerialDevicePath0 = {
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
- EFI_WIN_NT_THUNK_PROTOCOL_GUID
- },
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),
- (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),
- EFI_WIN_NT_SERIAL_PORT_GUID
- },
- {
- MESSAGING_DEVICE_PATH,
- MSG_UART_DP,
- (UINT8) (sizeof (UART_DEVICE_PATH)),
- (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8),
- 0,
- 115200,
- 8,
- 1,
- 1
- },
- {
- MESSAGING_DEVICE_PATH,
- MSG_VENDOR_DP,
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
- DEVICE_PATH_MESSAGING_PC_ANSI
- },
- gEndEntire
-};
-
-NT_ISA_SERIAL_DEVICE_PATH gNtSerialDevicePath1 = {
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
- EFI_WIN_NT_THUNK_PROTOCOL_GUID
- },
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8) (sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)),
- (UINT8) ((sizeof (WIN_NT_VENDOR_DEVICE_PATH_NODE)) >> 8),
- EFI_WIN_NT_SERIAL_PORT_GUID,
- 1
- },
- {
- MESSAGING_DEVICE_PATH,
- MSG_UART_DP,
- (UINT8) (sizeof (UART_DEVICE_PATH)),
- (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8),
- 0,
- 115200,
- 8,
- 1,
- 1
- },
- {
- MESSAGING_DEVICE_PATH,
- MSG_VENDOR_DP,
- (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
- (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
- DEVICE_PATH_MESSAGING_PC_ANSI
- },
- gEndEntire
-};
-
-//
-// Predefined platform default console device path
-//
-PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
- {
- (EFI_DEVICE_PATH_PROTOCOL *) &gNtSerialDevicePath0,
- (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
- },
- {
- (EFI_DEVICE_PATH_PROTOCOL *) &gNtSerialDevicePath1,
- (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
- },
- {
- (EFI_DEVICE_PATH_PROTOCOL *) &gGopDevicePath0,
- (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
- },
- {
- (EFI_DEVICE_PATH_PROTOCOL *) &gGopDevicePath1,
- (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)
- },
- {
- NULL,
- 0
- }
-};
diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/Strings.uni b/Nt32Pkg/Library/PlatformBootManagerLib/Strings.uni
deleted file mode 100644
index d5a28e0ad5..0000000000
--- a/Nt32Pkg/Library/PlatformBootManagerLib/Strings.uni
+++ /dev/null
@@ -1,27 +0,0 @@
-///** @file
-//
-// String definitions for PlatformBootManagerLib.
-//
-// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//**/
-
-/=#
-
-#langdef en-US "English"
-#langdef fr-FR "Français"
-
-#string STR_PERFORM_MEM_TEST #language en-US "Perform memory test (ESC to skip)"
- #language fr-FR "Exécute l'examen de mémoire (ESC pour sauter)"
-#string STR_MEMORY_TEST_PERCENT #language en-US "% of the system memory tested OK"
- #language fr-FR "% de la mémoire de système essayée D'ACCORD"
-#string STR_ESC_TO_SKIP_MEM_TEST #language en-US "Press ESC key to skip memory test"
- #language fr-FR "Appuie sur ESC sauter examen de mémoire"
-#string STR_MEM_TEST_COMPLETED #language en-US " bytes of system memory tested OK\r\n"
- #language fr-FR "octets dela mémoire de système essayée D'ACCORD\r\n"
-#string STR_SYSTEM_MEM_ERROR #language en-US "System encounters memory errors"
- #language fr-FR "le Système rencontre les erreurs de mémoire"
-#string STR_START_BOOT_OPTION #language en-US "Start boot option"
- #language fr-FR "l'option de botte de Début"
-
\ No newline at end of file
diff --git a/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.c b/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.c
deleted file mode 100644
index 8a37099be5..0000000000
--- a/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- Provides a platform-specific method to enable Secure Boot Custom Mode setup.
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#include
-
-
-/**
-
- This function provides a platform-specific method to detect whether the platform
- is operating by a physically present user.
-
- Programmatic changing of platform security policy (such as disable Secure Boot,
- or switch between Standard/Custom Secure Boot mode) MUST NOT be possible during
- Boot Services or after exiting EFI Boot Services. Only a physically present user
- is allowed to perform these operations.
-
- NOTE THAT: This function cannot depend on any EFI Variable Service since they are
- not available when this function is called in AuthenticateVariable driver.
-
- @retval TRUE The platform is operated by a physically present user.
- @retval FALSE The platform is NOT operated by a physically present user.
-
-**/
-BOOLEAN
-EFIAPI
-UserPhysicalPresent (
- VOID
- )
-{
- return TRUE;
-}
diff --git a/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf b/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf
deleted file mode 100644
index 0e5fb1468d..0000000000
--- a/Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf
+++ /dev/null
@@ -1,28 +0,0 @@
-## @file
-# Provides a platform-specific method to enable Secure Boot Custom Mode setup.
-#
-# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PlatformSecureLib
- FILE_GUID = F263EC2A-F0DB-4640-8B12-4ED22A506FB1
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PlatformSecureLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_DRIVER
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- PlatformSecureLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
diff --git a/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.c b/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.c
deleted file mode 100644
index f8f9aa409f..0000000000
--- a/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/** @file
-
- Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#include
-#include
-#include
-
-/**
- This function causes a system-wide reset (cold reset), in which
- all circuitry within the system returns to its initial state. This type of reset
- is asynchronous to system operation and operates without regard to
- cycle boundaries.
-
- If this function returns, it means that the system does not support cold reset.
-**/
-VOID
-EFIAPI
-ResetCold (
- VOID
- )
-{
- gWinNt->ExitProcess (0);
- ASSERT (FALSE);
-}
-
-/**
- This function causes a system-wide initialization (warm reset), in which all processors
- are set to their initial state. Pending cycles are not corrupted.
-
- If this function returns, it means that the system does not support warm reset.
-**/
-VOID
-EFIAPI
-ResetWarm (
- VOID
- )
-{
- ResetCold ();
-}
-
-/**
- This function causes the system to enter a power state equivalent
- to the ACPI G2/S5 or G3 states.
-
- If this function returns, it means that the system does not support shut down reset.
-**/
-VOID
-EFIAPI
-ResetShutdown (
- VOID
- )
-{
- ResetCold ();
-}
-
-/**
- This function causes the system to enter S3 and then wake up immediately.
-
- If this function returns, it means that the system does not support S3 feature.
-**/
-VOID
-EFIAPI
-EnterS3WithImmediateWake (
- VOID
- )
-{
- ResetCold ();
-}
-
-/**
- This function causes a systemwide reset. The exact type of the reset is
- defined by the EFI_GUID that follows the Null-terminated Unicode string passed
- into ResetData. If the platform does not recognize the EFI_GUID in ResetData
- the platform must pick a supported reset type to perform.The platform may
- optionally log the parameters from any non-normal reset that occurs.
-
- @param[in] DataSize The size, in bytes, of ResetData.
- @param[in] ResetData The data buffer starts with a Null-terminated string,
- followed by the EFI_GUID.
-**/
-VOID
-EFIAPI
-ResetPlatformSpecific (
- IN UINTN DataSize,
- IN VOID *ResetData
- )
-{
- ResetCold ();
-}
-
-/**
- The ResetSystem function resets the entire platform.
-
- @param[in] ResetType The type of reset to perform.
- @param[in] ResetStatus The status code for the reset.
- @param[in] DataSize The size, in bytes, of ResetData.
- @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
- the data buffer starts with a Null-terminated string, optionally
- followed by additional binary data. The string is a description
- that the caller may use to further indicate the reason for the
- system reset.
-**/
-VOID
-EFIAPI
-ResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN VOID *ResetData OPTIONAL
- )
-{
- switch (ResetType) {
- case EfiResetWarm:
- ResetWarm ();
- break;
-
- case EfiResetCold:
- ResetCold ();
- break;
-
- case EfiResetShutdown:
- ResetShutdown ();
- return;
-
- case EfiResetPlatformSpecific:
- ResetPlatformSpecific (DataSize, ResetData);
- return;
-
- default:
- return;
- }
-}
diff --git a/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf b/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf
deleted file mode 100644
index f93fe8a636..0000000000
--- a/Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ /dev/null
@@ -1,32 +0,0 @@
-## @file
-#
-# Copyright (c) 2017, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = Nt32ResetSystemLib
- FILE_GUID = A7EBA1F6-5505-4fba-8895-386EE02B2FAC
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ResetSystemLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- ResetSystemLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- WinNtLib
- DebugLib
diff --git a/Nt32Pkg/MetronomeDxe/Metronome.c b/Nt32Pkg/MetronomeDxe/Metronome.c
deleted file mode 100644
index aeb346990c..0000000000
--- a/Nt32Pkg/MetronomeDxe/Metronome.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- Metronome.c
-
-Abstract:
-
- NT Emulation Metronome Architectural Protocol Driver as defined in DXE CIS
-
-**/
-
-#include "Metronome.h"
-
-//
-// Global Variables
-//
-EFI_METRONOME_ARCH_PROTOCOL mMetronome = {
- WinNtMetronomeDriverWaitForTick,
- TICK_PERIOD
-};
-
-//
-// Worker Functions
-//
-
-EFI_STATUS
-EFIAPI
-WinNtMetronomeDriverWaitForTick (
- IN EFI_METRONOME_ARCH_PROTOCOL *This,
- IN UINT32 TickNumber
- )
-/*++
-
-Routine Description:
-
- The WaitForTick() function waits for the number of ticks specified by
- TickNumber from a known time source in the platform. If TickNumber of
- ticks are detected, then EFI_SUCCESS is returned. The actual time passed
- between entry of this function and the first tick is between 0 and
- TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod
- time has elapsed, wait for two ticks. This function waits for a hardware
- event to determine when a tick occurs. It is possible for interrupt
- processing, or exception processing to interrupt the execution of the
- WaitForTick() function. Depending on the hardware source for the ticks, it
- is possible for a tick to be missed. This function cannot guarantee that
- ticks will not be missed. If a timeout occurs waiting for the specified
- number of ticks, then EFI_TIMEOUT is returned.
-
-Arguments:
-
- This - The EFI_METRONOME_ARCH_PROTOCOL instance.
- TickNumber - Number of ticks to wait.
-
-Returns:
-
- EFI_SUCCESS - The wait for the number of ticks specified by TickNumber
- succeeded.
-
---*/
-{
- UINT64 SleepTime;
-
- //
- // Calculate the time to sleep. Win API smallest unit to sleep is 1 millisec
- // Tick Period is in 100ns units, divide by 10000 to convert to ms
- //
- SleepTime = DivU64x32 (MultU64x32 ((UINT64) TickNumber, TICK_PERIOD) + 9999, 10000);
- gWinNt->Sleep ((UINT32) SleepTime);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtMetronomeDriverInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Initialize the Metronome Architectural Protocol driver
-
-Arguments:
-
- ImageHandle - ImageHandle of the loaded driver
-
-
- SystemTable - Pointer to the System Table
-
-Returns:
-
- EFI_SUCCESS - Metronome Architectural Protocol created
-
- EFI_OUT_OF_RESOURCES - Not enough resources available to initialize driver.
-
- EFI_DEVICE_ERROR - A device error occured attempting to initialize the driver.
-
---*/
-{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
-
- //
- // Install the Metronome Architectural Protocol onto a new handle
- //
- Handle = NULL;
- Status = gBS->InstallProtocolInterface (
- &Handle,
- &gEfiMetronomeArchProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &mMetronome
- );
-
- return Status;
-}
diff --git a/Nt32Pkg/MetronomeDxe/Metronome.h b/Nt32Pkg/MetronomeDxe/Metronome.h
deleted file mode 100644
index 4a1a58c5d9..0000000000
--- a/Nt32Pkg/MetronomeDxe/Metronome.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- Metronome.h
-
-Abstract:
-
- NT Emulation Metronome Architectural Protocol Driver as defined in DXE CIS
-
-**/
-
-#ifndef _NT_THUNK_METRONOME_H_
-#define _NT_THUNK_METRONOME_H_
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-//
-// Period of on tick in 100 nanosecond units
-//
-#define TICK_PERIOD 2000
-
-//
-// Function Prototypes
-//
-
-EFI_STATUS
-EFIAPI
-WinNtMetronomeDriverInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ImageHandle - TODO: add argument description
- SystemTable - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-WinNtMetronomeDriverWaitForTick (
- IN EFI_METRONOME_ARCH_PROTOCOL *This,
- IN UINT32 TickNumber
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- TickNumber - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-#endif
diff --git a/Nt32Pkg/MetronomeDxe/MetronomeDxe.inf b/Nt32Pkg/MetronomeDxe/MetronomeDxe.inf
deleted file mode 100644
index d7a4065bae..0000000000
--- a/Nt32Pkg/MetronomeDxe/MetronomeDxe.inf
+++ /dev/null
@@ -1,46 +0,0 @@
-## @file
-# NT Emulation Metronome Architectural Protocol Driver as defined in DXE CIS
-#
-# This metronome module simulates metronome by Sleep WinAPI.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = Metronome
- FILE_GUID = 154CAB4A-52B5-46CD-99C3-4368ABBACFFD
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = WinNtMetronomeDriverInitialize
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- Metronome.h
- Metronome.c
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- WinNtLib
- UefiDriverEntryPoint
- BaseLib
-
-[Protocols]
- gEfiMetronomeArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
-
-[Depex]
- TRUE
-
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c
deleted file mode 100644
index ab88a9207a..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscBaseBoardManufacturerData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer) = {
- STRING_TOKEN(STR_MISC_BASE_BOARD_MANUFACTURER),
- STRING_TOKEN(STR_MISC_BASE_BOARD_PRODUCT_NAME),
- STRING_TOKEN(STR_MISC_BASE_BOARD_VERSION),
- STRING_TOKEN(STR_MISC_BASE_BOARD_SERIAL_NUMBER),
- STRING_TOKEN(STR_MISC_BASE_BOARD_ASSET_TAG),
- STRING_TOKEN(STR_MISC_BASE_BOARD_CHASSIS_LOCATION),
- { // BaseBoardFeatureFlags
- 1, // Motherboard
- 0, // RequiresDaughterCard
- 0, // Removable
- 1, // Replaceable,
- 0, // HotSwappable
- 0, // Reserved
- },
- EfiBaseBoardTypeUnknown, // BaseBoardType
- { // BaseBoardChassisLink
- EFI_MISC_SUBCLASS_GUID, // ProducerName
- 1, // Instance
- 1, // SubInstance
- },
- 0, // BaseBoardNumberLinks
- { // LinkN
- EFI_MISC_SUBCLASS_GUID, // ProducerName
- 1, // Instance
- 1, // SubInstance
- },
-};
-
-/* eof - MiscBaseBoardManufacturerData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c
deleted file mode 100644
index c414cf6531..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
- BaseBoard manufacturer information boot time changes.
- SMBIOS type 2.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-(C) Copyright 2017 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-/**
- This function makes boot time changes to the contents of the
- MiscBaseBoardManufacturer (Type 2).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer)
-{
- CHAR8 *OptionalStrStart;
- UINTN ManuStrLen;
- UINTN ProductStrLen;
- UINTN VerStrLen;
- UINTN AssetTagStrLen;
- UINTN SerialNumStrLen;
- UINTN ChassisStrLen;
- EFI_STATUS Status;
- EFI_STRING Manufacturer;
- EFI_STRING Product;
- EFI_STRING Version;
- EFI_STRING SerialNumber;
- EFI_STRING AssetTag;
- EFI_STRING Chassis;
- STRING_REF TokenToGet;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE2 *SmbiosRecord;
- EFI_MISC_BASE_BOARD_MANUFACTURER *ForType2InputData;
-
- ForType2InputData = (EFI_MISC_BASE_BOARD_MANUFACTURER *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
- Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- ManuStrLen = StrLen(Manufacturer);
- if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
- Product = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- ProductStrLen = StrLen(Product);
- if (ProductStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
- Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- VerStrLen = StrLen(Version);
- if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER);
- SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- SerialNumStrLen = StrLen(SerialNumber);
- if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG);
- AssetTag = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- AssetTagStrLen = StrLen(AssetTag);
- if (AssetTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION);
- Chassis = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- ChassisStrLen = StrLen(Chassis);
- if (ChassisStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
-
- //
- // Two zeros following the last string.
- //
- // Since we fill NumberOfContainedObjectHandles = 0, remove sizeof (UINT16) bytes for ContainedObjectHandles[1]
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE2) - sizeof (UINT16) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + ChassisStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE2) - sizeof (UINT16) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + ChassisStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION;
- //
- // Since we fill NumberOfContainedObjectHandles = 0, remove sizeof (UINT16) bytes for ContainedObjectHandles[1]
- //
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE2) - sizeof (UINT16);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- //
- // Manu will be the 1st optional string following the formatted structure.
- //
- SmbiosRecord->Manufacturer = 1;
- //
- // ProductName will be the 2st optional string following the formatted structure.
- //
- SmbiosRecord->ProductName = 2;
- //
- // Version will be the 3rd optional string following the formatted structure.
- //
- SmbiosRecord->Version = 3;
- //
- // SerialNumber will be the 4th optional string following the formatted structure.
- //
- SmbiosRecord->SerialNumber = 4;
- //
- // AssetTag will be the 5th optional string following the formatted structure.
- //
- SmbiosRecord->AssetTag = 5;
-
- //
- // LocationInChassis will be the 6th optional string following the formatted structure.
- //
- SmbiosRecord->LocationInChassis = 6;
- SmbiosRecord->FeatureFlag = (*(BASE_BOARD_FEATURE_FLAGS*)&(ForType2InputData->BaseBoardFeatureFlags));
- SmbiosRecord->ChassisHandle = 0;
- SmbiosRecord->BoardType = (UINT8)ForType2InputData->BaseBoardType;
- SmbiosRecord->NumberOfContainedObjectHandles = 0;
-
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- //
- // Since we fill NumberOfContainedObjectHandles = 0, just after this field to fill string
- //
- OptionalStrStart -= sizeof (UINT16);
- UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);
- UnicodeStrToAsciiStr(Product, OptionalStrStart + ManuStrLen + 1);
- UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1);
- UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1);
- UnicodeStrToAsciiStr(AssetTag, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);
- UnicodeStrToAsciiStr(Chassis, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1);
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c
deleted file mode 100644
index a9f33b49b6..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscBiosVendorData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor) = {
- STRING_TOKEN(STR_MISC_BIOS_VENDOR), // BiosVendor
- STRING_TOKEN(STR_MISC_BIOS_VERSION), // BiosVersion
- STRING_TOKEN(STR_MISC_BIOS_RELEASE_DATE), // BiosReleaseDate
- 0xBABE, // BiosStartingAddress
- { // BiosPhysicalDeviceSize
- 2, // Value
- 3, // Exponent
- },
- { // BiosCharacteristics1
- 0, // Reserved1 :2
- 0, // Unknown :1
- 1, // BiosCharacteristicsNotSupported :1
- 0, // IsaIsSupported :1
- 0, // McaIsSupported :1
- 0, // EisaIsSupported :1
- 0, // PciIsSupported :1
- 0, // PcmciaIsSupported :1
- 0, // PlugAndPlayIsSupported :1
- 0, // ApmIsSupported :1
- 0, // BiosIsUpgradable :1
- 0, // BiosShadowingAllowed :1
- 0, // VlVesaIsSupported :1
- 0, // EscdSupportIsAvailable :1
- 0, // BootFromCdIsSupported :1
- 0, // SelectableBootIsSupported :1
- 0, // RomBiosIsSocketed :1
- 0, // BootFromPcmciaIsSupported :1
- 0, // EDDSpecificationIsSupported :1
- 0, // JapaneseNecFloppyIsSupported :1
- 0, // JapaneseToshibaFloppyIsSupported :1
- 0, // Floppy525_360IsSupported :1
- 0, // Floppy525_12IsSupported :1
- 0, // Floppy35_720IsSupported :1
- 0, // Floppy35_288IsSupported :1
- 0, // PrintScreenIsSupported :1
- 0, // Keyboard8042IsSupported :1
- 0, // SerialIsSupported :1
- 0, // PrinterIsSupported :1
- 0, // CgaMonoIsSupported :1
- 0, // NecPc98 :1
- 0, // AcpiIsSupported :1
- 0, // UsbLegacyIsSupported :1
- 0, // AgpIsSupported :1
- 0, // I20BootIsSupported :1
- 0, // Ls120BootIsSupported :1
- 0, // AtapiZipDriveBootIsSupported :1
- 0, // Boot1394IsSupported :1
- 0, // SmartBatteryIsSupported :1
- 0, // BiosBootSpecIsSupported :1
- 0, // FunctionKeyNetworkBootIsSupported :1
- 0 // Reserved :22
- },
- { // BiosCharacteristics2
- 0, // BiosReserved :16
- 0, // SystemReserved :16
- 0 // Reserved :32
- },
-};
-
-/* eof - MiscBiosVendorData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
deleted file mode 100644
index 5bb75614cc..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/** @file
- BIOS vendor information boot time changes.
- Misc. subclass type 2.
- SMBIOS type 0.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-/**
- This function returns the value & exponent to Base2 for a given
- Hex value. This is used to calculate the BiosPhysicalDeviceSize.
-
- @param Value The hex value which is to be converted into value-exponent form
- @param Exponent The exponent out of the conversion
-
- @retval EFI_SUCCESS All parameters were valid and *Value & *Exponent have been set.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-EFI_STATUS
-GetValueExponentBase2(
- IN OUT UINTN *Value,
- OUT UINTN *Exponent
- )
-{
- if ((Value == NULL) || (Exponent == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- while ((*Value % 2) == 0) {
- *Value=*Value/2;
- (*Exponent)++;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'
- as the unit.
-
- @param Base2Data Pointer to Base2_Data
-
- @retval EFI_SUCCESS Transform successfully.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-UINT16
-Base2ToByteWith64KUnit (
- IN EFI_EXP_BASE2_DATA *Base2Data
- )
-{
- UINT16 Value;
- UINT16 Exponent;
-
- Value = Base2Data->Value;
- Exponent = Base2Data->Exponent;
- Exponent -= 16;
- Value <<= Exponent;
-
- return Value;
-}
-
-
-/**
- This function makes boot time changes to the contents of the
- MiscBiosVendor (Type 0).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor)
-{
- CHAR8 *OptionalStrStart;
- UINTN VendorStrLen;
- UINTN VerStrLen;
- UINTN DateStrLen;
- CHAR16 *Version;
- CHAR16 *ReleaseDate;
- EFI_STATUS Status;
- EFI_STRING Char16String;
- STRING_REF TokenToGet;
- STRING_REF TokenToUpdate;
- SMBIOS_TABLE_TYPE0 *SmbiosRecord;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- EFI_MISC_BIOS_VENDOR *ForType0InputData;
-
- ForType0InputData = (EFI_MISC_BIOS_VENDOR *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Version = (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString);
- if (StrLen (Version) > 0) {
- TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
- HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL);
- }
-
- ReleaseDate = (CHAR16 *) PcdGetPtr (PcdFirmwareReleaseDateString);
- if (StrLen(ReleaseDate) > 0) {
- TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);
- HiiSetString (mHiiHandle, TokenToUpdate, ReleaseDate, NULL);
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR);
- Char16String = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- VendorStrLen = StrLen(Char16String);
- if (VendorStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);
- Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- VerStrLen = StrLen(Version);
- if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);
- ReleaseDate = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- DateStrLen = StrLen(ReleaseDate);
- if (DateStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_INFORMATION;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- //
- // Vendor will be the 1st optional string following the formatted structure.
- //
- SmbiosRecord->Vendor = 1;
- //
- // Version will be the 2nd optional string following the formatted structure.
- //
- SmbiosRecord->BiosVersion = 2;
- SmbiosRecord->BiosSegment = (UINT16)ForType0InputData->BiosStartingAddress;
- //
- // ReleaseDate will be the 3rd optional string following the formatted structure.
- //
- SmbiosRecord->BiosReleaseDate = 3;
- //
- // Nt32 has no PCD value to indicate BIOS Size, just fill 0 for simply.
- //
- SmbiosRecord->BiosSize = 0;
- SmbiosRecord->BiosCharacteristics = *(MISC_BIOS_CHARACTERISTICS*)(&ForType0InputData->BiosCharacteristics1);
- //
- // CharacterExtensionBytes also store in ForType0InputData->BiosCharacteristics1 later two bytes to save size.
- //
- SmbiosRecord->BIOSCharacteristicsExtensionBytes[0] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 4);
- SmbiosRecord->BIOSCharacteristicsExtensionBytes[1] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 5);
-
- SmbiosRecord->SystemBiosMajorRelease = ForType0InputData->BiosMajorRelease;
- SmbiosRecord->SystemBiosMinorRelease = ForType0InputData->BiosMinorRelease;
- SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = ForType0InputData->BiosEmbeddedFirmwareMajorRelease;
- SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = ForType0InputData->BiosEmbeddedFirmwareMinorRelease;
-
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- UnicodeStrToAsciiStr(Char16String, OptionalStrStart);
- UnicodeStrToAsciiStr(Version, OptionalStrStart + VendorStrLen + 1);
- UnicodeStrToAsciiStr(ReleaseDate, OptionalStrStart + VendorStrLen + 1 + VerStrLen + 1);
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationData.c
deleted file mode 100644
index 83ade64f69..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationData.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscBootInformationData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus) = {
- EfiBootInformationStatusNoError, // BootInformationStatus
- 0 // BootInformationData
-};
-
-/* eof - MiscBootInformationData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
deleted file mode 100644
index 5f4ffc5ec2..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/** @file
- boot information boot time changes.
- SMBIOS type 32.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-
-/**
- This function makes boot time changes to the contents of the
- MiscBootInformation (Type 32).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-
-MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)
-{
- EFI_STATUS Status;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE32 *SmbiosRecord;
- EFI_MISC_BOOT_INFORMATION_STATUS* ForType32InputData;
-
- ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- SmbiosRecord->BootStatus = (UINT8)ForType32InputData->BootInformationStatus;
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c
deleted file mode 100644
index 7de39b676c..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-(C) Copyright 2017 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscChassisManufacturerData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Chassis Manufacturer data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer) = {
- STRING_TOKEN(STR_MISC_CHASSIS_MANUFACTURER), // ChassisManufactrurer
- STRING_TOKEN(STR_MISC_CHASSIS_VERSION), // ChassisVersion
- STRING_TOKEN(STR_MISC_CHASSIS_SERIAL_NUMBER), // ChassisSerialNumber
- STRING_TOKEN(STR_MISC_CHASSIS_ASSET_TAG), // ChassisAssetTag
- { // ChassisTypeStatus
- EfiMiscChassisTypeOther, // ChassisType
- 0, // ChassisLockPresent
- 0 // Reserved
- },
- EfiChassisStateOther, // ChassisBootupState
- EfiChassisStateOther, // ChassisPowerSupplyState
- EfiChassisStateOther, // ChassisThermalState
- EfiChassisSecurityStatusOther, // ChassisSecurityState
- 0, // ChassisOemDefined
- 1, // Height
- 1 // NumberofPowerCords
-};
-
-/* eof - MiscChassisManufacaturerData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c
deleted file mode 100644
index 238b62fb66..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/** @file
- Chassis manufacturer information boot time changes.
- SMBIOS type 3.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-(C) Copyright 2017 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-/**
- This function makes boot time changes to the contents of the
- MiscChassisManufacturer (Type 3).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer)
-{
- CHAR8 *OptionalStrStart;
- UINTN ManuStrLen;
- UINTN VerStrLen;
- UINTN AssetTagStrLen;
- UINTN SerialNumStrLen;
- UINTN SkuNumberStrLen;
- EFI_STATUS Status;
- EFI_STRING Manufacturer;
- EFI_STRING Version;
- EFI_STRING SerialNumber;
- EFI_STRING AssetTag;
- EFI_STRING SkuNumber;
- STRING_REF TokenToGet;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE3 *SmbiosRecord;
- EFI_MISC_CHASSIS_MANUFACTURER *ForType3InputData;
- UINT8 *Buffer;
-
- ForType3InputData = (EFI_MISC_CHASSIS_MANUFACTURER *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER);
- Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- ManuStrLen = StrLen(Manufacturer);
- if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_VERSION);
- Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- VerStrLen = StrLen(Version);
- if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER);
- SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- SerialNumStrLen = StrLen(SerialNumber);
- if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG);
- AssetTag = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- AssetTagStrLen = StrLen(AssetTag);
- if (AssetTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SKU_NUMBER);
- SkuNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- SkuNumberStrLen = StrLen(SkuNumber);
- if (SkuNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Two zeros following the last string.
- //
- // Since we set ContainedElementCount = 0 and ContainedElementRecordLength = 0,
- // remove sizeof (CONTAINED_ELEMENT) for ContainedElements[1].
- //
- // Add sizeof (SMBIOS_TABLE_STRING) for SKU Number, since not contained in SMBIOS_TABLE_TYPE3.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT) + sizeof (SMBIOS_TABLE_STRING) + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + SkuNumberStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT) + sizeof (SMBIOS_TABLE_STRING) + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1 + SkuNumberStrLen + 1 + 1);
-
- Buffer = (UINT8 *) SmbiosRecord;
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE;
- //
- // Since we set ContainedElementCount = 0 and ContainedElementRecordLength = 0,
- // remove sizeof (CONTAINED_ELEMENT) for ContainedElements[1].
- //
- // Add sizeof (SMBIOS_TABLE_STRING) for SKU Number, since not contained in SMBIOS_TABLE_TYPE3.
- //
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT) + sizeof (SMBIOS_TABLE_STRING);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- //
- // Manu will be the 1st optional string following the formatted structure.
- //
- SmbiosRecord->Manufacturer = 1;
- SmbiosRecord->Type = (UINT8)ForType3InputData->ChassisType.ChassisType;
- //
- // Version will be the 2nd optional string following the formatted structure.
- //
- SmbiosRecord->Version = 2;
- //
- // SerialNumber will be the 3rd optional string following the formatted structure.
- //
- SmbiosRecord->SerialNumber = 3;
- //
- // AssetTag will be the 4th optional string following the formatted structure.
- //
- SmbiosRecord->AssetTag = 4;
-
- SmbiosRecord->BootupState = (UINT8)ForType3InputData->ChassisBootupState;
- SmbiosRecord->PowerSupplyState = (UINT8)ForType3InputData->ChassisPowerSupplyState;
- SmbiosRecord->ThermalState = (UINT8)ForType3InputData->ChassisThermalState;
- SmbiosRecord->SecurityStatus = (UINT8)ForType3InputData->ChassisSecurityState;
- CopyMem (SmbiosRecord->OemDefined,(UINT8*)&ForType3InputData->ChassisOemDefined, 4);
- SmbiosRecord->Height = (UINT8)ForType3InputData->ChassisHeight;
- SmbiosRecord->NumberofPowerCords = (UINT8)ForType3InputData->ChassisNumberPowerCords;
- SmbiosRecord->ContainedElementCount = 0;
- SmbiosRecord->ContainedElementRecordLength = 0;
-
- //
- // SKU Number will be the 5th optional string following the formatted structure.
- //
- // Since SKU Number is not in SMBIOS_TABLE_TYPE3 structure, must locate it after ContainedElementRecordLength.
- //
- Buffer[sizeof (SMBIOS_TABLE_TYPE3) - sizeof (CONTAINED_ELEMENT)] = 5;
-
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- //
- // Since we set ContainedElementCount = 0 and ContainedElementRecordLength = 0,
- // remove sizeof (CONTAINED_ELEMENT) for ContainedElements[1].
- //
- OptionalStrStart -= sizeof (CONTAINED_ELEMENT);
- //
- // Add sizeof (SMBIOS_TABLE_STRING) for SKU Number, since not contained in SMBIOS_TABLE_TYPE3.
- //
- OptionalStrStart += sizeof (SMBIOS_TABLE_STRING);
- UnicodeStrToAsciiStr (Manufacturer, OptionalStrStart);
- UnicodeStrToAsciiStr (Version, OptionalStrStart + ManuStrLen + 1);
- UnicodeStrToAsciiStr (SerialNumber, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1);
- UnicodeStrToAsciiStr (AssetTag, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);
- UnicodeStrToAsciiStr (SkuNumber, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1);
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscDevicePath.h b/Nt32Pkg/MiscSubClassPlatformDxe/MiscDevicePath.h
deleted file mode 100644
index 875507b33d..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscDevicePath.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscDevicePath.h
-
-Abstract:
-
- Misc class required EFI Device Path definitions (Ports, slots &
- onboard devices)
-
-**/
-
-#ifndef _MISC_DEVICE_PATH_H
-#define _MISC_DEVICE_PATH_H
-
-
-#pragma pack(1)
-//
-// USB
-//
-
-/* For reference:
-#define USB1_1_STR "ACPI(PNP0A03,0)/PCI(1D,0)."
-#define USB1_2_STR "ACPI(PNP0A03,0)/PCI(1D,1)."
-#define USB1_3_STR "ACPI(PNP0A03,0)/PCI(1D,2)."
-#define USB2_1_STR "ACPI(PNP0A03,0)/PCI(1D,7)."
-*/
-
-//
-// #define acpi { 0x02, 0x01, 0x00, 0x0C, 0x0a0341d0, 0x00000000 }
-// #define pci( device,function) { 0x01, 0x01, 0x00, 0x06, device, function }
-// #define end { 0xFF, 0xFF, 0x00, 0x04 }
-//
-#define DP_ACPI \
- { \
- ACPI_DEVICE_PATH, ACPI_DP, (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \
- ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8), EISA_PNP_ID (0x0A03), 0 \
- }
-#define DP_PCI(device, function) \
- { \
- HARDWARE_DEVICE_PATH, HW_PCI_DP, (UINT8) (sizeof (PCI_DEVICE_PATH)), (UINT8) \
- ((sizeof (PCI_DEVICE_PATH)) >> 8), function, device \
- }
-#define DP_END \
- { \
- END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, END_DEVICE_PATH_LENGTH, 0 \
- }
-
-#define DP_LPC(eisaid, function) \
- { \
- ACPI_DEVICE_PATH, ACPI_DP, (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \
- ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8), EISA_PNP_ID (eisaid), function \
- }
-
-//
-// Shanmu >> moved to TianoDevicePath.h
-//
-
-/*
-typedef struct _USB_PORT_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH PciBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} USB_PORT_DEVICE_PATH;
-
-
-//IDE ??I am not sure. Should this be ATAPI_DEVICE_PATH
-typedef struct _IDE_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH PciBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} IDE_DEVICE_PATH;
-
-//RMC Connector
-typedef struct _RMC_CONN_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH PciBridgeDevicePath;
- PCI_DEVICE_PATH PciBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} RMC_CONN_DEVICE_PATH;
-
-//static RMC_CONN_DEVICE_PATH mRmcConnDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x0A,0x00 ), end };
-
-//RIDE
-typedef struct _RIDE_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH PciBridgeDevicePath;
- PCI_DEVICE_PATH PciBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} RIDE_DEVICE_PATH;
-
-//static RIDE_DEVICE_PATH mRideDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x02,0x00 ), end };
-
-//Gigabit NIC
-//typedef struct _GB_NIC_DEVICE_PATH
-//{
-// ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
-// PCI_DEVICE_PATH PciBridgeDevicePath;
-// PCI_DEVICE_PATH PciXBridgeDevicePath;
-// PCI_DEVICE_PATH PciXBusDevicePath;
-// EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-//} GB_NIC_DEVICE_PATH;
-
-//static GB_NIC_DEVICE_PATH mGbNicDevicePath = { acpi, pci( 0x03,0x00 ),pci( 0x1F,0x00 ),pci( 0x07,0x00 ), end };
-
-
-//P/S2 Connector
-typedef struct _PS2_CONN_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH LpcBridgeDevicePath;
- ACPI_HID_DEVICE_PATH LpcBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} PS2_CONN_DEVICE_PATH;
-
-//static PS2_CONN_DEVICE_PATH mPs2KeyboardDevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,0 ), end };
-//static PS2_CONN_DEVICE_PATH mPs2MouseDevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,1 ), end };
-
-//Serial Port Connector
-typedef struct _SERIAL_CONN_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH LpcBridgeDevicePath;
- ACPI_HID_DEVICE_PATH LpcBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} SERIAL_CONN_DEVICE_PATH;
-
-//static SERIAL_CONN_DEVICE_PATH mCom1DevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,0 ), end };
-//static SERIAL_CONN_DEVICE_PATH mCom2DevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,1 ), end };
-
-//Parallel Port Connector
-typedef struct _PARALLEL_CONN_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH LpcBridgeDevicePath;
- ACPI_HID_DEVICE_PATH LpcBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} PARALLEL_CONN_DEVICE_PATH;
-
-//static PARALLEL_CONN_DEVICE_PATH mLpt1DevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0401,0 ), end };
-
-//Floopy Connector
-typedef struct _FLOOPY_CONN_DEVICE_PATH
-{
- ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath;
- PCI_DEVICE_PATH LpcBridgeDevicePath;
- ACPI_HID_DEVICE_PATH LpcBusDevicePath;
- EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
-} FLOOPY_CONN_DEVICE_PATH;
-
-//static FLOOPY_CONN_DEVICE_PATH mFloopyADevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,0 ), end };
-//static FLOOPY_CONN_DEVICE_PATH mFloopyBDevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,1 ), end };
-
-*/
-
-//
-// End Shanmu
-//
-#pragma pack()
-
-#endif
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c
deleted file mode 100644
index 3532001415..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscNumberOfInstallableLanguagesData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA, NumberOfInstallableLanguages)
-= {
- 1, // NumberOfInstallableLanguages
- { // LanguageFlags
- 0, // AbbreviatedLanguageFormat
- 0 // Reserved
- },
- 0, // CurrentLanguageNumber
-};
-
-/* eof - MiscNumberOfInstallableLanguagesData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c
deleted file mode 100644
index 58c0b692f6..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/** @file
-
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-/*++
- Check whether the language is supported for given HII handle
-
- @param HiiHandle The HII package list handle.
- @param Offset The offest of current lanague in the supported languages.
- @param CurrentLang The language code.
-
- @retval TRUE Supported.
- @retval FALSE Not Supported.
-
---*/
-VOID
-EFIAPI
-CurrentLanguageMatch (
- IN EFI_HII_HANDLE HiiHandle,
- OUT UINT16 *Offset,
- OUT CHAR8 *CurrentLang
- )
-{
- CHAR8 *DefaultLang;
- CHAR8 *BestLanguage;
- CHAR8 *Languages;
- CHAR8 *MatchLang;
- CHAR8 *EndMatchLang;
- UINTN CompareLength;
-
- Languages = HiiGetSupportedLanguages (HiiHandle);
- if (Languages == NULL) {
- return;
- }
-
- GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&CurrentLang, NULL);
- DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
- BestLanguage = GetBestLanguage (
- Languages,
- FALSE,
- (CurrentLang != NULL) ? CurrentLang : "",
- DefaultLang,
- NULL
- );
- if (BestLanguage != NULL) {
- //
- // Find the best matching RFC 4646 language, compute the offset.
- //
- CompareLength = AsciiStrLen (BestLanguage);
- for (MatchLang = Languages, (*Offset) = 0; MatchLang != '\0'; (*Offset)++) {
- //
- // Seek to the end of current match language.
- //
- for (EndMatchLang = MatchLang; *EndMatchLang != '\0' && *EndMatchLang != ';'; EndMatchLang++);
-
- if ((EndMatchLang == MatchLang + CompareLength) && AsciiStrnCmp(MatchLang, BestLanguage, CompareLength) == 0) {
- //
- // Find the current best Language in the supported languages
- //
- break;
- }
- //
- // best language match be in the supported language.
- //
- ASSERT (*EndMatchLang == ';');
- MatchLang = EndMatchLang + 1;
- }
- FreePool (BestLanguage);
- }
-
- FreePool (Languages);
- if (CurrentLang != NULL) {
- FreePool (CurrentLang);
- }
- return ;
-}
-
-
-/**
- Get next language from language code list (with separator ';').
-
- @param LangCode Input: point to first language in the list. On
- Otput: point to next language in the list, or
- NULL if no more language in the list.
- @param Lang The first language in the list.
-
-**/
-VOID
-EFIAPI
-GetNextLanguage (
- IN OUT CHAR8 **LangCode,
- OUT CHAR8 *Lang
- )
-{
- UINTN Index;
- CHAR8 *StringPtr;
-
- ASSERT (LangCode != NULL);
- ASSERT (*LangCode != NULL);
- ASSERT (Lang != NULL);
-
- Index = 0;
- StringPtr = *LangCode;
- while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {
- Index++;
- }
-
- CopyMem (Lang, StringPtr, Index);
- Lang[Index] = 0;
-
- if (StringPtr[Index] == ';') {
- Index++;
- }
- *LangCode = StringPtr + Index;
-}
-
-/**
- This function returns the number of supported languages on HiiHandle.
-
- @param HiiHandle The HII package list handle.
-
- @retval The number of supported languages.
-
-**/
-UINT16
-EFIAPI
-GetSupportedLanguageNumber (
- IN EFI_HII_HANDLE HiiHandle
- )
-{
- CHAR8 *Lang;
- CHAR8 *Languages;
- CHAR8 *LanguageString;
- UINT16 LangNumber;
-
- Languages = HiiGetSupportedLanguages (HiiHandle);
- if (Languages == NULL) {
- return 0;
- }
-
- LangNumber = 0;
- Lang = AllocatePool (AsciiStrSize (Languages));
- if (Lang != NULL) {
- LanguageString = Languages;
- while (*LanguageString != 0) {
- GetNextLanguage (&LanguageString, Lang);
- LangNumber++;
- }
- FreePool (Lang);
- }
- FreePool (Languages);
- return LangNumber;
-}
-
-
-/**
- This function makes boot time changes to the contents of the
- MiscNumberOfInstallableLanguages (Type 13).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(NumberOfInstallableLanguages)
-{
- UINTN LangStrLen;
- CHAR8 CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1];
- CHAR8 *OptionalStrStart;
- UINT16 Offset;
- EFI_STATUS Status;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE13 *SmbiosRecord;
- EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES *ForType13InputData;
-
- ForType13InputData = (EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- ForType13InputData->NumberOfInstallableLanguages = GetSupportedLanguageNumber (mHiiHandle);
-
- //
- // Try to check if current langcode matches with the langcodes in installed languages
- //
- ZeroMem(CurrentLang, SMBIOS_STRING_MAX_LENGTH + 1);
- CurrentLanguageMatch (mHiiHandle, &Offset, CurrentLang);
- LangStrLen = AsciiStrLen(CurrentLang);
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
-
- SmbiosRecord->InstallableLanguages = (UINT8)ForType13InputData->NumberOfInstallableLanguages;
- SmbiosRecord->Flags = (UINT8)ForType13InputData->LanguageFlags.AbbreviatedLanguageFormat;
- SmbiosRecord->CurrentLanguages = 1;
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- AsciiStrCpy(OptionalStrStart, CurrentLang);
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringData.c
deleted file mode 100644
index 64a3e79c7f..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringData.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscOemStringData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_STRING_DATA, OemString) = {
- STRING_TOKEN(STR_MISC_OEM_STRING)
-};
-
-/* eof - MiscOemStringData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c
deleted file mode 100644
index 3c2d326815..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file
- boot information boot time changes.
- SMBIOS type 11.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-
-#include "MiscSubclassDriver.h"
-/**
- This function makes boot time changes to the contents of the
- MiscOemString (Type 11).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(OemString)
-{
- UINTN OemStrLen;
- CHAR8 *OptionalStrStart;
- EFI_STATUS Status;
- EFI_STRING OemStr;
- STRING_REF TokenToGet;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE11 *SmbiosRecord;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_OEM_STRING);
- OemStr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- OemStrLen = StrLen(OemStr);
- if (OemStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_OEM_STRINGS;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE11);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- SmbiosRecord->StringCount = 1;
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- UnicodeStrToAsciiStr(OemStr, OptionalStrStart);
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c
deleted file mode 100644
index 4e9117a29c..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscPortInternalConnectorDesignatorData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortInternalConnectorDesignator) = {
- STRING_TOKEN(STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR), // PortInternalConnectorDesignator
- STRING_TOKEN(STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR), // PortExternalConnectorDesignator
- EfiPortConnectorTypeOther, // PortInternalConnectorType
- EfiPortConnectorTypeOther, // PortExternalConnectorType
- EfiPortTypeNone, // PortType
- 0 // PortPath
-};
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortKeyboard) = {
- STRING_TOKEN (STR_MISC_PORT_INTERNAL_KEYBOARD), // PortInternalConnectorDesignator
- STRING_TOKEN (STR_MISC_PORT_EXTERNAL_KEYBOARD), // PortExternalConnectorDesignator
- EfiPortConnectorTypeNone, // PortInternalConnectorType
- EfiPortConnectorTypePS2, // PortExternalConnectorType
- EfiPortTypeKeyboard, // PortType
- // mPs2KbyboardDevicePath // PortPath
- //
- 0
-};
-
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortMouse) = {
- STRING_TOKEN (STR_MISC_PORT_INTERNAL_MOUSE), // PortInternalConnectorDesignator
- STRING_TOKEN (STR_MISC_PORT_EXTERNAL_MOUSE), // PortExternalConnectorDesignator
- EfiPortConnectorTypeNone, // PortInternalConnectorType
- EfiPortConnectorTypePS2, // PortExternalConnectorType
- EfiPortTypeMouse, // PortType
- // mPs2MouseDevicePath // PortPath
- //
- 0
-};
-
-
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom1) = {
- STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM1),
- STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM1),
- EfiPortConnectorTypeNone,
- EfiPortConnectorTypeDB9Female,
- EfiPortTypeSerial16550ACompatible,
- 0
-};
-
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom2) = {
- STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM2),
- STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM2),
- EfiPortConnectorTypeNone,
- EfiPortConnectorTypeDB9Female,
- EfiPortTypeSerial16550ACompatible,
- 0
-};
-
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortExtensionPower) = {
- STRING_TOKEN(STR_MISC_PORT_INTERNAL_EXTENSION_POWER),
- STRING_TOKEN(STR_MISC_PORT_EXTERNAL_EXTENSION_POWER),
- EfiPortConnectorTypeOther,
- EfiPortConnectorTypeNone,
- EfiPortTypeOther,
- 0
-};
-
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortFloppy) = {
- STRING_TOKEN(STR_MISC_PORT_INTERNAL_FLOPPY),
- STRING_TOKEN(STR_MISC_PORT_EXTERNAL_FLOPPY),
- EfiPortConnectorTypeOnboardFloppy,
- EfiPortConnectorTypeNone,
- EfiPortTypeOther,
- 0
-};
-
-/* eof - MiscPortInternalConnectorDesignatorData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c
deleted file mode 100644
index 8de657cb6a..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscPortInternalConnectorDesignatorFunction.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-
-MISC_SMBIOS_TABLE_FUNCTION (
- MiscPortInternalConnectorDesignator
- )
-/*++
-Description:
-
- This function makes boot time changes to the contents of the
- MiscPortConnectorInformation (Type 8).
-
-Parameters:
-
- RecordType
- Type of record to be processed from the Data Table.
- mMiscSubclassDataTable[].RecordType
-
- RecordLen
- Size of static RecordData from the Data Table.
- mMiscSubclassDataTable[].RecordLen
-
- RecordData
- Pointer to copy of RecordData from the Data Table. Changes made
- to this copy will be written to the Data Hub but will not alter
- the contents of the static Data Table.
-
- LogRecordData
- Set *LogRecordData to TRUE to log RecordData to Data Hub.
- Set *LogRecordData to FALSE when there is no more data to log.
-
-Returns:
-
- EFI_SUCCESS
- All parameters were valid and *RecordData and *LogRecordData have
- been set.
-
- EFI_UNSUPPORTED
- Unexpected RecordType value.
-
- EFI_INVALID_PARAMETER
- One of the following parameter conditions was true:
- RecordLen was zero.
- RecordData was NULL.
- LogRecordData was NULL.
---*/
-{
- CHAR8 *OptionalStrStart;
- UINTN InternalRefStrLen;
- UINTN ExternalRefStrLen;
- EFI_STRING InternalRef;
- EFI_STRING ExternalRef;
- STRING_REF TokenForInternal;
- STRING_REF TokenForExternal;
- EFI_STATUS Status;
- SMBIOS_TABLE_TYPE8 *SmbiosRecord;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *ForType8InputData;
-
- ForType8InputData = (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *)RecordData;
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenForInternal = 0;
- TokenForExternal = 0;
-
- switch (ForType8InputData->PortInternalConnectorDesignator) {
-
- case STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR:
- TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR);
- TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR);
- break;
- case STR_MISC_PORT_INTERNAL_KEYBOARD:
- TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_KEYBOARD);
- TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_KEYBOARD);
- break;
- case STR_MISC_PORT_INTERNAL_MOUSE:
- TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_MOUSE);
- TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_MOUSE);
- break;
- case STR_MISC_PORT_INTERNAL_COM1:
- TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_COM1);
- TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM1);
- break;
- case STR_MISC_PORT_INTERNAL_COM2:
- TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_COM2);
- TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM2);
- break;
- case STR_MISC_PORT_INTERNAL_EXTENSION_POWER:
- TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_EXTENSION_POWER);
- TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_EXTENSION_POWER);
- break;
- case STR_MISC_PORT_INTERNAL_FLOPPY:
- TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_FLOPPY);
- TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_FLOPPY);
- break;
- default:
- break;
- }
-
- InternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForInternal, NULL);
- InternalRefStrLen = StrLen(InternalRef);
- if (InternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- ExternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForExternal, NULL);
- ExternalRefStrLen = StrLen(ExternalRef);
- if (ExternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE8);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- SmbiosRecord->InternalReferenceDesignator = 1;
- SmbiosRecord->InternalConnectorType = (UINT8)ForType8InputData->PortInternalConnectorType;
- SmbiosRecord->ExternalReferenceDesignator = 2;
- SmbiosRecord->ExternalConnectorType = (UINT8)ForType8InputData->PortExternalConnectorType;
- SmbiosRecord->PortType = (UINT8)ForType8InputData->PortType;
-
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- UnicodeStrToAsciiStr(InternalRef, OptionalStrStart);
- UnicodeStrToAsciiStr(ExternalRef, OptionalStrStart + InternalRefStrLen + 1);
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
-
-
-
-/* eof - MiscSystemManufacturerFunction.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c
deleted file mode 100644
index e8a66bf068..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscResetCapabilitiesData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities) = {
- { // ResetCapabilities
- 0, // Status
- 0, // BootOption
- 0, // BootOptionOnLimit
- 0, // WatchdogTimerPresent
- 0 // Reserved
- },
- 0, // ResetCount
- 0, // ResetLimit
- 0, // ResetTimerInterval
- 0 // ResetTimeout
-};
-
-/* eof - MiscResetCapabilities.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
deleted file mode 100644
index 0cf894d6e3..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- ResetCapabilities.
- SMBIOS type 23.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-
-#include "MiscSubclassDriver.h"
-/**
- This function makes boot time changes to the contents of the
- MiscOemString (Type 11).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)
-{
- EFI_STATUS Status;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE23 *SmbiosRecord;
- EFI_MISC_RESET_CAPABILITIES *ForType23InputData;
-
- ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- SmbiosRecord->Capabilities = *(UINT8*)&(ForType23InputData->ResetCapabilities);
- SmbiosRecord->ResetCount = (UINT16)ForType23InputData->ResetCount;
- SmbiosRecord->ResetLimit = (UINT16)ForType23InputData->ResetLimit;
- SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;
- SmbiosRecord->Timeout = (UINT16)ForType23InputData->ResetTimeout;
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
-
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
deleted file mode 100644
index 2850598f29..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
+++ /dev/null
@@ -1,89 +0,0 @@
-## @file
-# Misc Sub class driver
-#
-# Parses the MiscSubclassDataTable and reports any generated data to the DataHub.
-# All .uni file who tagged with "ToolCode="DUMMY"" in following file list is included by
-# MiscSubclassDriver.uni file, the StrGather tool will expand MiscSubclassDriver.uni file
-# and parse all .uni file.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = MiscSubclass
- FILE_GUID = 4A9B9DB8-EC62-4A92-818F-8AA0246D246E
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = MiscSubclassDriverEntryPoint
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- MiscBaseBoardManufacturerData.c
- MiscBaseBoardManufacturerFunction.c
- MiscBiosVendorData.c
- MiscBiosVendorFunction.c
- MiscBootInformationData.c
- MiscBootInformationFunction.c
- MiscChassisManufacturerData.c
- MiscChassisManufacturerFunction.c
- MiscNumberOfInstallableLanguagesData.c
- MiscNumberOfInstallableLanguagesFunction.c
- MiscOemStringData.c
- MiscOemStringFunction.c
- MiscPortInternalConnectorDesignatorData.c
- MiscPortInternalConnectorDesignatorFunction.c
- MiscResetCapabilitiesData.c
- MiscResetCapabilitiesFunction.c
- MiscSystemLanguageStringData.c
- MiscSystemLanguageStringFunction.c
- MiscSystemManufacturerData.c
- MiscSystemManufacturerFunction.c
- MiscSystemOptionStringData.c
- MiscSystemOptionStringFunction.c
- MiscSystemSlotDesignationData.c
- MiscSystemSlotDesignationFunction.c
- MiscDevicePath.h
- MiscSubclassDriver.h
- MiscSubclassDriver.uni
- MiscSubclassDriverDataTable.c
- MiscSubclassDriverEntryPoint.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- DevicePathLib
- UefiBootServicesTableLib
- BaseMemoryLib
- UefiDriverEntryPoint
- UefiLib
- HiiLib
- DebugLib
- BaseLib
- MemoryAllocationLib
- PcdLib
-
-[Protocols]
- gEfiWinNtIoProtocolGuid # PROTOCOL_NOTIFY SOMETIMES_CONSUMED
- gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
-
-[Pcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString
- gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize
- gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
-
-[Depex]
- gEfiSmbiosProtocolGuid
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
deleted file mode 100644
index fbd29d7092..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSubclassDriver.h
-
-Abstract:
-
- Header file for MiscSubclass Driver.
-
-**/
-
-#ifndef _MISC_SUBCLASS_DRIVER_H
-#define _MISC_SUBCLASS_DRIVER_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-//
-// Data table entry update function.
-//
-typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (
- IN VOID *RecordData,
- IN EFI_SMBIOS_PROTOCOL *Smbios
- );
-
-//
-// Data table entry definition.
-//
-typedef struct {
- //
- // intermediat input data for SMBIOS record
- //
- VOID *RecordData;
- EFI_MISC_SMBIOS_DATA_FUNCTION *Function;
-} EFI_MISC_SMBIOS_DATA_TABLE;
-
-//
-// Data Table extern definitions.
-//
-#define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \
-extern NAME1 NAME2 ## Data; \
-extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function
-
-
-//
-// Data Table entries
-//
-#define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \
-{ \
- & NAME1 ## Data, \
- & NAME2 ## Function \
-}
-
-//
-// Global definition macros.
-//
-#define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \
- NAME1 NAME2 ## Data
-
-#define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \
- EFI_STATUS EFIAPI NAME2 ## Function( \
- IN VOID *RecordData, \
- IN EFI_SMBIOS_PROTOCOL *Smbios \
- )
-
-
-//
-// Data Table Array
-//
-extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];
-
-//
-// Data Table Array Entries
-//
-extern UINTN mMiscSubclassDataTableEntries;
-extern UINT8 MiscSubclassStrings[];
-extern EFI_HII_HANDLE mHiiHandle;
-
-
-/**
- Add an SMBIOS record.
-
- @param Smbios The EFI_SMBIOS_PROTOCOL instance.
- @param SmbiosHandle A unique handle will be assigned to the SMBIOS record.
- @param Record The data for the fixed portion of the SMBIOS record. The format of the record is
- determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined
- by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or
- a set of null terminated strings and a null.
-
- @retval EFI_SUCCESS Record was added.
- @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system resources.
-
-**/
-EFI_STATUS
-AddSmbiosRecord (
- IN EFI_SMBIOS_PROTOCOL *Smbios,
- OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
- IN EFI_SMBIOS_TABLE_HEADER *Record
- );
-
-#endif /* _MISC_SUBCLASS_DRIVER_H */
-
-/* eof - MiscSubclassDriver.h */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.uni
deleted file mode 100644
index 8d11a497b8..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.uni
+++ /dev/null
@@ -1,114 +0,0 @@
-// *++
-//
-// Copyright (c) 2006, Intel Corporation. All rights reserved.
-// (C) Copyright 2017 Hewlett Packard Enterprise Development LP
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// Module Name:
-//
-// MiscSubclassStrings.Vfr
-//
-// Abstract:
-//
-// Misc. Subclass formset.
-//
-// Revision History:
-//
-// --*/
-
-/=#
-
-#langdef en-US "English"
-#langdef fr-FR "Français"
-
-
-#string STR_MISC_SUBCLASS_DRIVER_TITLE #language en-US "Not used"
-
-#string STR_MISC_BASE_BOARD_MANUFACTURER #language en-US "Base Board Manufacturer"
-#string STR_MISC_BASE_BOARD_PRODUCT_NAME #language en-US "Base Board Product Name"
-#string STR_MISC_BASE_BOARD_VERSION #language en-US "Base Board Version"
-#string STR_MISC_BASE_BOARD_SERIAL_NUMBER #language en-US "Base Board Serial Number"
-#string STR_MISC_BASE_BOARD_ASSET_TAG #language en-US "Base Board Asset Tag"
-#string STR_MISC_BASE_BOARD_CHASSIS_LOCATION #language en-US "Base Board Chassis Location"
-
-#string STR_MISC_BIOS_VENDOR #language en-US "Bios Vendor"
-#string STR_MISC_BIOS_VERSION #language en-US "R9 Prime"
- #language fr-FR "Perfection R9"
-#string STR_MISC_BIOS_RELEASE_DATE #language en-US "Bios Release Date"
-
-#string STR_MISC_CHASSIS_MANUFACTURER #language en-US "Chassis Manufacturer"
-#string STR_MISC_CHASSIS_VERSION #language en-US "Chassis Version"
-#string STR_MISC_CHASSIS_SERIAL_NUMBER #language en-US "Chassis Serial Number"
-#string STR_MISC_CHASSIS_ASSET_TAG #language en-US "Chassis Asset Tag"
-#string STR_MISC_CHASSIS_SKU_NUMBER #language en-US "Chassis SKU Number"
-
-#string STR_MISC_OEM_STRING #language en-US "System Language String"
-
-#string STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR #language en-US "Port Internal Connector"
-#string STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR #language en-US "Port External Connector"
-#string STR_MISC_PORT_INTERNAL_KEYBOARD #language en-US "J1A1"
-#string STR_MISC_PORT_EXTERNAL_KEYBOARD #language en-US "Keyboard"
-#string STR_MISC_PORT_INTERNAL_MOUSE #language en-US "J1A1"
-#string STR_MISC_PORT_EXTERNAL_MOUSE #language en-US "Mouse"
-#string STR_MISC_PORT_INTERNAL_COM1 #language en-US "J2A1"
-#string STR_MISC_PORT_EXTERNAL_COM1 #language en-US "COM 1"
-#string STR_MISC_PORT_INTERNAL_LPT1 #language en-US "J4A2"
-#string STR_MISC_PORT_EXTERNAL_LPT1 #language en-US "LPT 1"
-#string STR_MISC_PORT_INTERNAL_EXTENSION_POWER #language en-US "J5C1"
-#string STR_MISC_PORT_EXTERNAL_EXTENSION_POWER #language en-US "Extension Power Header"
-#string STR_MISC_PORT_INTERNAL_USB1 #language en-US "JA5A1"
-#string STR_MISC_PORT_EXTERNAL_USB1 #language en-US "USB"
-#string STR_MISC_PORT_INTERNAL_USB2 #language en-US "J2A2"
-#string STR_MISC_PORT_EXTERNAL_USB2 #language en-US "USB"
-#string STR_MISC_PORT_INTERNAL_NETWORK #language en-US "JA5A1"
-#string STR_MISC_PORT_EXTERNAL_NETWORK #language en-US "RJ-45 Type"
-#string STR_MISC_PORT_INTERNAL_MIC #language en-US "J6A1"
-#string STR_MISC_PORT_EXTERNAL_MIC #language en-US "Audio Mic In"
-#string STR_MISC_PORT_INTERNAL_LINE_IN #language en-US "J6A1"
-#string STR_MISC_PORT_EXTERNAL_LINE_IN #language en-US "Audio Line In"
-#string STR_MISC_PORT_INTERNAL_LINE_OUT #language en-US "J6A1"
-#string STR_MISC_PORT_EXTERNAL_LINE_OUT #language en-US "Audio Line Out"
-#string STR_MISC_PORT_INTERNAL_FLOPPY #language en-US "J4H1"
-#string STR_MISC_PORT_EXTERNAL_FLOPPY #language en-US "OnBoard Floppy Type"
-#string STR_MISC_PORT_INTERNAL_IDE1 #language en-US "J6H2"
-#string STR_MISC_PORT_EXTERNAL_IDE1 #language en-US "OnBoard Primary IDE"
-#string STR_MISC_PORT_INTERNAL_IDE2 #language en-US "J6H1"
-#string STR_MISC_PORT_EXTERNAL_IDE2 #language en-US "OnBoard Secondary IDE"
-#string STR_MISC_PORT_INTERNAL_SOUND_IN1 #language en-US "J8B1"
-#string STR_MISC_PORT_EXTERNAL_SOUND_IN1 #language en-US "OnBoard Sound Input Type"
-#string STR_MISC_PORT_INTERNAL_SOUND_IN2 #language en-US "J6B1"
-#string STR_MISC_PORT_EXTERNAL_SOUND_IN2 #language en-US "OnBoard Sound Input Type"
-#string STR_MISC_PORT_INTERNAL_FRONT_PANEL #language en-US "J9G1"
-#string STR_MISC_PORT_EXTERNAL_FRONT_PANEL #language en-US "Front Panel Header Type"
-#string STR_MISC_PORT_INTERNAL_CPU_FAN #language en-US "J2F1"
-#string STR_MISC_PORT_EXTERNAL_CPU_FAN #language en-US "CPU Fan Header"
-#string STR_MISC_PORT_INTERNAL_FRONT_FAN #language en-US "J9H3"
-#string STR_MISC_PORT_EXTERNAL_FRONT_FAN #language en-US "Front Chassis Fan"
-#string STR_MISC_PORT_INTERNAL_REAR_FAN #language en-US "J1B1"
-#string STR_MISC_PORT_EXTERNAL_REAR_FAN #language en-US "Rear Chassis Fan"
-#string STR_MISC_PORT_INTERNAL_CONFIG_JUMPER #language en-US "J9H2"
-#string STR_MISC_PORT_EXTERNAL_CONFIG_JUMPER #language en-US "Configuration Jumper"
-#string STR_MISC_PORT_INTERNAL_AUDIO_PANEL #language en-US "J8A1"
-#string STR_MISC_PORT_EXTERNAL_AUDIO_PANEL #language en-US "Audio Front Panel Header"
-#string STR_MISC_PORT_INTERNAL_USB_PANEL #language en-US "J9F1"
-#string STR_MISC_PORT_EXTERNAL_USB_PANEL #language en-US "USB Front Panel Header"
-#string STR_MISC_PORT_INTERNAL_ATX_POWER #language en-US "J2H1"
-#string STR_MISC_PORT_EXTERNAL_ATX_POWER #language en-US "ATX Power Header"
-#string STR_MISC_PORT_INTERNAL_COM2 #language en-US "J5A1"
-#string STR_MISC_PORT_EXTERNAL_COM2 #language en-US "COM 2"
-#string STR_MISC_PORT_INTERNAL_USB3 #language en-US "J1D3"
-#string STR_MISC_PORT_EXTERNAL_USB3 #language en-US "USB"
-
-#string STR_MISC_SYSTEM_LANGUAGE_STRING #language en-US "System Language String"
-
-#string STR_MISC_SYSTEM_MANUFACTURER #language en-US "System Manufacturer"
-#string STR_MISC_SYSTEM_PRODUCT_NAME #language en-US "NT32 Emulation Environment"
- #language fr-FR "Environnement De l'Émulation NT32"
-
-#string STR_MISC_SYSTEM_VERSION #language en-US "System Version"
-#string STR_MISC_SYSTEM_SERIAL_NUMBER #language en-US "System Serial Number"
-
-#string STR_MISC_SYSTEM_OPTION_STRING #language en-US "System Option String"
-
-#string STR_MISC_SYSTEM_SLOT_DESIGNATION #language en-US "System Slot Designation"
-
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c
deleted file mode 100644
index ceecbe977d..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSubclassDriverDataTable.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-
-//
-// External definitions referenced by Data Table entries.
-//
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer, MiscBaseBoardManufacturer);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor,MiscBiosVendor );
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus, BootInformationStatus);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer, MiscChassisManufacturer);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA,NumberOfInstallableLanguages, NumberOfInstallableLanguages);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_OEM_STRING_DATA,OemString, OemString);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortInternalConnectorDesignator, MiscPortInternalConnectorDesignator);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortKeyboard, MiscPortInternalConnectorDesignator);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortMouse, MiscPortInternalConnectorDesignator);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom1, MiscPortInternalConnectorDesignator);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom2, MiscPortInternalConnectorDesignator);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortExtensionPower, MiscPortInternalConnectorDesignator);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortFloppy, MiscPortInternalConnectorDesignator);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities, MiscResetCapabilities);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA,SystemLanguageString, SystemLanguageString);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer, MiscSystemManufacturer);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString, SystemOptionString);
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotDesignation, MiscSystemSlotDesignation);
-
-
-//
-// Data Table.
-//
-EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[] = {
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscBaseBoardManufacturer, MiscBaseBoardManufacturer),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscBiosVendor,MiscBiosVendor ),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( BootInformationStatus, BootInformationStatus),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscChassisManufacturer, MiscChassisManufacturer),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NumberOfInstallableLanguages, NumberOfInstallableLanguages),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(OemString, OemString),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortInternalConnectorDesignator, MiscPortInternalConnectorDesignator),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortKeyboard, MiscPortInternalConnectorDesignator),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortMouse, MiscPortInternalConnectorDesignator),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortCom1, MiscPortInternalConnectorDesignator),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortCom2, MiscPortInternalConnectorDesignator),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortExtensionPower, MiscPortInternalConnectorDesignator),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortFloppy, MiscPortInternalConnectorDesignator),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscResetCapabilities, MiscResetCapabilities),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(SystemLanguageString, SystemLanguageString),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscSystemManufacturer, MiscSystemManufacturer),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( SystemOptionString, SystemOptionString),
- MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscSystemSlotDesignation, MiscSystemSlotDesignation),
- };
-
-//
-// Number of Data Table entries.
-//
-UINTN mMiscSubclassDataTableEntries = (sizeof mMiscSubclassDataTable) / sizeof (EFI_MISC_SMBIOS_DATA_TABLE);
-
-/* eof - MiscSubclassDriverDataTable.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
deleted file mode 100644
index b7098e9b02..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSubclassDriverEntryPoint.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-EFI_HII_HANDLE mHiiHandle;
-
-/**
- This is the standard EFI driver point that detects whether there is a
- MemoryConfigurationData Variable and, if so, reports memory configuration info
- to the DataHub.
-
- @param ImageHandle Handle for the image of this driver
- @param SystemTable Pointer to the EFI System Table
-
- @return EFI_SUCCESS if the data is successfully reported
- @return EFI_NOT_FOUND if the HOB list could not be located.
-
-**/
-EFI_STATUS
-LogMemorySmbiosRecord (
- VOID
- )
-{
- EFI_STATUS Status;
- UINT64 TotalMemorySize;
- UINT8 NumSlots;
- SMBIOS_TABLE_TYPE19 *Type19Record;
- EFI_SMBIOS_HANDLE MemArrayMappedAddrSmbiosHandle;
- EFI_SMBIOS_PROTOCOL *Smbios;
- CHAR16 *Nt32MemString;
-
- Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);
- ASSERT_EFI_ERROR (Status);
-
- NumSlots = 1;
-
- //
- // Process Memory String in form size!size ...
- // So 64!64 is 128 MB
- //
- Nt32MemString = PcdGetPtr (PcdWinNtMemorySize);
- for (TotalMemorySize = 0; *Nt32MemString != '\0';) {
- TotalMemorySize += StrDecimalToUint64 (Nt32MemString);
- while (*Nt32MemString != '\0') {
- if (*Nt32MemString == '!') {
- Nt32MemString++;
- break;
- }
- Nt32MemString++;
- }
- }
-
- //
- // Convert Total Memory Size to based on KiloByte
- //
- TotalMemorySize = LShiftU64 (TotalMemorySize, 20);
- //
- // Generate Memory Array Mapped Address info
- //
- Type19Record = AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE19) + 2);
- Type19Record->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS;
- Type19Record->Hdr.Length = sizeof(SMBIOS_TABLE_TYPE19);
- Type19Record->Hdr.Handle = 0;
- Type19Record->StartingAddress = 0;
- Type19Record->EndingAddress = (UINT32)RShiftU64(TotalMemorySize, 10) - 1;
- Type19Record->MemoryArrayHandle = 0;
- Type19Record->PartitionWidth = (UINT8)(NumSlots);
-
- //
- // Generate Memory Array Mapped Address info (TYPE 19)
- //
- Status = AddSmbiosRecord (Smbios, &MemArrayMappedAddrSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type19Record);
-
- FreePool(Type19Record);
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-
-EFI_STATUS
-EFIAPI
-MiscSubclassDriverEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-Description:
-
- Standard EFI driver point. This driver parses the mMiscSubclassDataTable
- structure and reports any generated data to the DataHub.
-
-Arguments:
-
- ImageHandle
- Handle for the image of this driver
-
- SystemTable
- Pointer to the EFI System Table
-
-Returns:
-
- EFI_SUCCESS
- The data was successfully reported to the Data Hub.
-
---*/
-{
- UINTN Index;
- EFI_STATUS EfiStatus;
- EFI_SMBIOS_PROTOCOL *Smbios;
-
- EfiStatus = gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);
-
- if (EFI_ERROR(EfiStatus)) {
- DEBUG((EFI_D_ERROR, "Could not locate SMBIOS protocol. %r\n", EfiStatus));
- return EfiStatus;
- }
-
- mHiiHandle = HiiAddPackages (
- &gEfiCallerIdGuid,
- NULL,
- MiscSubclassStrings,
- NULL
- );
- ASSERT (mHiiHandle != NULL);
-
- for (Index = 0; Index < mMiscSubclassDataTableEntries; ++Index) {
- //
- // If the entry have a function pointer, just log the data.
- //
- if (mMiscSubclassDataTable[Index].Function != NULL) {
- EfiStatus = (*mMiscSubclassDataTable[Index].Function)(
- mMiscSubclassDataTable[Index].RecordData,
- Smbios
- );
-
- if (EFI_ERROR(EfiStatus)) {
- DEBUG((EFI_D_ERROR, "Misc smbios store error. Index=%d, ReturnStatus=%r\n", Index, EfiStatus));
- return EfiStatus;
- }
- }
- }
-
- //
- // Log Memory SMBIOS Record
- //
- EfiStatus = LogMemorySmbiosRecord();
- return EfiStatus;
-}
-
-/**
- Add an SMBIOS record.
-
- @param Smbios The EFI_SMBIOS_PROTOCOL instance.
- @param SmbiosHandle A unique handle will be assigned to the SMBIOS record.
- @param Record The data for the fixed portion of the SMBIOS record. The format of the record is
- determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined
- by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or
- a set of null terminated strings and a null.
-
- @retval EFI_SUCCESS Record was added.
- @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system resources.
-
-**/
-EFI_STATUS
-AddSmbiosRecord (
- IN EFI_SMBIOS_PROTOCOL *Smbios,
- OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
- IN EFI_SMBIOS_TABLE_HEADER *Record
- )
-{
- *SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
- return Smbios->Add (
- Smbios,
- NULL,
- SmbiosHandle,
- Record
- );
-}
-
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c
deleted file mode 100644
index dd432e3002..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSystemLanguageStringData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA, SystemLanguageString) = {
- 0,
- STRING_TOKEN(STR_MISC_SYSTEM_LANGUAGE_STRING)
-};
-
-/* eof - MiscSystemLanguageStringData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c
deleted file mode 100644
index 45d2279c2a..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/** @file
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-/**
- This function makes boot time changes to the contents of the
- MiscOemString (Type 11).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(SystemLanguageString)
-{
- EFI_STATUS Status;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE13 *SmbiosRecord;
- UINTN StrLeng;
- CHAR8 *OptionalStrStart;
- EFI_STRING Str;
- STRING_REF TokenToGet;
-
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_LANGUAGE_STRING);
- Str = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- StrLeng = StrLen(Str);
- if (StrLeng > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- SmbiosRecord->InstallableLanguages = 1;
- SmbiosRecord->Flags = 1;
- SmbiosRecord->CurrentLanguages = 1;
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- UnicodeStrToAsciiStr(Str, OptionalStrStart);
-
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
-
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c
deleted file mode 100644
index bc44ca5f89..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSystemManufacturerData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) System Manufacturer data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer)
-= {
- STRING_TOKEN(STR_MISC_SYSTEM_MANUFACTURER),
- // SystemManufactrurer
- STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME),
- // SystemProductName
- STRING_TOKEN(STR_MISC_SYSTEM_VERSION),
- // SystemVersion
- STRING_TOKEN(STR_MISC_SYSTEM_SERIAL_NUMBER),
- // SystemSerialNumber
- {
- 0xbadfaced,
- 0xdead,
- 0xbeef,
- 0x13,
- 0x13,
- 0x13,
- 0x13,
- 0x13,
- 0x13,
- 0x13,
- 0x13
- },
- // SystemUuid
- EfiSystemWakeupTypePowerSwitch // SystemWakeupType
-};
-
-/* eof - MiscSystemManufacturerData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
deleted file mode 100644
index f0719f6caf..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSystemManufacturerFunction.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-/**
- This function makes boot time changes to the contents of the
- MiscSystemManufacturer (Type 1).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)
-{
- CHAR8 *OptionalStrStart;
- UINTN ManuStrLen;
- UINTN VerStrLen;
- UINTN PdNameStrLen;
- UINTN SerialNumStrLen;
- EFI_STATUS Status;
- EFI_STRING Manufacturer;
- EFI_STRING ProductName;
- EFI_STRING Version;
- EFI_STRING SerialNumber;
- STRING_REF TokenToGet;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE1 *SmbiosRecord;
- EFI_MISC_SYSTEM_MANUFACTURER *ForType1InputData;
-
- ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);
- Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- ManuStrLen = StrLen(Manufacturer);
- if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
- ProductName = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- PdNameStrLen = StrLen(ProductName);
- if (PdNameStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
- Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- VerStrLen = StrLen(Version);
- if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);
- SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- SerialNumStrLen = StrLen(SerialNumber);
- if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_INFORMATION;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
- //
- // Manu will be the 1st optional string following the formatted structure.
- //
- SmbiosRecord->Manufacturer = 1;
- //
- // ProductName will be the 2nd optional string following the formatted structure.
- //
- SmbiosRecord->ProductName = 2;
- //
- // Version will be the 3rd optional string following the formatted structure.
- //
- SmbiosRecord->Version = 3;
- //
- // Version will be the 4th optional string following the formatted structure.
- //
- SmbiosRecord->SerialNumber = 4;
- CopyMem ((UINT8 *) (&SmbiosRecord->Uuid),&ForType1InputData->SystemUuid,16);
- SmbiosRecord->WakeUpType = (UINT8)ForType1InputData->SystemWakeupType;
-
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);
- UnicodeStrToAsciiStr(ProductName, OptionalStrStart + ManuStrLen + 1);
- UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1);
- UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1);
-
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
-
-/* eof - MiscSystemManufacturerFunction.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c
deleted file mode 100644
index b027354390..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSystemOptionStringData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString) = {
- STRING_TOKEN(STR_MISC_SYSTEM_OPTION_STRING)
-};
-
-/* eof - MiscSystemOptionStringData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c
deleted file mode 100644
index e3abc4f2cf..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/** @file
- BIOS system option string boot time changes.
- SMBIOS type 12.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-
-/**
- This function makes boot time changes to the contents of the
- MiscSystemOptionString (Type 12).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(SystemOptionString)
-{
- CHAR8 *OptionalStrStart;
- UINTN OptStrLen;
- EFI_STRING OptionString;
- EFI_STATUS Status;
- STRING_REF TokenToGet;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- SMBIOS_TABLE_TYPE12 *SmbiosRecord;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_OPTION_STRING);
- OptionString = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- OptStrLen = StrLen(OptionString);
- if (OptStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE12);
- //
- // Make handle chosen by smbios protocol.add automatically.
- //
- SmbiosRecord->Hdr.Handle = 0;
-
- SmbiosRecord->StringCount = 1;
- OptionalStrStart = (CHAR8*) (SmbiosRecord + 1);
- UnicodeStrToAsciiStr(OptionString, OptionalStrStart);
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c
deleted file mode 100644
index be70130415..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- MiscSystemSlotDesignationData.c
-
-Abstract:
-
- This driver parses the mMiscSubclassDataTable structure and reports
- any generated data to the DataHub.
-
-**/
-
-#include "MiscSubclassDriver.h"
-
-//
-// Static (possibly build generated) Bios Vendor data.
-//
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotDesignation) = {
- STRING_TOKEN(STR_MISC_SYSTEM_SLOT_DESIGNATION), // SlotDesignation
- EfiSlotTypeOther, // SlotType
- EfiSlotDataBusWidthOther, // SlotDataBusWidth
- EfiSlotUsageOther, // SlotUsage
- EfiSlotLengthOther, // SlotLength
- 0, // SlotId
- { // SlotCharacteristics
- 0, // CharacteristicsUnknown :1;
- 0, // Provides50Volts :1;
- 0, // Provides33Volts :1;
- 0, // SharedSlot :1;
- 0, // PcCard16Supported :1;
- 0, // CardBusSupported :1;
- 0, // ZoomVideoSupported :1;
- 0, // ModemRingResumeSupported:1;
- 0, // PmeSignalSupported :1;
- 0, // HotPlugDevicesSupported :1;
- 0, // SmbusSignalSupported :1;
- 0 // Reserved :21;
- },
- 0 // SlotDevicePath
-};
-
-/* eof - MiscSystemSlotsData.c */
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c
deleted file mode 100644
index f62600352e..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/** @file
- BIOS system slot designator information boot time changes.
- SMBIOS type 9.
-
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include "MiscSubclassDriver.h"
-/**
- This function makes boot time changes to the contents of the
- MiscSystemSlotDesignator structure (Type 9).
-
- @param RecordData Pointer to copy of RecordData from the Data Table.
-
- @retval EFI_SUCCESS All parameters were valid.
- @retval EFI_UNSUPPORTED Unexpected RecordType value.
- @retval EFI_INVALID_PARAMETER Invalid parameter was found.
-
-**/
-MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignation)
-{
- CHAR8 *OptionalStrStart;
- UINTN SlotDesignationStrLen;
- EFI_STATUS Status;
- EFI_STRING SlotDesignation;
- STRING_REF TokenToGet;
- SMBIOS_TABLE_TYPE9 *SmbiosRecord;
- EFI_SMBIOS_HANDLE SmbiosHandle;
- EFI_MISC_SYSTEM_SLOT_DESIGNATION* ForType9InputData;
-
- ForType9InputData = (EFI_MISC_SYSTEM_SLOT_DESIGNATION *)RecordData;
-
- //
- // First check for invalid parameters.
- //
- if (RecordData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- TokenToGet = 0;
- switch (ForType9InputData->SlotDesignation) {
- case STR_MISC_SYSTEM_SLOT_DESIGNATION:
- TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_DESIGNATION);
- break;
- default:
- break;
- }
-
- SlotDesignation = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
- SlotDesignationStrLen = StrLen(SlotDesignation);
- if (SlotDesignationStrLen > SMBIOS_STRING_MAX_LENGTH) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Two zeros following the last string.
- //
- SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE9) + SlotDesignationStrLen + 1 + 1);
- ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE9) +SlotDesignationStrLen + 1 + 1);
-
- SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_SLOTS;
- SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE9);
- SmbiosRecord->Hdr.Handle = 0;
- SmbiosRecord->SlotDesignation = 1;
- SmbiosRecord->SlotType = (UINT8)ForType9InputData->SlotType;
- SmbiosRecord->SlotDataBusWidth = (UINT8)ForType9InputData->SlotDataBusWidth;
- SmbiosRecord->CurrentUsage = (UINT8)ForType9InputData->SlotUsage;
- SmbiosRecord->SlotLength = (UINT8)ForType9InputData->SlotLength;
- SmbiosRecord->SlotID = ForType9InputData->SlotId;
-
- //
- // Slot Characteristics
- //
- CopyMem ((UINT8 *) &SmbiosRecord->SlotCharacteristics1,(UINT8 *) &ForType9InputData->SlotCharacteristics,2);
- OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
- UnicodeStrToAsciiStr(SlotDesignation, OptionalStrStart);
- //
- // Now we have got the full smbios record, call smbios protocol to add this record.
- //
- Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);
-
- FreePool(SmbiosRecord);
- return Status;
-}
diff --git a/Nt32Pkg/Nt32Pkg.dec b/Nt32Pkg/Nt32Pkg.dec
deleted file mode 100644
index 158e896389..0000000000
--- a/Nt32Pkg/Nt32Pkg.dec
+++ /dev/null
@@ -1,90 +0,0 @@
-## @file
-# This package is a platform package that provide platform module/library
-# required by NT32 platform.
-#
-# File/Directory Orignazation:
-# |- Sec : Emulation SecCore for Nt32 platform
-# |- *Pei : PEIM drivers
-# |- *Dxe : DXE drivers
-# |- Nt32Pkg.dec : This file
-# |- Nt32Pkg.dsc : Nt32 platform DSC file
-# |- Nt32Pkg.fdf : Flash description file for Nt32Pkg. It is used for creating FD file.
-# |- Include : Include files for Nt32Pkg
-#
-#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-
-[Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = Nt32Pkg
- PACKAGE_GUID = 0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3
- PACKAGE_VERSION = 0.4
-
-[Includes]
- Include
-
-[LibraryClasses]
- ##
- # Expose EFI_WIN_NT_THUNK_PROTOCOL's interface, this protocol wrapper all
- # necessary Window API used by Nt32 enumlation environment.
- WinNtLib|Include/Library/WinNtLib.h
-
-[Guids]
- gEfiWinNtPassThroughGuid = { 0xCC664EB8, 0x3C24, 0x4086, { 0xB6, 0xF6, 0x34, 0xE8, 0x56, 0xBC, 0xE3, 0x6E }}
- gEfiWinNtConsoleGuid = { 0xBA73672C, 0xA5D3, 0x11D4, { 0xBD, 0x00, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
- gEfiWinNtUgaGuid = { 0xAB248E99, 0xABE1, 0x11D4, { 0xBD, 0x0D, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
- gEfiWinNtGopGuid = { 0x4e11e955, 0xccca, 0x11d4, { 0xbd, 0x0d, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81 }}
- gEfiWinNtSerialPortGuid = { 0x0C95A93D, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
- gEfiWinNtFileSystemGuid = { 0x0C95A935, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
- gEfiWinNtPhysicalDisksGuid = { 0x0C95A92F, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
- gEfiWinNtVirtualDisksGuid = { 0x0C95A928, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
- gEfiNt32PkgTokenSpaceGuid = { 0x0D79A645, 0x1D91, 0x40a6, { 0xA8, 0x1F, 0x61, 0xE6, 0x98, 0x2B, 0x32, 0xB4 }}
- gEfiWinNtSystemConfigGuid = { 0xb347f047, 0xaf8c, 0x490e, { 0xac, 0x07, 0x0a, 0xa9, 0xb7, 0xe5, 0x38, 0x58 }}
-
-[Ppis]
- ## This PPI wrapper all necessary windows API used by PEI driver in NT32 environment.
- gPeiNtThunkPpiGuid = { 0x98c281e5, 0xf906, 0x43dd, { 0xa9, 0x2b, 0xb0, 0x03, 0xbf, 0x27, 0x65, 0xda }}
- ## This PPI provide system memory scan interface which simulate real platform perform
- # memory's auto scan.
- gPeiNtAutoScanPpiGuid = { 0x0dce384d, 0x007c, 0x4ba5, { 0x94, 0xbd, 0x0f, 0x6e, 0xb6, 0x4d, 0x2a, 0xa9 }}
- ## This PPI provide interace to loads and relocates a PE/COFF image into memory.
- gNtPeiLoadFilePpiGuid = { 0xfd0c65eb, 0x0405, 0x4cd2, { 0x8a, 0xee, 0xf4, 0x0, 0xef, 0x13, 0xba, 0xc2 }}
- ## This PPI instance hold information for an simulated firmware device.
- gNtFwhPpiGuid = { 0x4e76928f, 0x50ad, 0x4334, {0xb0, 0x6b, 0xa8, 0x42, 0x13, 0x10, 0x8a, 0x57 }}
-
-[Protocols]
- gWinNtBusDriverGuid = { 0x0419f582, 0x0625, 0x4531, { 0x8a, 0x33, 0x85, 0xa9, 0x96, 0x5c, 0x95, 0xbc }}
- gEfiWinNtThunkProtocolGuid = { 0x58C518B1, 0x76F3, 0x11D4, { 0xBC, 0xEA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
- gEfiWinNtIoProtocolGuid = { 0x96EB4AD6, 0xA32A, 0x11D4, { 0xBC, 0xFD, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
-
-[PcdsFixedAtBuild]
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogBase|0x0|UINT32|0x0000100e
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogSize|0x0|UINT32|0x0000100f
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoveryBase|0x0|UINT32|0x00001010
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize|0x0|UINT32|0x00001011
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize|0x0|UINT32|0x00001012
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareBlockSize|0|UINT32|0x00001013
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageVariableBase|0x0|UINT32|0x00001014
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwSpareBase|0x0|UINT32|0x00001015
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwWorkingBase|0x0|UINT32|0x00001016
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFdBaseAddress|0x0|UINT32|0x00001017
-
-[PcdsFixedAtBuild, PcdsPatchableInModule]
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtBootMode|1|UINT32|0x00001006
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareVolume|L"..\\Fv\\Fv_Recovery.fd"|VOID*|0x00001009
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySizeForSecMain|L"64!64"|VOID*|0x0000100c
-
-[PcdsDynamic, PcdsDynamicEx]
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtPhysicalDisk|L"E:RW;245760;512"|VOID*|0x00001000
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk|L"FW;40960;512"|VOID*|0x00001001
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtSerialPort|L"COM1!COM2"|VOID*|0x00001002
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtUga|L"UGA Window 1!UGA Window 2"|VOID*|0x00001003
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|0x00001004
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize|L"64!64"|VOID*|0x00001005
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtConsole|L"Bus Driver Console Window"|VOID*|0x0000100a
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtGop|L"UGA Window 1!UGA Window 2"|VOID*|0x0000100d
-
diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
deleted file mode 100644
index 990d5ee0bf..0000000000
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ /dev/null
@@ -1,483 +0,0 @@
-## @file
-# EFI/Framework Emulation Platform with UEFI HII interface supported.
-#
-# The Emulation Platform can be used to debug individual modules, prior to creating
-# a real platform. This also provides an example for how an DSC is created.
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-################################################################################
-#
-# Defines Section - statements that will be processed to create a Makefile.
-#
-################################################################################
-[Defines]
- PLATFORM_NAME = NT32
- PLATFORM_GUID = EB216561-961F-47EE-9EF9-CA426EF547C2
- PLATFORM_VERSION = 0.4
- DSC_SPECIFICATION = 0x00010005
- OUTPUT_DIRECTORY = Build/NT32$(ARCH)
- SUPPORTED_ARCHITECTURES = IA32|X64
- BUILD_TARGETS = DEBUG|RELEASE|NOOPT
- SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Nt32Pkg/Nt32Pkg.fdf
- #
- # This flag is to control tool to generate PCD info for dynamic(ex) PCD,
- # then enable or disable PCD info feature. TRUE is enable, and FLASE is disable.
- # If the flag is absent, it will be same as FALSE.
- #
- PCD_INFO_GENERATION = TRUE
-
- #
- # Defines for default states. These can be changed on the command line.
- # -D FLAG=VALUE
- #
- # Note: Secure Boot feature highly depends on the OpenSSL building. To enable this
- # feature, please follow the instructions found in the file "Patch-HOWTO.txt"
- # located in CryptoPkg\Library\OpensslLib to enable the OpenSSL building first.
- #
- DEFINE SECURE_BOOT_ENABLE = FALSE
-
- #
- # Network definition
- # SnpNt32Dxe.inf will be used.
- #
- DEFINE NETWORK_TLS_ENABLE = FALSE
- DEFINE NETWORK_IP6_ENABLE = FALSE
- DEFINE NETWORK_SNP_ENABLE = FALSE
- DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
-
-################################################################################
-#
-# SKU Identification section - list of all SKU IDs supported by this
-# Platform.
-#
-################################################################################
-[SkuIds]
- 0|DEFAULT # The entry: 0|DEFAULT is reserved and always required.
-
-################################################################################
-#
-# Library Class section - list of all Library Classes needed by this Platform.
-#
-################################################################################
-[LibraryClasses]
- #
- # Entry point
- #
- PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
- PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
- DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
- #
- # Basic
- #
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
- PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
- PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
- PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
- CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
- PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
- #
- # UEFI & PI
- #
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
- HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiTianoCustomDecompressLib.inf
- PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
- UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
- FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
-
- #
- # Generic Modules
- #
- UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
- UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
- OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
- GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
- CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
- SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
- TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
- SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
- CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
- BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
- #
- # Platform
- #
- PlatformBootManagerLib|Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
- #
- # Misc
- #
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
- DebugPrintErrorLevelLib|MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.inf
- PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
- DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
- CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
- LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
- ResetSystemLib|Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf
-!if $(NETWORK_TLS_ENABLE) == TRUE
- OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
-!else
- OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
-!endif
-
-!if $(SECURE_BOOT_ENABLE) == TRUE
- PlatformSecureLib|Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf
- TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
- AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
-!else
- TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
- AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
-!endif
- VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
-
-[LibraryClasses.common.USER_DEFINED]
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
- ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
- OemHookStatusCodeLib|Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-
-[LibraryClasses.common.PEIM,LibraryClasses.common.PEI_CORE]
- #
- # PEI phase common
- #
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
- ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf
- IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
- PeCoffGetEntryPointLib|Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf
- PeCoffExtraActionLib|Nt32Pkg/Library/PeiNt32PeCoffExtraActionLib/PeiNt32PeCoffExtraActionLib.inf
- DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
-
-[LibraryClasses.common.PEI_CORE]
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
-
-[LibraryClasses.common.PEIM]
- PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
- OemHookStatusCodeLib|Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/PeiNt32OemHookStatusCodeLib.inf
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
-
-[LibraryClasses.common]
- #
- # DXE phase common
- #
- BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
- OemHookStatusCodeLib|Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf
- PeCoffExtraActionLib|Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.inf
- ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
- WinNtLib|Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
- TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
-
-[LibraryClasses.common.DXE_CORE]
- HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
- MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-
-[LibraryClasses.common.DXE_SMM_DRIVER]
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-
-[LibraryClasses.common.UEFI_DRIVER]
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-
-[LibraryClasses.common.UEFI_APPLICATION]
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
- PrintLib|MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf
-
-[LibraryClasses.common.DXE_RUNTIME_DRIVER]
- #
- # Runtime
- #
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
-
-################################################################################
-#
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform
-#
-################################################################################
-[PcdsFeatureFlag]
- gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE
- gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
- gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplBuildPageTables|FALSE
- gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE
- gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics|TRUE
-
-[PcdsFixedAtBuild]
- gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000000
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0x0
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x0
- gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000040
- gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x1f
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareVolume|L"..\\Fv\\Nt32.fd"
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareBlockSize|0x10000
- gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0f
- gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
-
-!if $(SECURE_BOOT_ENABLE) == TRUE
- # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot
- gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04
- gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04
- gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04
-!endif
-
- gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
-
-
-################################################################################
-#
-# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
-#
-################################################################################
-[PcdsDynamicDefault.common.DEFAULT]
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtSerialPort|L"COM1!COM2"|VOID*|20
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtGop|L"UGA Window 1!UGA Window 2"|VOID*|52
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtConsole|L"Bus Driver Console Window"|VOID*|52
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk|L"FW;40960;512"|VOID*|26
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize|L"64!64"|VOID*|12
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtPhysicalDisk|L"a:RW;2880;512!d:RO;307200;2048!j:RW;262144;512"|VOID*|100
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtUga|L"UGA Window 1!UGA Window 2"|VOID*|52
-
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
-
-[PcdsDynamicDefault.Ia32]
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|106
-
-[PcdsDynamicDefault.x64]
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|106
-
-[PcdsDynamicHii.common.DEFAULT]
- gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn|L"SetupConsoleConfig"|gEfiNt32PkgTokenSpaceGuid|0x0|80
- gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow|L"SetupConsoleConfig"|gEfiNt32PkgTokenSpaceGuid|0x4|25
- gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|10
- gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|L"HwErrRecSupport"|gEfiGlobalVariableGuid|0x0|1
-
-###################################################################################################
-#
-# Components Section - list of the modules and components that will be processed by compilation
-# tools and the EDK II tools to generate PE32/PE32+/Coff image files.
-#
-# Note: The EDK II DSC file is not used to specify how compiled binary images get placed
-# into firmware volume images. This section is just a list of modules to compile from
-# source into UEFI-compliant binaries.
-# It is the FDF file that contains information on combining binary files into firmware
-# volume images, whose concept is beyond UEFI and is described in PI specification.
-# Binary modules do not need to be listed in this section, as they should be
-# specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),
-# Logo (Logo.bmp), and etc.
-# There may also be modules listed in this section that are not required in the FDF file,
-# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be
-# generated for it, but the binary will not be put into any firmware volume.
-#
-###################################################################################################
-[Components]
- ##
- # SEC Phase modules
- ##
- Nt32Pkg/Sec/SecMain.inf
-
- ##
- # PEI Phase modules
- ##
- MdeModulePkg/Core/Pei/PeiMain.inf
- MdeModulePkg/Universal/PCD/Pei/Pcd.inf {
-
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- }
- MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf
- MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf
- Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf
- Nt32Pkg/BootModePei/BootModePei.inf
- Nt32Pkg/StallPei/StallPei.inf
- Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf
-
- MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
- MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
-
- Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf
- Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf
- Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf
- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
- ##
- # DXE Phase modules
- ##
- MdeModulePkg/Core/Dxe/DxeMain.inf {
-
- NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-
- *_*_*_CC_FLAGS =
- }
-
- MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {
-
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- }
- Nt32Pkg/MetronomeDxe/MetronomeDxe.inf
- Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
- MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
- MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
- Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
- MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
-
-!if $(SECURE_BOOT_ENABLE) == TRUE
- NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf
-!endif
- }
- MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
- MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
- Nt32Pkg/WinNtThunkDxe/WinNtThunkDxe.inf
- Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf
- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
- Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
- Nt32Pkg/TimerDxe/TimerDxe.inf
- MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
- MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
- Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf
- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
-
- NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
- }
-!if $(SECURE_BOOT_ENABLE) == TRUE
- SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
-!endif
- MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
- MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
- MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
- MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
- MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf {
-
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
- }
- MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf {
-
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
- }
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
-
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
- }
- MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf {
-
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- }
- MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
- MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
- MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
- FatPkg/EnhancedFatDxe/Fat.inf
- MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
- MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf ##This driver follows UEFI specification definition
- MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf ##This driver follows UEFI specification definition
- IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf
- Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf {
-
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
- }
- Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf
- Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf
- Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf
- Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf
- MdeModulePkg/Application/HelloWorld/HelloWorld.inf
-
- #
- # Network SNP drivers
- # To test network drivers, need network Io driver(SnpNt32Io.dll), please refer to NETWORK-IO Subproject.
- #
-!include NetworkPkg/Network.dsc.inc
- Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
- MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
- MdeModulePkg/Application/UiApp/UiApp.inf{
-
- NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
- NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf
- NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
- }
- MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
- MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
- MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
- MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
- MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf {
-
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- }
- MdeModulePkg/Application/VariableInfo/VariableInfo.inf
-
- MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
- MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf
- MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf {
-
- NULL|IntelFrameworkModulePkg/Library/LegacyBootManagerLib/LegacyBootManagerLib.inf
- }
- MdeModulePkg/Logo/LogoDxe.inf
- ShellPkg/Application/Shell/Shell.inf {
-
- gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
-
- NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
- NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
- ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
- ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
- HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
- BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
- FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
- }
-
-###################################################################################################
-#
-# BuildOptions Section - Define the module specific tool chain flags that should be used as
-# the default flags for a module. These flags are appended to any
-# standard flags that are defined by the build process. They can be
-# applied for any modules or only those modules with the specific
-# module style (EDK or EDKII) specified in [Components] section.
-#
-###################################################################################################
-[BuildOptions]
- DEBUG_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000 /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE
- NOOPT_*_*_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /BASE:0x10000 /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CONSOLE
- RELEASE_*_*_DLINK_FLAGS = /ALIGN:4096 /FILEALIGN:4096
-
diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf
deleted file mode 100644
index 7798d17923..0000000000
--- a/Nt32Pkg/Nt32Pkg.fdf
+++ /dev/null
@@ -1,395 +0,0 @@
-## @file
-# This is NT32 FDF file with UEFI HII features enabled
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-
-################################################################################
-#
-# FD Section
-# The [FD] Section is made up of the definition statements and a
-# description of what goes into the Flash Device Image. Each FD section
-# defines one flash "device" image. A flash device image may be one of
-# the following: Removable media bootable image (like a boot floppy
-# image,) an Option ROM image (that would be "flashed" into an add-in
-# card,) a System "Flash" image (that would be burned into a system's
-# flash) or an Update ("Capsule") image that will be used to update and
-# existing system flash.
-#
-################################################################################
-[FD.Nt32]
-BaseAddress = 0x0|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFdBaseAddress #The base address of the FLASH Device.
-Size = 0x00480000|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize #The size in bytes of the FLASH Device
-ErasePolarity = 1
-BlockSize = 0x10000
-NumBlocks = 0x48
-
-################################################################################
-#
-# Following are lists of FD Region layout which correspond to the locations of different
-# images within the flash device.
-#
-# Regions must be defined in ascending order and may not overlap.
-#
-# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
-# the pipe "|" character, followed by the size of the region, also in hex with the leading
-# "0x" characters. Like:
-# Offset|Size
-# PcdOffsetCName|PcdSizeCName
-# RegionType
-#
-################################################################################
-0x00000000|0x00460000
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoveryBase|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize
-FV = FvRecovery
-
-0x00460000|0x0000c000
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
-#NV_VARIABLE_STORE
-DATA = {
- ## This is the EFI_FIRMWARE_VOLUME_HEADER
- # ZeroVector []
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- # FileSystemGuid: gEfiSystemNvDataFvGuid =
- # { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}
- 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,
- 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,
- # FvLength: 0x20000
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
- #Signature "_FVH" #Attributes
- 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00,
- #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision
- 0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02,
- #Blockmap[0]: 2 Blocks * 0x10000 Bytes / Block
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
- #Blockmap[1]: End
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- ## This is the VARIABLE_STORE_HEADER
-!if $(SECURE_BOOT_ENABLE) == TRUE
- #Signature: gEfiAuthenticatedVariableGuid =
- # { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}
- 0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43,
- 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92,
-!else
- #Signature: gEfiVariableGuid =
- # { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
- 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,
- 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,
-!endif
- #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xBFB8
- # This can speed up the Variable Dispatch a bit.
- 0xB8, 0xBF, 0x00, 0x00,
- #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32
- 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-}
-
-0x0046c000|0x00002000
-#NV_EVENT_LOG
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogBase|gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageEventLogSize
-
-0x0046e000|0x00002000
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
-#NV_FTW_WORKING
-DATA = {
- # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid =
- # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95 }}
- 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49,
- 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95,
- # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved
- 0xE2, 0x33, 0xF2, 0x03, 0xFE, 0xFF, 0xFF, 0xFF,
- # WriteQueueSize: UINT64
- 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-}
-
-0x00470000|0x00010000
-#NV_FTW_SPARE
-gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
-
-################################################################################
-#
-# FV Section
-#
-# [FV] section is used to define what components or modules are placed within a flash
-# device file. This section also defines order the components and modules are positioned
-# within the image. The [FV] section consists of define statements, set statements and
-# module statements.
-#
-################################################################################
-[FV.FvRecovery]
-FvAlignment = 16 #FV alignment and FV attributes setting.
-ERASE_POLARITY = 1
-MEMORY_MAPPED = TRUE
-STICKY_WRITE = TRUE
-LOCK_CAP = TRUE
-LOCK_STATUS = TRUE
-WRITE_DISABLED_CAP = TRUE
-WRITE_ENABLED_CAP = TRUE
-WRITE_STATUS = TRUE
-WRITE_LOCK_CAP = TRUE
-WRITE_LOCK_STATUS = TRUE
-READ_DISABLED_CAP = TRUE
-READ_ENABLED_CAP = TRUE
-READ_STATUS = TRUE
-READ_LOCK_CAP = TRUE
-READ_LOCK_STATUS = TRUE
-FvNameGuid = 6D99E806-3D38-42c2-A095-5F4300BFD7DC
-
-################################################################################
-#
-# The INF statements point to EDK component and EDK II module INF files, which will be placed into this FV image.
-# Parsing tools will scan the INF file to determine the type of component or module.
-# The component or module type is used to reference the standard rules
-# defined elsewhere in the FDF file.
-#
-# The format for INF statements is:
-# INF $(PathAndInfFileName)
-#
-################################################################################
- ##
- # PEI Phase modules
- ##
- ##
- # PEI Apriori file example, more PEIM module added later.
- ##
-APRIORI PEI {
- INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
- INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf
- INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf
- INF Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf
- }
-APRIORI DXE {
- INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
- INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
- INF Nt32Pkg/MetronomeDxe/MetronomeDxe.inf
- INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
- INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
- INF Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf
- }
-
-INF MdeModulePkg/Core/Pei/PeiMain.inf
-INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
-INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf
-INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf
-INF Nt32Pkg/WinNtOemHookStatusCodeHandlerPei/WinNtOemHookStatusCodeHandlerPei.inf
-INF Nt32Pkg/BootModePei/BootModePei.inf
-INF Nt32Pkg/StallPei/StallPei.inf
-INF Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf
-INF Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf
-INF Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf
-
-INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
-INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
-
-INF Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocolPei.inf
-INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
-
- ##
- # DXE Phase modules
- ##
-INF MdeModulePkg/Core/Dxe/DxeMain.inf
-INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
-INF Nt32Pkg/MetronomeDxe/MetronomeDxe.inf
-INF Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
-INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
-INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
-INF Nt32Pkg/FvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
-INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
-INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
-INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
-INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
-INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
-INF Nt32Pkg/WinNtThunkDxe/WinNtThunkDxe.inf
-INF Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf
-INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
-INF MdeModulePkg/Application/UiApp/UiApp.inf
-INF MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
-INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
-INF Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
-INF Nt32Pkg/TimerDxe/TimerDxe.inf
-INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
-INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
-INF Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.inf
-INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
-!if $(SECURE_BOOT_ENABLE) == TRUE
-INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
-!endif
-INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
-INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
-INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
-INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
-INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
-INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
-INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
-INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
-INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
-INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
-INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
-INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
-INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
-INF RuleOverride = TIANOCOMPRESSED MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
-INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
-INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
-INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
-INF IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf
-INF Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriverDxe.inf
-INF Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIoDxe.inf
-INF Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf
-INF Nt32Pkg/WinNtGopDxe/WinNtGopDxe.inf
-INF Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystemDxe.inf
-INF MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
-INF MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf
-
-INF Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
-!include NetworkPkg/Network.fdf.inc
-
-INF MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
-################################################################################
-#
-# FILE statements are provided so that a platform integrator can include
-# complete EFI FFS files, as well as a method for constructing FFS files
-# using curly "{}" brace scoping. The following three FILEs are
-# for binary shell, binary fat and logo module.
-#
-################################################################################
-INF ShellPkg/Application/Shell/Shell.inf
-
-INF FatPkg/EnhancedFatDxe/Fat.inf
-INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
-
-INF MdeModulePkg/Logo/LogoDxe.inf
-INF MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf
-################################################################################
-#
-# Rules are use with the [FV] section's module INF type to define
-# how an FFS file is created for a given INF file. The following Rule are the default
-# rules for the different module type. User can add the customized rules to define the
-# content of the FFS file.
-#
-################################################################################
-
-
-############################################################################
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #
-############################################################################
-#
-#[Rule.Common.DXE_DRIVER]
-# FILE DRIVER = $(NAMED_GUID) {
-# DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
-# COMPRESS PI_STD {
-# GUIDED {
-# PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
-# UI STRING="$(MODULE_NAME)" Optional
-# VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
-# }
-# }
-# }
-#
-############################################################################
-
-[Rule.Common.PEI_CORE]
- FILE PEI_CORE = $(NAMED_GUID) {
- PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING ="$(MODULE_NAME)" Optional
- VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
-
-[Rule.Common.PEIM]
- FILE PEIM = $(NAMED_GUID) {
- PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
- PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
-
-[Rule.Common.DXE_CORE]
- FILE DXE_CORE = $(NAMED_GUID) {
- COMPRESS PI_STD {
- PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
-
-[Rule.Common.UEFI_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
- COMPRESS PI_STD {
- GUIDED {
- PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
- }
-
-[Rule.Common.UEFI_DRIVER.TIANOCOMPRESSED]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
- GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {
- PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
-
-[Rule.Common.DXE_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
- COMPRESS PI_STD {
- GUIDED {
- PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
- }
-
-[Rule.Common.DXE_RUNTIME_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
- COMPRESS PI_STD {
- GUIDED {
- PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
- }
-
-[Rule.Common.UEFI_APPLICATION]
- FILE APPLICATION = $(NAMED_GUID) {
- COMPRESS PI_STD {
- GUIDED {
- PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
- }
-
-[Rule.Common.UEFI_APPLICATION.BINARY]
- FILE APPLICATION = $(NAMED_GUID) {
- COMPRESS PI_STD {
- GUIDED {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
- }
-
-[Rule.Common.UEFI_DRIVER.BINARY]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- COMPRESS PI_STD {
- GUIDED {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
- }
- }
diff --git a/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c
deleted file mode 100644
index 8a623019da..0000000000
--- a/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClock.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- RealTimeClock.c
-
-Abstract:
-
- NT Emulation Architectural Protocol Driver as defined in Tiano
-
-**/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-BOOLEAN
-DayValid (
- IN EFI_TIME *Time
- );
-
-BOOLEAN
-IsLeapYear (
- IN EFI_TIME *Time
- );
-
-EFI_STATUS
-RtcTimeFieldsValid (
- IN EFI_TIME *Time
- );
-
-EFI_STATUS
-EFIAPI
-InitializeRealTimeClock (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-EFI_STATUS
-EFIAPI
-WinNtGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL
- )
-/*++
-
-Routine Description:
- Service routine for RealTimeClockInstance->GetTime
-
-Arguments:
-
- Time - A pointer to storage that will receive a snapshot of the current time.
-
- Capabilities - A pointer to storage that will receive the capabilities of the real time clock
- in the platform. This includes the real time clock's resolution and accuracy.
- All reported device capabilities are rounded up. This is an OPTIONAL argument.
-
-Returns:
-
- EFI_SUCEESS - The underlying GetSystemTime call occurred and returned
- Note that in the NT32 emulation, the GetSystemTime call has no return value
- thus you will always receive a EFI_SUCCESS on this.
-
---*/
-// TODO: EFI_INVALID_PARAMETER - add return value to function comment
-{
- SYSTEMTIME SystemTime;
- TIME_ZONE_INFORMATION TimeZone;
-
- //
- // Check parameter for null pointer
- //
- if (Time == NULL) {
- return EFI_INVALID_PARAMETER;
-
- }
-
- gWinNt->GetLocalTime (&SystemTime);
- gWinNt->GetTimeZoneInformation (&TimeZone);
-
- Time->Year = (UINT16) SystemTime.wYear;
- Time->Month = (UINT8) SystemTime.wMonth;
- Time->Day = (UINT8) SystemTime.wDay;
- Time->Hour = (UINT8) SystemTime.wHour;
- Time->Minute = (UINT8) SystemTime.wMinute;
- Time->Second = (UINT8) SystemTime.wSecond;
- Time->Nanosecond = (UINT32) (SystemTime.wMilliseconds * 1000000);
- Time->TimeZone = (INT16) TimeZone.Bias;
-
- if (Capabilities != NULL) {
- Capabilities->Resolution = 1;
- Capabilities->Accuracy = 50000000;
- Capabilities->SetsToZero = FALSE;
- }
-
- Time->Daylight = 0;
- if (TimeZone.StandardDate.wMonth) {
- Time->Daylight = (UINT8) TimeZone.StandardDate.wMonth;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-WinNtSetTime (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
- Service routine for RealTimeClockInstance->SetTime
-
-Arguments:
-
- Time - A pointer to storage containing the time and date information to
- program into the real time clock.
-
-Returns:
-
- EFI_SUCEESS - The operation completed successfully.
-
- EFI_INVALID_PARAMETER - One of the fields in Time is out of range.
-
- EFI_DEVICE_ERROR - The operation could not be complete due to a device error.
-
---*/
-// TODO: EFI_SUCCESS - add return value to function comment
-{
- TIME_ZONE_INFORMATION TimeZone;
- EFI_STATUS Status;
- SYSTEMTIME SystemTime;
- BOOL Flag;
-
- if (Time == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // Make sure that the time fields are valid
- //
- Status = RtcTimeFieldsValid (Time);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // Set Daylight savings time information and Time Zone
- //
- gWinNt->GetTimeZoneInformation (&TimeZone);
- TimeZone.StandardDate.wMonth = Time->Daylight;
- TimeZone.Bias = Time->TimeZone;
- Flag = gWinNt->SetTimeZoneInformation (&TimeZone);
- if (!Flag) {
- return EFI_DEVICE_ERROR;
- }
-
- SystemTime.wYear = Time->Year;
- SystemTime.wMonth = Time->Month;
- SystemTime.wDay = Time->Day;
- SystemTime.wHour = Time->Hour;
- SystemTime.wMinute = Time->Minute;
- SystemTime.wSecond = Time->Second;
- SystemTime.wMilliseconds = (INT16) (Time->Nanosecond / 1000000);
-
- Flag = gWinNt->SetLocalTime (&SystemTime);
-
- if (!Flag) {
- return EFI_DEVICE_ERROR;
- } else {
- return EFI_SUCCESS;
- }
-}
-
-EFI_STATUS
-EFIAPI
-WinNtGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
- Service routine for RealTimeClockInstance->GetWakeupTime
-
-Arguments:
- This - Indicates the protocol instance structure.
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
-
- Pending - Indicates if the alarm signal is pending and requires
- acknowledgement.
-
- Time - The current alarm setting.
-
-Returns:
-
- EFI_SUCEESS - The operation completed successfully.
-
- EFI_DEVICE_ERROR - The operation could not be complete due to a device error.
-
- EFI_UNSUPPORTED - The operation is not supported on this platform.
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EFIAPI
-WinNtSetWakeupTime (
- IN BOOLEAN Enable,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
- Service routine for RealTimeClockInstance->SetWakeupTime
-
-Arguments:
-
- Enabled - Enable or disable the wakeup alarm.
-
- Time - If enable is TRUE, the time to set the wakup alarm for.
- If enable is FALSE, then this parameter is optional, and
- may be NULL.
-
-Returns:
-
- EFI_SUCEESS - The operation completed successfully.
-
- EFI_DEVICE_ERROR - The operation could not be complete due to a device error.
-
- EFI_INVALID_PARAMETER - A field in Time is out of range.
-
- EFI_UNSUPPORTED - The operation is not supported on this platform.
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EFIAPI
-InitializeRealTimeClock (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
- Install Real Time Clock Protocol
-
-Arguments:
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
-
-Returns:
-
- EFI_SUCEESS - Real Time Clock Services are installed into the Runtime Services Table
-
---*/
-// TODO: ImageHandle - add argument and description to function comment
-// TODO: SystemTable - add argument and description to function comment
-{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
-
- SystemTable->RuntimeServices->GetTime = WinNtGetTime;
- SystemTable->RuntimeServices->SetTime = WinNtSetTime;
- SystemTable->RuntimeServices->GetWakeupTime = WinNtGetWakeupTime;
- SystemTable->RuntimeServices->SetWakeupTime = WinNtSetWakeupTime;
-
- Handle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Handle,
- &gEfiRealTimeClockArchProtocolGuid,
- NULL,
- NULL
- );
- return Status;
-}
-
-EFI_STATUS
-RtcTimeFieldsValid (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Arguments:
-
- Returns:
---*/
-// TODO: Time - add argument and description to function comment
-// TODO: EFI_INVALID_PARAMETER - add return value to function comment
-// TODO: EFI_SUCCESS - add return value to function comment
-{
- if (Time->Year < 1998 ||
- Time->Year > 2099 ||
- Time->Month < 1 ||
- Time->Month > 12 ||
- (!DayValid (Time)) ||
- Time->Hour > 23 ||
- Time->Minute > 59 ||
- Time->Second > 59 ||
- Time->Nanosecond > 999999999 ||
- (!(Time->TimeZone == EFI_UNSPECIFIED_TIMEZONE || (Time->TimeZone >= -1440 && Time->TimeZone <= 1440))) ||
- (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT)))
- ) {
- return EFI_INVALID_PARAMETER;
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-DayValid (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Time - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
-
- INTN DayOfMonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
- if (Time->Day < 1 ||
- Time->Day > DayOfMonth[Time->Month - 1] ||
- (Time->Month == 2 && (!IsLeapYear (Time) && Time->Day > 28))
- ) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-BOOLEAN
-IsLeapYear (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Time - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- if (Time->Year % 4 == 0) {
- if (Time->Year % 100 == 0) {
- if (Time->Year % 400 == 0) {
- return TRUE;
- } else {
- return FALSE;
- }
- } else {
- return TRUE;
- }
- } else {
- return FALSE;
- }
-}
diff --git a/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf b/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
deleted file mode 100644
index 2cd9bf85fa..0000000000
--- a/Nt32Pkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
+++ /dev/null
@@ -1,45 +0,0 @@
-## @file
-# NT Emulation Real time clock Architectural Protocol Driver as defined in TIANO
-#
-# This real time clock module simulates virtual device by time WinAPI.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = RealTimeClock
- FILE_GUID = 27F05AF5-1644-4EF4-8944-48C4F75675A0
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = InitializeRealTimeClock
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- RealTimeClock.c
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- WinNtLib
- UefiDriverEntryPoint
- DebugLib
-
-[Protocols]
- gEfiRealTimeClockArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
-
-[depex]
- TRUE
-
diff --git a/Nt32Pkg/Sec/FwVol.c b/Nt32Pkg/Sec/FwVol.c
deleted file mode 100644
index c7c647e0e5..0000000000
--- a/Nt32Pkg/Sec/FwVol.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
- FwVol.c
-
-Abstract:
- A simple FV stack so the SEC can extract the SEC Core from an
- FV.
-
-**/
-
-#include "SecMain.h"
-
-#define GET_OCCUPIED_SIZE(ActualSize, Alignment) \
- (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1))
-
-EFI_FFS_FILE_STATE
-GetFileState (
- IN UINT8 ErasePolarity,
- IN EFI_FFS_FILE_HEADER *FfsHeader
- )
-/*++
-
-Routine Description:
- Returns the highest bit set of the State field
-
-Arguments:
- ErasePolarity - Erase Polarity as defined by EFI_FVB_ERASE_POLARITY
- in the Attributes field.
- FfsHeader - Pointer to FFS File Header.
-
-Returns:
- Returns the highest bit in the State field
-
---*/
-{
- EFI_FFS_FILE_STATE FileState;
- EFI_FFS_FILE_STATE HighestBit;
-
- FileState = FfsHeader->State;
-
- if (ErasePolarity != 0) {
- FileState = (EFI_FFS_FILE_STATE)~FileState;
- }
-
- HighestBit = 0x80;
- while (HighestBit != 0 && (HighestBit & FileState) == 0) {
- HighestBit >>= 1;
- }
-
- return HighestBit;
-}
-
-UINT8
-CalculateHeaderChecksum (
- IN EFI_FFS_FILE_HEADER *FileHeader
- )
-/*++
-
-Routine Description:
- Calculates the checksum of the header of a file.
-
-Arguments:
- FileHeader - Pointer to FFS File Header.
-
-Returns:
- Checksum of the header.
-
---*/
-{
- UINT8 *ptr;
- UINTN Index;
- UINT8 Sum;
-
- Sum = 0;
- ptr = (UINT8 *) FileHeader;
-
- for (Index = 0; Index < sizeof (EFI_FFS_FILE_HEADER) - 3; Index += 4) {
- Sum = (UINT8) (Sum + ptr[Index]);
- Sum = (UINT8) (Sum + ptr[Index + 1]);
- Sum = (UINT8) (Sum + ptr[Index + 2]);
- Sum = (UINT8) (Sum + ptr[Index + 3]);
- }
-
- for (; Index < sizeof (EFI_FFS_FILE_HEADER); Index++) {
- Sum = (UINT8) (Sum + ptr[Index]);
- }
- //
- // State field (since this indicates the different state of file).
- //
- Sum = (UINT8) (Sum - FileHeader->State);
- //
- // Checksum field of the file is not part of the header checksum.
- //
- Sum = (UINT8) (Sum - FileHeader->IntegrityCheck.Checksum.File);
-
- return Sum;
-}
-
-EFI_STATUS
-SecFfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
- IN OUT EFI_FFS_FILE_HEADER **FileHeader
- )
-/*++
-
-Routine Description:
- Given the input file pointer, search for the next matching file in the
- FFS volume as defined by SearchType. The search starts from FileHeader inside
- the Firmware Volume defined by FwVolHeader.
-
-Arguments:
- SearchType - Filter to find only files of this type.
- Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
- FwVolHeader - Pointer to the FV header of the volume to search.
- This parameter must point to a valid FFS volume.
- FileHeader - Pointer to the current file from which to begin searching.
- This pointer will be updated upon return to reflect the file
- found.
-
-Returns:
- EFI_NOT_FOUND - No files matching the search criteria were found
- EFI_SUCCESS
-
---*/
-{
- EFI_FFS_FILE_HEADER *FfsFileHeader;
- UINT32 FileLength;
- UINT32 FileOccupiedSize;
- UINT32 FileOffset;
- UINT64 FvLength;
- UINT8 ErasePolarity;
- UINT8 FileState;
-
- FvLength = FwVolHeader->FvLength;
- if (FwVolHeader->Attributes & EFI_FVB2_ERASE_POLARITY) {
- ErasePolarity = 1;
- } else {
- ErasePolarity = 0;
- }
- //
- // If FileHeader is not specified (NULL) start with the first file in the
- // firmware volume. Otherwise, start from the FileHeader.
- //
- if (*FileHeader == NULL) {
- FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FwVolHeader + FwVolHeader->HeaderLength);
- } else {
- //
- // Length is 24 bits wide so mask upper 8 bits
- // FileLength is adjusted to FileOccupiedSize as it is 8 byte aligned.
- //
- FileLength = *(UINT32 *) (*FileHeader)->Size & 0x00FFFFFF;
- FileOccupiedSize = GET_OCCUPIED_SIZE (FileLength, 8);
- FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) *FileHeader + FileOccupiedSize);
- }
-
- FileOffset = (UINT32) ((UINT8 *) FfsFileHeader - (UINT8 *) FwVolHeader);
-
- while (FileOffset < (FvLength - sizeof (EFI_FFS_FILE_HEADER))) {
- //
- // Get FileState which is the highest bit of the State
- //
- FileState = GetFileState (ErasePolarity, FfsFileHeader);
-
- switch (FileState) {
-
- case EFI_FILE_HEADER_INVALID:
- FileOffset += sizeof (EFI_FFS_FILE_HEADER);
- FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER));
- break;
-
- case EFI_FILE_DATA_VALID:
- case EFI_FILE_MARKED_FOR_UPDATE:
- if (CalculateHeaderChecksum (FfsFileHeader) == 0) {
- FileLength = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;
- FileOccupiedSize = GET_OCCUPIED_SIZE (FileLength, 8);
-
- if ((SearchType == FfsFileHeader->Type) || (SearchType == EFI_FV_FILETYPE_ALL)) {
-
- *FileHeader = FfsFileHeader;
-
- return EFI_SUCCESS;
- }
-
- FileOffset += FileOccupiedSize;
- FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + FileOccupiedSize);
- } else {
- return EFI_NOT_FOUND;
- }
- break;
-
- case EFI_FILE_DELETED:
- FileLength = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;
- FileOccupiedSize = GET_OCCUPIED_SIZE (FileLength, 8);
- FileOffset += FileOccupiedSize;
- FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + FileOccupiedSize);
- break;
-
- default:
- return EFI_NOT_FOUND;
-
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-SecFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,
- IN OUT VOID **SectionData
- )
-/*++
-
-Routine Description:
- Given the input file pointer, search for the next matching section in the
- FFS volume.
-
-Arguments:
- SearchType - Filter to find only sections of this type.
- FfsFileHeader - Pointer to the current file to search.
- SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
- NULL if section not found
-
-Returns:
- EFI_NOT_FOUND - No files matching the search criteria were found
- EFI_SUCCESS
-
---*/
-{
- UINT32 FileSize;
- EFI_COMMON_SECTION_HEADER *Section;
- UINT32 SectionLength;
- UINT32 ParsedLength;
-
- //
- // Size is 24 bits wide so mask upper 8 bits.
- // Does not include FfsFileHeader header size
- // FileSize is adjusted to FileOccupiedSize as it is 8 byte aligned.
- //
- Section = (EFI_COMMON_SECTION_HEADER *) (FfsFileHeader + 1);
- FileSize = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;
- FileSize -= sizeof (EFI_FFS_FILE_HEADER);
-
- *SectionData = NULL;
- ParsedLength = 0;
- while (ParsedLength < FileSize) {
- if (Section->Type == SectionType) {
- *SectionData = (VOID *) (Section + 1);
- return EFI_SUCCESS;
- }
- //
- // Size is 24 bits wide so mask upper 8 bits.
- // SectionLength is adjusted it is 4 byte aligned.
- // Go to the next section
- //
- SectionLength = *(UINT32 *) Section->Size & 0x00FFFFFF;
- SectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);
-
- ParsedLength += SectionLength;
- Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + SectionLength);
- }
-
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-SecFfsFindPeiCore (
- IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
- OUT VOID **Pe32Data
- )
-/*++
-
-Routine Description:
- Given the pointer to the Firmware Volume Header find the SEC
- core and return it's PE32 image.
-
-Arguments:
- FwVolHeader - Pointer to memory mapped FV
- Pe32Data - Pointer to SEC PE32 iamge.
-
-Returns:
- EFI_SUCCESS - Pe32Data is valid
- other - Failure
-
---*/
-{
- EFI_STATUS Status;
- EFI_FFS_FILE_HEADER *FileHeader;
- EFI_FV_FILETYPE SearchType;
-
- SearchType = EFI_FV_FILETYPE_PEI_CORE;
- FileHeader = NULL;
- do {
- Status = SecFfsFindNextFile (SearchType, FwVolHeader, &FileHeader);
- if (!EFI_ERROR (Status)) {
- Status = SecFfsFindSectionData (EFI_SECTION_PE32, FileHeader, Pe32Data);
- return Status;
- }
- } while (!EFI_ERROR (Status));
-
- return Status;
-}
diff --git a/Nt32Pkg/Sec/SecMain.c b/Nt32Pkg/Sec/SecMain.c
deleted file mode 100644
index c3bfe47024..0000000000
--- a/Nt32Pkg/Sec/SecMain.c
+++ /dev/null
@@ -1,1130 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- SecMain.c
-
-Abstract:
- WinNt emulator of SEC phase. It's really a Win32 application, but this is
- Ok since all the other modules for NT32 are NOT Win32 applications.
-
- This program gets NT32 PCD setting and figures out what the memory layout
- will be, how may FD's will be loaded and also what the boot mode is.
-
- The SEC registers a set of services with the SEC core. gPrivateDispatchTable
- is a list of PPI's produced by the SEC that are available for usage in PEI.
-
- This code produces 128 K of temporary memory for the PEI stack by directly
- allocate memory space with ReadWrite and Execute attribute.
-
-**/
-
-#include "SecMain.h"
-
-#ifndef SE_TIME_ZONE_NAME
-#define SE_TIME_ZONE_NAME TEXT("SeTimeZonePrivilege")
-#endif
-
-NT_PEI_LOAD_FILE_PPI mSecNtLoadFilePpi = { SecWinNtPeiLoadFile };
-
-PEI_NT_AUTOSCAN_PPI mSecNtAutoScanPpi = { SecWinNtPeiAutoScan };
-
-PEI_NT_THUNK_PPI mSecWinNtThunkPpi = { SecWinNtWinNtThunkAddress };
-
-EFI_PEI_PROGRESS_CODE_PPI mSecStatusCodePpi = { SecPeiReportStatusCode };
-
-NT_FWH_PPI mSecFwhInformationPpi = { SecWinNtFdAddress };
-
-EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI mSecTemporaryRamSupportPpi = {SecTemporaryRamSupport};
-
-EFI_PEI_PPI_DESCRIPTOR gPrivateDispatchTable[] = {
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI,
- &gNtPeiLoadFilePpiGuid,
- &mSecNtLoadFilePpi
- },
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI,
- &gPeiNtAutoScanPpiGuid,
- &mSecNtAutoScanPpi
- },
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI,
- &gPeiNtThunkPpiGuid,
- &mSecWinNtThunkPpi
- },
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI,
- &gEfiPeiStatusCodePpiGuid,
- &mSecStatusCodePpi
- },
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI,
- &gEfiTemporaryRamSupportPpiGuid,
- &mSecTemporaryRamSupportPpi
- },
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
- &gNtFwhPpiGuid,
- &mSecFwhInformationPpi
- }
-};
-
-
-//
-// Default information about where the FD is located.
-// This array gets filled in with information from PcdWinNtFirmwareVolume
-// The number of array elements is allocated base on parsing
-// PcdWinNtFirmwareVolume and the memory is never freed.
-//
-UINTN gFdInfoCount = 0;
-NT_FD_INFO *gFdInfo;
-
-//
-// Array that supports seperate memory rantes.
-// The memory ranges are set by PcdWinNtMemorySizeForSecMain.
-// The number of array elements is allocated base on parsing
-// PcdWinNtMemorySizeForSecMain value and the memory is never freed.
-//
-UINTN gSystemMemoryCount = 0;
-NT_SYSTEM_MEMORY *gSystemMemory;
-
-VOID
-EFIAPI
-SecSwitchStack (
- UINT32 TemporaryMemoryBase,
- UINT32 PermenentMemoryBase
- );
-EFI_STATUS
-SecNt32PeCoffRelocateImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-VOID
-EFIAPI
-PeiSwitchStacks (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *Context3, OPTIONAL
- IN VOID *NewStack
- );
-
-VOID
-SecPrint (
- CHAR8 *Format,
- ...
- )
-{
- va_list Marker;
- UINTN CharCount;
- CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
-
- va_start (Marker, Format);
-
- _vsnprintf (Buffer, sizeof (Buffer), Format, Marker);
-
- va_end (Marker);
-
- CharCount = strlen (Buffer);
- WriteFile (
- GetStdHandle (STD_OUTPUT_HANDLE),
- Buffer,
- (DWORD)CharCount,
- (LPDWORD)&CharCount,
- NULL
- );
-}
-
-INTN
-EFIAPI
-main (
- IN INTN Argc,
- IN CHAR8 **Argv,
- IN CHAR8 **Envp
- )
-/*++
-
-Routine Description:
- Main entry point to SEC for WinNt. This is a Windows program
-
-Arguments:
- Argc - Number of command line arguments
- Argv - Array of command line argument strings
- Envp - Array of environment variable strings
-
-Returns:
- 0 - Normal exit
- 1 - Abnormal exit
-
---*/
-{
- EFI_STATUS Status;
- HANDLE Token;
- TOKEN_PRIVILEGES TokenPrivileges;
- EFI_PHYSICAL_ADDRESS InitialStackMemory;
- UINT64 InitialStackMemorySize;
- UINTN Index;
- UINTN Index1;
- UINTN Index2;
- CHAR16 *FileName;
- CHAR16 *FileNamePtr;
- BOOLEAN Done;
- VOID *PeiCoreFile;
- CHAR16 *MemorySizeStr;
- CHAR16 *FirmwareVolumesStr;
- UINTN *StackPointer;
- UINT32 ProcessAffinityMask;
- UINT32 SystemAffinityMask;
- INT32 LowBit;
-
-
- //
- // Enable the privilege so that RTC driver can successfully run SetTime()
- //
- OpenProcessToken (GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &Token);
- if (LookupPrivilegeValue(NULL, SE_TIME_ZONE_NAME, &TokenPrivileges.Privileges[0].Luid)) {
- TokenPrivileges.PrivilegeCount = 1;
- TokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
- AdjustTokenPrivileges(Token, FALSE, &TokenPrivileges, 0, (PTOKEN_PRIVILEGES) NULL, 0);
- }
-
- MemorySizeStr = (CHAR16 *) PcdGetPtr (PcdWinNtMemorySizeForSecMain);
- FirmwareVolumesStr = (CHAR16 *) PcdGetPtr (PcdWinNtFirmwareVolume);
-
- SecPrint ("\nEDK II SEC Main NT Emulation Environment from www.TianoCore.org\n");
-
- //
- // Determine the first thread available to this process.
- //
- if (GetProcessAffinityMask (GetCurrentProcess (), &ProcessAffinityMask, &SystemAffinityMask)) {
- LowBit = (INT32)LowBitSet32 (ProcessAffinityMask);
- if (LowBit != -1) {
- //
- // Force the system to bind the process to a single thread to work
- // around odd semaphore type crashes.
- //
- SetProcessAffinityMask (GetCurrentProcess (), (INTN)(BIT0 << LowBit));
- }
- }
-
- //
- // Make some Windows calls to Set the process to the highest priority in the
- // idle class. We need this to have good performance.
- //
- SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS);
- SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST);
-
- //
- // Allocate space for gSystemMemory Array
- //
- gSystemMemoryCount = CountSeparatorsInString (MemorySizeStr, '!') + 1;
- gSystemMemory = calloc (gSystemMemoryCount, sizeof (NT_SYSTEM_MEMORY));
- if (gSystemMemory == NULL) {
- SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n", MemorySizeStr);
- exit (1);
- }
- //
- // Allocate space for gSystemMemory Array
- //
- gFdInfoCount = CountSeparatorsInString (FirmwareVolumesStr, '!') + 1;
- gFdInfo = calloc (gFdInfoCount, sizeof (NT_FD_INFO));
- if (gFdInfo == NULL) {
- SecPrint ("ERROR : Can not allocate memory for %S. Exiting.\n", FirmwareVolumesStr);
- exit (1);
- }
- //
- // Setup Boot Mode. If BootModeStr == "" then BootMode = 0 (BOOT_WITH_FULL_CONFIGURATION)
- //
- SecPrint (" BootMode 0x%02x\n", PcdGet32 (PcdWinNtBootMode));
-
- //
- // Allocate 128K memory to emulate temp memory for PEI.
- // on a real platform this would be SRAM, or using the cache as RAM.
- // Set InitialStackMemory to zero so WinNtOpenFile will allocate a new mapping
- //
- InitialStackMemorySize = STACK_SIZE;
- InitialStackMemory = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAlloc (NULL, (SIZE_T) (InitialStackMemorySize), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
- if (InitialStackMemory == 0) {
- SecPrint ("ERROR : Can not allocate enough space for SecStack\n");
- exit (1);
- }
-
- for (StackPointer = (UINTN*) (UINTN) InitialStackMemory;
- StackPointer < (UINTN*) ((UINTN)InitialStackMemory + (SIZE_T) InitialStackMemorySize);
- StackPointer ++) {
- *StackPointer = PcdGet32 (PcdInitValueInTempStack);
- }
-
- SecPrint (" SEC passing in %d bytes of temp RAM to PEI\n", InitialStackMemorySize);
-
- //
- // Open All the firmware volumes and remember the info in the gFdInfo global
- //
- FileNamePtr = (CHAR16 *)malloc (StrLen ((CHAR16 *)FirmwareVolumesStr) * sizeof(CHAR16));
- if (FileNamePtr == NULL) {
- SecPrint ("ERROR : Can not allocate memory for firmware volume string\n");
- exit (1);
- }
-
- StrCpy (FileNamePtr, (CHAR16*)FirmwareVolumesStr);
-
- for (Done = FALSE, Index = 0, PeiCoreFile = NULL; !Done; Index++) {
- FileName = FileNamePtr;
- for (Index1 = 0; (FileNamePtr[Index1] != '!') && (FileNamePtr[Index1] != 0); Index1++)
- ;
- if (FileNamePtr[Index1] == 0) {
- Done = TRUE;
- } else {
- FileNamePtr[Index1] = '\0';
- FileNamePtr = FileNamePtr + Index1 + 1;
- }
-
- //
- // Open the FD and remember where it got mapped into our processes address space
- //
- Status = WinNtOpenFile (
- FileName,
- 0,
- OPEN_EXISTING,
- &gFdInfo[Index].Address,
- &gFdInfo[Index].Size
- );
- if (EFI_ERROR (Status)) {
- SecPrint ("ERROR : Can not open Firmware Device File %S (0x%X). Exiting.\n", FileName, Status);
- exit (1);
- }
-
- SecPrint (" FD loaded from");
- //
- // printf can't print filenames directly as the \ gets interpreted as an
- // escape character.
- //
- for (Index2 = 0; FileName[Index2] != '\0'; Index2++) {
- SecPrint ("%c", FileName[Index2]);
- }
-
- if (PeiCoreFile == NULL) {
- //
- // Assume the beginning of the FD is an FV and look for the PEI Core.
- // Load the first one we find.
- //
- Status = SecFfsFindPeiCore ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) gFdInfo[Index].Address, &PeiCoreFile);
- if (!EFI_ERROR (Status)) {
- SecPrint (" contains SEC Core");
- }
- }
-
- SecPrint ("\n");
- }
- //
- // Calculate memory regions and store the information in the gSystemMemory
- // global for later use. The autosizing code will use this data to
- // map this memory into the SEC process memory space.
- //
- for (Index = 0, Done = FALSE; !Done; Index++) {
- //
- // Save the size of the memory and make a Unicode filename SystemMemory00, ...
- //
- gSystemMemory[Index].Size = _wtoi (MemorySizeStr) * 0x100000;
-
- //
- // Find the next region
- //
- for (Index1 = 0; MemorySizeStr[Index1] != '!' && MemorySizeStr[Index1] != 0; Index1++)
- ;
- if (MemorySizeStr[Index1] == 0) {
- Done = TRUE;
- }
-
- MemorySizeStr = MemorySizeStr + Index1 + 1;
- }
-
- SecPrint ("\n");
-
- //
- // Hand off to PEI Core
- //
- SecLoadFromCore ((UINTN) InitialStackMemory, (UINTN) InitialStackMemorySize, (UINTN) gFdInfo[0].Address, PeiCoreFile);
-
- //
- // If we get here, then the PEI Core returned. This is an error as PEI should
- // always hand off to DXE.
- //
- SecPrint ("ERROR : PEI Core returned\n");
- exit (1);
-}
-
-EFI_STATUS
-WinNtOpenFile (
- IN CHAR16 *FileName,
- IN UINT32 MapSize,
- IN DWORD CreationDisposition,
- IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
- OUT UINT64 *Length
- )
-/*++
-
-Routine Description:
- Opens and memory maps a file using WinNt services. If BaseAddress is non zero
- the process will try and allocate the memory starting at BaseAddress.
-
-Arguments:
- FileName - The name of the file to open and map
- MapSize - The amount of the file to map in bytes
- CreationDisposition - The flags to pass to CreateFile(). Use to create new files for
- memory emulation, and exiting files for firmware volume emulation
- BaseAddress - The base address of the mapped file in the user address space.
- If passed in as NULL the new memory region is used.
- If passed in as non NULL the request memory region is used for
- the mapping of the file into the process space.
- Length - The size of the mapped region in bytes
-
-Returns:
- EFI_SUCCESS - The file was opened and mapped.
- EFI_NOT_FOUND - FileName was not found in the current directory
- EFI_DEVICE_ERROR - An error occured attempting to map the opened file
-
---*/
-{
- HANDLE NtFileHandle;
- HANDLE NtMapHandle;
- VOID *VirtualAddress;
- UINTN FileSize;
-
- //
- // Use Win API to open/create a file
- //
- NtFileHandle = CreateFile (
- FileName,
- GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE,
- FILE_SHARE_READ,
- NULL,
- CreationDisposition,
- FILE_ATTRIBUTE_NORMAL,
- NULL
- );
- if (NtFileHandle == INVALID_HANDLE_VALUE) {
- return EFI_NOT_FOUND;
- }
- //
- // Map the open file into a memory range
- //
- NtMapHandle = CreateFileMapping (
- NtFileHandle,
- NULL,
- PAGE_EXECUTE_READWRITE,
- 0,
- MapSize,
- NULL
- );
- if (NtMapHandle == NULL) {
- return EFI_DEVICE_ERROR;
- }
- //
- // Get the virtual address (address in the emulator) of the mapped file
- //
- VirtualAddress = MapViewOfFileEx (
- NtMapHandle,
- FILE_MAP_EXECUTE | FILE_MAP_ALL_ACCESS,
- 0,
- 0,
- MapSize,
- (LPVOID) (UINTN) *BaseAddress
- );
- if (VirtualAddress == NULL) {
- return EFI_DEVICE_ERROR;
- }
-
- if (MapSize == 0) {
- //
- // Seek to the end of the file to figure out the true file size.
- //
- FileSize = SetFilePointer (
- NtFileHandle,
- 0,
- NULL,
- FILE_END
- );
- if (FileSize == -1) {
- return EFI_DEVICE_ERROR;
- }
-
- *Length = (UINT64) FileSize;
- } else {
- *Length = (UINT64) MapSize;
- }
-
- *BaseAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAddress;
-
- return EFI_SUCCESS;
-}
-
-
-#define BYTES_PER_RECORD 512
-
-EFI_STATUS
-EFIAPI
-SecPeiReportStatusCode (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId,
- IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine produces the ReportStatusCode PEI service. It's passed
- up to the PEI Core via a PPI. T
-
- This code currently uses the NT clib printf. This does not work the same way
- as the EFI Print (), as %t, %g, %s as Unicode are not supported.
-
-Arguments:
- (see EFI_PEI_REPORT_STATUS_CODE)
-
-Returns:
- EFI_SUCCESS - Always return success
-
---*/
-// TODO: PeiServices - add argument and description to function comment
-// TODO: CodeType - add argument and description to function comment
-// TODO: Value - add argument and description to function comment
-// TODO: Instance - add argument and description to function comment
-// TODO: CallerId - add argument and description to function comment
-// TODO: Data - add argument and description to function comment
-{
- CHAR8 *Format;
- BASE_LIST Marker;
- CHAR8 PrintBuffer[BYTES_PER_RECORD * 2];
- CHAR8 *Filename;
- CHAR8 *Description;
- UINT32 LineNumber;
- UINT32 ErrorLevel;
-
-
- if (Data == NULL) {
- } else if (ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {
- //
- // Processes ASSERT ()
- //
- SecPrint ("ASSERT %s(%d): %s\n", Filename, (int)LineNumber, Description);
-
- } else if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
- //
- // Process DEBUG () macro
- //
- AsciiBSPrint (PrintBuffer, BYTES_PER_RECORD, Format, Marker);
- SecPrint (PrintBuffer);
- }
-
- return EFI_SUCCESS;
-}
-
-#if defined (MDE_CPU_IA32)
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
- Reserved on other architectures.
-
-**/
-VOID
-EFIAPI
-PeiSwitchStacks (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *Context3, OPTIONAL
- IN VOID *NewStack
- )
-{
- BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
-
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
-
- //
- // Stack should be aligned with CPU_STACK_ALIGNMENT
- //
- ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
-
- JumpBuffer.Eip = (UINTN)EntryPoint;
- JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
- JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2) + sizeof(Context3);
- ((VOID**)JumpBuffer.Esp)[1] = Context1;
- ((VOID**)JumpBuffer.Esp)[2] = Context2;
- ((VOID**)JumpBuffer.Esp)[3] = Context3;
-
- LongJump (&JumpBuffer, (UINTN)-1);
-
-
- //
- // InternalSwitchStack () will never return
- //
- ASSERT (FALSE);
-}
-#endif
-
-VOID
-SecLoadFromCore (
- IN UINTN LargestRegion,
- IN UINTN LargestRegionSize,
- IN UINTN BootFirmwareVolumeBase,
- IN VOID *PeiCorePe32File
- )
-/*++
-
-Routine Description:
- This is the service to load the PEI Core from the Firmware Volume
-
-Arguments:
- LargestRegion - Memory to use for PEI.
- LargestRegionSize - Size of Memory to use for PEI
- BootFirmwareVolumeBase - Start of the Boot FV
- PeiCorePe32File - PEI Core PE32
-
-Returns:
- Success means control is transfered and thus we should never return
-
---*/
-{
- EFI_STATUS Status;
- VOID *TopOfStack;
- UINT64 PeiCoreSize;
- EFI_PHYSICAL_ADDRESS PeiCoreEntryPoint;
- EFI_PHYSICAL_ADDRESS PeiImageAddress;
- EFI_SEC_PEI_HAND_OFF *SecCoreData;
- UINTN PeiStackSize;
-
- //
- // Compute Top Of Memory for Stack and PEI Core Allocations
- //
- PeiStackSize = (UINTN)RShiftU64((UINT64)STACK_SIZE,1);
-
- //
- // |-----------| <---- TemporaryRamBase + TemporaryRamSize
- // | Heap |
- // | |
- // |-----------| <---- StackBase / PeiTemporaryMemoryBase
- // | |
- // | Stack |
- // |-----------| <---- TemporaryRamBase
- //
- TopOfStack = (VOID *)(LargestRegion + PeiStackSize);
-
- //
- // Reservet space for storing PeiCore's parament in stack.
- //
- TopOfStack = (VOID *)((UINTN)TopOfStack - sizeof (EFI_SEC_PEI_HAND_OFF) - CPU_STACK_ALIGNMENT);
- TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
-
- //
- // Bind this information into the SEC hand-off state
- //
- SecCoreData = (EFI_SEC_PEI_HAND_OFF*)(UINTN) TopOfStack;
- SecCoreData->DataSize = sizeof(EFI_SEC_PEI_HAND_OFF);
- SecCoreData->BootFirmwareVolumeBase = (VOID*)BootFirmwareVolumeBase;
- SecCoreData->BootFirmwareVolumeSize = PcdGet32(PcdWinNtFirmwareFdSize);
- SecCoreData->TemporaryRamBase = (VOID*)(UINTN)LargestRegion;
- SecCoreData->TemporaryRamSize = STACK_SIZE;
- SecCoreData->StackBase = SecCoreData->TemporaryRamBase;
- SecCoreData->StackSize = PeiStackSize;
- SecCoreData->PeiTemporaryRamBase = (VOID*) ((UINTN) SecCoreData->TemporaryRamBase + PeiStackSize);
- SecCoreData->PeiTemporaryRamSize = STACK_SIZE - PeiStackSize;
-
- //
- // Load the PEI Core from a Firmware Volume
- //
- Status = SecWinNtPeiLoadFile (
- PeiCorePe32File,
- &PeiImageAddress,
- &PeiCoreSize,
- &PeiCoreEntryPoint
- );
- if (EFI_ERROR (Status)) {
- return ;
- }
-
- //
- // Transfer control to the PEI Core
- //
- PeiSwitchStacks (
- (SWITCH_STACK_ENTRY_POINT) (UINTN) PeiCoreEntryPoint,
- SecCoreData,
- (VOID *) (UINTN) ((EFI_PEI_PPI_DESCRIPTOR *) &gPrivateDispatchTable),
- NULL,
- TopOfStack
- );
- //
- // If we get here, then the PEI Core returned. This is an error
- //
- return ;
-}
-
-EFI_STATUS
-EFIAPI
-SecWinNtPeiAutoScan (
- IN UINTN Index,
- OUT EFI_PHYSICAL_ADDRESS *MemoryBase,
- OUT UINT64 *MemorySize
- )
-/*++
-
-Routine Description:
- This service is called from Index == 0 until it returns EFI_UNSUPPORTED.
- It allows discontinuous memory regions to be supported by the emulator.
- It uses gSystemMemory[] and gSystemMemoryCount that were created by
- parsing PcdWinNtMemorySizeForSecMain value.
- The size comes from the Pcd value and the address comes from the memory space
- with ReadWrite and Execute attributes allocated by VirtualAlloc() API.
-
-Arguments:
- Index - Which memory region to use
- MemoryBase - Return Base address of memory region
- MemorySize - Return size in bytes of the memory region
-
-Returns:
- EFI_SUCCESS - If memory region was mapped
- EFI_UNSUPPORTED - If Index is not supported
-
---*/
-{
- if (Index >= gSystemMemoryCount) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Allocate enough memory space for emulator
- //
- gSystemMemory[Index].Memory = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAlloc (NULL, (SIZE_T) (gSystemMemory[Index].Size), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
- if (gSystemMemory[Index].Memory == 0) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- *MemoryBase = gSystemMemory[Index].Memory;
- *MemorySize = gSystemMemory[Index].Size;
-
- return EFI_SUCCESS;
-}
-
-VOID *
-EFIAPI
-SecWinNtWinNtThunkAddress (
- VOID
- )
-/*++
-
-Routine Description:
- Since the SEC is the only Windows program in stack it must export
- an interface to do Win API calls. That's what the WinNtThunk address
- is for. gWinNt is initialized in WinNtThunk.c.
-
-Arguments:
- InterfaceSize - sizeof (EFI_WIN_NT_THUNK_PROTOCOL);
- InterfaceBase - Address of the gWinNt global
-
-Returns:
- EFI_SUCCESS - Data returned
-
---*/
-{
- return gWinNt;
-}
-
-
-EFI_STATUS
-EFIAPI
-SecWinNtPeiLoadFile (
- IN VOID *Pe32Data,
- IN EFI_PHYSICAL_ADDRESS *ImageAddress,
- IN UINT64 *ImageSize,
- IN EFI_PHYSICAL_ADDRESS *EntryPoint
- )
-/*++
-
-Routine Description:
- Loads and relocates a PE/COFF image into memory.
-
-Arguments:
- Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated
- ImageAddress - The base address of the relocated PE/COFF image
- ImageSize - The size of the relocated PE/COFF image
- EntryPoint - The entry point of the relocated PE/COFF image
-
-Returns:
- EFI_SUCCESS - The file was loaded and relocated
- EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file
-
---*/
-{
- EFI_STATUS Status;
- PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
-
- ZeroMem (&ImageContext, sizeof (ImageContext));
- ImageContext.Handle = Pe32Data;
-
- ImageContext.ImageRead = (PE_COFF_LOADER_READ_FILE) SecImageRead;
-
- Status = PeCoffLoaderGetImageInfo (&ImageContext);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- //
- // Allocate space in NT (not emulator) memory with ReadWrite and Execute attribute.
- // Extra space is for alignment
- //
- ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) VirtualAlloc (NULL, (SIZE_T) (ImageContext.ImageSize + (ImageContext.SectionAlignment * 2)), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
- if (ImageContext.ImageAddress == 0) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Align buffer on section boundary
- //
- ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
- ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)ImageContext.SectionAlignment - 1);
-
- Status = PeCoffLoaderLoadImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = SecNt32PeCoffRelocateImage (&ImageContext);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // BugBug: Flush Instruction Cache Here when CPU Lib is ready
- //
-
- *ImageAddress = ImageContext.ImageAddress;
- *ImageSize = ImageContext.ImageSize;
- *EntryPoint = ImageContext.EntryPoint;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-SecWinNtFdAddress (
- IN UINTN Index,
- IN OUT EFI_PHYSICAL_ADDRESS *FdBase,
- IN OUT UINT64 *FdSize
- )
-/*++
-
-Routine Description:
- Return the FD Size and base address. Since the FD is loaded from a
- file into Windows memory only the SEC will know it's address.
-
-Arguments:
- Index - Which FD, starts at zero.
- FdSize - Size of the FD in bytes
- FdBase - Start address of the FD. Assume it points to an FV Header
-
-Returns:
- EFI_SUCCESS - Return the Base address and size of the FV
- EFI_UNSUPPORTED - Index does not map to an FD in the system
-
---*/
-{
- if (Index >= gFdInfoCount) {
- return EFI_UNSUPPORTED;
- }
-
- *FdBase = gFdInfo[Index].Address;
- *FdSize = gFdInfo[Index].Size;
-
- if (*FdBase == 0 && *FdSize == 0) {
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-SecImageRead (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
-
-Arguments:
- FileHandle - The handle to the PE/COFF file
- FileOffset - The offset, in bytes, into the file to read
- ReadSize - The number of bytes to read from the file starting at FileOffset
- Buffer - A pointer to the buffer to read the data into.
-
-Returns:
- EFI_SUCCESS - ReadSize bytes of data were read into Buffer from the PE/COFF file starting at FileOffset
-
---*/
-{
- CHAR8 *Destination8;
- CHAR8 *Source8;
- UINTN Length;
-
- Destination8 = Buffer;
- Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
- Length = *ReadSize;
- while (Length--) {
- *(Destination8++) = *(Source8++);
- }
-
- return EFI_SUCCESS;
-}
-
-CHAR16 *
-AsciiToUnicode (
- IN CHAR8 *Ascii,
- IN UINTN *StrLen OPTIONAL
- )
-/*++
-
-Routine Description:
- Convert the passed in Ascii string to Unicode.
- Optionally return the length of the strings.
-
-Arguments:
- Ascii - Ascii string to convert
- StrLen - Length of string
-
-Returns:
- Pointer to malloc'ed Unicode version of Ascii
-
---*/
-{
- UINTN Index;
- CHAR16 *Unicode;
-
- //
- // Allocate a buffer for unicode string
- //
- for (Index = 0; Ascii[Index] != '\0'; Index++)
- ;
- Unicode = malloc ((Index + 1) * sizeof (CHAR16));
- if (Unicode == NULL) {
- return NULL;
- }
-
- for (Index = 0; Ascii[Index] != '\0'; Index++) {
- Unicode[Index] = (CHAR16) Ascii[Index];
- }
-
- Unicode[Index] = '\0';
-
- if (StrLen != NULL) {
- *StrLen = Index;
- }
-
- return Unicode;
-}
-
-UINTN
-CountSeparatorsInString (
- IN CONST CHAR16 *String,
- IN CHAR16 Separator
- )
-/*++
-
-Routine Description:
- Count the number of separators in String
-
-Arguments:
- String - String to process
- Separator - Item to count
-
-Returns:
- Number of Separator in String
-
---*/
-{
- UINTN Count;
-
- for (Count = 0; *String != '\0'; String++) {
- if (*String == Separator) {
- Count++;
- }
- }
-
- return Count;
-}
-
-
-EFI_STATUS
-SecNt32PeCoffRelocateImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- EFI_STATUS Status;
- VOID *DllEntryPoint;
- CHAR16 *DllFileName;
- HMODULE Library;
- UINTN Index;
-
-
- Status = PeCoffLoaderRelocateImage (ImageContext);
- if (EFI_ERROR (Status)) {
- //
- // We could not relocated the image in memory properly
- //
- return Status;
- }
-
- //
- // If we load our own PE COFF images the Windows debugger can not source
- // level debug our code. If a valid PDB pointer exists usw it to load
- // the *.dll file as a library using Windows* APIs. This allows
- // source level debug. The image is still loaded and relocated
- // in the Framework memory space like on a real system (by the code above),
- // but the entry point points into the DLL loaded by the code bellow.
- //
-
- DllEntryPoint = NULL;
-
- //
- // Load the DLL if it's not an EBC image.
- //
- if ((ImageContext->PdbPointer != NULL) &&
- (ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {
- //
- // Convert filename from ASCII to Unicode
- //
- DllFileName = AsciiToUnicode (ImageContext->PdbPointer, &Index);
-
- //
- // Check that we have a valid filename
- //
- if (Index < 5 || DllFileName[Index - 4] != '.') {
- free (DllFileName);
-
- //
- // Never return an error if PeCoffLoaderRelocateImage() succeeded.
- // The image will run, but we just can't source level debug. If we
- // return an error the image will not run.
- //
- return EFI_SUCCESS;
- }
- //
- // Replace .PDB with .DLL on the filename
- //
- DllFileName[Index - 3] = 'D';
- DllFileName[Index - 2] = 'L';
- DllFileName[Index - 1] = 'L';
-
- //
- // Load the .DLL file into the user process's address space for source
- // level debug
- //
- Library = LoadLibraryEx (DllFileName, NULL, DONT_RESOLVE_DLL_REFERENCES);
- if (Library != NULL) {
- //
- // InitializeDriver is the entry point we put in all our EFI DLL's. The
- // DONT_RESOLVE_DLL_REFERENCES argument to LoadLIbraryEx() suppresses the
- // normal DLL entry point of DllMain, and prevents other modules that are
- // referenced in side the DllFileName from being loaded. There is no error
- // checking as the we can point to the PE32 image loaded by Tiano. This
- // step is only needed for source level debugging
- //
- DllEntryPoint = (VOID *) (UINTN) GetProcAddress (Library, "InitializeDriver");
-
- }
-
- if ((Library != NULL) && (DllEntryPoint != NULL)) {
- ImageContext->EntryPoint = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;
- SecPrint ("LoadLibraryEx (%S,\n NULL, DONT_RESOLVE_DLL_REFERENCES)\n", DllFileName);
- } else {
- SecPrint ("WARNING: No source level debug %S. \n", DllFileName);
- }
-
- free (DllFileName);
- }
-
- //
- // Never return an error if PeCoffLoaderRelocateImage() succeeded.
- // The image will run, but we just can't source level debug. If we
- // return an error the image will not run.
- //
- return EFI_SUCCESS;
-}
-
-
-
-
-VOID
-_ModuleEntryPoint (
- VOID
- )
-{
-}
-
-EFI_STATUS
-EFIAPI
-SecTemporaryRamSupport (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
- IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
- IN UINTN CopySize
- )
-{
- //
- // Migrate the whole temporary memory to permanent memory.
- //
- CopyMem (
- (VOID*)(UINTN)PermanentMemoryBase,
- (VOID*)(UINTN)TemporaryMemoryBase,
- CopySize
- );
-
- //
- // SecSwitchStack function must be invoked after the memory migration
- // immediately, also we need fixup the stack change caused by new call into
- // permanent memory.
- //
- SecSwitchStack (
- (UINT32) TemporaryMemoryBase,
- (UINT32) PermanentMemoryBase
- );
-
- //
- // We need *not* fix the return address because currently,
- // The PeiCore is executed in flash.
- //
-
- //
- // Simulate to invalid temporary memory, terminate temporary memory
- //
- //ZeroMem ((VOID*)(UINTN)TemporaryMemoryBase, CopySize);
-
- return EFI_SUCCESS;
-}
-
diff --git a/Nt32Pkg/Sec/SecMain.h b/Nt32Pkg/Sec/SecMain.h
deleted file mode 100644
index 09d4e367f6..0000000000
--- a/Nt32Pkg/Sec/SecMain.h
+++ /dev/null
@@ -1,553 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-
-Module Name:
- SecMain.h
-
-Abstract:
- Include file for Windows API based SEC
-
-**/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#define STACK_SIZE 0x20000
-
-typedef struct {
- EFI_PHYSICAL_ADDRESS Address;
- UINT64 Size;
-} NT_FD_INFO;
-
-typedef struct {
- EFI_PHYSICAL_ADDRESS Memory;
- UINT64 Size;
-} NT_SYSTEM_MEMORY;
-
-#define MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE 0x100
-
-typedef struct {
- CHAR8 *PdbPointer;
- VOID *ModHandle;
-} PDB_NAME_TO_MOD_HANDLE;
-
-
-
-
-EFI_STATUS
-EFIAPI
-SecWinNtPeiLoadFile (
- VOID *Pe32Data, // TODO: add IN/OUT modifier to Pe32Data
- EFI_PHYSICAL_ADDRESS *ImageAddress, // TODO: add IN/OUT modifier to ImageAddress
- UINT64 *ImageSize, // TODO: add IN/OUT modifier to ImageSize
- EFI_PHYSICAL_ADDRESS *EntryPoint // TODO: add IN/OUT modifier to EntryPoint
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Pe32Data - TODO: add argument description
- ImageAddress - TODO: add argument description
- ImageSize - TODO: add argument description
- EntryPoint - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecWinNtPeiAutoScan (
- IN UINTN Index,
- OUT EFI_PHYSICAL_ADDRESS *MemoryBase,
- OUT UINT64 *MemorySize
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Index - TODO: add argument description
- MemoryBase - TODO: add argument description
- MemorySize - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-VOID *
-EFIAPI
-SecWinNtWinNtThunkAddress (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- InterfaceSize - TODO: add argument description
- InterfaceBase - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecWinNtWinNtFwhAddress (
- IN OUT UINT64 *FwhSize,
- IN OUT EFI_PHYSICAL_ADDRESS *FwhBase
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- FwhSize - TODO: add argument description
- FwhBase - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecPeiReportStatusCode (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID * CallerId,
- IN CONST EFI_STATUS_CODE_DATA * Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- PeiServices - TODO: add argument description
- CodeType - TODO: add argument description
- Value - TODO: add argument description
- Instance - TODO: add argument description
- CallerId - TODO: add argument description
- Data - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-INTN
-EFIAPI
-main (
- IN INTN Argc,
- IN CHAR8 **Argv,
- IN CHAR8 **Envp
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Argc - TODO: add argument description
- Argv - TODO: add argument description
- Envp - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-WinNtOpenFile (
- CHAR16 *FileName,
- UINT32 MapSize,
- DWORD CreationDispostion,
- EFI_PHYSICAL_ADDRESS *BaseAddress,
- UINT64 *Length
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- FileName - TODO: add argument description
- MapSize - TODO: add argument description
- CreationDispostion - TODO: add argument description
- BaseAddress - TODO: add argument description
- Length - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-VOID
-SecLoadFromCore (
- IN UINTN LargestRegion,
- IN UINTN LargestRegionSize,
- IN UINTN BootFirmwareVolumeBase,
- IN VOID *PeiCoreFile
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- LargestRegion - TODO: add argument description
- LargestRegionSize - TODO: add argument description
- BootFirmwareVolumeBase - TODO: add argument description
- PeiCoreFile - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-SecLoadFile (
- IN VOID *Pe32Data,
- IN EFI_PHYSICAL_ADDRESS *ImageAddress,
- IN UINT64 *ImageSize,
- IN EFI_PHYSICAL_ADDRESS *EntryPoint
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Pe32Data - TODO: add argument description
- ImageAddress - TODO: add argument description
- ImageSize - TODO: add argument description
- EntryPoint - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-SecFfsFindPeiCore (
- IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
- OUT VOID **Pe32Data
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- FwVolHeader - TODO: add argument description
- Pe32Data - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-SecFfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
- IN OUT EFI_FFS_FILE_HEADER **FileHeader
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- SearchType - TODO: add argument description
- FwVolHeader - TODO: add argument description
- FileHeader - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-SecFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,
- IN OUT VOID **SectionData
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- SectionType - TODO: add argument description
- FfsFileHeader - TODO: add argument description
- SectionData - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecWinNtPeCoffLoaderLoadAsDll (
- IN CHAR8 *PdbFileName,
- IN VOID **ImageEntryPoint,
- OUT VOID **ModHandle
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- PdbFileName - TODO: add argument description
- ImageEntryPoint - TODO: add argument description
- ModHandle - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecWinNtPeCoffLoaderFreeLibrary (
- OUT VOID *ModHandle
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ModHandle - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecWinNtFdAddress (
- IN UINTN Index,
- IN OUT EFI_PHYSICAL_ADDRESS *FdBase,
- IN OUT UINT64 *FdSize
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Index - TODO: add argument description
- FdBase - TODO: add argument description
- FdSize - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-GetImageReadFunction (
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN EFI_PHYSICAL_ADDRESS *TopOfMemory
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ImageContext - TODO: add argument description
- TopOfMemory - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecImageRead (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- FileHandle - TODO: add argument description
- FileOffset - TODO: add argument description
- ReadSize - TODO: add argument description
- Buffer - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-CHAR16 *
-AsciiToUnicode (
- IN CHAR8 *Ascii,
- IN UINTN *StrLen OPTIONAL
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Ascii - TODO: add argument description
- StrLen - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-UINTN
-CountSeparatorsInString (
- IN CONST CHAR16 *String,
- IN CHAR16 Separator
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- String - TODO: add argument description
- Separator - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SecTemporaryRamSupport (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
- IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
- IN UINTN CopySize
- );
-
-
-extern EFI_WIN_NT_THUNK_PROTOCOL *gWinNt;
diff --git a/Nt32Pkg/Sec/SecMain.inf b/Nt32Pkg/Sec/SecMain.inf
deleted file mode 100644
index 2a68284ef8..0000000000
--- a/Nt32Pkg/Sec/SecMain.inf
+++ /dev/null
@@ -1,88 +0,0 @@
-## @file
-# Entry Point of NT32 Emulator
-#
-# Main executable file of NT32 Emulator that loads PEI core after initialization finished.
-#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = SecMain
- FILE_GUID = 4b837b03-6587-4d19-b82b-edfad836c0a0
- MODULE_TYPE = USER_DEFINED
- VERSION_STRING = 1.0
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- SecMain.h
- WinNtThunk.c
- FwVol.c
- SecMain.c
-
-[Sources.ia32]
- Stack.asm
-
-[Sources.x64]
- StackX64.asm
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- DebugLib
- PcdLib
- PrintLib
- BaseMemoryLib
- BaseLib
- PeCoffLib
- ReportStatusCodeLib
-
-[Ppis]
- gNtPeiLoadFilePpiGuid # PPI ALWAYS_PRODUCED
- gEfiPeiStatusCodePpiGuid # PPI ALWAYS_PRODUCED
- gNtFwhPpiGuid # PPI ALWAYS_PRODUCED
- gPeiNtAutoScanPpiGuid # PPI ALWAYS_PRODUCED
- gPeiNtThunkPpiGuid # PPI ALWAYS_PRODUCED
- gEfiTemporaryRamSupportPpiGuid
-
-[Pcd]
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtBootMode
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySizeForSecMain
- gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareVolume
- gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack
-
-[BuildOptions]
- MSFT:*_*_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_VS2015_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_VS2015x86_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_VS2017_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_*_IA32_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
- MSFT:*_*_IA32_PP_FLAGS == /nologo /E /TC /FIAutoGen.h
- MSFT:*_*_IA32_ASM_FLAGS == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi
- MSFT:*_*_IA32_ASMLINK_FLAGS == /link /nologo /tiny
-
- MSFT:*_*_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_VS2015_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_VS2015x86_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_VS2017_X64_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:AMD64 /LTCG Kernel32.lib MSVCRTD.lib vcruntimed.lib ucrtd.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
- MSFT:*_*_X64_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
- MSFT:*_*_X64_PP_FLAGS == /nologo /E /TC /FIAutoGen.h
- MSFT:*_*_X64_ASM_FLAGS == /nologo /W3 /WX /c /Cx /Zd /W0 /Zi
- MSFT:*_*_X64_ASMLINK_FLAGS == /link /nologo
-
- INTEL:*_*_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"C:\Program Files\Intel\Compiler\C++\9.1\IA32\Lib" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib
- INTEL:*_*_IA32_CC_FLAGS == /nologo /W4 /WX /Gy /c /D UNICODE /Od /FIAutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
- INTEL:*_*_IA32_PP_FLAGS == /nologo /E /TC /FIAutoGen.h
- INTEL:*_*_IA32_ASM_FLAGS == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi
- INTEL:*_*_IA32_ASMLINK_FLAGS == /link /nologo /tiny
diff --git a/Nt32Pkg/Sec/Stack.asm b/Nt32Pkg/Sec/Stack.asm
deleted file mode 100644
index 90fa2b2e82..0000000000
--- a/Nt32Pkg/Sec/Stack.asm
+++ /dev/null
@@ -1,88 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2007, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent
-;
-; Module Name:
-;
-; Stack.asm
-;
-; Abstract:
-;
-; Switch the stack from temporary memory to permenent memory.
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; SecSwitchStack (
-; UINT32 TemporaryMemoryBase,
-; UINT32 PermenentMemoryBase
-; );
-;------------------------------------------------------------------------------
-SecSwitchStack PROC
- ;
- ; Save three register: eax, ebx, ecx
- ;
- push eax
- push ebx
- push ecx
- push edx
-
- ;
- ; !!CAUTION!! this function address's is pushed into stack after
- ; migration of whole temporary memory, so need save it to permenent
- ; memory at first!
- ;
-
- mov ebx, [esp + 20] ; Save the first parameter
- mov ecx, [esp + 24] ; Save the second parameter
-
- ;
- ; Save this function's return address into permenent memory at first.
- ; Then, Fixup the esp point to permenent memory
- ;
- mov eax, esp
- sub eax, ebx
- add eax, ecx
- mov edx, dword ptr [esp] ; copy pushed register's value to permenent memory
- mov dword ptr [eax], edx
- mov edx, dword ptr [esp + 4]
- mov dword ptr [eax + 4], edx
- mov edx, dword ptr [esp + 8]
- mov dword ptr [eax + 8], edx
- mov edx, dword ptr [esp + 12]
- mov dword ptr [eax + 12], edx
- mov edx, dword ptr [esp + 16] ; Update this function's return address into permenent memory
- mov dword ptr [eax + 16], edx
- mov esp, eax ; From now, esp is pointed to permenent memory
-
- ;
- ; Fixup the ebp point to permenent memory
- ;
- mov eax, ebp
- sub eax, ebx
- add eax, ecx
- mov ebp, eax ; From now, ebp is pointed to permenent memory
-
- ;
- ; Fixup callee's ebp point for PeiDispatch
- ;
- mov eax, dword ptr [ebp]
- sub eax, ebx
- add eax, ecx
- mov dword ptr [ebp], eax ; From now, Temporary's PPI caller's stack is in permenent memory
-
- pop edx
- pop ecx
- pop ebx
- pop eax
- ret
-SecSwitchStack ENDP
-
- END
diff --git a/Nt32Pkg/Sec/StackX64.asm b/Nt32Pkg/Sec/StackX64.asm
deleted file mode 100644
index 565acfa8b6..0000000000
--- a/Nt32Pkg/Sec/StackX64.asm
+++ /dev/null
@@ -1,104 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2013, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent
-;
-; Module Name:
-;
-; Stack.asm
-;
-; Abstract:
-;
-; Switch the stack from temporary memory to permenent memory.
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; SecSwitchStack (
-; UINT32 TemporaryMemoryBase,
-; UINT32 PermenentMemoryBase
-; );
-;------------------------------------------------------------------------------
-SecSwitchStack PROC
- mov [rsp + 08h], rcx
- mov [rsp + 10h], rdx
-
- ;
- ; Save three register: eax, ebx, ecx
- ;
- push rax
- push rbx
- push rcx
- push rdx
-
- ;
- ; !!CAUTION!! this function address's is pushed into stack after
- ; migration of whole temporary memory, so need save it to permenent
- ; memory at first!
- ;
-
- mov rbx, [rsp + 28h] ; Save the first parameter
- mov rcx, [rsp + 30h] ; Save the second parameter
-
- ;
- ; Save this function's return address into permenent memory at first.
- ; Then, Fixup the esp point to permenent memory
- ;
- mov rax, rsp
- sub rax, rbx
- add rax, rcx
- mov rdx, qword ptr [rsp] ; copy pushed register's value to permenent memory
- mov qword ptr [rax], rdx
- mov rdx, qword ptr [rsp + 8]
- mov qword ptr [rax + 8], rdx
- mov rdx, qword ptr [rsp + 10h]
- mov qword ptr [rax + 10h], rdx
- mov rdx, qword ptr [rsp + 18h]
- mov qword ptr [rax + 18h], rdx
- mov rdx, qword ptr [rsp + 20h] ; Update this function's return address into permenent memory
- mov qword ptr [rax + 20h], rdx
- mov rsp, rax ; From now, esp is pointed to permenent memory
-
- ;
- ; Fixup the ebp point to permenent memory
- ;
- mov rax, rbp
- sub rax, rbx
- add rax, rcx
- mov rbp, rax ; From now, ebp is pointed to permenent memory
-
- pop rdx
- pop rcx
- pop rbx
- pop rax
- ret
-SecSwitchStack ENDP
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; PeiSwitchStacks (
-; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-; IN VOID *Context1, OPTIONAL
-; IN VOID *Context2, OPTIONAL
-; IN VOID *Context3, OPTIONAL
-; IN VOID *NewStack
-; )
-;------------------------------------------------------------------------------
-PeiSwitchStacks PROC
- mov rax, rcx
- mov rcx, rdx
- mov rdx, r8
- mov r8, r9
- mov rsp, [rsp + 28h]
- sub rsp, 20h
- call rax
- jmp $
- ret
-PeiSwitchStacks ENDP
-
- END
diff --git a/Nt32Pkg/Sec/WinNtThunk.c b/Nt32Pkg/Sec/WinNtThunk.c
deleted file mode 100644
index c65b906292..0000000000
--- a/Nt32Pkg/Sec/WinNtThunk.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- WinNtThunk.c
-
-Abstract:
-
- Since the SEC is the only windows program in our emulation we
- must use a Tiano mechanism to export Win32 APIs to other modules.
- This is the role of the EFI_WIN_NT_THUNK_PROTOCOL.
-
- The mWinNtThunkTable exists so that a change to EFI_WIN_NT_THUNK_PROTOCOL
- will cause an error in initializing the array if all the member functions
- are not added. It looks like adding a element to end and not initializing
- it may cause the table to be initaliized with the members at the end being
- set to zero. This is bad as jumping to zero will case the NT32 to crash.
-
- All the member functions in mWinNtThunkTable are Win32
- API calls, so please reference Microsoft documentation.
-
-
- gWinNt is a a public exported global that contains the initialized
- data.
-
-**/
-
-#include "SecMain.h"
-
-//
-// This pragma is needed for all the DLL entry points to be asigned to the array.
-// if warning 4232 is not dissabled a warning will be generated as a DLL entry
-// point could be modified dynamically. The SEC does not do that, so we must
-// disable the warning so we can compile the SEC. The previous method was to
-// asign each element in code. The disadvantage to that approach is it's harder
-// to tell if all the elements have been initialized properly.
-//
-#pragma warning(disable : 4232)
-#pragma warning(disable : 4996)
-
-#if __INTEL_COMPILER
-#pragma warning ( disable : 144 )
-#endif
-
-EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable = {
- EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE,
- GetProcAddress,
- GetTickCount,
- LoadLibraryEx,
- FreeLibrary,
- SetPriorityClass,
- SetThreadPriority,
- Sleep,
- SuspendThread,
- GetCurrentThread,
- GetCurrentThreadId,
- GetCurrentProcess,
- CreateThread,
- TerminateThread,
- SendMessage,
- ExitThread,
- ResumeThread,
- DuplicateHandle,
- InitializeCriticalSection,
- EnterCriticalSection,
- LeaveCriticalSection,
- DeleteCriticalSection,
- TlsAlloc,
- TlsFree,
- TlsSetValue,
- TlsGetValue,
- CreateSemaphore,
- WaitForSingleObject,
- ReleaseSemaphore,
- CreateConsoleScreenBuffer,
- FillConsoleOutputAttribute,
- FillConsoleOutputCharacter,
- GetConsoleCursorInfo,
- GetNumberOfConsoleInputEvents,
- PeekConsoleInput,
- ScrollConsoleScreenBuffer,
- ReadConsoleInput,
- SetConsoleActiveScreenBuffer,
- SetConsoleCursorInfo,
- SetConsoleCursorPosition,
- SetConsoleScreenBufferSize,
- SetConsoleTitleW,
- WriteConsoleInput,
- WriteConsoleOutput,
- CreateFile,
- DeviceIoControl,
- CreateDirectory,
- RemoveDirectory,
- GetFileAttributes,
- SetFileAttributes,
- CreateFileMapping,
- CloseHandle,
- DeleteFile,
- FindFirstFile,
- FindNextFile,
- FindClose,
- FlushFileBuffers,
- GetEnvironmentVariable,
- GetLastError,
- SetErrorMode,
- GetStdHandle,
- MapViewOfFileEx,
- ReadFile,
- SetEndOfFile,
- SetFilePointer,
- WriteFile,
- GetFileInformationByHandle,
- GetDiskFreeSpace,
- GetDiskFreeSpaceEx,
- MoveFile,
- SetFileTime,
- SystemTimeToFileTime,
- LocalFileTimeToFileTime,
- FileTimeToLocalFileTime,
- FileTimeToSystemTime,
- GetSystemTime,
- SetSystemTime,
- GetLocalTime,
- SetLocalTime,
- GetTimeZoneInformation,
- SetTimeZoneInformation,
- timeSetEvent,
- timeKillEvent,
- ClearCommError,
- EscapeCommFunction,
- GetCommModemStatus,
- GetCommState,
- SetCommState,
- PurgeComm,
- SetCommTimeouts,
- ExitProcess,
- _snwprintf,
- GetDesktopWindow,
- GetForegroundWindow,
- CreateWindowEx,
- ShowWindow,
- UpdateWindow,
- DestroyWindow,
- InvalidateRect,
- GetWindowDC,
- GetClientRect,
- AdjustWindowRect,
- SetDIBitsToDevice,
- BitBlt,
- GetDC,
- ReleaseDC,
- RegisterClassEx,
- UnregisterClass,
- BeginPaint,
- EndPaint,
- PostQuitMessage,
- DefWindowProc,
- LoadIcon,
- LoadCursor,
- GetStockObject,
- SetViewportOrgEx,
- SetWindowOrgEx,
- MoveWindow,
- GetWindowRect,
- GetMessage,
- TranslateMessage,
- DispatchMessage,
- GetProcessHeap,
- HeapAlloc,
- HeapFree,
- QueryPerformanceCounter,
- QueryPerformanceFrequency
-};
-
-#pragma warning(default : 4996)
-#pragma warning(default : 4232)
-
-EFI_WIN_NT_THUNK_PROTOCOL *gWinNt = &mWinNtThunkTable;
diff --git a/Nt32Pkg/SnpNt32Dxe/ComponentName.c b/Nt32Pkg/SnpNt32Dxe/ComponentName.c
deleted file mode 100644
index 2f4efd0066..0000000000
--- a/Nt32Pkg/SnpNt32Dxe/ComponentName.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- ComponentName.c
-
-Abstract:
-
-
-**/
-
-#include "SnpNt32.h"
-
-//
-// EFI Component Name Functions
-//
-/**
- Retrieves a Unicode string that is the user readable name of the driver.
-
- This function retrieves the user readable name of a driver in the form of a
- Unicode string. If the driver specified by This has a user readable name in
- the language specified by Language, then a pointer to the driver name is
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
- by This does not support the language specified by Language,
- then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified
- in RFC 4646 or ISO 639-2 language code format.
-
- @param DriverName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by
- This and the language specified by Language was
- returned in DriverName.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- );
-
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by a driver.
-
- This function retrieves the user readable name of the controller specified by
- ControllerHandle and ChildHandle in the form of a Unicode string. If the
- driver specified by This has a user readable name in the language specified by
- Language, then a pointer to the controller name is returned in ControllerName,
- and EFI_SUCCESS is returned. If the driver specified by This is not currently
- managing the controller specified by ControllerHandle and ChildHandle,
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not
- support the language specified by Language, then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param ControllerHandle[in] The handle of a controller that the driver
- specified by This is managing. This handle
- specifies the controller whose name is to be
- returned.
-
- @param ChildHandle[in] The handle of the child controller to retrieve
- the name of. This is an optional parameter that
- may be NULL. It will be NULL for device
- drivers. It will also be NULL for a bus drivers
- that wish to retrieve the name of the bus
- controller. It will not be NULL for a bus
- driver that wishes to retrieve the name of a
- child controller.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified in
- RFC 4646 or ISO 639-2 language code format.
-
- @param ControllerName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- controller specified by ControllerHandle and
- ChildHandle in the language specified by
- Language from the point of view of the driver
- specified by This.
-
- @retval EFI_SUCCESS The Unicode string for the user readable name in
- the language specified by Language for the
- driver specified by This was returned in
- DriverName.
-
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
- EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This is not currently
- managing the controller specified by
- ControllerHandle and ChildHandle.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- );
-
-
-//
-// EFI Component Name Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gSnpNt32DriverComponentName = {
- SnpNt32DriverComponentNameGetDriverName,
- SnpNt32DriverComponentNameGetControllerName,
- "eng"
-};
-
-//
-// EFI Component Name 2 Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gSnpNt32DriverComponentName2 = {
- (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SnpNt32DriverComponentNameGetDriverName,
- (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) SnpNt32DriverComponentNameGetControllerName,
- "en"
-};
-
-
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSnpNt32DriverNameTable[] = {
- {
- "eng;en",
- L"SNP NT32 Driver"
- },
- {
- NULL,
- NULL
- }
-};
-
-/**
- Retrieves a Unicode string that is the user readable name of the driver.
-
- This function retrieves the user readable name of a driver in the form of a
- Unicode string. If the driver specified by This has a user readable name in
- the language specified by Language, then a pointer to the driver name is
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
- by This does not support the language specified by Language,
- then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified
- in RFC 4646 or ISO 639-2 language code format.
-
- @param DriverName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by
- This and the language specified by Language was
- returned in DriverName.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- )
-{
- return LookupUnicodeString2 (
- Language,
- This->SupportedLanguages,
- mSnpNt32DriverNameTable,
- DriverName,
- (BOOLEAN)(This == &gSnpNt32DriverComponentName)
- );
-}
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by a driver.
-
- This function retrieves the user readable name of the controller specified by
- ControllerHandle and ChildHandle in the form of a Unicode string. If the
- driver specified by This has a user readable name in the language specified by
- Language, then a pointer to the controller name is returned in ControllerName,
- and EFI_SUCCESS is returned. If the driver specified by This is not currently
- managing the controller specified by ControllerHandle and ChildHandle,
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not
- support the language specified by Language, then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param ControllerHandle[in] The handle of a controller that the driver
- specified by This is managing. This handle
- specifies the controller whose name is to be
- returned.
-
- @param ChildHandle[in] The handle of the child controller to retrieve
- the name of. This is an optional parameter that
- may be NULL. It will be NULL for device
- drivers. It will also be NULL for a bus drivers
- that wish to retrieve the name of the bus
- controller. It will not be NULL for a bus
- driver that wishes to retrieve the name of a
- child controller.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified in
- RFC 4646 or ISO 639-2 language code format.
-
- @param ControllerName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- controller specified by ControllerHandle and
- ChildHandle in the language specified by
- Language from the point of view of the driver
- specified by This.
-
- @retval EFI_SUCCESS The Unicode string for the user readable name in
- the language specified by Language for the
- driver specified by This was returned in
- DriverName.
-
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
- EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This is not currently
- managing the controller specified by
- ControllerHandle and ChildHandle.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- )
-{
- return EFI_UNSUPPORTED;
-}
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.c b/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
deleted file mode 100644
index 88c2e22bad..0000000000
--- a/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
+++ /dev/null
@@ -1,1480 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- SnpNt32.c
-
-Abstract:
-
--**/
-
-#include "SnpNt32.h"
-
-EFI_DRIVER_BINDING_PROTOCOL gSnpNt32DriverBinding = {
- SnpNt32DriverBindingSupported,
- SnpNt32DriverBindingStart,
- SnpNt32DriverBindingStop,
- 0xa,
- NULL,
- NULL
-};
-
-SNPNT32_GLOBAL_DATA gSnpNt32GlobalData = {
- SNP_NT32_DRIVER_SIGNATURE, // Signature
- {
- NULL,
- NULL
- }, // InstanceList
- NULL, // WinNtThunk
- NULL, // NetworkLibraryHandle
- {
- 0
- }, // NtNetUtilityTable
- {
- 0,
- 0,
- EfiLockUninitialized
- }, // Lock
- //
- // Private functions
- //
- SnpNt32InitializeGlobalData, // InitializeGlobalData
- SnpNt32InitializeInstanceData, // InitializeInstanceData
- SnpNt32CloseInstance // CloseInstance
-};
-
-/**
- Changes the state of a network interface from "stopped" to "started".
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Start (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This
- );
-
-/**
- Changes the state of a network interface from "started" to "stopped".
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Stop (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This
- );
-
-/**
- Resets a network adapter and allocates the transmit and receive buffers
- required by the network interface; optionally, also requests allocation
- of additional transmit and receive buffers.
-
- @param This Protocol instance pointer.
- @param ExtraRxBufferSize The size, in bytes, of the extra receive buffer space
- that the driver should allocate for the network interface.
- Some network interfaces will not be able to use the extra
- buffer, and the caller will not know if it is actually
- being used.
- @param ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space
- that the driver should allocate for the network interface.
- Some network interfaces will not be able to use the extra
- buffer, and the caller will not know if it is actually
- being used.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Initialize (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN UINTN ExtraRxBufferSize OPTIONAL,
- IN UINTN ExtraTxBufferSize OPTIONAL
- );
-
-/**
- Resets a network adapter and re-initializes it with the parameters that were
- provided in the previous call to Initialize().
-
- @param This Protocol instance pointer.
- @param ExtendedVerification Indicates that the driver may perform a more
- exhaustive verification operation of the device
- during reset.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Reset (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- );
-
-/**
- Resets a network adapter and leaves it in a state that is safe for
- another driver to initialize.
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Shutdown (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This
- );
-
-/**
- Manages the multicast receive filters of a network interface.
-
- @param This Protocol instance pointer.
- @param EnableBits A bit mask of receive filters to enable on the network interface.
- @param DisableBits A bit mask of receive filters to disable on the network interface.
- @param ResetMcastFilter Set to TRUE to reset the contents of the multicast receive
- filters on the network interface to their default values.
- @param McastFilterCount Number of multicast HW MAC addresses in the new
- MCastFilter list. This value must be less than or equal to
- the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This
- field is optional if ResetMCastFilter is TRUE.
- @param McastFilter A pointer to a list of new multicast receive filter HW MAC
- addresses. This list will replace any existing multicast
- HW MAC address list. This field is optional if
- ResetMCastFilter is TRUE.
-
- @retval EFI_SUCCESS The multicast receive filter list was updated.
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32ReceiveFilters (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN UINT32 EnableBits,
- IN UINT32 DisableBits,
- IN BOOLEAN ResetMcastFilter,
- IN UINTN McastFilterCount OPTIONAL,
- IN EFI_MAC_ADDRESS *McastFilter OPTIONAL
- );
-
-/**
- Modifies or resets the current station address, if supported.
-
- @param This Protocol instance pointer.
- @param Reset Flag used to reset the station address to the network interfaces
- permanent address.
- @param NewMacAddr New station address to be used for the network interface.
-
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32StationAddress (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN Reset,
- IN EFI_MAC_ADDRESS *NewMacAddr OPTIONAL
- );
-
-/**
- Resets or collects the statistics on a network interface.
-
- @param This Protocol instance pointer.
- @param Reset Set to TRUE to reset the statistics for the network interface.
- @param StatisticsSize On input the size, in bytes, of StatisticsTable. On
- output the size, in bytes, of the resulting table of
- statistics.
- @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that
- contains the statistics.
-
- @retval EFI_SUCCESS The statistics were collected from the network interface.
- @retval EFI_NOT_STARTED The network interface has not been started.
- @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
- size needed to hold the statistics is returned in
- StatisticsSize.
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Statistics (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
- IN BOOLEAN Reset,
- IN OUT UINTN *StatisticsSize OPTIONAL,
- OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
- );
-
-/**
- Converts a multicast IP address to a multicast HW MAC address.
-
- @param This Protocol instance pointer.
- @param Ipv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set
- to FALSE if the multicast IP address is IPv4 [RFC 791].
- @param Ip The multicast IP address that is to be converted to a multicast
- HW MAC address.
- @param Mac The multicast HW MAC address that is to be generated from IP.
-
- @retval EFI_SUCCESS The multicast IP address was mapped to the multicast
- HW MAC address.
- @retval EFI_NOT_STARTED The network interface has not been started.
- @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
- size needed to hold the statistics is returned in
- StatisticsSize.
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32McastIptoMac (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN Ipv6,
- IN EFI_IP_ADDRESS *Ip,
- OUT EFI_MAC_ADDRESS *Mac
- );
-
-/**
- Performs read and write operations on the NVRAM device attached to a
- network interface.
-
- @param This Protocol instance pointer.
- @param ReadOrWrite TRUE for read operations, FALSE for write operations.
- @param Offset Byte offset in the NVRAM device at which to start the read or
- write operation. This must be a multiple of NvRamAccessSize and
- less than NvRamSize.
- @param BufferSize The number of bytes to read or write from the NVRAM device.
- This must also be a multiple of NvramAccessSize.
- @param Buffer A pointer to the data buffer.
-
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Nvdata (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN ReadOrWrite,
- IN UINTN Offset,
- IN UINTN BufferSize,
- IN OUT VOID *Buffer
- );
-
-/**
- Reads the current interrupt status and recycled transmit buffer status from
- a network interface.
-
- @param This Protocol instance pointer.
- @param InterruptStatus A pointer to the bit mask of the currently active interrupts
- If this is NULL, the interrupt status will not be read from
- the device. If this is not NULL, the interrupt status will
- be read from the device. When the interrupt status is read,
- it will also be cleared. Clearing the transmit interrupt
- does not empty the recycled transmit buffer array.
- @param TxBuffer Recycled transmit buffer address. The network interface will
- not transmit if its internal recycled transmit buffer array
- is full. Reading the transmit buffer does not clear the
- transmit interrupt. If this is NULL, then the transmit buffer
- status will not be read. If there are no transmit buffers to
- recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32GetStatus (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- OUT UINT32 *InterruptStatus,
- OUT VOID **TxBuffer
- );
-
-/**
- Places a packet in the transmit queue of a network interface.
-
- @param This Protocol instance pointer.
- @param HeaderSize The size, in bytes, of the media header to be filled in by
- the Transmit() function. If HeaderSize is non-zero, then it
- must be equal to This->Mode->MediaHeaderSize and the DestAddr
- and Protocol parameters must not be NULL.
- @param BufferSize The size, in bytes, of the entire packet (media header and
- data) to be transmitted through the network interface.
- @param Buffer A pointer to the packet (media header followed by data) to be
- transmitted. This parameter cannot be NULL. If HeaderSize is zero,
- then the media header in Buffer must already be filled in by the
- caller. If HeaderSize is non-zero, then the media header will be
- filled in by the Transmit() function.
- @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter
- is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
- This->Mode->CurrentAddress is used for the source HW MAC address.
- @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this
- parameter is ignored.
- @param Protocol The type of header to build. If HeaderSize is zero, then this
- parameter is ignored. See RFC 1700, section "Ether Types", for
- examples.
-
- @retval EFI_SUCCESS The packet was placed on the transmit queue.
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
- @retval EFI_ACCESS_DENIED Error acquire global lock for operation.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Transmit (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN UINTN HeaderSize,
- IN UINTN BufferSize,
- IN VOID *Buffer,
- IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
- IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
- IN UINT16 *Protocol OPTIONAL
- );
-
-/**
- Receives a packet from a network interface.
-
- @param This Protocol instance pointer.
- @param HeaderSize The size, in bytes, of the media header received on the network
- interface. If this parameter is NULL, then the media header size
- will not be returned.
- @param BuffSize On entry, the size, in bytes, of Buffer. On exit, the size, in
- bytes, of the packet that was received on the network interface.
- @param Buffer A pointer to the data buffer to receive both the media header and
- the data.
- @param SourceAddr The source HW MAC address. If this parameter is NULL, the
- HW MAC source address will not be extracted from the media
- header.
- @param DestinationAddr The destination HW MAC address. If this parameter is NULL,
- the HW MAC destination address will not be extracted from the
- media header.
- @param Protocol The media header type. If this parameter is NULL, then the
- protocol will not be extracted from the media header. See
- RFC 1700 section "Ether Types" for examples.
-
- @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has
- been updated to the number of bytes received.
- @retval EFI_NOT_READY The network interface is too busy to accept this transmit
- request.
- @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
- @retval EFI_ACCESS_DENIED Error acquire global lock for operation.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Receive (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- OUT UINTN *HeaderSize,
- IN OUT UINTN *BuffSize,
- OUT VOID *Buffer,
- OUT EFI_MAC_ADDRESS *SourceAddr,
- OUT EFI_MAC_ADDRESS *DestinationAddr,
- OUT UINT16 *Protocol
- );
-
-SNPNT32_INSTANCE_DATA gSnpNt32InstanceTemplate = {
- SNP_NT32_INSTANCE_SIGNATURE, // Signature
- {
- NULL,
- NULL
- }, // Entry
- NULL, // RecycledTxBuf
- 0, // RecycledTxBufCount
- 32, // MaxRecycledTxBuf
- NULL, // GlobalData
- NULL, // DeviceHandle
- NULL, // DevicePath
- { // Snp
- EFI_SIMPLE_NETWORK_PROTOCOL_REVISION, // Revision
- SnpNt32Start, // Start
- SnpNt32Stop, // Stop
- SnpNt32Initialize, // Initialize
- SnpNt32Reset, // Reset
- SnpNt32Shutdown, // Shutdown
- SnpNt32ReceiveFilters, // ReceiveFilters
- SnpNt32StationAddress, // StationAddress
- SnpNt32Statistics, // Statistics
- SnpNt32McastIptoMac, // MCastIpToMac
- SnpNt32Nvdata, // NvData
- SnpNt32GetStatus, // GetStatus
- SnpNt32Transmit, // Transmit
- SnpNt32Receive, // Receive
- NULL, // WaitForPacket
- NULL // Mode
- },
- { // Mode
- EfiSimpleNetworkInitialized, // State
- NET_ETHER_ADDR_LEN, // HwAddressSize
- NET_ETHER_HEADER_SIZE, // MediaHeaderSize
- 1500, // MaxPacketSize
- 0, // NvRamSize
- 0, // NvRamAccessSize
- 0, // ReceiveFilterMask
- 0, // ReceiveFilterSetting
- MAX_MCAST_FILTER_CNT, // MaxMCastFilterCount
- 0, // MCastFilterCount
- {
- 0
- }, // MCastFilter
- {
- 0
- }, // CurrentAddress
- {
- 0
- }, // BroadcastAddress
- {
- 0
- }, // PermanentAddress
- NET_IFTYPE_ETHERNET, // IfType
- FALSE, // MacAddressChangeable
- FALSE, // MultipleTxSupported
- TRUE, // MediaPresentSupported
- TRUE // MediaPresent
- },
- {
- 0
- } // InterfaceInfo
-};
-
-/**
- Test to see if this driver supports ControllerHandle. This service
- is called by the EFI boot service ConnectController(). In
- order to make drivers as small as possible, there are a few calling
- restrictions for this service. ConnectController() must
- follow these calling restrictions. If any other agent wishes to call
- Supported() it must also follow these calling restrictions.
-
- @param This Protocol instance pointer.
- @param ControllerHandle Handle of device to test
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver supports this device
- @retval EFI_UNSUPPORTED This driver does not support this device
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL * This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
- )
-{
-
- SNPNT32_GLOBAL_DATA *GlobalData;
- LIST_ENTRY *Entry;
- SNPNT32_INSTANCE_DATA *Instance;
-
- GlobalData = &gSnpNt32GlobalData;
-
- NET_LIST_FOR_EACH (Entry, &GlobalData->InstanceList) {
-
- Instance = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);
-
- if (Instance->DeviceHandle == ControllerHandle) {
- return EFI_SUCCESS;
- }
-
- }
-
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Start this driver on ControllerHandle. This service is called by the
- EFI boot service ConnectController(). In order to make
- drivers as small as possible, there are a few calling restrictions for
- this service. ConnectController() must follow these
- calling restrictions. If any other agent wishes to call Start() it
- must also follow these calling restrictions.
-
- @param This Protocol instance pointer.
- @param ControllerHandle Handle of device to bind driver to
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL * This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
- )
-{
- return EFI_SUCCESS;
-}
-
-/**
- Stop this driver on ControllerHandle. This service is called by the
- EFI boot service DisconnectController(). In order to
- make drivers as small as possible, there are a few calling
- restrictions for this service. DisconnectController()
- must follow these calling restrictions. If any other agent wishes
- to call Stop() it must also follow these calling restrictions.
-
- @param This Protocol instance pointer.
- @param ControllerHandle Handle of device to stop driver on
- @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
- children is zero stop the entire bus driver.
- @param ChildHandleBuffer List of Child Handles to Stop.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- )
-{
- return EFI_SUCCESS;
-}
-
-
-/**
- Changes the state of a network interface from "stopped" to "started".
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Start (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This
- )
-{
- return EFI_SUCCESS;
-}
-
-
-/**
- Changes the state of a network interface from "started" to "stopped".
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Stop (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This
- )
-{
- return EFI_SUCCESS;
-}
-
-/**
- Resets a network adapter and allocates the transmit and receive buffers
- required by the network interface; optionally, also requests allocation
- of additional transmit and receive buffers.
-
- @param This Protocol instance pointer.
- @param ExtraRxBufferSize The size, in bytes, of the extra receive buffer space
- that the driver should allocate for the network interface.
- Some network interfaces will not be able to use the extra
- buffer, and the caller will not know if it is actually
- being used.
- @param ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space
- that the driver should allocate for the network interface.
- Some network interfaces will not be able to use the extra
- buffer, and the caller will not know if it is actually
- being used.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Initialize (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN UINTN ExtraRxBufferSize OPTIONAL,
- IN UINTN ExtraTxBufferSize OPTIONAL
- )
-{
- return EFI_SUCCESS;
-}
-
-/**
- Resets a network adapter and re-initializes it with the parameters that were
- provided in the previous call to Initialize().
-
- @param This Protocol instance pointer.
- @param ExtendedVerification Indicates that the driver may perform a more
- exhaustive verification operation of the device
- during reset.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Reset (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-{
- return EFI_SUCCESS;
-}
-
-/**
- Resets a network adapter and leaves it in a state that is safe for
- another driver to initialize.
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Shutdown (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This
- )
-{
- return EFI_SUCCESS;
-}
-
-/**
- Manages the multicast receive filters of a network interface.
-
- @param This Protocol instance pointer.
- @param EnableBits A bit mask of receive filters to enable on the network interface.
- @param DisableBits A bit mask of receive filters to disable on the network interface.
- @param ResetMcastFilter Set to TRUE to reset the contents of the multicast receive
- filters on the network interface to their default values.
- @param McastFilterCount Number of multicast HW MAC addresses in the new
- MCastFilter list. This value must be less than or equal to
- the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This
- field is optional if ResetMCastFilter is TRUE.
- @param McastFilter A pointer to a list of new multicast receive filter HW MAC
- addresses. This list will replace any existing multicast
- HW MAC address list. This field is optional if
- ResetMCastFilter is TRUE.
-
- @retval EFI_SUCCESS The multicast receive filter list was updated.
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32ReceiveFilters (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN UINT32 EnableBits,
- IN UINT32 DisableBits,
- IN BOOLEAN ResetMcastFilter,
- IN UINTN McastFilterCount OPTIONAL,
- IN EFI_MAC_ADDRESS *McastFilter OPTIONAL
- )
-{
- SNPNT32_INSTANCE_DATA *Instance;
- SNPNT32_GLOBAL_DATA *GlobalData;
- INT32 ReturnValue;
-
- Instance = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);
-
- GlobalData = Instance->GlobalData;
-
- if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {
- return EFI_ACCESS_DENIED;
- }
-
- ReturnValue = GlobalData->NtNetUtilityTable.SetReceiveFilter (
- Instance->InterfaceInfo.InterfaceIndex,
- EnableBits,
- (UINT32)McastFilterCount,
- McastFilter
- );
-
- EfiReleaseLock (&GlobalData->Lock);
-
- if (ReturnValue <= 0) {
- return EFI_DEVICE_ERROR;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Modifies or resets the current station address, if supported.
-
- @param This Protocol instance pointer.
- @param Reset Flag used to reset the station address to the network interfaces
- permanent address.
- @param NewMacAddr New station address to be used for the network interface.
-
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32StationAddress (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN Reset,
- IN EFI_MAC_ADDRESS *NewMacAddr OPTIONAL
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Resets or collects the statistics on a network interface.
-
- @param This Protocol instance pointer.
- @param Reset Set to TRUE to reset the statistics for the network interface.
- @param StatisticsSize On input the size, in bytes, of StatisticsTable. On
- output the size, in bytes, of the resulting table of
- statistics.
- @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that
- contains the statistics.
-
- @retval EFI_SUCCESS The statistics were collected from the network interface.
- @retval EFI_NOT_STARTED The network interface has not been started.
- @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
- size needed to hold the statistics is returned in
- StatisticsSize.
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Statistics (
- IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
- IN BOOLEAN Reset,
- IN OUT UINTN *StatisticsSize OPTIONAL,
- OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Converts a multicast IP address to a multicast HW MAC address.
-
- @param This Protocol instance pointer.
- @param Ipv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set
- to FALSE if the multicast IP address is IPv4 [RFC 791].
- @param Ip The multicast IP address that is to be converted to a multicast
- HW MAC address.
- @param Mac The multicast HW MAC address that is to be generated from IP.
-
- @retval EFI_SUCCESS The multicast IP address was mapped to the multicast
- HW MAC address.
- @retval EFI_NOT_STARTED The network interface has not been started.
- @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
- size needed to hold the statistics is returned in
- StatisticsSize.
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32McastIptoMac (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN Ipv6,
- IN EFI_IP_ADDRESS *Ip,
- OUT EFI_MAC_ADDRESS *Mac
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Performs read and write operations on the NVRAM device attached to a
- network interface.
-
- @param This Protocol instance pointer.
- @param ReadOrWrite TRUE for read operations, FALSE for write operations.
- @param Offset Byte offset in the NVRAM device at which to start the read or
- write operation. This must be a multiple of NvRamAccessSize and
- less than NvRamSize.
- @param BufferSize The number of bytes to read or write from the NVRAM device.
- This must also be a multiple of NvramAccessSize.
- @param Buffer A pointer to the data buffer.
-
- @retval EFI_UNSUPPORTED Not supported yet.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Nvdata (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN BOOLEAN ReadOrWrite,
- IN UINTN Offset,
- IN UINTN BufferSize,
- IN OUT VOID *Buffer
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Reads the current interrupt status and recycled transmit buffer status from
- a network interface.
-
- @param This Protocol instance pointer.
- @param InterruptStatus A pointer to the bit mask of the currently active interrupts
- If this is NULL, the interrupt status will not be read from
- the device. If this is not NULL, the interrupt status will
- be read from the device. When the interrupt status is read,
- it will also be cleared. Clearing the transmit interrupt
- does not empty the recycled transmit buffer array.
- @param TxBuffer Recycled transmit buffer address. The network interface will
- not transmit if its internal recycled transmit buffer array
- is full. Reading the transmit buffer does not clear the
- transmit interrupt. If this is NULL, then the transmit buffer
- status will not be read. If there are no transmit buffers to
- recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32GetStatus (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- OUT UINT32 *InterruptStatus,
- OUT VOID **TxBuffer
- )
-{
- SNPNT32_INSTANCE_DATA *Instance;
-
- Instance = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);
-
- if (TxBuffer != NULL) {
- if (Instance->RecycledTxBufCount != 0) {
- Instance->RecycledTxBufCount --;
- *((UINT8 **) TxBuffer) = (UINT8 *) (UINTN)Instance->RecycledTxBuf[Instance->RecycledTxBufCount];
- } else {
- *((UINT8 **) TxBuffer) = NULL;
- }
- }
-
- if (InterruptStatus != NULL) {
- *InterruptStatus = EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;
- }
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Places a packet in the transmit queue of a network interface.
-
- @param This Protocol instance pointer.
- @param HeaderSize The size, in bytes, of the media header to be filled in by
- the Transmit() function. If HeaderSize is non-zero, then it
- must be equal to This->Mode->MediaHeaderSize and the DestAddr
- and Protocol parameters must not be NULL.
- @param BufferSize The size, in bytes, of the entire packet (media header and
- data) to be transmitted through the network interface.
- @param Buffer A pointer to the packet (media header followed by data) to be
- transmitted. This parameter cannot be NULL. If HeaderSize is zero,
- then the media header in Buffer must already be filled in by the
- caller. If HeaderSize is non-zero, then the media header will be
- filled in by the Transmit() function.
- @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter
- is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
- This->Mode->CurrentAddress is used for the source HW MAC address.
- @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this
- parameter is ignored.
- @param Protocol The type of header to build. If HeaderSize is zero, then this
- parameter is ignored. See RFC 1700, section "Ether Types", for
- examples.
-
- @retval EFI_SUCCESS The packet was placed on the transmit queue.
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
- @retval EFI_ACCESS_DENIED Error acquire global lock for operation.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Transmit (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- IN UINTN HeaderSize,
- IN UINTN BufferSize,
- IN VOID *Buffer,
- IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
- IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
- IN UINT16 *Protocol OPTIONAL
- )
-{
- SNPNT32_INSTANCE_DATA *Instance;
- SNPNT32_GLOBAL_DATA *GlobalData;
- INT32 ReturnValue;
- UINT64 *Tmp;
-
- Instance = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);
-
- GlobalData = Instance->GlobalData;
-
- if ((HeaderSize != 0) && (SrcAddr == NULL)) {
- SrcAddr = &Instance->Mode.CurrentAddress;
- }
-
- if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {
- return EFI_ACCESS_DENIED;
- }
-
- ReturnValue = GlobalData->NtNetUtilityTable.Transmit (
- Instance->InterfaceInfo.InterfaceIndex,
- (UINT32)HeaderSize,
- (UINT32)BufferSize,
- Buffer,
- SrcAddr,
- DestAddr,
- Protocol
- );
-
- EfiReleaseLock (&GlobalData->Lock);
-
- if (ReturnValue < 0) {
- return EFI_DEVICE_ERROR;
- } else {
- if ((Instance->MaxRecycledTxBuf + SNP_TX_BUFFER_INCREASEMENT) >= SNP_MAX_TX_BUFFER_NUM) {
- return EFI_NOT_READY;
- }
-
- if (Instance->RecycledTxBufCount < Instance->MaxRecycledTxBuf) {
- Instance->RecycledTxBuf[Instance->RecycledTxBufCount] = (UINT64) Buffer;
- Instance->RecycledTxBufCount ++;
- } else {
- Tmp = AllocatePool (sizeof (UINT64) * (Instance->MaxRecycledTxBuf + SNP_TX_BUFFER_INCREASEMENT));
- if (Tmp == NULL) {
- return EFI_DEVICE_ERROR;
- }
- CopyMem (Tmp, Instance->RecycledTxBuf, sizeof (UINT64) * Instance->RecycledTxBufCount);
- FreePool (Instance->RecycledTxBuf);
- Instance->RecycledTxBuf = Tmp;
- Instance->MaxRecycledTxBuf += SNP_TX_BUFFER_INCREASEMENT;
- }
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Receives a packet from a network interface.
-
- @param This Protocol instance pointer.
- @param HeaderSize The size, in bytes, of the media header received on the network
- interface. If this parameter is NULL, then the media header size
- will not be returned.
- @param BuffSize On entry, the size, in bytes, of Buffer. On exit, the size, in
- bytes, of the packet that was received on the network interface.
- @param Buffer A pointer to the data buffer to receive both the media header and
- the data.
- @param SourceAddr The source HW MAC address. If this parameter is NULL, the
- HW MAC source address will not be extracted from the media
- header.
- @param DestinationAddr The destination HW MAC address. If this parameter is NULL,
- the HW MAC destination address will not be extracted from the
- media header.
- @param Protocol The media header type. If this parameter is NULL, then the
- protocol will not be extracted from the media header. See
- RFC 1700 section "Ether Types" for examples.
-
- @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has
- been updated to the number of bytes received.
- @retval EFI_NOT_READY The network interface is too busy to accept this transmit
- request.
- @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
- @retval EFI_ACCESS_DENIED Error acquire global lock for operation.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Receive (
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
- OUT UINTN *HeaderSize,
- IN OUT UINTN *BuffSize,
- OUT VOID *Buffer,
- OUT EFI_MAC_ADDRESS *SourceAddr,
- OUT EFI_MAC_ADDRESS *DestinationAddr,
- OUT UINT16 *Protocol
- )
-{
- SNPNT32_INSTANCE_DATA *Instance;
- SNPNT32_GLOBAL_DATA *GlobalData;
- INT32 ReturnValue;
- UINTN BufSize;
-
- BufSize = *BuffSize;
-
- Instance = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);
-
- GlobalData = Instance->GlobalData;
-
- ASSERT (GlobalData->NtNetUtilityTable.Receive != NULL);
-
- if (EFI_ERROR (EfiAcquireLockOrFail (&GlobalData->Lock))) {
- return EFI_ACCESS_DENIED;
- }
-
- ReturnValue = GlobalData->NtNetUtilityTable.Receive (
- Instance->InterfaceInfo.InterfaceIndex,
- BuffSize,
- Buffer
- );
-
- EfiReleaseLock (&GlobalData->Lock);
-
- if (ReturnValue < 0) {
- if (ReturnValue == -100) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- return EFI_DEVICE_ERROR;
- } else if (ReturnValue == 0) {
- return EFI_NOT_READY;
- }
-
- if (HeaderSize != NULL) {
- *HeaderSize = 14;
- }
-
- if (SourceAddr != NULL) {
- ZeroMem (SourceAddr, sizeof (EFI_MAC_ADDRESS));
- CopyMem (SourceAddr, ((UINT8 *) Buffer) + 6, 6);
- }
-
- if (DestinationAddr != NULL) {
- ZeroMem (DestinationAddr, sizeof (EFI_MAC_ADDRESS));
- CopyMem (DestinationAddr, ((UINT8 *) Buffer), 6);
- }
-
- if (Protocol != NULL) {
- *Protocol = NTOHS (*((UINT16 *) (((UINT8 *) Buffer) + 12)));
- }
-
- return (*BuffSize <= BufSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;
-}
-
-/**
- Initialize the driver's global data.
-
- @param This Pointer to the global context data.
-
- @retval EFI_SUCCESS The global data is initialized.
- @retval EFI_NOT_FOUND The required DLL is not found.
- @retval EFI_DEVICE_ERROR Error initialize network utility library.
- @retval EFI_OUT_OF_RESOURCES Out of resource.
- @retval other Other errors.
-
-**/
-EFI_STATUS
-SnpNt32InitializeGlobalData (
- IN OUT SNPNT32_GLOBAL_DATA *This
- )
-{
- EFI_STATUS Status;
- CHAR16 *DllFileNameU;
- UINT32 Index;
- INT32 ReturnValue;
- BOOLEAN NetUtilityLibInitDone;
- NT_NET_INTERFACE_INFO NetInterfaceInfoBuffer[MAX_INTERFACE_INFO_NUMBER];
- SNPNT32_INSTANCE_DATA *Instance;
- LIST_ENTRY *Entry;
- UINT32 InterfaceCount;
-
- ASSERT (This != NULL);
-
- NetUtilityLibInitDone = FALSE;
- InterfaceCount = MAX_INTERFACE_INFO_NUMBER;
-
- InitializeListHead (&This->InstanceList);
- EfiInitializeLock (&This->Lock, TPL_CALLBACK);
-
- //
- // Get the WinNT thunk
- //
- Status = gBS->LocateProtocol (&gEfiWinNtThunkProtocolGuid, NULL, (VOID **)&This->WinNtThunk);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- ASSERT (This->WinNtThunk != NULL);
-
- DllFileNameU = NETWORK_LIBRARY_NAME_U;
-
- //
- // Load network utility library
- //
- This->NetworkLibraryHandle = This->WinNtThunk->LoadLibraryEx (DllFileNameU, NULL, 0);
-
- if (NULL == This->NetworkLibraryHandle) {
- return EFI_NOT_FOUND;
- }
-
- This->NtNetUtilityTable.Initialize = (NT_NET_INITIALIZE) This->WinNtThunk->GetProcAddress (
- This->NetworkLibraryHandle,
- NETWORK_LIBRARY_INITIALIZE
- );
-
- if (NULL == This->NtNetUtilityTable.Initialize) {
- Status = EFI_NOT_FOUND;
- goto ErrorReturn;
- }
-
- This->NtNetUtilityTable.Finalize = (NT_NET_FINALIZE) This->WinNtThunk->GetProcAddress (
- This->NetworkLibraryHandle,
- NETWORK_LIBRARY_FINALIZE
- );
-
- if (NULL == This->NtNetUtilityTable.Finalize) {
- Status = EFI_NOT_FOUND;
- goto ErrorReturn;
- }
-
- This->NtNetUtilityTable.SetReceiveFilter = (NT_NET_SET_RECEIVE_FILTER) This->WinNtThunk->GetProcAddress (
- This->NetworkLibraryHandle,
- NETWORK_LIBRARY_SET_RCV_FILTER
- );
-
- if (NULL == This->NtNetUtilityTable.SetReceiveFilter) {
- Status = EFI_NOT_FOUND;
- goto ErrorReturn;
- }
-
- This->NtNetUtilityTable.Receive = (NT_NET_RECEIVE) This->WinNtThunk->GetProcAddress (
- This->NetworkLibraryHandle,
- NETWORK_LIBRARY_RECEIVE
- );
-
- if (NULL == This->NtNetUtilityTable.Receive) {
- Status = EFI_NOT_FOUND;
- goto ErrorReturn;
- }
-
- This->NtNetUtilityTable.Transmit = (NT_NET_TRANSMIT) This->WinNtThunk->GetProcAddress (
- This->NetworkLibraryHandle,
- NETWORK_LIBRARY_TRANSMIT
- );
-
- if (NULL == This->NtNetUtilityTable.Transmit) {
- Status = EFI_NOT_FOUND;
- goto ErrorReturn;
- }
- //
- // Initialize the network utility library
- // And enumerate the interfaces in NT32 host
- //
- ReturnValue = This->NtNetUtilityTable.Initialize (&InterfaceCount, &NetInterfaceInfoBuffer[0]);
- if (ReturnValue <= 0) {
- Status = EFI_DEVICE_ERROR;
- goto ErrorReturn;
- }
-
- NetUtilityLibInitDone = TRUE;
-
- if (InterfaceCount == 0) {
- Status = EFI_NOT_FOUND;
- goto ErrorReturn;
- }
- //
- // Create fake SNP instances
- //
- for (Index = 0; Index < InterfaceCount; Index++) {
-
- Instance = AllocateZeroPool (sizeof (SNPNT32_INSTANCE_DATA));
-
- if (NULL == Instance) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ErrorReturn;
- }
- //
- // Copy the content from a template
- //
- CopyMem (Instance, &gSnpNt32InstanceTemplate, sizeof (SNPNT32_INSTANCE_DATA));
-
- //
- // Allocate the RecycledTxBuf.
- //
- Instance->RecycledTxBuf = AllocatePool (sizeof (UINT64) * Instance->MaxRecycledTxBuf);
- if (Instance->RecycledTxBuf == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Set the interface information.
- //
- CopyMem (&Instance->InterfaceInfo, &NetInterfaceInfoBuffer[Index], sizeof(Instance->InterfaceInfo));
- //
- // Initialize this instance
- //
- Status = This->InitializeInstanceData (This, Instance);
- if (EFI_ERROR (Status)) {
-
- gBS->FreePool (Instance);
- goto ErrorReturn;
- }
- //
- // Insert this instance into the instance list
- //
- InsertTailList (&This->InstanceList, &Instance->Entry);
- }
-
- return EFI_SUCCESS;
-
-ErrorReturn:
-
- while (!IsListEmpty (&This->InstanceList)) {
-
- Entry = This->InstanceList.ForwardLink;
-
- Instance = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);
-
- RemoveEntryList (Entry);
-
- This->CloseInstance (This, Instance);
- gBS->FreePool (Instance);
- }
-
- if (NetUtilityLibInitDone) {
-
- ASSERT (This->WinNtThunk != NULL);
-
- if (This->NtNetUtilityTable.Finalize != NULL) {
- This->NtNetUtilityTable.Finalize ();
- This->NtNetUtilityTable.Finalize = NULL;
- }
- }
-
- return Status;
-}
-
-
-/**
- Initialize the snpnt32 driver instance.
-
- @param This Pointer to the SnpNt32 global data.
- @param Instance Pointer to the instance context data.
-
- @retval EFI_SUCCESS The driver instance is initialized.
- @retval other Initialization errors.
-
-**/
-EFI_STATUS
-SnpNt32InitializeInstanceData (
- IN SNPNT32_GLOBAL_DATA *This,
- IN OUT SNPNT32_INSTANCE_DATA *Instance
- )
-{
- EFI_STATUS Status;
- EFI_DEV_PATH EndNode;
- EFI_DEV_PATH Node;
-
- Instance->GlobalData = This;
- Instance->Snp.Mode = &Instance->Mode;
- //
- // Set broadcast address
- //
- SetMem (&Instance->Mode.BroadcastAddress, sizeof (EFI_MAC_ADDRESS), 0xFF);
-
- //
- // Copy Current/PermanentAddress MAC address
- //
- CopyMem (&Instance->Mode.CurrentAddress, &Instance->InterfaceInfo.MacAddr, sizeof(Instance->Mode.CurrentAddress));
- CopyMem (&Instance->Mode.PermanentAddress, &Instance->InterfaceInfo.MacAddr, sizeof(Instance->Mode.PermanentAddress));
-
- //
- // Since the fake SNP is based on a real NIC, to avoid conflict with the host
- // NIC network stack, we use a different MAC address.
- // So just change the last byte of the MAC address for the real NIC.
- //
- Instance->Mode.CurrentAddress.Addr[NET_ETHER_ADDR_LEN - 1]++;
-
- //
- // Create a fake device path for the instance
- //
- ZeroMem (&Node, sizeof (Node));
-
- Node.DevPath.Type = MESSAGING_DEVICE_PATH;
- Node.DevPath.SubType = MSG_MAC_ADDR_DP;
- SetDevicePathNodeLength (&Node.DevPath, sizeof (MAC_ADDR_DEVICE_PATH));
-
- CopyMem (
- &Node.MacAddr.MacAddress,
- &Instance->Mode.CurrentAddress,
- NET_ETHER_ADDR_LEN
- );
-
- Node.MacAddr.IfType = Instance->Mode.IfType;
-
- SetDevicePathEndNode (&EndNode.DevPath);
-
- Instance->DevicePath = AppendDevicePathNode (
- &EndNode.DevPath,
- &Node.DevPath
- );
-
- //
- // Create a fake device handle for the fake SNP
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Instance->DeviceHandle,
- &gEfiSimpleNetworkProtocolGuid,
- &Instance->Snp,
- &gEfiDevicePathProtocolGuid,
- Instance->DevicePath,
- NULL
- );
- return Status;
-}
-
-
-/**
- Close the SnpNt32 driver instance.
-
- @param This Pointer to the SnpNt32 global data.
- @param Instance Pointer to the instance context data.
-
- @retval EFI_SUCCESS The instance is closed.
-
-**/
-EFI_STATUS
-SnpNt32CloseInstance (
- IN SNPNT32_GLOBAL_DATA *This,
- IN OUT SNPNT32_INSTANCE_DATA *Instance
- )
-{
- ASSERT (This != NULL);
- ASSERT (Instance != NULL);
-
- gBS->UninstallMultipleProtocolInterfaces (
- Instance->DeviceHandle,
- &gEfiSimpleNetworkProtocolGuid,
- &Instance->Snp,
- &gEfiDevicePathProtocolGuid,
- Instance->DevicePath,
- NULL
- );
-
- if (Instance->DevicePath != NULL) {
- gBS->FreePool (Instance->DevicePath);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Unloads an image.
-
- @param ImageHandle Handle that identifies the image to be unloaded.
-
- @retval EFI_SUCCESS The image has been unloaded.
- @return Exit code from the image's unload handler
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32Unload (
- IN EFI_HANDLE ImageHandle
- )
-{
- EFI_STATUS Status;
- SNPNT32_GLOBAL_DATA *This;
- LIST_ENTRY *Entry;
- SNPNT32_INSTANCE_DATA *Instance;
-
- This = &gSnpNt32GlobalData;
-
- Status = NetLibDefaultUnload (ImageHandle);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- while (!IsListEmpty (&This->InstanceList)) {
- //
- // Walkthrough the interfaces and remove all the SNP instance
- //
- Entry = This->InstanceList.ForwardLink;
-
- Instance = NET_LIST_USER_STRUCT_S (Entry, SNPNT32_INSTANCE_DATA, Entry, SNP_NT32_INSTANCE_SIGNATURE);
-
- RemoveEntryList (Entry);
-
- This->CloseInstance (This, Instance);
- gBS->FreePool (Instance);
- }
-
- if (This->NtNetUtilityTable.Finalize != NULL) {
- This->NtNetUtilityTable.Finalize ();
- }
-
- This->WinNtThunk->FreeLibrary (This->NetworkLibraryHandle);
-
- return EFI_SUCCESS;
-}
-
-/**
- This is the declaration of an EFI image entry point. This entry point is
- the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
- both device drivers and bus drivers.
-
- @param ImageHandle The firmware allocated handle for the UEFI image.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
-
-**/
-EFI_STATUS
-InitializeSnpNt32Driver (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
-
- EFI_STATUS Status;
-
- //
- // Install the Driver Protocols
- //
-
- Status = EfiLibInstallDriverBindingComponentName2 (
- ImageHandle,
- SystemTable,
- &gSnpNt32DriverBinding,
- ImageHandle,
- &gSnpNt32DriverComponentName,
- &gSnpNt32DriverComponentName2
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Initialize the global data
- //
- Status = SnpNt32InitializeGlobalData (&gSnpNt32GlobalData);
- if (EFI_ERROR (Status)) {
- SnpNt32Unload (ImageHandle);
- }
-
- return Status;
-}
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.h b/Nt32Pkg/SnpNt32Dxe/SnpNt32.h
deleted file mode 100644
index 9939c6bd64..0000000000
--- a/Nt32Pkg/SnpNt32Dxe/SnpNt32.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/** @file
-
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- SnpNt32.h
-
-Abstract:
-
--**/
-
-#ifndef _SNP_NT32_H_
-#define _SNP_NT32_H_
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-typedef struct _SNPNT32_GLOBAL_DATA SNPNT32_GLOBAL_DATA;
-typedef struct _SNPNT32_INSTANCE_DATA SNPNT32_INSTANCE_DATA;
-
-#define NETWORK_LIBRARY_NAME_U L"SnpNt32Io.dll"
-
-#define NETWORK_LIBRARY_INITIALIZE "SnpInitialize"
-#define NETWORK_LIBRARY_FINALIZE "SnpFinalize"
-#define NETWORK_LIBRARY_SET_RCV_FILTER "SnpSetReceiveFilter"
-#define NETWORK_LIBRARY_RECEIVE "SnpReceive"
-#define NETWORK_LIBRARY_TRANSMIT "SnpTransmit"
-
-#pragma pack(1)
-typedef struct _NT_NET_INTERFACE_INFO {
- UINT32 InterfaceIndex;
- EFI_MAC_ADDRESS MacAddr;
-} NT_NET_INTERFACE_INFO;
-#pragma pack()
-
-#define NET_ETHER_HEADER_SIZE 14
-
-#define MAX_INTERFACE_INFO_NUMBER 16
-#define MAX_FILE_NAME_LENGTH 280
-
-#define SNP_MAX_TX_BUFFER_NUM 65536
-#define SNP_TX_BUFFER_INCREASEMENT 32
-
-
-
-
-//
-// Functions in Net Library
-//
-typedef
-INT32
-(*NT_NET_INITIALIZE) (
- IN OUT UINT32 *InterfaceCount,
- IN OUT NT_NET_INTERFACE_INFO * InterfaceInfoBuffer
- );
-
-typedef
-INT32
-(*NT_NET_FINALIZE) (
- VOID
- );
-
-typedef
-INT32
-(*NT_NET_SET_RECEIVE_FILTER) (
- IN UINT32 Index,
- IN UINT32 EnableFilter,
- IN UINT32 MCastFilterCnt,
- IN EFI_MAC_ADDRESS * MCastFilter
- );
-
-typedef
-INT32
-(*NT_NET_RECEIVE) (
- IN UINT32 Index,
- IN OUT UINT32 *BufferSize,
- OUT VOID *Buffer
- );
-
-typedef
-INT32
-(*NT_NET_TRANSMIT) (
- IN UINT32 Index,
- IN UINT32 HeaderSize,
- IN UINT32 BufferSize,
- IN VOID *Buffer,
- IN EFI_MAC_ADDRESS * SrcAddr,
- IN EFI_MAC_ADDRESS * DestAddr,
- IN UINT16 *Protocol
- );
-
-typedef struct _NT_NET_UTILITY_TABLE {
- NT_NET_INITIALIZE Initialize;
- NT_NET_FINALIZE Finalize;
- NT_NET_SET_RECEIVE_FILTER SetReceiveFilter;
- NT_NET_RECEIVE Receive;
- NT_NET_TRANSMIT Transmit;
-} NT_NET_UTILITY_TABLE;
-
-//
-// Private functions
-//
-typedef
-EFI_STATUS
-(*SNPNT32_INITIALIZE_GLOBAL_DATA) (
- IN SNPNT32_GLOBAL_DATA * This
- );
-
-typedef
-EFI_STATUS
-(*SNPNT32_INITIALIZE_INSTANCE_DATA) (
- IN SNPNT32_GLOBAL_DATA * This,
- IN SNPNT32_INSTANCE_DATA * Instance
- );
-
-typedef
-EFI_STATUS
-(*SNPNT32_CLOSE_INSTANCE) (
- IN SNPNT32_GLOBAL_DATA * This,
- IN SNPNT32_INSTANCE_DATA * Instance
- );
-
-//
-// Global data for this driver
-//
-#define SNP_NT32_DRIVER_SIGNATURE SIGNATURE_32 ('W', 'S', 'N', 'P')
-
-struct _SNPNT32_GLOBAL_DATA {
- UINT32 Signature;
-
- //
- // List for all the fake SNP instance
- //
- LIST_ENTRY InstanceList;
-
- EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;
- HMODULE NetworkLibraryHandle;
-
- NT_NET_UTILITY_TABLE NtNetUtilityTable;
-
- EFI_LOCK Lock;
-
- //
- // Private functions
- //
- SNPNT32_INITIALIZE_GLOBAL_DATA InitializeGlobalData;
- SNPNT32_INITIALIZE_INSTANCE_DATA InitializeInstanceData;
- SNPNT32_CLOSE_INSTANCE CloseInstance;
-};
-
-//
-// Instance data for each fake SNP instance
-//
-#define SNP_NT32_INSTANCE_SIGNATURE SIGNATURE_32 ('w', 'S', 'N', 'P')
-
-struct _SNPNT32_INSTANCE_DATA {
- UINT32 Signature;
-
- //
- // List entry use for linking with other instance
- //
- LIST_ENTRY Entry;
-
- //
- // Array of the recycled transmit buffer address.
- //
- UINT64 *RecycledTxBuf;
-
- //
- // Current number of recycled buffer pointers in RecycledTxBuf.
- //
- UINT32 RecycledTxBufCount;
-
- //
- // The maximum number of recycled buffer pointers in RecycledTxBuf.
- //
- UINT32 MaxRecycledTxBuf;
-
- SNPNT32_GLOBAL_DATA *GlobalData;
-
- EFI_HANDLE DeviceHandle;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- EFI_SIMPLE_NETWORK_PROTOCOL Snp;
- EFI_SIMPLE_NETWORK_MODE Mode;
-
- NT_NET_INTERFACE_INFO InterfaceInfo;
-
- //
- // Private functions
- //
-};
-
-#define SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS(a) \
- CR ( \
- a, \
- SNPNT32_INSTANCE_DATA, \
- Snp, \
- SNP_NT32_INSTANCE_SIGNATURE \
- )
-
-extern EFI_DRIVER_BINDING_PROTOCOL gSnpNt32DriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gSnpNt32DriverComponentName;
-extern EFI_COMPONENT_NAME2_PROTOCOL gSnpNt32DriverComponentName2;
-
-/**
- Test to see if this driver supports ControllerHandle. This service
- is called by the EFI boot service ConnectController(). In
- order to make drivers as small as possible, there are a few calling
- restrictions for this service. ConnectController() must
- follow these calling restrictions. If any other agent wishes to call
- Supported() it must also follow these calling restrictions.
-
- @param This Protocol instance pointer.
- @param ControllerHandle Handle of device to test
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver supports this device
- @retval EFI_UNSUPPORTED This driver does not support this device
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL * This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
- );
-
-/**
- Start this driver on ControllerHandle. This service is called by the
- EFI boot service ConnectController(). In order to make
- drivers as small as possible, there are a few calling restrictions for
- this service. ConnectController() must follow these
- calling restrictions. If any other agent wishes to call Start() it
- must also follow these calling restrictions.
-
- @param This Protocol instance pointer.
- @param ControllerHandle Handle of device to bind driver to
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL * This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
- );
-
-/**
- Stop this driver on ControllerHandle. This service is called by the
- EFI boot service DisconnectController(). In order to
- make drivers as small as possible, there are a few calling
- restrictions for this service. DisconnectController()
- must follow these calling restrictions. If any other agent wishes
- to call Stop() it must also follow these calling restrictions.
-
- @param This Protocol instance pointer.
- @param ControllerHandle Handle of device to stop driver on
- @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
- children is zero stop the entire bus driver.
- @param ChildHandleBuffer List of Child Handles to Stop.
-
- @retval EFI_SUCCESS Always succeeds.
-
-**/
-EFI_STATUS
-EFIAPI
-SnpNt32DriverBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- );
-
-/**
- Initialize the driver's global data.
-
- @param This Pointer to the global context data.
-
- @retval EFI_SUCCESS The global data is initialized.
- @retval EFI_NOT_FOUND The required DLL is not found.
- @retval EFI_DEVICE_ERROR Error initialize network utility library.
- @retval EFI_OUT_OF_RESOURCES Out of resource.
- @retval other Other errors.
-
-**/
-EFI_STATUS
-SnpNt32InitializeGlobalData (
- IN OUT SNPNT32_GLOBAL_DATA *This
- );
-
-/**
- Initialize the snpnt32 driver instance.
-
- @param This Pointer to the SnpNt32 global data.
- @param Instance Pointer to the instance context data.
-
- @retval EFI_SUCCESS The driver instance is initialized.
- @retval other Initialization errors.
-
-**/
-EFI_STATUS
-SnpNt32InitializeInstanceData (
- IN SNPNT32_GLOBAL_DATA *This,
- IN OUT SNPNT32_INSTANCE_DATA *Instance
- );
-
-/**
- Close the SnpNt32 driver instance.
-
- @param This Pointer to the SnpNt32 global data.
- @param Instance Pointer to the instance context data.
-
- @retval EFI_SUCCESS The instance is closed.
-
-**/
-EFI_STATUS
-SnpNt32CloseInstance (
- IN SNPNT32_GLOBAL_DATA *This,
- IN OUT SNPNT32_INSTANCE_DATA *Instance
- );
-
-#endif
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf b/Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
deleted file mode 100644
index 38758b1de8..0000000000
--- a/Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
+++ /dev/null
@@ -1,48 +0,0 @@
-## @file
-# Component name for module SnpNt32Dxe
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = SnpNt32Dxe
- FILE_GUID = D0893F05-B06D-4161-B947-9BE9B85AC3A1
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = InitializeSnpNt32Driver
- UNLOAD_IMAGE = SnpNt32Unload
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- ComponentName.c
- SnpNt32.h
- SnpNt32.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- DevicePathLib
- UefiLib
- UefiBootServicesTableLib
- BaseMemoryLib
- DebugLib
- UefiDriverEntryPoint
- NetLib
-
-[Protocols]
- gEfiSimpleNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiWinNtThunkProtocolGuid # PROTOCOL ALWAYS_CONSUMED
diff --git a/Nt32Pkg/StallPei/Stall.c b/Nt32Pkg/StallPei/Stall.c
deleted file mode 100644
index 69b99cc5d4..0000000000
--- a/Nt32Pkg/StallPei/Stall.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/**@file
- EFI_PEI_STALL implementation for NT32 simulation environment.
-
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#include "WinNtPeim.h"
-
-#include
-#include
-#include
-
-EFI_STATUS
-EFIAPI
-Stall (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_STALL_PPI *This,
- IN UINTN Microseconds
- );
-
-EFI_PEI_STALL_PPI mStallPpi = {1000, Stall};
-
-EFI_PEI_PPI_DESCRIPTOR mPpiListStall[1] = {
- {
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gEfiPeiStallPpiGuid,
- &mStallPpi
- }
-};
-
-
-/**
- PEIM's entry point.
-
- This routine installs the simulation instance of EFI_PEI_STALL_PPI based
- on Win API Sleep().
-
- @param FileHandle Handle of the file being invoked.
- @param PeiServices Describes the list of possible PEI Services.
-
- @retval EFI_SUCCESS The PEIM executed normally.
- @retval !EFI_SUCCESS The PEIM failed to execute normally.
-**/
-EFI_STATUS
-EFIAPI
-InitializeStall (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- )
-{
- EFI_STATUS Status;
- Status = (*PeiServices)->InstallPpi (PeiServices, &mPpiListStall[0]);
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-/**
- The Stall() function provides a blocking stall for at least the number
- of microseconds stipulated in the final argument of the API.
-
- @param PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- @param This Pointer to the local data for the interface.
- @param Microseconds Number of microseconds for which to stall.
-
- @retval EFI_SUCCESS The service provided at least the required delay.
-
-**/
-EFI_STATUS
-EFIAPI
-Stall (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_STALL_PPI *This,
- IN UINTN Microseconds
- )
-{
- EFI_STATUS Status;
- PEI_NT_THUNK_PPI *PeiNtService;
- EFI_WIN_NT_THUNK_PROTOCOL *NtThunk;
-
- Status = (**PeiServices).LocatePpi (
- (const EFI_PEI_SERVICES **)PeiServices,
- &gPeiNtThunkPpiGuid,
- 0,
- NULL,
- (VOID**)&PeiNtService
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Calculate the time to sleep. Win API smallest unit to sleep is 1 millisec
- // so micro second units need be divided by 1000 to convert to ms
- //
- NtThunk = (EFI_WIN_NT_THUNK_PROTOCOL*) PeiNtService->NtThunk();
- NtThunk->Sleep ((DWORD)((Microseconds + 999) / 1000));
-
- return EFI_SUCCESS;
-}
diff --git a/Nt32Pkg/StallPei/StallPei.inf b/Nt32Pkg/StallPei/StallPei.inf
deleted file mode 100644
index 7fb083dec0..0000000000
--- a/Nt32Pkg/StallPei/StallPei.inf
+++ /dev/null
@@ -1,43 +0,0 @@
-## @file
-# EFI_PEI_STALL implementation for NT32 simulation environment.
-#
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = Stall
- FILE_GUID = 6807217E-E8DE-42d0-91D9-60AECED7420D
- MODULE_TYPE = PEIM
- VERSION_STRING = 1.0
-
- ENTRY_POINT = InitializeStall
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- Stall.c
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- PeimEntryPoint
- DebugLib
-
-[Ppis]
- gEfiPeiStallPpiGuid ## PRODUCES
- gPeiNtThunkPpiGuid ## CONSUMES
-
-[Depex]
- TRUE
-
diff --git a/Nt32Pkg/TimerDxe/Timer.c b/Nt32Pkg/TimerDxe/Timer.c
deleted file mode 100644
index f3e1e32d08..0000000000
--- a/Nt32Pkg/TimerDxe/Timer.c
+++ /dev/null
@@ -1,601 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- Timer.c
-
-Abstract:
-
- NT Emulation Timer Architectural Protocol Driver as defined in DXE CIS
-
- This Timer module uses an NT Thread to simulate the timer-tick driven
- timer service. In the future, the Thread creation should possibly be
- abstracted by the CPU architectural protocol
-
-**/
-
-#include "Timer.h"
-
-//
-// Pointer to the CPU Architectural Protocol instance
-//
-EFI_CPU_ARCH_PROTOCOL *mCpu;
-
-//
-// The Timer Architectural Protocol that this driver produces
-//
-EFI_TIMER_ARCH_PROTOCOL mTimer = {
- WinNtTimerDriverRegisterHandler,
- WinNtTimerDriverSetTimerPeriod,
- WinNtTimerDriverGetTimerPeriod,
- WinNtTimerDriverGenerateSoftInterrupt
-};
-
-//
-// Define a global that we can use to shut down the NT timer thread when
-// the timer is canceled.
-//
-BOOLEAN mCancelTimerThread = FALSE;
-
-//
-// The notification function to call on every timer interrupt
-//
-EFI_TIMER_NOTIFY mTimerNotifyFunction = NULL;
-
-//
-// The current period of the timer interrupt
-//
-UINT64 mTimerPeriod;
-
-//
-// The thread handle for this driver
-//
-HANDLE mNtMainThreadHandle;
-
-//
-// The timer value from the last timer interrupt
-//
-UINT32 mNtLastTick;
-
-//
-// Critical section used to update varibles shared between the main thread and
-// the timer interrupt thread.
-//
-CRITICAL_SECTION mNtCriticalSection;
-
-//
-// Worker Functions
-//
-UINT mMMTimerThreadID = 0;
-
-VOID
-CALLBACK
-MMTimerThread (
- UINT wTimerID,
- UINT msg,
- DWORD dwUser,
- DWORD dw1,
- DWORD dw2
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- wTimerID - TODO: add argument description
- msg - TODO: add argument description
- dwUser - TODO: add argument description
- dw1 - TODO: add argument description
- dw2 - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- EFI_TPL OriginalTPL;
- UINT32 CurrentTick;
- UINT32 Delta;
- EFI_TIMER_NOTIFY CallbackFunction;
- BOOLEAN InterruptState;
-
- if (!mCancelTimerThread) {
-
- //
- // Suspend the main thread until we are done.
- // Enter the critical section before suspending
- // and leave the critical section after resuming
- // to avoid deadlock between main and timer thread.
- //
- gWinNt->EnterCriticalSection (&mNtCriticalSection);
- gWinNt->SuspendThread (mNtMainThreadHandle);
-
- //
- // If the timer thread is being canceled, then bail immediately.
- // We check again here because there's a small window of time from when
- // this thread was kicked off and when we suspended the main thread above.
- //
- if (mCancelTimerThread) {
- gWinNt->ResumeThread (mNtMainThreadHandle);
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
- gWinNt->timeKillEvent (wTimerID);
- mMMTimerThreadID = 0;
- return ;
- }
-
- mCpu->GetInterruptState (mCpu, &InterruptState);
- while (!InterruptState) {
- //
- // Resume the main thread
- //
- gWinNt->ResumeThread (mNtMainThreadHandle);
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
-
- //
- // Wait for interrupts to be enabled.
- //
- mCpu->GetInterruptState (mCpu, &InterruptState);
- while (!InterruptState) {
- gWinNt->Sleep (1);
- mCpu->GetInterruptState (mCpu, &InterruptState);
- }
-
- //
- // Suspend the main thread until we are done
- //
- gWinNt->EnterCriticalSection (&mNtCriticalSection);
- gWinNt->SuspendThread (mNtMainThreadHandle);
- mCpu->GetInterruptState (mCpu, &InterruptState);
- }
-
- //
- // Get the current system tick
- //
- CurrentTick = gWinNt->GetTickCount ();
- Delta = CurrentTick - mNtLastTick;
- mNtLastTick = CurrentTick;
-
- //
- // If delay was more then 1 second, ignore it (probably debugging case)
- //
- if (Delta < 1000) {
-
- OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
-
- //
- // Inform the firmware of an "timer interrupt". The time
- // expired since the last call is 10,000 times the number
- // of ms. (or 100ns units)
- //
- CallbackFunction = mTimerNotifyFunction;
-
- //
- // Only invoke the callback function if a Non-NULL handler has been
- // registered. Assume all other handlers are legal.
- //
- if (CallbackFunction != NULL) {
- CallbackFunction ((UINT64) (Delta * 10000));
- }
-
- gBS->RestoreTPL (OriginalTPL);
-
- }
-
- //
- // Resume the main thread
- //
- gWinNt->ResumeThread (mNtMainThreadHandle);
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
- } else {
- gWinNt->timeKillEvent (wTimerID);
- mMMTimerThreadID = 0;
- }
-
-}
-
-UINT
-CreateNtTimer (
- VOID
- )
-/*++
-
-Routine Description:
-
- It is used to emulate a platform
- timer-driver interrupt handler.
-
-Returns:
-
- Timer ID
-
---*/
-// TODO: function comment is missing 'Arguments:'
-{
- UINT32 SleepCount;
-
- //
- // Set our thread priority higher than the "main" thread.
- //
- gWinNt->SetThreadPriority (
- gWinNt->GetCurrentThread (),
- THREAD_PRIORITY_HIGHEST
- );
-
- //
- // Calc the appropriate interval
- //
- gWinNt->EnterCriticalSection (&mNtCriticalSection);
- SleepCount = (UINT32) (mTimerPeriod + 5000) / 10000;
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
-
- return gWinNt->timeSetEvent (
- SleepCount,
- 0,
- MMTimerThread,
- (DWORD_PTR) NULL,
- TIME_PERIODIC | TIME_KILL_SYNCHRONOUS | TIME_CALLBACK_FUNCTION
- );
-
-}
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverRegisterHandler (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- IN EFI_TIMER_NOTIFY NotifyFunction
- )
-/*++
-
-Routine Description:
-
- This function registers the handler NotifyFunction so it is called every time
- the timer interrupt fires. It also passes the amount of time since the last
- handler call to the NotifyFunction. If NotifyFunction is NULL, then the
- handler is unregistered. If the handler is registered, then EFI_SUCCESS is
- returned. If the CPU does not support registering a timer interrupt handler,
- then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler
- when a handler is already registered, then EFI_ALREADY_STARTED is returned.
- If an attempt is made to unregister a handler when a handler is not registered,
- then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to
- register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR
- is returned.
-
-Arguments:
-
- This - The EFI_TIMER_ARCH_PROTOCOL instance.
-
- NotifyFunction - The function to call when a timer interrupt fires. This
- function executes at TPL_HIGH_LEVEL. The DXE Core will
- register a handler for the timer interrupt, so it can know
- how much time has passed. This information is used to
- signal timer based events. NULL will unregister the handler.
-
-Returns:
-
- EFI_SUCCESS - The timer handler was registered.
-
- EFI_UNSUPPORTED - The platform does not support timer interrupts.
-
- EFI_ALREADY_STARTED - NotifyFunction is not NULL, and a handler is already
- registered.
-
- EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not
- previously registered.
-
- EFI_DEVICE_ERROR - The timer handler could not be registered.
-
---*/
-{
- //
- // Check for invalid parameters
- //
- if (NotifyFunction == NULL && mTimerNotifyFunction == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (NotifyFunction != NULL && mTimerNotifyFunction != NULL) {
- return EFI_ALREADY_STARTED;
- }
-
- //
- // Use Critical Section to update the notification function that is
- // used from the timer interrupt thread.
- //
- gWinNt->EnterCriticalSection (&mNtCriticalSection);
-
- mTimerNotifyFunction = NotifyFunction;
-
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverSetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- IN UINT64 TimerPeriod
- )
-/*++
-
-Routine Description:
-
- This function adjusts the period of timer interrupts to the value specified
- by TimerPeriod. If the timer period is updated, then the selected timer
- period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If
- the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.
- If an error occurs while attempting to update the timer period, then the
- timer hardware will be put back in its state prior to this call, and
- EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt
- is disabled. This is not the same as disabling the CPU's interrupts.
- Instead, it must either turn off the timer hardware, or it must adjust the
- interrupt controller so that a CPU interrupt is not generated when the timer
- interrupt fires.
-
-Arguments:
-
- This - The EFI_TIMER_ARCH_PROTOCOL instance.
-
- TimerPeriod - The rate to program the timer interrupt in 100 nS units. If
- the timer hardware is not programmable, then EFI_UNSUPPORTED is
- returned. If the timer is programmable, then the timer period
- will be rounded up to the nearest timer period that is supported
- by the timer hardware. If TimerPeriod is set to 0, then the
- timer interrupts will be disabled.
-
-Returns:
-
- EFI_SUCCESS - The timer period was changed.
-
- EFI_UNSUPPORTED - The platform cannot change the period of the timer interrupt.
-
- EFI_DEVICE_ERROR - The timer period could not be changed due to a device error.
-
---*/
-{
-
- //
- // If TimerPeriod is 0, then the timer thread should be canceled
- //
- if (TimerPeriod == 0) {
- //
- // Cancel the timer thread
- //
- gWinNt->EnterCriticalSection (&mNtCriticalSection);
-
- mCancelTimerThread = TRUE;
-
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
-
- //
- // Wait for the timer thread to exit
- //
-
- if (mMMTimerThreadID) {
- gWinNt->timeKillEvent (mMMTimerThreadID);
- }
-
- mMMTimerThreadID = 0;
-
- //
- // Update the timer period
- //
- gWinNt->EnterCriticalSection (&mNtCriticalSection);
-
- mTimerPeriod = TimerPeriod;
-
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
-
- //
- // NULL out the thread handle so it will be re-created if the timer is enabled again
- //
-
- } else if ((TimerPeriod > TIMER_MINIMUM_VALUE) && (TimerPeriod < TIMER_MAXIMUM_VALUE)) {
- //
- // If the TimerPeriod is valid, then create and/or adjust the period of the timer thread
- //
- gWinNt->EnterCriticalSection (&mNtCriticalSection);
-
- mTimerPeriod = TimerPeriod;
-
- mCancelTimerThread = FALSE;
-
- gWinNt->LeaveCriticalSection (&mNtCriticalSection);
-
- //
- // Get the starting tick location if we are just starting the timer thread
- //
- mNtLastTick = gWinNt->GetTickCount ();
-
- if (mMMTimerThreadID) {
- gWinNt->timeKillEvent (mMMTimerThreadID);
- }
-
- mMMTimerThreadID = 0;
-
- mMMTimerThreadID = CreateNtTimer ();
-
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverGetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- OUT UINT64 *TimerPeriod
- )
-/*++
-
-Routine Description:
-
- This function retrieves the period of timer interrupts in 100 ns units,
- returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod
- is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is
- returned, then the timer is currently disabled.
-
-Arguments:
-
- This - The EFI_TIMER_ARCH_PROTOCOL instance.
-
- TimerPeriod - A pointer to the timer period to retrieve in 100 ns units. If
- 0 is returned, then the timer is currently disabled.
-
-Returns:
-
- EFI_SUCCESS - The timer period was returned in TimerPeriod.
-
- EFI_INVALID_PARAMETER - TimerPeriod is NULL.
-
---*/
-{
- if (TimerPeriod == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- *TimerPeriod = mTimerPeriod;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverGenerateSoftInterrupt (
- IN EFI_TIMER_ARCH_PROTOCOL *This
- )
-/*++
-
-Routine Description:
-
- This function generates a soft timer interrupt. If the platform does not support soft
- timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.
- If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()
- service, then a soft timer interrupt will be generated. If the timer interrupt is
- enabled when this service is called, then the registered handler will be invoked. The
- registered handler should not be able to distinguish a hardware-generated timer
- interrupt from a software-generated timer interrupt.
-
-Arguments:
-
- This - The EFI_TIMER_ARCH_PROTOCOL instance.
-
-Returns:
-
- EFI_SUCCESS - The soft timer interrupt was generated.
-
- EFI_UNSUPPORTED - The platform does not support the generation of soft timer interrupts.
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
-
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Initialize the Timer Architectural Protocol driver
-
-Arguments:
-
- ImageHandle - ImageHandle of the loaded driver
-
- SystemTable - Pointer to the System Table
-
-Returns:
-
- EFI_SUCCESS - Timer Architectural Protocol created
-
- EFI_OUT_OF_RESOURCES - Not enough resources available to initialize driver.
-
- EFI_DEVICE_ERROR - A device error occured attempting to initialize the driver.
-
---*/
-{
- EFI_STATUS Status;
- UINTN Result;
- EFI_HANDLE Handle;
- EFI_HANDLE hSourceProcessHandle;
- EFI_HANDLE hSourceHandle;
- EFI_HANDLE hTargetProcessHandle;
- //
- // Make sure the Timer Architectural Protocol is not already installed in the system
- //
- ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiTimerArchProtocolGuid);
-
- //
- // Get the CPU Architectural Protocol instance
- //
- Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID**)&mCpu);
- ASSERT_EFI_ERROR (Status);
-
- //
- // Get our handle so the timer tick thread can suspend
- //
- hSourceProcessHandle = gWinNt->GetCurrentProcess ();
- hSourceHandle = gWinNt->GetCurrentThread ();
- hTargetProcessHandle = gWinNt->GetCurrentProcess ();
- Result = gWinNt->DuplicateHandle (
- hSourceProcessHandle,
- hSourceHandle,
- hTargetProcessHandle,
- &mNtMainThreadHandle,
- 0,
- FALSE,
- DUPLICATE_SAME_ACCESS
- );
- if (Result == 0) {
- return EFI_DEVICE_ERROR;
- }
-
- //
- // Initialize Critical Section used to update variables shared between the main
- // thread and the timer interrupt thread.
- //
- gWinNt->InitializeCriticalSection (&mNtCriticalSection);
-
- //
- // Start the timer thread at the default timer period
- //
- Status = mTimer.SetTimerPeriod (&mTimer, DEFAULT_TIMER_TICK_DURATION);
- if (EFI_ERROR (Status)) {
- gWinNt->DeleteCriticalSection (&mNtCriticalSection);
- return Status;
- }
-
- //
- // Install the Timer Architectural Protocol onto a new handle
- //
- Handle = NULL;
- Status = gBS->InstallProtocolInterface (
- &Handle,
- &gEfiTimerArchProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &mTimer
- );
- if (EFI_ERROR (Status)) {
- //
- // Cancel the timer
- //
- mTimer.SetTimerPeriod (&mTimer, 0);
- gWinNt->DeleteCriticalSection (&mNtCriticalSection);
- return Status;
- }
-
- return EFI_SUCCESS;
-}
diff --git a/Nt32Pkg/TimerDxe/Timer.h b/Nt32Pkg/TimerDxe/Timer.h
deleted file mode 100644
index 71af11947d..0000000000
--- a/Nt32Pkg/TimerDxe/Timer.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- Timer.h
-
-Abstract:
-
- NT Emulation Architectural Protocol Driver as defined in Tiano.
- This Timer module uses an NT Thread to simulate the timer-tick driven
- timer service.
-
-**/
-
-#ifndef _TIMER_H_
-#define _TIMER_H_
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-//
-// Legal timer value range in 100 ns units
-//
-#define TIMER_MINIMUM_VALUE 0
-#define TIMER_MAXIMUM_VALUE (0x100000000 - 1)
-
-//
-// Default timer value in 100 ns units (10 ms)
-//
-#define DEFAULT_TIMER_TICK_DURATION 100000
-
-//
-// Function Prototypes
-//
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ImageHandle - TODO: add argument description
- SystemTable - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverRegisterHandler (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- IN EFI_TIMER_NOTIFY NotifyFunction
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- NotifyFunction - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverSetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- IN UINT64 TimerPeriod
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- TimerPeriod - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverGetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- OUT UINT64 *TimerPeriod
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- TimerPeriod - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-WinNtTimerDriverGenerateSoftInterrupt (
- IN EFI_TIMER_ARCH_PROTOCOL *This
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-#endif
diff --git a/Nt32Pkg/TimerDxe/TimerDxe.inf b/Nt32Pkg/TimerDxe/TimerDxe.inf
deleted file mode 100644
index 9c5aaa10e6..0000000000
--- a/Nt32Pkg/TimerDxe/TimerDxe.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-## @file
-# NT Emulation Timer Architectural Protocol Driver as defined in DXE CIS
-#
-# This Timer module uses an NT Thread to simulate the timer-tick driven
-# timer service. In the future, the Thread creation should possibly be
-# abstracted by the CPU architectural protocol
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = Timer
- FILE_GUID = C3811036-710B-4E39-8CF1-0AF9BE3A8198
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = WinNtTimerDriverInitialize
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- Timer.c
- Timer.h
-
-[Packages]
- MdePkg/MdePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-[LibraryClasses]
- UefiBootServicesTableLib
- WinNtLib
- UefiDriverEntryPoint
- DebugLib
-
-[Protocols]
- gEfiCpuArchProtocolGuid # PROTOCOL ALWAYS_CONSUMED
- gEfiTimerArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
-
-[Depex]
- gEfiCpuArchProtocolGuid
-
\ No newline at end of file
diff --git a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c
deleted file mode 100644
index cd3777ab2b..0000000000
--- a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScan.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
- WinNtAutoscan.c
-
-Abstract:
- This PEIM to abstract memory auto-scan in a Windows NT environment.
-
-Revision History
-
-**/
-
-//
-// The package level header files this module uses
-//
-#include
-#include
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include
-#include
-
-#include
-
-//
-// The Library classes this module consumes
-//
-#include
-#include
-#include
-#include
-
-EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
- { EfiReservedMemoryType, 0x0004 },
- { EfiRuntimeServicesCode, 0x0040 },
- { EfiRuntimeServicesData, 0x0040 },
- { EfiBootServicesCode, 0x0300 },
- { EfiBootServicesData, 0x1000 },
- { EfiMaxMemoryType, 0 }
-};
-
-/**
- Validate variable data for the MemoryTypeInformation.
-
- @param MemoryData Variable data.
- @param MemoryDataSize Variable data length.
-
- @return TRUE The variable data is valid.
- @return FALSE The variable data is invalid.
-
-**/
-BOOLEAN
-ValidateMemoryTypeInfoVariable (
- IN EFI_MEMORY_TYPE_INFORMATION *MemoryData,
- IN UINTN MemoryDataSize
- )
-{
- UINTN Count;
- UINTN Index;
-
- // Check the input parameter.
- if (MemoryData == NULL) {
- return FALSE;
- }
-
- // Get Count
- Count = MemoryDataSize / sizeof (*MemoryData);
-
- // Check Size
- if (Count * sizeof(*MemoryData) != MemoryDataSize) {
- return FALSE;
- }
-
- // Check last entry type filed.
- if (MemoryData[Count - 1].Type != EfiMaxMemoryType) {
- return FALSE;
- }
-
- // Check the type filed.
- for (Index = 0; Index < Count - 1; Index++) {
- if (MemoryData[Index].Type >= EfiMaxMemoryType) {
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-EFI_STATUS
-EFIAPI
-PeimInitializeWinNtAutoScan (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
- Perform a call-back into the SEC simulator to get a memory value
-
-Arguments:
- FfsHeader - General purpose data available to every PEIM
- PeiServices - General purpose services available to every PEIM.
-
-Returns:
- None
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
- PEI_NT_AUTOSCAN_PPI *PeiNtService;
- UINT64 MemorySize;
- EFI_PHYSICAL_ADDRESS MemoryBase;
- UINTN Index;
- EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;
- EFI_PEI_READ_ONLY_VARIABLE2_PPI *Variable;
- UINTN DataSize;
- EFI_MEMORY_TYPE_INFORMATION MemoryData [EfiMaxMemoryType + 1];
-
-
- DEBUG ((EFI_D_ERROR, "NT 32 Autoscan PEIM Loaded\n"));
-
- //
- // Get the PEI NT Autoscan PPI
- //
- Status = PeiServicesLocatePpi (
- &gPeiNtAutoScanPpiGuid, // GUID
- 0, // INSTANCE
- &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
- (VOID**)&PeiNtService // PPI
- );
- ASSERT_EFI_ERROR (Status);
-
- Index = 0;
- do {
- Status = PeiNtService->NtAutoScan (Index, &MemoryBase, &MemorySize);
- if (!EFI_ERROR (Status)) {
- Attributes =
- (
- EFI_RESOURCE_ATTRIBUTE_PRESENT |
- EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
- EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
- );
-
- if (Index == 0) {
- //
- // Register the memory with the PEI Core
- //
- Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize);
- ASSERT_EFI_ERROR (Status);
-
- Attributes |= EFI_RESOURCE_ATTRIBUTE_TESTED;
- }
-
- BuildResourceDescriptorHob (
- EFI_RESOURCE_SYSTEM_MEMORY,
- Attributes,
- MemoryBase,
- MemorySize
- );
- }
- Index++;
- } while (!EFI_ERROR (Status));
-
- //
- // Build the CPU hob with 52-bit addressing and 16-bits of IO space.
- //
- BuildCpuHob (52, 16);
-
- //
- // Build GUIDed Hob that contains the Memory Type Information array
- //
- Status = PeiServicesLocatePpi (
- &gEfiPeiReadOnlyVariable2PpiGuid,
- 0,
- NULL,
- (VOID **)&Variable
- );
- ASSERT_EFI_ERROR (Status);
-
- DataSize = sizeof (MemoryData);
- Status = Variable->GetVariable (
- Variable,
- EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
- &gEfiMemoryTypeInformationGuid,
- NULL,
- &DataSize,
- &MemoryData
- );
- if (EFI_ERROR (Status) || !ValidateMemoryTypeInfoVariable(MemoryData, DataSize)) {
- //
- // Create Memory Type Information HOB
- //
- BuildGuidDataHob (
- &gEfiMemoryTypeInformationGuid,
- mDefaultMemoryTypeInformation,
- sizeof(mDefaultMemoryTypeInformation)
- );
- } else {
- //
- // Create Memory Type Information HOB
- //
- BuildGuidDataHob (
- &gEfiMemoryTypeInformationGuid,
- MemoryData,
- DataSize
- );
- }
-
- return Status;
-}
diff --git a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf b/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf
deleted file mode 100644
index 30d67c038d..0000000000
--- a/Nt32Pkg/WinNtAutoScanPei/WinNtAutoScanPei.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-## @file
-# Component description file for WinNtAutoScan module
-#
-# This module abstracts memory auto-scan in a Windows NT environment.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = WinNtAutoScan
- FILE_GUID = BE0FEABA-3443-4919-9F3A-2D4216329EA9
- MODULE_TYPE = PEIM
- VERSION_STRING = 1.0
-
- ENTRY_POINT = PeimInitializeWinNtAutoScan
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32
-#
-
-[Sources]
- WinNtAutoScan.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- Nt32Pkg/Nt32Pkg.dec
-
-
-[LibraryClasses]
- HobLib
- PeimEntryPoint
- DebugLib
- PeiServicesLib
-
-[Ppis]
- gPeiNtAutoScanPpiGuid # PPI ALWAYS_CONSUMED
- gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED
-
-[Guids]
- gEfiMemoryTypeInformationGuid
-
-[Depex]
- gPeiNtAutoScanPpiGuid AND gEfiPeiMasterBootModePpiGuid AND gEfiPeiReadOnlyVariable2PpiGuid
diff --git a/Nt32Pkg/WinNtBlockIoDxe/ComponentName.c b/Nt32Pkg/WinNtBlockIoDxe/ComponentName.c
deleted file mode 100644
index 5c28e328c5..0000000000
--- a/Nt32Pkg/WinNtBlockIoDxe/ComponentName.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- ComponentName.c
-
-Abstract:
-
-**/
-#include
-#include
-#include
-#include
-
-#include "WinNtBlockIo.h"
-
-//
-// EFI Component Name Functions
-//
-/**
- Retrieves a Unicode string that is the user readable name of the driver.
-
- This function retrieves the user readable name of a driver in the form of a
- Unicode string. If the driver specified by This has a user readable name in
- the language specified by Language, then a pointer to the driver name is
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
- by This does not support the language specified by Language,
- then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified
- in RFC 4646 or ISO 639-2 language code format.
-
- @param DriverName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by
- This and the language specified by Language was
- returned in DriverName.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-WinNtBlockIoComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- );
-
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by a driver.
-
- This function retrieves the user readable name of the controller specified by
- ControllerHandle and ChildHandle in the form of a Unicode string. If the
- driver specified by This has a user readable name in the language specified by
- Language, then a pointer to the controller name is returned in ControllerName,
- and EFI_SUCCESS is returned. If the driver specified by This is not currently
- managing the controller specified by ControllerHandle and ChildHandle,
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not
- support the language specified by Language, then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param ControllerHandle[in] The handle of a controller that the driver
- specified by This is managing. This handle
- specifies the controller whose name is to be
- returned.
-
- @param ChildHandle[in] The handle of the child controller to retrieve
- the name of. This is an optional parameter that
- may be NULL. It will be NULL for device
- drivers. It will also be NULL for a bus drivers
- that wish to retrieve the name of the bus
- controller. It will not be NULL for a bus
- driver that wishes to retrieve the name of a
- child controller.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified in
- RFC 4646 or ISO 639-2 language code format.
-
- @param ControllerName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- controller specified by ControllerHandle and
- ChildHandle in the language specified by
- Language from the point of view of the driver
- specified by This.
-
- @retval EFI_SUCCESS The Unicode string for the user readable name in
- the language specified by Language for the
- driver specified by This was returned in
- DriverName.
-
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
- EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This is not currently
- managing the controller specified by
- ControllerHandle and ChildHandle.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-WinNtBlockIoComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- );
-
-
-//
-// EFI Component Name Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gWinNtBlockIoComponentName = {
- WinNtBlockIoComponentNameGetDriverName,
- WinNtBlockIoComponentNameGetControllerName,
- "eng"
-};
-
-//
-// EFI Component Name 2 Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gWinNtBlockIoComponentName2 = {
- (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) WinNtBlockIoComponentNameGetDriverName,
- (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) WinNtBlockIoComponentNameGetControllerName,
- "en"
-};
-
-
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mWinNtBlockIoDriverNameTable[] = {
- { "eng;en", L"Windows Block I/O Driver" },
- { NULL , NULL }
-};
-
-/**
- Retrieves a Unicode string that is the user readable name of the driver.
-
- This function retrieves the user readable name of a driver in the form of a
- Unicode string. If the driver specified by This has a user readable name in
- the language specified by Language, then a pointer to the driver name is
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
- by This does not support the language specified by Language,
- then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified
- in RFC 4646 or ISO 639-2 language code format.
-
- @param DriverName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by
- This and the language specified by Language was
- returned in DriverName.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-WinNtBlockIoComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- )
-{
- return LookupUnicodeString2 (
- Language,
- This->SupportedLanguages,
- mWinNtBlockIoDriverNameTable,
- DriverName,
- (BOOLEAN)(This == &gWinNtBlockIoComponentName)
- );
-}
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by a driver.
-
- This function retrieves the user readable name of the controller specified by
- ControllerHandle and ChildHandle in the form of a Unicode string. If the
- driver specified by This has a user readable name in the language specified by
- Language, then a pointer to the controller name is returned in ControllerName,
- and EFI_SUCCESS is returned. If the driver specified by This is not currently
- managing the controller specified by ControllerHandle and ChildHandle,
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not
- support the language specified by Language, then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param ControllerHandle[in] The handle of a controller that the driver
- specified by This is managing. This handle
- specifies the controller whose name is to be
- returned.
-
- @param ChildHandle[in] The handle of the child controller to retrieve
- the name of. This is an optional parameter that
- may be NULL. It will be NULL for device
- drivers. It will also be NULL for a bus drivers
- that wish to retrieve the name of the bus
- controller. It will not be NULL for a bus
- driver that wishes to retrieve the name of a
- child controller.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified in
- RFC 4646 or ISO 639-2 language code format.
-
- @param ControllerName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- controller specified by ControllerHandle and
- ChildHandle in the language specified by
- Language from the point of view of the driver
- specified by This.
-
- @retval EFI_SUCCESS The Unicode string for the user readable name in
- the language specified by Language for the
- driver specified by This was returned in
- DriverName.
-
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
- EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This is not currently
- managing the controller specified by
- ControllerHandle and ChildHandle.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-WinNtBlockIoComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- )
-{
- EFI_STATUS Status;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- WIN_NT_BLOCK_IO_PRIVATE *Private;
-
- //
- // This is a device driver, so ChildHandle must be NULL.
- //
- if (ChildHandle != NULL) {
- return EFI_UNSUPPORTED;
- }
- //
- // Make sure this driver is currently managing ControllerHandle
- //
- Status = EfiTestManagedDevice (
- ControllerHandle,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- &gEfiWinNtIoProtocolGuid
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- //
- // Get our context back
- //
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiBlockIoProtocolGuid,
- (VOID **) &BlockIo,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- Private = WIN_NT_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);
-
- return LookupUnicodeString2 (
- Language,
- This->SupportedLanguages,
- Private->ControllerNameTable,
- ControllerName,
- (BOOLEAN)(This == &gWinNtBlockIoComponentName)
- );
-}
diff --git a/Nt32Pkg/WinNtBlockIoDxe/DriverConfiguration.c b/Nt32Pkg/WinNtBlockIoDxe/DriverConfiguration.c
deleted file mode 100644
index 8969e5e198..0000000000
--- a/Nt32Pkg/WinNtBlockIoDxe/DriverConfiguration.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/**@file
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- DriverConfiguration.c
-
-Abstract:
-
-**/
-#include
-#include
-#include
-#include
-#include
-
-#include "WinNtBlockIo.h"
-
-//
-// EFI Driver Configuration Functions
-//
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverConfigurationSetOptions (
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
- );
-
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverConfigurationOptionsValid (
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL
- );
-
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverConfigurationForceDefaults (
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN UINT32 DefaultType,
- OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
- );
-
-//
-// EFI Driver Configuration Protocol
-//
-EFI_DRIVER_CONFIGURATION_PROTOCOL gWinNtBlockIoDriverConfiguration = {
- WinNtBlockIoDriverConfigurationSetOptions,
- WinNtBlockIoDriverConfigurationOptionsValid,
- WinNtBlockIoDriverConfigurationForceDefaults,
- LANGUAGESUPPORTED
-};
-
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverConfigurationSetOptions (
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
- )
-/*++
-
- Routine Description:
- Allows the user to set controller specific options for a controller that a
- driver is currently managing.
-
- Arguments:
- This - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
- ControllerHandle - The handle of the controller to set options on.
- ChildHandle - The handle of the child controller to set options on. This
- is an optional parameter that may be NULL. It will be NULL
- for device drivers, and for a bus drivers that wish to set
- options for the bus controller. It will not be NULL for a
- bus driver that wishes to set options for one of its child
- controllers.
- Language - A pointer to a three character ISO 639-2 language identifier.
- This is the language of the user interface that should be
- presented to the user, and it must match one of the languages
- specified in SupportedLanguages. The number of languages
- supported by a driver is up to the driver writer.
- ActionRequired - A pointer to the action that the calling agent is required
- to perform when this function returns. See "Related
- Definitions" for a list of the actions that the calling
- agent is required to perform prior to accessing
- ControllerHandle again.
-
- Returns:
- EFI_SUCCESS - The driver specified by This successfully set the
- configuration options for the controller specified
- by ControllerHandle..
- EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ActionRequired is NULL.
- EFI_UNSUPPORTED - The driver specified by This does not support setting
- configuration options for the controller specified by
- ControllerHandle and ChildHandle.
- EFI_UNSUPPORTED - The driver specified by This does not support the
- language specified by Language.
- EFI_DEVICE_ERROR - A device error occurred while attempt to set the
- configuration options for the controller specified
- by ControllerHandle and ChildHandle.
- EFI_OUT_RESOURCES - There are not enough resources available to set the
- configuration options for the controller specified
- by ControllerHandle and ChildHandle.
-
---*/
-{
- EFI_STATUS Status;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- CHAR8 *SupportedLanguage;
-
- SupportedLanguage = This->SupportedLanguages;
-
- Status = EFI_UNSUPPORTED;
- while (*SupportedLanguage != 0) {
- if (AsciiStrnCmp (Language, SupportedLanguage, 3) == 0) {
- Status = EFI_SUCCESS;
- }
-
- SupportedLanguage += 3;
- }
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (ActionRequired == NULL || ControllerHandle == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (ChildHandle != NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Validate controller handle
- //
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- (VOID **) &BlockIo,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle
- );
-
- return EFI_UNSUPPORTED;
- }
-
- if (Status == EFI_UNSUPPORTED) {
- return Status;
- } else if (Status != EFI_ALREADY_STARTED) {
- return EFI_INVALID_PARAMETER;
- }
-
- *ActionRequired = EfiDriverConfigurationActionNone;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverConfigurationOptionsValid (
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL
- )
-/*++
-
- Routine Description:
- Tests to see if a controller's current configuration options are valid.
-
- Arguments:
- This - A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
- ControllerHandle - The handle of the controller to test if it's current
- configuration options are valid.
- ChildHandle - The handle of the child controller to test if it's current
- configuration options are valid. This is an optional
- parameter that may be NULL. It will be NULL for device
- drivers. It will also be NULL for a bus drivers that wish
- to test the configuration options for the bus controller.
- It will not be NULL for a bus driver that wishes to test
- configuration options for one of its child controllers.
-
- Returns:
- EFI_SUCCESS - The controller specified by ControllerHandle and
- ChildHandle that is being managed by the driver
- specified by This has a valid set of configuration
- options.
- EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
- EFI_UNSUPPORTED - The driver specified by This is not currently
- managing the controller specified by ControllerHandle
- and ChildHandle.
- EFI_DEVICE_ERROR - The controller specified by ControllerHandle and
- ChildHandle that is being managed by the driver
- specified by This has an invalid set of configuration
- options.
-
---*/
-{
- EFI_STATUS Status;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
-
- if (ChildHandle != NULL) {
- return EFI_UNSUPPORTED;
- }
-
- if (ControllerHandle == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Validate controller handle
- //
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- (VOID **) &BlockIo,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle
- );
-
- return EFI_UNSUPPORTED;
- }
-
- if (Status == EFI_UNSUPPORTED) {
- return Status;
- } else if (Status != EFI_ALREADY_STARTED) {
- return EFI_INVALID_PARAMETER;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverConfigurationForceDefaults (
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN UINT32 DefaultType,
- OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
- )
-/*++
-
- Routine Description:
- Forces a driver to set the default configuration options for a controller.
-
- Arguments:
- This - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
- ControllerHandle - The handle of the controller to force default configuration options on.
- ChildHandle - The handle of the child controller to force default configuration options on This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to force default configuration options for the bus controller. It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.
- DefaultType - The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle. See Table 9-1 for legal values. A DefaultType of 0x00000000 must be supported by this protocol.
- ActionRequired - A pointer to the action that the calling agent is required to perform when this function returns. See "Related Definitions" in Section 9.1for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.
-
- Returns:
- EFI_SUCCESS - The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
- EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ActionRequired is NULL.
- EFI_UNSUPPORTED - The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
- EFI_UNSUPPORTED - The driver specified by This does not support the configuration type specified by DefaultType.
- EFI_DEVICE_ERROR - A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
- EFI_OUT_RESOURCES - There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
-
---*/
-{
- EFI_STATUS Status;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
-
- if (ChildHandle != NULL) {
- return EFI_UNSUPPORTED;
- }
-
- if (ActionRequired == NULL || ControllerHandle == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Validate controller handle
- //
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- (VOID **) &BlockIo,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle
- );
-
- return EFI_UNSUPPORTED;
- }
-
- if (Status == EFI_UNSUPPORTED) {
- return Status;
- } else if (Status != EFI_ALREADY_STARTED) {
- return EFI_INVALID_PARAMETER;
- }
-
- *ActionRequired = EfiDriverConfigurationActionNone;
- return EFI_SUCCESS;
-}
diff --git a/Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c b/Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c
deleted file mode 100644
index aebb744400..0000000000
--- a/Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-Module Name:
-
- DriverDiagnostics.c
-
-Abstract:
-
-**/
-#include
-#include
-#include
-#include
-#include
-
-#include "WinNtBlockIo.h"
-
-//
-// EFI Driver Diagnostics Functions
-//
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverDiagnosticsRunDiagnostics (
- IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
- IN CHAR8 *Language,
- OUT EFI_GUID **ErrorType,
- OUT UINTN *BufferSize,
- OUT CHAR16 **Buffer
- );
-
-//
-// EFI Driver Diagnostics Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS_PROTOCOL gWinNtBlockIoDriverDiagnostics = {
- WinNtBlockIoDriverDiagnosticsRunDiagnostics,
- "eng"
-};
-
-//
-// EFI Driver Diagnostics 2 Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gWinNtBlockIoDriverDiagnostics2 = {
- (EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS) WinNtBlockIoDriverDiagnosticsRunDiagnostics,
- "en"
-};
-
-EFI_STATUS
-EFIAPI
-WinNtBlockIoDriverDiagnosticsRunDiagnostics (
- IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
- IN CHAR8 *Language,
- OUT EFI_GUID **ErrorType,
- OUT UINTN *BufferSize,
- OUT CHAR16 **Buffer
- )
-/*++
-
- Routine Description:
- Runs diagnostics on a controller.
-
- Arguments:
- This - A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
- ControllerHandle - The handle of the controller to run diagnostics on.
- ChildHandle - The handle of the child controller to run diagnostics on
- This is an optional parameter that may be NULL. It will
- be NULL for device drivers. It will also be NULL for a
- bus drivers that wish to run diagnostics on the bus
- controller. It will not be NULL for a bus driver that
- wishes to run diagnostics on one of its child controllers.
- DiagnosticType - Indicates type of diagnostics to perform on the controller
- specified by ControllerHandle and ChildHandle. See
- "Related Definitions" for the list of supported types.
- Language - A pointer to a three character ISO 639-2 language
- identifier or a Null-terminated ASCII string array indicating
- the language. This is the language in which the optional
- error message should be returned in Buffer, and it must
- match one of the languages specified in SupportedLanguages.
- The number of languages supported by a driver is up to
- the driver writer.
- ErrorType - A GUID that defines the format of the data returned in
- Buffer.
- BufferSize - The size, in bytes, of the data returned in Buffer.
- Buffer - A buffer that contains a Null-terminated Unicode string
- plus some additional data whose format is defined by
- ErrorType. Buffer is allocated by this function with
- AllocatePool(), and it is the caller's responsibility
- to free it with a call to FreePool().
-
- Returns:
- EFI_SUCCESS - The controller specified by ControllerHandle and
- ChildHandle passed the diagnostic.
- EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
- EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
- EFI_HANDLE.
- EFI_INVALID_PARAMETER - Language is NULL.
- EFI_INVALID_PARAMETER - ErrorType is NULL.
- EFI_INVALID_PARAMETER - BufferType is NULL.
- EFI_INVALID_PARAMETER - Buffer is NULL.
- EFI_UNSUPPORTED - The driver specified by This does not support
- running diagnostics for the controller specified
- by ControllerHandle and ChildHandle.
- EFI_UNSUPPORTED - The driver specified by This does not support the
- type of diagnostic specified by DiagnosticType.
- EFI_UNSUPPORTED - The driver specified by This does not support the
- language specified by Language.
- EFI_OUT_OF_RESOURCES - There are not enough resources available to complete
- the diagnostics.
- EFI_OUT_OF_RESOURCES - There are not enough resources available to return
- the status information in ErrorType, BufferSize,
- and Buffer.
- EFI_DEVICE_ERROR - The controller specified by ControllerHandle and
- ChildHandle did not pass the diagnostic.
-
---*/
-{
- EFI_STATUS Status;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- CHAR8 *SupportedLanguages;
- BOOLEAN Iso639Language;
- BOOLEAN Found;
- UINTN Index;
-
- if (Language == NULL ||
- ErrorType == NULL ||
- Buffer == NULL ||
- ControllerHandle == NULL ||
- BufferSize == NULL) {
-
- return EFI_INVALID_PARAMETER;
- }
-
- SupportedLanguages = This->SupportedLanguages;
- Iso639Language = (BOOLEAN)(This == &gWinNtBlockIoDriverDiagnostics);
- //
- // Make sure Language is in the set of Supported Languages
- //
- Found = FALSE;
- while (*SupportedLanguages != 0) {
- if (Iso639Language) {
- if (CompareMem (Language, SupportedLanguages, 3) == 0) {
- Found = TRUE;
- break;
- }
- SupportedLanguages += 3;
- } else {
- for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++);
- if ((AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) && (Language[Index] == 0)) {
- Found = TRUE;
- break;
- }
- SupportedLanguages += Index;
- for (; *SupportedLanguages != 0 && *SupportedLanguages == ';'; SupportedLanguages++);
- }
- }
- //
- // If Language is not a member of SupportedLanguages, then return EFI_UNSUPPORTED
- //
- if (!Found) {
- return EFI_UNSUPPORTED;
- }
-
- *ErrorType = NULL;
- *BufferSize = 0;
- if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {
- *ErrorType = &gEfiBlockIoProtocolGuid;
- *BufferSize = 0x60;
- *Buffer = AllocatePool ((UINTN) (*BufferSize));
- CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize);
- return EFI_DEVICE_ERROR;
- }
-
- //
- // This is a device driver, so ChildHandle must be NULL.
- //
- if (ChildHandle != NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Validate controller handle
- //
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- (VOID **) &BlockIo,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- ControllerHandle,
- &gEfiWinNtIoProtocolGuid,
- gWinNtBlockIoDriverBinding.DriverBindingHandle,
- ControllerHandle
- );
-
- return EFI_UNSUPPORTED;
- }
-
-
- if (Status == EFI_UNSUPPORTED) {
- return Status;
- } else if (Status != EFI_ALREADY_STARTED) {
- return EFI_INVALID_PARAMETER;
- }
-
- return EFI_SUCCESS;
-}
diff --git a/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c b/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c
deleted file mode 100644
index 3eb9bee79e..0000000000
--- a/Nt32Pkg/WinNtBlockIoDxe/WinNtBlockIo.c
+++ /dev/null
@@ -1,1125 +0,0 @@
-/**@file
-
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.