]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg)
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 29 Jul 2013 21:09:55 +0000 (21:09 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 29 Jul 2013 21:09:55 +0000 (21:09 +0000)
For now the UnixPkg/Deprecated.txt file is retained to indicate
that EmulatorPkg should be used instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14518 6f19259b-4bc3-4df7-8a09-765794883524

330 files changed:
UnixPkg/.gdbinit [deleted file]
UnixPkg/BootModePei/BootModePei.c [deleted file]
UnixPkg/BootModePei/BootModePei.inf [deleted file]
UnixPkg/Contributions.txt [deleted file]
UnixPkg/CpuRuntimeDxe/Cpu.c [deleted file]
UnixPkg/CpuRuntimeDxe/Cpu.inf [deleted file]
UnixPkg/CpuRuntimeDxe/CpuDriver.h [deleted file]
UnixPkg/CpuRuntimeDxe/CpuIo.c [deleted file]
UnixPkg/CpuRuntimeDxe/Strings.uni [deleted file]
UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c [deleted file]
UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c [deleted file]
UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h [deleted file]
UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf [deleted file]
UnixPkg/Include/Common/UnixInclude.h [deleted file]
UnixPkg/Include/FlashLayout.h [deleted file]
UnixPkg/Include/Guid/UnixSystemConfig.h [deleted file]
UnixPkg/Include/Library/SecDispatchTableLib.h [deleted file]
UnixPkg/Include/Library/UnixLib.h [deleted file]
UnixPkg/Include/Ppi/UnixAutoScan.h [deleted file]
UnixPkg/Include/Ppi/UnixFwh.h [deleted file]
UnixPkg/Include/Ppi/UnixPeiLoadFile.h [deleted file]
UnixPkg/Include/Ppi/UnixThunk.h [deleted file]
UnixPkg/Include/Protocol/UnixIo.h [deleted file]
UnixPkg/Include/Protocol/UnixThunk.h [deleted file]
UnixPkg/Include/Protocol/UnixUgaIo.h [deleted file]
UnixPkg/Include/UnixDxe.h [deleted file]
UnixPkg/Include/UnixPeim.h [deleted file]
UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf [deleted file]
UnixPkg/Library/DxeUnixLib/UnixLib.c [deleted file]
UnixPkg/Library/DxeUnixOemHookStatusCodeLib/DxeUnixOemHookStatusCodeLib.inf [deleted file]
UnixPkg/Library/DxeUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c [deleted file]
UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c [deleted file]
UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf [deleted file]
UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/EdkUnixPeiPeCoffGetEntryPointLib.inf [deleted file]
UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c [deleted file]
UnixPkg/Library/PeiUnixOemHookStatusCodeLib/PeiUnixOemHookStatusCodeLib.inf [deleted file]
UnixPkg/Library/PeiUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c [deleted file]
UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c [deleted file]
UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf [deleted file]
UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.c [deleted file]
UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.inf [deleted file]
UnixPkg/Library/UnixBaseLib/ARShiftU64.c [deleted file]
UnixPkg/Library/UnixBaseLib/BaseLibInternals.h [deleted file]
UnixPkg/Library/UnixBaseLib/BitField.c [deleted file]
UnixPkg/Library/UnixBaseLib/CheckSum.c [deleted file]
UnixPkg/Library/UnixBaseLib/ChkStkGcc.c [deleted file]
UnixPkg/Library/UnixBaseLib/Cpu.c [deleted file]
UnixPkg/Library/UnixBaseLib/CpuDeadLoop.c [deleted file]
UnixPkg/Library/UnixBaseLib/DivS64x64Remainder.c [deleted file]
UnixPkg/Library/UnixBaseLib/DivU64x32.c [deleted file]
UnixPkg/Library/UnixBaseLib/DivU64x32Remainder.c [deleted file]
UnixPkg/Library/UnixBaseLib/DivU64x64Remainder.c [deleted file]
UnixPkg/Library/UnixBaseLib/GetPowerOfTwo32.c [deleted file]
UnixPkg/Library/UnixBaseLib/GetPowerOfTwo64.c [deleted file]
UnixPkg/Library/UnixBaseLib/HighBitSet32.c [deleted file]
UnixPkg/Library/UnixBaseLib/HighBitSet64.c [deleted file]
UnixPkg/Library/UnixBaseLib/LRotU32.c [deleted file]
UnixPkg/Library/UnixBaseLib/LRotU64.c [deleted file]
UnixPkg/Library/UnixBaseLib/LShiftU64.c [deleted file]
UnixPkg/Library/UnixBaseLib/LinkedList.c [deleted file]
UnixPkg/Library/UnixBaseLib/LongJump.c [deleted file]
UnixPkg/Library/UnixBaseLib/LowBitSet32.c [deleted file]
UnixPkg/Library/UnixBaseLib/LowBitSet64.c [deleted file]
UnixPkg/Library/UnixBaseLib/Math64.c [deleted file]
UnixPkg/Library/UnixBaseLib/ModU64x32.c [deleted file]
UnixPkg/Library/UnixBaseLib/MultS64x64.c [deleted file]
UnixPkg/Library/UnixBaseLib/MultU64x32.c [deleted file]
UnixPkg/Library/UnixBaseLib/MultU64x64.c [deleted file]
UnixPkg/Library/UnixBaseLib/RRotU32.c [deleted file]
UnixPkg/Library/UnixBaseLib/RRotU64.c [deleted file]
UnixPkg/Library/UnixBaseLib/RShiftU64.c [deleted file]
UnixPkg/Library/UnixBaseLib/SetJump.c [deleted file]
UnixPkg/Library/UnixBaseLib/String.c [deleted file]
UnixPkg/Library/UnixBaseLib/SwapBytes16.c [deleted file]
UnixPkg/Library/UnixBaseLib/SwapBytes32.c [deleted file]
UnixPkg/Library/UnixBaseLib/SwapBytes64.c [deleted file]
UnixPkg/Library/UnixBaseLib/SwitchStack.c [deleted file]
UnixPkg/Library/UnixBaseLib/Unaligned.c [deleted file]
UnixPkg/Library/UnixBaseLib/UnixBaseLib.inf [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.c [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuId.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuId.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuIdEx.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuIdEx.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/CpuPause.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/DisableCache.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/DisableCache.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/DisableInterrupts.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/DisablePaging64.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/DisablePaging64.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/EnableCache.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/EnableCache.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/EnableDisableInterrupts.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/EnableDisableInterrupts.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/EnableInterrupts.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/FlushCacheLine.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/FxRestore.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/FxSave.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/GccInline.c [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Invd.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/LongJump.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/LongJump.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Monitor.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Mwait.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Non-existing.c [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadCr0.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadCr2.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadCr3.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadCr4.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadCs.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr0.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr1.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr2.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr3.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr4.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr5.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr6.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDr7.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadDs.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadEflags.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadEs.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadFs.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadGdtr.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadGs.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadIdtr.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadLdtr.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm0.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm1.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm2.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm3.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm4.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm5.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm6.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMm7.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMsr64.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadMsr64.c [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadPmc.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadSs.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadTr.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/ReadTsc.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/SetJump.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/SetJump.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/SwitchStack.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Thunk16.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Wbinvd.S [deleted file]
UnixPkg/Library/UnixBaseLib/X64/Wbinvd.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteCr0.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteCr2.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteCr3.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteCr4.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr0.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr1.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr2.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr3.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr4.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr5.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr6.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteDr7.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteGdtr.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteIdtr.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteLdtr.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm0.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm1.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm2.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm3.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm4.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm5.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm6.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMm7.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMsr64.asm [deleted file]
UnixPkg/Library/UnixBaseLib/X64/WriteMsr64.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86DisablePaging32.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86DisablePaging64.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86EnablePaging32.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86EnablePaging64.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86FxRestore.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86FxSave.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86GetInterruptState.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86MemoryFence.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86Msr.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86ReadGdtr.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86ReadIdtr.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86Thunk.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86WriteGdtr.c [deleted file]
UnixPkg/Library/UnixBaseLib/X86WriteIdtr.c [deleted file]
UnixPkg/Library/UnixBdsLib/BdsPlatform.c [deleted file]
UnixPkg/Library/UnixBdsLib/BdsPlatform.h [deleted file]
UnixPkg/Library/UnixBdsLib/PlatformBds.inf [deleted file]
UnixPkg/Library/UnixBdsLib/PlatformData.c [deleted file]
UnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoader.c [deleted file]
UnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoaderLib.inf [deleted file]
UnixPkg/License.txt [deleted file]
UnixPkg/MetronomeDxe/Metronome.c [deleted file]
UnixPkg/MetronomeDxe/Metronome.h [deleted file]
UnixPkg/MetronomeDxe/Metronome.inf [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscOemStringData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c [deleted file]
UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c [deleted file]
UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.c [deleted file]
UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.inf [deleted file]
UnixPkg/ResetRuntimeDxe/Reset.c [deleted file]
UnixPkg/ResetRuntimeDxe/Reset.inf [deleted file]
UnixPkg/Sec/FwVol.c [deleted file]
UnixPkg/Sec/Gasket.c [deleted file]
UnixPkg/Sec/Gasket.h [deleted file]
UnixPkg/Sec/Ia32/Gasket.S [deleted file]
UnixPkg/Sec/Ia32/Stack.S [deleted file]
UnixPkg/Sec/Ia32/SwitchStack.c [deleted file]
UnixPkg/Sec/SecMain.c [deleted file]
UnixPkg/Sec/SecMain.h [deleted file]
UnixPkg/Sec/SecMain.inf [deleted file]
UnixPkg/Sec/UgaX11.c [deleted file]
UnixPkg/Sec/UnixThunk.c [deleted file]
UnixPkg/Sec/X64/MangleGasket.S [deleted file]
UnixPkg/Sec/X64/NameManglingFix.c [deleted file]
UnixPkg/Sec/X64/SwitchStack.S [deleted file]
UnixPkg/TimerDxe/Timer.c [deleted file]
UnixPkg/TimerDxe/Timer.h [deleted file]
UnixPkg/TimerDxe/Timer.inf [deleted file]
UnixPkg/UnixAutoScanPei/UnixAutoScan.c [deleted file]
UnixPkg/UnixAutoScanPei/UnixAutoScan.inf [deleted file]
UnixPkg/UnixBlockIoDxe/ComponentName.c [deleted file]
UnixPkg/UnixBlockIoDxe/DriverConfiguration.c [deleted file]
UnixPkg/UnixBlockIoDxe/DriverDiagnostics.c [deleted file]
UnixPkg/UnixBlockIoDxe/EntryPoint.c [deleted file]
UnixPkg/UnixBlockIoDxe/UnixBlockIo.c [deleted file]
UnixPkg/UnixBlockIoDxe/UnixBlockIo.h [deleted file]
UnixPkg/UnixBlockIoDxe/UnixBlockIo.inf [deleted file]
UnixPkg/UnixBusDriverDxe/ComponentName.c [deleted file]
UnixPkg/UnixBusDriverDxe/EntryPoint.c [deleted file]
UnixPkg/UnixBusDriverDxe/UnixBusDriver.c [deleted file]
UnixPkg/UnixBusDriverDxe/UnixBusDriver.h [deleted file]
UnixPkg/UnixBusDriverDxe/UnixBusDriver.inf [deleted file]
UnixPkg/UnixConsoleDxe/ComponentName.c [deleted file]
UnixPkg/UnixConsoleDxe/Console.c [deleted file]
UnixPkg/UnixConsoleDxe/Console.h [deleted file]
UnixPkg/UnixConsoleDxe/ConsoleIn.c [deleted file]
UnixPkg/UnixConsoleDxe/ConsoleOut.c [deleted file]
UnixPkg/UnixConsoleDxe/EntryPoint.c [deleted file]
UnixPkg/UnixConsoleDxe/UnixConsole.inf [deleted file]
UnixPkg/UnixFirmwareVolumePei/UnixFwh.c [deleted file]
UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf [deleted file]
UnixPkg/UnixFlashMapPei/FlashMap.c [deleted file]
UnixPkg/UnixFlashMapPei/FlashMap.inf [deleted file]
UnixPkg/UnixGopDxe/ComponentName.c [deleted file]
UnixPkg/UnixGopDxe/UnixGop.h [deleted file]
UnixPkg/UnixGopDxe/UnixGop.inf [deleted file]
UnixPkg/UnixGopDxe/UnixGopDriver.c [deleted file]
UnixPkg/UnixGopDxe/UnixGopInput.c [deleted file]
UnixPkg/UnixGopDxe/UnixGopScreen.c [deleted file]
UnixPkg/UnixPkg.dec [deleted file]
UnixPkg/UnixPkg.dsc [deleted file]
UnixPkg/UnixPkg.fdf [deleted file]
UnixPkg/UnixPkgX64.dsc [deleted file]
UnixPkg/UnixPkgX64.fdf [deleted file]
UnixPkg/UnixSerialIoDxe/ComponentName.c [deleted file]
UnixPkg/UnixSerialIoDxe/EntryPoint.c [deleted file]
UnixPkg/UnixSerialIoDxe/UnixSerialIo.c [deleted file]
UnixPkg/UnixSerialIoDxe/UnixSerialIo.h [deleted file]
UnixPkg/UnixSerialIoDxe/UnixSerialIo.inf [deleted file]
UnixPkg/UnixSimpleFileSystemDxe/ComponentName.c [deleted file]
UnixPkg/UnixSimpleFileSystemDxe/EntryPoint.c [deleted file]
UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c [deleted file]
UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h [deleted file]
UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.inf [deleted file]
UnixPkg/UnixSnpDxe/ComponentName.c [deleted file]
UnixPkg/UnixSnpDxe/UnixSnp.c [deleted file]
UnixPkg/UnixSnpDxe/UnixSnp.h [deleted file]
UnixPkg/UnixSnpDxe/UnixSnpDxe.inf [deleted file]
UnixPkg/UnixThunkDxe/UnixThunk.c [deleted file]
UnixPkg/UnixThunkDxe/UnixThunk.h [deleted file]
UnixPkg/UnixThunkDxe/UnixThunk.inf [deleted file]
UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.c [deleted file]
UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.inf [deleted file]
UnixPkg/UnixUgaDxe/ComponentName.c [deleted file]
UnixPkg/UnixUgaDxe/EntryPoint.c [deleted file]
UnixPkg/UnixUgaDxe/UnixUga.h [deleted file]
UnixPkg/UnixUgaDxe/UnixUga.inf [deleted file]
UnixPkg/UnixUgaDxe/UnixUgaDriver.c [deleted file]
UnixPkg/UnixUgaDxe/UnixUgaInput.c [deleted file]
UnixPkg/UnixUgaDxe/UnixUgaScreen.c [deleted file]
UnixPkg/Xcode/xcode_project/XcodeBuild.sh [deleted file]
UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj/default.pbxuser [deleted file]
UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj/project.pbxproj [deleted file]
UnixPkg/Xcode/xcode_project64/XcodeBuild.sh [deleted file]
UnixPkg/Xcode/xcode_project64/xcode_project.xcodeproj/default.pbxuser [deleted file]
UnixPkg/Xcode/xcode_project64/xcode_project.xcodeproj/project.pbxproj [deleted file]
UnixPkg/build.sh [deleted file]
UnixPkg/build64.sh [deleted file]
UnixPkg/readme.txt [deleted file]

diff --git a/UnixPkg/.gdbinit b/UnixPkg/.gdbinit
deleted file mode 100644 (file)
index 173818c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-set confirm off
-set output-radix 16
-b SecGdbScriptBreak
-command
-silent
-source SecMain.gdb
-c
-end
diff --git a/UnixPkg/BootModePei/BootModePei.c b/UnixPkg/BootModePei/BootModePei.c
deleted file mode 100644 (file)
index 6427da8..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  BootMode.c\r
-   \r
-Abstract:\r
-\r
-  Tiano PEIM to provide the platform support functionality within Unix\r
-\r
-**/\r
-\r
-\r
-\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <PiPei.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Ppi/MasterBootMode.h>\r
-#include <Ppi/BootInRecoveryMode.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-\r
-\r
-//\r
-// Module globals\r
-//\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListBootMode = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiMasterBootModePpiGuid,\r
-  NULL\r
-};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR  mPpiListRecoveryBootMode = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiBootInRecoveryModePpiGuid,\r
-  NULL\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeBootMode (\r
-  IN       EFI_PEI_FILE_HANDLE       FileHandle,\r
-  IN CONST EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Peform the boot mode determination logic\r
-\r
-Arguments:\r
-\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-\r
-  Status -  EFI_SUCCESS if the boot mode could be set\r
-\r
---*/\r
-// TODO:    FfsHeader - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       BootMode;\r
-\r
-  DEBUG ((EFI_D_ERROR, "Unix Boot Mode PEIM Loaded\n"));\r
-\r
-  //\r
-  // Let's assume things are OK if not told otherwise\r
-  // Should we read an environment variable in order to easily change this?\r
-  //\r
-  BootMode  = BOOT_WITH_FULL_CONFIGURATION;\r
-\r
-  Status    = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
-    Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode);\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/BootModePei/BootModePei.inf b/UnixPkg/BootModePei/BootModePei.inf
deleted file mode 100644 (file)
index 49302a5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-## @file\r
-# Component description file for BootMode module\r
-#\r
-# This module provides platform specific function to detect boot mode.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = BootModePei\r
-  FILE_GUID                      = f3ff9aee-8985-11db-b133-0040d02b1835\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeBootMode\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  BootModePei.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  PeiServicesTablePointerLib\r
-  PeiServicesLib\r
-  BaseLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-\r
-[Ppis]\r
-  gEfiPeiMasterBootModePpiGuid                  # PPI ALWAYS_PRODUCED\r
-  gEfiPeiBootInRecoveryModePpiGuid              # PPI SOMETIMES_PRODUCED\r
-\r
-\r
-[Depex]\r
-  TRUE\r
-\r
diff --git a/UnixPkg/Contributions.txt b/UnixPkg/Contributions.txt
deleted file mode 100644 (file)
index 667ca10..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-\r
-======================\r
-= Code Contributions =\r
-======================\r
-\r
-To make a contribution to a TianoCore project, follow these steps.\r
-1. Create a change description in the format specified below to\r
-   use in the source control commit log.\r
-2. Your commit message must include your "Signed-off-by" signature,\r
-   and "Contributed-under" message.\r
-3. Your "Contributed-under" message explicitly states that the\r
-   contribution is made under the terms of the specified\r
-   contribution agreement.  Your "Contributed-under" message\r
-   must include the name of contribution agreement and version.\r
-   For example: Contributed-under: TianoCore Contribution Agreement 1.0\r
-   The "TianoCore Contribution Agreement" is included below in\r
-   this document.\r
-4. Submit your code to the TianoCore project using the process\r
-   that the project documents on its web page.  If the process is\r
-   not documented, then submit the code on development email list\r
-   for the project.\r
-\r
-=======================================\r
-= Change Description / Commit Message =\r
-=======================================\r
-\r
-Your change description should use the standard format for a\r
-commit message, and must include your "Signed-off-by" signature\r
-and the "Contributed-under" message.\r
-\r
-== Sample Change Description / Commit Message =\r
-\r
-=== Definitions for sample change description ===\r
-\r
-* "CodeModule" is a short idenfier for the affected code.  For\r
-  example MdePkg, or MdeModulePkg UsbBusDxe.\r
-* "Brief-single-line-summary" is a short summary of the change.\r
-* The entire first line should be less than ~70 characters.\r
-* "Full-commit-message" a verbose multiple line comment describing\r
-  the change.  Each line should be less than ~70 characters.\r
-* "Contributed-under" explicitely states that the contribution is\r
-  made under the terms of the contribtion agreement.  This\r
-  agreement is included below in this document.\r
-* "Signed-off-by" is the contributor's signature identifying them\r
-  by their real/legal name and their email address.\r
-\r
-=== Start of sample change description / commit message ===\r
-CodeModule: Brief-single-line-summary\r
-\r
-Full-commit-message\r
-\r
-Contributed-under: TianoCore Contribution Agreement 1.0\r
-Signed-off-by: Contributor Name <contributor@email.server>\r
-=== End of sample change description / commit message ===\r
-\r
-========================================\r
-= TianoCore Contribution Agreement 1.0 =\r
-========================================\r
-\r
-INTEL CORPORATION ("INTEL") MAKES AVAILABLE SOFTWARE, DOCUMENTATION,\r
-INFORMATION AND/OR OTHER MATERIALS FOR USE IN THE TIANOCORE OPEN SOURCE\r
-PROJECT (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE\r
-TERMS AND CONDITIONS OF THIS AGREEMENT BETWEEN YOU AND INTEL AND/OR THE\r
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR\r
-REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE\r
-CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS\r
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\r
-BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS\r
-AGREEMENT AND THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE\r
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT\r
-USE THE CONTENT.\r
-\r
-Unless otherwise indicated, all Content made available on the TianoCore\r
-site is provided to you under the terms and conditions of the BSD\r
-License ("BSD"). A copy of the BSD License is available at\r
-http://opensource.org/licenses/bsd-license.php\r
-or when applicable, in the associated License.txt file.\r
-\r
-Certain other content may be made available under other licenses as\r
-indicated in or with such Content. (For example, in a License.txt file.)\r
-\r
-You accept and agree to the following terms and conditions for Your\r
-present and future Contributions submitted to TianoCore site. Except\r
-for the license granted to Intel hereunder, You reserve all right,\r
-title, and interest in and to Your Contributions.\r
-\r
-== SECTION 1: Definitions ==\r
-* "You" or "Contributor" shall mean the copyright owner or legal\r
-  entity authorized by the copyright owner that is making a\r
-  Contribution hereunder. All other entities that control, are\r
-  controlled by, or are under common control with that entity are\r
-  considered to be a single Contributor. For the purposes of this\r
-  definition, "control" means (i) the power, direct or indirect, to\r
-  cause the direction or management of such entity, whether by\r
-  contract or otherwise, or (ii) ownership of fifty percent (50%)\r
-  or more of the outstanding shares, or (iii) beneficial ownership\r
-  of such entity.\r
-* "Contribution" shall mean any original work of authorship,\r
-  including any modifications or additions to an existing work,\r
-  that is intentionally submitted by You to the TinaoCore site for\r
-  inclusion in, or documentation of, any of the Content. For the\r
-  purposes of this definition, "submitted" means any form of\r
-  electronic, verbal, or written communication sent to the\r
-  TianoCore site or its representatives, including but not limited\r
-  to communication on electronic mailing lists, source code\r
-  control systems, and issue tracking systems that are managed by,\r
-  or on behalf of, the TianoCore site for the purpose of\r
-  discussing and improving the Content, but excluding\r
-  communication that is conspicuously marked or otherwise\r
-  designated in writing by You as "Not a Contribution."\r
-\r
-== SECTION 2: License for Contributions ==\r
-* Contributor hereby agrees that redistribution and use of the\r
-  Contribution in source and binary forms, with or without\r
-  modification, are permitted provided that the following\r
-  conditions are met:\r
-** Redistributions of source code must retain the Contributor's\r
-   copyright notice, this list of conditions and the following\r
-   disclaimer.\r
-** Redistributions in binary form must reproduce the Contributor's\r
-   copyright notice, this list of conditions and the following\r
-   disclaimer in the documentation and/or other materials provided\r
-   with the distribution.\r
-* Disclaimer. None of the names of Contributor, Intel, or the names\r
-  of their respective contributors may be used to endorse or\r
-  promote products derived from this software without specific\r
-  prior written permission.\r
-* Contributor grants a license (with the right to sublicense) under\r
-  claims of Contributor's patents that Contributor can license that\r
-  are infringed by the Contribution (as delivered by Contributor) to\r
-  make, use, distribute, sell, offer for sale, and import the\r
-  Contribution and derivative works thereof solely to the minimum\r
-  extent necessary for licensee to exercise the granted copyright\r
-  license; this patent license applies solely to those portions of\r
-  the Contribution that are unmodified. No hardware per se is\r
-  licensed.\r
-* EXCEPT AS EXPRESSLY SET FORTH IN SECTION 3 BELOW, THE\r
-  CONTRIBUTION IS PROVIDED BY THE CONTRIBUTOR "AS IS" AND ANY\r
-  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
-  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\r
-  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r
-  CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
-  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
-  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
-  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
-  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\r
-  CONTRIBUTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\r
-  DAMAGE.\r
-\r
-== SECTION 3: Representations ==\r
-* You represent that You are legally entitled to grant the above\r
-  license. If your employer(s) has rights to intellectual property\r
-  that You create that includes Your Contributions, You represent\r
-  that You have received permission to make Contributions on behalf\r
-  of that employer, that Your employer has waived such rights for\r
-  Your Contributions.\r
-* You represent that each of Your Contributions is Your original\r
-  creation (see Section 4 for submissions on behalf of others).\r
-  You represent that Your Contribution submissions include complete\r
-  details of any third-party license or other restriction\r
-  (including, but not limited to, related patents and trademarks)\r
-  of which You are personally aware and which are associated with\r
-  any part of Your Contributions.\r
-\r
-== SECTION 4: Third Party Contributions ==\r
-* Should You wish to submit work that is not Your original creation,\r
-  You may submit it to TianoCore site separately from any\r
-  Contribution, identifying the complete details of its source\r
-  and of any license or other restriction (including, but not\r
-  limited to, related patents, trademarks, and license agreements)\r
-  of which You are personally aware, and conspicuously marking the\r
-  work as "Submitted on behalf of a third-party: [named here]".\r
-\r
-== SECTION 5: Miscellaneous ==\r
-* Applicable Laws. Any claims arising under or relating to this\r
-  Agreement shall be governed by the internal substantive laws of\r
-  the State of Delaware or federal courts located in Delaware,\r
-  without regard to principles of conflict of laws.\r
-* Language. This Agreement is in the English language only, which\r
-  language shall be controlling in all respects, and all versions\r
-  of this Agreement in any other language shall be for accommodation\r
-  only and shall not be binding. All communications and notices made\r
-  or given pursuant to this Agreement, and all documentation and\r
-  support to be provided, unless otherwise noted, shall be in the\r
-  English language.\r
-\r
diff --git a/UnixPkg/CpuRuntimeDxe/Cpu.c b/UnixPkg/CpuRuntimeDxe/Cpu.c
deleted file mode 100644 (file)
index 54c784e..0000000
+++ /dev/null
@@ -1,556 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  Cpu.c\r
-\r
-Abstract:\r
-\r
-  Unix Emulation Architectural Protocol Driver as defined in Tiano.\r
-  This CPU module abstracts the interrupt subsystem of a platform and\r
-  the CPU-specific setjump/long pair.  Other services are not implemented\r
-  in this driver.\r
-\r
---*/\r
-#include <FrameworkDxe.h>\r
-#include <IndustryStandard/SmBios.h>\r
-#include <Protocol/Cpu.h>\r
-#include <Protocol/Smbios.h>\r
-#include <Guid/DataHubRecords.h>\r
-#include <Protocol/CpuIo2.h>\r
-#include <Protocol/FrameworkHii.h>\r
-#include <Protocol/UnixThunk.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UnixLib.h>\r
-\r
-#include "CpuDriver.h"\r
-#include "UnixDxe.h"\r
-#include <Protocol/UnixIo.h>\r
-\r
-#define EFI_CPU_DATA_MAXIMUM_LENGTH 0x100\r
-\r
-CPU_ARCH_PROTOCOL_PRIVATE mCpuTemplate = {\r
-  CPU_ARCH_PROT_PRIVATE_SIGNATURE,\r
-  NULL,\r
-  {\r
-    UnixFlushCpuDataCache,\r
-    UnixEnableInterrupt,\r
-    UnixDisableInterrupt,\r
-    UnixGetInterruptState,\r
-    UnixInit,\r
-    UnixRegisterInterruptHandler,\r
-    UnixGetTimerValue,\r
-    UnixSetMemoryAttributes,\r
-    0,\r
-    4\r
-  },\r
-  {\r
-    {\r
-      CpuMemoryServiceRead,\r
-      CpuMemoryServiceWrite\r
-    },\r
-    {\r
-      CpuIoServiceRead,\r
-      CpuIoServiceWrite\r
-    }\r
-  },\r
-  TRUE\r
-};\r
-\r
-\r
-//\r
-// Service routines for the driver\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixFlushCpuDataCache (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   Start,\r
-  IN UINT64                 Length,\r
-  IN EFI_CPU_FLUSH_TYPE     FlushType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would provide support for flushing the CPU data cache.\r
-  In the case of UNIX emulation environment, this flushing is not necessary and\r
-  is thus not implemented.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  Start adddress in memory to flush\r
-  Length of memory to flush\r
-  Flush type\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    FlushType - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-{\r
-  if (FlushType == EfiCpuFlushTypeWriteBackInvalidate) {\r
-    //\r
-    // Only WB flush is supported. We actually need do nothing on UNIX emulator\r
-    // environment. Classify this to follow EFI spec\r
-    //\r
-    return EFI_SUCCESS;\r
-  }\r
-  //\r
-  // Other flush types are not supported by UNIX emulator\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixEnableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine provides support for emulation of the interrupt enable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
-  Architectural Protocol observes in order to defer behaviour while in its\r
-  emulated interrupt, or timer tick.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  Private                 = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  Private->InterruptState = TRUE;\r
-  gUnix->EnableInterrupt ();\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixDisableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine provides support for emulation of the interrupt disable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
-  Architectural Protocol observes in order to defer behaviour while in its\r
-  emulated interrupt, or timer tick.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  Private                 = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  Private->InterruptState = FALSE;\r
-  gUnix->DisableInterrupt ();\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGetInterruptState (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  OUT BOOLEAN               *State\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine provides support for emulation of the interrupt disable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
-  Architectural Protocol observes in order to defer behaviour while in its\r
-  emulated interrupt, or timer tick.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_SUCCESS\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    State - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  if (State == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  *State  = Private->InterruptState;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixInit (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_CPU_INIT_TYPE      InitType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support generation of a CPU INIT.  At\r
-  present, this code does not provide emulation.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  INIT Type\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_UNSUPPORTED - not yet implemented\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    InitType - add argument and description to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixRegisterInterruptHandler (\r
-  IN EFI_CPU_ARCH_PROTOCOL      *This,\r
-  IN EFI_EXCEPTION_TYPE         InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support registration of an interrupt handler.  At\r
-  present, this code does not provide emulation.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  Pointer to interrupt handlers\r
-  Interrupt type\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_UNSUPPORTED - not yet implemented\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    InterruptType - add argument and description to function comment\r
-// TODO:    InterruptHandler - add argument and description to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  //\r
-  // Do parameter checking for EFI spec conformance\r
-  //\r
-  if (InterruptType < 0 || InterruptType > 0xff) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Do nothing for Nt32 emulation\r
-  //\r
-  Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGetTimerValue (\r
-  IN  EFI_CPU_ARCH_PROTOCOL *This,\r
-  IN  UINT32                TimerIndex,\r
-  OUT UINT64                *TimerValue,\r
-  OUT UINT64                *TimerPeriod OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support querying of an on-CPU timer.  At present,\r
-  this code does not provide timer emulation.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to CPU Architectural Protocol interface\r
-  TimerIndex  - Index of given CPU timer\r
-  TimerValue  - Output of the timer\r
-  TimerPeriod - Output of the timer period\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED       - not yet implemented\r
-  EFI_INVALID_PARAMETER - TimeValue is NULL\r
-\r
---*/\r
-{\r
-  if (TimerValue == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // No timer supported\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSetMemoryAttributes (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   BaseAddress,\r
-  IN UINT64                 Length,\r
-  IN UINT64                 Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This routine would support querying of an on-CPU timer.  At present,\r
-  this code does not provide timer emulation.\r
-\r
-Arguments:\r
-\r
-  Pointer to CPU Architectural Protocol interface\r
-  Start address of memory region\r
-  The size in bytes of the memory region\r
-  The bit mask of attributes to set for the memory region\r
-\r
-Returns:\r
-\r
-  Status\r
-    EFI_UNSUPPORTED - not yet implemented\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    BaseAddress - add argument and description to function comment\r
-// TODO:    Length - add argument and description to function comment\r
-// TODO:    Attributes - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
-\r
-  //\r
-  // Check for invalid parameter for Spec conformance\r
-  //\r
-  if (Length == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 emulation\r
-  //\r
-  Private = CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS (This);\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-\r
-\r
-/**\r
-  Logs SMBIOS record.\r
-\r
-  @param  Smbios   Pointer to SMBIOS protocol instance.\r
-  @param  Buffer   Pointer to the data buffer.\r
-\r
-**/\r
-VOID\r
-LogSmbiosData (\r
-  IN  EFI_SMBIOS_PROTOCOL        *Smbios,\r
-  IN  UINT8                      *Buffer\r
-  )\r
-{\r
-  EFI_STATUS         Status;\r
-  EFI_SMBIOS_HANDLE  SmbiosHandle;\r
-  \r
-  SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  Status = Smbios->Add (\r
-                     Smbios,\r
-                     NULL,\r
-                     &SmbiosHandle,\r
-                     (EFI_SMBIOS_TABLE_HEADER*)Buffer\r
-                     );\r
-  ASSERT_EFI_ERROR (Status);\r
-}\r
-\r
-VOID\r
-CpuUpdateSmbios (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This function will log processor version and frequency data to data hub.\r
-\r
-Arguments:\r
-  Event        - Event whose notification function is being invoked.\r
-  Context      - Pointer to the notification function's context.\r
-\r
-Returns:\r
-  None.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_SMBIOS_PROTOCOL         *Smbios;\r
-  UINT32                      TotalSize;\r
-  EFI_HII_HANDLE              HiiHandle;\r
-  STRING_REF                  Token;\r
-  UINTN                       CpuVerStrLen;\r
-  EFI_STRING                  CpuVerStr;\r
-  SMBIOS_TABLE_TYPE4          *SmbiosRecord;\r
-  CHAR8                       *OptionalStrStart;\r
-\r
-  //\r
-  // Locate Smbios protocol.\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&Smbios);\r
-  \r
-  if (EFI_ERROR (Status)) {\r
-    return;\r
-  }\r
-\r
-  //\r
-  // Initialize strings to HII database\r
-  //\r
-  HiiHandle = HiiAddPackages (\r
-                &gEfiCallerIdGuid,\r
-                NULL,\r
-                CpuStrings,\r
-                NULL\r
-                );\r
-  ASSERT (HiiHandle != NULL);\r
-\r
-\r
-  Token  = STRING_TOKEN (STR_INTEL_GENUINE_PROCESSOR);\r
-  CpuVerStr = HiiGetPackageString(&gEfiCallerIdGuid, Token, NULL);\r
-  CpuVerStrLen = StrLen(CpuVerStr);\r
-  ASSERT (CpuVerStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-  TotalSize = sizeof(SMBIOS_TABLE_TYPE4) + CpuVerStrLen + 1 + 1;\r
-  SmbiosRecord = AllocatePool(TotalSize);\r
-  ZeroMem(SmbiosRecord, TotalSize);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE4);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Processor version is the 1st string.\r
-  //\r
-  SmbiosRecord->ProcessorVersion = 1;\r
-  //\r
-  // Store CPU frequency data record to data hub - It's an emulator so make up a value\r
-  //\r
-  SmbiosRecord->CurrentSpeed  = 1234;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(CpuVerStr, OptionalStrStart);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  LogSmbiosData(Smbios, (UINT8 *) SmbiosRecord);\r
-  FreePool (SmbiosRecord);\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeCpu (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the state information for the CPU Architectural Protocol\r
-\r
-Arguments:\r
-\r
-  ImageHandle of the loaded driver\r
-  Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  EFI_SUCCESS           - protocol instance can be published\r
-  EFI_OUT_OF_RESOURCES  - cannot allocate protocol data structure\r
-  EFI_DEVICE_ERROR      - cannot create the thread\r
-\r
---*/\r
-// TODO:    SystemTable - add argument and description to function comment\r
-{\r
-  EFI_STATUS                Status;\r
-\r
-  CpuUpdateSmbios ();\r
-\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &mCpuTemplate.Handle,\r
-                  &gEfiCpuArchProtocolGuid,   &mCpuTemplate.Cpu,\r
-                  &gEfiCpuIo2ProtocolGuid,    &mCpuTemplate.CpuIo,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  DEBUG ((EFI_D_ERROR, "CPU Architectural Protocol Loaded\n"));\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/CpuRuntimeDxe/Cpu.inf b/UnixPkg/CpuRuntimeDxe/Cpu.inf
deleted file mode 100644 (file)
index ea49064..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-## @file\r
-# Component description file for Cpu module.\r
-#\r
-# This CPU module abstracts the interrupt subsystem of a platform and the CPU-specific setjump-long pair.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Cpu\r
-  FILE_GUID                      = f3794b60-8985-11db-8e53-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeCpu\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  CpuIo.c\r
-  Cpu.c\r
-  CpuDriver.h\r
-  Strings.uni\r
-\r
-\r
-[Packages]\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  HiiLib\r
-  DebugLib\r
-  BaseLib\r
-  UnixLib\r
-\r
-[Protocols]\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL_NOTIFY SOMETIMES_CONSUMED\r
-  gEfiSmbiosProtocolGuid                        # PROTOCOL SOMETIMES_CONSUMED\r
-  gEfiHiiProtocolGuid                           # PROTOCOL SOMETIMES_CONSUMED\r
-  gEfiCpuIo2ProtocolGuid                        # PROTOCOL ALWAYS_PRODUCED\r
-  gEfiCpuArchProtocolGuid                       # PROTOCOL ALWAYS_PRODUCED\r
-\r
-[Depex]\r
-  gEfiSmbiosProtocolGuid\r
diff --git a/UnixPkg/CpuRuntimeDxe/CpuDriver.h b/UnixPkg/CpuRuntimeDxe/CpuDriver.h
deleted file mode 100644 (file)
index 7bd59df..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  CpuDriver.h\r
-\r
-Abstract:\r
-\r
-  UNIX Emulation Architectural Protocol Driver as defined in Tiano.\r
-\r
---*/\r
-\r
-#ifndef _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_\r
-#define _CPU_ARCHITECTURAL_PROTOCOL_DRIVER_H_\r
-\r
-\r
-\r
-extern UINT8  CpuStrings[];\r
-\r
-//\r
-// Internal Data Structures\r
-//\r
-#define CPU_ARCH_PROT_PRIVATE_SIGNATURE SIGNATURE_32 ('c', 'a', 'p', 'd')\r
-\r
-typedef struct {\r
-  UINTN                 Signature;\r
-  EFI_HANDLE            Handle;\r
-\r
-  EFI_CPU_ARCH_PROTOCOL Cpu;\r
-  EFI_CPU_IO2_PROTOCOL  CpuIo;\r
-\r
-  //\r
-  // Local Data for CPU interface goes here\r
-  //\r
-  BOOLEAN               InterruptState;\r
-\r
-} CPU_ARCH_PROTOCOL_PRIVATE;\r
-\r
-#define CPU_ARCH_PROTOCOL_PRIVATE_DATA_FROM_THIS(a) \\r
-  CR (a, \\r
-      CPU_ARCH_PROTOCOL_PRIVATE, \\r
-      Cpu, \\r
-      CPU_ARCH_PROT_PRIVATE_SIGNATURE \\r
-      )\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceRead (\r
-  IN  EFI_CPU_IO2_PROTOCOL              *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceRead (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeCpu (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixFlushCpuDataCache (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   Start,\r
-  IN UINT64                 Length,\r
-  IN EFI_CPU_FLUSH_TYPE     FlushType\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixEnableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixDisableInterrupt (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGetInterruptState (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  OUT BOOLEAN               *State\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixInit (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_CPU_INIT_TYPE      InitType\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixRegisterInterruptHandler (\r
-  IN EFI_CPU_ARCH_PROTOCOL      *This,\r
-  IN EFI_EXCEPTION_TYPE         InterruptType,\r
-  IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGetTimerValue (\r
-  IN  EFI_CPU_ARCH_PROTOCOL *This,\r
-  IN  UINT32                TimerIndex,\r
-  OUT UINT64                *TimerValue,\r
-  OUT UINT64                *TimerPeriod OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSetMemoryAttributes (\r
-  IN EFI_CPU_ARCH_PROTOCOL  *This,\r
-  IN EFI_PHYSICAL_ADDRESS   BaseAddress,\r
-  IN UINT64                 Length,\r
-  IN UINT64                 Attributes\r
-  );\r
-\r
-#endif\r
diff --git a/UnixPkg/CpuRuntimeDxe/CpuIo.c b/UnixPkg/CpuRuntimeDxe/CpuIo.c
deleted file mode 100644 (file)
index 1a7f4f4..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  CpuIo.c\r
-\r
-Abstract:\r
-\r
-  This is the code that publishes the CPU I/O Protocol.\r
-  The intent herein is to have a single I/O service that can load\r
-  as early as possible, extend into runtime, and be layered upon by \r
-  the implementations of architectural protocols and the PCI Root\r
-  Bridge I/O Protocol.\r
-\r
---*/\r
-#include <FrameworkDxe.h>\r
-#include <Protocol/Cpu.h>\r
-#include <Protocol/DataHub.h>\r
-#include <Guid/DataHubRecords.h>\r
-#include <Protocol/CpuIo2.h>\r
-#include <Protocol/FrameworkHii.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <CpuDriver.h>\r
-\r
-#define IA32_MAX_IO_ADDRESS   0xFFFF\r
-#define IA32_MAX_MEM_ADDRESS  0xFFFFFFFF\r
-\r
-EFI_STATUS\r
-CpuIoCheckAddressRange (\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  VOID                              *Buffer,\r
-  IN  UINT64                            Limit\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceRead (\r
-  IN  EFI_CPU_IO2_PROTOCOL              *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Perform the Memory Access Read service for the CPU I/O Protocol\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the Memory access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from memory\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  EFI_SUCCESS             - The data was read from or written to the EFI \r
-                            System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, \r
-                            and Count is not valid for this EFI System.\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  if (!Buffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMemoryServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Perform the Memory Access Read service for the CPU I/O Protocol\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the Memory access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from memory\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  EFI_SUCCESS             - The data was read from or written to the EFI System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, and \r
-                            Count is not valid for this EFI System.\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  if (!Buffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, Buffer, IA32_MAX_MEM_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceRead (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  This is the service that implements the I/O read\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the I/O access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from I/O space\r
-\r
-Returns:\r
-\r
-  Status\r
-  EFI_SUCCESS             - The data was read from or written to the EFI System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, and \r
-                            Count is not valid for this EFI System.\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    UserAddress - add argument and description to function comment\r
-// TODO:    UserBuffer - add argument and description to function comment\r
-{\r
-  UINTN       Address;\r
-  EFI_STATUS  Status;\r
-\r
-  if (!UserBuffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Address = (UINTN) UserAddress;\r
-\r
-  if (Width >= EfiCpuIoWidthMaximum) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, UserBuffer, IA32_MAX_IO_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoServiceWrite (\r
-  IN EFI_CPU_IO2_PROTOCOL               *This,\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            UserAddress,\r
-  IN  UINTN                             Count,\r
-  IN  OUT VOID                          *UserBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  \r
-  This is the service that implements the I/O Write\r
-\r
-Arguments:\r
-\r
-  Pointer to an instance of the CPU I/O Protocol\r
-  Width of the Memory Access\r
-  Address of the I/O access\r
-  Count of the number of accesses to perform\r
-  Pointer to the buffer to read or write from I/O space\r
-\r
-Returns:\r
-\r
-  Status\r
-\r
-  Status\r
-  EFI_SUCCESS             - The data was read from or written to the EFI System.\r
-  EFI_INVALID_PARAMETER   - Width is invalid for this EFI System.\r
-  EFI_INVALID_PARAMETER   - Buffer is NULL.\r
-  EFI_UNSUPPORTED         - The Buffer is not aligned for the given Width.\r
-  EFI_UNSUPPORTED         - The address range specified by Address, Width, and \r
-                            Count is not valid for this EFI System.\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    UserAddress - add argument and description to function comment\r
-// TODO:    UserBuffer - add argument and description to function comment\r
-{\r
-  UINTN       Address;\r
-  EFI_STATUS  Status;\r
-\r
-  if (!UserBuffer) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Address = (UINTN) UserAddress;\r
-\r
-  if (Width >= EfiCpuIoWidthMaximum) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = CpuIoCheckAddressRange (Width, Address, Count, UserBuffer, IA32_MAX_IO_ADDRESS);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Do nothing for Nt32 version\r
-  //\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CpuIoCheckAddressRange (\r
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
-  IN  UINT64                            Address,\r
-  IN  UINTN                             Count,\r
-  IN  VOID                              *Buffer,\r
-  IN  UINT64                            Limit\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Width   - TODO: add argument description\r
-  Address - TODO: add argument description\r
-  Count   - TODO: add argument description\r
-  Buffer  - TODO: add argument description\r
-  Limit   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UINTN AlignMask;\r
-\r
-  if (Address > Limit) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // For FiFo type, the target address won't increase during the access, so treat count as 1\r
-  //\r
-  if (Width >= EfiCpuIoWidthFifoUint8 && Width <= EfiCpuIoWidthFifoUint64) {\r
-    Count = 1;\r
-  }\r
-\r
-  Width = Width & 0x03;\r
-  if (Address - 1 + (1 << Width) * Count > Limit) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  AlignMask = (1 << Width) - 1;\r
-  if ((UINTN) Buffer & AlignMask) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
diff --git a/UnixPkg/CpuRuntimeDxe/Strings.uni b/UnixPkg/CpuRuntimeDxe/Strings.uni
deleted file mode 100644 (file)
index 66edf8b..0000000
Binary files a/UnixPkg/CpuRuntimeDxe/Strings.uni and /dev/null differ
diff --git a/UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c b/UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c
deleted file mode 100644 (file)
index b49a660..0000000
+++ /dev/null
@@ -1,1363 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  FWBlockService.c\r
-    \r
-Abstract:\r
-\r
-Revision History\r
-\r
---*/\r
-\r
-#include "PiDxe.h"\r
-#include <Guid/EventGroup.h>\r
-#include <Protocol/FirmwareVolumeBlock.h>\r
-#include <Protocol/DevicePath.h>\r
-\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/UefiRuntimeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-#include "FwBlockService.h"\r
-\r
-ESAL_FWB_GLOBAL         *mFvbModuleGlobal;\r
-\r
-#define EFI_FVB2_STATUS (EFI_FVB2_READ_STATUS | EFI_FVB2_WRITE_STATUS | EFI_FVB2_LOCK_STATUS)\r
-\r
-EFI_FW_VOL_BLOCK_DEVICE mFvbDeviceTemplate = {\r
-  FVB_DEVICE_SIGNATURE,\r
-  {\r
-    {\r
-      {\r
-        HARDWARE_DEVICE_PATH,\r
-        HW_MEMMAP_DP,\r
-        {\r
-          sizeof (MEMMAP_DEVICE_PATH),\r
-          0\r
-        }\r
-      },\r
-      EfiMemoryMappedIO,\r
-      0,\r
-      0,\r
-    },\r
-    {\r
-      END_DEVICE_PATH_TYPE,\r
-      END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
-      {\r
-        sizeof (EFI_DEVICE_PATH_PROTOCOL),\r
-        0\r
-      }\r
-    }\r
-  },\r
-  0,\r
-  {\r
-    FvbProtocolGetAttributes,\r
-    FvbProtocolSetAttributes,\r
-    FvbProtocolGetPhysicalAddress,\r
-    FvbProtocolGetBlockSize,\r
-    FvbProtocolRead,\r
-    FvbProtocolWrite,\r
-    FvbProtocolEraseBlocks,\r
-    NULL\r
-  }\r
-};\r
-\r
-\r
-\r
-VOID\r
-EFIAPI\r
-FvbVirtualddressChangeEvent (\r
-  IN EFI_EVENT        Event,\r
-  IN VOID             *Context\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Fixup internal data so that EFI and SAL can be call in virtual mode.\r
-  Call the passed in Child Notify event and convert the mFvbModuleGlobal\r
-  date items to there virtual address.\r
-\r
-  mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]  - Physical copy of instance data\r
-  mFvbModuleGlobal->FvInstance[FVB_VIRTUAL]   - Virtual pointer to common \r
-                                                instance data.\r
-\r
-Arguments:\r
-\r
-  (Standard EFI notify event - EFI_EVENT_NOTIFY)\r
-\r
-Returns: \r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhInstance;\r
-  UINTN               Index;\r
-\r
-  EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal->FvInstance[FVB_VIRTUAL]);\r
-\r
-  //\r
-  // Convert the base address of all the instances\r
-  //\r
-  Index       = 0;\r
-  FwhInstance = mFvbModuleGlobal->FvInstance[FVB_PHYSICAL];\r
-  while (Index < mFvbModuleGlobal->NumFv) {\r
-    EfiConvertPointer (0x0, (VOID **) &FwhInstance->FvBase[FVB_VIRTUAL]);\r
-    FwhInstance = (EFI_FW_VOL_INSTANCE *)\r
-      (\r
-        (UINTN) ((UINT8 *) FwhInstance) + FwhInstance->VolumeHeader.HeaderLength +\r
-          (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))\r
-      );\r
-    Index++;\r
-  }\r
-\r
-  EfiConvertPointer (0x0, (VOID **) &mFvbModuleGlobal);\r
-}\r
-\r
-EFI_STATUS\r
-GetFvbInstance (\r
-  IN  UINTN                               Instance,\r
-  IN  ESAL_FWB_GLOBAL                     *Global,\r
-  OUT EFI_FW_VOL_INSTANCE                 **FwhInstance,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves the physical address of a memory mapped FV\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose base address is going to be\r
-                          returned\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  FwhInstance           - The EFI_FW_VOL_INSTANCE fimrware instance structure\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhRecord;\r
-\r
-  if (Instance >= Global->NumFv) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  FwhRecord = Global->FvInstance[Virtual];\r
-  while (Instance > 0) {\r
-    FwhRecord = (EFI_FW_VOL_INSTANCE *)\r
-      (\r
-        (UINTN) ((UINT8 *) FwhRecord) + FwhRecord->VolumeHeader.HeaderLength +\r
-          (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))\r
-      );\r
-    Instance--;\r
-  }\r
-\r
-  *FwhInstance = FwhRecord;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbGetPhysicalAddress (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_PHYSICAL_ADDRESS                *Address,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves the physical address of a memory mapped FV\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose base address is going to be\r
-                          returned\r
-  Address               - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r
-                          that on successful return, contains the base address\r
-                          of the firmware volume. \r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhInstance = NULL;\r
-  EFI_STATUS          Status;\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-  *Address = FwhInstance->FvBase[Virtual];\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbGetVolumeAttributes (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_FVB_ATTRIBUTES_2                *Attributes,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves attributes, insures positive polarity of attribute bits, returns\r
-  resulting attributes in output parameter\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose attributes is going to be \r
-                          returned\r
-  Attributes            - Output buffer which contains attributes\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE *FwhInstance = NULL;\r
-  EFI_STATUS          Status;\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-  *Attributes = FwhInstance->VolumeHeader.Attributes;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbGetLbaAddress (\r
-  IN  UINTN                               Instance,\r
-  IN  EFI_LBA                             Lba,\r
-  OUT UINTN                               *LbaAddress,\r
-  OUT UINTN                               *LbaLength,\r
-  OUT UINTN                               *NumOfBlocks,\r
-  IN  ESAL_FWB_GLOBAL                     *Global,\r
-  IN  BOOLEAN                             Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieves the starting address of an LBA in an FV\r
-\r
-Arguments:\r
-  Instance              - The FV instance which the Lba belongs to\r
-  Lba                   - The logical block address\r
-  LbaAddress            - On output, contains the physical starting address \r
-                          of the Lba\r
-  LbaLength             - On output, contains the length of the block\r
-  NumOfBlocks           - A pointer to a caller allocated UINTN in which the\r
-                          number of consecutive blocks starting with Lba is\r
-                          returned. All blocks in this range have a size of\r
-                          BlockSize\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-  UINT32                  NumBlocks;\r
-  UINT32                  BlockLength;\r
-  UINTN                   Offset;\r
-  EFI_LBA                 StartLba;\r
-  EFI_LBA                 NextLba;\r
-  EFI_FW_VOL_INSTANCE     *FwhInstance = NULL;\r
-  EFI_FV_BLOCK_MAP_ENTRY  *BlockMap;\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  StartLba  = 0;\r
-  Offset    = 0;\r
-  BlockMap  = &(FwhInstance->VolumeHeader.BlockMap[0]);\r
-\r
-  //\r
-  // Parse the blockmap of the FV to find which map entry the Lba belongs to\r
-  //\r
-  while (TRUE) {\r
-    NumBlocks   = BlockMap->NumBlocks;\r
-    BlockLength = BlockMap->Length;\r
-\r
-    if (NumBlocks == 0 || BlockLength == 0) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    NextLba = StartLba + NumBlocks;\r
-\r
-    //\r
-    // The map entry found\r
-    //\r
-    if (Lba >= StartLba && Lba < NextLba) {\r
-      Offset = Offset + (UINTN) MultU64x32 ((Lba - StartLba), BlockLength);\r
-      if (LbaAddress != NULL) {\r
-        *LbaAddress = FwhInstance->FvBase[Virtual] + Offset;\r
-      }\r
-\r
-      if (LbaLength != NULL) {\r
-        *LbaLength = BlockLength;\r
-      }\r
-\r
-      if (NumOfBlocks != NULL) {\r
-        *NumOfBlocks = (UINTN) (NextLba - Lba);\r
-      }\r
-\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    StartLba  = NextLba;\r
-    Offset    = Offset + NumBlocks * BlockLength;\r
-    BlockMap++;\r
-  }\r
-}\r
-\r
-EFI_STATUS\r
-FvbReadBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Reads specified number of bytes into a buffer from the specified block\r
-\r
-Arguments:\r
-  Instance              - The FV instance to be read from\r
-  Lba                   - The logical block address to be read from\r
-  BlockOffset           - Offset into the block at which to begin reading\r
-  NumBytes              - Pointer that on input contains the total size of\r
-                          the buffer. On output, it contains the total number\r
-                          of bytes read\r
-  Buffer                - Pointer to a caller allocated buffer that will be\r
-                          used to hold the data read\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was read successfully and \r
-                          contents are in Buffer\r
-  EFI_BAD_BUFFER_SIZE   - Read attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes returned\r
-                          in Buffer\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the ReadDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
-                          could not be read\r
-  EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL\r
-\r
---*/\r
-{\r
-  EFI_FVB_ATTRIBUTES_2  Attributes;\r
-  UINTN               LbaAddress;\r
-  UINTN               LbaLength;\r
-  EFI_STATUS          Status;\r
-\r
-  //\r
-  // Check for invalid conditions\r
-  //\r
-  if ((NumBytes == NULL) || (Buffer == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (*NumBytes == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Check if the FV is read enabled\r
-  //\r
-  FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);\r
-\r
-  if ((Attributes & EFI_FVB2_READ_STATUS) == 0) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-  //\r
-  // Perform boundary checks and adjust NumBytes\r
-  //\r
-  if (BlockOffset > LbaLength) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (LbaLength < (*NumBytes + BlockOffset)) {\r
-    *NumBytes = (UINT32) (LbaLength - BlockOffset);\r
-    Status    = EFI_BAD_BUFFER_SIZE;\r
-  }\r
-\r
-  CopyMem (Buffer, (UINT8 *) (LbaAddress + BlockOffset), (UINTN) (*NumBytes));\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-FvbWriteBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Writes specified number of bytes from the input buffer to the block\r
-\r
-Arguments:\r
-  Instance              - The FV instance to be written to\r
-  Lba                   - The starting logical block index to write to\r
-  BlockOffset           - Offset into the block at which to begin writing\r
-  NumBytes              - Pointer that on input contains the total size of\r
-                          the buffer. On output, it contains the total number\r
-                          of bytes actually written\r
-  Buffer                - Pointer to a caller allocated buffer that contains\r
-                          the source for the write\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was written successfully\r
-  EFI_BAD_BUFFER_SIZE   - Write attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes\r
-                          actually written\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
-                          could not be written\r
-  EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL\r
-\r
---*/\r
-{\r
-  EFI_FVB_ATTRIBUTES_2  Attributes;\r
-  UINTN               LbaAddress;\r
-  UINTN               LbaLength;\r
-  EFI_STATUS          Status;\r
-\r
-  //\r
-  // Check for invalid conditions\r
-  //\r
-  if ((NumBytes == NULL) || (Buffer == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (*NumBytes == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Check if the FV is write enabled\r
-  //\r
-  FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);\r
-\r
-  if ((Attributes & EFI_FVB2_WRITE_STATUS) == 0) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-  //\r
-  // Perform boundary checks and adjust NumBytes\r
-  //\r
-  if (BlockOffset > LbaLength) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (LbaLength < (*NumBytes + BlockOffset)) {\r
-    *NumBytes = (UINT32) (LbaLength - BlockOffset);\r
-    Status    = EFI_BAD_BUFFER_SIZE;\r
-  }\r
-  //\r
-  // Write data\r
-  //\r
-  CopyMem ((UINT8 *) (LbaAddress + BlockOffset), Buffer, (UINTN) (*NumBytes));\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-FvbEraseBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Erases and initializes a firmware volume block\r
-\r
-Arguments:\r
-  Instance              - The FV instance to be erased\r
-  Lba                   - The logical block index to be erased\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The erase request was successfully completed\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
-                          could not be written. Firmware device may have been\r
-                          partially erased\r
-  EFI_INVALID_PARAMETER - Instance not found\r
-\r
---*/\r
-{\r
-\r
-  EFI_FVB_ATTRIBUTES_2  Attributes;\r
-  UINTN                 LbaAddress;\r
-  UINTN                 LbaLength;\r
-  EFI_STATUS            Status;\r
-  UINT8                 Data;\r
-\r
-  //\r
-  // Check if the FV is write enabled\r
-  //\r
-  FvbGetVolumeAttributes (Instance, &Attributes, Global, Virtual);\r
-\r
-  if ((Attributes & EFI_FVB2_WRITE_STATUS) == 0) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-  //\r
-  // Get the starting address of the block for erase.\r
-  //\r
-  Status = FvbGetLbaAddress (Instance, Lba, &LbaAddress, &LbaLength, NULL, Global, Virtual);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if ((Attributes & EFI_FVB2_ERASE_POLARITY) != 0) {\r
-    Data = 0xFF;\r
-  } else {\r
-    Data = 0x0;\r
-  }\r
-\r
-  SetMem ((UINT8 *) LbaAddress, LbaLength, Data);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-FvbSetVolumeAttributes (\r
-  IN UINTN                                Instance,\r
-  IN OUT EFI_FVB_ATTRIBUTES_2             *Attributes,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Modifies the current settings of the firmware volume according to the \r
-  input parameter, and returns the new setting of the volume\r
-\r
-Arguments:\r
-  Instance              - The FV instance whose attributes is going to be \r
-                          modified\r
-  Attributes            - On input, it is a pointer to EFI_FVB_ATTRIBUTES_2 \r
-                          containing the desired firmware volume settings.\r
-                          On successful return, it contains the new settings\r
-                          of the firmware volume\r
-  Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
-                          instance data\r
-  Virtual               - Whether CPU is in virtual or physical mode\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-  EFI_ACCESS_DENIED     - The volume setting is locked and cannot be modified\r
-  EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are\r
-                          in conflict with the capabilities as declared in the\r
-                          firmware volume header\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_INSTANCE   *FwhInstance = NULL;\r
-  EFI_FVB_ATTRIBUTES_2  OldAttributes;\r
-  EFI_FVB_ATTRIBUTES_2  *AttribPtr;\r
-  UINT32                Capabilities;\r
-  UINT32                OldStatus;\r
-  UINT32                NewStatus;\r
-  EFI_STATUS            Status;\r
-  EFI_FVB_ATTRIBUTES_2  UnchangedAttributes;\r
-\r
-\r
-  //\r
-  // Find the right instance of the FVB private data\r
-  //\r
-  Status = GetFvbInstance (Instance, Global, &FwhInstance, Virtual);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  AttribPtr     = (EFI_FVB_ATTRIBUTES_2 *) &(FwhInstance->VolumeHeader.Attributes);\r
-  OldAttributes = *AttribPtr;\r
-  Capabilities  = OldAttributes & (EFI_FVB2_READ_DISABLED_CAP | \\r
-                                   EFI_FVB2_READ_ENABLED_CAP | \\r
-                                   EFI_FVB2_WRITE_DISABLED_CAP | \\r
-                                   EFI_FVB2_WRITE_ENABLED_CAP | \\r
-                                   EFI_FVB2_LOCK_CAP \\r
-                                   );\r
-\r
-  OldStatus     = OldAttributes & EFI_FVB2_STATUS;\r
-  NewStatus     = *Attributes & EFI_FVB2_STATUS;\r
-  UnchangedAttributes = EFI_FVB2_READ_DISABLED_CAP  | \\r
-                        EFI_FVB2_READ_ENABLED_CAP   | \\r
-                        EFI_FVB2_WRITE_DISABLED_CAP | \\r
-                        EFI_FVB2_WRITE_ENABLED_CAP  | \\r
-                        EFI_FVB2_LOCK_CAP           | \\r
-                        EFI_FVB2_STICKY_WRITE       | \\r
-                        EFI_FVB2_MEMORY_MAPPED      | \\r
-                        EFI_FVB2_ERASE_POLARITY     | \\r
-                        EFI_FVB2_READ_LOCK_CAP      | \\r
-                        EFI_FVB2_WRITE_LOCK_CAP     | \\r
-                        EFI_FVB2_ALIGNMENT;\r
-\r
-  //\r
-  // Some attributes of FV is read only can *not* be set\r
-  //\r
-  if ((OldAttributes & UnchangedAttributes) ^ (*Attributes & UnchangedAttributes)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // If firmware volume is locked, no status bit can be updated\r
-  //\r
-  if (OldAttributes & EFI_FVB2_LOCK_STATUS) {\r
-    if (OldStatus ^ NewStatus) {\r
-      return EFI_ACCESS_DENIED;\r
-    }\r
-  }\r
-  //\r
-  // Test read disable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_READ_DISABLED_CAP) == 0) {\r
-    if ((NewStatus & EFI_FVB2_READ_STATUS) == 0) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test read enable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_READ_ENABLED_CAP) == 0) {\r
-    if (NewStatus & EFI_FVB2_READ_STATUS) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test write disable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_WRITE_DISABLED_CAP) == 0) {\r
-    if ((NewStatus & EFI_FVB2_WRITE_STATUS) == 0) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test write enable\r
-  //\r
-  if ((Capabilities & EFI_FVB2_WRITE_ENABLED_CAP) == 0) {\r
-    if (NewStatus & EFI_FVB2_WRITE_STATUS) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-  //\r
-  // Test lock\r
-  //\r
-  if ((Capabilities & EFI_FVB2_LOCK_CAP) == 0) {\r
-    if (NewStatus & EFI_FVB2_LOCK_STATUS) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  }\r
-\r
-  *AttribPtr  = (*AttribPtr) & (0xFFFFFFFF & (~EFI_FVB2_STATUS));\r
-  *AttribPtr  = (*AttribPtr) | NewStatus;\r
-  *Attributes = *AttribPtr;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-//\r
-// FVB protocol APIs\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetPhysicalAddress (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  OUT EFI_PHYSICAL_ADDRESS                        *Address\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Retrieves the physical address of the device.\r
-\r
-Arguments:\r
-\r
-  This                  - Calling context\r
-  Address               - Output buffer containing the address.\r
-\r
-Returns:\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbGetPhysicalAddress (FvbDevice->Instance, Address, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetBlockSize (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  IN  EFI_LBA                                     Lba,\r
-  OUT UINTN                                       *BlockSize,\r
-  OUT UINTN                                       *NumOfBlocks\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Retrieve the size of a logical block\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Lba                   - Indicates which block to return the size for.\r
-  BlockSize             - A pointer to a caller allocated UINTN in which\r
-                          the size of the block is returned\r
-  NumOfBlocks           - a pointer to a caller allocated UINTN in which the\r
-                          number of consecutive blocks starting with Lba is\r
-                          returned. All blocks in this range have a size of\r
-                          BlockSize\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was read successfully and \r
-                          contents are in Buffer\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbGetLbaAddress (\r
-          FvbDevice->Instance,\r
-          Lba,\r
-          NULL,\r
-          BlockSize,\r
-          NumOfBlocks,\r
-          mFvbModuleGlobal,\r
-          EfiGoneVirtual ()\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetAttributes (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  OUT EFI_FVB_ATTRIBUTES_2                        *Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Retrieves Volume attributes.  No polarity translations are done.\r
-\r
-Arguments:\r
-    This                - Calling context\r
-    Attributes          - output buffer which contains attributes\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbGetVolumeAttributes (FvbDevice->Instance, Attributes, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolSetAttributes (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  IN OUT EFI_FVB_ATTRIBUTES_2                     *Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Sets Volume attributes. No polarity translations are done.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Attributes            - output buffer which contains attributes\r
-\r
-Returns: \r
-  EFI_SUCCESS           - Successfully returns\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbSetVolumeAttributes (FvbDevice->Instance, Attributes, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolEraseBlocks (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL    *This,\r
-  ...  \r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The EraseBlock() function erases one or more blocks as denoted by the \r
-  variable argument list. The entire parameter list of blocks must be verified\r
-  prior to erasing any blocks.  If a block is requested that does not exist \r
-  within the associated firmware volume (it has a larger index than the last \r
-  block of the firmware volume), the EraseBlock() function must return\r
-  EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  ...                   - Starting LBA followed by Number of Lba to erase. \r
-                          a -1 to terminate the list.\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The erase request was successfully completed\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
-                          could not be written. Firmware device may have been\r
-                          partially erased\r
-\r
---*/\r
-{\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-  EFI_FW_VOL_INSTANCE     *FwhInstance = NULL;\r
-  UINTN                   NumOfBlocks;\r
-  VA_LIST                 args;\r
-  EFI_LBA                 StartingLba;\r
-  UINTN                   NumOfLba;\r
-  EFI_STATUS              Status;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  Status    = GetFvbInstance (FvbDevice->Instance, mFvbModuleGlobal, &FwhInstance, EfiGoneVirtual ());\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  NumOfBlocks = FwhInstance->NumOfBlocks;\r
-\r
-  VA_START (args, This);\r
-\r
-  do {\r
-    StartingLba = VA_ARG (args, EFI_LBA);\r
-    if (StartingLba == EFI_LBA_LIST_TERMINATOR) {\r
-      break;\r
-    }\r
-\r
-    NumOfLba = VA_ARG (args, UINT32);\r
-\r
-    //\r
-    // Check input parameters\r
-    //\r
-    if (NumOfLba == 0 || (StartingLba + NumOfLba) > NumOfBlocks) {\r
-      VA_END (args);\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-  } while (1);\r
-\r
-  VA_END (args);\r
-\r
-  VA_START (args, This);\r
-  do {\r
-    StartingLba = VA_ARG (args, EFI_LBA);\r
-    if (StartingLba == EFI_LBA_LIST_TERMINATOR) {\r
-      break;\r
-    }\r
-\r
-    NumOfLba = VA_ARG (args, UINT32);\r
-\r
-    while (NumOfLba > 0) {\r
-      Status = FvbEraseBlock (FvbDevice->Instance, StartingLba, mFvbModuleGlobal, EfiGoneVirtual ());\r
-      if (EFI_ERROR (Status)) {\r
-        VA_END (args);\r
-        return Status;\r
-      }\r
-\r
-      StartingLba++;\r
-      NumOfLba--;\r
-    }\r
-\r
-  } while (1);\r
-\r
-  VA_END (args);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolWrite (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  IN EFI_LBA                                      Lba,\r
-  IN UINTN                                        Offset,\r
-  IN OUT UINTN                                    *NumBytes,\r
-  IN UINT8                                        *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Writes data beginning at Lba:Offset from FV. The write terminates either\r
-  when *NumBytes of data have been written, or when a block boundary is\r
-  reached.  *NumBytes is updated to reflect the actual number of bytes\r
-  written. The write opertion does not include erase. This routine will\r
-  attempt to write only the specified bytes. If the writes do not stick,\r
-  it will return an error.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Lba                   - Block in which to begin write\r
-  Offset                - Offset in the block at which to begin write\r
-  NumBytes              - On input, indicates the requested write size. On\r
-                          output, indicates the actual number of bytes written\r
-  Buffer                - Buffer containing source data for the write.\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was written successfully\r
-  EFI_BAD_BUFFER_SIZE   - Write attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes\r
-                          actually written\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
-                          could not be written\r
-  EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL\r
-\r
---*/\r
-{\r
-\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbWriteBlock (FvbDevice->Instance, Lba, Offset, NumBytes, Buffer, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolRead (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  IN EFI_LBA                                      Lba,\r
-  IN UINTN                                        Offset,\r
-  IN OUT UINTN                                    *NumBytes,\r
-  IN UINT8                                        *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Reads data beginning at Lba:Offset from FV. The Read terminates either\r
-  when *NumBytes of data have been read, or when a block boundary is\r
-  reached.  *NumBytes is updated to reflect the actual number of bytes\r
-  written. The write opertion does not include erase. This routine will\r
-  attempt to write only the specified bytes. If the writes do not stick,\r
-  it will return an error.\r
-\r
-Arguments:\r
-  This                  - Calling context\r
-  Lba                   - Block in which to begin Read\r
-  Offset                - Offset in the block at which to begin Read\r
-  NumBytes              - On input, indicates the requested write size. On\r
-                          output, indicates the actual number of bytes Read\r
-  Buffer                - Buffer containing source data for the Read.\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was read successfully and \r
-                          contents are in Buffer\r
-  EFI_BAD_BUFFER_SIZE   - Read attempted across a LBA boundary. On output,\r
-                          NumBytes contains the total number of bytes returned\r
-                          in Buffer\r
-  EFI_ACCESS_DENIED     - The firmware volume is in the ReadDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
-                          could not be read\r
-  EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL\r
-\r
---*/\r
-{\r
-\r
-  EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;\r
-\r
-  FvbDevice = FVB_DEVICE_FROM_THIS (This);\r
-\r
-  return FvbReadBlock (FvbDevice->Instance, Lba, Offset, NumBytes, Buffer, mFvbModuleGlobal, EfiGoneVirtual ());\r
-}\r
-EFI_STATUS\r
-ValidateFvHeader (\r
-  EFI_FIRMWARE_VOLUME_HEADER            *FwVolHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Check the integrity of firmware volume header\r
-\r
-Arguments:\r
-  FwVolHeader           - A pointer to a firmware volume header\r
-\r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume is consistent\r
-  EFI_NOT_FOUND         - The firmware volume has corrupted. So it is not an FV\r
-\r
---*/\r
-{\r
-  UINT16  *Ptr;\r
-  UINT16  HeaderLength;\r
-  UINT16  Checksum;\r
-\r
-  //\r
-  // Verify the header revision, header signature, length\r
-  // Length of FvBlock cannot be 2**64-1\r
-  // HeaderLength cannot be an odd number\r
-  //\r
-  if ((FwVolHeader->Revision != EFI_FVH_REVISION) ||\r
-      (FwVolHeader->Signature != EFI_FVH_SIGNATURE) ||\r
-      (FwVolHeader->FvLength == ((UINTN) -1)) ||\r
-      ((FwVolHeader->HeaderLength & 0x01) != 0)\r
-      ) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-  //\r
-  // Verify the header checksum\r
-  //\r
-  HeaderLength  = (UINT16) (FwVolHeader->HeaderLength / 2);\r
-  Ptr           = (UINT16 *) FwVolHeader;\r
-  Checksum      = 0;\r
-  while (HeaderLength > 0) {\r
-    Checksum = Checksum + (*Ptr);\r
-    HeaderLength--;\r
-    Ptr++;\r
-  }\r
-\r
-  if (Checksum != 0) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbInitialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This function does common initialization for FVB services\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-{\r
-  EFI_STATUS                          Status;\r
-  EFI_FW_VOL_INSTANCE                 *FwhInstance = NULL;\r
-  EFI_FIRMWARE_VOLUME_HEADER          *FwVolHeader;\r
-  EFI_DXE_SERVICES                    *DxeServices;\r
-  EFI_GCD_MEMORY_SPACE_DESCRIPTOR     Descriptor;\r
-  UINT32                              BufferSize;\r
-  EFI_FV_BLOCK_MAP_ENTRY              *PtrBlockMapEntry;\r
-  EFI_HANDLE                          FwbHandle;\r
-  EFI_FW_VOL_BLOCK_DEVICE             *FvbDevice;\r
-  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *OldFwbInterface;\r
-  EFI_DEVICE_PATH_PROTOCOL            *TempFwbDevicePath;\r
-  FV_DEVICE_PATH                      TempFvbDevicePathData;\r
-  UINT32                              MaxLbaSize;\r
-  EFI_PHYSICAL_ADDRESS                BaseAddress;\r
-  UINT64                              Length;\r
-  UINTN                               NumOfBlocks;\r
-  EFI_PEI_HOB_POINTERS                FvHob;\r
-\r
-   //\r
-  // Get the DXE services table\r
-  //\r
-  DxeServices = gDS;\r
-\r
-  //\r
-  // Allocate runtime services data for global variable, which contains\r
-  // the private data of all firmware volume block instances\r
-  //\r
-  Status = gBS->AllocatePool (\r
-                  EfiRuntimeServicesData,\r
-                  sizeof (ESAL_FWB_GLOBAL),\r
-                  (VOID**) &mFvbModuleGlobal\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Calculate the total size for all firmware volume block instances\r
-  //\r
-  BufferSize            = 0;\r
-\r
-  FvHob.Raw = GetHobList ();\r
-  while ((FvHob.Raw = GetNextHob (EFI_HOB_TYPE_FV, FvHob.Raw)) != NULL) {\r
-    BaseAddress = FvHob.FirmwareVolume->BaseAddress;\r
-    Length      = FvHob.FirmwareVolume->Length;\r
-    //\r
-    // Check if it is a "real" flash\r
-    //\r
-    Status = DxeServices->GetMemorySpaceDescriptor (\r
-                            BaseAddress,\r
-                            &Descriptor\r
-                            );\r
-    if (EFI_ERROR (Status)) {\r
-      break;\r
-    }\r
-\r
-    if (Descriptor.GcdMemoryType != EfiGcdMemoryTypeMemoryMappedIo) {\r
-      FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-      continue;\r
-    }\r
-\r
-    FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;\r
-    Status      = ValidateFvHeader (FwVolHeader);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // Get FvbInfo\r
-      //\r
-      Status = GetFvbInfo (Length, &FwVolHeader);\r
-      if (EFI_ERROR (Status)) {\r
-        FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-        continue;\r
-      }\r
-    }\r
-\r
-    BufferSize += (sizeof (EFI_FW_VOL_INSTANCE) + FwVolHeader->HeaderLength - sizeof (EFI_FIRMWARE_VOLUME_HEADER));\r
-    FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-  }\r
-\r
-  //\r
-  // Only need to allocate once. There is only one copy of physical memory for\r
-  // the private data of each FV instance. But in virtual mode or in physical\r
-  // mode, the address of the the physical memory may be different.\r
-  //\r
-  Status = gBS->AllocatePool (\r
-                  EfiRuntimeServicesData,\r
-                  BufferSize,\r
-                  (VOID**) &mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Make a virtual copy of the FvInstance pointer.\r
-  //\r
-  FwhInstance = mFvbModuleGlobal->FvInstance[FVB_PHYSICAL];\r
-  mFvbModuleGlobal->FvInstance[FVB_VIRTUAL] = FwhInstance;\r
-\r
-  mFvbModuleGlobal->NumFv                   = 0;\r
-  MaxLbaSize = 0;\r
-\r
-  FvHob.Raw = GetHobList ();\r
-  while (NULL != (FvHob.Raw = GetNextHob (EFI_HOB_TYPE_FV, FvHob.Raw))) {\r
-    BaseAddress = FvHob.FirmwareVolume->BaseAddress;\r
-    Length      = FvHob.FirmwareVolume->Length;\r
-    //\r
-    // Check if it is a "real" flash\r
-    //\r
-    Status = DxeServices->GetMemorySpaceDescriptor (\r
-                            BaseAddress,\r
-                            &Descriptor\r
-                            );\r
-    if (EFI_ERROR (Status)) {\r
-      break;\r
-    }\r
-\r
-    if (Descriptor.GcdMemoryType != EfiGcdMemoryTypeMemoryMappedIo) {\r
-      FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-      continue;\r
-    }\r
-\r
-    FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;\r
-    Status      = ValidateFvHeader (FwVolHeader);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // Get FvbInfo to provide in FwhInstance.\r
-      //\r
-      Status = GetFvbInfo (Length, &FwVolHeader);\r
-      if (EFI_ERROR (Status)) {\r
-        FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-        continue;\r
-      }\r
-      //\r
-      //  Write healthy FV header back.\r
-      //\r
-      CopyMem (\r
-        (VOID *) (UINTN) BaseAddress,\r
-        (VOID *) FwVolHeader,\r
-        FwVolHeader->HeaderLength\r
-        );\r
-    }\r
-\r
-    FwhInstance->FvBase[FVB_PHYSICAL] = (UINTN) BaseAddress;\r
-    FwhInstance->FvBase[FVB_VIRTUAL]  = (UINTN) BaseAddress;\r
-\r
-    CopyMem ((UINTN *) &(FwhInstance->VolumeHeader), (UINTN *) FwVolHeader, FwVolHeader->HeaderLength);\r
-    FwVolHeader = &(FwhInstance->VolumeHeader);\r
-    EfiInitializeLock (&(FwhInstance->FvbDevLock), TPL_HIGH_LEVEL);\r
-\r
-    NumOfBlocks = 0;\r
-\r
-    for (PtrBlockMapEntry = FwVolHeader->BlockMap; PtrBlockMapEntry->NumBlocks != 0; PtrBlockMapEntry++) {\r
-      //\r
-      // Get the maximum size of a block. The size will be used to allocate\r
-      // buffer for Scratch space, the intermediate buffer for FVB extension\r
-      // protocol\r
-      //\r
-      if (MaxLbaSize < PtrBlockMapEntry->Length) {\r
-        MaxLbaSize = PtrBlockMapEntry->Length;\r
-      }\r
-\r
-      NumOfBlocks = NumOfBlocks + PtrBlockMapEntry->NumBlocks;\r
-    }\r
-    //\r
-    // The total number of blocks in the FV.\r
-    //\r
-    FwhInstance->NumOfBlocks = NumOfBlocks;\r
-\r
-    //\r
-    // Add a FVB Protocol Instance\r
-    //\r
-    Status = gBS->AllocatePool (\r
-                    EfiRuntimeServicesData,\r
-                    sizeof (EFI_FW_VOL_BLOCK_DEVICE),\r
-                    (VOID**) &FvbDevice\r
-                    );\r
-    ASSERT_EFI_ERROR (Status);\r
-\r
-    CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE));\r
-\r
-    FvbDevice->Instance = mFvbModuleGlobal->NumFv;\r
-    mFvbModuleGlobal->NumFv++;\r
-\r
-    //\r
-    // Set up the devicepath\r
-    //\r
-    FvbDevice->DevicePath.MemMapDevPath.StartingAddress = BaseAddress;\r
-    FvbDevice->DevicePath.MemMapDevPath.EndingAddress   = BaseAddress + (FwVolHeader->FvLength - 1);\r
-\r
-    //\r
-    // Find a handle with a matching device path that has supports FW Block protocol\r
-    //\r
-    TempFwbDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) &TempFvbDevicePathData;\r
-    CopyMem (TempFwbDevicePath, &FvbDevice->DevicePath, sizeof (FV_DEVICE_PATH));\r
-    Status = gBS->LocateDevicePath (&gEfiFirmwareVolumeBlockProtocolGuid, &TempFwbDevicePath, &FwbHandle);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // LocateDevicePath fails so install a new interface and device path\r
-      //\r
-      FwbHandle = NULL;\r
-      Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &FwbHandle,\r
-                      &gEfiFirmwareVolumeBlockProtocolGuid,\r
-                      &FvbDevice->FwVolBlockInstance,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      &FvbDevice->DevicePath,\r
-                      NULL\r
-                      );\r
-      ASSERT_EFI_ERROR (Status);\r
-    } else if (IsDevicePathEnd (TempFwbDevicePath)) {\r
-      //\r
-      // Device allready exists, so reinstall the FVB protocol\r
-      //\r
-      Status = gBS->HandleProtocol (\r
-                      FwbHandle,\r
-                      &gEfiFirmwareVolumeBlockProtocolGuid,\r
-                      (VOID**)&OldFwbInterface\r
-                      );\r
-      ASSERT_EFI_ERROR (Status);\r
-\r
-      Status = gBS->ReinstallProtocolInterface (\r
-                      FwbHandle,\r
-                      &gEfiFirmwareVolumeBlockProtocolGuid,\r
-                      OldFwbInterface,\r
-                      &FvbDevice->FwVolBlockInstance\r
-                      );\r
-      ASSERT_EFI_ERROR (Status);\r
-\r
-    } else {\r
-      //\r
-      // There was a FVB protocol on an End Device Path node\r
-      //\r
-      ASSERT (FALSE);\r
-    }\r
-\r
-    FwhInstance = (EFI_FW_VOL_INSTANCE *)\r
-      (\r
-        (UINTN) ((UINT8 *) FwhInstance) + FwVolHeader->HeaderLength +\r
-          (sizeof (EFI_FW_VOL_INSTANCE) - sizeof (EFI_FIRMWARE_VOLUME_HEADER))\r
-      );\r
-\r
-    FvHob.Raw = GET_NEXT_HOB (FvHob);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c b/UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c
deleted file mode 100644 (file)
index ebfa28d..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  FvbInfo.c\r
-\r
-Abstract:\r
-\r
-  Defines data structure that is the volume header found.These data is intent\r
-  to decouple FVB driver with FV header.\r
-\r
---*/\r
-#include "PiDxe.h"\r
-#include <Guid/EventGroup.h>\r
-#include <Protocol/FirmwareVolumeBlock.h>\r
-#include <Protocol/DevicePath.h>\r
-\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DxeServicesTableLib.h>\r
-#include <Library/UefiRuntimeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-#include <Guid/FirmwareFileSystem2.h>\r
-#include <Guid/SystemNvDataGuid.h>\r
-\r
-typedef struct {\r
-  UINT64                      FvLength;\r
-  EFI_FIRMWARE_VOLUME_HEADER  FvbInfo;\r
-  //\r
-  // EFI_FV_BLOCK_MAP_ENTRY    ExtraBlockMap[n];//n=0\r
-  //\r
-  EFI_FV_BLOCK_MAP_ENTRY      End[1];\r
-} EFI_FVB_MEDIA_INFO;\r
-\r
-EFI_FVB_MEDIA_INFO  mPlatformFvbMediaInfo[] = {\r
-  //\r
-  // Recovery BOIS FVB\r
-  //\r
-  {\r
-    FixedPcdGet32 (PcdUnixFlashFvRecoverySize),\r
-    {\r
-      {\r
-        0,\r
-      },  // ZeroVector[16]\r
-      EFI_FIRMWARE_FILE_SYSTEM2_GUID,\r
-      FixedPcdGet32 (PcdUnixFlashFvRecoverySize),\r
-      EFI_FVH_SIGNATURE,\r
-      EFI_FVB2_READ_ENABLED_CAP |\r
-        EFI_FVB2_READ_STATUS |\r
-        EFI_FVB2_WRITE_ENABLED_CAP |\r
-        EFI_FVB2_WRITE_STATUS |\r
-        EFI_FVB2_ERASE_POLARITY,\r
-      sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),\r
-      0,  // CheckSum\r
-      0,  // ExtHeaderOffset\r
-      {\r
-        0,\r
-      },  // Reserved[1]\r
-      2,  // Revision\r
-      {\r
-        {\r
-          FixedPcdGet32 (PcdUnixFlashFvRecoverySize)/FixedPcdGet32 (PcdUnixFirmwareBlockSize),\r
-          FixedPcdGet32 (PcdUnixFirmwareBlockSize),\r
-        }\r
-      }\r
-    },\r
-    {\r
-      {\r
-        0,\r
-        0\r
-      }\r
-    }\r
-  },\r
-  //\r
-  // Systen NvStorage FVB\r
-  //\r
-  {\r
-    FixedPcdGet32 (PcdFlashNvStorageVariableSize) + \\r
-    FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + \\r
-    FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) + \\r
-    FixedPcdGet32 (PcdUnixFlashNvStorageEventLogSize),\r
-    {\r
-      {\r
-        0,\r
-      },  // ZeroVector[16]\r
-      EFI_SYSTEM_NV_DATA_FV_GUID,\r
-      FixedPcdGet32 (PcdFlashNvStorageVariableSize) + \\r
-      FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + \\r
-      FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) + \\r
-      FixedPcdGet32 (PcdUnixFlashNvStorageEventLogSize),\r
-      EFI_FVH_SIGNATURE,\r
-      EFI_FVB2_READ_ENABLED_CAP |\r
-        EFI_FVB2_READ_STATUS |\r
-        EFI_FVB2_WRITE_ENABLED_CAP |\r
-        EFI_FVB2_WRITE_STATUS |\r
-        EFI_FVB2_ERASE_POLARITY,\r
-      sizeof (EFI_FIRMWARE_VOLUME_HEADER) + sizeof (EFI_FV_BLOCK_MAP_ENTRY),\r
-      0,  // CheckSum\r
-      0,  // ExtHeaderOffset\r
-      {\r
-        0,\r
-      },  // Reserved[1]\r
-      2,  // Revision\r
-      {\r
-        {\r
-          (FixedPcdGet32 (PcdFlashNvStorageVariableSize) + \\r
-          FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + \\r
-          FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) + \\r
-          FixedPcdGet32 (PcdUnixFlashNvStorageEventLogSize)) / FixedPcdGet32 (PcdUnixFirmwareBlockSize),\r
-          FixedPcdGet32 (PcdUnixFirmwareBlockSize),\r
-        }\r
-      }\r
-    },\r
-    {\r
-      {\r
-        0,\r
-        0\r
-      }\r
-    }\r
-  }\r
-};\r
-\r
-EFI_STATUS\r
-GetFvbInfo (\r
-  IN  UINT64                        FvLength,\r
-  OUT EFI_FIRMWARE_VOLUME_HEADER    **FvbInfo\r
-  )\r
-{\r
-  UINTN Index;\r
-\r
-  for (Index = 0; Index < sizeof (mPlatformFvbMediaInfo) / sizeof (EFI_FVB_MEDIA_INFO); Index += 1) {\r
-    if (mPlatformFvbMediaInfo[Index].FvLength == FvLength) {\r
-      *FvbInfo = &mPlatformFvbMediaInfo[Index].FvbInfo;\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
diff --git a/UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h b/UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h
deleted file mode 100644 (file)
index b6d0c2e..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  FwBlockService.h\r
-  \r
-Abstract:\r
-\r
-  Firmware volume block driver for Intel Firmware Hub (FWH) device\r
-\r
---*/\r
-\r
-#ifndef _FW_BLOCK_SERVICE_H\r
-#define _FW_BLOCK_SERVICE_H\r
-\r
-//\r
-// BugBug: Add documentation here for data structure!!!!\r
-//\r
-#define FVB_PHYSICAL  0\r
-#define FVB_VIRTUAL   1\r
-\r
-typedef struct {\r
-  EFI_LOCK                    FvbDevLock;\r
-  UINTN                       FvBase[2];\r
-  UINTN                       NumOfBlocks;\r
-  EFI_FIRMWARE_VOLUME_HEADER  VolumeHeader;\r
-} EFI_FW_VOL_INSTANCE;\r
-\r
-typedef struct {\r
-  UINT32              NumFv;\r
-  EFI_FW_VOL_INSTANCE *FvInstance[2];\r
-} ESAL_FWB_GLOBAL;\r
-\r
-//\r
-// Fvb Protocol instance data\r
-//\r
-#define FVB_DEVICE_FROM_THIS(a)         CR (a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)\r
-#define FVB_EXTEND_DEVICE_FROM_THIS(a)  CR (a, EFI_FW_VOL_BLOCK_DEVICE, FvbExtension, FVB_DEVICE_SIGNATURE)\r
-#define FVB_DEVICE_SIGNATURE            SIGNATURE_32 ('F', 'V', 'B', 'N')\r
-\r
-typedef struct {\r
-  MEMMAP_DEVICE_PATH        MemMapDevPath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevPath;\r
-} FV_DEVICE_PATH;\r
-\r
-typedef struct {\r
-  UINTN                               Signature;\r
-  FV_DEVICE_PATH                      DevicePath;\r
-  UINTN                               Instance;\r
-  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  FwVolBlockInstance;\r
-} EFI_FW_VOL_BLOCK_DEVICE;\r
-\r
-EFI_STATUS\r
-GetFvbInfo (\r
-  IN  UINT64                            FvLength,\r
-  OUT EFI_FIRMWARE_VOLUME_HEADER        **FvbInfo\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-FvbReadBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-FvbWriteBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN UINTN                                BlockOffset,\r
-  IN OUT UINTN                            *NumBytes,\r
-  IN UINT8                                *Buffer,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-FvbEraseBlock (\r
-  IN UINTN                                Instance,\r
-  IN EFI_LBA                              Lba,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-FvbSetVolumeAttributes (\r
-  IN UINTN                                Instance,\r
-  IN OUT EFI_FVB_ATTRIBUTES_2             *Attributes,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-FvbGetVolumeAttributes (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_FVB_ATTRIBUTES_2                *Attributes,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-FvbGetPhysicalAddress (\r
-  IN UINTN                                Instance,\r
-  OUT EFI_PHYSICAL_ADDRESS                *Address,\r
-  IN ESAL_FWB_GLOBAL                      *Global,\r
-  IN BOOLEAN                              Virtual\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbInitialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-;\r
-\r
-\r
-VOID\r
-EFIAPI\r
-FvbClassAddressChangeEvent (\r
-  IN EFI_EVENT        Event,\r
-  IN VOID             *Context\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-FvbGetLbaAddress (\r
-  IN  UINTN                               Instance,\r
-  IN  EFI_LBA                             Lba,\r
-  OUT UINTN                               *LbaAddress,\r
-  OUT UINTN                               *LbaLength,\r
-  OUT UINTN                               *NumOfBlocks,\r
-  IN  ESAL_FWB_GLOBAL                     *Global,\r
-  IN  BOOLEAN                             Virtual\r
-  )\r
-;\r
-\r
-//\r
-// Protocol APIs\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetAttributes (\r
-  IN  CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  OUT       EFI_FVB_ATTRIBUTES_2                         *Attributes\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolSetAttributes (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  IN OUT   EFI_FVB_ATTRIBUTES_2                         *Attributes\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetPhysicalAddress (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
-  OUT      EFI_PHYSICAL_ADDRESS                         *Address\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolGetBlockSize (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  IN  EFI_LBA                                     Lba,\r
-  OUT UINTN                                       *BlockSize,\r
-  OUT UINTN                                       *NumOfBlocks\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolRead (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  IN EFI_LBA                                      Lba,\r
-  IN UINTN                                        Offset,\r
-  IN OUT UINTN                                    *NumBytes,\r
-  IN UINT8                                        *Buffer\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolWrite (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL     *This,\r
-  IN EFI_LBA                                      Lba,\r
-  IN UINTN                                        Offset,\r
-  IN OUT UINTN                                    *NumBytes,\r
-  IN UINT8                                        *Buffer\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-FvbProtocolEraseBlocks (\r
-  IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL    *This,\r
-  ...\r
-  )\r
-;\r
-\r
-#endif\r
diff --git a/UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf b/UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf
deleted file mode 100644 (file)
index 5f350b8..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-## @file\r
-# Component description file for Unix Fimware Volume Block DXE driver module.\r
-#\r
-# This DXE runtime driver implements and produces the Fimware Volue Block Protocol on \r
-#  Unix emulator.\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = FwBlockService\r
-  FILE_GUID                      = f42fd042-8985-11db-a7db-0040d02b1835\r
-  MODULE_TYPE                    = DXE_RUNTIME_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = FvbInitialize\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  FvbInfo.c\r
-  FWBlockService.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  HobLib\r
-  DebugLib\r
-  UefiRuntimeLib\r
-  DxeServicesTableLib\r
-  BaseLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  DevicePathLib\r
-\r
-[Guids]\r
-  gEfiEventVirtualAddressChangeGuid             # ALWAYS_CONSUMED  Create Event: EVENT_GROUP_GUID\r
-\r
-[Protocols]\r
-  gEfiFirmwareVolumeBlockProtocolGuid           # PROTOCOL ALWAYS_PRODUCED\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL SOMETIMES_PRODUCED\r
-\r
-[FixedPcd]\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareBlockSize\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoveryBase\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoverySize\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogBase\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogSize\r
-\r
-[Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase\r
-\r
-[Depex]\r
-  TRUE\r
-\r
diff --git a/UnixPkg/Include/Common/UnixInclude.h b/UnixPkg/Include/Common/UnixInclude.h
deleted file mode 100644 (file)
index 3dbe09d..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-  UnixInclude.h\r
-\r
-Abstract:\r
-  Public include file for the Unix Library\r
-\r
---*/\r
-\r
-#ifndef __UNIX_INCLUDE_H__\r
-#define __UNIX_INCLUDE_H__\r
-\r
-// #include <sys/poll.h>\r
-// #include <dirent.h>\r
-\r
-//\r
-// Name mangle to prevent build errors. I.e conflicts between EFI and OS\r
-//\r
-#define NTOHL   _UNIX_EFI_NAME_MANGLE_NTOHL_\r
-#define HTONL   _UNIX_EFI_NAME_MANGLE_HTONL_\r
-#define NTOHS   _UNIX_EFI_NAME_MANGLE_NTOHS_\r
-#define HTONS   _UNIX_EFI_NAME_MANGLE_HTOHS_\r
-#define B0      _UNIX_EFI_NAME_MANGLE_B0_\r
-\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-#include <sys/termios.h>\r
-#include <sys/time.h>\r
-\r
-#if __CYGWIN__\r
-#include <sys/dirent.h>\r
-#else\r
-#include <sys/dir.h>\r
-#endif\r
-\r
-#include <unistd.h>\r
-#include <poll.h>\r
-#include <fcntl.h>\r
-#include <time.h>\r
-#include <signal.h>\r
-#include <errno.h>\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include <sys/ioctl.h>\r
-\r
-#include <sys/socket.h>\r
-#include <netdb.h>\r
-#include <netinet/in.h>\r
-#include <net/if.h>\r
-#include <ifaddrs.h>\r
-\r
-#ifdef __APPLE__\r
-#include <net/if_dl.h>\r
-#include <net/bpf.h>\r
-#include <sys/param.h>\r
-#include <sys/mount.h>\r
-#define _XOPEN_SOURCE\r
-#ifndef _Bool\r
-  #define _Bool char // for clang debug\r
-#endif\r
-#else\r
-#include <termio.h>\r
-#include <sys/vfs.h>\r
-#endif \r
-\r
-#include <utime.h>\r
-\r
-#if __APPLE__\r
-//\r
-// EFI packing is not compatible witht he default OS packing for struct stat.\r
-// st_size is 64-bit but starts on a 32-bit offset in the structure. The compiler\r
-// flags used to produce compatible EFI images, break struct stat\r
-//\r
-#ifdef MDE_CPU_IA32\r
-#pragma pack(4)\r
-#endif\r
-\r
-#if defined(__DARWIN_64_BIT_INO_T)\r
-\r
-\r
-typedef struct {\r
-  UINTN  tv_sec;    /* seconds */\r
-  UINTN  tv_nsec;  /* and nanoseconds */\r
-} EFI_timespec;\r
-\r
-\r
-\r
-typedef struct stat_fix { \\r
-  dev_t    st_dev;      /* [XSI] ID of device containing file */ \r
-  mode_t    st_mode;    /* [XSI] Mode of file (see below) */ \r
-  nlink_t    st_nlink;    /* [XSI] Number of hard links */ \r
-  __darwin_ino64_t st_ino;    /* [XSI] File serial number */ \r
-  uid_t    st_uid;      /* [XSI] User ID of the file */ \r
-  gid_t    st_gid;      /* [XSI] Group ID of the file */ \r
-  dev_t    st_rdev;    /* [XSI] Device ID */ \r
-\r
-  // clang for X64 ABI follows Windows and a long is 32-bits\r
-  // this breaks system inlcude files so that is why we need\r
-  // to redefine timespec as EFI_timespec \r
-  EFI_timespec  st_atimespec;\r
-  EFI_timespec  st_mtimespec;\r
-  EFI_timespec  st_ctimespec;\r
-  EFI_timespec  st_birthtimespec;\r
-\r
-  off_t    st_size;    /* [XSI] file size, in bytes */ \r
-  blkcnt_t  st_blocks;    /* [XSI] blocks allocated for file */ \r
-  blksize_t  st_blksize;    /* [XSI] optimal blocksize for I/O */ \r
-  __uint32_t  st_flags;    /* user defined flags for file */ \r
-  __uint32_t  st_gen;      /* file generation number */ \r
-  __int32_t  st_lspare;    /* RESERVED: DO NOT USE! */ \r
-  __int64_t  st_qspare[2];    /* RESERVED: DO NOT USE! */ \r
-} STAT_FIX;\r
-\r
-#else /* !__DARWIN_64_BIT_INO_T */\r
-\r
-typedef struct stat_fix {\r
-  dev_t     st_dev;    /* [XSI] ID of device containing file */\r
-  ino_t      st_ino;    /* [XSI] File serial number */\r
-  mode_t     st_mode;  /* [XSI] Mode of file (see below) */\r
-  nlink_t    st_nlink;  /* [XSI] Number of hard links */\r
-  uid_t    st_uid;    /* [XSI] User ID of the file */\r
-  gid_t    st_gid;    /* [XSI] Group ID of the file */\r
-  dev_t    st_rdev;  /* [XSI] Device ID */\r
-#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)\r
-  struct  timespec st_atimespec;  /* time of last access */\r
-  struct  timespec st_mtimespec;  /* time of last data modification */\r
-  struct  timespec st_ctimespec;  /* time of last status change */\r
-#else\r
-  time_t    st_atime;  /* [XSI] Time of last access */\r
-  long    st_atimensec;  /* nsec of last access */\r
-  time_t    st_mtime;  /* [XSI] Last data modification time */\r
-  long    st_mtimensec;  /* last data modification nsec */\r
-  time_t    st_ctime;  /* [XSI] Time of last status change */\r
-  long    st_ctimensec;  /* nsec of last status change */\r
-#endif\r
-  off_t    st_size;  /* [XSI] file size, in bytes */\r
-  blkcnt_t  st_blocks;  /* [XSI] blocks allocated for file */\r
-  blksize_t  st_blksize;  /* [XSI] optimal blocksize for I/O */\r
-  __uint32_t  st_flags;  /* user defined flags for file */\r
-  __uint32_t  st_gen;    /* file generation number */\r
-  __int32_t  st_lspare;  /* RESERVED: DO NOT USE! */\r
-  __int64_t  st_qspare[2];  /* RESERVED: DO NOT USE! */\r
-} STAT_FIX;\r
-\r
-#endif\r
-\r
-#ifdef MDE_CPU_IA32\r
-#pragma pack(4)\r
-#endif\r
-\r
-#else \r
-\r
-  typedef struct stat STAT_FIX;\r
-\r
-#endif\r
-\r
-//\r
-// Undo name mangling\r
-//\r
-#undef NTOHL\r
-#undef HTONL\r
-#undef NTOHS\r
-#undef HTONS\r
-#undef B0\r
-\r
-\r
-#endif\r
-\r
diff --git a/UnixPkg/Include/FlashLayout.h b/UnixPkg/Include/FlashLayout.h
deleted file mode 100644 (file)
index 5fa197b..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  FlashLayout.h\r
-   \r
-Abstract:\r
-\r
-  Platform specific flash layout\r
-\r
-  BugBug: We need a better way\r
-\r
---*/\r
-\r
-#ifndef __EFI_FLASH_LAYOUT__\r
-#define __EFI_FLASH_LAYOUT__\r
-\r
-//\r
-// Firmware Volume Information for Nt32\r
-// adding one working block before FFS FV,\r
-// and another one for spare block behind FFS FV\r
-//\r
-//\r
-// Note: When block number is changed in .dsc file,\r
-//       this value should be changed accordingly!!!\r
-//\r
-#define FIRMWARE_BLOCK_NUMBER                         0x28\r
-\r
-#define EFI_WINNT_FIRMWARE_OFFSET                     0x0\r
-#define EFI_WINNT_FIRMWARE_LENGTH                     (0x10000 * FIRMWARE_BLOCK_NUMBER)\r
-\r
-#define EFI_WINNT_RUNTIME_UPDATABLE_OFFSET            (EFI_WINNT_FIRMWARE_OFFSET + EFI_WINNT_FIRMWARE_LENGTH)\r
-\r
-#define EFI_WINNT_RUNTIME_UPDATABLE_LENGTH            0x10000\r
-\r
-#define EFI_WINNT_FTW_SPARE_BLOCK_OFFSET              (EFI_WINNT_RUNTIME_UPDATABLE_OFFSET + EFI_WINNT_RUNTIME_UPDATABLE_LENGTH)\r
-\r
-#define EFI_WINNT_FTW_SPARE_BLOCK_LENGTH              0x10000\r
-\r
-#define EFI_WINNT_RUNTIME_UPDATABLE_FV_HEADER_LENGTH  0x48\r
-\r
-#define EFI_VARIABLE_STORE_OFFSET                     EFI_WINNT_RUNTIME_UPDATABLE_OFFSET\r
-\r
-#define EFI_VARIABLE_STORE_LENGTH                     0x00C000\r
-\r
-#define EFI_EVENT_LOG_OFFSET                          (EFI_VARIABLE_STORE_OFFSET + EFI_VARIABLE_STORE_LENGTH)\r
-\r
-#define EFI_EVENT_LOG_LENGTH                          0x002000\r
-\r
-#define EFI_FTW_WORKING_OFFSET                        (EFI_EVENT_LOG_OFFSET + EFI_EVENT_LOG_LENGTH)\r
-\r
-#define EFI_FTW_WORKING_LENGTH                        0x002000\r
-\r
-#endif\r
-\r
diff --git a/UnixPkg/Include/Guid/UnixSystemConfig.h b/UnixPkg/Include/Guid/UnixSystemConfig.h
deleted file mode 100644 (file)
index dc56beb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/**@file\r
-  Setup Variable data structure for Unix platform.\r
-\r
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-\r
-**/\r
-\r
-#ifndef __UNIX_SYSTEM_CONFIGUE_H__\r
-#define __UNIX_SYSTEM_CONFIGUE_H__\r
-\r
-#define EFI_UXIX_SYSTEM_CONFIG_GUID  \\r
-  {0x375ea976, 0x3ccd, 0x4e74, {0xa8, 0x45, 0x26, 0xb9, 0xb3, 0x24, 0xb1, 0x3c}}\r
-\r
-\r
-#pragma pack(1)\r
-typedef struct {\r
-  //\r
-  // Console output mode\r
-  //\r
-  UINT32        ConOutColumn;\r
-  UINT32        ConOutRow;\r
-} UNIX_SYSTEM_CONFIGURATION;\r
-#pragma pack()\r
-\r
-\r
-extern EFI_GUID   gEfiUnixSystemConfigGuid;\r
-\r
-#endif\r
diff --git a/UnixPkg/Include/Library/SecDispatchTableLib.h b/UnixPkg/Include/Library/SecDispatchTableLib.h
deleted file mode 100644 (file)
index 9e22007..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/** @file
-  Allows an override of the SEC SEC PPI Dispatch Table. This allows 
-  customized PPIs to be passed into the PEI Core.
-
-Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#ifndef __SEC_DISPATCH_TABLE_LIB_H__
-#define __SEC_DISPATCH_TABLE_LIB_H__
-
-
-/**
-  Return the number of bytes that OverrideDispatchTable() will append to
-  the dispatch table.
-
-  @return  Size of table in bytes OverrideDispatchTable() will return
-
-**/
-UINTN
-EFIAPI
-OverrideDispatchTableExtraSize (
-  VOID
-  );
-  
-
-/**
-  Allow an override of the Sec PPI Dispatch Table. This table contains PPIs passed
-  up from SEC to PEI. 
-
-  @param  OriginalTable         SECs default PPI dispatch table
-  @param  OriginalTableSize     Size of SECs default PPI dispatch table
-  @param  NewTable              New dispatch table
-  @param  NewTableSize          Size of of the NewTable in bytes
-
-  @return EFI_SUCCESS table was copied
-
-**/
-EFI_STATUS
-EFIAPI
-OverrideDispatchTable (
-  IN CONST EFI_PEI_PPI_DESCRIPTOR          *OriginalTable,
-  IN       UINTN                           OriginalTableSize,
-  IN OUT   EFI_PEI_PPI_DESCRIPTOR          *NewTable,
-  IN       UINTN                           NewTableSize
-  );
-
-
-#endif
diff --git a/UnixPkg/Include/Library/UnixLib.h b/UnixPkg/Include/Library/UnixLib.h
deleted file mode 100644 (file)
index 32ed2e5..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*++
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials                          
-are licensed and made available under the terms and conditions of the BSD License         
-which accompanies this distribution.  The full text of the license may be found at        
-http://opensource.org/licenses/bsd-license.php                                            
-                                                                                          
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
-
-Module Name:
-
-  UnixLib.h
-
-Abstract:
-
-  Public include file for the Unix Library
-
---*/
-
-#ifndef __UNIX_LIB_H__
-#define __UNIX_LIB_H__
-
-extern EFI_UNIX_THUNK_PROTOCOL  *gUnix;
-
-#endif
diff --git a/UnixPkg/Include/Ppi/UnixAutoScan.h b/UnixPkg/Include/Ppi/UnixAutoScan.h
deleted file mode 100644 (file)
index 577fd71..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixAutoscan.h\r
-\r
-Abstract:\r
-\r
-Unix Autoscan PPI\r
-\r
---*/\r
-\r
-#ifndef __UNIX_PEI_AUTOSCAN_H__\r
-#define __UNIX_PEI_AUTOSCAN_H__\r
-\r
-#include <UnixDxe.h>\r
-\r
-#define PEI_UNIX_AUTOSCAN_PPI_GUID \\r
-  { \\r
-    0xf2ed3d14, 0x8985, 0x11db, {0xb0, 0x57, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *PEI_UNIX_AUTOSCAN) (\r
-  IN  UINTN                 Index,\r
-  OUT EFI_PHYSICAL_ADDRESS  *MemoryBase,\r
-  OUT UINT64                *MemorySize\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  This service is called from Index == 0 until it returns EFI_UNSUPPORTED.\r
-  It allows discontiguous memory regions to be supported by the emulator.\r
-  It uses gSystemMemory[] and gSystemMemoryCount that were created by\r
-  parsing the host environment variable EFI_MEMORY_SIZE.\r
-  The size comes from the varaible and the address comes from the call to\r
-  WinNtOpenFile. \r
-\r
-Arguments:\r
-  Index      - Which memory region to use\r
-  MemoryBase - Return Base address of memory region\r
-  MemorySize - Return size in bytes of the memory region\r
-\r
-Returns:\r
-  EFI_SUCCESS - If memory region was mapped\r
-  EFI_UNSUPPORTED - If Index is not supported\r
-\r
---*/\r
-typedef struct {\r
-  PEI_UNIX_AUTOSCAN UnixAutoScan;\r
-} PEI_UNIX_AUTOSCAN_PPI;\r
-\r
-extern EFI_GUID gPeiUnixAutoScanPpiGuid;\r
-\r
-#endif\r
diff --git a/UnixPkg/Include/Ppi/UnixFwh.h b/UnixPkg/Include/Ppi/UnixFwh.h
deleted file mode 100644 (file)
index 1befccf..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixFwh.h\r
-\r
-Abstract:\r
-\r
-  Unix FWH PPI as defined in Tiano\r
-\r
---*/\r
-\r
-#ifndef __UNIX_PEI_FWH_H__\r
-#define __UNIX_PEI_FWH_H__\r
-\r
-#include <UnixDxe.h>\r
-\r
-#define UNIX_FWH_PPI_GUID \\r
-  { \\r
-    0xf2f0dc30, 0x8985, 0x11db, {0xa1, 0x5b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *UNIX_FWH_INFORMATION) (\r
-  IN     UINTN                  Index,\r
-  IN OUT EFI_PHYSICAL_ADDRESS   *FdBase,\r
-  IN OUT UINT64                 *FdSize,\r
-  IN OUT EFI_PHYSICAL_ADDRESS   *FixUp\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  Return the FD Size and base address. Since the FD is loaded from a \r
-  file into host memory only the SEC will know it's address.\r
-\r
-Arguments:\r
-  Index  - Which FD, starts at zero.\r
-  FdSize - Size of the FD in bytes\r
-  FdBase - Start address of the FD. Assume it points to an FV Header\r
-  FixUp  - Difference between actual FD address and build address\r
-\r
-Returns:\r
-  EFI_SUCCESS     - Return the Base address and size of the FV\r
-  EFI_UNSUPPORTED - Index does nto map to an FD in the system\r
-\r
---*/\r
-typedef struct {\r
-  UNIX_FWH_INFORMATION  UnixFwh;\r
-} UNIX_FWH_PPI;\r
-\r
-extern EFI_GUID gUnixFwhPpiGuid;\r
-\r
-#endif\r
diff --git a/UnixPkg/Include/Ppi/UnixPeiLoadFile.h b/UnixPkg/Include/Ppi/UnixPeiLoadFile.h
deleted file mode 100644 (file)
index f1de509..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
- UnixPeiLoadFile.h\r
-\r
-Abstract:\r
-\r
-  Unix Load File PPI.\r
-\r
-  When the PEI core is done it calls the DXE IPL via PPI\r
-\r
---*/\r
-\r
-#ifndef __UNIX_PEI_LOAD_FILE_H__\r
-#define __UNIX_PEI_LOAD_FILE_H__\r
-\r
-#include <UnixDxe.h>\r
-\r
-#define UNIX_PEI_LOAD_FILE_GUID \\r
-  { \\r
-    0xf2f48768, 0x8985, 0x11db, {0xb8, 0xda, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *UNIX_PEI_LOAD_FILE) (\r
-  VOID                  *Pe32Data,\r
-  EFI_PHYSICAL_ADDRESS  *ImageAddress,\r
-  UINT64                *ImageSize,\r
-  EFI_PHYSICAL_ADDRESS  *EntryPoint\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  Loads and relocates a PE/COFF image into memory.\r
-\r
-Arguments:\r
-  Pe32Data         - The base address of the PE/COFF file that is to be loaded and relocated\r
-  ImageAddress     - The base address of the relocated PE/COFF image\r
-  ImageSize        - The size of the relocated PE/COFF image\r
-  EntryPoint       - The entry point of the relocated PE/COFF image\r
-\r
-Returns:\r
-  EFI_SUCCESS   - The file was loaded and relocated\r
-  EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file\r
-\r
---*/\r
-typedef struct {\r
-  UNIX_PEI_LOAD_FILE  PeiLoadFileService;\r
-} UNIX_PEI_LOAD_FILE_PPI;\r
-\r
-extern EFI_GUID gUnixPeiLoadFilePpiGuid;\r
-\r
-#endif\r
diff --git a/UnixPkg/Include/Ppi/UnixThunk.h b/UnixPkg/Include/Ppi/UnixThunk.h
deleted file mode 100644 (file)
index 96076a3..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixThunk.h\r
-\r
-Abstract:\r
-\r
-  Unix Thunk interface PPI\r
-\r
---*/\r
-\r
-#ifndef __UNIX_PEI_UNIX_THUNK_H__\r
-#define __UNIX_PEI_UNIX_THUNK_H__\r
-\r
-#include <UnixDxe.h>\r
-\r
-#define PEI_UNIX_THUNK_PPI_GUID \\r
-  { \\r
-    0xf2f830f2, 0x8985, 0x11db, {0x80, 0x6b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-typedef\r
-VOID *\r
-(EFIAPI *PEI_UNIX_THUNK_INTERFACE) (\r
-  VOID\r
-  );\r
-\r
-/*++\r
-\r
-Routine Description:\r
-  Export of EFI_UNIX_THUNK_PROTOCOL from the Unix SEC.\r
-\r
-Arguments:\r
-  InterfaceBase - Address of the EFI_UNIX_THUNK_PROTOCOL\r
-\r
-Returns:\r
-  EFI_SUCCESS - Data returned\r
-\r
---*/\r
-typedef struct {\r
-  PEI_UNIX_THUNK_INTERFACE  UnixThunk;\r
-} PEI_UNIX_THUNK_PPI;\r
-\r
-extern EFI_GUID gPeiUnixThunkPpiGuid;\r
-\r
-#endif\r
diff --git a/UnixPkg/Include/Protocol/UnixIo.h b/UnixPkg/Include/Protocol/UnixIo.h
deleted file mode 100644 (file)
index c9b91ef..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixIo.h\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#ifndef _UNIX_IO_H_\r
-#define _UNIX_IO_H_\r
-\r
-#include <Protocol/UnixThunk.h>\r
-\r
-#define EFI_UNIX_IO_PROTOCOL_GUID \\r
-  { \\r
-    0xf2e23f54, 0x8985, 0x11db, {0xac, 0x79, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-typedef struct {\r
-  EFI_UNIX_THUNK_PROTOCOL  *UnixThunk;\r
-  EFI_GUID                  *TypeGuid;\r
-  UINT16                    *EnvString;\r
-  UINT16                    InstanceNumber;\r
-} EFI_UNIX_IO_PROTOCOL;\r
-\r
-extern EFI_GUID gEfiUnixIoProtocolGuid;\r
-\r
-//\r
-// The following GUIDs are used in EFI_UNIX_IO_PROTOCOL_GUID\r
-// Device paths. They map 1:1 with UNIX envirnment variables. The variables\r
-// define what virtual hardware the emulator/UnixBusDriver will produce.\r
-//\r
-//\r
-// EFI_UNIX_VIRTUAL_DISKS\r
-//\r
-#define EFI_UNIX_VIRTUAL_DISKS_GUID \\r
-  { \\r
-    0xf2ba331a, 0x8985, 0x11db, {0xa4, 0x06, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixVirtualDisksGuid;\r
-\r
-//\r
-// EFI_UNIX_PHYSICAL_DISKS\r
-//\r
-#define EFI_UNIX_PHYSICAL_DISKS_GUID \\r
-  { \\r
-    0xf2bdcc96, 0x8985, 0x11db, {0x87, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixPhysicalDisksGuid;\r
-\r
-//\r
-// EFI_UNIX_FILE_SYSTEM\r
-//\r
-#define EFI_UNIX_FILE_SYSTEM_GUID \\r
-  { \\r
-    0xf2c16b9e, 0x8985, 0x11db, {0x92, 0xc8, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixFileSystemGuid;\r
-\r
-//\r
-// EFI_WIN_NT_SERIAL_PORT\r
-//\r
-#define EFI_UNIX_SERIAL_PORT_GUID \\r
-  { \\r
-    0x6d3a727d, 0x66c8, 0x4d19, {0x87, 0xe6, 0x2, 0x15, 0x86, 0x14, 0x90, 0xf3} \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixSerialPortGuid;\r
-\r
-//\r
-// EFI_UNIX_UGA\r
-//\r
-#define EFI_UNIX_UGA_GUID \\r
-  { \\r
-    0xf2c8b80e, 0x8985, 0x11db, {0x93, 0xf1, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixUgaGuid;\r
-\r
-//\r
-// EFI_UNIX_GOP\r
-//\r
-#define EFI_UNIX_GOP_GUID \\r
-  { \\r
-    0xbace07c2, 0x8987, 0x11db, {0xa5, 0x9a, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixGopGuid;\r
-\r
-//\r
-// EFI_UNIX_CONSOLE\r
-//\r
-#define EFI_UNIX_CONSOLE_GUID \\r
-  { \\r
-    0xf2cc5d06, 0x8985, 0x11db, {0xbb, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixConsoleGuid;\r
-\r
-//\r
-// EFI_UNIX_MEMORY\r
-//\r
-#define EFI_UNIX_MEMORY_GUID \\r
-  { \\r
-    0xf2d006cc, 0x8985, 0x11db, {0xa4, 0x72, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixMemoryGuid;\r
-\r
-//\r
-// EFI_UNIX_CPU_MODEL\r
-//\r
-#define EFI_UNIX_CPU_MODEL_GUID \\r
-  { \\r
-    0xf2d3b330, 0x8985, 0x11db, {0x8a, 0xa3, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixCPUModelGuid;\r
-\r
-//\r
-// EFI_UNIX_CPU_SPEED\r
-//\r
-#define EFI_UNIX_CPU_SPEED_GUID \\r
-  { \\r
-    0xf2d74e5a, 0x8985, 0x11db, {0x97, 0x05, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixCPUSpeedGuid;\r
-\r
-//\r
-// EFI_UNIX_NETWORK\r
-//\r
-#define EFI_UNIX_NETWORK_GUID \\r
-  { \\r
-    0x081603B4, 0x0F1D, 0x4022, {0xB6, 0xFD, 0x4C, 0xE3, 0x5E, 0x09, 0xA1, 0xA6 } \\r
-  }\r
-\r
-extern EFI_GUID gEfiUnixNetworkGuid;\r
-\r
-#endif\r
diff --git a/UnixPkg/Include/Protocol/UnixThunk.h b/UnixPkg/Include/Protocol/UnixThunk.h
deleted file mode 100644 (file)
index 476dcc6..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-  UnixThunk.h
-
-Abstract:
-
-  This protocol allows an EFI driver in the Unix emulation environment
-  to make Posix calls.
-
-  NEVER make an Unix call directly, always make the call via this protocol.
-
-  There are no This pointers on the protocol member functions as they map
-  exactly into Unix system calls.
-
---*/
-
-#ifndef _UNIX_THUNK_H_
-#define _UNIX_THUNK_H_
-
-#include <Common/UnixInclude.h>
-
-#include <Base.h>
-#include <Library/PeCoffLib.h>
-
-
-
-#define EFI_UNIX_THUNK_PROTOCOL_GUID \
-  { \
-    0xf2e98868, 0x8985, 0x11db, {0x9a, 0x59, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
-  }
-
-typedef
-VOID
-(EFIAPI *UnixSleep) (
-  unsigned long Milliseconds
-  );
-
-typedef
-VOID
-(EFIAPI *UnixExit) (
-  int status  // exit code for all threads
-  );
-
-typedef
-VOID
-(EFIAPI *UnixSetTimer) (
-  UINT64 PeriodMs,
-  VOID (EFIAPI *CallBack)(UINT64 DeltaMs)
-  );
-
-typedef
-VOID
-(EFIAPI *UnixGetLocalTime) (
-  EFI_TIME *Time
-  );
-
-typedef
-struct tm *
-(EFIAPI *UnixGmTime)(
-  const time_t *timep
-  );
-
-typedef
-long
-(EFIAPI *UnixGetTimeZone)(
-  void
-  );
-
-typedef
-int
-(EFIAPI *UnixGetDayLight)(
-  void
-  );
-
-typedef
-int
-(EFIAPI *UnixPoll)(
-  struct pollfd *pfd,
-  unsigned int  nfds,
-  int           timeout
-  );
-
-typedef
-long
-(EFIAPI *UnixRead) (
-  int  fd,
-  void *buf,
-  int  count
-  );
-
-typedef
-long
-(EFIAPI *UnixWrite) (
-  int         fd,
-  const void  *buf,
-  int         count
-  );
-
-typedef
-char *
-(EFIAPI *UnixGetenv) (const char *var);
-
-typedef
-int
-(EFIAPI *UnixOpen) (const char *name, int flags, int mode);
-
-typedef
-off_t
-(EFIAPI *UnixSeek) (int fd, off_t off, int whence);
-
-typedef
-int
-(EFIAPI *UnixFtruncate) (int fd, long int len);
-
-typedef
-int
-(EFIAPI *UnixClose) (int fd);
-
-typedef
-int
-(EFIAPI *UnixMkdir)(const char *pathname, mode_t mode);
-
-typedef
-int
-(EFIAPI *UnixRmDir)(const char *pathname);
-
-typedef
-int
-(EFIAPI *UnixUnLink)(const char *pathname);
-
-typedef
-int
-(EFIAPI *UnixGetErrno)(VOID);
-
-typedef
-DIR *
-(EFIAPI *UnixOpenDir)(const char *pathname);
-
-typedef
-void
-(EFIAPI *UnixRewindDir)(DIR *dir);
-
-typedef
-struct dirent *
-(EFIAPI *UnixReadDir)(DIR *dir);
-
-typedef
-int
-(EFIAPI *UnixCloseDir)(DIR *dir);
-
-typedef
-int
-(EFIAPI *UnixStat)(const char *path, STAT_FIX *buf);
-
-typedef
-int
-(EFIAPI *UnixStatFs)(const char *path, struct statfs *buf);
-
-typedef
-int
-(EFIAPI *UnixRename)(const char *oldpath, const char *newpath);
-
-typedef
-time_t
-(EFIAPI *UnixMkTime)(struct tm *tm);
-
-typedef
-int
-(EFIAPI *UnixFSync)(int fd);
-
-typedef
-int
-(EFIAPI *UnixChmod)(const char *path, mode_t mode);
-
-typedef
-int
-(EFIAPI *UnixUTime)(const char *filename, const struct utimbuf *buf);
-
-struct _EFI_UNIX_UGA_IO_PROTOCOL;
-typedef
-EFI_STATUS
-(EFIAPI *UnixUgaCreate)(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo,
-     CONST CHAR16 *Title);
-
-typedef
-int
-(EFIAPI *UnixTcflush) (int fildes, int queue_selector);
-
-typedef
-void
-(EFIAPI *UnixPerror) (__const char *__s);
-
-typedef
-int
-#if __CYGWIN__
-(EFIAPI *UnixIoCtl) (int fd, int __request, UINTN Arg);
-#else
-(EFIAPI *UnixIoCtl) (int fd, unsigned long int __request, void *Arg);
-#endif
-
-typedef
-int
-(EFIAPI *UnixFcntl) (int __fd, int __cmd, void *Arg);
-
-typedef
-int
-(EFIAPI *UnixCfsetispeed) (struct termios *__termios_p, speed_t __speed);
-
-typedef
-int
-(EFIAPI *UnixCfsetospeed) (struct termios *__termios_p, speed_t __speed);
-
-typedef
-int
-(EFIAPI *UnixTcgetattr) (int __fd, struct termios *__termios_p);
-
-typedef
-int
-(EFIAPI *UnixTcsetattr) (int __fd, int __optional_actions,
-          __const struct termios *__termios_p);
-
-
-//
-// Worker functions to enable source level debug in the emulator
-//
-
-typedef
-RETURN_STATUS
-(EFIAPI *UnixPeCoffGetEntryPoint) (
-  IN     VOID  *Pe32Data,
-  IN OUT VOID  **EntryPoint
-  );
-
-typedef
-VOID
-(EFIAPI *UnixPeCoffRelocateImageExtraAction) (
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext
-  );
-
-typedef
-VOID
-(EFIAPI *UnixPeCoffLoaderUnloadImageExtraAction) (
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext
-  );
-
-typedef
-int
-(EFIAPI *UnixGetIfAddrs) (
-  struct ifaddrs **ifap
-  );
-
-typedef
-void
-(EFIAPI *UnixFreeIfAddrs) (
-  struct ifaddrs *ifap
-  );
-
-typedef
-int
-(EFIAPI *UnixSocket) (
-  int domain, 
-  int type, 
-  int protocol
-  );
-
-typedef 
-void
-(EFIAPI *UnixDisableInterruptEmulation) (void);
-
-typedef 
-void
-(EFIAPI *UnixEnableInterruptEmulation) (void);
-
-
-
-
-#define EFI_UNIX_THUNK_PROTOCOL_SIGNATURE SIGNATURE_32 ('L', 'N', 'X', 'T')
-
-typedef struct _EFI_UNIX_THUNK_PROTOCOL {
-  UINT64                              Signature;
-
-  UnixSleep                           Sleep;
-  UnixExit                            Exit;
-  UnixSetTimer                        SetTimer;
-  UnixGetLocalTime                    GetLocalTime;
-  UnixGmTime                          GmTime;
-  UnixGetTimeZone                     GetTimeZone;
-  UnixGetDayLight                     GetDayLight;
-  UnixPoll                            Poll;
-  UnixRead                            Read;
-  UnixWrite                           Write;
-  UnixGetenv                          Getenv;
-  UnixOpen                            Open;
-  UnixSeek                            Lseek;
-  UnixFtruncate                       FTruncate;
-  UnixClose                           Close;
-  UnixMkdir                           MkDir;
-  UnixRmDir                           RmDir;
-  UnixUnLink                          UnLink;
-  UnixGetErrno                        GetErrno;
-  UnixOpenDir                         OpenDir;
-  UnixRewindDir                       RewindDir;
-  UnixReadDir                         ReadDir;
-  UnixCloseDir                        CloseDir;
-  UnixStat                            Stat;
-  UnixStatFs                          StatFs;
-  UnixRename                          Rename;
-  UnixMkTime                          MkTime;
-  UnixFSync                           FSync;
-  UnixChmod                           Chmod;
-  UnixUTime                           UTime;
-  UnixTcflush                         Tcflush;
-  UnixUgaCreate                        UgaCreate;
-  UnixPerror                          Perror;
-  UnixIoCtl                           IoCtl;
-  UnixFcntl                           Fcntl;
-  UnixCfsetispeed                     Cfsetispeed;
-  UnixCfsetospeed                     Cfsetospeed;
-  UnixTcgetattr                       Tcgetattr;
-  UnixTcsetattr                       Tcsetattr;
-  UnixPeCoffGetEntryPoint                 PeCoffGetEntryPoint;
-  UnixPeCoffRelocateImageExtraAction      PeCoffRelocateImageExtraAction;
-  UnixPeCoffLoaderUnloadImageExtraAction  PeCoffUnloadImageExtraAction;
-  UnixEnableInterruptEmulation        EnableInterrupt;
-  UnixDisableInterruptEmulation       DisableInterrupt;
-
-  UnixGetIfAddrs                      GetIfAddrs;
-  UnixFreeIfAddrs                     FreeIfAddrs;
-  UnixSocket                          Socket;
-} EFI_UNIX_THUNK_PROTOCOL;
-
-extern EFI_GUID gEfiUnixThunkProtocolGuid;
-
-#endif
diff --git a/UnixPkg/Include/Protocol/UnixUgaIo.h b/UnixPkg/Include/Protocol/UnixUgaIo.h
deleted file mode 100644 (file)
index 1327e6a..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*++
-
-Copyright (c) 2006, Tristan Gingold. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the
-BSD License which accompanies this distribution.  The full text of the
-license may be found at http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-  UnixUgaIo.h
-
-Abstract:
-
---*/
-
-#ifndef _UNIX_UGA_IO_H_
-#define _UNIX_UGA_IO_H_
-
-#include <Protocol/SimplePointer.h>
-#include <Protocol/SimpleTextIn.h>
-#include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
-
-#define EFI_UNIX_UGA_IO_PROTOCOL_GUID {0xf2e5e2c6, 0x8985, 0x11db, {0xa1, 0x91, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } }
-
-typedef struct _EFI_UNIX_UGA_IO_PROTOCOL EFI_UNIX_UGA_IO_PROTOCOL;
-
-typedef
-EFI_STATUS
-(EFIAPI *UGAClose)(
-  EFI_UNIX_UGA_IO_PROTOCOL *Uga
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *UGASize)(
-  EFI_UNIX_UGA_IO_PROTOCOL *Uga, 
-  UINT32                   Width, 
-  UINT32                   Height
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *UGACheckKey)(
-  EFI_UNIX_UGA_IO_PROTOCOL *Uga
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *UGAGetKey)(
-  EFI_UNIX_UGA_IO_PROTOCOL *Uga, 
-  EFI_KEY_DATA             *key
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *UGAKeySetState) (
-  IN EFI_UNIX_UGA_IO_PROTOCOL   *UgaIo, 
-  IN EFI_KEY_TOGGLE_STATE       *KeyToggleState
-  );
-
-
-typedef 
-VOID
-(EFIAPI *UGA_REGISTER_KEY_NOTIFY_CALLBACK) (
-  IN VOID           *Context,
-  IN EFI_KEY_DATA   *KeyData
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *UGARegisterKeyNotify) (
-  IN EFI_UNIX_UGA_IO_PROTOCOL           *UgaIo, 
-  IN UGA_REGISTER_KEY_NOTIFY_CALLBACK   CallBack,
-  IN VOID                               *Context
-  );
-
-
-typedef struct {
-    UINTN                                   SourceX;
-    UINTN                                   SourceY;
-    UINTN                                   DestinationX;
-    UINTN                                   DestinationY;
-    UINTN                                   Width;
-    UINTN                                   Height;
-    UINTN                                   Delta;
-} UGA_BLT_ARGS;
-
-typedef
-EFI_STATUS
-(EFIAPI *UGABlt)(
-    IN  EFI_UNIX_UGA_IO_PROTOCOL                *Uga,
-    IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
-    IN  EFI_UGA_BLT_OPERATION                   BltOperation,
-    IN  UGA_BLT_ARGS                            *Args
-    );
-
-typedef
-BOOLEAN
-(EFIAPI *UGAIsKeyPressed) ( 
-  IN  EFI_UNIX_UGA_IO_PROTOCOL  *UgaIo, 
-  IN  EFI_KEY_DATA              *KeyData
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *UGACheckPointer)(
-  EFI_UNIX_UGA_IO_PROTOCOL *Uga
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *UGAGetPointerState)(
-  EFI_UNIX_UGA_IO_PROTOCOL *Uga,
-  EFI_SIMPLE_POINTER_STATE *state
-  );
-
-struct _EFI_UNIX_UGA_IO_PROTOCOL {
-  VOID                                *Private;
-  UGAClose                            UgaClose;
-  UGASize                             UgaSize;
-  UGACheckKey                         UgaCheckKey;
-  UGAKeySetState                      UgaKeySetState;
-  UGAGetKey                           UgaGetKey;
-  UGARegisterKeyNotify                UgaRegisterKeyNotify;
-  UGABlt                              UgaBlt;
-  UGAIsKeyPressed                     UgaIsKeyPressed;
-  UGACheckPointer                     UgaCheckPointer;
-  UGAGetPointerState                  UgaGetPointerState;
-};
-
-
-extern EFI_GUID gEfiUnixUgaIoProtocolGuid;
-
-#endif
diff --git a/UnixPkg/Include/UnixDxe.h b/UnixPkg/Include/UnixDxe.h
deleted file mode 100644 (file)
index 29cde56..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  UnixDxe.h\r
-\r
-Abstract:\r
-  Public include file for the Unix Library\r
-\r
---*/\r
-\r
-#ifndef __UNIX_DXE_H__\r
-#define __UNIX_DXE_H__\r
-\r
-#include <Ppi/UnixPeiLoadFile.h>\r
-#include <Ppi/UnixAutoScan.h>\r
-#include <Ppi/UnixThunk.h>\r
-#include <Ppi/UnixFwh.h>\r
-\r
-//\r
-//  UnixIo.h depends on UnixThunk.h\r
-//\r
-\r
-#include <Common/UnixInclude.h>\r
-#include <Protocol/UnixThunk.h>\r
-#include <Protocol/UnixIo.h>\r
-\r
-#endif\r
diff --git a/UnixPkg/Include/UnixPeim.h b/UnixPkg/Include/UnixPeim.h
deleted file mode 100644 (file)
index af91d3f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  UnixPeim.h\r
-\r
-Abstract:\r
-  Public include file for the Unix Library\r
-\r
---*/\r
-\r
-#ifndef __UNIX_PEIM_H__\r
-#define __UNIX_PEIM_H__\r
-\r
-#include <Ppi/UnixPeiLoadFile.h>\r
-#include <Ppi/UnixAutoScan.h>\r
-#include <Ppi/UnixThunk.h>\r
-#include <Ppi/UnixFwh.h>\r
-\r
-#include <Protocol/UnixThunk.h>\r
-\r
-#endif\r
diff --git a/UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf b/UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf
deleted file mode 100644 (file)
index 432dc59..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-## @file\r
-# A library to produce the global variable 'gUnix'\r
-#\r
-# This library contains a single global variable 'gUnix' along with a constructor to initialize that global.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = DxeUnixLib\r
-  FILE_GUID                      = f39efc84-8985-11db-ad67-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = UnixLib \r
-\r
-  CONSTRUCTOR                    = UnixLibConstructor\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  UnixLib.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  HobLib\r
-  DebugLib\r
-\r
-\r
-[Protocols]\r
-  gEfiUnixThunkProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED\r
-\r
diff --git a/UnixPkg/Library/DxeUnixLib/UnixLib.c b/UnixPkg/Library/DxeUnixLib/UnixLib.c
deleted file mode 100644 (file)
index 0935448..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  UnixLib.c\r
-\r
-Abstract:\r
-\r
-  Unix Library\r
-\r
---*/\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include <Library/UnixLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-\r
-EFI_UNIX_THUNK_PROTOCOL *gUnix;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixLibConstructor (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-{\r
-  EFI_HOB_GUID_TYPE        *GuidHob;\r
-\r
-  GuidHob = GetFirstGuidHob (&gEfiUnixThunkProtocolGuid);\r
-  ASSERT (GuidHob != NULL);\r
-  gUnix = (EFI_UNIX_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
-  ASSERT (gUnix != NULL);\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/Library/DxeUnixOemHookStatusCodeLib/DxeUnixOemHookStatusCodeLib.inf b/UnixPkg/Library/DxeUnixOemHookStatusCodeLib/DxeUnixOemHookStatusCodeLib.inf
deleted file mode 100644 (file)
index f07d494..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-## @file\r
-# Memory Status Code Library for UEFI drivers\r
-#\r
-# Lib to provide memory journal status code reporting Routines\r
-#\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = DxeUnixOemHookStatusCodeLib\r
-  FILE_GUID                      = 0BB6F68A-2FC5-4394-9375-2B43F1C34B59\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = OemHookStatusCodeLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  UnixOemHookStatusCodeLib.c\r
-\r
-\r
-[Packages]\r
-  UnixPkg/UnixPkg.dec\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  ReportStatusCodeLib\r
-  BaseMemoryLib\r
-  PrintLib\r
-  HobLib\r
-  DebugLib\r
-\r
-[Protocols]\r
-  gEfiUnixThunkProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED\r
-\r
diff --git a/UnixPkg/Library/DxeUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c b/UnixPkg/Library/DxeUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c
deleted file mode 100644 (file)
index d9a7b3e..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/** @file\r
-  OEM hook status code library functions with no library constructor/destructor\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  UnixOemHookStatusCodeLib.c\r
-\r
-**/\r
-#include <Guid/StatusCodeDataTypeId.h>\r
-#include <Guid/StatusCodeDataTypeDebug.h>\r
-#include "UnixDxe.h"\r
-#include <Library/OemHookStatusCodeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-\r
-//\r
-// Cache of UnixThunk protocol \r
-//\r
-EFI_UNIX_THUNK_PROTOCOL   *mUnix;\r
-\r
-//\r
-// Cache of standard output handle . \r
-//\r
-int                      mStdOut;\r
-\r
-/**\r
-\r
-  Initialize OEM status code device .\r
-\r
-  @return    Always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeInitialize (\r
-  VOID\r
-  )\r
-{\r
-  EFI_HOB_GUID_TYPE        *GuidHob;\r
-\r
-  //\r
-  // Retrieve UnixThunkProtocol from GUID'ed HOB\r
-  //\r
-  GuidHob = GetFirstGuidHob (&gEfiUnixThunkProtocolGuid);\r
-  ASSERT (GuidHob != NULL);\r
-  mUnix = (EFI_UNIX_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
-  ASSERT (mUnix != NULL);\r
-\r
-  //\r
-  // Cache standard output handle.\r
-  //\r
-  mStdOut = 1;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Report status code to OEM device.\r
\r
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
\r
-  @param  Value         Describes the current status of a hardware or software entity.  \r
-                        This included information about the class and subclass that is used to classify the entity \r
-                        as well as an operation.  For progress codes, the operation is the current activity. \r
-                        For error codes, it is the exception.  For debug codes, it is not defined at this time. \r
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.  \r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.  \r
-                        A system may contain multiple entities that match a class/subclass pairing. \r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable, \r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-\r
-  @param  CallerId      This optional parameter may be used to identify the caller. \r
-                        This parameter allows the status code driver to apply different rules to different callers. \r
-                        Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
-\r
-\r
-  @param  Data          This optional parameter may be used to pass additional data\r
\r
-  @return               The function always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeReport (\r
-  IN EFI_STATUS_CODE_TYPE     CodeType,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\r
-  IN EFI_GUID                 *CallerId, OPTIONAL\r
-  IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL\r
-  )\r
-{\r
-  CHAR8           *Filename;\r
-  CHAR8           *Description;\r
-  CHAR8           *Format;\r
-  CHAR8           Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
-  UINT32          ErrorLevel;\r
-  UINT32          LineNumber;\r
-  UINTN           CharCount;\r
-  BASE_LIST       Marker;\r
-\r
-  Buffer[0] = '\0';\r
-\r
-  if (Data != NULL &&\r
-      ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
-    //\r
-    // Print ASSERT() information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "\n\rASSERT!: %a (%d): %a\n\r",\r
-                  Filename,\r
-                  LineNumber,\r
-                  Description\r
-                  );\r
-\r
-    //\r
-    // Callout to standard output.\r
-    //\r
-    mUnix->Write (\r
-              mStdOut,\r
-              Buffer,\r
-              CharCount\r
-        );\r
-\r
-    return EFI_SUCCESS;\r
-\r
-  } else if (Data != NULL &&\r
-             ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
-    //\r
-    // Print DEBUG() information into output buffer.\r
-    //\r
-    CharCount = AsciiBSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  Format, \r
-                  Marker\r
-                  );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
-    //\r
-    // Print ERROR information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  "ERROR: C%x:V%x I%x", \r
-                  CodeType, \r
-                  Value, \r
-                  Instance\r
-                  );\r
-\r
-    //\r
-    // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
-    //\r
-    \r
-    if (CallerId != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %g",\r
-                     CallerId\r
-                     );\r
-    }\r
-\r
-    if (Data != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %x",\r
-                     Data\r
-                     );\r
-    }\r
-\r
-    CharCount += AsciiSPrint (\r
-                   &Buffer[CharCount - 1],\r
-                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                   "\n\r"\r
-                   );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  "PROGRESS CODE: V%x I%x\n\r", \r
-                  Value, \r
-                  Instance\r
-                  );\r
-  } else {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  "Undefined: C%x:V%x I%x\n\r", \r
-                  CodeType, \r
-                  Value, \r
-                  Instance\r
-                  );\r
-  }\r
-\r
-  //\r
-  // Callout to standard output.\r
-  //\r
-  mUnix->Write (\r
-            mStdOut,\r
-            Buffer,\r
-            CharCount\r
-            );\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c
deleted file mode 100644 (file)
index f98b30b..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  PeiUnixPeCoffExtraActionLib.c\r
-\r
-Abstract:\r
-\r
-  Provides services to perform additional actions to relocate and unload\r
-  PE/Coff image for Unix environment specific purpose such as souce level debug.\r
-  This version only works for DXE phase  \r
-\r
-\r
-**/\r
-\r
-#include <PiDxe.h>\r
-#include <UnixDxe.h>\r
-#include <Library/PeCoffLib.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/PeCoffExtraActionLib.h>\r
-\r
-//\r
-\r
-// Cache of UnixThunk protocol \r
-\r
-//\r
-\r
-EFI_UNIX_THUNK_PROTOCOL   *mUnix = NULL;\r
-\r
-\r
-/**\r
-  The constructor function gets  the pointer of the WinNT thunk functions\r
-  It will ASSERT() if Unix thunk protocol is not installed.\r
-\r
-  @retval EFI_SUCCESS   Unix thunk protocol is found and cached.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-DxeUnixPeCoffLibExtraActionConstructor (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-{\r
-   EFI_HOB_GUID_TYPE        *GuidHob;\r
-\r
-  //\r
-  // Retrieve UnixThunkProtocol from GUID'ed HOB\r
-  //\r
-  GuidHob = GetFirstGuidHob (&gEfiUnixThunkProtocolGuid);\r
-  ASSERT (GuidHob != NULL);\r
-  mUnix = (EFI_UNIX_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
-  ASSERT (mUnix != NULL);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
-\r
-  If ImageContext is NULL, then ASSERT().\r
-\r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that has already been loaded and relocated.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderRelocateImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  if (mUnix != NULL) {\r
-    mUnix->PeCoffRelocateImageExtraAction (ImageContext);\r
-  }\r
-}\r
-\r
-\r
-\r
-/**\r
-  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
-  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
-  \r
-  If ImageContext is NULL, then ASSERT().\r
-  \r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that is being unloaded.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderUnloadImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  if (mUnix != NULL) {\r
-    mUnix->PeCoffUnloadImageExtraAction (ImageContext);\r
-  }\r
-}\r
diff --git a/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf b/UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf
deleted file mode 100644 (file)
index 6b8a89d..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-## @file
-# PeCoff extra action libary for DXE phase that run Unix emulator.
-#
-# Lib to provide memory journal status code reporting Routines
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution.  The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-#
-#
-##
-
-[Defines]
-  INF_VERSION                    = 0x00010005
-  BASE_NAME                      = DxeUnixPeCoffExtraActionLib
-  FILE_GUID                      = C6F96971-39D2-49a5-93FC-5D42FB4D7DD2
-  MODULE_TYPE                    = DXE_DRIVER
-  VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = PeCoffExtraActionLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_DRIVER
-
-  CONSTRUCTOR                    = DxeUnixPeCoffLibExtraActionConstructor
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-#  VALID_ARCHITECTURES           = IA32
-#
-
-[Sources]
-  DxeUnixPeCoffExtraActionLib.c
-
-[Packages]
-  UnixPkg/UnixPkg.dec
-  MdePkg/MdePkg.dec
-
-[LibraryClasses]
-  DebugLib
-  HobLib
-  BaseMemoryLib
-
-[Protocols]
-  gEfiUnixThunkProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED
-
diff --git a/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/EdkUnixPeiPeCoffGetEntryPointLib.inf b/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/EdkUnixPeiPeCoffGetEntryPointLib.inf
deleted file mode 100644 (file)
index 24e0b46..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-## @file\r
-# Component description file for the EdkNt32PeiPeCoffGetEntryPointLib library.\r
-#\r
-# PeCoffGetEntryPointLib library class for NT32 instance implemented by use NTPeiLoadFile PPI.\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = EdkUnixPeiPeCoffGetEntryPointLib\r
-  FILE_GUID                      = f3b702e8-8985-11db-9558-0040d02b1835\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = PeCoffGetEntryPointLib \r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  PeCoffGetEntryPoint.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  PeiServicesLib\r
-  DebugLib\r
-\r
-\r
-[Ppis]\r
-  gUnixPeiLoadFilePpiGuid                       # PPI ALWAYS_CONSUMED\r
-\r
diff --git a/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c b/UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
deleted file mode 100644 (file)
index 3a8f304..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  PeCoffGetEntryPoint.c\r
-\r
-Abstract:\r
-\r
-  Tiano PE/COFF loader\r
-\r
-Revision History\r
-\r
---*/\r
-#include "PiPei.h"\r
-#include <Library/PeCoffGetEntryPointLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Ppi/UnixPeiLoadFile.h>\r
-#include <IndustryStandard/PeImage.h>\r
-#include <Library/DebugLib.h>\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-PeCoffLoaderGetEntryPoint (\r
-  IN     VOID  *Pe32Data,\r
-  IN OUT VOID  **EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads a PE/COFF image into memory, this is not follow the original purpose of \r
-  PeCoffGetEntryPoint library class.  But it's ok that Unix package not run on a real \r
-  platform and this is for source level debug.\r
-\r
-Arguments:\r
-\r
-  Pe32Data   - Pointer to a PE/COFF Image\r
-\r
-  EntryPoint - Pointer to the entry point of the PE/COFF image\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS            if the EntryPoint was returned\r
-  EFI_INVALID_PARAMETER  if the EntryPoint could not be found from Pe32Data\r
-\r
---*/\r
-{\r
-  PEI_UNIX_THUNK_PPI      *UnixThunkPpi;\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_THUNK_PROTOCOL *Unix;\r
-\r
-  //\r
-  // Locate Unix ThunkPpi for retrieving standard output handle\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-              &gPeiUnixThunkPpiGuid,\r
-             0,\r
-              NULL,\r
-              (VOID **) &UnixThunkPpi\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Unix  = (EFI_UNIX_THUNK_PROTOCOL *)UnixThunkPpi->UnixThunk ();\r
-\r
-  return Unix->PeCoffGetEntryPoint (Pe32Data, EntryPoint);\r
-}\r
-\r
-/**\r
-  Returns the machine type of PE/COFF image. \r
-  This is copied from MDE BasePeCoffGetEntryPointLib, the code should be sync with it.\r
-  The reason is Unix package needs to load the image to memory to support source\r
-  level debug.\r
-   \r
-\r
-  @param  Pe32Data   Pointer to a PE/COFF header\r
-\r
-  @return            Machine type or zero if not a valid iamge\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-PeCoffLoaderGetMachineType (\r
-  IN  VOID  *Pe32Data\r
-  )\r
-{  \r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Hdr;\r
-  EFI_IMAGE_DOS_HEADER                 *DosHdr;\r
-\r
-  ASSERT (Pe32Data   != NULL);\r
-\r
-  DosHdr = (EFI_IMAGE_DOS_HEADER  *)Pe32Data;\r
-  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));\r
-\r
-  } else {\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)(Pe32Data);\r
-  }\r
-\r
-  if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
-    return Hdr.Te->Machine;\r
-  } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)  {\r
-    return Hdr.Pe32->FileHeader.Machine;\r
-  }\r
-\r
-  return 0x0000;\r
-}\r
-\r
-/**\r
-  Returns a pointer to the PDB file name for a PE/COFF image that has been\r
-  loaded into system memory with the PE/COFF Loader Library functions.\r
-\r
-  Returns the PDB file name for the PE/COFF image specified by Pe32Data.  If\r
-  the PE/COFF image specified by Pe32Data is not a valid, then NULL is\r
-  returned.  If the PE/COFF image specified by Pe32Data does not contain a\r
-  debug directory entry, then NULL is returned.  If the debug directory entry\r
-  in the PE/COFF image specified by Pe32Data does not contain a PDB file name,\r
-  then NULL is returned.\r
-  If Pe32Data is NULL, then ASSERT().\r
-\r
-  @param  Pe32Data   Pointer to the PE/COFF image that is loaded in system\r
-                     memory.\r
-\r
-  @return The PDB file name for the PE/COFF image specified by Pe32Data or NULL\r
-          if it cannot be retrieved.\r
-\r
-**/\r
-VOID *\r
-EFIAPI\r
-PeCoffLoaderGetPdbPointer (\r
-  IN VOID  *Pe32Data\r
-  )\r
-{\r
-  EFI_IMAGE_DOS_HEADER                  *DosHdr;\r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr;\r
-  EFI_IMAGE_DATA_DIRECTORY              *DirectoryEntry;\r
-  EFI_IMAGE_DEBUG_DIRECTORY_ENTRY       *DebugEntry;\r
-  UINTN                                 DirCount;\r
-  VOID                                  *CodeViewEntryPointer;\r
-  INTN                                  TEImageAdjust;\r
-  UINT32                                NumberOfRvaAndSizes;\r
-  UINT16                                Magic;\r
-\r
-  ASSERT (Pe32Data   != NULL);\r
-\r
-  TEImageAdjust       = 0;\r
-  DirectoryEntry      = NULL;\r
-  DebugEntry          = NULL;\r
-  NumberOfRvaAndSizes = 0;\r
-\r
-  DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
-  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-    //\r
-    // DOS image header is present, so read the PE header after the DOS image header.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));\r
-  } else {\r
-    //\r
-    // DOS image header is not present, so PE header is at the image base.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;\r
-  }\r
-\r
-  if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
-    if (Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {\r
-      DirectoryEntry  = &Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];\r
-      TEImageAdjust   = sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;\r
-      DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) Hdr.Te +\r
-                    Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +\r
-                    TEImageAdjust);\r
-    }\r
-  } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
-    //\r
-    // NOTE: We use Machine field to identify PE32/PE32+, instead of Magic.\r
-    //       It is due to backward-compatibility, for some system might\r
-    //       generate PE32+ image with PE32 Magic.\r
-    //\r
-    switch (Hdr.Pe32->FileHeader.Machine) {\r
-    case EFI_IMAGE_MACHINE_IA32:\r
-      //\r
-      // Assume PE32 image with IA32 Machine field.\r
-      //\r
-      Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;\r
-      break;\r
-    case EFI_IMAGE_MACHINE_X64:\r
-    case EFI_IMAGE_MACHINE_IA64:\r
-      //\r
-      // Assume PE32+ image with X64 or IA64 Machine field\r
-      //\r
-      Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;\r
-      break;\r
-    default:\r
-      //\r
-      // For unknow Machine field, use Magic in optional Header\r
-      //\r
-      Magic = Hdr.Pe32->OptionalHeader.Magic;\r
-    }\r
-\r
-    if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {\r
-      //\r
-      // Use PE32 offset get Debug Directory Entry\r
-      //\r
-      NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;\r
-      DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);\r
-      DebugEntry     = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);\r
-    } else if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {\r
-      //\r
-      // Use PE32+ offset get Debug Directory Entry\r
-      //\r
-      NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;\r
-      DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);\r
-      DebugEntry     = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);\r
-    }\r
-\r
-    if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {\r
-      DirectoryEntry = NULL;\r
-      DebugEntry = NULL;\r
-    }\r
-  } else {\r
-    return NULL;\r
-  }\r
-\r
-  if (DebugEntry == NULL || DirectoryEntry == NULL) {\r
-    return NULL;\r
-  }\r
-\r
-  for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {\r
-    if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {\r
-      if (DebugEntry->SizeOfData > 0) {\r
-        CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + ((UINTN)Pe32Data) + (UINTN)TEImageAdjust);\r
-        switch (* (UINT32 *) CodeViewEntryPointer) {\r
-        case CODEVIEW_SIGNATURE_NB10:\r
-          return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));\r
-        case CODEVIEW_SIGNATURE_RSDS:\r
-          return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY));\r
-        case CODEVIEW_SIGNATURE_MTOC:\r
-          return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY));\r
-        default:\r
-          break;\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-\r
-/**\r
-  Returns the size of the PE/COFF headers\r
-\r
-  Returns the size of the PE/COFF header specified by Pe32Data.\r
-  If Pe32Data is NULL, then ASSERT().\r
-\r
-  @param  Pe32Data   Pointer to the PE/COFF image that is loaded in system\r
-                     memory.\r
-\r
-  @return Size of PE/COFF header in bytes or zero if not a valid image.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-PeCoffGetSizeOfHeaders (\r
-  IN VOID     *Pe32Data\r
-  )\r
-{\r
-  EFI_IMAGE_DOS_HEADER                  *DosHdr;\r
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr;\r
-  UINTN                                 SizeOfHeaders;\r
-\r
-  ASSERT (Pe32Data   != NULL);\r
\r
-  DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
-  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-    //\r
-    // DOS image header is present, so read the PE header after the DOS image header.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));\r
-  } else {\r
-    //\r
-    // DOS image header is not present, so PE header is at the image base.\r
-    //\r
-    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;\r
-  }\r
-\r
-  if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
-    SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;\r
-  } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
-    SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;\r
-  } else {\r
-    SizeOfHeaders = 0;\r
-  }\r
-\r
-  return SizeOfHeaders;\r
-}\r
-\r
diff --git a/UnixPkg/Library/PeiUnixOemHookStatusCodeLib/PeiUnixOemHookStatusCodeLib.inf b/UnixPkg/Library/PeiUnixOemHookStatusCodeLib/PeiUnixOemHookStatusCodeLib.inf
deleted file mode 100644 (file)
index 792dfa8..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-## @file\r
-# Memory Status Code Library for UEFI drivers\r
-#\r
-# Lib to provide memory journal status code reporting Routines\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PeiUnixOemHookStatusCodeLib\r
-  FILE_GUID                      = 23E378C1-B199-49ad-9F14-DAF5D3C7EC28\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = OemHookStatusCodeLib|PEIM \r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-\r
-[Sources]\r
-  UnixOemHookStatusCodeLib.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  PeiServicesLib\r
-  ReportStatusCodeLib\r
-  BaseMemoryLib\r
-  PrintLib\r
-  DebugLib\r
-\r
-[Ppis]\r
-  gPeiUnixThunkPpiGuid                          # PPI ALWAYS_CONSUMED\r
-\r
diff --git a/UnixPkg/Library/PeiUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c b/UnixPkg/Library/PeiUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c
deleted file mode 100644 (file)
index b42101c..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/** @file\r
-  OEM hook status code library functions with no library constructor/destructor\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  UnixOemHookStatusCodeLib.c\r
-\r
-**/\r
-#include <Guid/StatusCodeDataTypeId.h>\r
-#include <Guid/StatusCodeDataTypeDebug.h>\r
-#include <Ppi/UnixThunk.h>\r
-#include <Library/OemHookStatusCodeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-\r
-//\r
-// Cache of UnixThunk protocol \r
-//\r
-EFI_UNIX_THUNK_PROTOCOL   *mUnix;\r
-\r
-//\r
-// Cache of standard output handle . \r
-//\r
-int                      mStdOut;\r
-\r
-/**\r
-\r
-  Initialize OEM status code device .\r
-\r
-  @return    Always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeInitialize (\r
-  VOID\r
-  )\r
-{\r
-  PEI_UNIX_THUNK_PPI  *UnixThunkPpi;\r
-  EFI_STATUS        Status;\r
-\r
-  \r
-  //\r
-  // Locate Unix ThunkPpi for retrieving standard output handle\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-              &gPeiUnixThunkPpiGuid,\r
-              0,\r
-              NULL,\r
-              (VOID **) &UnixThunkPpi\r
-              );\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  mUnix  = (EFI_UNIX_THUNK_PROTOCOL *) UnixThunkPpi->UnixThunk ();\r
-  \r
-  //\r
-  // Cache standard output handle.\r
-  //\r
-  mStdOut = 1;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Report status code to OEM device.\r
\r
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
\r
-  @param  Value         Describes the current status of a hardware or software entity.  \r
-                        This included information about the class and subclass that is used to classify the entity \r
-                        as well as an operation.  For progress codes, the operation is the current activity. \r
-                        For error codes, it is the exception.  For debug codes, it is not defined at this time. \r
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.  \r
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.  \r
-                        A system may contain multiple entities that match a class/subclass pairing. \r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable, \r
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
-\r
-\r
-  @param  CallerId      This optional parameter may be used to identify the caller. \r
-                        This parameter allows the status code driver to apply different rules to different callers. \r
-                        Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
-\r
-\r
-  @param  Data          This optional parameter may be used to pass additional data\r
\r
-  @return               The function always return EFI_SUCCESS.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OemHookStatusCodeReport (\r
-  IN EFI_STATUS_CODE_TYPE     CodeType,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\r
-  IN EFI_GUID                 *CallerId, OPTIONAL\r
-  IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL\r
-  )\r
-{\r
-  CHAR8           *Filename;\r
-  CHAR8           *Description;\r
-  CHAR8           *Format;\r
-  CHAR8           Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
-  UINT32          ErrorLevel;\r
-  UINT32          LineNumber;\r
-  UINTN           CharCount;\r
-  BASE_LIST       Marker;\r
-\r
-  Buffer[0] = '\0';\r
-\r
-  if (Data != NULL &&\r
-      ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
-    //\r
-    // Print ASSERT() information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer,\r
-                  sizeof (Buffer),\r
-                  "\n\rASSERT!: %a (%d): %a\n\r",\r
-                  Filename,\r
-                  LineNumber,\r
-                  Description\r
-                  );\r
-\r
-    //\r
-    // Callout to standard output.\r
-    //\r
-    mUnix->Write (\r
-              mStdOut,\r
-              Buffer,\r
-              CharCount\r
-        );\r
-\r
-    return EFI_SUCCESS;\r
-\r
-  } else if (Data != NULL &&\r
-             ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
-    //\r
-    // Print DEBUG() information into output buffer.\r
-    //\r
-    CharCount = AsciiBSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  Format, \r
-                  Marker\r
-                  );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
-    //\r
-    // Print ERROR information into output buffer.\r
-    //\r
-    CharCount = AsciiSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  "ERROR: C%x:V%x I%x", \r
-                  CodeType, \r
-                  Value, \r
-                  Instance\r
-                  );\r
-\r
-    //\r
-    // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
-    //\r
-    \r
-    if (CallerId != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %g",\r
-                     CallerId\r
-                     );\r
-    }\r
-\r
-    if (Data != NULL) {\r
-      CharCount += AsciiSPrint (\r
-                     &Buffer[CharCount - 1],\r
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                     " %x",\r
-                     Data\r
-                     );\r
-    }\r
-\r
-    CharCount += AsciiSPrint (\r
-                   &Buffer[CharCount - 1],\r
-                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
-                   "\n\r"\r
-                   );\r
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  "PROGRESS CODE: V%x I%x\n\r", \r
-                  Value, \r
-                  Instance\r
-                  );\r
-  } else {\r
-    CharCount = AsciiSPrint (\r
-                  Buffer, \r
-                  sizeof (Buffer), \r
-                  "Undefined: C%x:V%x I%x\n\r", \r
-                  CodeType, \r
-                  Value, \r
-                  Instance\r
-                  );\r
-  }\r
-\r
-  //\r
-  // Callout to standard output.\r
-  //\r
-  mUnix->Write (\r
-            mStdOut,\r
-            Buffer,\r
-            CharCount\r
-            );\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.c
deleted file mode 100644 (file)
index 98b5b9e..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  PeiUnixPeCoffExtraActionLib.c\r
-\r
-Abstract:\r
-\r
-  Provides services to perform additional actions to relocate and unload\r
-  PE/Coff image for UNIX environment specific purpose such as souce level debug.\r
-  This version only works for PEI phase\r
-\r
-\r
-**/\r
-#include <PiPei.h>\r
-#include <Ppi/UnixThunk.h>\r
-\r
-#include <Library/PeCoffLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/PeCoffExtraActionLib.h>\r
-\r
-//\r
-// Cache of UnixThunk protocol \r
-//\r
-EFI_UNIX_THUNK_PROTOCOL   *mUnix = NULL;\r
-\r
-/**\r
-  The function caches the pointer of the Unix thunk functions\r
-  It will ASSERT() if Unix thunk ppi is not installed.\r
-\r
-  @retval EFI_SUCCESS   WinNT thunk protocol is found and cached.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixPeCoffGetUnixThunkStucture (\r
-  )\r
-{\r
-  PEI_UNIX_THUNK_PPI  *UnixThunkPpi;\r
-  EFI_STATUS        Status;\r
-\r
-  \r
-  //\r
-  // Locate Unix ThunkPpi for retrieving standard output handle\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-              &gPeiUnixThunkPpiGuid,\r
-              0,\r
-              NULL,\r
-              (VOID **) &UnixThunkPpi\r
-              );\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  mUnix  = (EFI_UNIX_THUNK_PROTOCOL *) UnixThunkPpi->UnixThunk ();\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Performs additional actions after a PE/COFF image has been loaded and relocated.\r
-\r
-  If ImageContext is NULL, then ASSERT().\r
-\r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that has already been loaded and relocated.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderRelocateImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  if (mUnix == NULL) {\r
-    UnixPeCoffGetUnixThunkStucture ();\r
-  }\r
-    mUnix->PeCoffRelocateImageExtraAction (ImageContext);\r
-  }\r
-\r
-\r
-/**\r
-  Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
-  that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
-  \r
-  If ImageContext is NULL, then ASSERT().\r
-  \r
-  @param  ImageContext  Pointer to the image context structure that describes the\r
-                        PE/COFF image that is being unloaded.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-PeCoffLoaderUnloadImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  if (mUnix == NULL) {\r
-    UnixPeCoffGetUnixThunkStucture ();\r
-  }\r
-  mUnix->PeCoffUnloadImageExtraAction (ImageContext);\r
-}\r
diff --git a/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf b/UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf
deleted file mode 100644 (file)
index 0545574..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-## @file
-# PeCoff extra action libary for Pei phase that run UNIX emulator.
-#
-# Lib to provide memory journal status code reporting Routines
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution.  The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-#
-#
-##
-
-[Defines]
-  INF_VERSION                    = 0x00010005
-  BASE_NAME                      = PeiUnixPeCoffExtraActionLib
-  FILE_GUID                      = 1D0D29DE-A5EC-46aa-AE8A-1A5A1F71F202
-  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]
-  PeiUnixPeCoffExtraActionLib.c
-
-[Packages]
-  MdePkg/MdePkg.dec
-  UnixPkg/UnixPkg.dec
-
-[LibraryClasses]
-  BaseLib
-  PeiServicesLib
-  DebugLib
-
-[Ppis]
-  gPeiUnixThunkPpiGuid                          # PPI ALWAYS_CONSUMED
diff --git a/UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.c b/UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.c
deleted file mode 100644 (file)
index 924547d..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/** @file\r
-  Allows an override of the SEC SEC PPI Dispatch Table. This allows \r
-  customized PPIs to be passed into the PEI Core.\r
-\r
-Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
---*/\r
-\r
-#include <PiPei.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/SecDispatchTableLib.h>\r
-\r
-\r
-/**\r
-  Return the number of bytes that OverrideDispatchTable() will append to\r
-  the dispatch table.\r
-\r
-  @return  Size of table in bytes OverrideDispatchTable() will return\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-OverrideDispatchTableExtraSize (\r
-  )\r
-{\r
-  return 0;\r
-}\r
-\r
-\r
-/**\r
-  Allow an override of the Sec PPI Dispatch Table. This table contains PPIs passed\r
-  up from SEC to PEI. \r
-\r
-  @param  OriginalTable         SECs default PPI dispatch table\r
-  @param  OriginalTableSize     Size of SECs default PPI dispatch table\r
-  @param  NewTable              New dispatch table\r
-  @param  NewTableSize          Size of of the NewTable in bytes\r
-\r
-  @return EFI_SUCCESS table was copied\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-OverrideDispatchTable (\r
-  IN CONST EFI_PEI_PPI_DESCRIPTOR          *OriginalTable,\r
-  IN       UINTN                           OriginalTableSize,\r
-  IN OUT   EFI_PEI_PPI_DESCRIPTOR          *NewTable,\r
-  IN       UINTN                           NewTableSize\r
-  )\r
-{\r
-  CopyMem (NewTable, OriginalTable, OriginalTableSize);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.inf b/UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.inf
deleted file mode 100644 (file)
index 2900fdb..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-## @file\r
-# A library to produce the global variable 'gUnix'\r
-#\r
-# This library contains a single global variable 'gUnix' along with a constructor to initialize that global.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = NullSecDispatchTableLib\r
-  FILE_GUID                      = D9F3D6F5-97C4-469A-848B-03F742FCCEA3\r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = SecDispatchTableLib \r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  SecDispatchTableLib.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  BaseMemoryLib\r
-\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/ARShiftU64.c b/UnixPkg/Library/UnixBaseLib/ARShiftU64.c
deleted file mode 100644 (file)
index 6c799fa..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled\r
-  with the original integer's bit 63. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the right by Count bits. The\r
-  high Count bits are set to bit 63 of Operand.  The shifted value is returned.\r
-\r
-  If Count is greater than 63, then ASSERT().\r
-\r
-  @param  Operand The 64-bit operand to shift right.\r
-  @param  Count   The number of bits to shift right.\r
-\r
-  @return Operand >> Count\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-ARShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  ASSERT (Count < 64);\r
-  return InternalMathARShiftU64 (Operand, Count);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/BaseLibInternals.h b/UnixPkg/Library/UnixBaseLib/BaseLibInternals.h
deleted file mode 100644 (file)
index a60310a..0000000
+++ /dev/null
@@ -1,1655 +0,0 @@
-/** @file\r
-  Declaration of internal functions in BaseLib.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef __BASE_LIB_INTERNALS__\r
-#define __BASE_LIB_INTERNALS__\r
-\r
-#include <Base.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-//\r
-// Math functions\r
-//\r
-\r
-/**\r
-  Shifts a 64-bit integer left between 0 and 63 bits. The low bits\r
-  are filled with zeros. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the left by Count bits. The\r
-  low Count bits are set to zero. The shifted value is returned.\r
-\r
-  @param  Operand The 64-bit operand to shift left.\r
-  @param  Count   The number of bits to shift left.\r
-\r
-  @return Operand << Count\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathLShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  );\r
-\r
-/**\r
-  Shifts a 64-bit integer right between 0 and 63 bits. The high bits\r
-  are filled with zeros. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the right by Count bits. The\r
-  high Count bits are set to zero. The shifted value is returned.\r
-\r
-  @param  Operand The 64-bit operand to shift right.\r
-  @param  Count   The number of bits to shift right.\r
-\r
-  @return Operand >> Count\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathRShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  );\r
-\r
-/**\r
-  Shifts a 64-bit integer right between 0 and 63 bits. The high bits\r
-  are filled with original integer's bit 63. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the right by Count bits. The\r
-  high Count bits are set to bit 63 of Operand.  The shifted value is returned.\r
-\r
-  @param  Operand The 64-bit operand to shift right.\r
-  @param  Count   The number of bits to shift right.\r
-\r
-  @return Operand arithmetically shifted right by Count\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathARShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  );\r
-\r
-/**\r
-  Rotates a 64-bit integer left between 0 and 63 bits, filling\r
-  the low bits with the high bits that were rotated.\r
-\r
-  This function rotates the 64-bit value Operand to the left by Count bits. The\r
-  low Count bits are filled with the high Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  @param  Operand The 64-bit operand to rotate left.\r
-  @param  Count   The number of bits to rotate left.\r
-\r
-  @return Operand <<< Count\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathLRotU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  );\r
-\r
-/**\r
-  Rotates a 64-bit integer right between 0 and 63 bits, filling\r
-  the high bits with the high low bits that were rotated.\r
-\r
-  This function rotates the 64-bit value Operand to the right by Count bits.\r
-  The high Count bits are filled with the low Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  @param  Operand The 64-bit operand to rotate right.\r
-  @param  Count   The number of bits to rotate right.\r
-\r
-  @return Operand >>> Count\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathRRotU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  );\r
-\r
-/**\r
-  Switches the endianess of a 64-bit integer.\r
-\r
-  This function swaps the bytes in a 64-bit unsigned value to switch the value\r
-  from little endian to big endian or vice versa. The byte swapped value is\r
-  returned.\r
-\r
-  @param  Operand A 64-bit unsigned value.\r
-\r
-  @return The byte swapped Operand.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathSwapBytes64 (\r
-  IN      UINT64                    Operand\r
-  );\r
-\r
-/**\r
-  Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer\r
-  and generates a 64-bit unsigned result.\r
-\r
-  This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit\r
-  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
-  bit unsigned result is returned.\r
-\r
-  @param  Multiplicand  A 64-bit unsigned value.\r
-  @param  Multiplier    A 32-bit unsigned value.\r
-\r
-  @return Multiplicand * Multiplier\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathMultU64x32 (\r
-  IN      UINT64                    Multiplicand,\r
-  IN      UINT32                    Multiplier\r
-  );\r
-\r
-/**\r
-  Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer\r
-  and generates a 64-bit unsigned result.\r
-\r
-  This function multiples the 64-bit unsigned value Multiplicand by the 64-bit\r
-  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
-  bit unsigned result is returned.\r
-\r
-  @param  Multiplicand  A 64-bit unsigned value.\r
-  @param  Multiplier    A 64-bit unsigned value.\r
-\r
-  @return Multiplicand * Multiplier\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathMultU64x64 (\r
-  IN      UINT64                    Multiplicand,\r
-  IN      UINT64                    Multiplier\r
-  );\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and\r
-  generates a 64-bit unsigned result.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. This\r
-  function returns the 64-bit unsigned quotient.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathDivU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor\r
-  );\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and\r
-  generates a 32-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 32-bit remainder. This function\r
-  returns the 32-bit unsigned remainder.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-\r
-  @return Dividend % Divisor\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-InternalMathModU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor\r
-  );\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and\r
-  generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
-  is not NULL, then the 32-bit unsigned remainder is returned in Remainder.\r
-  This function returns the 64-bit unsigned quotient.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-  @param  Remainder A pointer to a 32-bit unsigned value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathDivRemU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor,\r
-  OUT     UINT32                    *Remainder OPTIONAL\r
-  );\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 64-bit unsigned integer and\r
-  generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 64-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
-  is not NULL, then the 64-bit unsigned remainder is returned in Remainder.\r
-  This function returns the 64-bit unsigned quotient.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 64-bit unsigned value.\r
-  @param  Remainder A pointer to a 64-bit unsigned value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathDivRemU64x64 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT64                    Divisor,\r
-  OUT     UINT64                    *Remainder OPTIONAL\r
-  );\r
-\r
-/**\r
-  Divides a 64-bit signed integer by a 64-bit signed integer and\r
-  generates a 64-bit signed result and an optional 64-bit signed remainder.\r
-\r
-  This function divides the 64-bit signed value Dividend by the 64-bit\r
-  signed value Divisor and generates a 64-bit signed quotient. If Remainder\r
-  is not NULL, then the 64-bit signed remainder is returned in Remainder.\r
-  This function returns the 64-bit signed quotient.\r
-\r
-  @param  Dividend  A 64-bit signed value.\r
-  @param  Divisor   A 64-bit signed value.\r
-  @param  Remainder A pointer to a 64-bit signed value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-INT64\r
-EFIAPI\r
-InternalMathDivRemS64x64 (\r
-  IN      INT64                     Dividend,\r
-  IN      INT64                     Divisor,\r
-  OUT     INT64                     *Remainder  OPTIONAL\r
-  );\r
-\r
-/**\r
-  Transfers control to a function starting with a new stack.\r
-\r
-  Transfers control to the function specified by EntryPoint using the\r
-  new stack specified by NewStack and passing in the parameters specified\r
-  by Context1 and Context2.  Context1 and Context2 are optional and may\r
-  be NULL.  The function EntryPoint must never return.\r
-  Marker will be ignored on IA-32, x64, and EBC.\r
-  IPF CPUs expect one additional parameter of type VOID * that specifies\r
-  the new backing store pointer.\r
-\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function.\r
-  @param  Marker      VA_LIST marker for the variable argument list.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalSwitchStack (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,   OPTIONAL\r
-  IN      VOID                      *Context2,   OPTIONAL\r
-  IN      VOID                      *NewStack,\r
-  IN      VA_LIST                   Marker\r
-  );\r
-\r
-\r
-/**\r
-  Worker function that locates the Node in the List.\r
-\r
-  By searching the List, finds the location of the Node in List. At the same time,\r
-  verifies the validity of this list.\r
-\r
-  If List is NULL, then ASSERT().\r
-  If List->ForwardLink is NULL, then ASSERT().\r
-  If List->backLink is NULL, then ASSERT().\r
-  If Node is NULL, then ASSERT();\r
-  If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
-  of nodes in ListHead, including the ListHead node, is greater than or\r
-  equal to PcdMaximumLinkedListLength, then ASSERT().\r
-\r
-  @param  List  A pointer to a node in a linked list.\r
-  @param  Node  A pointer to one nod.\r
-\r
-  @retval TRUE   Node is in List.\r
-  @retval FALSE  Node isn't in List, or List is invalid.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsNodeInList (\r
-  IN      CONST LIST_ENTRY      *List,\r
-  IN      CONST LIST_ENTRY      *Node\r
-  );\r
-\r
-/**\r
-  Worker function that returns a bit field from Operand.\r
-\r
-  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-\r
-  @return The bit field read.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-BitFieldReadUint (\r
-  IN      UINTN                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  );\r
-\r
-\r
-/**\r
-  Worker function that reads a bit field from Operand, performs a bitwise OR,\r
-  and returns the result.\r
-\r
-  Performs a bitwise OR between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new value is returned.\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-  @param  OrData    The value to OR with the read value from the value\r
-\r
-  @return The new value.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-BitFieldOrUint (\r
-  IN      UINTN                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINTN                     OrData\r
-  );\r
-\r
-\r
-/**\r
-  Worker function that reads a bit field from Operand, performs a bitwise AND,\r
-  and returns the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new value is returned.\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-  @param  AndData    The value to And with the read value from the value\r
-\r
-  @return The new value.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-BitFieldAndUint (\r
-  IN      UINTN                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINTN                     AndData\r
-  );\r
-\r
-\r
-/**\r
-  Worker function that checks ASSERT condition for JumpBuffer\r
-\r
-  Checks ASSERT condition for JumpBuffer.\r
-\r
-  If JumpBuffer is NULL, then ASSERT().\r
-  For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
-\r
-  @param  JumpBuffer    A pointer to CPU context buffer.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalAssertJumpBuffer (\r
-  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
-  );\r
-\r
-\r
-/**\r
-  Restores the CPU context that was saved with SetJump().\r
-\r
-  Restores the CPU context from the buffer specified by JumpBuffer.\r
-  This function never returns to the caller.\r
-  Instead is resumes execution based on the state of JumpBuffer.\r
-\r
-  @param  JumpBuffer    A pointer to CPU context buffer.\r
-  @param  Value         The value to return when the SetJump() context is restored.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalLongJump (\r
-  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
-  IN      UINTN                     Value\r
-  );\r
-\r
-\r
-//\r
-// Ia32 and x64 specific functions\r
-//\r
-#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)\r
-\r
-/**\r
-  Reads the current Global Descriptor Table Register(GDTR) descriptor.\r
-\r
-  Reads and returns the current GDTR descriptor and returns it in Gdtr. This\r
-  function is only available on IA-32 and x64.\r
-\r
-  @param  Gdtr  The pointer to a GDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86ReadGdtr (\r
-  OUT     IA32_DESCRIPTOR           *Gdtr\r
-  );\r
-\r
-/**\r
-  Writes the current Global Descriptor Table Register (GDTR) descriptor.\r
-\r
-  Writes and the current GDTR descriptor specified by Gdtr. This function is\r
-  only available on IA-32 and x64.\r
-\r
-  @param  Gdtr  The pointer to a GDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86WriteGdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Gdtr\r
-  );\r
-\r
-/**\r
-  Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
-\r
-  Reads and returns the current IDTR descriptor and returns it in Idtr. This\r
-  function is only available on IA-32 and x64.\r
-\r
-  @param  Idtr  The pointer to an IDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86ReadIdtr (\r
-  OUT     IA32_DESCRIPTOR           *Idtr\r
-  );\r
-\r
-/**\r
-  Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
-\r
-  Writes the current IDTR descriptor and returns it in Idtr. This function is\r
-  only available on IA-32 and x64.\r
-\r
-  @param  Idtr  The pointer to an IDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86WriteIdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Idtr\r
-  );\r
-\r
-/**\r
-  Save the current floating point/SSE/SSE2 context to a buffer.\r
-\r
-  Saves the current floating point/SSE/SSE2 state to the buffer specified by\r
-  Buffer. Buffer must be aligned on a 16-byte boundary. This function is only\r
-  available on IA-32 and x64.\r
-\r
-  @param  Buffer  The pointer to a buffer to save the floating point/SSE/SSE2 context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86FxSave (\r
-  OUT     IA32_FX_BUFFER            *Buffer\r
-  );\r
-\r
-/**\r
-  Restores the current floating point/SSE/SSE2 context from a buffer.\r
-\r
-  Restores the current floating point/SSE/SSE2 state from the buffer specified\r
-  by Buffer. Buffer must be aligned on a 16-byte boundary. This function is\r
-  only available on IA-32 and x64.\r
-\r
-  @param  Buffer  The pointer to a buffer to save the floating point/SSE/SSE2 context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86FxRestore (\r
-  IN      CONST IA32_FX_BUFFER      *Buffer\r
-  );\r
-\r
-/**\r
-  Enables the 32-bit paging mode on the CPU.\r
-\r
-  Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
-  must be properly initialized prior to calling this service. This function\r
-  assumes the current execution mode is 32-bit protected mode. This function is\r
-  only available on IA-32. After the 32-bit paging mode is enabled, control is\r
-  transferred to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  There are a number of constraints that must be followed before calling this\r
-  function:\r
-  1)  Interrupts must be disabled.\r
-  2)  The caller must be in 32-bit protected mode with flat descriptors. This\r
-      means all descriptors must have a base of 0 and a limit of 4GB.\r
-  3)  CR0 and CR4 must be compatible with 32-bit protected mode with flat\r
-      descriptors.\r
-  4)  CR3 must point to valid page tables that will be used once the transition\r
-      is complete, and those page tables must guarantee that the pages for this\r
-      function and the stack are identity mapped.\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack after\r
-                      paging is enabled.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function as the first parameter after paging is enabled.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function as the second parameter after paging is enabled.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function after paging is enabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86EnablePaging32 (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  );\r
-\r
-/**\r
-  Disables the 32-bit paging mode on the CPU.\r
-\r
-  Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r
-  mode. This function assumes the current execution mode is 32-paged protected\r
-  mode. This function is only available on IA-32. After the 32-bit paging mode\r
-  is disabled, control is transferred to the function specified by EntryPoint\r
-  using the new stack specified by NewStack and passing in the parameters\r
-  specified by Context1 and Context2. Context1 and Context2 are optional and\r
-  may be NULL. The function EntryPoint must never return.\r
-\r
-  There are a number of constraints that must be followed before calling this\r
-  function:\r
-  1)  Interrupts must be disabled.\r
-  2)  The caller must be in 32-bit paged mode.\r
-  3)  CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r
-  4)  CR3 must point to valid page tables that guarantee that the pages for\r
-      this function and the stack are identity mapped.\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack after\r
-                      paging is disabled.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function as the first parameter after paging is disabled.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function as the second parameter after paging is\r
-                      disabled.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function after paging is disabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86DisablePaging32 (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  );\r
-\r
-/**\r
-  Enables the 64-bit paging mode on the CPU.\r
-\r
-  Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
-  must be properly initialized prior to calling this service. This function\r
-  assumes the current execution mode is 32-bit protected mode with flat\r
-  descriptors. This function is only available on IA-32. After the 64-bit\r
-  paging mode is enabled, control is transferred to the function specified by\r
-  EntryPoint using the new stack specified by NewStack and passing in the\r
-  parameters specified by Context1 and Context2. Context1 and Context2 are\r
-  optional and may be 0. The function EntryPoint must never return.\r
-\r
-  @param  Cs          The 16-bit selector to load in the CS before EntryPoint\r
-                      is called. The descriptor in the GDT that this selector\r
-                      references must be setup for long mode.\r
-  @param  EntryPoint  The 64-bit virtual address of the function to call with\r
-                      the new stack after paging is enabled.\r
-  @param  Context1    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the first parameter after\r
-                      paging is enabled.\r
-  @param  Context2    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the second parameter after\r
-                      paging is enabled.\r
-  @param  NewStack    The 64-bit virtual address of the new stack to use for\r
-                      the EntryPoint function after paging is enabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86EnablePaging64 (\r
-  IN      UINT16                    Cs,\r
-  IN      UINT64                    EntryPoint,\r
-  IN      UINT64                    Context1,  OPTIONAL\r
-  IN      UINT64                    Context2,  OPTIONAL\r
-  IN      UINT64                    NewStack\r
-  );\r
-\r
-/**\r
-  Disables the 64-bit paging mode on the CPU.\r
-\r
-  Disables the 64-bit paging mode on the CPU and returns to 32-bit protected\r
-  mode. This function assumes the current execution mode is 64-paging mode.\r
-  This function is only available on x64. After the 64-bit paging mode is\r
-  disabled, control is transferred to the function specified by EntryPoint\r
-  using the new stack specified by NewStack and passing in the parameters\r
-  specified by Context1 and Context2. Context1 and Context2 are optional and\r
-  may be 0. The function EntryPoint must never return.\r
-\r
-  @param  Cs          The 16-bit selector to load in the CS before EntryPoint\r
-                      is called. The descriptor in the GDT that this selector\r
-                      references must be setup for 32-bit protected mode.\r
-  @param  EntryPoint  The 64-bit virtual address of the function to call with\r
-                      the new stack after paging is disabled.\r
-  @param  Context1    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the first parameter after\r
-                      paging is disabled.\r
-  @param  Context2    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the second parameter after\r
-                      paging is disabled.\r
-  @param  NewStack    The 64-bit virtual address of the new stack to use for\r
-                      the EntryPoint function after paging is disabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86DisablePaging64 (\r
-  IN      UINT16                    Cs,\r
-  IN      UINT32                    EntryPoint,\r
-  IN      UINT32                    Context1,  OPTIONAL\r
-  IN      UINT32                    Context2,  OPTIONAL\r
-  IN      UINT32                    NewStack\r
-  );\r
-\r
-\r
-#elif defined (MDE_CPU_IPF)\r
-//\r
-//\r
-// IPF specific functions\r
-//\r
-\r
-/**\r
-  Reads control register DCR.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_DCR.\r
-\r
-  @return The 64-bit control register DCR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterDcr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register ITM.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_ITM.\r
-\r
-  @return The 64-bit control register ITM.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterItm (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IVA.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IVA.\r
-\r
-  @return The 64-bit control register IVA.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIva (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register PTA.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_PTA.\r
-\r
-  @return The 64-bit control register PTA.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterPta (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IPSR.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IPSR.\r
-\r
-  @return The 64-bit control register IPSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIpsr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register ISR.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_ISR.\r
-\r
-  @return The 64-bit control register ISR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIsr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IIP.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IIP.\r
-\r
-  @return The 64-bit control register IIP.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIip (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IFA.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IFA.\r
-\r
-  @return The 64-bit control register IFA.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIfa (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register ITIR.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_ITIR.\r
-\r
-  @return The 64-bit control register ITIR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterItir (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IIPA.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IIPA.\r
-\r
-  @return The 64-bit control register IIPA.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIipa (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IFS.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IFS.\r
-\r
-  @return The 64-bit control register IFS.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIfs (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IIM.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IIM.\r
-\r
-  @return The 64-bit control register IIM.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIim (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IHA.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IHA.\r
-\r
-  @return The 64-bit control register IHA.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIha (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register LID.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_LID.\r
-\r
-  @return The 64-bit control register LID.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterLid (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IVR.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IVR.\r
-\r
-  @return The 64-bit control register IVR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIvr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register TPR.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_TPR.\r
-\r
-  @return The 64-bit control register TPR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterTpr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register EOI.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_EOI.\r
-\r
-  @return The 64-bit control register EOI.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterEoi (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IRR0.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IRR0.\r
-\r
-  @return The 64-bit control register IRR0.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIrr0 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IRR1.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IRR1.\r
-\r
-  @return The 64-bit control register IRR1.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIrr1 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IRR2.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IRR2.\r
-\r
-  @return The 64-bit control register IRR2.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIrr2 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register IRR3.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_IRR3.\r
-\r
-  @return The 64-bit control register IRR3.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterIrr3 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register ITV.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_ITV.\r
-\r
-  @return The 64-bit control register ITV.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterItv (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register PMV.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_PMV.\r
-\r
-  @return The 64-bit control register PMV.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterPmv (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register CMCV.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_CMCV.\r
-\r
-  @return The 64-bit control register CMCV.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterCmcv (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register LRR0.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_LRR0.\r
-\r
-  @return The 64-bit control register LRR0.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterLrr0 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads control register LRR1.\r
-\r
-  This is a worker function for AsmReadControlRegister()\r
-  when its parameter Index is IPF_CONTROL_REGISTER_LRR1.\r
-\r
-  @return The 64-bit control register LRR1.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadControlRegisterLrr1 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register K0.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K0.\r
-\r
-  @return The 64-bit application register K0.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK0 (\r
-  VOID\r
-  );\r
-\r
-\r
-\r
-/**\r
-  Reads application register K1.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K1.\r
-\r
-  @return The 64-bit application register K1.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK1 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register K2.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K2.\r
-\r
-  @return The 64-bit application register K2.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK2 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register K3.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K3.\r
-\r
-  @return The 64-bit application register K3.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK3 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register K4.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K4.\r
-\r
-  @return The 64-bit application register K4.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK4 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register K5.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K5.\r
-\r
-  @return The 64-bit application register K5.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK5 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register K6.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K6.\r
-\r
-  @return The 64-bit application register K6.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK6 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register K7.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_K7.\r
-\r
-  @return The 64-bit application register K7.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterK7 (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register RSC.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_RSC.\r
-\r
-  @return The 64-bit application register RSC.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterRsc (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register BSP.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_BSP.\r
-\r
-  @return The 64-bit application register BSP.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterBsp (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register BSPSTORE.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_BSPSTORE.\r
-\r
-  @return The 64-bit application register BSPSTORE.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterBspstore (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register RNAT.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_RNAT.\r
-\r
-  @return The 64-bit application register RNAT.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterRnat (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register FCR.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_FCR.\r
-\r
-  @return The 64-bit application register FCR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterFcr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register EFLAG.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_EFLAG.\r
-\r
-  @return The 64-bit application register EFLAG.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterEflag (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register CSD.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_CSD.\r
-\r
-  @return The 64-bit application register CSD.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterCsd (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register SSD.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_SSD.\r
-\r
-  @return The 64-bit application register SSD.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterSsd (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register CFLG.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_CFLG.\r
-\r
-  @return The 64-bit application register CFLG.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterCflg (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register FSR.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_FSR.\r
-\r
-  @return The 64-bit application register FSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterFsr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register FIR.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_FIR.\r
-\r
-  @return The 64-bit application register FIR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterFir (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register FDR.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_FDR.\r
-\r
-  @return The 64-bit application register FDR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterFdr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register CCV.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_CCV.\r
-\r
-  @return The 64-bit application register CCV.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterCcv (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register UNAT.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_UNAT.\r
-\r
-  @return The 64-bit application register UNAT.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterUnat (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register FPSR.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_FPSR.\r
-\r
-  @return The 64-bit application register FPSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterFpsr (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register ITC.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_ITC.\r
-\r
-  @return The 64-bit application register ITC.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterItc (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register PFS.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_PFS.\r
-\r
-  @return The 64-bit application register PFS.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterPfs (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register LC.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_LC.\r
-\r
-  @return The 64-bit application register LC.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterLc (\r
-  VOID\r
-  );\r
-\r
-\r
-/**\r
-  Reads application register EC.\r
-\r
-  This is a worker function for AsmReadApplicationRegister()\r
-  when its parameter Index is IPF_APPLICATION_REGISTER_EC.\r
-\r
-  @return The 64-bit application register EC.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadApplicationRegisterEc (\r
-  VOID\r
-  );\r
-\r
-\r
-\r
-/**\r
-  Transfers control to a function starting with a new stack.\r
-\r
-  Transfers control to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function.\r
-  @param  NewBsp      A pointer to the new memory location for RSE backing\r
-                      store.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmSwitchStackAndBackingStore (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack,\r
-  IN      VOID                      *NewBsp\r
-  );\r
-\r
-/**\r
-  Internal worker function to invalidate a range of instruction cache lines\r
-  in the cache coherency domain of the calling CPU.\r
-\r
-  Internal worker function to invalidate the instruction cache lines specified\r
-  by Address and Length. If Address is not aligned on a cache line boundary,\r
-  then entire instruction cache line containing Address is invalidated. If\r
-  Address + Length is not aligned on a cache line boundary, then the entire\r
-  instruction cache line containing Address + Length -1 is invalidated. This\r
-  function may choose to invalidate the entire instruction cache if that is more\r
-  efficient than invalidating the specified range. If Length is 0, the no instruction\r
-  cache lines are invalidated. Address is returned.\r
-  This function is only available on IPF.\r
-\r
-  @param  Address The base address of the instruction cache lines to\r
-                  invalidate. If the CPU is in a physical addressing mode, then\r
-                  Address is a physical address. If the CPU is in a virtual\r
-                  addressing mode, then Address is a virtual address.\r
-\r
-  @param  Length  The number of bytes to invalidate from the instruction cache.\r
-\r
-  @return Address\r
-\r
-**/\r
-VOID *\r
-EFIAPI\r
-InternalFlushCacheRange (\r
-  IN      VOID                      *Address,\r
-  IN      UINTN                     Length\r
-  );\r
-\r
-#else\r
-\r
-#endif\r
-\r
-#endif\r
diff --git a/UnixPkg/Library/UnixBaseLib/BitField.c b/UnixPkg/Library/UnixBaseLib/BitField.c
deleted file mode 100644 (file)
index d17e562..0000000
+++ /dev/null
@@ -1,868 +0,0 @@
-/** @file\r
-  Bit field functions of BaseLib.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Worker function that returns a bit field from Operand.\r
-\r
-  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-\r
-  @return The bit field read.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-InternalBaseLibBitFieldReadUint (\r
-  IN      UINTN                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  )\r
-{\r
-  //\r
-  // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
-  // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.\r
-  //\r
-  return (Operand & ~((UINTN)-2 << EndBit)) >> StartBit;\r
-}\r
-\r
-/**\r
-  Worker function that reads a bit field from Operand, performs a bitwise OR,\r
-  and returns the result.\r
-\r
-  Performs a bitwise OR between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new value is returned.\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-  @param  OrData    The value to OR with the read value from the value.\r
-\r
-  @return The new value.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-InternalBaseLibBitFieldOrUint (\r
-  IN      UINTN                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINTN                     OrData\r
-  )\r
-{\r
-  //\r
-  // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
-  // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.\r
-  //\r
-  return Operand | ((OrData << StartBit) & ~((UINTN) -2 << EndBit));\r
-}\r
-\r
-/**\r
-  Worker function that reads a bit field from Operand, performs a bitwise AND,\r
-  and returns the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new value is returned.\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-  @param  AndData    The value to And with the read value from the value.\r
-\r
-  @return The new value.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-InternalBaseLibBitFieldAndUint (\r
-  IN      UINTN                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINTN                     AndData\r
-  )\r
-{\r
-  //\r
-  // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]\r
-  // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.\r
-  //\r
-  return Operand & ~((~AndData << StartBit) & ~((UINTN)-2 << EndBit));\r
-}\r
-\r
-/**\r
-  Returns a bit field from an 8-bit value.\r
-\r
-  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
-\r
-  If 8-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 7, then ASSERT().\r
-  If EndBit is greater than 7, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..7.\r
-\r
-  @return The bit field read.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-BitFieldRead8 (\r
-  IN      UINT8                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  )\r
-{\r
-  ASSERT (EndBit < 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT8)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);\r
-}\r
-\r
-/**\r
-  Writes a bit field to an 8-bit value, and returns the result.\r
-\r
-  Writes Value to the bit field specified by the StartBit and the EndBit in\r
-  Operand. All other bits in Operand are preserved. The new 8-bit value is\r
-  returned.\r
-\r
-  If 8-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 7, then ASSERT().\r
-  If EndBit is greater than 7, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  Value     The new value of the bit field.\r
-\r
-  @return The new 8-bit value.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-BitFieldWrite8 (\r
-  IN      UINT8                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     Value\r
-  )\r
-{\r
-  ASSERT (EndBit < 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldAndThenOr8 (Operand, StartBit, EndBit, 0, Value);\r
-}\r
-\r
-/**\r
-  Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the\r
-  result.\r
-\r
-  Performs a bitwise OR between the bit field specified by StartBit\r
-  and EndBit in Operand and the value specified by OrData. All other bits in\r
-  Operand are preserved. The new 8-bit value is returned.\r
-\r
-  If 8-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 7, then ASSERT().\r
-  If EndBit is greater than 7, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  OrData    The value to OR with the read value from the value.\r
-\r
-  @return The new 8-bit value.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-BitFieldOr8 (\r
-  IN      UINT8                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT8)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
-}\r
-\r
-/**\r
-  Reads a bit field from an 8-bit value, performs a bitwise AND, and returns\r
-  the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new 8-bit value is returned.\r
-\r
-  If 8-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 7, then ASSERT().\r
-  If EndBit is greater than 7, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-\r
-  @return The new 8-bit value.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-BitFieldAnd8 (\r
-  IN      UINT8                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     AndData\r
-  )\r
-{\r
-  ASSERT (EndBit < 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT8)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
-}\r
-\r
-/**\r
-  Reads a bit field from an 8-bit value, performs a bitwise AND followed by a\r
-  bitwise OR, and returns the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData, followed by a bitwise \r
-  OR with value specified by OrData. All other bits in Operand are\r
-  preserved. The new 8-bit value is returned.\r
-\r
-  If 8-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 7, then ASSERT().\r
-  If EndBit is greater than 7, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..7.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-  @param  OrData    The value to OR with the result of the AND operation.\r
-\r
-  @return The new 8-bit value.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-BitFieldAndThenOr8 (\r
-  IN      UINT8                     Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT8                     AndData,\r
-  IN      UINT8                     OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldOr8 (\r
-           BitFieldAnd8 (Operand, StartBit, EndBit, AndData),\r
-           StartBit,\r
-           EndBit,\r
-           OrData\r
-           );\r
-}\r
-\r
-/**\r
-  Returns a bit field from a 16-bit value.\r
-\r
-  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
-\r
-  If 16-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 15, then ASSERT().\r
-  If EndBit is greater than 15, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..15.\r
-\r
-  @return The bit field read.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-BitFieldRead16 (\r
-  IN      UINT16                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  )\r
-{\r
-  ASSERT (EndBit < 16);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT16)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);\r
-}\r
-\r
-/**\r
-  Writes a bit field to a 16-bit value, and returns the result.\r
-\r
-  Writes Value to the bit field specified by the StartBit and the EndBit in\r
-  Operand. All other bits in Operand are preserved. The new 16-bit value is\r
-  returned.\r
-\r
-  If 16-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 15, then ASSERT().\r
-  If EndBit is greater than 15, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  Value     The new value of the bit field.\r
-\r
-  @return The new 16-bit value.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-BitFieldWrite16 (\r
-  IN      UINT16                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    Value\r
-  )\r
-{\r
-  ASSERT (EndBit < 16);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldAndThenOr16 (Operand, StartBit, EndBit, 0, Value);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the\r
-  result.\r
-\r
-  Performs a bitwise OR between the bit field specified by StartBit\r
-  and EndBit in Operand and the value specified by OrData. All other bits in\r
-  Operand are preserved. The new 16-bit value is returned.\r
-\r
-  If 16-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 15, then ASSERT().\r
-  If EndBit is greater than 15, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  OrData    The value to OR with the read value from the value.\r
-\r
-  @return The new 16-bit value.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-BitFieldOr16 (\r
-  IN      UINT16                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < 16);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT16)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 16-bit value, performs a bitwise AND, and returns\r
-  the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new 16-bit value is returned.\r
-\r
-  If 16-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 15, then ASSERT().\r
-  If EndBit is greater than 15, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-\r
-  @return The new 16-bit value.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-BitFieldAnd16 (\r
-  IN      UINT16                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    AndData\r
-  )\r
-{\r
-  ASSERT (EndBit < 16);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT16)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 16-bit value, performs a bitwise AND followed by a\r
-  bitwise OR, and returns the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData, followed by a bitwise \r
-  OR with value specified by OrData. All other bits in Operand are\r
-  preserved. The new 16-bit value is returned.\r
-\r
-  If 16-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 15, then ASSERT().\r
-  If EndBit is greater than 15, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..15.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-  @param  OrData    The value to OR with the result of the AND operation.\r
-\r
-  @return The new 16-bit value.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-BitFieldAndThenOr16 (\r
-  IN      UINT16                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT16                    AndData,\r
-  IN      UINT16                    OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < 16);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldOr16 (\r
-           BitFieldAnd16 (Operand, StartBit, EndBit, AndData),\r
-           StartBit,\r
-           EndBit,\r
-           OrData\r
-           );\r
-}\r
-\r
-/**\r
-  Returns a bit field from a 32-bit value.\r
-\r
-  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
-\r
-  If 32-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-\r
-  @return The bit field read.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-BitFieldRead32 (\r
-  IN      UINT32                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  )\r
-{\r
-  ASSERT (EndBit < 32);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT32)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);\r
-}\r
-\r
-/**\r
-  Writes a bit field to a 32-bit value, and returns the result.\r
-\r
-  Writes Value to the bit field specified by the StartBit and the EndBit in\r
-  Operand. All other bits in Operand are preserved. The new 32-bit value is\r
-  returned.\r
-\r
-  If 32-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  Value     The new value of the bit field.\r
-\r
-  @return The new 32-bit value.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-BitFieldWrite32 (\r
-  IN      UINT32                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  ASSERT (EndBit < 32);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldAndThenOr32 (Operand, StartBit, EndBit, 0, Value);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the\r
-  result.\r
-\r
-  Performs a bitwise OR between the bit field specified by StartBit\r
-  and EndBit in Operand and the value specified by OrData. All other bits in\r
-  Operand are preserved. The new 32-bit value is returned.\r
-\r
-  If 32-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  OrData    The value to OR with the read value from the value.\r
-\r
-  @return The new 32-bit value.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-BitFieldOr32 (\r
-  IN      UINT32                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < 32);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT32)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 32-bit value, performs a bitwise AND, and returns\r
-  the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new 32-bit value is returned.\r
-\r
-  If 32-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-\r
-  @return The new 32-bit value.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-BitFieldAnd32 (\r
-  IN      UINT32                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    AndData\r
-  )\r
-{\r
-  ASSERT (EndBit < 32);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT32)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 32-bit value, performs a bitwise AND followed by a\r
-  bitwise OR, and returns the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData, followed by a bitwise \r
-  OR with value specified by OrData. All other bits in Operand are\r
-  preserved. The new 32-bit value is returned.\r
-\r
-  If 32-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-  @param  OrData    The value to OR with the result of the AND operation.\r
-\r
-  @return The new 32-bit value.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-BitFieldAndThenOr32 (\r
-  IN      UINT32                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    AndData,\r
-  IN      UINT32                    OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < 32);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldOr32 (\r
-           BitFieldAnd32 (Operand, StartBit, EndBit, AndData),\r
-           StartBit,\r
-           EndBit,\r
-           OrData\r
-           );\r
-}\r
-\r
-/**\r
-  Returns a bit field from a 64-bit value.\r
-\r
-  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
-\r
-  If 64-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-\r
-  @return The bit field read.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-BitFieldRead64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  )\r
-{\r
-  ASSERT (EndBit < 64);\r
-  ASSERT (StartBit <= EndBit);\r
-  return RShiftU64 (Operand & ~LShiftU64 ((UINT64)-2, EndBit), StartBit);\r
-}\r
-\r
-/**\r
-  Writes a bit field to a 64-bit value, and returns the result.\r
-\r
-  Writes Value to the bit field specified by the StartBit and the EndBit in\r
-  Operand. All other bits in Operand are preserved. The new 64-bit value is\r
-  returned.\r
-\r
-  If 64-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  Value     The new value of the bit field.\r
-\r
-  @return The new 64-bit value.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-BitFieldWrite64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  ASSERT (EndBit < 64);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldAndThenOr64 (Operand, StartBit, EndBit, 0, Value);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the\r
-  result.\r
-\r
-  Performs a bitwise OR between the bit field specified by StartBit\r
-  and EndBit in Operand and the value specified by OrData. All other bits in\r
-  Operand are preserved. The new 64-bit value is returned.\r
-\r
-  If 64-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  OrData    The value to OR with the read value from the value\r
-\r
-  @return The new 64-bit value.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-BitFieldOr64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    OrData\r
-  )\r
-{\r
-  UINT64  Value1;\r
-  UINT64  Value2;\r
-\r
-  ASSERT (EndBit < 64);\r
-  ASSERT (StartBit <= EndBit);\r
-\r
-  Value1 = LShiftU64 (OrData, StartBit);\r
-  Value2 = LShiftU64 ((UINT64) - 2, EndBit);\r
-\r
-  return Operand | (Value1 & ~Value2);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 64-bit value, performs a bitwise AND, and returns\r
-  the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData. All other bits in Operand are\r
-  preserved. The new 64-bit value is returned.\r
-\r
-  If 64-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-\r
-  @return The new 64-bit value.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-BitFieldAnd64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    AndData\r
-  )\r
-{\r
-  UINT64  Value1;\r
-  UINT64  Value2;\r
-  \r
-  ASSERT (EndBit < 64);\r
-  ASSERT (StartBit <= EndBit);\r
-\r
-  Value1 = LShiftU64 (~AndData, StartBit);\r
-  Value2 = LShiftU64 ((UINT64)-2, EndBit);\r
-\r
-  return Operand & ~(Value1 & ~Value2);\r
-}\r
-\r
-/**\r
-  Reads a bit field from a 64-bit value, performs a bitwise AND followed by a\r
-  bitwise OR, and returns the result.\r
-\r
-  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
-  in Operand and the value specified by AndData, followed by a bitwise \r
-  OR with value specified by OrData. All other bits in Operand are\r
-  preserved. The new 64-bit value is returned.\r
-\r
-  If 64-bit operations are not supported, then ASSERT().\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Operand   Operand on which to perform the bitfield operation.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  AndData   The value to AND with the read value from the value.\r
-  @param  OrData    The value to OR with the result of the AND operation.\r
-\r
-  @return The new 64-bit value.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-BitFieldAndThenOr64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    AndData,\r
-  IN      UINT64                    OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < 64);\r
-  ASSERT (StartBit <= EndBit);\r
-  return BitFieldOr64 (\r
-           BitFieldAnd64 (Operand, StartBit, EndBit, AndData),\r
-           StartBit,\r
-           EndBit,\r
-           OrData\r
-           );\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/CheckSum.c b/UnixPkg/Library/UnixBaseLib/CheckSum.c
deleted file mode 100644 (file)
index 2968829..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/** @file\r
-  Utility functions to generate checksum based on 2's complement\r
-  algorithm.\r
-\r
-  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Returns the sum of all elements in a buffer in unit of UINT8.\r
-  During calculation, the carry bits are dropped.\r
-\r
-  This function calculates the sum of all elements in a buffer\r
-  in unit of UINT8. The carry bits in result of addition are dropped.\r
-  The result is returned as UINT8. If Length is Zero, then Zero is\r
-  returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-CalculateSum8 (\r
-  IN      CONST UINT8              *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT8     Sum;\r
-  UINTN     Count;\r
-\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));\r
-\r
-  for (Sum = 0, Count = 0; Count < Length; Count++) {\r
-    Sum = (UINT8) (Sum + *(Buffer + Count));\r
-  }\r
-  \r
-  return Sum;\r
-}\r
-\r
-\r
-/**\r
-  Returns the two's complement checksum of all elements in a buffer\r
-  of 8-bit values.\r
-\r
-  This function first calculates the sum of the 8-bit values in the\r
-  buffer specified by Buffer and Length.  The carry bits in the result\r
-  of addition are dropped. Then, the two's complement of the sum is\r
-  returned.  If Length is 0, then 0 is returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Checksum    The 2's complement checksum of Buffer.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-CalculateCheckSum8 (\r
-  IN      CONST UINT8              *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT8     CheckSum;\r
-\r
-  CheckSum = CalculateSum8 (Buffer, Length);\r
-\r
-  //\r
-  // Return the checksum based on 2's complement.\r
-  //\r
-  return (UINT8) (0x100 - CheckSum);\r
-}\r
-\r
-/**\r
-  Returns the sum of all elements in a buffer of 16-bit values.  During\r
-  calculation, the carry bits are dropped.\r
-\r
-  This function calculates the sum of the 16-bit values in the buffer\r
-  specified by Buffer and Length. The carry bits in result of addition are dropped.\r
-  The 16-bit result is returned.  If Length is 0, then 0 is returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-CalculateSum16 (\r
-  IN      CONST UINT16             *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT16    Sum;\r
-  UINTN     Count;\r
-  UINTN     Total;\r
-\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (((UINTN) Buffer & 0x1) == 0);\r
-  ASSERT ((Length & 0x1) == 0);\r
-  ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));\r
-\r
-  Total = Length / sizeof (*Buffer);\r
-  for (Sum = 0, Count = 0; Count < Total; Count++) {\r
-    Sum = (UINT16) (Sum + *(Buffer + Count));\r
-  }\r
-  \r
-  return Sum;\r
-}\r
-\r
-\r
-/**\r
-  Returns the two's complement checksum of all elements in a buffer of\r
-  16-bit values.\r
-\r
-  This function first calculates the sum of the 16-bit values in the buffer\r
-  specified by Buffer and Length.  The carry bits in the result of addition\r
-  are dropped. Then, the two's complement of the sum is returned.  If Length\r
-  is 0, then 0 is returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Checksum    The 2's complement checksum of Buffer.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-CalculateCheckSum16 (\r
-  IN      CONST UINT16             *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT16     CheckSum;\r
-\r
-  CheckSum = CalculateSum16 (Buffer, Length);\r
-\r
-  //\r
-  // Return the checksum based on 2's complement.\r
-  //\r
-  return (UINT16) (0x10000 - CheckSum);\r
-}\r
-\r
-\r
-/**\r
-  Returns the sum of all elements in a buffer of 32-bit values. During\r
-  calculation, the carry bits are dropped.\r
-\r
-  This function calculates the sum of the 32-bit values in the buffer\r
-  specified by Buffer and Length. The carry bits in result of addition are dropped.\r
-  The 32-bit result is returned. If Length is 0, then 0 is returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
-  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-CalculateSum32 (\r
-  IN      CONST UINT32             *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT32    Sum;\r
-  UINTN     Count;\r
-  UINTN     Total;\r
-\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (((UINTN) Buffer & 0x3) == 0);\r
-  ASSERT ((Length & 0x3) == 0);\r
-  ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));\r
-\r
-  Total = Length / sizeof (*Buffer);\r
-  for (Sum = 0, Count = 0; Count < Total; Count++) {\r
-    Sum = Sum + *(Buffer + Count);\r
-  }\r
-  \r
-  return Sum;\r
-}\r
-\r
-\r
-/**\r
-  Returns the two's complement checksum of all elements in a buffer of\r
-  32-bit values.\r
-\r
-  This function first calculates the sum of the 32-bit values in the buffer\r
-  specified by Buffer and Length.  The carry bits in the result of addition\r
-  are dropped. Then, the two's complement of the sum is returned.  If Length\r
-  is 0, then 0 is returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
-  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Checksum    The 2's complement checksum of Buffer.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-CalculateCheckSum32 (\r
-  IN      CONST UINT32             *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT32     CheckSum;\r
-\r
-  CheckSum = CalculateSum32 (Buffer, Length);\r
-\r
-  //\r
-  // Return the checksum based on 2's complement.\r
-  //\r
-  return (UINT32) ((UINT32)(-1) - CheckSum + 1);\r
-}\r
-\r
-\r
-/**\r
-  Returns the sum of all elements in a buffer of 64-bit values.  During\r
-  calculation, the carry bits are dropped.\r
-\r
-  This function calculates the sum of the 64-bit values in the buffer\r
-  specified by Buffer and Length. The carry bits in result of addition are dropped.\r
-  The 64-bit result is returned.  If Length is 0, then 0 is returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
-  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the sum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-CalculateSum64 (\r
-  IN      CONST UINT64             *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT64    Sum;\r
-  UINTN     Count;\r
-  UINTN     Total;\r
-\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (((UINTN) Buffer & 0x7) == 0);\r
-  ASSERT ((Length & 0x7) == 0);\r
-  ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));\r
-\r
-  Total = Length / sizeof (*Buffer);\r
-  for (Sum = 0, Count = 0; Count < Total; Count++) {\r
-    Sum = Sum + *(Buffer + Count);\r
-  }\r
-  \r
-  return Sum;\r
-}\r
-\r
-\r
-/**\r
-  Returns the two's complement checksum of all elements in a buffer of\r
-  64-bit values.\r
-\r
-  This function first calculates the sum of the 64-bit values in the buffer\r
-  specified by Buffer and Length.  The carry bits in the result of addition\r
-  are dropped. Then, the two's complement of the sum is returned.  If Length\r
-  is 0, then 0 is returned.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
-  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
-\r
-  @param  Buffer      The pointer to the buffer to carry out the checksum operation.\r
-  @param  Length      The size, in bytes, of Buffer.\r
-\r
-  @return Checksum    The 2's complement checksum of Buffer.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-CalculateCheckSum64 (\r
-  IN      CONST UINT64             *Buffer,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINT64     CheckSum;\r
-\r
-  CheckSum = CalculateSum64 (Buffer, Length);\r
-\r
-  //\r
-  // Return the checksum based on 2's complement.\r
-  //\r
-  return (UINT64) ((UINT64)(-1) - CheckSum + 1);\r
-}\r
-\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/ChkStkGcc.c b/UnixPkg/Library/UnixBaseLib/ChkStkGcc.c
deleted file mode 100644 (file)
index ecba385..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file\r
-  Provides hack function for passng GCC build.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Hack function for passing GCC build.\r
-**/\r
-VOID \r
-__chkstk() \r
-{\r
-}\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/Cpu.c b/UnixPkg/Library/UnixBaseLib/Cpu.c
deleted file mode 100644 (file)
index 8bcbf25..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/** @file\r
-  Base Library CPU Functions for all architectures.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-\r
-/**\r
-  Disables CPU interrupts and returns the interrupt state prior to the disable\r
-  operation.\r
-\r
-  @retval TRUE  CPU interrupts were enabled on entry to this call.\r
-  @retval FALSE CPU interrupts were disabled on entry to this call.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-SaveAndDisableInterrupts (\r
-  VOID\r
-  )\r
-{\r
-  BOOLEAN                           InterruptState;\r
-\r
-  InterruptState = GetInterruptState ();\r
-  DisableInterrupts ();\r
-  return InterruptState;\r
-}\r
-\r
-/**\r
-  Set the current CPU interrupt state.\r
-\r
-  Sets the current CPU interrupt state to the state specified by\r
-  InterruptState. If InterruptState is TRUE, then interrupts are enabled. If\r
-  InterruptState is FALSE, then interrupts are disabled. InterruptState is\r
-  returned.\r
-\r
-  @param  InterruptState  TRUE if interrupts should be enabled. FALSE if\r
-                          interrupts should be disabled.\r
-\r
-  @return InterruptState\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-SetInterruptState (\r
-  IN      BOOLEAN                   InterruptState\r
-  )\r
-{\r
-  if (InterruptState) {\r
-    EnableInterrupts ();\r
-  } else {\r
-    DisableInterrupts ();\r
-  }\r
-  return InterruptState;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/CpuDeadLoop.c b/UnixPkg/Library/UnixBaseLib/CpuDeadLoop.c
deleted file mode 100644 (file)
index 3f94405..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file\r
-  Base Library CPU Functions for all architectures.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-#include <Base.h>\r
-#include <Library/BaseLib.h>\r
-\r
-/**\r
-  Executes an infinite loop.\r
-\r
-  Forces the CPU to execute an infinite loop. A debugger may be used to skip\r
-  past the loop and the code that follows the loop must execute properly. This\r
-  implies that the infinite loop must not cause the code that follow it to be\r
-  optimized away.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-CpuDeadLoop (\r
-  VOID\r
-  )\r
-{\r
-  volatile UINTN  Index;\r
-\r
-  for (Index = 0; Index == 0;);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/DivS64x64Remainder.c b/UnixPkg/Library/UnixBaseLib/DivS64x64Remainder.c
deleted file mode 100644 (file)
index bb2fddc..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Divides a 64-bit signed integer by a 64-bit signed integer and generates a\r
-  64-bit signed result and a optional 64-bit signed remainder.\r
-\r
-  This function divides the 64-bit signed value Dividend by the 64-bit signed\r
-  value Divisor and generates a 64-bit signed quotient. If Remainder is not\r
-  NULL, then the 64-bit signed remainder is returned in Remainder. This\r
-  function returns the 64-bit signed quotient.\r
-\r
-  It is the caller's responsibility to not call this function with a Divisor of 0.\r
-  If Divisor is 0, then the quotient and remainder should be assumed to be \r
-  the largest negative integer.\r
-\r
-  If Divisor is 0, then ASSERT().\r
-\r
-  @param  Dividend  A 64-bit signed value.\r
-  @param  Divisor   A 64-bit signed value.\r
-  @param  Remainder A pointer to a 64-bit signed value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-INT64\r
-EFIAPI\r
-DivS64x64Remainder (\r
-  IN      INT64                     Dividend,\r
-  IN      INT64                     Divisor,\r
-  OUT     INT64                     *Remainder  OPTIONAL\r
-  )\r
-{\r
-  ASSERT (Divisor != 0);\r
-  return InternalMathDivRemS64x64 (Dividend, Divisor, Remainder);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/DivU64x32.c b/UnixPkg/Library/UnixBaseLib/DivU64x32.c
deleted file mode 100644 (file)
index 3e637cc..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates\r
-  a 64-bit unsigned result.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. This\r
-  function returns the 64-bit unsigned quotient.\r
-\r
-  If Divisor is 0, then ASSERT().\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-DivU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor\r
-  )\r
-{\r
-  ASSERT (Divisor != 0);\r
-  return InternalMathDivU64x32 (Dividend, Divisor);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/DivU64x32Remainder.c b/UnixPkg/Library/UnixBaseLib/DivU64x32Remainder.c
deleted file mode 100644 (file)
index cf51f13..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates\r
-  a 64-bit unsigned result and an optional 32-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
-  is not NULL, then the 32-bit unsigned remainder is returned in Remainder.\r
-  This function returns the 64-bit unsigned quotient.\r
-\r
-  If Divisor is 0, then ASSERT().\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-  @param  Remainder A pointer to a 32-bit unsigned value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-DivU64x32Remainder (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor,\r
-  OUT     UINT32                    *Remainder  OPTIONAL\r
-  )\r
-{\r
-  ASSERT (Divisor != 0);\r
-  return InternalMathDivRemU64x32 (Dividend, Divisor, Remainder);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/DivU64x64Remainder.c b/UnixPkg/Library/UnixBaseLib/DivU64x64Remainder.c
deleted file mode 100644 (file)
index 1366ca4..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates\r
-  a 64-bit unsigned result and an optional 64-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 64-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
-  is not NULL, then the 64-bit unsigned remainder is returned in Remainder.\r
-  This function returns the 64-bit unsigned quotient.\r
-\r
-  If Divisor is 0, then ASSERT().\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 64-bit unsigned value.\r
-  @param  Remainder A pointer to a 64-bit unsigned value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-DivU64x64Remainder (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT64                    Divisor,\r
-  OUT     UINT64                    *Remainder  OPTIONAL\r
-  )\r
-{\r
-  ASSERT (Divisor != 0);\r
-  return InternalMathDivRemU64x64 (Dividend, Divisor, Remainder);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/GetPowerOfTwo32.c b/UnixPkg/Library/UnixBaseLib/GetPowerOfTwo32.c
deleted file mode 100644 (file)
index 913efb7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Returns the value of the highest bit set in a 32-bit value. Equivalent to\r
-  1 << log2(x).\r
-\r
-  This function computes the value of the highest bit set in the 32-bit value\r
-  specified by Operand. If Operand is zero, then zero is returned.\r
-\r
-  @param  Operand The 32-bit operand to evaluate.\r
-\r
-  @return 1 << HighBitSet32(Operand)\r
-  @retval 0 Operand is zero.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-GetPowerOfTwo32 (\r
-  IN      UINT32                    Operand\r
-  )\r
-{\r
-  if (0 == Operand) {\r
-    return 0;\r
-  }\r
-\r
-  return 1ul << HighBitSet32 (Operand);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/GetPowerOfTwo64.c b/UnixPkg/Library/UnixBaseLib/GetPowerOfTwo64.c
deleted file mode 100644 (file)
index 3574bc4..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Returns the value of the highest bit set in a 64-bit value. Equivalent to\r
-  1 << log2(x).\r
-\r
-  This function computes the value of the highest bit set in the 64-bit value\r
-  specified by Operand. If Operand is zero, then zero is returned.\r
-\r
-  @param  Operand The 64-bit operand to evaluate.\r
-\r
-  @return 1 << HighBitSet64(Operand)\r
-  @retval 0 Operand is zero.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-GetPowerOfTwo64 (\r
-  IN      UINT64                    Operand\r
-  )\r
-{\r
-  if (Operand == 0) {\r
-    return 0;\r
-  }\r
-\r
-  return LShiftU64 (1, (UINTN) HighBitSet64 (Operand));\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/HighBitSet32.c b/UnixPkg/Library/UnixBaseLib/HighBitSet32.c
deleted file mode 100644 (file)
index 8d055fe..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Returns the bit position of the highest bit set in a 32-bit value. Equivalent\r
-  to log2(x).\r
-\r
-  This function computes the bit position of the highest bit set in the 32-bit\r
-  value specified by Operand. If Operand is zero, then -1 is returned.\r
-  Otherwise, a value between 0 and 31 is returned.\r
-\r
-  @param  Operand The 32-bit operand to evaluate.\r
-\r
-  @retval 0..31  Position of the highest bit set in Operand if found.\r
-  @retval -1     Operand is zero.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-HighBitSet32 (\r
-  IN      UINT32                    Operand\r
-  )\r
-{\r
-  INTN                              BitIndex;\r
-\r
-  if (Operand == 0) {\r
-    return - 1;\r
-  }\r
-  for (BitIndex = 31; (INT32)Operand > 0; BitIndex--, Operand <<= 1);\r
-  return BitIndex;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/HighBitSet64.c b/UnixPkg/Library/UnixBaseLib/HighBitSet64.c
deleted file mode 100644 (file)
index 23abb73..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Returns the bit position of the highest bit set in a 64-bit value. Equivalent\r
-  to log2(x).\r
-\r
-  This function computes the bit position of the highest bit set in the 64-bit\r
-  value specified by Operand. If Operand is zero, then -1 is returned.\r
-  Otherwise, a value between 0 and 63 is returned.\r
-\r
-  @param  Operand The 64-bit operand to evaluate.\r
-\r
-  @retval 0..63   Position of the highest bit set in Operand if found.\r
-  @retval -1      Operand is zero.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-HighBitSet64 (\r
-  IN      UINT64                    Operand\r
-  )\r
-{\r
-  if (Operand == (UINT32)Operand) {\r
-    //\r
-    // Operand is just a 32-bit integer\r
-    //\r
-    return HighBitSet32 ((UINT32)Operand);\r
-  }\r
-\r
-  //\r
-  // Operand is really a 64-bit integer\r
-  //\r
-  if (sizeof (UINTN) == sizeof (UINT32)) {\r
-    return HighBitSet32 (((UINT32*)&Operand)[1]) + 32;\r
-  } else {\r
-    return HighBitSet32 ((UINT32)RShiftU64 (Operand, 32)) + 32;\r
-  }\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/LRotU32.c b/UnixPkg/Library/UnixBaseLib/LRotU32.c
deleted file mode 100644 (file)
index d9bde78..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits\r
-  with the high bits that were rotated.\r
-\r
-  This function rotates the 32-bit value Operand to the left by Count bits. The\r
-  low Count bits are fill with the high Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  If Count is greater than 31, then ASSERT().\r
-\r
-  @param  Operand The 32-bit operand to rotate left.\r
-  @param  Count   The number of bits to rotate left.\r
-\r
-  @return Operand << Count\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-LRotU32 (\r
-  IN      UINT32                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  ASSERT (Count < 32);\r
-  return (Operand << Count) | (Operand >> (32 - Count));\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/LRotU64.c b/UnixPkg/Library/UnixBaseLib/LRotU64.c
deleted file mode 100644 (file)
index 66b982a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits\r
-  with the high bits that were rotated.\r
-\r
-  This function rotates the 64-bit value Operand to the left by Count bits. The\r
-  low Count bits are fill with the high Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  If Count is greater than 63, then ASSERT().\r
-\r
-  @param  Operand The 64-bit operand to rotate left.\r
-  @param  Count   The number of bits to rotate left.\r
-\r
-  @return Operand << Count\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-LRotU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  ASSERT (Count < 64);\r
-  return InternalMathLRotU64 (Operand, Count);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/LShiftU64.c b/UnixPkg/Library/UnixBaseLib/LShiftU64.c
deleted file mode 100644 (file)
index d13fd21..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled\r
-  with zeros. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the left by Count bits. The\r
-  low Count bits are set to zero. The shifted value is returned.\r
-\r
-  If Count is greater than 63, then ASSERT().\r
-\r
-  @param  Operand The 64-bit operand to shift left.\r
-  @param  Count   The number of bits to shift left.\r
-\r
-  @return Operand << Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-LShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  ASSERT (Count < 64);\r
-  return InternalMathLShiftU64 (Operand, Count);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/LinkedList.c b/UnixPkg/Library/UnixBaseLib/LinkedList.c
deleted file mode 100644 (file)
index 726a402..0000000
+++ /dev/null
@@ -1,550 +0,0 @@
-/** @file\r
-  Linked List Library Functions.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Worker function that locates the Node in the List.\r
-\r
-  By searching the List, finds the location of the Node in List. At the same time,\r
-  verifies the validity of this list.\r
-\r
-  If List is NULL, then ASSERT().\r
-  If List->ForwardLink is NULL, then ASSERT().\r
-  If List->backLink is NULL, then ASSERT().\r
-  If Node is NULL, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE and Node \r
-  is in not a member of List, then return FALSE\r
-  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
-  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
-\r
-  @param  List              A pointer to a node in a linked list.\r
-  @param  Node              A pointer to a node in a linked list.\r
-  @param  VerifyNodeInList  TRUE if a check should be made to see if Node is a \r
-                            member of List.  FALSE if no membership test should \r
-                            be performed.\r
-\r
-  @retval   TRUE if PcdVerifyNodeInList is FALSE\r
-  @retval   TRUE if DoMembershipCheck is FALSE\r
-  @retval   TRUE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE \r
-            and Node is a member of List.\r
-  @retval   FALSE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE \r
-            and Node is in not a member of List.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-InternalBaseLibIsNodeInList (\r
-  IN CONST LIST_ENTRY  *List,\r
-  IN CONST LIST_ENTRY  *Node,\r
-  IN BOOLEAN           VerifyNodeInList\r
-  )\r
-{\r
-  UINTN             Count;\r
-  CONST LIST_ENTRY  *Ptr;\r
-\r
-  //\r
-  // Test the validity of List and Node\r
-  //\r
-  ASSERT (List != NULL);\r
-  ASSERT (List->ForwardLink != NULL);\r
-  ASSERT (List->BackLink != NULL);\r
-  ASSERT (Node != NULL);\r
-\r
-  Count = 0;\r
-  Ptr   = List;\r
-\r
-  if (FeaturePcdGet (PcdVerifyNodeInList) && VerifyNodeInList) {\r
-    //\r
-    // Check to see if Node is a member of List.  \r
-    // Exit early if the number of nodes in List >= PcdMaximumLinkedListLength\r
-    //\r
-    do {\r
-      Ptr = Ptr->ForwardLink;\r
-      if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {\r
-        Count++;\r
-        //\r
-        // ASSERT() if the linked list is too long\r
-        //\r
-        ASSERT (Count < PcdGet32 (PcdMaximumLinkedListLength));\r
-\r
-        //\r
-        // Return if the linked list is too long\r
-        //\r
-        if (Count >= PcdGet32 (PcdMaximumLinkedListLength)) {\r
-          return (BOOLEAN)(Ptr == Node);\r
-        }\r
-      }\r
-    } while ((Ptr != List) && (Ptr != Node)); \r
-\r
-    if (Ptr != Node) {\r
-      return FALSE;\r
-    }\r
-  }\r
-\r
-  if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {\r
-    //\r
-    // Count the total number of nodes in List.\r
-    // Exit early if the number of nodes in List >= PcdMaximumLinkedListLength\r
-    //\r
-    do {\r
-      Ptr = Ptr->ForwardLink;\r
-      Count++;\r
-    } while ((Ptr != List) && (Count < PcdGet32 (PcdMaximumLinkedListLength)));\r
-\r
-    //\r
-    // ASSERT() if the linked list is too long\r
-    //\r
-    ASSERT (Count < PcdGet32 (PcdMaximumLinkedListLength));\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
-/**\r
-  Initializes the head node of a doubly-linked list, and returns the pointer to\r
-  the head node of the doubly-linked list.\r
-\r
-  Initializes the forward and backward links of a new linked list. After\r
-  initializing a linked list with this function, the other linked list\r
-  functions may be used to add and remove nodes from the linked list. It is up\r
-  to the caller of this function to allocate the memory for ListHead.\r
-\r
-  If ListHead is NULL, then ASSERT().\r
-\r
-  @param  ListHead  A pointer to the head node of a new doubly-linked list.\r
-\r
-  @return ListHead\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-InitializeListHead (\r
-  IN OUT  LIST_ENTRY                *ListHead\r
-  )\r
-\r
-{\r
-  ASSERT (ListHead != NULL);\r
-\r
-  ListHead->ForwardLink = ListHead;\r
-  ListHead->BackLink = ListHead;\r
-  return ListHead;\r
-}\r
-\r
-/**\r
-  Adds a node to the beginning of a doubly-linked list, and returns the pointer\r
-  to the head node of the doubly-linked list.\r
-\r
-  Adds the node Entry at the beginning of the doubly-linked list denoted by\r
-  ListHead, and returns ListHead.\r
-\r
-  If ListHead is NULL, then ASSERT().\r
-  If Entry is NULL, then ASSERT().\r
-  If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
-  InitializeListHead(), then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
-  of nodes in ListHead, including the ListHead node, is greater than or\r
-  equal to PcdMaximumLinkedListLength, then ASSERT().\r
-\r
-  @param  ListHead  A pointer to the head node of a doubly-linked list.\r
-  @param  Entry     A pointer to a node that is to be inserted at the beginning\r
-                    of a doubly-linked list.\r
-\r
-  @return ListHead\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-InsertHeadList (\r
-  IN OUT  LIST_ENTRY                *ListHead,\r
-  IN OUT  LIST_ENTRY                *Entry\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long and Entry is not one of the nodes of List\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (ListHead, Entry, FALSE));\r
-  \r
-  Entry->ForwardLink = ListHead->ForwardLink;\r
-  Entry->BackLink = ListHead;\r
-  Entry->ForwardLink->BackLink = Entry;\r
-  ListHead->ForwardLink = Entry;\r
-  return ListHead;\r
-}\r
-\r
-/**\r
-  Adds a node to the end of a doubly-linked list, and returns the pointer to\r
-  the head node of the doubly-linked list.\r
-\r
-  Adds the node Entry to the end of the doubly-linked list denoted by ListHead,\r
-  and returns ListHead.\r
-\r
-  If ListHead is NULL, then ASSERT().\r
-  If Entry is NULL, then ASSERT().\r
-  If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
-  InitializeListHead(), then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
-  of nodes in ListHead, including the ListHead node, is greater than or\r
-  equal to PcdMaximumLinkedListLength, then ASSERT().\r
-\r
-  @param  ListHead  A pointer to the head node of a doubly-linked list.\r
-  @param  Entry     A pointer to a node that is to be added at the end of the\r
-                    doubly-linked list.\r
-\r
-  @return ListHead\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-InsertTailList (\r
-  IN OUT  LIST_ENTRY                *ListHead,\r
-  IN OUT  LIST_ENTRY                *Entry\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long and Entry is not one of the nodes of List\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (ListHead, Entry, FALSE));\r
-  \r
-  Entry->ForwardLink = ListHead;\r
-  Entry->BackLink = ListHead->BackLink;\r
-  Entry->BackLink->ForwardLink = Entry;\r
-  ListHead->BackLink = Entry;\r
-  return ListHead;\r
-}\r
-\r
-/**\r
-  Retrieves the first node of a doubly-linked list.\r
-\r
-  Returns the first node of a doubly-linked list.  List must have been \r
-  initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().\r
-  If List is empty, then List is returned.\r
-\r
-  If List is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
-  InitializeListHead(), then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
-  in List, including the List node, is greater than or equal to\r
-  PcdMaximumLinkedListLength, then ASSERT().\r
-\r
-  @param  List  A pointer to the head node of a doubly-linked list.\r
-\r
-  @return The first node of a doubly-linked list.\r
-  @retval NULL  The list is empty.\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-GetFirstNode (\r
-  IN      CONST LIST_ENTRY          *List\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (List, List, FALSE));\r
-\r
-  return List->ForwardLink;\r
-}\r
-\r
-/**\r
-  Retrieves the next node of a doubly-linked list.\r
-\r
-  Returns the node of a doubly-linked list that follows Node.  \r
-  List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()\r
-  or InitializeListHead().  If List is empty, then List is returned.\r
-\r
-  If List is NULL, then ASSERT().\r
-  If Node is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
-  InitializeListHead(), then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
-  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().\r
-\r
-  @param  List  A pointer to the head node of a doubly-linked list.\r
-  @param  Node  A pointer to a node in the doubly-linked list.\r
-\r
-  @return A pointer to the next node if one exists. Otherwise List is returned.\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-GetNextNode (\r
-  IN      CONST LIST_ENTRY          *List,\r
-  IN      CONST LIST_ENTRY          *Node\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long and Node is one of the nodes of List\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE));\r
-\r
-  return Node->ForwardLink;\r
-}\r
-\r
-/**\r
-  Retrieves the previous node of a doubly-linked list.\r
\r
-  Returns the node of a doubly-linked list that precedes Node.  \r
-  List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()\r
-  or InitializeListHead().  If List is empty, then List is returned.\r
\r
-  If List is NULL, then ASSERT().\r
-  If Node is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
-  InitializeListHead(), then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
-  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().\r
\r
-  @param  List  A pointer to the head node of a doubly-linked list.\r
-  @param  Node  A pointer to a node in the doubly-linked list.\r
\r
-  @return A pointer to the previous node if one exists. Otherwise List is returned.\r
\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-GetPreviousNode (\r
-  IN      CONST LIST_ENTRY          *List,\r
-  IN      CONST LIST_ENTRY          *Node\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long and Node is one of the nodes of List\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE));\r
\r
-  return Node->BackLink;\r
-}\r
-\r
-/**\r
-  Checks to see if a doubly-linked list is empty or not.\r
-\r
-  Checks to see if the doubly-linked list is empty. If the linked list contains\r
-  zero nodes, this function returns TRUE. Otherwise, it returns FALSE.\r
-\r
-  If ListHead is NULL, then ASSERT().\r
-  If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or \r
-  InitializeListHead(), then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
-  in List, including the List node, is greater than or equal to\r
-  PcdMaximumLinkedListLength, then ASSERT().\r
-\r
-  @param  ListHead  A pointer to the head node of a doubly-linked list.\r
-\r
-  @retval TRUE  The linked list is empty.\r
-  @retval FALSE The linked list is not empty.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsListEmpty (\r
-  IN      CONST LIST_ENTRY          *ListHead\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (ListHead, ListHead, FALSE));\r
-  \r
-  return (BOOLEAN)(ListHead->ForwardLink == ListHead);\r
-}\r
-\r
-/**\r
-  Determines if a node in a doubly-linked list is the head node of a the same\r
-  doubly-linked list.  This function is typically used to terminate a loop that\r
-  traverses all the nodes in a doubly-linked list starting with the head node.\r
-\r
-  Returns TRUE if Node is equal to List.  Returns FALSE if Node is one of the\r
-  nodes in the doubly-linked list specified by List.  List must have been\r
-  initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().\r
-\r
-  If List is NULL, then ASSERT().\r
-  If Node is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(), \r
-  then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
-  in List, including the List node, is greater than or equal to\r
-  PcdMaximumLinkedListLength, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and Node is not a node in List and Node is not \r
-  equal to List, then ASSERT().\r
-\r
-  @param  List  A pointer to the head node of a doubly-linked list.\r
-  @param  Node  A pointer to a node in the doubly-linked list.\r
-\r
-  @retval TRUE  Node is one of the nodes in the doubly-linked list.\r
-  @retval FALSE Node is not one of the nodes in the doubly-linked list.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsNull (\r
-  IN      CONST LIST_ENTRY          *List,\r
-  IN      CONST LIST_ENTRY          *Node\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long and Node is one of the nodes of List\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE));\r
-  \r
-  return (BOOLEAN)(Node == List);\r
-}\r
-\r
-/**\r
-  Determines if a node the last node in a doubly-linked list.\r
-\r
-  Returns TRUE if Node is the last node in the doubly-linked list specified by\r
-  List. Otherwise, FALSE is returned. List must have been initialized with\r
-  INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().\r
-\r
-  If List is NULL, then ASSERT().\r
-  If Node is NULL, then ASSERT().\r
-  If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or\r
-  InitializeListHead(), then ASSERT().\r
-  If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
-  in List, including the List node, is greater than or equal to\r
-  PcdMaximumLinkedListLength, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().\r
-\r
-  @param  List  A pointer to the head node of a doubly-linked list.\r
-  @param  Node  A pointer to a node in the doubly-linked list.\r
-\r
-  @retval TRUE  Node is the last node in the linked list.\r
-  @retval FALSE Node is not the last node in the linked list.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-IsNodeAtEnd (\r
-  IN      CONST LIST_ENTRY          *List,\r
-  IN      CONST LIST_ENTRY          *Node\r
-  )\r
-{\r
-  //\r
-  // ASSERT List not too long and Node is one of the nodes of List\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (List, Node, TRUE));\r
-  \r
-  return (BOOLEAN)(!IsNull (List, Node) && List->BackLink == Node);\r
-}\r
-\r
-/**\r
-  Swaps the location of two nodes in a doubly-linked list, and returns the\r
-  first node after the swap.\r
-\r
-  If FirstEntry is identical to SecondEntry, then SecondEntry is returned.\r
-  Otherwise, the location of the FirstEntry node is swapped with the location\r
-  of the SecondEntry node in a doubly-linked list. SecondEntry must be in the\r
-  same double linked list as FirstEntry and that double linked list must have\r
-  been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). \r
-  SecondEntry is returned after the nodes are swapped.\r
-\r
-  If FirstEntry is NULL, then ASSERT().\r
-  If SecondEntry is NULL, then ASSERT().\r
-  If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the \r
-  same linked list, then ASSERT().\r
-  If PcdMaximumLinkedListLength is not zero, and the number of nodes in the\r
-  linked list containing the FirstEntry and SecondEntry nodes, including\r
-  the FirstEntry and SecondEntry nodes, is greater than or equal to\r
-  PcdMaximumLinkedListLength, then ASSERT().\r
-\r
-  @param  FirstEntry  A pointer to a node in a linked list.\r
-  @param  SecondEntry A pointer to another node in the same linked list.\r
-  \r
-  @return SecondEntry.\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-SwapListEntries (\r
-  IN OUT  LIST_ENTRY                *FirstEntry,\r
-  IN OUT  LIST_ENTRY                *SecondEntry\r
-  )\r
-{\r
-  LIST_ENTRY                    *Ptr;\r
-\r
-  if (FirstEntry == SecondEntry) {\r
-    return SecondEntry;\r
-  }\r
-\r
-  //\r
-  // ASSERT Entry1 and Entry2 are in the same linked list\r
-  //\r
-  ASSERT (InternalBaseLibIsNodeInList (FirstEntry, SecondEntry, TRUE));\r
-  \r
-  //\r
-  // Ptr is the node pointed to by FirstEntry->ForwardLink\r
-  //\r
-  Ptr = RemoveEntryList (FirstEntry);\r
-\r
-  //\r
-  // If FirstEntry immediately follows SecondEntry, FirstEntry will be placed\r
-  // immediately in front of SecondEntry\r
-  //\r
-  if (Ptr->BackLink == SecondEntry) {\r
-    return InsertTailList (SecondEntry, FirstEntry);\r
-  }\r
-\r
-  //\r
-  // Ptr == SecondEntry means SecondEntry immediately follows FirstEntry,\r
-  // then there are no further steps necessary\r
-  //\r
-  if (Ptr == InsertHeadList (SecondEntry, FirstEntry)) {\r
-    return Ptr;\r
-  }\r
-\r
-  //\r
-  // Move SecondEntry to the front of Ptr\r
-  //\r
-  RemoveEntryList (SecondEntry);\r
-  InsertTailList (Ptr, SecondEntry);\r
-  return SecondEntry;\r
-}\r
-\r
-/**\r
-  Removes a node from a doubly-linked list, and returns the node that follows\r
-  the removed node.\r
-\r
-  Removes the node Entry from a doubly-linked list. It is up to the caller of\r
-  this function to release the memory used by this node if that is required. On\r
-  exit, the node following Entry in the doubly-linked list is returned. If\r
-  Entry is the only node in the linked list, then the head node of the linked\r
-  list is returned.\r
-\r
-  If Entry is NULL, then ASSERT().\r
-  If Entry is the head node of an empty list, then ASSERT().\r
-  If PcdMaximumLinkedListLength is not zero, and the number of nodes in the\r
-  linked list containing Entry, including the Entry node, is greater than\r
-  or equal to PcdMaximumLinkedListLength, then ASSERT().\r
-\r
-  @param  Entry A pointer to a node in a linked list.\r
-\r
-  @return Entry.\r
-\r
-**/\r
-LIST_ENTRY *\r
-EFIAPI\r
-RemoveEntryList (\r
-  IN      CONST LIST_ENTRY          *Entry\r
-  )\r
-{\r
-  ASSERT (!IsListEmpty (Entry));\r
-  \r
-  Entry->ForwardLink->BackLink = Entry->BackLink;\r
-  Entry->BackLink->ForwardLink = Entry->ForwardLink;\r
-  return Entry->ForwardLink;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/LongJump.c b/UnixPkg/Library/UnixBaseLib/LongJump.c
deleted file mode 100644 (file)
index 062be8f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file\r
-  Long Jump functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Restores the CPU context that was saved with SetJump().\r
-\r
-  Restores the CPU context from the buffer specified by JumpBuffer. This\r
-  function never returns to the caller. Instead is resumes execution based on\r
-  the state of JumpBuffer.\r
-\r
-  If JumpBuffer is NULL, then ASSERT().\r
-  For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
-  If Value is 0, then ASSERT().\r
-\r
-  @param  JumpBuffer  A pointer to CPU context buffer.\r
-  @param  Value       The value to return when the SetJump() context is\r
-                      restored and must be non-zero.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-LongJump (\r
-  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
-  IN      UINTN                     Value\r
-  )\r
-{\r
-  InternalAssertJumpBuffer (JumpBuffer);\r
-  ASSERT (Value != 0);\r
-\r
-  InternalLongJump (JumpBuffer, Value);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/LowBitSet32.c b/UnixPkg/Library/UnixBaseLib/LowBitSet32.c
deleted file mode 100644 (file)
index 6430036..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Returns the bit position of the lowest bit set in a 32-bit value.\r
-\r
-  This function computes the bit position of the lowest bit set in the 32-bit\r
-  value specified by Operand. If Operand is zero, then -1 is returned.\r
-  Otherwise, a value between 0 and 31 is returned.\r
-\r
-  @param  Operand The 32-bit operand to evaluate.\r
-\r
-  @retval 0..31  The lowest bit set in Operand was found.\r
-  @retval -1     Operand is zero.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-LowBitSet32 (\r
-  IN      UINT32                    Operand\r
-  )\r
-{\r
-  INTN                              BitIndex;\r
-\r
-  if (Operand == 0) {\r
-    return -1;\r
-  }\r
-\r
-  for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1);\r
-  return BitIndex;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/LowBitSet64.c b/UnixPkg/Library/UnixBaseLib/LowBitSet64.c
deleted file mode 100644 (file)
index 2bc8bc3..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Returns the bit position of the lowest bit set in a 64-bit value.\r
-\r
-  This function computes the bit position of the lowest bit set in the 64-bit\r
-  value specified by Operand. If Operand is zero, then -1 is returned.\r
-  Otherwise, a value between 0 and 63 is returned.\r
-\r
-  @param  Operand The 64-bit operand to evaluate.\r
-\r
-  @retval 0..63  The lowest bit set in Operand was found.\r
-  @retval -1     Operand is zero.\r
-\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-LowBitSet64 (\r
-  IN      UINT64                    Operand\r
-  )\r
-{\r
-  INTN                              BitIndex;\r
-\r
-  if (Operand == 0) {\r
-    return -1;\r
-  }\r
-\r
-  for (BitIndex = 0;\r
-       (Operand & 1) == 0;\r
-       BitIndex++, Operand = RShiftU64 (Operand, 1));\r
-  return BitIndex;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/Math64.c b/UnixPkg/Library/UnixBaseLib/Math64.c
deleted file mode 100644 (file)
index 83d7684..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/** @file\r
-  Leaf math worker functions that require 64-bit arithmetic support from the\r
-  compiler.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Shifts a 64-bit integer left between 0 and 63 bits. The low bits\r
-  are filled with zeros. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the left by Count bits. The\r
-  low Count bits are set to zero. The shifted value is returned.\r
-\r
-  @param  Operand The 64-bit operand to shift left.\r
-  @param  Count   The number of bits to shift left.\r
-\r
-  @return Operand << Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathLShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  return Operand << Count;\r
-}\r
-\r
-/**\r
-  Shifts a 64-bit integer right between 0 and 63 bits. This high bits\r
-  are filled with zeros. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the right by Count bits. The\r
-  high Count bits are set to zero. The shifted value is returned.\r
-\r
-  @param  Operand The 64-bit operand to shift right.\r
-  @param  Count   The number of bits to shift right.\r
-\r
-  @return Operand >> Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathRShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  return Operand >> Count;\r
-}\r
-\r
-/**\r
-  Shifts a 64-bit integer right between 0 and 63 bits. The high bits\r
-  are filled with original integer's bit 63. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the right by Count bits. The\r
-  high Count bits are set to bit 63 of Operand.  The shifted value is returned.\r
-\r
-  @param  Operand The 64-bit operand to shift right.\r
-  @param  Count   The number of bits to shift right.\r
-\r
-  @return Operand arithmetically shifted right by Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathARShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  INTN  TestValue;\r
-\r
-  //\r
-  // Test if this compiler supports arithmetic shift\r
-  //\r
-  TestValue = (((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1));\r
-  if (TestValue == -1) {\r
-    //\r
-    // Arithmetic shift is supported\r
-    //\r
-    return (UINT64)((INT64)Operand >> Count);\r
-  }\r
-\r
-  //\r
-  // Arithmetic is not supported\r
-  //\r
-  return (Operand >> Count) |\r
-         ((INTN)Operand < 0 ? ~((UINTN)-1 >> Count) : 0);\r
-}\r
-\r
-\r
-/**\r
-  Rotates a 64-bit integer left between 0 and 63 bits, filling\r
-  the low bits with the high bits that were rotated.\r
-\r
-  This function rotates the 64-bit value Operand to the left by Count bits. The\r
-  low Count bits are fill with the high Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  @param  Operand The 64-bit operand to rotate left.\r
-  @param  Count   The number of bits to rotate left.\r
-\r
-  @return Operand <<< Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathLRotU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  return (Operand << Count) | (Operand >> (64 - Count));\r
-}\r
-\r
-/**\r
-  Rotates a 64-bit integer right between 0 and 63 bits, filling\r
-  the high bits with the high low bits that were rotated.\r
-\r
-  This function rotates the 64-bit value Operand to the right by Count bits.\r
-  The high Count bits are fill with the low Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  @param  Operand The 64-bit operand to rotate right.\r
-  @param  Count   The number of bits to rotate right.\r
-\r
-  @return Operand >>> Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathRRotU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  return (Operand >> Count) | (Operand << (64 - Count));\r
-}\r
-\r
-/**\r
-  Switches the endianess of a 64-bit integer.\r
-\r
-  This function swaps the bytes in a 64-bit unsigned value to switch the value\r
-  from little endian to big endian or vice versa. The byte swapped value is\r
-  returned.\r
-\r
-  @param  Operand A 64-bit unsigned value.\r
-\r
-  @return The byte swapped Operand.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathSwapBytes64 (\r
-  IN      UINT64                    Operand\r
-  )\r
-{\r
-  UINT64  LowerBytes;\r
-  UINT64  HigherBytes;\r
-\r
-  LowerBytes  = (UINT64) SwapBytes32 ((UINT32) Operand);\r
-  HigherBytes = (UINT64) SwapBytes32 ((UINT32) (Operand >> 32));\r
-\r
-  return (LowerBytes << 32 | HigherBytes);\r
-}\r
-\r
-/**\r
-  Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer\r
-  and generates a 64-bit unsigned result.\r
-\r
-  This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit\r
-  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
-  bit unsigned result is returned.\r
-\r
-  @param  Multiplicand  A 64-bit unsigned value.\r
-  @param  Multiplier    A 32-bit unsigned value.\r
-\r
-  @return Multiplicand * Multiplier\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathMultU64x32 (\r
-  IN      UINT64                    Multiplicand,\r
-  IN      UINT32                    Multiplier\r
-  )\r
-{\r
-  return Multiplicand * Multiplier;\r
-}\r
-\r
-\r
-/**\r
-  Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer\r
-  and generates a 64-bit unsigned result.\r
-\r
-  This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit\r
-  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
-  bit unsigned result is returned.\r
-\r
-  @param  Multiplicand  A 64-bit unsigned value.\r
-  @param  Multiplier    A 64-bit unsigned value.\r
-\r
-  @return Multiplicand * Multiplier.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathMultU64x64 (\r
-  IN      UINT64                    Multiplicand,\r
-  IN      UINT64                    Multiplier\r
-  )\r
-{\r
-  return Multiplicand * Multiplier;\r
-}\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and\r
-  generates a 64-bit unsigned result.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. This\r
-  function returns the 64-bit unsigned quotient.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-\r
-  @return Dividend / Divisor.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathDivU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor\r
-  )\r
-{\r
-  return Dividend / Divisor;\r
-}\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and\r
-  generates a 32-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 32-bit remainder. This function\r
-  returns the 32-bit unsigned remainder.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-\r
-  @return Dividend % Divisor.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-InternalMathModU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor\r
-  )\r
-{\r
-  return (UINT32)(Dividend % Divisor);\r
-}\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and\r
-  generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
-  is not NULL, then the 32-bit unsigned remainder is returned in Remainder.\r
-  This function returns the 64-bit unsigned quotient.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-  @param  Remainder A pointer to a 32-bit unsigned value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathDivRemU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor,\r
-  OUT     UINT32                    *Remainder OPTIONAL\r
-  )\r
-{\r
-  if (Remainder != NULL) {\r
-    *Remainder = (UINT32)(Dividend % Divisor);\r
-  }\r
-  return Dividend / Divisor;\r
-}\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 64-bit unsigned integer and\r
-  generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 64-bit\r
-  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
-  is not NULL, then the 64-bit unsigned remainder is returned in Remainder.\r
-  This function returns the 64-bit unsigned quotient.\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 64-bit unsigned value.\r
-  @param  Remainder A pointer to a 64-bit unsigned value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-InternalMathDivRemU64x64 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT64                    Divisor,\r
-  OUT     UINT64                    *Remainder OPTIONAL\r
-  )\r
-{\r
-  if (Remainder != NULL) {\r
-    *Remainder = Dividend % Divisor;\r
-  }\r
-  return Dividend / Divisor;\r
-}\r
-\r
-/**\r
-  Divides a 64-bit signed integer by a 64-bit signed integer and\r
-  generates a 64-bit signed result and an optional 64-bit signed remainder.\r
-\r
-  This function divides the 64-bit signed value Dividend by the 64-bit\r
-  signed value Divisor and generates a 64-bit signed quotient. If Remainder\r
-  is not NULL, then the 64-bit signed remainder is returned in Remainder.\r
-  This function returns the 64-bit signed quotient.\r
-\r
-  @param  Dividend  A 64-bit signed value.\r
-  @param  Divisor   A 64-bit signed value.\r
-  @param  Remainder A pointer to a 64-bit signed value. This parameter is\r
-                    optional and may be NULL.\r
-\r
-  @return Dividend / Divisor.\r
-\r
-**/\r
-INT64\r
-EFIAPI\r
-InternalMathDivRemS64x64 (\r
-  IN      INT64                     Dividend,\r
-  IN      INT64                     Divisor,\r
-  OUT     INT64                     *Remainder  OPTIONAL\r
-  )\r
-{\r
-  if (Remainder != NULL) {\r
-    *Remainder = Dividend % Divisor;\r
-  }\r
-  return Dividend / Divisor;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/ModU64x32.c b/UnixPkg/Library/UnixBaseLib/ModU64x32.c
deleted file mode 100644 (file)
index 29d7b77..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates\r
-  a 32-bit unsigned remainder.\r
-\r
-  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
-  unsigned value Divisor and generates a 32-bit remainder. This function\r
-  returns the 32-bit unsigned remainder.\r
-\r
-  If Divisor is 0, then ASSERT().\r
-\r
-  @param  Dividend  A 64-bit unsigned value.\r
-  @param  Divisor   A 32-bit unsigned value.\r
-\r
-  @return Dividend % Divisor.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-ModU64x32 (\r
-  IN      UINT64                    Dividend,\r
-  IN      UINT32                    Divisor\r
-  )\r
-{\r
-  ASSERT (Divisor != 0);\r
-  return InternalMathModU64x32 (Dividend, Divisor);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/MultS64x64.c b/UnixPkg/Library/UnixBaseLib/MultS64x64.c
deleted file mode 100644 (file)
index 229c76c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Multiplies a 64-bit signed integer by a 64-bit signed integer and generates a\r
-  64-bit signed result.\r
-\r
-  This function multiplies the 64-bit signed value Multiplicand by the 64-bit\r
-  signed value Multiplier and generates a 64-bit signed result. This 64-bit\r
-  signed result is returned.\r
-\r
-  @param  Multiplicand  A 64-bit signed value.\r
-  @param  Multiplier    A 64-bit signed value.\r
-\r
-  @return Multiplicand * Multiplier.\r
-\r
-**/\r
-INT64\r
-EFIAPI\r
-MultS64x64 (\r
-  IN      INT64                     Multiplicand,\r
-  IN      INT64                     Multiplier\r
-  )\r
-{\r
-  return (INT64)MultU64x64 ((UINT64) Multiplicand, (UINT64) Multiplier);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/MultU64x32.c b/UnixPkg/Library/UnixBaseLib/MultU64x32.c
deleted file mode 100644 (file)
index a2c2436..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer and\r
-  generates a 64-bit unsigned result.\r
-\r
-  This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit\r
-  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
-  bit unsigned result is returned.\r
-\r
-  @param  Multiplicand  A 64-bit unsigned value.\r
-  @param  Multiplier    A 32-bit unsigned value.\r
-\r
-  @return Multiplicand * Multiplier.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-MultU64x32 (\r
-  IN      UINT64                    Multiplicand,\r
-  IN      UINT32                    Multiplier\r
-  )\r
-{\r
-  UINT64                            Result;\r
-\r
-  Result = InternalMathMultU64x32 (Multiplicand, Multiplier);\r
-\r
-  return Result;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/MultU64x64.c b/UnixPkg/Library/UnixBaseLib/MultU64x64.c
deleted file mode 100644 (file)
index a1a7629..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer and\r
-  generates a 64-bit unsigned result.\r
-\r
-  This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit\r
-  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
-  bit unsigned result is returned.\r
-\r
-  @param  Multiplicand  A 64-bit unsigned value.\r
-  @param  Multiplier    A 64-bit unsigned value.\r
-\r
-  @return Multiplicand * Multiplier.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-MultU64x64 (\r
-  IN      UINT64                    Multiplicand,\r
-  IN      UINT64                    Multiplier\r
-  )\r
-{\r
-  UINT64                            Result;\r
-\r
-  Result = InternalMathMultU64x64 (Multiplicand, Multiplier);\r
-\r
-  return Result;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/RRotU32.c b/UnixPkg/Library/UnixBaseLib/RRotU32.c
deleted file mode 100644 (file)
index f4779f5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits\r
-  with the low bits that were rotated.\r
-\r
-  This function rotates the 32-bit value Operand to the right by Count bits.\r
-  The high Count bits are fill with the low Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  If Count is greater than 31, then ASSERT().\r
-\r
-  @param  Operand The 32-bit operand to rotate right.\r
-  @param  Count   The number of bits to rotate right.\r
-\r
-  @return Operand >> Count.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-RRotU32 (\r
-  IN      UINT32                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  ASSERT (Count < 32);\r
-  return (Operand >> Count) | (Operand << (32 - Count));\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/RRotU64.c b/UnixPkg/Library/UnixBaseLib/RRotU64.c
deleted file mode 100644 (file)
index 45be7ef..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits\r
-  with the high low bits that were rotated.\r
-\r
-  This function rotates the 64-bit value Operand to the right by Count bits.\r
-  The high Count bits are fill with the low Count bits of Operand. The rotated\r
-  value is returned.\r
-\r
-  If Count is greater than 63, then ASSERT().\r
-\r
-  @param  Operand The 64-bit operand to rotate right.\r
-  @param  Count   The number of bits to rotate right.\r
-\r
-  @return Operand >> Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-RRotU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  ASSERT (Count < 64);\r
-  return InternalMathRRotU64 (Operand, Count);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/RShiftU64.c b/UnixPkg/Library/UnixBaseLib/RShiftU64.c
deleted file mode 100644 (file)
index 8a4834b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Shifts a 64-bit integer right between 0 and 63 bits. This high bits are\r
-  filled with zeros. The shifted value is returned.\r
-\r
-  This function shifts the 64-bit value Operand to the right by Count bits. The\r
-  high Count bits are set to zero. The shifted value is returned.\r
-\r
-  If Count is greater than 63, then ASSERT().\r
-\r
-  @param  Operand The 64-bit operand to shift right.\r
-  @param  Count   The number of bits to shift right.\r
-\r
-  @return Operand >> Count.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-RShiftU64 (\r
-  IN      UINT64                    Operand,\r
-  IN      UINTN                     Count\r
-  )\r
-{\r
-  ASSERT (Count < 64);\r
-  return InternalMathRShiftU64 (Operand, Count);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/SetJump.c b/UnixPkg/Library/UnixBaseLib/SetJump.c
deleted file mode 100644 (file)
index b8fb35b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file\r
-  Internal ASSERT () functions for SetJump.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Worker function that checks ASSERT condition for JumpBuffer\r
-\r
-  Checks ASSERT condition for JumpBuffer.\r
-\r
-  If JumpBuffer is NULL, then ASSERT().\r
-  For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
-\r
-  @param  JumpBuffer    A pointer to CPU context buffer.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalAssertJumpBuffer (\r
-  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
-  )\r
-{\r
-  ASSERT (JumpBuffer != NULL);\r
-\r
-  ASSERT (((UINTN)JumpBuffer & (BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT - 1)) == 0);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/String.c b/UnixPkg/Library/UnixBaseLib/String.c
deleted file mode 100644 (file)
index 273291a..0000000
+++ /dev/null
@@ -1,2074 +0,0 @@
-/** @file\r
-  Unicode and ASCII string primatives.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-\r
-/**\r
-  Copies one Null-terminated Unicode string to another Null-terminated Unicode\r
-  string and returns the new Unicode string.\r
-\r
-  This function copies the contents of the Unicode string Source to the Unicode\r
-  string Destination, and returns Destination. If Source and Destination\r
-  overlap, then the results are undefined.\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source is NULL, then ASSERT().\r
-  If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated Unicode string.\r
-  @param  Source      A pointer to a Null-terminated Unicode string.\r
-\r
-  @return Destination.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-StrCpy (\r
-  OUT     CHAR16                    *Destination,\r
-  IN      CONST CHAR16              *Source\r
-  )\r
-{\r
-  CHAR16                            *ReturnValue;\r
-\r
-  //\r
-  // Destination cannot be NULL\r
-  //\r
-  ASSERT (Destination != NULL);\r
-  ASSERT (((UINTN) Destination & BIT0) == 0);\r
-\r
-  //\r
-  // Destination and source cannot overlap\r
-  //\r
-  ASSERT ((UINTN)(Destination - Source) > StrLen (Source));\r
-  ASSERT ((UINTN)(Source - Destination) > StrLen (Source));\r
-\r
-  ReturnValue = Destination;\r
-  while (*Source != 0) {\r
-    *(Destination++) = *(Source++);\r
-  }\r
-  *Destination = 0;\r
-  return ReturnValue;\r
-}\r
-\r
-/**\r
-  Copies up to a specified length from one Null-terminated Unicode string  to \r
-  another Null-terminated Unicode string and returns the new Unicode string.\r
-\r
-  This function copies the contents of the Unicode string Source to the Unicode\r
-  string Destination, and returns Destination. At most, Length Unicode\r
-  characters are copied from Source to Destination. If Length is 0, then\r
-  Destination is returned unmodified. If Length is greater that the number of\r
-  Unicode characters in Source, then Destination is padded with Null Unicode\r
-  characters. If Source and Destination overlap, then the results are\r
-  undefined.\r
-\r
-  If Length > 0 and Destination is NULL, then ASSERT().\r
-  If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length > 0 and Source is NULL, then ASSERT().\r
-  If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than \r
-  PcdMaximumUnicodeStringLength, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated Unicode string.\r
-  @param  Source      A pointer to a Null-terminated Unicode string.\r
-  @param  Length      The maximum number of Unicode characters to copy.\r
-\r
-  @return Destination.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-StrnCpy (\r
-  OUT     CHAR16                    *Destination,\r
-  IN      CONST CHAR16              *Source,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  CHAR16                            *ReturnValue;\r
-\r
-  if (Length == 0) {\r
-    return Destination;\r
-  }\r
-\r
-  //\r
-  // Destination cannot be NULL if Length is not zero\r
-  //\r
-  ASSERT (Destination != NULL);\r
-  ASSERT (((UINTN) Destination & BIT0) == 0);\r
-\r
-  //\r
-  // Destination and source cannot overlap\r
-  //\r
-  ASSERT ((UINTN)(Destination - Source) > StrLen (Source));\r
-  ASSERT ((UINTN)(Source - Destination) >= Length);\r
-\r
-  if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {\r
-    ASSERT (Length <= PcdGet32 (PcdMaximumUnicodeStringLength));\r
-  }\r
-\r
-  ReturnValue = Destination;\r
-\r
-  while ((*Source != L'\0') && (Length > 0)) {\r
-    *(Destination++) = *(Source++);\r
-    Length--;\r
-  }\r
-\r
-  ZeroMem (Destination, Length * sizeof (*Destination));\r
-  return ReturnValue;\r
-}\r
-\r
-/**\r
-  Returns the length of a Null-terminated Unicode string.\r
-\r
-  This function returns the number of Unicode characters in the Null-terminated\r
-  Unicode string specified by String.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If String is not aligned on a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  String  A pointer to a Null-terminated Unicode string.\r
-\r
-  @return The length of String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-StrLen (\r
-  IN      CONST CHAR16              *String\r
-  )\r
-{\r
-  UINTN                             Length;\r
-\r
-  ASSERT (String != NULL);\r
-  ASSERT (((UINTN) String & BIT0) == 0);\r
-\r
-  for (Length = 0; *String != L'\0'; String++, Length++) {\r
-    //\r
-    // If PcdMaximumUnicodeStringLength is not zero,\r
-    // length should not more than PcdMaximumUnicodeStringLength\r
-    //\r
-    if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {\r
-      ASSERT (Length < PcdGet32 (PcdMaximumUnicodeStringLength));\r
-    }\r
-  }\r
-  return Length;\r
-}\r
-\r
-/**\r
-  Returns the size of a Null-terminated Unicode string in bytes, including the\r
-  Null terminator.\r
-\r
-  This function returns the size, in bytes, of the Null-terminated Unicode string \r
-  specified by String.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If String is not aligned on a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  String  A pointer to a Null-terminated Unicode string.\r
-\r
-  @return The size of String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-StrSize (\r
-  IN      CONST CHAR16              *String\r
-  )\r
-{\r
-  return (StrLen (String) + 1) * sizeof (*String);\r
-}\r
-\r
-/**\r
-  Compares two Null-terminated Unicode strings, and returns the difference\r
-  between the first mismatched Unicode characters.\r
-\r
-  This function compares the Null-terminated Unicode string FirstString to the\r
-  Null-terminated Unicode string SecondString. If FirstString is identical to\r
-  SecondString, then 0 is returned. Otherwise, the value returned is the first\r
-  mismatched Unicode character in SecondString subtracted from the first\r
-  mismatched Unicode character in FirstString.\r
-\r
-  If FirstString is NULL, then ASSERT().\r
-  If FirstString is not aligned on a 16-bit boundary, then ASSERT().\r
-  If SecondString is NULL, then ASSERT().\r
-  If SecondString is not aligned on a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  FirstString   A pointer to a Null-terminated Unicode string.\r
-  @param  SecondString  A pointer to a Null-terminated Unicode string.\r
-\r
-  @retval 0      FirstString is identical to SecondString.\r
-  @return others FirstString is not identical to SecondString.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-StrCmp (\r
-  IN      CONST CHAR16              *FirstString,\r
-  IN      CONST CHAR16              *SecondString\r
-  )\r
-{\r
-  //\r
-  // ASSERT both strings are less long than PcdMaximumUnicodeStringLength\r
-  //\r
-  ASSERT (StrSize (FirstString) != 0);\r
-  ASSERT (StrSize (SecondString) != 0);\r
-\r
-  while ((*FirstString != L'\0') && (*FirstString == *SecondString)) {\r
-    FirstString++;\r
-    SecondString++;\r
-  }\r
-  return *FirstString - *SecondString;\r
-}\r
-\r
-/**\r
-  Compares up to a specified length the contents of two Null-terminated Unicode strings,\r
-  and returns the difference between the first mismatched Unicode characters.\r
-  \r
-  This function compares the Null-terminated Unicode string FirstString to the\r
-  Null-terminated Unicode string SecondString. At most, Length Unicode\r
-  characters will be compared. If Length is 0, then 0 is returned. If\r
-  FirstString is identical to SecondString, then 0 is returned. Otherwise, the\r
-  value returned is the first mismatched Unicode character in SecondString\r
-  subtracted from the first mismatched Unicode character in FirstString.\r
-\r
-  If Length > 0 and FirstString is NULL, then ASSERT().\r
-  If Length > 0 and FirstString is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length > 0 and SecondString is NULL, then ASSERT().\r
-  If Length > 0 and SecondString is not aligned on a 16-bit boundary, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than\r
-  PcdMaximumUnicodeStringLength, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  FirstString   A pointer to a Null-terminated Unicode string.\r
-  @param  SecondString  A pointer to a Null-terminated Unicode string.\r
-  @param  Length        The maximum number of Unicode characters to compare.\r
-\r
-  @retval 0      FirstString is identical to SecondString.\r
-  @return others FirstString is not identical to SecondString.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-StrnCmp (\r
-  IN      CONST CHAR16              *FirstString,\r
-  IN      CONST CHAR16              *SecondString,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  if (Length == 0) {\r
-    return 0;\r
-  }\r
-\r
-  //\r
-  // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
-  //\r
-  ASSERT (StrSize (FirstString) != 0);\r
-  ASSERT (StrSize (SecondString) != 0);\r
-\r
-  if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {\r
-    ASSERT (Length <= PcdGet32 (PcdMaximumUnicodeStringLength));\r
-  }\r
-\r
-  while ((*FirstString != L'\0') &&\r
-         (*FirstString == *SecondString) &&\r
-         (Length > 1)) {\r
-    FirstString++;\r
-    SecondString++;\r
-    Length--;\r
-  }\r
-\r
-  return *FirstString - *SecondString;\r
-}\r
-\r
-/**\r
-  Concatenates one Null-terminated Unicode string to another Null-terminated\r
-  Unicode string, and returns the concatenated Unicode string.\r
-\r
-  This function concatenates two Null-terminated Unicode strings. The contents\r
-  of Null-terminated Unicode string Source are concatenated to the end of\r
-  Null-terminated Unicode string Destination. The Null-terminated concatenated\r
-  Unicode String is returned. If Source and Destination overlap, then the\r
-  results are undefined.\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source is NULL, then ASSERT().\r
-  If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
-  and Source results in a Unicode string with more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated Unicode string.\r
-  @param  Source      A pointer to a Null-terminated Unicode string.\r
-\r
-  @return Destination.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-StrCat (\r
-  IN OUT  CHAR16                    *Destination,\r
-  IN      CONST CHAR16              *Source\r
-  )\r
-{\r
-  StrCpy (Destination + StrLen (Destination), Source);\r
-\r
-  //\r
-  // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
-  //\r
-  ASSERT (StrSize (Destination) != 0);\r
-  return Destination;\r
-}\r
-\r
-/**\r
-  Concatenates up to a specified length one Null-terminated Unicode to the end \r
-  of another Null-terminated Unicode string, and returns the concatenated \r
-  Unicode string.\r
-\r
-  This function concatenates two Null-terminated Unicode strings. The contents\r
-  of Null-terminated Unicode string Source are concatenated to the end of\r
-  Null-terminated Unicode string Destination, and Destination is returned. At\r
-  most, Length Unicode characters are concatenated from Source to the end of\r
-  Destination, and Destination is always Null-terminated. If Length is 0, then\r
-  Destination is returned unmodified. If Source and Destination overlap, then\r
-  the results are undefined.\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length > 0 and Source is NULL, then ASSERT().\r
-  If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than \r
-  PcdMaximumUnicodeStringLength, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
-  and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength\r
-  Unicode characters, not including the Null-terminator, then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated Unicode string.\r
-  @param  Source      A pointer to a Null-terminated Unicode string.\r
-  @param  Length      The maximum number of Unicode characters to concatenate from\r
-                      Source.\r
-\r
-  @return Destination.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-StrnCat (\r
-  IN OUT  CHAR16                    *Destination,\r
-  IN      CONST CHAR16              *Source,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINTN   DestinationLen;\r
-\r
-  DestinationLen = StrLen (Destination);\r
-  StrnCpy (Destination + DestinationLen, Source, Length);\r
-  Destination[DestinationLen + Length] = L'\0';\r
-\r
-  //\r
-  // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
-  //\r
-  ASSERT (StrSize (Destination) != 0);\r
-  return Destination;\r
-}\r
-\r
-/**\r
-  Returns the first occurrence of a Null-terminated Unicode sub-string\r
-  in a Null-terminated Unicode string.\r
-\r
-  This function scans the contents of the Null-terminated Unicode string\r
-  specified by String and returns the first occurrence of SearchString.\r
-  If SearchString is not found in String, then NULL is returned.  If\r
-  the length of SearchString is zero, then String is\r
-  returned.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If String is not aligned on a 16-bit boundary, then ASSERT().\r
-  If SearchString is NULL, then ASSERT().\r
-  If SearchString is not aligned on a 16-bit boundary, then ASSERT().\r
-\r
-  If PcdMaximumUnicodeStringLength is not zero, and SearchString\r
-  or String contains more than PcdMaximumUnicodeStringLength Unicode\r
-  characters, not including the Null-terminator, then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated Unicode string.\r
-  @param  SearchString    A pointer to a Null-terminated Unicode string to search for.\r
-\r
-  @retval NULL            If the SearchString does not appear in String.\r
-  @return others          If there is a match.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-StrStr (\r
-  IN      CONST CHAR16              *String,\r
-  IN      CONST CHAR16              *SearchString\r
-  )\r
-{\r
-  CONST CHAR16 *FirstMatch;\r
-  CONST CHAR16 *SearchStringTmp;\r
-\r
-  //\r
-  // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
-  //\r
-  ASSERT (StrSize (String) != 0);\r
-  ASSERT (StrSize (SearchString) != 0);\r
-\r
-  if (*SearchString == L'\0') {\r
-    return (CHAR16 *) String;\r
-  }\r
-\r
-  while (*String != L'\0') {\r
-    SearchStringTmp = SearchString;\r
-    FirstMatch = String;\r
-    \r
-    while ((*String == *SearchStringTmp) \r
-            && (*String != L'\0')) {\r
-      String++;\r
-      SearchStringTmp++;\r
-    } \r
-    \r
-    if (*SearchStringTmp == L'\0') {\r
-      return (CHAR16 *) FirstMatch;\r
-    }\r
-\r
-    if (*String == L'\0') {\r
-      return NULL;\r
-    }\r
-\r
-    String = FirstMatch + 1;\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-/**\r
-  Check if a Unicode character is a decimal character.\r
-\r
-  This internal function checks if a Unicode character is a \r
-  decimal character. The valid decimal character is from\r
-  L'0' to L'9'.\r
-\r
-  @param  Char  The character to check against.\r
-\r
-  @retval TRUE  If the Char is a decmial character.\r
-  @retval FALSE If the Char is not a decmial character.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-InternalIsDecimalDigitCharacter (\r
-  IN      CHAR16                    Char\r
-  )\r
-{\r
-  return (BOOLEAN) (Char >= L'0' && Char <= L'9');\r
-}\r
-\r
-/**\r
-  Convert a Unicode character to upper case only if \r
-  it maps to a valid small-case ASCII character.\r
-\r
-  This internal function only deal with Unicode character\r
-  which maps to a valid small-case ASCII character, i.e.\r
-  L'a' to L'z'. For other Unicode character, the input character\r
-  is returned directly.\r
-\r
-  @param  Char  The character to convert.\r
-\r
-  @retval LowerCharacter   If the Char is with range L'a' to L'z'.\r
-  @retval Unchanged        Otherwise.\r
-\r
-**/\r
-CHAR16\r
-EFIAPI\r
-InternalCharToUpper (\r
-  IN      CHAR16                    Char\r
-  )\r
-{\r
-  if (Char >= L'a' && Char <= L'z') {\r
-    return (CHAR16) (Char - (L'a' - L'A'));\r
-  }\r
-\r
-  return Char;\r
-}\r
-\r
-/**\r
-  Convert a Unicode character to numerical value.\r
-\r
-  This internal function only deal with Unicode character\r
-  which maps to a valid hexadecimal ASII character, i.e.\r
-  L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other \r
-  Unicode character, the value returned does not make sense.\r
-\r
-  @param  Char  The character to convert.\r
-\r
-  @return The numerical value converted.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-InternalHexCharToUintn (\r
-  IN      CHAR16                    Char\r
-  )\r
-{\r
-  if (InternalIsDecimalDigitCharacter (Char)) {\r
-    return Char - L'0';\r
-  }\r
-\r
-  return (UINTN) (10 + InternalCharToUpper (Char) - L'A');\r
-}\r
-\r
-/**\r
-  Check if a Unicode character is a hexadecimal character.\r
-\r
-  This internal function checks if a Unicode character is a \r
-  decimal character.  The valid hexadecimal character is \r
-  L'0' to L'9', L'a' to L'f', or L'A' to L'F'.\r
-\r
-\r
-  @param  Char  The character to check against.\r
-\r
-  @retval TRUE  If the Char is a hexadecmial character.\r
-  @retval FALSE If the Char is not a hexadecmial character.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-InternalIsHexaDecimalDigitCharacter (\r
-  IN      CHAR16                    Char\r
-  )\r
-{\r
-\r
-  return (BOOLEAN) (InternalIsDecimalDigitCharacter (Char) ||\r
-    (Char >= L'A' && Char <= L'F') ||\r
-    (Char >= L'a' && Char <= L'f'));\r
-}\r
-\r
-/**\r
-  Convert a Null-terminated Unicode decimal string to a value of\r
-  type UINTN.\r
-\r
-  This function returns a value of type UINTN by interpreting the contents\r
-  of the Unicode string specified by String as a decimal number. The format\r
-  of the input Unicode string String is:\r
-\r
-                  [spaces] [decimal digits].\r
-\r
-  The valid decimal digit character is in the range [0-9]. The\r
-  function will ignore the pad space, which includes spaces or\r
-  tab characters, before [decimal digits]. The running zero in the\r
-  beginning of [decimal digits] will be ignored. Then, the function\r
-  stops at the first character that is a not a valid decimal character\r
-  or a Null-terminator, whichever one comes first.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If String has only pad spaces, then 0 is returned.\r
-  If String has no pad spaces or valid decimal digits,\r
-  then 0 is returned.\r
-  If the number represented by String overflows according\r
-  to the range defined by UINTN, then ASSERT().\r
-\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains\r
-  more than PcdMaximumUnicodeStringLength Unicode characters, not including\r
-  the Null-terminator, then ASSERT().\r
-\r
-  @param  String      A pointer to a Null-terminated Unicode string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-StrDecimalToUintn (\r
-  IN      CONST CHAR16              *String\r
-  )\r
-{\r
-  UINTN     Result;\r
-  \r
-  //\r
-  // ASSERT String is less long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
-  //\r
-  ASSERT (StrSize (String) != 0);\r
-\r
-  //\r
-  // Ignore the pad spaces (space or tab)\r
-  //\r
-  while ((*String == L' ') || (*String == L'\t')) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == L'0') {\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-\r
-  while (InternalIsDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= ((((UINTN) ~0) - (*String - L'0')) / 10));\r
-\r
-    Result = Result * 10 + (*String - L'0');\r
-    String++;\r
-  }\r
-  \r
-  return Result;\r
-}\r
-\r
-\r
-/**\r
-  Convert a Null-terminated Unicode decimal string to a value of\r
-  type UINT64.\r
-\r
-  This function returns a value of type UINT64 by interpreting the contents\r
-  of the Unicode string specified by String as a decimal number. The format\r
-  of the input Unicode string String is:\r
-\r
-                  [spaces] [decimal digits].\r
-\r
-  The valid decimal digit character is in the range [0-9]. The\r
-  function will ignore the pad space, which includes spaces or\r
-  tab characters, before [decimal digits]. The running zero in the\r
-  beginning of [decimal digits] will be ignored. Then, the function\r
-  stops at the first character that is a not a valid decimal character\r
-  or a Null-terminator, whichever one comes first.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If String has only pad spaces, then 0 is returned.\r
-  If String has no pad spaces or valid decimal digits,\r
-  then 0 is returned.\r
-  If the number represented by String overflows according\r
-  to the range defined by UINT64, then ASSERT().\r
-\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains\r
-  more than PcdMaximumUnicodeStringLength Unicode characters, not including\r
-  the Null-terminator, then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated Unicode string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-StrDecimalToUint64 (\r
-  IN      CONST CHAR16              *String\r
-  )\r
-{\r
-  UINT64     Result;\r
-  \r
-  //\r
-  // ASSERT String is less long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
-  //\r
-  ASSERT (StrSize (String) != 0);\r
-\r
-  //\r
-  // Ignore the pad spaces (space or tab)\r
-  //\r
-  while ((*String == L' ') || (*String == L'\t')) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == L'0') {\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-\r
-  while (InternalIsDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= DivU64x32 (((UINT64) ~0) - (*String - L'0') , 10));\r
-\r
-    Result = MultU64x32 (Result, 10) + (*String - L'0');\r
-    String++;\r
-  }\r
-  \r
-  return Result;\r
-}\r
-\r
-/**\r
-  Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.\r
-\r
-  This function returns a value of type UINTN by interpreting the contents\r
-  of the Unicode string specified by String as a hexadecimal number.\r
-  The format of the input Unicode string String is:\r
-\r
-                  [spaces][zeros][x][hexadecimal digits].\r
-\r
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.\r
-  If "x" appears in the input string, it must be prefixed with at least one 0.\r
-  The function will ignore the pad space, which includes spaces or tab characters,\r
-  before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or\r
-  [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the\r
-  first valid hexadecimal digit. Then, the function stops at the first character that is\r
-  a not a valid hexadecimal character or NULL, whichever one comes first.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If String has only pad spaces, then zero is returned.\r
-  If String has no leading pad spaces, leading zeros or valid hexadecimal digits,\r
-  then zero is returned.\r
-  If the number represented by String overflows according to the range defined by\r
-  UINTN, then ASSERT().\r
-\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated Unicode string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-StrHexToUintn (\r
-  IN      CONST CHAR16              *String\r
-  )\r
-{\r
-  UINTN     Result;\r
-\r
-  //\r
-  // ASSERT String is less long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
-  //\r
-  ASSERT (StrSize (String) != 0);\r
-  \r
-  //\r
-  // Ignore the pad spaces (space or tab) \r
-  //\r
-  while ((*String == L' ') || (*String == L'\t')) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == L'0') {\r
-    String++;\r
-  }\r
-\r
-  if (InternalCharToUpper (*String) == L'X') {\r
-    if (*(String - 1) != L'0') {\r
-      return 0;\r
-    }\r
-    //\r
-    // Skip the 'X'\r
-    //\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-  \r
-  while (InternalIsHexaDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the Hex Number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= ((((UINTN) ~0) - InternalHexCharToUintn (*String)) >> 4));\r
-\r
-    Result = (Result << 4) + InternalHexCharToUintn (*String);\r
-    String++;\r
-  }\r
-\r
-  return Result;\r
-}\r
-\r
-\r
-/**\r
-  Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.\r
-\r
-  This function returns a value of type UINT64 by interpreting the contents\r
-  of the Unicode string specified by String as a hexadecimal number.\r
-  The format of the input Unicode string String is\r
-\r
-                  [spaces][zeros][x][hexadecimal digits].\r
-\r
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.\r
-  If "x" appears in the input string, it must be prefixed with at least one 0.\r
-  The function will ignore the pad space, which includes spaces or tab characters,\r
-  before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or\r
-  [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the\r
-  first valid hexadecimal digit. Then, the function stops at the first character that is\r
-  a not a valid hexadecimal character or NULL, whichever one comes first.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If String is not aligned in a 16-bit boundary, then ASSERT().\r
-  If String has only pad spaces, then zero is returned.\r
-  If String has no leading pad spaces, leading zeros or valid hexadecimal digits,\r
-  then zero is returned.\r
-  If the number represented by String overflows according to the range defined by\r
-  UINT64, then ASSERT().\r
-\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated Unicode string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-StrHexToUint64 (\r
-  IN      CONST CHAR16             *String\r
-  )\r
-{\r
-  UINT64    Result;\r
-\r
-  //\r
-  // ASSERT String is less long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
-  //\r
-  ASSERT (StrSize (String) != 0);\r
-  \r
-  //\r
-  // Ignore the pad spaces (space or tab) \r
-  //\r
-  while ((*String == L' ') || (*String == L'\t')) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == L'0') {\r
-    String++;\r
-  }\r
-\r
-  if (InternalCharToUpper (*String) == L'X') {\r
-    ASSERT (*(String - 1) == L'0');\r
-    if (*(String - 1) != L'0') {\r
-      return 0;\r
-    }\r
-    //\r
-    // Skip the 'X'\r
-    //\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-  \r
-  while (InternalIsHexaDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the Hex Number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= RShiftU64 (((UINT64) ~0) - InternalHexCharToUintn (*String) , 4));\r
-\r
-    Result = LShiftU64 (Result, 4);\r
-    Result = Result + InternalHexCharToUintn (*String);\r
-    String++;\r
-  }\r
-\r
-  return Result;\r
-}\r
-\r
-/**\r
-  Check if a ASCII character is a decimal character.\r
-\r
-  This internal function checks if a Unicode character is a \r
-  decimal character. The valid decimal character is from\r
-  '0' to '9'.\r
-\r
-  @param  Char  The character to check against.\r
-\r
-  @retval TRUE  If the Char is a decmial character.\r
-  @retval FALSE If the Char is not a decmial character.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-InternalAsciiIsDecimalDigitCharacter (\r
-  IN      CHAR8                     Char\r
-  )\r
-{\r
-  return (BOOLEAN) (Char >= '0' && Char <= '9');\r
-}\r
-\r
-/**\r
-  Check if a ASCII character is a hexadecimal character.\r
-\r
-  This internal function checks if a ASCII character is a \r
-  decimal character.  The valid hexadecimal character is \r
-  L'0' to L'9', L'a' to L'f', or L'A' to L'F'.\r
-\r
-\r
-  @param  Char  The character to check against.\r
-\r
-  @retval TRUE  If the Char is a hexadecmial character.\r
-  @retval FALSE If the Char is not a hexadecmial character.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-InternalAsciiIsHexaDecimalDigitCharacter (\r
-  IN      CHAR8                    Char\r
-  )\r
-{\r
-\r
-  return (BOOLEAN) (InternalAsciiIsDecimalDigitCharacter (Char) ||\r
-    (Char >= 'A' && Char <= 'F') ||\r
-    (Char >= 'a' && Char <= 'f'));\r
-}\r
-\r
-/**\r
-  Convert a Null-terminated Unicode string to a Null-terminated\r
-  ASCII string and returns the ASCII string.\r
-\r
-  This function converts the content of the Unicode string Source\r
-  to the ASCII string Destination by copying the lower 8 bits of\r
-  each Unicode character. It returns Destination.\r
-\r
-  If any Unicode characters in Source contain non-zero value in\r
-  the upper 8 bits, then ASSERT().\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Source is NULL, then ASSERT().\r
-  If Source is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains\r
-  more than PcdMaximumUnicodeStringLength Unicode characters, not including\r
-  the Null-terminator, then ASSERT().\r
-\r
-  If PcdMaximumAsciiStringLength is not zero, and Source contains more\r
-  than PcdMaximumAsciiStringLength Unicode characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  Source        A pointer to a Null-terminated Unicode string.\r
-  @param  Destination   A pointer to a Null-terminated ASCII string.\r
-\r
-  @return Destination.\r
-\r
-**/\r
-CHAR8 *\r
-EFIAPI\r
-UnicodeStrToAsciiStr (\r
-  IN      CONST CHAR16              *Source,\r
-  OUT     CHAR8                     *Destination\r
-  )\r
-{\r
-  CHAR8                               *ReturnValue;\r
-\r
-  ASSERT (Destination != NULL);\r
-\r
-  //\r
-  // ASSERT if Source is long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
-  //\r
-  ASSERT (StrSize (Source) != 0);\r
-\r
-  //\r
-  // Source and Destination should not overlap\r
-  //\r
-  ASSERT ((UINTN) ((CHAR16 *) Destination -  Source) > StrLen (Source));\r
-  ASSERT ((UINTN) ((CHAR8 *) Source - Destination) > StrLen (Source));\r
-\r
-\r
-  ReturnValue = Destination;\r
-  while (*Source != '\0') {\r
-    //\r
-    // If any Unicode characters in Source contain \r
-    // non-zero value in the upper 8 bits, then ASSERT().\r
-    //\r
-    ASSERT (*Source < 0x100);\r
-    *(Destination++) = (CHAR8) *(Source++);\r
-  }\r
-\r
-  *Destination = '\0';\r
-\r
-  //\r
-  // ASSERT Original Destination is less long than PcdMaximumAsciiStringLength.\r
-  // Length tests are performed inside AsciiStrLen().\r
-  //\r
-  ASSERT (AsciiStrSize (ReturnValue) != 0);\r
-\r
-  return ReturnValue;\r
-}\r
-\r
-\r
-/**\r
-  Copies one Null-terminated ASCII string to another Null-terminated ASCII\r
-  string and returns the new ASCII string.\r
-\r
-  This function copies the contents of the ASCII string Source to the ASCII\r
-  string Destination, and returns Destination. If Source and Destination\r
-  overlap, then the results are undefined.\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Source is NULL, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated ASCII string.\r
-  @param  Source      A pointer to a Null-terminated ASCII string.\r
-\r
-  @return Destination\r
-\r
-**/\r
-CHAR8 *\r
-EFIAPI\r
-AsciiStrCpy (\r
-  OUT     CHAR8                     *Destination,\r
-  IN      CONST CHAR8               *Source\r
-  )\r
-{\r
-  CHAR8                             *ReturnValue;\r
-\r
-  //\r
-  // Destination cannot be NULL\r
-  //\r
-  ASSERT (Destination != NULL);\r
-\r
-  //\r
-  // Destination and source cannot overlap\r
-  //\r
-  ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source));\r
-  ASSERT ((UINTN)(Source - Destination) > AsciiStrLen (Source));\r
-\r
-  ReturnValue = Destination;\r
-  while (*Source != 0) {\r
-    *(Destination++) = *(Source++);\r
-  }\r
-  *Destination = 0;\r
-  return ReturnValue;\r
-}\r
-\r
-/**\r
-  Copies up to a specified length one Null-terminated ASCII string to another \r
-  Null-terminated ASCII string and returns the new ASCII string.\r
-\r
-  This function copies the contents of the ASCII string Source to the ASCII\r
-  string Destination, and returns Destination. At most, Length ASCII characters\r
-  are copied from Source to Destination. If Length is 0, then Destination is\r
-  returned unmodified. If Length is greater that the number of ASCII characters\r
-  in Source, then Destination is padded with Null ASCII characters. If Source\r
-  and Destination overlap, then the results are undefined.\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Source is NULL, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Length is greater than \r
-  PcdMaximumAsciiStringLength, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated ASCII string.\r
-  @param  Source      A pointer to a Null-terminated ASCII string.\r
-  @param  Length      The maximum number of ASCII characters to copy.\r
-\r
-  @return Destination\r
-\r
-**/\r
-CHAR8 *\r
-EFIAPI\r
-AsciiStrnCpy (\r
-  OUT     CHAR8                     *Destination,\r
-  IN      CONST CHAR8               *Source,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  CHAR8                             *ReturnValue;\r
-\r
-  if (Length == 0) {\r
-    return Destination;\r
-  }\r
-\r
-  //\r
-  // Destination cannot be NULL\r
-  //\r
-  ASSERT (Destination != NULL);\r
-\r
-  //\r
-  // Destination and source cannot overlap\r
-  //\r
-  ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source));\r
-  ASSERT ((UINTN)(Source - Destination) >= Length);\r
-\r
-  if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {\r
-    ASSERT (Length <= PcdGet32 (PcdMaximumAsciiStringLength));\r
-  }\r
-\r
-  ReturnValue = Destination;\r
-\r
-  while (*Source != 0 && Length > 0) {\r
-    *(Destination++) = *(Source++);\r
-    Length--;\r
-  }\r
-\r
-  ZeroMem (Destination, Length * sizeof (*Destination));\r
-  return ReturnValue;\r
-}\r
-\r
-/**\r
-  Returns the length of a Null-terminated ASCII string.\r
-\r
-  This function returns the number of ASCII characters in the Null-terminated\r
-  ASCII string specified by String.\r
-\r
-  If Length > 0 and Destination is NULL, then ASSERT().\r
-  If Length > 0 and Source is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  String  A pointer to a Null-terminated ASCII string.\r
-\r
-  @return The length of String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsciiStrLen (\r
-  IN      CONST CHAR8               *String\r
-  )\r
-{\r
-  UINTN                             Length;\r
-\r
-  ASSERT (String != NULL);\r
-\r
-  for (Length = 0; *String != '\0'; String++, Length++) {\r
-    //\r
-    // If PcdMaximumUnicodeStringLength is not zero,\r
-    // length should not more than PcdMaximumUnicodeStringLength\r
-    //\r
-    if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {\r
-      ASSERT (Length < PcdGet32 (PcdMaximumAsciiStringLength));\r
-    }\r
-  }\r
-  return Length;\r
-}\r
-\r
-/**\r
-  Returns the size of a Null-terminated ASCII string in bytes, including the\r
-  Null terminator.\r
-\r
-  This function returns the size, in bytes, of the Null-terminated ASCII string\r
-  specified by String.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  String  A pointer to a Null-terminated ASCII string.\r
-\r
-  @return The size of String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsciiStrSize (\r
-  IN      CONST CHAR8               *String\r
-  )\r
-{\r
-  return (AsciiStrLen (String) + 1) * sizeof (*String);\r
-}\r
-\r
-/**\r
-  Compares two Null-terminated ASCII strings, and returns the difference\r
-  between the first mismatched ASCII characters.\r
-\r
-  This function compares the Null-terminated ASCII string FirstString to the\r
-  Null-terminated ASCII string SecondString. If FirstString is identical to\r
-  SecondString, then 0 is returned. Otherwise, the value returned is the first\r
-  mismatched ASCII character in SecondString subtracted from the first\r
-  mismatched ASCII character in FirstString.\r
-\r
-  If FirstString is NULL, then ASSERT().\r
-  If SecondString is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  FirstString   A pointer to a Null-terminated ASCII string.\r
-  @param  SecondString  A pointer to a Null-terminated ASCII string.\r
-\r
-  @retval ==0      FirstString is identical to SecondString.\r
-  @retval !=0      FirstString is not identical to SecondString.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-AsciiStrCmp (\r
-  IN      CONST CHAR8               *FirstString,\r
-  IN      CONST CHAR8               *SecondString\r
-  )\r
-{\r
-  //\r
-  // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (FirstString));\r
-  ASSERT (AsciiStrSize (SecondString));\r
-\r
-  while ((*FirstString != '\0') && (*FirstString == *SecondString)) {\r
-    FirstString++;\r
-    SecondString++;\r
-  }\r
-\r
-  return *FirstString - *SecondString;\r
-}\r
-\r
-/**\r
-  Converts a lowercase Ascii character to upper one.\r
-\r
-  If Chr is lowercase Ascii character, then converts it to upper one.\r
-\r
-  If Value >= 0xA0, then ASSERT().\r
-  If (Value & 0x0F) >= 0x0A, then ASSERT().\r
-\r
-  @param  Chr   one Ascii character\r
-\r
-  @return The uppercase value of Ascii character \r
-\r
-**/\r
-CHAR8\r
-EFIAPI\r
-InternalBaseLibAsciiToUpper (\r
-  IN      CHAR8                     Chr\r
-  )\r
-{\r
-  return (UINT8) ((Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr);\r
-}\r
-\r
-/**\r
-  Convert a ASCII character to numerical value.\r
-\r
-  This internal function only deal with Unicode character\r
-  which maps to a valid hexadecimal ASII character, i.e.\r
-  '0' to '9', 'a' to 'f' or 'A' to 'F'. For other \r
-  ASCII character, the value returned does not make sense.\r
-\r
-  @param  Char  The character to convert.\r
-\r
-  @return The numerical value converted.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-InternalAsciiHexCharToUintn (\r
-  IN      CHAR8                    Char\r
-  )\r
-{\r
-  if (InternalIsDecimalDigitCharacter (Char)) {\r
-    return Char - '0';\r
-  }\r
-\r
-  return (UINTN) (10 + InternalBaseLibAsciiToUpper (Char) - 'A');\r
-}\r
-\r
-\r
-/**\r
-  Performs a case insensitive comparison of two Null-terminated ASCII strings,\r
-  and returns the difference between the first mismatched ASCII characters.\r
-\r
-  This function performs a case insensitive comparison of the Null-terminated\r
-  ASCII string FirstString to the Null-terminated ASCII string SecondString. If\r
-  FirstString is identical to SecondString, then 0 is returned. Otherwise, the\r
-  value returned is the first mismatched lower case ASCII character in\r
-  SecondString subtracted from the first mismatched lower case ASCII character\r
-  in FirstString.\r
-\r
-  If FirstString is NULL, then ASSERT().\r
-  If SecondString is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  FirstString   A pointer to a Null-terminated ASCII string.\r
-  @param  SecondString  A pointer to a Null-terminated ASCII string.\r
-\r
-  @retval ==0    FirstString is identical to SecondString using case insensitive\r
-                 comparisons.\r
-  @retval !=0    FirstString is not identical to SecondString using case\r
-                 insensitive comparisons.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-AsciiStriCmp (\r
-  IN      CONST CHAR8               *FirstString,\r
-  IN      CONST CHAR8               *SecondString\r
-  )\r
-{\r
-  CHAR8  UpperFirstString;\r
-  CHAR8  UpperSecondString;\r
-\r
-  //\r
-  // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (FirstString));\r
-  ASSERT (AsciiStrSize (SecondString));\r
-\r
-  UpperFirstString  = InternalBaseLibAsciiToUpper (*FirstString);\r
-  UpperSecondString = InternalBaseLibAsciiToUpper (*SecondString);\r
-  while ((*FirstString != '\0') && (UpperFirstString == UpperSecondString)) {\r
-    FirstString++;\r
-    SecondString++;\r
-    UpperFirstString  = InternalBaseLibAsciiToUpper (*FirstString);\r
-    UpperSecondString = InternalBaseLibAsciiToUpper (*SecondString);\r
-  }\r
-\r
-  return UpperFirstString - UpperSecondString;\r
-}\r
-\r
-/**\r
-  Compares two Null-terminated ASCII strings with maximum lengths, and returns\r
-  the difference between the first mismatched ASCII characters.\r
-\r
-  This function compares the Null-terminated ASCII string FirstString to the\r
-  Null-terminated ASCII  string SecondString. At most, Length ASCII characters\r
-  will be compared. If Length is 0, then 0 is returned. If FirstString is\r
-  identical to SecondString, then 0 is returned. Otherwise, the value returned\r
-  is the first mismatched ASCII character in SecondString subtracted from the\r
-  first mismatched ASCII character in FirstString.\r
-\r
-  If Length > 0 and FirstString is NULL, then ASSERT().\r
-  If Length > 0 and SecondString is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Length is greater than \r
-  PcdMaximumAsciiStringLength, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  FirstString   A pointer to a Null-terminated ASCII string.\r
-  @param  SecondString  A pointer to a Null-terminated ASCII string.\r
-  @param  Length        The maximum number of ASCII characters for compare.\r
-  \r
-  @retval ==0       FirstString is identical to SecondString.\r
-  @retval !=0       FirstString is not identical to SecondString.\r
-\r
-**/\r
-INTN\r
-EFIAPI\r
-AsciiStrnCmp (\r
-  IN      CONST CHAR8               *FirstString,\r
-  IN      CONST CHAR8               *SecondString,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  if (Length == 0) {\r
-    return 0;\r
-  }\r
-\r
-  //\r
-  // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (FirstString));\r
-  ASSERT (AsciiStrSize (SecondString));\r
-\r
-  if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {\r
-    ASSERT (Length <= PcdGet32 (PcdMaximumAsciiStringLength));\r
-  }\r
-\r
-  while ((*FirstString != '\0') &&\r
-         (*FirstString == *SecondString) &&\r
-         (Length > 1)) {\r
-    FirstString++;\r
-    SecondString++;\r
-    Length--;\r
-  }\r
-  return *FirstString - *SecondString;\r
-}\r
-\r
-/**\r
-  Concatenates one Null-terminated ASCII string to another Null-terminated\r
-  ASCII string, and returns the concatenated ASCII string.\r
-\r
-  This function concatenates two Null-terminated ASCII strings. The contents of\r
-  Null-terminated ASCII string Source are concatenated to the end of Null-\r
-  terminated ASCII string Destination. The Null-terminated concatenated ASCII\r
-  String is returned.\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Source is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and Destination contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and concatenating Destination and\r
-  Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
-  ASCII characters, then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated ASCII string.\r
-  @param  Source      A pointer to a Null-terminated ASCII string.\r
-\r
-  @return Destination\r
-\r
-**/\r
-CHAR8 *\r
-EFIAPI\r
-AsciiStrCat (\r
-  IN OUT CHAR8    *Destination,\r
-  IN CONST CHAR8  *Source\r
-  )\r
-{\r
-  AsciiStrCpy (Destination + AsciiStrLen (Destination), Source);\r
-\r
-  //\r
-  // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
-  //\r
-  ASSERT (AsciiStrSize (Destination) != 0);\r
-  return Destination;\r
-}\r
-\r
-/**\r
-  Concatenates up to a specified length one Null-terminated ASCII string to \r
-  the end of another Null-terminated ASCII string, and returns the \r
-  concatenated ASCII string.\r
-\r
-  This function concatenates two Null-terminated ASCII strings. The contents\r
-  of Null-terminated ASCII string Source are concatenated to the end of Null-\r
-  terminated ASCII string Destination, and Destination is returned. At most,\r
-  Length ASCII characters are concatenated from Source to the end of\r
-  Destination, and Destination is always Null-terminated. If Length is 0, then\r
-  Destination is returned unmodified. If Source and Destination overlap, then\r
-  the results are undefined.\r
-\r
-  If Length > 0 and Destination is NULL, then ASSERT().\r
-  If Length > 0 and Source is NULL, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Length is greater than\r
-  PcdMaximumAsciiStringLength, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Destination contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and\r
-  Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
-  ASCII characters, not including the Null-terminator, then ASSERT().\r
-\r
-  @param  Destination A pointer to a Null-terminated ASCII string.\r
-  @param  Source      A pointer to a Null-terminated ASCII string.\r
-  @param  Length      The maximum number of ASCII characters to concatenate from\r
-                      Source.\r
-\r
-  @return Destination\r
-\r
-**/\r
-CHAR8 *\r
-EFIAPI\r
-AsciiStrnCat (\r
-  IN OUT  CHAR8                     *Destination,\r
-  IN      CONST CHAR8               *Source,\r
-  IN      UINTN                     Length\r
-  )\r
-{\r
-  UINTN   DestinationLen;\r
-\r
-  DestinationLen = AsciiStrLen (Destination);\r
-  AsciiStrnCpy (Destination + DestinationLen, Source, Length);\r
-  Destination[DestinationLen + Length] = '\0';\r
-\r
-  //\r
-  // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
-  //\r
-  ASSERT (AsciiStrSize (Destination) != 0);\r
-  return Destination;\r
-}\r
-\r
-/**\r
-  Returns the first occurrence of a Null-terminated ASCII sub-string\r
-  in a Null-terminated ASCII string.\r
-\r
-  This function scans the contents of the ASCII string specified by String\r
-  and returns the first occurrence of SearchString. If SearchString is not\r
-  found in String, then NULL is returned. If the length of SearchString is zero,\r
-  then String is returned.\r
-\r
-  If String is NULL, then ASSERT().\r
-  If SearchString is NULL, then ASSERT().\r
-\r
-  If PcdMaximumAsciiStringLength is not zero, and SearchString or\r
-  String contains more than PcdMaximumAsciiStringLength Unicode characters\r
-  not including the Null-terminator, then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated ASCII string.\r
-  @param  SearchString    A pointer to a Null-terminated ASCII string to search for.\r
-\r
-  @retval NULL            If the SearchString does not appear in String.\r
-  @retval others          If there is a match return the first occurrence of SearchingString.\r
-                          If the length of SearchString is zero,return String.\r
-\r
-**/\r
-CHAR8 *\r
-EFIAPI\r
-AsciiStrStr (\r
-  IN      CONST CHAR8               *String,\r
-  IN      CONST CHAR8               *SearchString\r
-  )\r
-{\r
-  CONST CHAR8 *FirstMatch;\r
-  CONST CHAR8 *SearchStringTmp;\r
-\r
-  //\r
-  // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (String) != 0);\r
-  ASSERT (AsciiStrSize (SearchString) != 0);\r
-\r
-  if (*SearchString == '\0') {\r
-    return (CHAR8 *) String;\r
-  }\r
-\r
-  while (*String != '\0') {\r
-    SearchStringTmp = SearchString;\r
-    FirstMatch = String;\r
-    \r
-    while ((*String == *SearchStringTmp) \r
-            && (*String != '\0')) {\r
-      String++;\r
-      SearchStringTmp++;\r
-    } \r
-    \r
-    if (*SearchStringTmp == '\0') {\r
-      return (CHAR8 *) FirstMatch;\r
-    }\r
-\r
-    if (*String == '\0') {\r
-      return NULL;\r
-    }\r
-\r
-    String = FirstMatch + 1;\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-/**\r
-  Convert a Null-terminated ASCII decimal string to a value of type\r
-  UINTN.\r
-\r
-  This function returns a value of type UINTN by interpreting the contents\r
-  of the ASCII string String as a decimal number. The format of the input\r
-  ASCII string String is:\r
-\r
-                    [spaces] [decimal digits].\r
-\r
-  The valid decimal digit character is in the range [0-9]. The function will\r
-  ignore the pad space, which includes spaces or tab characters, before the digits.\r
-  The running zero in the beginning of [decimal digits] will be ignored. Then, the\r
-  function stops at the first character that is a not a valid decimal character or\r
-  Null-terminator, whichever on comes first.\r
-\r
-  If String has only pad spaces, then 0 is returned.\r
-  If String has no pad spaces or valid decimal digits, then 0 is returned.\r
-  If the number represented by String overflows according to the range defined by\r
-  UINTN, then ASSERT().\r
-  If String is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated ASCII string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsciiStrDecimalToUintn (\r
-  IN      CONST CHAR8               *String\r
-  )\r
-{\r
-  UINTN     Result;\r
-  \r
-  //\r
-  // ASSERT Strings is less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (String) != 0);\r
-\r
-  //\r
-  // Ignore the pad spaces (space or tab)\r
-  //\r
-  while ((*String == ' ') || (*String == '\t' )) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == '0') {\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-\r
-  while (InternalAsciiIsDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= ((((UINTN) ~0) - (*String - L'0')) / 10));\r
-\r
-    Result = Result * 10 + (*String - '0');\r
-    String++;\r
-  }\r
-  \r
-  return Result;\r
-}\r
-\r
-\r
-/**\r
-  Convert a Null-terminated ASCII decimal string to a value of type\r
-  UINT64.\r
-\r
-  This function returns a value of type UINT64 by interpreting the contents\r
-  of the ASCII string String as a decimal number. The format of the input\r
-  ASCII string String is:\r
-\r
-                    [spaces] [decimal digits].\r
-\r
-  The valid decimal digit character is in the range [0-9]. The function will\r
-  ignore the pad space, which includes spaces or tab characters, before the digits.\r
-  The running zero in the beginning of [decimal digits] will be ignored. Then, the\r
-  function stops at the first character that is a not a valid decimal character or\r
-  Null-terminator, whichever on comes first.\r
-\r
-  If String has only pad spaces, then 0 is returned.\r
-  If String has no pad spaces or valid decimal digits, then 0 is returned.\r
-  If the number represented by String overflows according to the range defined by\r
-  UINT64, then ASSERT().\r
-  If String is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
-  then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated ASCII string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsciiStrDecimalToUint64 (\r
-  IN      CONST CHAR8               *String\r
-  )\r
-{\r
-  UINT64     Result;\r
-  \r
-  //\r
-  // ASSERT Strings is less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (String) != 0);\r
-\r
-  //\r
-  // Ignore the pad spaces (space or tab)\r
-  //\r
-  while ((*String == ' ') || (*String == '\t' )) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == '0') {\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-\r
-  while (InternalAsciiIsDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= DivU64x32 (((UINT64) ~0) - (*String - L'0') , 10));\r
-\r
-    Result = MultU64x32 (Result, 10) + (*String - '0');\r
-    String++;\r
-  }\r
-  \r
-  return Result;\r
-}\r
-\r
-/**\r
-  Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.\r
-\r
-  This function returns a value of type UINTN by interpreting the contents of\r
-  the ASCII string String as a hexadecimal number. The format of the input ASCII\r
-  string String is:\r
-\r
-                  [spaces][zeros][x][hexadecimal digits].\r
-\r
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"\r
-  appears in the input string, it must be prefixed with at least one 0. The function\r
-  will ignore the pad space, which includes spaces or tab characters, before [zeros],\r
-  [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]\r
-  will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal\r
-  digit. Then, the function stops at the first character that is a not a valid\r
-  hexadecimal character or Null-terminator, whichever on comes first.\r
-\r
-  If String has only pad spaces, then 0 is returned.\r
-  If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then\r
-  0 is returned.\r
-\r
-  If the number represented by String overflows according to the range defined by UINTN,\r
-  then ASSERT().\r
-  If String is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero,\r
-  and String contains more than PcdMaximumAsciiStringLength ASCII characters not including\r
-  the Null-terminator, then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated ASCII string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsciiStrHexToUintn (\r
-  IN      CONST CHAR8               *String\r
-  )\r
-{\r
-  UINTN     Result;\r
-\r
-  //\r
-  // ASSERT Strings is less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (String) != 0);\r
-  \r
-  //\r
-  // Ignore the pad spaces (space or tab) \r
-  //\r
-  while ((*String == ' ') || (*String == '\t' )) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == '0') {\r
-    String++;\r
-  }\r
-\r
-  if (InternalBaseLibAsciiToUpper (*String) == 'X') {\r
-    ASSERT (*(String - 1) == '0');\r
-    if (*(String - 1) != '0') {\r
-      return 0;\r
-    }\r
-    //\r
-    // Skip the 'X'\r
-    //\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-  \r
-  while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the Hex Number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= ((((UINTN) ~0) - InternalHexCharToUintn (*String)) >> 4));\r
-\r
-    Result = (Result << 4) + InternalAsciiHexCharToUintn (*String);\r
-    String++;\r
-  }\r
-\r
-  return Result;\r
-}\r
-\r
-\r
-/**\r
-  Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.\r
-\r
-  This function returns a value of type UINT64 by interpreting the contents of\r
-  the ASCII string String as a hexadecimal number. The format of the input ASCII\r
-  string String is:\r
-\r
-                  [spaces][zeros][x][hexadecimal digits].\r
-\r
-  The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].\r
-  The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"\r
-  appears in the input string, it must be prefixed with at least one 0. The function\r
-  will ignore the pad space, which includes spaces or tab characters, before [zeros],\r
-  [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]\r
-  will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal\r
-  digit. Then, the function stops at the first character that is a not a valid\r
-  hexadecimal character or Null-terminator, whichever on comes first.\r
-\r
-  If String has only pad spaces, then 0 is returned.\r
-  If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then\r
-  0 is returned.\r
-\r
-  If the number represented by String overflows according to the range defined by UINT64,\r
-  then ASSERT().\r
-  If String is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero,\r
-  and String contains more than PcdMaximumAsciiStringLength ASCII characters not including\r
-  the Null-terminator, then ASSERT().\r
-\r
-  @param  String          A pointer to a Null-terminated ASCII string.\r
-\r
-  @retval Value translated from String.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsciiStrHexToUint64 (\r
-  IN      CONST CHAR8                *String\r
-  )\r
-{\r
-  UINT64    Result;\r
-\r
-  //\r
-  // ASSERT Strings is less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (String) != 0);\r
-  \r
-  //\r
-  // Ignore the pad spaces (space or tab) and leading Zeros\r
-  //\r
-  //\r
-  // Ignore the pad spaces (space or tab) \r
-  //\r
-  while ((*String == ' ') || (*String == '\t' )) {\r
-    String++;\r
-  }\r
-\r
-  //\r
-  // Ignore leading Zeros after the spaces\r
-  //\r
-  while (*String == '0') {\r
-    String++;\r
-  }\r
-\r
-  if (InternalBaseLibAsciiToUpper (*String) == 'X') {\r
-    ASSERT (*(String - 1) == '0');\r
-    if (*(String - 1) != '0') {\r
-      return 0;\r
-    }\r
-    //\r
-    // Skip the 'X'\r
-    //\r
-    String++;\r
-  }\r
-\r
-  Result = 0;\r
-  \r
-  while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) {\r
-    //\r
-    // If the Hex Number represented by String overflows according \r
-    // to the range defined by UINTN, then ASSERT().\r
-    //\r
-    ASSERT (Result <= RShiftU64 (((UINT64) ~0) - InternalHexCharToUintn (*String) , 4));\r
-\r
-    Result = LShiftU64 (Result, 4);\r
-    Result = Result + InternalAsciiHexCharToUintn (*String);\r
-    String++;\r
-  }\r
-\r
-  return Result;\r
-}\r
-\r
-\r
-/**\r
-  Convert one Null-terminated ASCII string to a Null-terminated\r
-  Unicode string and returns the Unicode string.\r
-\r
-  This function converts the contents of the ASCII string Source to the Unicode\r
-  string Destination, and returns Destination.  The function terminates the\r
-  Unicode string Destination by appending a Null-terminator character at the end.\r
-  The caller is responsible to make sure Destination points to a buffer with size\r
-  equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.\r
-\r
-  If Destination is NULL, then ASSERT().\r
-  If Destination is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Source is NULL, then ASSERT().\r
-  If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,\r
-  then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength ASCII characters not including the\r
-  Null-terminator, then ASSERT().\r
-\r
-  @param  Source        A pointer to a Null-terminated ASCII string.\r
-  @param  Destination   A pointer to a Null-terminated Unicode string.\r
-\r
-  @return Destination.\r
-\r
-**/\r
-CHAR16 *\r
-EFIAPI\r
-AsciiStrToUnicodeStr (\r
-  IN      CONST CHAR8               *Source,\r
-  OUT     CHAR16                    *Destination\r
-  )\r
-{\r
-  CHAR16                            *ReturnValue;\r
-\r
-  ASSERT (Destination != NULL);\r
-\r
-  //\r
-  // ASSERT Source is less long than PcdMaximumAsciiStringLength\r
-  //\r
-  ASSERT (AsciiStrSize (Source) != 0);\r
-\r
-  //\r
-  // Source and Destination should not overlap\r
-  //\r
-  ASSERT ((UINTN) ((CHAR8 *) Destination - Source) > AsciiStrLen (Source));\r
-  ASSERT ((UINTN) (Source - (CHAR8 *) Destination) > (AsciiStrLen (Source) * sizeof (CHAR16)));\r
-\r
\r
-  ReturnValue = Destination;\r
-  while (*Source != '\0') {\r
-    *(Destination++) = (CHAR16) *(Source++);\r
-  }\r
-  //\r
-  // End the Destination with a NULL.\r
-  //\r
-  *Destination = '\0';\r
-\r
-  //\r
-  // ASSERT Original Destination is less long than PcdMaximumUnicodeStringLength\r
-  //\r
-  ASSERT (StrSize (ReturnValue) != 0);\r
-\r
-  return ReturnValue;\r
-}\r
-\r
-/**\r
-  Converts an 8-bit value to an 8-bit BCD value.\r
-\r
-  Converts the 8-bit value specified by Value to BCD. The BCD value is\r
-  returned.\r
-\r
-  If Value >= 100, then ASSERT().\r
-\r
-  @param  Value The 8-bit value to convert to BCD. Range 0..99.\r
-\r
-  @return The BCD value.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-DecimalToBcd8 (\r
-  IN      UINT8                     Value\r
-  )\r
-{\r
-  ASSERT (Value < 100);\r
-  return (UINT8) (((Value / 10) << 4) | (Value % 10));\r
-}\r
-\r
-/**\r
-  Converts an 8-bit BCD value to an 8-bit value.\r
-\r
-  Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit\r
-  value is returned.\r
-\r
-  If Value >= 0xA0, then ASSERT().\r
-  If (Value & 0x0F) >= 0x0A, then ASSERT().\r
-\r
-  @param  Value The 8-bit BCD value to convert to an 8-bit value.\r
-\r
-  @return The 8-bit value is returned.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-BcdToDecimal8 (\r
-  IN      UINT8                     Value\r
-  )\r
-{\r
-  ASSERT (Value < 0xa0);\r
-  ASSERT ((Value & 0xf) < 0xa);\r
-  return (UINT8) ((Value >> 4) * 10 + (Value & 0xf));\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/SwapBytes16.c b/UnixPkg/Library/UnixBaseLib/SwapBytes16.c
deleted file mode 100644 (file)
index 64a674a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Switches the endianess of a 16-bit integer.\r
-\r
-  This function swaps the bytes in a 16-bit unsigned value to switch the value\r
-  from little endian to big endian or vice versa. The byte swapped value is\r
-  returned.\r
-\r
-  @param  Value A 16-bit unsigned value.\r
-\r
-  @return The byte swapped Value.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-SwapBytes16 (\r
-  IN      UINT16                    Value\r
-  )\r
-{\r
-  return (UINT16) ((Value<< 8) | (Value>> 8));\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/SwapBytes32.c b/UnixPkg/Library/UnixBaseLib/SwapBytes32.c
deleted file mode 100644 (file)
index 7e30d25..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Switches the endianess of a 32-bit integer.\r
-\r
-  This function swaps the bytes in a 32-bit unsigned value to switch the value\r
-  from little endian to big endian or vice versa. The byte swapped value is\r
-  returned.\r
-\r
-  @param  Value A 32-bit unsigned value.\r
-\r
-  @return The byte swapped Value.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-SwapBytes32 (\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  UINT32  LowerBytes;\r
-  UINT32  HigherBytes;\r
-\r
-  LowerBytes  = (UINT32) SwapBytes16 ((UINT16) Value);\r
-  HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Value >> 16));\r
-\r
-  return (LowerBytes << 16 | HigherBytes);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/SwapBytes64.c b/UnixPkg/Library/UnixBaseLib/SwapBytes64.c
deleted file mode 100644 (file)
index 6a6ce83..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  Math worker functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Switches the endianess of a 64-bit integer.\r
-\r
-  This function swaps the bytes in a 64-bit unsigned value to switch the value\r
-  from little endian to big endian or vice versa. The byte swapped value is\r
-  returned.\r
-\r
-  @param  Value A 64-bit unsigned value.\r
-\r
-  @return The byte swapped Value.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-SwapBytes64 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  return InternalMathSwapBytes64 (Value);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/SwitchStack.c b/UnixPkg/Library/UnixBaseLib/SwitchStack.c
deleted file mode 100644 (file)
index 3681117..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file\r
-  Switch Stack functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Transfers control to a function starting with a new stack.\r
-\r
-  Transfers control to the function specified by EntryPoint using the\r
-  new stack specified by NewStack and passing in the parameters specified\r
-  by Context1 and Context2.  Context1 and Context2 are optional and may\r
-  be NULL.  The function EntryPoint must never return.  This function\r
-  supports a variable number of arguments following the NewStack parameter.\r
-  These additional arguments are ignored on IA-32, x64, and EBC.\r
-  IPF CPUs expect one additional parameter of type VOID * that specifies\r
-  the new backing store pointer.\r
-\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function.\r
-  @param  ...         This variable argument list is ignored for IA32, x64, and EBC.  \r
-                      For IPF, this variable argument list is expected to contain \r
-                      a single parameter of type VOID * that specifies the new backing \r
-                      store pointer.\r
-\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-SwitchStack (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack,\r
-  ...\r
-  )\r
-{\r
-  VA_LIST    Marker;\r
-\r
-  ASSERT (EntryPoint != NULL);\r
-  ASSERT (NewStack != NULL);\r
-\r
-  //\r
-  // New stack must be aligned with CPU_STACK_ALIGNMENT\r
-  //\r
-  ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);\r
-\r
-  VA_START (Marker, NewStack);\r
-\r
-  InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);\r
-\r
-  VA_END (Marker);\r
-\r
-  //\r
-  // InternalSwitchStack () will never return\r
-  //\r
-  ASSERT (FALSE);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/Unaligned.c b/UnixPkg/Library/UnixBaseLib/Unaligned.c
deleted file mode 100644 (file)
index 68dafa6..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/** @file\r
-  Unaligned access functions of BaseLib.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-\r
-/**\r
-  Reads a 16-bit value from memory that may be unaligned.\r
-\r
-  This function returns the 16-bit value pointed to by Buffer. The function\r
-  guarantees that the read operation does not produce an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 16-bit value that may be unaligned.\r
-\r
-  @return The 16-bit value read from Buffer.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-ReadUnaligned16 (\r
-  IN CONST UINT16              *Buffer\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return *Buffer;\r
-}\r
-\r
-/**\r
-  Writes a 16-bit value to memory that may be unaligned.\r
-\r
-  This function writes the 16-bit value specified by Value to Buffer. Value is\r
-  returned. The function guarantees that the write operation does not produce\r
-  an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 16-bit value that may be unaligned.\r
-  @param  Value   16-bit value to write to Buffer.\r
-\r
-  @return The 16-bit value to write to Buffer.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-WriteUnaligned16 (\r
-  OUT UINT16                    *Buffer,\r
-  IN  UINT16                    Value\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return *Buffer = Value;\r
-}\r
-\r
-/**\r
-  Reads a 24-bit value from memory that may be unaligned.\r
-\r
-  This function returns the 24-bit value pointed to by Buffer. The function\r
-  guarantees that the read operation does not produce an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 24-bit value that may be unaligned.\r
-\r
-  @return The 24-bit value read from Buffer.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-ReadUnaligned24 (\r
-  IN CONST UINT32              *Buffer\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return *Buffer & 0xffffff;\r
-}\r
-\r
-/**\r
-  Writes a 24-bit value to memory that may be unaligned.\r
-\r
-  This function writes the 24-bit value specified by Value to Buffer. Value is\r
-  returned. The function guarantees that the write operation does not produce\r
-  an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 24-bit value that may be unaligned.\r
-  @param  Value   24-bit value to write to Buffer.\r
-\r
-  @return The 24-bit value to write to Buffer.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-WriteUnaligned24 (\r
-  OUT UINT32                    *Buffer,\r
-  IN  UINT32                    Value\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  *Buffer = BitFieldWrite32 (*Buffer, 0, 23, Value);\r
-  return Value;\r
-}\r
-\r
-/**\r
-  Reads a 32-bit value from memory that may be unaligned.\r
-\r
-  This function returns the 32-bit value pointed to by Buffer. The function\r
-  guarantees that the read operation does not produce an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 32-bit value that may be unaligned.\r
-\r
-  @return The 32-bit value read from Buffer.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-ReadUnaligned32 (\r
-  IN CONST UINT32              *Buffer\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return *Buffer;\r
-}\r
-\r
-/**\r
-  Writes a 32-bit value to memory that may be unaligned.\r
-\r
-  This function writes the 32-bit value specified by Value to Buffer. Value is\r
-  returned. The function guarantees that the write operation does not produce\r
-  an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 32-bit value that may be unaligned.\r
-  @param  Value   The 32-bit value to write to Buffer.\r
-\r
-  @return The 32-bit value to write to Buffer.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-WriteUnaligned32 (\r
-  OUT UINT32                    *Buffer,\r
-  IN  UINT32                    Value\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return *Buffer = Value;\r
-}\r
-\r
-/**\r
-  Reads a 64-bit value from memory that may be unaligned.\r
-\r
-  This function returns the 64-bit value pointed to by Buffer. The function\r
-  guarantees that the read operation does not produce an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 64-bit value that may be unaligned.\r
-\r
-  @return The 64-bit value read from Buffer.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-ReadUnaligned64 (\r
-  IN CONST UINT64              *Buffer\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return *Buffer;\r
-}\r
-\r
-/**\r
-  Writes a 64-bit value to memory that may be unaligned.\r
-\r
-  This function writes the 64-bit value specified by Value to Buffer. Value is\r
-  returned. The function guarantees that the write operation does not produce\r
-  an alignment fault.\r
-\r
-  If the Buffer is NULL, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a 64-bit value that may be unaligned.\r
-  @param  Value   The 64-bit value to write to Buffer.\r
-\r
-  @return The 64-bit value to write to Buffer.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-WriteUnaligned64 (\r
-  OUT UINT64                    *Buffer,\r
-  IN  UINT64                    Value\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-\r
-  return *Buffer = Value;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/UnixBaseLib.inf b/UnixPkg/Library/UnixBaseLib/UnixBaseLib.inf
deleted file mode 100644 (file)
index 081b872..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-## @file\r
-#  Base Library implementation for X64 UnixPkg. X64 code writes CR3 so to\r
-#  not change MdeModulePkg DxeIpl we need a UnixPkg copy of the BaseLib.\r
-#  \r
-#  Currently I'm debugging UnixPkg with SVR V ABI so there are some \r
-#   temp changes for that too.\r
-#\r
-#\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php.\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = BaseLib\r
-  FILE_GUID                      = 25A41BF7-7718-4e9a-9A7E-50DC324929FD\r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = BaseLib \r
-\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC ARM\r
-#\r
-\r
-[Sources]\r
-  CheckSum.c\r
-  SwitchStack.c\r
-  SwapBytes64.c\r
-  SwapBytes32.c\r
-  SwapBytes16.c\r
-  LongJump.c\r
-  SetJump.c\r
-  RShiftU64.c\r
-  RRotU64.c\r
-  RRotU32.c\r
-  MultU64x64.c\r
-  MultU64x32.c\r
-  MultS64x64.c\r
-  ModU64x32.c\r
-  LShiftU64.c\r
-  LRotU64.c\r
-  LRotU32.c\r
-  LowBitSet64.c\r
-  LowBitSet32.c\r
-  HighBitSet64.c\r
-  HighBitSet32.c\r
-  GetPowerOfTwo64.c\r
-  GetPowerOfTwo32.c\r
-  DivU64x64Remainder.c\r
-  DivU64x32Remainder.c\r
-  DivU64x32.c\r
-  DivS64x64Remainder.c\r
-  ARShiftU64.c\r
-  BitField.c\r
-  CpuDeadLoop.c\r
-  Cpu.c\r
-  LinkedList.c\r
-  String.c\r
-  BaseLibInternals.h\r
-\r
-\r
-[Sources.X64]\r
-  X64/Thunk16.asm\r
-  X64/CpuPause.asm\r
-  X64/EnableDisableInterrupts.asm\r
-  X64/DisableInterrupts.asm\r
-  X64/EnableInterrupts.asm\r
-  X64/FlushCacheLine.asm\r
-  X64/Invd.asm\r
-  X64/Wbinvd.asm\r
-  X64/DisablePaging64.asm\r
-  X64/Mwait.asm\r
-  X64/Monitor.asm\r
-  X64/ReadPmc.asm\r
-  X64/ReadTsc.asm\r
-  X64/WriteMm7.asm\r
-  X64/WriteMm6.asm\r
-  X64/WriteMm5.asm\r
-  X64/WriteMm4.asm\r
-  X64/WriteMm3.asm\r
-  X64/WriteMm2.asm\r
-  X64/WriteMm1.asm\r
-  X64/WriteMm0.asm\r
-  X64/ReadMm7.asm\r
-  X64/ReadMm6.asm\r
-  X64/ReadMm5.asm\r
-  X64/ReadMm4.asm\r
-  X64/ReadMm3.asm\r
-  X64/ReadMm2.asm\r
-  X64/ReadMm1.asm\r
-  X64/ReadMm0.asm\r
-  X64/FxRestore.asm\r
-  X64/FxSave.asm\r
-  X64/WriteLdtr.asm\r
-  X64/ReadLdtr.asm\r
-  X64/WriteIdtr.asm\r
-  X64/ReadIdtr.asm\r
-  X64/WriteGdtr.asm\r
-  X64/ReadGdtr.asm\r
-  X64/ReadTr.asm\r
-  X64/ReadSs.asm\r
-  X64/ReadGs.asm\r
-  X64/ReadFs.asm\r
-  X64/ReadEs.asm\r
-  X64/ReadDs.asm\r
-  X64/ReadCs.asm\r
-  X64/WriteDr7.asm\r
-  X64/WriteDr6.asm\r
-  X64/WriteDr5.asm\r
-  X64/WriteDr4.asm\r
-  X64/WriteDr3.asm\r
-  X64/WriteDr2.asm\r
-  X64/WriteDr1.asm\r
-  X64/WriteDr0.asm\r
-  X64/ReadDr7.asm\r
-  X64/ReadDr6.asm\r
-  X64/ReadDr5.asm\r
-  X64/ReadDr4.asm\r
-  X64/ReadDr3.asm\r
-  X64/ReadDr2.asm\r
-  X64/ReadDr1.asm\r
-  X64/ReadDr0.asm\r
-  X64/WriteCr4.asm\r
-  X64/WriteCr3.asm\r
-  X64/WriteCr2.asm\r
-  X64/WriteCr0.asm\r
-  X64/ReadCr4.asm\r
-  X64/ReadCr3.asm\r
-  X64/ReadCr2.asm\r
-  X64/ReadCr0.asm\r
-  X64/ReadEflags.asm\r
-  X64/CpuIdEx.asm\r
-  X64/CpuId.asm\r
-  X64/LongJump.asm\r
-  X64/SetJump.asm\r
-  X64/SwitchStack.asm\r
-  X64/EnableCache.asm\r
-  X64/DisableCache.asm\r
-\r
-  X64/CpuBreakpoint.c | MSFT \r
-  X64/WriteMsr64.c | MSFT \r
-  X64/ReadMsr64.c | MSFT \r
-\r
-  X64/CpuBreakpoint.asm | INTEL \r
-  X64/WriteMsr64.asm | INTEL \r
-  X64/ReadMsr64.asm | INTEL \r
-\r
-  X64/Non-existing.c\r
-  Math64.c\r
-  Unaligned.c\r
-  X86WriteIdtr.c\r
-  X86WriteGdtr.c\r
-  X86Thunk.c\r
-  X86ReadIdtr.c\r
-  X86ReadGdtr.c\r
-  X86Msr.c\r
-  X86MemoryFence.c | MSFT\r
-  X86MemoryFence.c | INTEL\r
-  X86GetInterruptState.c\r
-  X86FxSave.c\r
-  X86FxRestore.c\r
-  X86EnablePaging64.c\r
-  X86EnablePaging32.c\r
-  X86DisablePaging64.c\r
-  X86DisablePaging32.c\r
-  X64/GccInline.c | GCC\r
-  X64/Thunk16.S | GCC \r
-  X64/SwitchStack.S | GCC \r
-  X64/SetJump.S | GCC \r
-  X64/LongJump.S | GCC \r
-  X64/EnableDisableInterrupts.S | GCC \r
-  X64/DisablePaging64.S | GCC \r
-  X64/CpuId.S | GCC \r
-  X64/CpuIdEx.S | GCC \r
-  X64/EnableCache.S | GCC\r
-  X64/DisableCache.S | GCC\r
-  ChkStkGcc.c  | GCC \r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-\r
-[LibraryClasses]\r
-  PcdLib\r
-  DebugLib\r
-  BaseMemoryLib\r
-\r
-[Pcd]\r
-  gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength\r
-  gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength\r
-  gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength\r
-  gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.S b/UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.S
deleted file mode 100644 (file)
index 51cf9c0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   CpuBreakpoint.S\r
-#\r
-# Abstract:\r
-#\r
-#   Implementation of CpuBreakpoint() on x86_64\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(CpuBreakpoint)\r
-ASM_PFX(CpuBreakpoint):\r
-  int $0x3\r
-  ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.asm b/UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.asm
deleted file mode 100644 (file)
index 25dd9b4..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuBreakpoint.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   CpuBreakpoint function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; CpuBreakpoint (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-CpuBreakpoint   PROC\r
-    int  3\r
-    ret\r
-CpuBreakpoint   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.c b/UnixPkg/Library/UnixBaseLib/X64/CpuBreakpoint.c
deleted file mode 100644 (file)
index d654f84..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  CpuBreakpoint function.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-/**\r
-  Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.\r
-**/\r
-\r
-void __debugbreak ();\r
-\r
-#pragma intrinsic(__debugbreak)\r
-\r
-/**\r
-  Generates a breakpoint on the CPU.\r
-\r
-  Generates a breakpoint on the CPU. The breakpoint must be implemented such\r
-  that code can resume normal execution after the breakpoint.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-CpuBreakpoint (\r
-  VOID\r
-  )\r
-{\r
-  __debugbreak ();\r
-}\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuId.S b/UnixPkg/Library/UnixBaseLib/X64/CpuId.S
deleted file mode 100644 (file)
index c3d2597..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   CpuId.S\r
-#\r
-# Abstract:\r
-#\r
-#   AsmCpuid function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#------------------------------------------------------------------------------\r
-#  VOID\r
-#  EFIAPI\r
-#  AsmCpuid (\r
-#    IN   UINT32  RegisterInEax,\r
-#    OUT  UINT32  *RegisterOutEax  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEbx  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEcx  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEdx  OPTIONAL\r
-#    )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(AsmCpuid)\r
-ASM_PFX(AsmCpuid):\r
-    push    %rbx\r
-    mov     %ecx, %eax\r
-    push    %rax                         # save Index on stack\r
-    push    %rdx\r
-    cpuid\r
-    test    %r9, %r9\r
-    jz      L1\r
-    mov     %ecx, (%r9)\r
-L1:\r
-    pop     %rcx\r
-    jrcxz   L2\r
-    mov     %eax, (%rcx)\r
-L2:\r
-    mov     %r8, %rcx\r
-    jrcxz   L3\r
-    mov     %ebx, (%rcx)\r
-L3:\r
-    mov     0x38(%rsp), %rcx\r
-    jrcxz   L4\r
-    mov     %edx, (%rcx)\r
-L4:\r
-    pop     %rax                         # restore Index to rax as return value\r
-    pop     %rbx\r
-    ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuId.asm b/UnixPkg/Library/UnixBaseLib/X64/CpuId.asm
deleted file mode 100644 (file)
index c6182c1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuId.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmCpuid function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-;  VOID\r
-;  EFIAPI\r
-;  AsmCpuid (\r
-;    IN   UINT32  RegisterInEax,\r
-;    OUT  UINT32  *RegisterOutEax  OPTIONAL,\r
-;    OUT  UINT32  *RegisterOutEbx  OPTIONAL,\r
-;    OUT  UINT32  *RegisterOutEcx  OPTIONAL,\r
-;    OUT  UINT32  *RegisterOutEdx  OPTIONAL\r
-;    )\r
-;------------------------------------------------------------------------------\r
-AsmCpuid    PROC    USES    rbx\r
-    mov     eax, ecx\r
-    push    rax                         ; save Index on stack\r
-    push    rdx\r
-    cpuid\r
-    test    r9, r9\r
-    jz      @F\r
-    mov     [r9], ecx\r
-@@:\r
-    pop     rcx\r
-    jrcxz   @F\r
-    mov     [rcx], eax\r
-@@:\r
-    mov     rcx, r8\r
-    jrcxz   @F\r
-    mov     [rcx], ebx\r
-@@:\r
-    mov     rcx, [rsp + 38h]\r
-    jrcxz   @F\r
-    mov     [rcx], edx\r
-@@:\r
-    pop     rax                         ; restore Index to rax as return value\r
-    ret\r
-AsmCpuid    ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuIdEx.S b/UnixPkg/Library/UnixBaseLib/X64/CpuIdEx.S
deleted file mode 100644 (file)
index d47f53c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   CpuIdEx.S\r
-#\r
-# Abstract:\r
-#\r
-#   AsmCpuidEx function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#------------------------------------------------------------------------------\r
-#  UINT32\r
-#  EFIAPI\r
-#  AsmCpuidEx (\r
-#    IN   UINT32  RegisterInEax,\r
-#    IN   UINT32  RegisterInEcx,\r
-#    OUT  UINT32  *RegisterOutEax  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEbx  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEcx  OPTIONAL,\r
-#    OUT  UINT32  *RegisterOutEdx  OPTIONAL\r
-#    )\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(AsmCpuidEx)\r
-ASM_PFX(AsmCpuidEx):\r
-    push    %rbx\r
-    movl    %ecx,%eax\r
-    movl    %edx,%ecx\r
-    push    %rax                  # save Index on stack\r
-    cpuid\r
-    mov     0x38(%rsp), %r10\r
-    test    %r10, %r10\r
-    jz      L1\r
-    mov     %ecx,(%r10)\r
-L1: \r
-    mov     %r8, %rcx\r
-    jrcxz   L2\r
-    movl    %eax,(%rcx)\r
-L2: \r
-    mov     %r9, %rcx\r
-    jrcxz   L3\r
-    mov     %ebx, (%rcx)\r
-L3: \r
-    mov     0x40(%rsp), %rcx\r
-    jrcxz   L4\r
-    mov     %edx, (%rcx)\r
-L4: \r
-    pop     %rax                  # restore Index to rax as return value\r
-    pop     %rbx\r
-    ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuIdEx.asm b/UnixPkg/Library/UnixBaseLib/X64/CpuIdEx.asm
deleted file mode 100644 (file)
index b41ba8e..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuIdEx.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmCpuidEx function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-;  UINT32\r
-;  EFIAPI\r
-;  AsmCpuidEx (\r
-;    IN   UINT32  RegisterInEax,\r
-;    IN   UINT32  RegisterInEcx,\r
-;    OUT  UINT32  *RegisterOutEax  OPTIONAL,\r
-;    OUT  UINT32  *RegisterOutEbx  OPTIONAL,\r
-;    OUT  UINT32  *RegisterOutEcx  OPTIONAL,\r
-;    OUT  UINT32  *RegisterOutEdx  OPTIONAL\r
-;    )\r
-;------------------------------------------------------------------------------\r
-AsmCpuidEx  PROC    USES    rbx\r
-    mov     eax, ecx\r
-    mov     ecx, edx\r
-    push    rax                         ; save Index on stack\r
-    cpuid\r
-    mov     r10, [rsp + 38h]\r
-    test    r10, r10\r
-    jz      @F\r
-    mov     [r10], ecx\r
-@@:\r
-    mov     rcx, r8\r
-    jrcxz   @F\r
-    mov     [rcx], eax\r
-@@:\r
-    mov     rcx, r9\r
-    jrcxz   @F\r
-    mov     [rcx], ebx\r
-@@:\r
-    mov     rcx, [rsp + 40h]\r
-    jrcxz   @F\r
-    mov     [rcx], edx\r
-@@:\r
-    pop     rax                         ; restore Index to rax as return value\r
-    ret\r
-AsmCpuidEx  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/CpuPause.asm b/UnixPkg/Library/UnixBaseLib/X64/CpuPause.asm
deleted file mode 100644 (file)
index a84465f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuPause.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   CpuPause function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; CpuPause (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-CpuPause    PROC\r
-    pause\r
-    ret\r
-CpuPause    ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/DisableCache.S b/UnixPkg/Library/UnixBaseLib/X64/DisableCache.S
deleted file mode 100644 (file)
index 970f2f3..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   DisableCache.S\r
-#\r
-# Abstract:\r
-#\r
-#   Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
-#   WBINVD instruction.\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# AsmDisableCache (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(AsmDisableCache)\r
-ASM_PFX(AsmDisableCache):\r
-    movq    %cr0, %rax\r
-    btsq    $30, %rax\r
-    btrq    $29, %rax\r
-    movq    %rax, %cr0\r
-    wbinvd\r
-    ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/DisableCache.asm b/UnixPkg/Library/UnixBaseLib/X64/DisableCache.asm
deleted file mode 100644 (file)
index 9fd5bd7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   DisableCache.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
-;   WBINVD instruction.\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmDisableCache (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmDisableCache PROC\r
-    mov     rax, cr0\r
-    bts     rax, 30\r
-    btr     rax, 29\r
-    mov     cr0, rax\r
-    wbinvd\r
-    ret\r
-AsmDisableCache ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/DisableInterrupts.asm b/UnixPkg/Library/UnixBaseLib/X64/DisableInterrupts.asm
deleted file mode 100644 (file)
index 4e54e0d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   DisableInterrupts.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   DisableInterrupts function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; DisableInterrupts (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-DisableInterrupts   PROC\r
-    cli\r
-    ret\r
-DisableInterrupts   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/DisablePaging64.S b/UnixPkg/Library/UnixBaseLib/X64/DisablePaging64.S
deleted file mode 100644 (file)
index 676e9e1..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   DisablePaging64.S\r
-#\r
-# Abstract:\r
-#\r
-#   AsmDisablePaging64 function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-    \r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# InternalX86DisablePaging64 (\r
-#   IN      UINT16                    Cs,\r
-#   IN      UINT32                    EntryPoint,\r
-#   IN      UINT32                    Context1,  OPTIONAL\r
-#   IN      UINT32                    Context2,  OPTIONAL\r
-#   IN      UINT32                    NewStack\r
-#   );\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalX86DisablePaging64)\r
-ASM_PFX(InternalX86DisablePaging64):\r
-    cli    \r
-    lea    L1(%rip), %rsi                 # rsi <- The start address of transition code\r
-    mov    0x28(%rsp), %edi               # rdi <- New stack\r
-    lea    _mTransitionEnd(%rip), %rax    # rax <- end of transition code\r
-    sub    %rsi, %rax                     # rax <- The size of transition piece code\r
-    add    $4, %rax                       # round rax up to the next 4 byte boundary\r
-    and    $0xfc, %al\r
-    sub    %rax, %rdi                     # rdi <- use stack to hold transition code \r
-    mov    %edi, %r10d                    # r10 <- The start address of transicition code below 4G\r
-    push   %rcx                           # save rcx to stack\r
-    mov    %rax, %rcx                     # rcx <- The size of transition piece code\r
-    rep\r
-    movsb                                 # copy transition code to (new stack - 64byte) below 4G\r
-    pop    %rcx                           # restore rcx\r
-   \r
-    mov    %r8d, %esi \r
-    mov    %r9d, %edi \r
-    mov    %r10d, %eax\r
-    sub    $4, %eax\r
-    push   %rcx                           # push Cs to stack\r
-    push   %r10                           # push address of transition code on stack  \r
-    .byte  0x48, 0xcb                     # retq: Use far return to load CS register from stack\r
-                                          # (Use raw byte code since some GNU assemblers generates incorrect code for "retq")  \r
-L1:\r
-    mov    %eax,%esp                      # set up new stack\r
-    mov    %cr0,%rax\r
-    btr    $0x1f,%eax                     # clear CR0.PG\r
-    mov    %rax,%cr0                      # disable paging\r
-\r
-    mov    %edx,%ebx                      # save EntryPoint to ebx, for rdmsr will overwrite edx\r
-    mov    $0xc0000080,%ecx\r
-    rdmsr  \r
-    and    $0xfe,%ah                      # clear LME\r
-    wrmsr  \r
-    mov    %cr4,%rax\r
-    and    $0xdf,%al                      # clear PAE\r
-    mov    %rax,%cr4\r
-    push   %rdi                           # push Context2\r
-    push   %rsi                           # push Context1\r
-    callq  *%rbx                          # transfer control to EntryPoint\r
-    jmp    .                              # no one should get here\r
-\r
-_mTransitionEnd :\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/DisablePaging64.asm b/UnixPkg/Library/UnixBaseLib/X64/DisablePaging64.asm
deleted file mode 100644 (file)
index 32dcd5a..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   DisablePaging64.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmDisablePaging64 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalX86DisablePaging64 (\r
-;   IN      UINT16                    Cs,\r
-;   IN      UINT32                    EntryPoint,\r
-;   IN      UINT32                    Context1,  OPTIONAL\r
-;   IN      UINT32                    Context2,  OPTIONAL\r
-;   IN      UINT32                    NewStack\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalX86DisablePaging64    PROC\r
-    cli\r
-    lea     rsi, @F                     ; rsi <- The start address of transition code\r
-    mov     edi, [rsp + 28h]            ; rdi <- New stack\r
-    lea     rax, mTransitionEnd         ; rax <- end of transition code\r
-    sub     rax, rsi                    ; rax <- The size of transition piece code \r
-    add     rax, 4                      ; Round RAX up to the next 4 byte boundary\r
-    and     al, 0fch\r
-    sub     rdi, rax                    ; rdi <- Use stack to hold transition code\r
-    mov     r10d, edi                   ; r10 <- The start address of transicition code below 4G\r
-    push    rcx                         ; save rcx to stack\r
-    mov     rcx, rax                    ; rcx <- The size of transition piece code\r
-    rep     movsb                       ; copy transition code to top of new stack which must be below 4GB\r
-    pop     rcx                         ; restore rcx\r
-    \r
-    mov     esi, r8d\r
-    mov     edi, r9d\r
-    mov     eax, r10d                   ; eax <- start of the transition code on the stack\r
-    sub     eax, 4                      ; eax <- One slot below transition code on the stack\r
-    push    rcx                         ; push Cs to stack\r
-    push    r10                         ; push address of tansition code on stack\r
-    DB      48h                         ; prefix to composite "retq" with next "retf"\r
-    retf                                ; Use far return to load CS register from stack\r
-\r
-; Start of transition code\r
-@@:\r
-    mov     esp, eax                    ; set up new stack\r
-    mov     rax, cr0\r
-    btr     eax, 31                     ; Clear CR0.PG\r
-    mov     cr0, rax                    ; disable paging and caches\r
-    \r
-    mov     ebx, edx                    ; save EntryPoint to rbx, for rdmsr will overwrite rdx\r
-    mov     ecx, 0c0000080h\r
-    rdmsr\r
-    and     ah, NOT 1                   ; clear LME\r
-    wrmsr\r
-    mov     rax, cr4\r
-    and     al, NOT (1 SHL 5)           ; clear PAE\r
-    mov     cr4, rax\r
-    push    rdi                         ; push Context2\r
-    push    rsi                         ; push Context1\r
-    call    rbx                         ; transfer control to EntryPoint\r
-    hlt                                 ; no one should get here\r
-InternalX86DisablePaging64    ENDP\r
-\r
-mTransitionEnd LABEL    BYTE\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/EnableCache.S b/UnixPkg/Library/UnixBaseLib/X64/EnableCache.S
deleted file mode 100644 (file)
index 9d73960..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   EnableCache.S\r
-#\r
-# Abstract:\r
-#\r
-#   Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear \r
-#   the NW bit of CR0 to 0\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# AsmEnableCache (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(AsmEnableCache)\r
-ASM_PFX(AsmEnableCache):\r
-    wbinvd\r
-    movq    %cr0, %rax\r
-    btrq    $30, %rax\r
-    btrq    $29, %rax\r
-    movq    %rax, %cr0\r
-    ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/EnableCache.asm b/UnixPkg/Library/UnixBaseLib/X64/EnableCache.asm
deleted file mode 100644 (file)
index 88b71d7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   EnableCache.Asm\r
-;\r
-; Abstract:\r
-;\r
-;  Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear \r
-;  the NW bit of CR0 to 0\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmEnableCache (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmEnableCache PROC\r
-    wbinvd\r
-    mov     rax, cr0\r
-    btr     rax, 29\r
-    btr     rax, 30\r
-    mov     cr0, rax\r
-    ret\r
-AsmEnableCache ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/EnableDisableInterrupts.S b/UnixPkg/Library/UnixBaseLib/X64/EnableDisableInterrupts.S
deleted file mode 100644 (file)
index f2ff61e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   EnableDisableInterrupts.S\r
-#\r
-# Abstract:\r
-#\r
-#   EnableDisableInterrupts function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# EnableDisableInterrupts (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(EnableDisableInterrupts)\r
-ASM_PFX(EnableDisableInterrupts):\r
-    sti\r
-    cli\r
-    ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/EnableDisableInterrupts.asm b/UnixPkg/Library/UnixBaseLib/X64/EnableDisableInterrupts.asm
deleted file mode 100644 (file)
index f6b2d9c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   EnableDisableInterrupts.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   EnableDisableInterrupts function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; EnableDisableInterrupts (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EnableDisableInterrupts PROC\r
-    sti\r
-    cli\r
-    ret\r
-EnableDisableInterrupts ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/EnableInterrupts.asm b/UnixPkg/Library/UnixBaseLib/X64/EnableInterrupts.asm
deleted file mode 100644 (file)
index e776c27..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   EnableInterrupts.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   EnableInterrupts function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; EnableInterrupts (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-EnableInterrupts    PROC\r
-    sti\r
-    ret\r
-EnableInterrupts    ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/FlushCacheLine.asm b/UnixPkg/Library/UnixBaseLib/X64/FlushCacheLine.asm
deleted file mode 100644 (file)
index e30f9a9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   FlushCacheLine.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmFlushCacheLine function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; EFIAPI \r
-; AsmFlushCacheLine (\r
-;   IN      VOID                      *LinearAddress\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmFlushCacheLine   PROC\r
-    clflush [rcx]\r
-    mov     rax, rcx\r
-    ret\r
-AsmFlushCacheLine   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/FxRestore.asm b/UnixPkg/Library/UnixBaseLib/X64/FxRestore.asm
deleted file mode 100644 (file)
index 8496331..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   FxRestore.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmFxRestore function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalX86FxRestore (\r
-;   IN CONST IA32_FX_BUFFER *Buffer\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalX86FxRestore  PROC\r
-    fxrstor [rcx]\r
-    ret\r
-InternalX86FxRestore  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/FxSave.asm b/UnixPkg/Library/UnixBaseLib/X64/FxSave.asm
deleted file mode 100644 (file)
index d41e935..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   FxSave.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmFxSave function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalX86FxSave (\r
-;   OUT IA32_FX_BUFFER *Buffer\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalX86FxSave PROC\r
-    fxsave  [rcx]\r
-    ret\r
-InternalX86FxSave ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/GccInline.c b/UnixPkg/Library/UnixBaseLib/X64/GccInline.c
deleted file mode 100644 (file)
index 731172a..0000000
+++ /dev/null
@@ -1,1801 +0,0 @@
-/** @file\r
-  GCC inline implementation of BaseLib processor specific functions.\r
-  \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-\r
-\r
-\r
-/**\r
-  Used to serialize load and store operations.\r
-\r
-  All loads and stores that proceed calls to this function are guaranteed to be\r
-  globally visible when this function returns.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-MemoryFence (\r
-  VOID\r
-  )\r
-{\r
-  // This is a little bit of overkill and it is more about the compiler that it is\r
-  // actually processor synchronization. This is like the _ReadWriteBarrier \r
-  // Microsoft specific intrinsic\r
-  __asm__ __volatile__ ("":::"memory");\r
-}\r
-\r
-\r
-/**\r
-  Enables CPU interrupts.\r
-\r
-  Enables CPU interrupts.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EnableInterrupts (\r
-  VOID\r
-  )\r
-{\r
-  __asm__ __volatile__ ("sti"::: "memory");\r
-}\r
-\r
-\r
-/**\r
-  Disables CPU interrupts.\r
-\r
-  Disables CPU interrupts.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-DisableInterrupts (\r
-  VOID\r
-  )\r
-{  \r
-  __asm__ __volatile__ ("cli"::: "memory");\r
-}\r
-\r
-\r
-\r
-\r
-/**\r
-  Requests CPU to pause for a short period of time.\r
-\r
-  Requests CPU to pause for a short period of time. Typically used in MP\r
-  systems to prevent memory starvation while waiting for a spin lock.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-CpuPause (\r
-  VOID\r
-  )\r
-{\r
-  __asm__ __volatile__ ("pause");\r
-}\r
-\r
-\r
-/**\r
-  Generates a breakpoint on the CPU.\r
-\r
-  Generates a breakpoint on the CPU. The breakpoint must be implemented such\r
-  that code can resume normal execution after the breakpoint.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-CpuBreakpoint (\r
-  VOID\r
-  )\r
-{\r
-  __asm__ __volatile__ ("int $3");\r
-}\r
-\r
-\r
-\r
-/**\r
-  Returns a 64-bit Machine Specific Register(MSR).\r
-\r
-  Reads and returns the 64-bit MSR specified by Index. No parameter checking is\r
-  performed on Index, and some Index values may cause CPU exceptions. The\r
-  caller must either guarantee that Index is valid, or the caller must set up\r
-  exception handlers to catch the exceptions. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @param  Index The 32-bit MSR index to read.\r
-\r
-  @return The value of the MSR identified by Index.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMsr64 (\r
-  IN      UINT32                    Index\r
-  )\r
-{\r
-  UINT32 LowData;\r
-  UINT32 HighData;\r
-  \r
-  __asm__ __volatile__ (\r
-    "rdmsr"\r
-    : "=a" (LowData),   // %0\r
-      "=d" (HighData)   // %1\r
-    : "c"  (Index)      // %2\r
-    );\r
-    \r
-  return (((UINT64)HighData) << 32) | LowData;\r
-}\r
-\r
-/**\r
-  Writes a 64-bit value to a Machine Specific Register(MSR), and returns the\r
-  value.\r
-\r
-  Writes the 64-bit value specified by Value to the MSR specified by Index. The\r
-  64-bit value written to the MSR is returned. No parameter checking is\r
-  performed on Index or Value, and some of these may cause CPU exceptions. The\r
-  caller must either guarantee that Index and Value are valid, or the caller\r
-  must establish proper exception handlers. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @param  Index The 32-bit MSR index to write.\r
-  @param  Value The 64-bit value to write to the MSR.\r
-\r
-  @return Value\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmWriteMsr64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  UINT32 LowData;\r
-  UINT32 HighData;\r
-\r
-  LowData  = (UINT32)(Value);\r
-  HighData = (UINT32)(Value >> 32);\r
-  \r
-  __asm__ __volatile__ (\r
-    "wrmsr"\r
-    :\r
-    : "c" (Index),\r
-      "a" (LowData),\r
-      "d" (HighData)\r
-    );\r
-    \r
-  return Value;\r
-}\r
-\r
-\r
-\r
-/**\r
-  Reads the current value of the EFLAGS register.\r
-\r
-  Reads and returns the current value of the EFLAGS register. This function is\r
-  only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a\r
-  64-bit value on X64.\r
-\r
-  @return EFLAGS on IA-32 or RFLAGS on X64.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadEflags (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Eflags;\r
-  \r
-  __asm__ __volatile__ (\r
-    "pushfq         \n\t"\r
-    "pop     %0         "\r
-    : "=r" (Eflags)       // %0\r
-    );\r
-    \r
-  return Eflags;\r
-}\r
-\r
-\r
-\r
-/**\r
-  Reads the current value of the Control Register 0 (CR0).\r
-\r
-  Reads and returns the current value of CR0. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of the Control Register 0 (CR0).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadCr0 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN   Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%cr0,%0" \r
-    : "=r" (Data)           // %0\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of the Control Register 2 (CR2).\r
-\r
-  Reads and returns the current value of CR2. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of the Control Register 2 (CR2).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadCr2 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%cr2,  %0" \r
-    : "=r" (Data)           // %0\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-/**\r
-  Reads the current value of the Control Register 3 (CR3).\r
-\r
-  Reads and returns the current value of CR3. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of the Control Register 3 (CR3).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadCr3 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%cr3,  %0" \r
-    : "=r" (Data)           // %0\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of the Control Register 4 (CR4).\r
-\r
-  Reads and returns the current value of CR4. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of the Control Register 4 (CR4).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadCr4 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%cr4,  %0" \r
-    : "=r" (Data)           // %0\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Control Register 0 (CR0).\r
-\r
-  Writes and returns a new value to CR0. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Cr0 The value to write to CR0.\r
-\r
-  @return The value written to CR0.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteCr0 (\r
-  UINTN  Cr0\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%cr0"\r
-    :\r
-    : "r" (Cr0)\r
-    );\r
-  return Cr0;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Control Register 2 (CR2).\r
-\r
-  Writes and returns a new value to CR2. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Cr2 The value to write to CR2.\r
-\r
-  @return The value written to CR2.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteCr2 (\r
-  UINTN  Cr2\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%cr2"\r
-    :\r
-    : "r" (Cr2)\r
-    );\r
-  return Cr2;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Control Register 3 (CR3).\r
-\r
-  Writes and returns a new value to CR3. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Cr3 The value to write to CR3.\r
-\r
-  @return The value written to CR3.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteCr3 (\r
-  UINTN  Cr3\r
-  )\r
-{\r
-  return Cr3;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Control Register 4 (CR4).\r
-\r
-  Writes and returns a new value to CR4. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Cr4 The value to write to CR4.\r
-\r
-  @return The value written to CR4.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteCr4 (\r
-  UINTN  Cr4\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%cr4"\r
-    :\r
-    : "r" (Cr4)\r
-    );\r
-  return Cr4;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 0 (DR0).\r
-\r
-  Reads and returns the current value of DR0. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 0 (DR0).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr0 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr0, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 1 (DR1).\r
-\r
-  Reads and returns the current value of DR1. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 1 (DR1).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr1 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr1, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 2 (DR2).\r
-\r
-  Reads and returns the current value of DR2. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 2 (DR2).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr2 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr2, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 3 (DR3).\r
-\r
-  Reads and returns the current value of DR3. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 3 (DR3).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr3 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr3, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 4 (DR4).\r
-\r
-  Reads and returns the current value of DR4. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 4 (DR4).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr4 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr4, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 5 (DR5).\r
-\r
-  Reads and returns the current value of DR5. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 5 (DR5).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr5 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr5, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 6 (DR6).\r
-\r
-  Reads and returns the current value of DR6. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 6 (DR6).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr6 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr6, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Debug Register 7 (DR7).\r
-\r
-  Reads and returns the current value of DR7. This function is only available\r
-  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
-  X64.\r
-\r
-  @return The value of Debug Register 7 (DR7).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmReadDr7 (\r
-  VOID\r
-  )\r
-{\r
-  UINTN Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%dr7, %0"\r
-    : "=r" (Data)\r
-    );\r
-  \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 0 (DR0).\r
-\r
-  Writes and returns a new value to DR0. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr0 The value to write to Dr0.\r
-\r
-  @return The value written to Debug Register 0 (DR0).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr0 (\r
-  UINTN  Dr0\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr0"\r
-    :\r
-    : "r" (Dr0)\r
-    );\r
-  return Dr0;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 1 (DR1).\r
-\r
-  Writes and returns a new value to DR1. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr1 The value to write to Dr1.\r
-\r
-  @return The value written to Debug Register 1 (DR1).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr1 (\r
-  UINTN  Dr1\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr1"\r
-    :\r
-    : "r" (Dr1)\r
-    );\r
-  return Dr1;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 2 (DR2).\r
-\r
-  Writes and returns a new value to DR2. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr2 The value to write to Dr2.\r
-\r
-  @return The value written to Debug Register 2 (DR2).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr2 (\r
-  UINTN  Dr2\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr2"\r
-    :\r
-    : "r" (Dr2)\r
-    );\r
-  return Dr2;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 3 (DR3).\r
-\r
-  Writes and returns a new value to DR3. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr3 The value to write to Dr3.\r
-\r
-  @return The value written to Debug Register 3 (DR3).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr3 (\r
-  UINTN  Dr3\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr3"\r
-    :\r
-    : "r" (Dr3)\r
-    );\r
-  return Dr3;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 4 (DR4).\r
-\r
-  Writes and returns a new value to DR4. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr4 The value to write to Dr4.\r
-\r
-  @return The value written to Debug Register 4 (DR4).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr4 (\r
-  UINTN  Dr4\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr4"\r
-    :\r
-    : "r" (Dr4)\r
-    );\r
-  return Dr4;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 5 (DR5).\r
-\r
-  Writes and returns a new value to DR5. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr5 The value to write to Dr5.\r
-\r
-  @return The value written to Debug Register 5 (DR5).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr5 (\r
-  UINTN  Dr5\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr5"\r
-    :\r
-    : "r" (Dr5)\r
-    );\r
-  return Dr5;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 6 (DR6).\r
-\r
-  Writes and returns a new value to DR6. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr6 The value to write to Dr6.\r
-\r
-  @return The value written to Debug Register 6 (DR6).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr6 (\r
-  UINTN  Dr6\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr6"\r
-    :\r
-    : "r" (Dr6)\r
-    );\r
-  return Dr6;\r
-}\r
-\r
-\r
-/**\r
-  Writes a value to Debug Register 7 (DR7).\r
-\r
-  Writes and returns a new value to DR7. This function is only available on\r
-  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
-\r
-  @param  Dr7 The value to write to Dr7.\r
-\r
-  @return The value written to Debug Register 7 (DR7).\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmWriteDr7 (\r
-  UINTN  Dr7\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mov  %0, %%dr7"\r
-    :\r
-    : "r" (Dr7)\r
-    );\r
-  return Dr7;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Code Segment Register (CS).\r
-\r
-  Reads and returns the current value of CS. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @return The current value of CS.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadCs (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov   %%cs, %0"\r
-    :"=a" (Data)\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Data Segment Register (DS).\r
-\r
-  Reads and returns the current value of DS. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @return The current value of DS.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadDs (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%ds, %0"\r
-    :"=a" (Data)\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Extra Segment Register (ES).\r
-\r
-  Reads and returns the current value of ES. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @return The current value of ES.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadEs (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%es, %0"\r
-    :"=a" (Data)\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of FS Data Segment Register (FS).\r
-\r
-  Reads and returns the current value of FS. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @return The current value of FS.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadFs (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%fs, %0"\r
-    :"=a" (Data)\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of GS Data Segment Register (GS).\r
-\r
-  Reads and returns the current value of GS. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @return The current value of GS.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadGs (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%gs, %0"\r
-    :"=a" (Data)\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Stack Segment Register (SS).\r
-\r
-  Reads and returns the current value of SS. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @return The current value of SS.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadSs (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "mov  %%ds, %0"\r
-    :"=a" (Data)\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Task Register (TR).\r
-\r
-  Reads and returns the current value of TR. This function is only available on\r
-  IA-32 and X64.\r
-\r
-  @return The current value of TR.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadTr (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "str  %0"\r
-    : "=r" (Data)\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current Global Descriptor Table Register(GDTR) descriptor.\r
-\r
-  Reads and returns the current GDTR descriptor and returns it in Gdtr. This\r
-  function is only available on IA-32 and X64.\r
-\r
-  @param  Gdtr  The pointer to a GDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86ReadGdtr (\r
-  OUT     IA32_DESCRIPTOR           *Gdtr\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "sgdt %0"\r
-    : "=m" (*Gdtr)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current Global Descriptor Table Register (GDTR) descriptor.\r
-\r
-  Writes and the current GDTR descriptor specified by Gdtr. This function is\r
-  only available on IA-32 and X64.\r
-\r
-  @param  Gdtr  The pointer to a GDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86WriteGdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Gdtr\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "lgdt %0"\r
-    :\r
-    : "m" (*Gdtr)\r
-    );\r
-    \r
-}\r
-\r
-\r
-/**\r
-  Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
-\r
-  Reads and returns the current IDTR descriptor and returns it in Idtr. This\r
-  function is only available on IA-32 and X64.\r
-\r
-  @param  Idtr  The pointer to a IDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86ReadIdtr (\r
-  OUT     IA32_DESCRIPTOR           *Idtr\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "sidt  %0"\r
-    : "=m" (*Idtr)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
-\r
-  Writes the current IDTR descriptor and returns it in Idtr. This function is\r
-  only available on IA-32 and X64.\r
-\r
-  @param  Idtr  The pointer to a IDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86WriteIdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Idtr\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "lidt %0"\r
-    :\r
-    : "m" (*Idtr)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Reads the current Local Descriptor Table Register(LDTR) selector.\r
-\r
-  Reads and returns the current 16-bit LDTR descriptor value. This function is\r
-  only available on IA-32 and X64.\r
-\r
-  @return The current selector of LDT.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-AsmReadLdtr (\r
-  VOID\r
-  )\r
-{\r
-  UINT16  Data;\r
-  \r
-  __asm__ __volatile__ (\r
-    "sldt  %0"\r
-    : "=g" (Data)   // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Writes the current Local Descriptor Table Register (GDTR) selector.\r
-\r
-  Writes and the current LDTR descriptor specified by Ldtr. This function is\r
-  only available on IA-32 and X64.\r
-\r
-  @param  Ldtr  16-bit LDTR selector value.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteLdtr (\r
-  IN      UINT16                    Ldtr\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "lldtw  %0"\r
-    :\r
-    : "g" (Ldtr)   // %0\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Save the current floating point/SSE/SSE2 context to a buffer.\r
-\r
-  Saves the current floating point/SSE/SSE2 state to the buffer specified by\r
-  Buffer. Buffer must be aligned on a 16-byte boundary. This function is only\r
-  available on IA-32 and X64.\r
-\r
-  @param  Buffer  The pointer to a buffer to save the floating point/SSE/SSE2 context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86FxSave (\r
-  OUT     IA32_FX_BUFFER            *Buffer\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "fxsave %0"\r
-    :\r
-    : "m" (*Buffer)  // %0\r
-    );    \r
-}\r
-\r
-\r
-/**\r
-  Restores the current floating point/SSE/SSE2 context from a buffer.\r
-\r
-  Restores the current floating point/SSE/SSE2 state from the buffer specified\r
-  by Buffer. Buffer must be aligned on a 16-byte boundary. This function is\r
-  only available on IA-32 and X64.\r
-\r
-  @param  Buffer  The pointer to a buffer to save the floating point/SSE/SSE2 context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86FxRestore (\r
-  IN      CONST IA32_FX_BUFFER      *Buffer\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "fxrstor %0"\r
-    :\r
-    : "m" (*Buffer)  // %0\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #0 (MM0).\r
-\r
-  Reads and returns the current value of MM0. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM0.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm0 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd   %%mm0,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #1 (MM1).\r
-\r
-  Reads and returns the current value of MM1. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM1.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm1 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd   %%mm1,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #2 (MM2).\r
-\r
-  Reads and returns the current value of MM2. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM2.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm2 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd  %%mm2,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #3 (MM3).\r
-\r
-  Reads and returns the current value of MM3. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM3.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm3 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd  %%mm3,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #4 (MM4).\r
-\r
-  Reads and returns the current value of MM4. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM4.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm4 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd  %%mm4,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #5 (MM5).\r
-\r
-  Reads and returns the current value of MM5. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM5.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm5 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd  %%mm5,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #6 (MM6).\r
-\r
-  Reads and returns the current value of MM6. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM6.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm6 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd  %%mm6,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of 64-bit MMX Register #7 (MM7).\r
-\r
-  Reads and returns the current value of MM7. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of MM7.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMm7 (\r
-  VOID\r
-  )\r
-{\r
-  UINT64  Data;\r
-\r
-  __asm__ __volatile__ (\r
-    "movd  %%mm7,  %0    \n\t"\r
-    : "=r"  (Data)       // %0\r
-    );\r
-    \r
-  return Data;\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #0 (MM0).\r
-\r
-  Writes the current value of MM0. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM0.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm0 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm0"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #1 (MM1).\r
-\r
-  Writes the current value of MM1. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM1.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm1 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm1"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #2 (MM2).\r
-\r
-  Writes the current value of MM2. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM2.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm2 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm2"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #3 (MM3).\r
-\r
-  Writes the current value of MM3. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM3.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm3 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm3"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #4 (MM4).\r
-\r
-  Writes the current value of MM4. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM4.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm4 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm4"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #5 (MM5).\r
-\r
-  Writes the current value of MM5. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM5.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm5 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm5"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #6 (MM6).\r
-\r
-  Writes the current value of MM6. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM6.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm6 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm6"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Writes the current value of 64-bit MMX Register #7 (MM7).\r
-\r
-  Writes the current value of MM7. This function is only available on IA32 and\r
-  X64.\r
-\r
-  @param  Value The 64-bit value to write to MM7.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteMm7 (\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "movd  %0, %%mm7"  // %0\r
-    :  \r
-    : "m" (Value)\r
-    );\r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of Time Stamp Counter (TSC).\r
-\r
-  Reads and returns the current value of TSC. This function is only available\r
-  on IA-32 and X64.\r
-\r
-  @return The current value of TSC\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadTsc (\r
-  VOID\r
-  )\r
-{\r
-  UINT32  LowData;\r
-  UINT32  HiData;\r
-  \r
-  __asm__ __volatile__ (\r
-    "rdtsc"\r
-    : "=a" (LowData),\r
-      "=d" (HiData)\r
-    );\r
-  \r
-  return (((UINT64)HiData) << 32) | LowData;  \r
-}\r
-\r
-\r
-/**\r
-  Reads the current value of a Performance Counter (PMC).\r
-\r
-  Reads and returns the current value of performance counter specified by\r
-  Index. This function is only available on IA-32 and X64.\r
-\r
-  @param  Index The 32-bit Performance Counter index to read.\r
-\r
-  @return The value of the PMC specified by Index.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadPmc (\r
-  IN      UINT32                    Index\r
-  )\r
-{\r
-  UINT32  LowData;\r
-  UINT32  HiData;\r
-  \r
-  __asm__ __volatile__ (\r
-    "rdpmc"\r
-    : "=a" (LowData),\r
-      "=d" (HiData)\r
-    : "c"  (Index)\r
-    );\r
-  \r
-  return (((UINT64)HiData) << 32) | LowData;  \r
-}\r
-\r
-\r
-/**\r
-  Sets up a monitor buffer that is used by AsmMwait().\r
-\r
-  Executes a MONITOR instruction with the register state specified by Eax, Ecx\r
-  and Edx. Returns Eax. This function is only available on IA-32 and X64.\r
-\r
-  @param  Eax The value to load into EAX or RAX before executing the MONITOR\r
-              instruction.\r
-  @param  Ecx The value to load into ECX or RCX before executing the MONITOR\r
-              instruction.\r
-  @param  Edx The value to load into EDX or RDX before executing the MONITOR\r
-              instruction.\r
-\r
-  @return Eax\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmMonitor (\r
-  IN      UINTN                     Eax,\r
-  IN      UINTN                     Ecx,\r
-  IN      UINTN                     Edx\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "monitor"\r
-    :\r
-    : "a" (Eax),\r
-      "c" (Ecx),\r
-      "d" (Edx)\r
-    );\r
-    \r
-  return Eax;\r
-}\r
-\r
-\r
-/**\r
-  Executes an MWAIT instruction.\r
-\r
-  Executes an MWAIT instruction with the register state specified by Eax and\r
-  Ecx. Returns Eax. This function is only available on IA-32 and X64.\r
-\r
-  @param  Eax The value to load into EAX or RAX before executing the MONITOR\r
-              instruction.\r
-  @param  Ecx The value to load into ECX or RCX before executing the MONITOR\r
-              instruction.\r
-\r
-  @return Eax\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsmMwait (\r
-  IN      UINTN                     Eax,\r
-  IN      UINTN                     Ecx\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "mwait"\r
-    : \r
-    : "a"  (Eax),\r
-      "c"  (Ecx)\r
-    );\r
-    \r
-  return Eax;    \r
-}\r
-\r
-\r
-/**\r
-  Executes a WBINVD instruction.\r
-\r
-  Executes a WBINVD instruction. This function is only available on IA-32 and\r
-  X64.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWbinvd (\r
-  VOID\r
-  )\r
-{\r
-  __asm__ __volatile__ ("wbinvd":::"memory");\r
-}\r
-\r
-\r
-/**\r
-  Executes a INVD instruction.\r
-\r
-  Executes a INVD instruction. This function is only available on IA-32 and\r
-  X64.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmInvd (\r
-  VOID\r
-  )\r
-{\r
-  __asm__ __volatile__ ("invd":::"memory");\r
-    \r
-}\r
-\r
-\r
-/**\r
-  Flushes a cache line from all the instruction and data caches within the\r
-  coherency domain of the CPU.\r
-\r
-  Flushed the cache line specified by LinearAddress, and returns LinearAddress.\r
-  This function is only available on IA-32 and X64.\r
-\r
-  @param  LinearAddress The address of the cache line to flush. If the CPU is\r
-                        in a physical addressing mode, then LinearAddress is a\r
-                        physical address. If the CPU is in a virtual\r
-                        addressing mode, then LinearAddress is a virtual\r
-                        address.\r
-\r
-  @return LinearAddress\r
-**/\r
-VOID *\r
-EFIAPI\r
-AsmFlushCacheLine (\r
-  IN      VOID                      *LinearAddress\r
-  )\r
-{\r
-  __asm__ __volatile__ (\r
-    "clflush (%0)"\r
-    :\r
-    : "r" (LinearAddress) \r
-    : "memory"\r
-    );\r
-    \r
-    return LinearAddress;\r
-}\r
-\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Invd.asm b/UnixPkg/Library/UnixBaseLib/X64/Invd.asm
deleted file mode 100644 (file)
index ed6f95d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   Invd.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmInvd function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmInvd (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmInvd PROC\r
-    invd\r
-    ret\r
-AsmInvd ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/LongJump.S b/UnixPkg/Library/UnixBaseLib/X64/LongJump.S
deleted file mode 100644 (file)
index f20446f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   LongJump.S\r
-#\r
-# Abstract:\r
-#\r
-#   Implementation of _LongJump() on x64.\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# InternalLongJump (\r
-#   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
-#   IN      UINTN                     Value\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalLongJump)\r
-ASM_PFX(InternalLongJump):\r
-    mov     (%rcx), %rbx\r
-    mov     0x8(%rcx), %rsp\r
-    mov     0x10(%rcx), %rbp\r
-    mov     0x18(%rcx), %rdi\r
-    mov     0x20(%rcx), %rsi\r
-    mov     0x28(%rcx), %r12\r
-    mov     0x30(%rcx), %r13\r
-    mov     0x38(%rcx), %r14\r
-    mov     0x40(%rcx), %r15\r
-    # load non-volatile fp registers\r
-    ldmxcsr 0x50(%rcx)\r
-    movdqu  0x58(%rcx), %xmm6\r
-    movdqu  0x68(%rcx), %xmm7\r
-    movdqu  0x78(%rcx), %xmm8\r
-    movdqu  0x88(%rcx), %xmm9\r
-    movdqu  0x98(%rcx), %xmm10\r
-    movdqu  0xA8(%rcx), %xmm11\r
-    movdqu  0xB8(%rcx), %xmm12\r
-    movdqu  0xC8(%rcx), %xmm13\r
-    movdqu  0xD8(%rcx), %xmm14\r
-    movdqu  0xE8(%rcx), %xmm15  \r
-    mov     %rdx, %rax          # set return value\r
-    jmp     *0x48(%rcx)\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/LongJump.asm b/UnixPkg/Library/UnixBaseLib/X64/LongJump.asm
deleted file mode 100644 (file)
index eaf32ea..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   LongJump.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   Implementation of _LongJump() on x64.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalLongJump (\r
-;   IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
-;   IN      UINTN                     Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalLongJump    PROC\r
-    mov     rbx, [rcx]\r
-    mov     rsp, [rcx + 8]\r
-    mov     rbp, [rcx + 10h]\r
-    mov     rdi, [rcx + 18h]\r
-    mov     rsi, [rcx + 20h]\r
-    mov     r12, [rcx + 28h]\r
-    mov     r13, [rcx + 30h]\r
-    mov     r14, [rcx + 38h]\r
-    mov     r15, [rcx + 40h]\r
-    ; load non-volatile fp registers\r
-    ldmxcsr [rcx + 50h]\r
-    movdqu  xmm6,  [rcx + 58h]\r
-    movdqu  xmm7,  [rcx + 68h]\r
-    movdqu  xmm8,  [rcx + 78h]\r
-    movdqu  xmm9,  [rcx + 88h]\r
-    movdqu  xmm10, [rcx + 98h]\r
-    movdqu  xmm11, [rcx + 0A8h]\r
-    movdqu  xmm12, [rcx + 0B8h]\r
-    movdqu  xmm13, [rcx + 0C8h]\r
-    movdqu  xmm14, [rcx + 0D8h]\r
-    movdqu  xmm15, [rcx + 0E8h]\r
-    mov     rax, rdx               ; set return value\r
-    jmp     qword ptr [rcx + 48h]\r
-InternalLongJump    ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Monitor.asm b/UnixPkg/Library/UnixBaseLib/X64/Monitor.asm
deleted file mode 100644 (file)
index 8ae6e73..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   Monitor.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmMonitor function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmMonitor (\r
-;   IN      UINTN                     Eax,\r
-;   IN      UINTN                     Ecx,\r
-;   IN      UINTN                     Edx\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmMonitor  PROC\r
-    mov     eax, ecx\r
-    mov     ecx, edx\r
-    mov     edx, r8d\r
-    DB      0fh, 1, 0c8h                ; monitor\r
-    ret\r
-AsmMonitor  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Mwait.asm b/UnixPkg/Library/UnixBaseLib/X64/Mwait.asm
deleted file mode 100644 (file)
index 02ec863..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   Mwait.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmMwait function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmMwait (\r
-;   IN      UINTN                     Eax,\r
-;   IN      UINTN                     Ecx\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmMwait    PROC\r
-    mov     eax, ecx\r
-    mov     ecx, edx\r
-    DB      0fh, 1, 0c9h                ; mwait\r
-    ret\r
-AsmMwait    ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Non-existing.c b/UnixPkg/Library/UnixBaseLib/X64/Non-existing.c
deleted file mode 100644 (file)
index 5ceb64b..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/** @file\r
-  Non-existing BaseLib functions on x64\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-\r
-/**\r
-  Enables the 32-bit paging mode on the CPU.\r
-\r
-  Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
-  must be properly initialized prior to calling this service. This function\r
-  assumes the current execution mode is 32-bit protected mode. This function is\r
-  only available on IA-32. After the 32-bit paging mode is enabled, control is\r
-  transferred to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  There are a number of constraints that must be followed before calling this\r
-  function:\r
-  1)  Interrupts must be disabled.\r
-  2)  The caller must be in 32-bit protected mode with flat descriptors. This\r
-      means all descriptors must have a base of 0 and a limit of 4GB.\r
-  3)  CR0 and CR4 must be compatible with 32-bit protected mode with flat\r
-      descriptors.\r
-  4)  CR3 must point to valid page tables that will be used once the transition\r
-      is complete, and those page tables must guarantee that the pages for this\r
-      function and the stack are identity mapped.\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack after\r
-                      paging is enabled.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function as the first parameter after paging is enabled.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function as the second parameter after paging is enabled.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function after paging is enabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86EnablePaging32 (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  )\r
-{\r
-  //\r
-  // This function cannot work on x64 platform\r
-  //\r
-  ASSERT (FALSE);\r
-}\r
-\r
-/**\r
-  Disables the 32-bit paging mode on the CPU.\r
-\r
-  Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r
-  mode. This function assumes the current execution mode is 32-paged protected\r
-  mode. This function is only available on IA-32. After the 32-bit paging mode\r
-  is disabled, control is transferred to the function specified by EntryPoint\r
-  using the new stack specified by NewStack and passing in the parameters\r
-  specified by Context1 and Context2. Context1 and Context2 are optional and\r
-  may be NULL. The function EntryPoint must never return.\r
-\r
-  There are a number of constraints that must be followed before calling this\r
-  function:\r
-  1)  Interrupts must be disabled.\r
-  2)  The caller must be in 32-bit paged mode.\r
-  3)  CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r
-  4)  CR3 must point to valid page tables that guarantee that the pages for\r
-      this function and the stack are identity mapped.\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack after\r
-                      paging is disabled.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function as the first parameter after paging is disabled.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function as the second parameter after paging is\r
-                      disabled.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function after paging is disabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86DisablePaging32 (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  )\r
-{\r
-  //\r
-  // This function cannot work on x64 platform\r
-  //\r
-  ASSERT (FALSE);\r
-}\r
-\r
-\r
-/**\r
-  Enables the 64-bit paging mode on the CPU.\r
-\r
-  Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
-  must be properly initialized prior to calling this service. This function\r
-  assumes the current execution mode is 32-bit protected mode with flat\r
-  descriptors. This function is only available on IA-32. After the 64-bit\r
-  paging mode is enabled, control is transferred to the function specified by\r
-  EntryPoint using the new stack specified by NewStack and passing in the\r
-  parameters specified by Context1 and Context2. Context1 and Context2 are\r
-  optional and may be 0. The function EntryPoint must never return.\r
-\r
-  @param  Cs          The 16-bit selector to load in the CS before EntryPoint\r
-                      is called. The descriptor in the GDT that this selector\r
-                      references must be setup for long mode.\r
-  @param  EntryPoint  The 64-bit virtual address of the function to call with\r
-                      the new stack after paging is enabled.\r
-  @param  Context1    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the first parameter after\r
-                      paging is enabled.\r
-  @param  Context2    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the second parameter after\r
-                      paging is enabled.\r
-  @param  NewStack    The 64-bit virtual address of the new stack to use for\r
-                      the EntryPoint function after paging is enabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalX86EnablePaging64 (\r
-  IN      UINT16                    Cs,\r
-  IN      UINT64                    EntryPoint,\r
-  IN      UINT64                    Context1,  OPTIONAL\r
-  IN      UINT64                    Context2,  OPTIONAL\r
-  IN      UINT64                    NewStack\r
-  )\r
-{\r
-  //\r
-  // This function cannot work on x64 platform.\r
-  //\r
-  ASSERT (FALSE);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadCr0.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadCr0.asm
deleted file mode 100644 (file)
index c3ff5b0..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadCr0.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadCr0 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadCr0 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadCr0  PROC\r
-    mov     rax, cr0\r
-    ret\r
-AsmReadCr0  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadCr2.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadCr2.asm
deleted file mode 100644 (file)
index f1473b9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadCr2.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadCr2 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadCr2 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadCr2  PROC\r
-    mov     rax, cr2\r
-    ret\r
-AsmReadCr2  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadCr3.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadCr3.asm
deleted file mode 100644 (file)
index 432468e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadCr3.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadCr3 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadCr3 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadCr3  PROC\r
-    mov     rax, cr3\r
-    ret\r
-AsmReadCr3  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadCr4.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadCr4.asm
deleted file mode 100644 (file)
index 17d4499..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadCr4.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadCr4 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadCr4 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadCr4  PROC\r
-    mov     rax, cr4\r
-    ret\r
-AsmReadCr4  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadCs.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadCs.asm
deleted file mode 100644 (file)
index ac3040c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadCs.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadCs function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadCs (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadCs   PROC\r
-    mov     eax, cs\r
-    ret\r
-AsmReadCs   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr0.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr0.asm
deleted file mode 100644 (file)
index 8ac85ad..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr0.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr0 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr0 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr0  PROC\r
-    mov     rax, dr0\r
-    ret\r
-AsmReadDr0  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr1.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr1.asm
deleted file mode 100644 (file)
index 8b042e2..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr1.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr1 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr1 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr1  PROC\r
-    mov     rax, dr1\r
-    ret\r
-AsmReadDr1  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr2.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr2.asm
deleted file mode 100644 (file)
index 9361756..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr2.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr2 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr2 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr2  PROC\r
-    mov     rax, dr2\r
-    ret\r
-AsmReadDr2  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr3.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr3.asm
deleted file mode 100644 (file)
index a25fc9d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr3.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr3 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr3 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr3  PROC\r
-    mov     rax, dr3\r
-    ret\r
-AsmReadDr3  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr4.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr4.asm
deleted file mode 100644 (file)
index dc6c5e9..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr4.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr4 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr4 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr4  PROC\r
-    ;\r
-    ; There's no obvious reason to access this register, since it's aliased to\r
-    ; DR7 when DE=0 or an exception generated when DE=1\r
-    ;\r
-    DB      0fh, 21h, 0e0h\r
-    ret\r
-AsmReadDr4  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr5.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr5.asm
deleted file mode 100644 (file)
index 7e31352..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr5.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr5 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr5 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr5  PROC\r
-    ;\r
-    ; There's no obvious reason to access this register, since it's aliased to\r
-    ; DR7 when DE=0 or an exception generated when DE=1\r
-    ;\r
-    DB      0fh, 21h, 0e8h\r
-    ret\r
-AsmReadDr5  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr6.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr6.asm
deleted file mode 100644 (file)
index ee6b9ec..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr6.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr6 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr6 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr6  PROC\r
-    mov     rax, dr6\r
-    ret\r
-AsmReadDr6  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDr7.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDr7.asm
deleted file mode 100644 (file)
index 7173057..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDr7.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDr7 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadDr7 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDr7  PROC\r
-    mov     rax, dr7\r
-    ret\r
-AsmReadDr7  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadDs.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadDs.asm
deleted file mode 100644 (file)
index d67512c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadDs.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadDs function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadDs (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadDs   PROC\r
-    mov     eax, ds\r
-    ret\r
-AsmReadDs   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadEflags.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadEflags.asm
deleted file mode 100644 (file)
index b3ecc7c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadEflags.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadEflags function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmReadEflags (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadEflags   PROC\r
-    pushfq\r
-    pop     rax\r
-    ret\r
-AsmReadEflags   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadEs.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadEs.asm
deleted file mode 100644 (file)
index 76cffdc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadEs.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadEs function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadEs (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadEs   PROC\r
-    mov     eax, es\r
-    ret\r
-AsmReadEs   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadFs.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadFs.asm
deleted file mode 100644 (file)
index e91aa14..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadFs.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadFs function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadFs (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadFs   PROC\r
-    mov     eax, fs\r
-    ret\r
-AsmReadFs   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadGdtr.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadGdtr.asm
deleted file mode 100644 (file)
index ebc60bd..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadGdtr.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadGdtr function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalX86ReadGdtr (\r
-;   OUT IA32_DESCRIPTOR  *Gdtr\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalX86ReadGdtr   PROC\r
-    sgdt    fword ptr [rcx]\r
-    ret\r
-InternalX86ReadGdtr   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadGs.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadGs.asm
deleted file mode 100644 (file)
index f185c38..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadGs.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadGs function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadGs (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadGs   PROC\r
-    mov     eax, gs\r
-    ret\r
-AsmReadGs   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadIdtr.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadIdtr.asm
deleted file mode 100644 (file)
index 4d53feb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadIdtr.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadIdtr function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalX86ReadIdtr (\r
-;   OUT     IA32_DESCRIPTOR           *Idtr\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalX86ReadIdtr   PROC\r
-    sidt    fword ptr [rcx]\r
-    ret\r
-InternalX86ReadIdtr   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadLdtr.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadLdtr.asm
deleted file mode 100644 (file)
index dbe517e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadLdtr.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadLdtr function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadLdtr (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadLdtr PROC\r
-    sldt    eax\r
-    ret\r
-AsmReadLdtr ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm0.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm0.asm
deleted file mode 100644 (file)
index 99212c7..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm0.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm0 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm0 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm0  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0c0h\r
-    ret\r
-AsmReadMm0  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm1.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm1.asm
deleted file mode 100644 (file)
index 7a9ae7c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm1.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm1 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm1 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm1  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0c8h\r
-    ret\r
-AsmReadMm1  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm2.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm2.asm
deleted file mode 100644 (file)
index 337ac73..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm2.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm2 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm2 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm2  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0d0h\r
-    ret\r
-AsmReadMm2  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm3.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm3.asm
deleted file mode 100644 (file)
index 266e29a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm3.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm3 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm3 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm3  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0d8h\r
-    ret\r
-AsmReadMm3  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm4.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm4.asm
deleted file mode 100644 (file)
index 9cc7435..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm4.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm4 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm4 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm4  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0e0h\r
-    ret\r
-AsmReadMm4  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm5.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm5.asm
deleted file mode 100644 (file)
index b665225..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm5.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm5 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm5 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm5  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0e8h\r
-    ret\r
-AsmReadMm5  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm6.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm6.asm
deleted file mode 100644 (file)
index 1e3ebc5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm6.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm6 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm6 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm6  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0f0h\r
-    ret\r
-AsmReadMm6  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMm7.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMm7.asm
deleted file mode 100644 (file)
index 8228672..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMm7.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMm7 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMm7 (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMm7  PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 7eh, 0f8h\r
-    ret\r
-AsmReadMm7  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMsr64.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadMsr64.asm
deleted file mode 100644 (file)
index 878ed18..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadMsr64.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadMsr64 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadMsr64 (\r
-;   IN UINT32  Index\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadMsr64    PROC\r
-    rdmsr                               ; edx & eax are zero extended\r
-    shl     rdx, 20h\r
-    or      rax, rdx\r
-    ret\r
-AsmReadMsr64    ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadMsr64.c b/UnixPkg/Library/UnixBaseLib/X64/ReadMsr64.c
deleted file mode 100644 (file)
index 343e924..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  CpuBreakpoint function.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-/**\r
-  Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.\r
-**/\r
-\r
-unsigned __int64 __readmsr (int register);\r
-\r
-#pragma intrinsic(__readmsr)\r
-\r
-/**\r
-  Read data to MSR.\r
-\r
-  @param  Index                Register index of MSR.\r
-\r
-  @return Value read from MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmReadMsr64 (\r
-  IN UINT32  Index\r
-  )\r
-{\r
-  return __readmsr (Index);\r
-}\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadPmc.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadPmc.asm
deleted file mode 100644 (file)
index 1b74f67..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadPmc.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadPmc function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadPmc (\r
-;   IN UINT32   PmcIndex\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadPmc  PROC\r
-    rdpmc\r
-    shl     rdx, 20h\r
-    or      rax, rdx\r
-    ret\r
-AsmReadPmc  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadSs.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadSs.asm
deleted file mode 100644 (file)
index 8f308c4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadSs.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadSs function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadSs (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadSs   PROC\r
-    mov     eax, ss\r
-    ret\r
-AsmReadSs   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadTr.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadTr.asm
deleted file mode 100644 (file)
index a114f53..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadTr.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadTr function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT16\r
-; EFIAPI\r
-; AsmReadTr (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadTr   PROC\r
-    str     eax\r
-    ret\r
-AsmReadTr   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/ReadTsc.asm b/UnixPkg/Library/UnixBaseLib/X64/ReadTsc.asm
deleted file mode 100644 (file)
index d792bfb..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   ReadTsc.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmReadTsc function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmReadTsc (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmReadTsc  PROC\r
-    rdtsc\r
-    shl     rdx, 20h\r
-    or      rax, rdx\r
-    ret\r
-AsmReadTsc  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/SetJump.S b/UnixPkg/Library/UnixBaseLib/X64/SetJump.S
deleted file mode 100644 (file)
index ea9e225..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   SetJump.S\r
-#\r
-# Abstract:\r
-#\r
-#   Implementation of SetJump() on x86_64\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(SetJump)\r
-ASM_PFX(SetJump):\r
-    push   %rcx\r
-    add    $0xffffffffffffffe0,%rsp\r
-    call   ASM_PFX(InternalAssertJumpBuffer)\r
-    add    $0x20,%rsp\r
-    pop    %rcx\r
-    pop    %rdx\r
-    mov    %rbx,(%rcx)\r
-    mov    %rsp,0x8(%rcx)\r
-    mov    %rbp,0x10(%rcx)\r
-    mov    %rdi,0x18(%rcx)\r
-    mov    %rsi,0x20(%rcx)\r
-    mov    %r12,0x28(%rcx)\r
-    mov    %r13,0x30(%rcx)\r
-    mov    %r14,0x38(%rcx)\r
-    mov    %r15,0x40(%rcx)\r
-    mov    %rdx,0x48(%rcx)\r
-    # save non-volatile fp registers\r
-    stmxcsr 0x50(%rcx)\r
-    movdqu  %xmm6, 0x58(%rcx) \r
-    movdqu  %xmm7, 0x68(%rcx)\r
-    movdqu  %xmm8, 0x78(%rcx)\r
-    movdqu  %xmm9, 0x88(%rcx)\r
-    movdqu  %xmm10, 0x98(%rcx)\r
-    movdqu  %xmm11, 0xA8(%rcx)\r
-    movdqu  %xmm12, 0xB8(%rcx)\r
-    movdqu  %xmm13, 0xC8(%rcx)\r
-    movdqu  %xmm14, 0xD8(%rcx)\r
-    movdqu  %xmm15, 0xE8(%rcx)     \r
-    xor    %rax,%rax\r
-    jmpq   *%rdx\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/SetJump.asm b/UnixPkg/Library/UnixBaseLib/X64/SetJump.asm
deleted file mode 100644 (file)
index efdbb9a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   SetJump.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   Implementation of SetJump() on x64.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-EXTERNDEF   InternalAssertJumpBuffer:PROC\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; SetJump (\r
-;   OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
-;   );\r
-;------------------------------------------------------------------------------\r
-SetJump     PROC\r
-    push    rcx\r
-    add     rsp, -20h\r
-    call    InternalAssertJumpBuffer\r
-    add     rsp, 20h\r
-    pop     rcx\r
-    pop     rdx\r
-    mov     [rcx], rbx\r
-    mov     [rcx + 8], rsp\r
-    mov     [rcx + 10h], rbp\r
-    mov     [rcx + 18h], rdi\r
-    mov     [rcx + 20h], rsi\r
-    mov     [rcx + 28h], r12\r
-    mov     [rcx + 30h], r13\r
-    mov     [rcx + 38h], r14\r
-    mov     [rcx + 40h], r15\r
-    mov     [rcx + 48h], rdx\r
-    ; save non-volatile fp registers\r
-    stmxcsr [rcx + 50h]\r
-    movdqu  [rcx + 58h], xmm6\r
-    movdqu  [rcx + 68h], xmm7\r
-    movdqu  [rcx + 78h], xmm8\r
-    movdqu  [rcx + 88h], xmm9\r
-    movdqu  [rcx + 98h], xmm10\r
-    movdqu  [rcx + 0A8h], xmm11\r
-    movdqu  [rcx + 0B8h], xmm12\r
-    movdqu  [rcx + 0C8h], xmm13\r
-    movdqu  [rcx + 0D8h], xmm14\r
-    movdqu  [rcx + 0E8h], xmm15\r
-    xor     rax, rax\r
-    jmp     rdx\r
-SetJump     ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S b/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.S
deleted file mode 100644 (file)
index fd7ba6e..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   SwitchStack.S\r
-#\r
-# Abstract:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# Routine Description:\r
-#\r
-#   Routine for switching stacks with 2 parameters\r
-#\r
-# Arguments:\r
-#\r
-#   (rcx) EntryPoint    - Entry point with new stack.\r
-#   (rdx) Context1      - Parameter1 for entry point.\r
-#   (r8)  Context2      - Parameter2 for entry point.\r
-#   (r9)  NewStack      - The pointer to new stack.\r
-#\r
-# Returns:\r
-#\r
-#   None\r
-#\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(InternalSwitchStack)\r
-ASM_PFX(InternalSwitchStack):\r
-    movq    %rcx, %rax\r
-    movq    %rdx, %rcx\r
-    movq    %r8,  %rdx\r
-    #\r
-    # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,\r
-    # in case the callee wishes to spill them.\r
-    #\r
-    lea     -0x20(%r9), %rsp\r
-    call    *%rax\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.asm b/UnixPkg/Library/UnixBaseLib/X64/SwitchStack.asm
deleted file mode 100644 (file)
index 0f802b0..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   SwitchStack.Asm\r
-;\r
-; Abstract:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; Routine Description:\r
-;\r
-;   Routine for switching stacks with 2 parameters\r
-;\r
-; Arguments:\r
-;\r
-;   (rcx) EntryPoint    - Entry point with new stack.\r
-;   (rdx) Context1      - Parameter1 for entry point.\r
-;   (r8)  Context2      - Parameter2 for entry point.\r
-;   (r9)  NewStack      - The pointer to new stack.\r
-;\r
-; Returns:\r
-;\r
-;   None\r
-;\r
-;------------------------------------------------------------------------------\r
-InternalSwitchStack PROC\r
-    mov     rax, rcx\r
-    mov     rcx, rdx\r
-    mov     rdx, r8\r
-    ;\r
-    ; Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,\r
-    ; in case the callee wishes to spill them.\r
-    ;\r
-    lea     rsp, [r9 - 20h]\r
-    call    rax\r
-InternalSwitchStack ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Thunk16.S b/UnixPkg/Library/UnixBaseLib/X64/Thunk16.S
deleted file mode 100644 (file)
index 0ec71cd..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   Thunk16.S\r
-#\r
-# Abstract:\r
-#\r
-#   Real mode thunk\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#include <Library/BaseLib.h>\r
-\r
-ASM_GLOBAL ASM_PFX(m16Start)\r
-ASM_GLOBAL ASM_PFX(m16Size)\r
-ASM_GLOBAL ASM_PFX(mThunk16Attr)\r
-ASM_GLOBAL ASM_PFX(m16Gdt)\r
-ASM_GLOBAL ASM_PFX(m16GdtrBase)\r
-ASM_GLOBAL ASM_PFX(mTransition)\r
-ASM_GLOBAL ASM_PFX(InternalAsmThunk16)\r
-\r
-# define the structure of IA32_REGS\r
-#define  _EDI  0       // size 4\r
-#define  _ESI  4       // size 4\r
-#define  _EBP  8       // size 4\r
-#define  _ESP  12      // size 4\r
-#define  _EBX  16      // size 4\r
-#define  _EDX  20      // size 4\r
-#define  _ECX  24      // size 4\r
-#define  _EAX  28      // size 4\r
-#define  _DS   32      // size 2\r
-#define  _ES   34      // size 2\r
-#define  _FS   36      // size 2\r
-#define  _GS   38      // size 2\r
-#define  _EFLAGS  40   // size 8\r
-#define  _EIP  48      // size 4\r
-#define  _CS  52       // size 2\r
-#define  _SS  54       // size 2\r
-#define  IA32_REGS_SIZE  56\r
-\r
-    .data\r
-\r
-.set L_m16SizeSym,      ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)\r
-.set L_mThunk16AttrSym, _ThunkAttr - ASM_PFX(m16Start)\r
-.set L_m16GdtSym,       ASM_PFX(NullSeg) - ASM_PFX(m16Start)\r
-.set L_m16GdtrBaseSym,  _16GdtrBase - ASM_PFX(m16Start)\r
-.set L_mTransitionSym,  _EntryPoint - ASM_PFX(m16Start)\r
-\r
-ASM_PFX(m16Size):         .word      L_m16SizeSym\r
-ASM_PFX(mThunk16Attr):    .word      L_mThunk16AttrSym\r
-ASM_PFX(m16Gdt):          .word      L_m16GdtSym\r
-ASM_PFX(m16GdtrBase):     .word      L_m16GdtrBaseSym\r
-ASM_PFX(mTransition):     .word      L_mTransitionSym\r
-\r
-    .text\r
-\r
-ASM_PFX(m16Start):\r
-\r
-SavedGdt:    .space 10\r
-\r
-#------------------------------------------------------------------------------\r
-# _BackFromUserCode() takes control in real mode after 'retf' has been executed\r
-# by user code. It will be shadowed to somewhere in memory below 1MB.\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(BackFromUserCode)\r
-ASM_PFX(BackFromUserCode):\r
-    #\r
-    # The order of saved registers on the stack matches the order they appears\r
-    # in IA32_REGS structure. This facilitates wrapper function to extract them\r
-    # into that structure.\r
-    #\r
-    # Some instructions for manipulation of segment registers have to be written\r
-    # in opcode since 64-bit MASM prevents accesses to those registers.\r
-    #\r
-    .byte 0x16                          # push ss\r
-    .byte 0xe                           # push cs\r
-    .byte 0x66\r
-    call    L_Base                       # push eip\r
-L_Base: \r
-    .byte 0x66\r
-    pushq   $0                          # reserved high order 32 bits of EFlags\r
-    .byte 0x66, 0x9c                    # pushfd actually\r
-    cli                                 # disable interrupts\r
-    push    %gs\r
-    push    %fs\r
-    .byte 6                             # push es\r
-    .byte 0x1e                          # push ds\r
-    .byte 0x66,0x60                     # pushad\r
-    .byte 0x66,0xba                     # mov edx, imm32\r
-_ThunkAttr:  .space  4\r
-    testb   $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl\r
-    jz      L_1\r
-    movl    $0x15cd2401,%eax            # mov ax, 2401h & int 15h\r
-    cli                                 # disable interrupts\r
-    jnc     L_2\r
-L_1: \r
-    testb   $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl\r
-    jz      L_2\r
-    inb     $0x92,%al\r
-    orb     $2,%al\r
-    outb    %al, $0x92                   # deactivate A20M#\r
-L_2: \r
-    movw    %ss,%ax\r
-    lea     IA32_REGS_SIZE(%esp), %bp\r
-    #\r
-    # rsi in the following 2 instructions is indeed bp in 16-bit code\r
-    #\r
-    movw    %bp, (_ESP - IA32_REGS_SIZE)(%rsi)\r
-    .byte 0x66\r
-    movl    (_EIP - IA32_REGS_SIZE)(%rsi), %ebx\r
-    shlw    $4,%ax                      # shl eax, 4\r
-    addw    %ax,%bp                     # add ebp, eax\r
-    movw    %cs,%ax\r
-    shlw    $4,%ax\r
-    lea     (L_64BitCode - L_Base)(%ebx, %eax), %ax\r
-    .byte 0x66,0x2e,0x89,0x87           # mov cs:[bx + (L_64Eip - L_Base)], eax\r
-.set EipOffset,  L_64Eip - L_Base\r
-    .word   EipOffset\r
-    .byte 0x66,0xb8                     # mov eax, imm32\r
-SavedCr4:   .space  4\r
-    movq    %rax, %cr4\r
-    #\r
-    # rdi in the instruction below is indeed bx in 16-bit code\r
-    #\r
-    .byte 0x66,0x2e                     # 2eh is "cs:" segment override\r
-    lgdt    (SavedGdt - L_Base)(%rdi)\r
-    .byte 0x66\r
-    movl    $0xc0000080,%ecx\r
-    rdmsr\r
-    orb     $1,%ah\r
-    wrmsr\r
-    .byte 0x66,0xb8                     # mov eax, imm32\r
-SavedCr0:    .space      4\r
-    movq    %rax, %cr0\r
-    .byte 0x66,0xea                     # jmp far cs:L_64Bit\r
-L_64Eip:     .space      4\r
-SavedCs:     .space      2\r
-L_64BitCode: \r
-    .byte   0x90\r
-    .byte   0x67,0xbc                  # mov esp, imm32\r
-SavedSp:    .space 4                   # restore stack\r
-    nop\r
-    ret\r
-\r
-_EntryPoint: .long      ASM_PFX(ToUserCode) - ASM_PFX(m16Start)\r
-             .word      CODE16\r
-_16Gdtr:     .word      L_GDT_SIZE - 1\r
-_16GdtrBase: .quad      ASM_PFX(NullSeg)\r
-_16Idtr:     .word      0x3ff\r
-             .long      0\r
-\r
-#------------------------------------------------------------------------------\r
-# _ToUserCode() takes control in real mode before passing control to user code.\r
-# It will be shadowed to somewhere in memory below 1MB.\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(ToUserCode)\r
-ASM_PFX(ToUserCode):\r
-    movl    %edx,%ss                    # set new segment selectors\r
-    movl    %edx,%ds\r
-    movl    %edx,%es\r
-    movl    %edx,%fs\r
-    movl    %edx,%gs\r
-    .byte 0x66\r
-    movl    $0xc0000080,%ecx\r
-    movq    %rax, %cr0\r
-    rdmsr\r
-    andb    $0xfe, %ah                  # $0b11111110\r
-    wrmsr\r
-    movq    %rbp, %cr4\r
-    movl    %esi,%ss                    # set up 16-bit stack segment\r
-    movw    %bx,%sp                     # set up 16-bit stack pointer\r
-    .byte 0x66                          # make the following call 32-bit\r
-    call    L_Base1                       # push eip\r
-L_Base1: \r
-    popw    %bp                         # ebp <- address of L_Base1\r
-    pushq   (IA32_REGS_SIZE + 2)(%esp)\r
-    lea     0x0c(%rsi), %eax\r
-    pushq   %rax\r
-    lret                                # execution begins at next instruction\r
-L_RealMode: \r
-    .byte 0x66,0x2e                     # CS and operand size override\r
-    lidt    (_16Idtr - L_Base1)(%rsi)\r
-    .byte 0x66,0x61                     # popad\r
-    .byte 0x1f                          # pop ds\r
-    .byte 0x7                           # pop es\r
-    .byte 0x0f, 0xa1                    # pop fs\r
-    .byte 0x0f, 0xa9                    # pop gs\r
-    .byte 0x66, 0x9d                    # popfd\r
-    leaw    4(%esp),%sp                 # skip high order 32 bits of EFlags\r
-    .byte 0x66                          # make the following retf 32-bit\r
-    lret                                # transfer control to user code\r
-\r
-.set  CODE16,  ASM_PFX(_16Code) - .\r
-.set  DATA16,  ASM_PFX(_16Data) - .\r
-.set  DATA32,  ASM_PFX(_32Data) - .\r
-\r
-ASM_PFX(NullSeg):   .quad      0\r
-ASM_PFX(_16Code):\r
-            .word -1\r
-            .word 0\r
-            .byte 0\r
-            .byte 0x9b\r
-            .byte 0x8f                  # 16-bit segment, 4GB limit\r
-            .byte 0\r
-ASM_PFX(_16Data):\r
-            .word -1\r
-            .word 0\r
-            .byte 0\r
-            .byte 0x93\r
-            .byte 0x8f                  # 16-bit segment, 4GB limit\r
-            .byte 0\r
-ASM_PFX(_32Data):\r
-            .word -1\r
-            .word 0\r
-            .byte 0\r
-            .byte 0x93\r
-            .byte 0xcf                  # 16-bit segment, 4GB limit\r
-            .byte 0\r
-\r
-.set  L_GDT_SIZE, . - ASM_PFX(NullSeg)\r
-\r
-#------------------------------------------------------------------------------\r
-# IA32_REGISTER_SET *\r
-# EFIAPI\r
-# InternalAsmThunk16 (\r
-#   IN      IA32_REGISTER_SET         *RegisterSet,\r
-#   IN OUT  VOID                      *Transition\r
-#   );\r
-#------------------------------------------------------------------------------\r
-\r
-ASM_GLOBAL ASM_PFX(InternalAsmThunk16)\r
-ASM_PFX(InternalAsmThunk16):\r
-    pushq   %rbp\r
-    pushq   %rbx\r
-    pushq   %rsi\r
-    pushq   %rdi\r
-    \r
-    movl    %ds, %ebx\r
-    pushq   %rbx      # Save ds segment register on the stack\r
-    movl    %es, %ebx\r
-    pushq   %rbx      # Save es segment register on the stack\r
-    movl    %ss, %ebx\r
-    pushq   %rbx      # Save ss segment register on the stack\r
-\r
-    .byte   0x0f, 0xa0                  #push   fs\r
-    .byte   0x0f, 0xa8                  #push   gs\r
-    movq    %rcx, %rsi\r
-    movzwl  _SS(%rsi), %r8d\r
-    movl    _ESP(%rsi), %edi\r
-    lea     -(IA32_REGS_SIZE + 4)(%edi), %rdi\r
-    imul    $16, %r8d, %eax \r
-    movl    %edi,%ebx                   # ebx <- stack for 16-bit code\r
-    pushq   $(IA32_REGS_SIZE / 4)\r
-    addl    %eax,%edi                   # edi <- linear address of 16-bit stack\r
-    popq    %rcx\r
-    rep\r
-    movsl                               # copy RegSet\r
-    lea     (SavedCr4 - ASM_PFX(m16Start))(%rdx), %ecx\r
-    movl    %edx,%eax                   # eax <- transition code address\r
-    andl    $0xf,%edx\r
-    shll    $12,%eax                    # segment address in high order 16 bits\r
-    lea     (ASM_PFX(BackFromUserCode) - ASM_PFX(m16Start))(%rdx), %ax\r
-    stosl                               # [edi] <- return address of user code\r
-    sgdt    0x60(%rsp)                  # save GDT stack in argument space\r
-    movzwq  0x60(%rsp), %r10            # r10 <- GDT limit \r
-    lea     ((ASM_PFX(InternalAsmThunk16) - SavedCr4) + 0xf)(%rcx), %r11 \r
-    andq    $0xfffffffffffffff0, %r11   # r11 <- 16-byte aligned shadowed GDT table in real mode buffer      \r
-    \r
-    movw    %r10w, (SavedGdt - SavedCr4)(%rcx)       # save the limit of shadowed GDT table\r
-    movq    %r11, (SavedGdt - SavedCr4 + 0x2)(%rcx)  # save the base address of shadowed GDT table\r
-    \r
-    movq    0x62(%rsp) ,%rsi            # rsi <- the original GDT base address\r
-    xchg   %r10, %rcx                   # save rcx to r10 and initialize rcx to be the limit of GDT table \r
-    incq   %rcx                         # rcx <- the size of memory to copy\r
-    xchg   %r11, %rdi                   # save rdi to r11 and initialize rdi to the base address of shadowed GDT table\r
-    rep\r
-    movsb                               # perform memory copy to shadow GDT table\r
-    movq   %r10, %rcx                   # restore the orignal rcx before memory copy\r
-    movq   %r11, %rdi                   # restore the original rdi before memory copy\r
-       \r
-    sidt    0x50(%rsp)\r
-    movq    %cr0, %rax\r
-    movl    %eax, (SavedCr0 - SavedCr4)(%rcx)\r
-    andl    $0x7ffffffe,%eax            # clear PE, PG bits\r
-    movq    %cr4, %rbp\r
-    movl    %ebp, (%rcx)                # save CR4 in SavedCr4\r
-    andl    $0x300,%ebp                 # clear all but PCE and OSFXSR bits\r
-    movl    %r8d, %esi                  # esi <- 16-bit stack segment\r
-    .byte      0x6a, DATA32\r
-    popq    %rdx\r
-    lgdt    (_16Gdtr - SavedCr4)(%rcx)\r
-    movl    %edx,%ss\r
-    pushfq\r
-    lea     -8(%rdx), %edx\r
-    lea     L_RetFromRealMode(%rip), %r8\r
-    pushq   %r8\r
-    movl    %cs, %r8d\r
-    movw    %r8w, (SavedCs - SavedCr4)(%rcx)\r
-    movl    %esp, (SavedSp - SavedCr4)(%rcx)\r
-    .byte   0xff, 0x69                  #  jmp (_EntryPoint - SavedCr4)(%rcx)\r
-.set EntryPointSavedCr4Offset, _EntryPoint - SavedCr4\r
-    .byte   EntryPointSavedCr4Offset\r
-L_RetFromRealMode: \r
-    popfq\r
-    lgdt    0x60(%rsp)                  # restore protected mode GDTR\r
-    lidt    0x50(%rsp)                  # restore protected mode IDTR\r
-    lea     -IA32_REGS_SIZE(%rbp), %eax\r
-    .byte 0x0f, 0xa9                    # pop gs\r
-    .byte 0x0f, 0xa1                    # pop fs\r
-    \r
-    popq     %rbx\r
-    movl     %ebx, %ss\r
-    popq     %rbx\r
-    movl     %ebx, %es\r
-    popq     %rbx\r
-    movl     %ebx, %ds\r
-    \r
-    popq    %rdi\r
-    popq    %rsi\r
-    popq    %rbx\r
-    popq    %rbp\r
-\r
-    ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm b/UnixPkg/Library/UnixBaseLib/X64/Thunk16.asm
deleted file mode 100644 (file)
index 829df1c..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-\r
-#include "BaseLibInternals.h"\r
-\r
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   Thunk.asm\r
-;\r
-; Abstract:\r
-;\r
-;   Real mode thunk\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-EXTERNDEF   m16Start:BYTE\r
-EXTERNDEF   m16Size:WORD\r
-EXTERNDEF   mThunk16Attr:WORD\r
-EXTERNDEF   m16Gdt:WORD\r
-EXTERNDEF   m16GdtrBase:WORD\r
-EXTERNDEF   mTransition:WORD\r
-\r
-IA32_REGS   STRUC   4t\r
-_EDI        DD      ?\r
-_ESI        DD      ?\r
-_EBP        DD      ?\r
-_ESP        DD      ?\r
-_EBX        DD      ?\r
-_EDX        DD      ?\r
-_ECX        DD      ?\r
-_EAX        DD      ?\r
-_DS         DW      ?\r
-_ES         DW      ?\r
-_FS         DW      ?\r
-_GS         DW      ?\r
-_EFLAGS     DQ      ?\r
-_EIP        DD      ?\r
-_CS         DW      ?\r
-_SS         DW      ?\r
-IA32_REGS   ENDS\r
-\r
-    .const\r
-\r
-m16Size         DW      InternalAsmThunk16 - m16Start\r
-mThunk16Attr    DW      _ThunkAttr - m16Start\r
-m16Gdt          DW      _NullSeg - m16Start\r
-m16GdtrBase     DW      _16GdtrBase - m16Start\r
-mTransition     DW      _EntryPoint - m16Start\r
-\r
-    .code\r
-\r
-m16Start    LABEL   BYTE\r
-\r
-SavedGdt    LABEL   FWORD\r
-            DW      ?\r
-            DQ      ?\r
-\r
-;------------------------------------------------------------------------------\r
-; _BackFromUserCode() takes control in real mode after 'retf' has been executed\r
-; by user code. It will be shadowed to somewhere in memory below 1MB.\r
-;------------------------------------------------------------------------------\r
-_BackFromUserCode   PROC\r
-    ;\r
-    ; The order of saved registers on the stack matches the order they appears\r
-    ; in IA32_REGS structure. This facilitates wrapper function to extract them\r
-    ; into that structure.\r
-    ;\r
-    ; Some instructions for manipulation of segment registers have to be written\r
-    ; in opcode since 64-bit MASM prevents accesses to those registers.\r
-    ;\r
-    DB      16h                         ; push ss\r
-    DB      0eh                         ; push cs\r
-    DB      66h\r
-    call    @Base                       ; push eip\r
-@Base:\r
-    DB      66h\r
-    push    0                           ; reserved high order 32 bits of EFlags\r
-    pushf                               ; pushfd actually\r
-    cli                                 ; disable interrupts\r
-    push    gs\r
-    push    fs\r
-    DB      6                           ; push es\r
-    DB      1eh                         ; push ds\r
-    DB      66h, 60h                    ; pushad\r
-    DB      66h, 0bah                   ; mov edx, imm32\r
-_ThunkAttr  DD      ?\r
-    test    dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15\r
-    jz      @1\r
-    mov     eax, 15cd2401h              ; mov ax, 2401h & int 15h\r
-    cli                                 ; disable interrupts\r
-    jnc     @2\r
-@1:\r
-    test    dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL\r
-    jz      @2\r
-    in      al, 92h\r
-    or      al, 2\r
-    out     92h, al                     ; deactivate A20M#\r
-@2:\r
-    mov     ax, ss\r
-    lea     bp, [esp + sizeof (IA32_REGS)]\r
-    ;\r
-    ; rsi in the following 2 instructions is indeed bp in 16-bit code\r
-    ;\r
-    mov     word ptr (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._ESP, bp\r
-    DB      66h\r
-    mov     ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP\r
-    shl     ax, 4                       ; shl eax, 4\r
-    add     bp, ax                      ; add ebp, eax\r
-    mov     ax, cs\r
-    shl     ax, 4\r
-    lea     ax, [eax + ebx + (@64BitCode - @Base)]\r
-    DB      66h, 2eh, 89h, 87h          ; mov cs:[bx + (@64Eip - @Base)], eax\r
-    DW      @64Eip - @Base\r
-    DB      66h, 0b8h                   ; mov eax, imm32\r
-SavedCr4    DD      ?\r
-    mov     cr4, rax\r
-    ;\r
-    ; rdi in the instruction below is indeed bx in 16-bit code\r
-    ;\r
-    DB      66h, 2eh                    ; 2eh is "cs:" segment override\r
-    lgdt    fword ptr [rdi + (SavedGdt - @Base)]\r
-    DB      66h\r
-    mov     ecx, 0c0000080h\r
-    rdmsr\r
-    or      ah, 1\r
-    wrmsr\r
-    DB      66h, 0b8h                   ; mov eax, imm32\r
-SavedCr0    DD      ?\r
-    mov     cr0, rax\r
-    DB      66h, 0eah                   ; jmp far cs:@64Bit\r
-@64Eip      DD      ?\r
-SavedCs     DW      ?\r
-@64BitCode:\r
-    db      090h \r
-    db      067h, 0bch                 ; mov esp, imm32\r
-SavedSp     DD   ?                     ; restore stack\r
-    nop\r
-    ret\r
-_BackFromUserCode   ENDP\r
-\r
-_EntryPoint DD      _ToUserCode - m16Start\r
-            DW      CODE16\r
-_16Gdtr     LABEL   FWORD\r
-            DW      GDT_SIZE - 1\r
-_16GdtrBase DQ      _NullSeg\r
-_16Idtr     FWORD   (1 SHL 10) - 1\r
-\r
-;------------------------------------------------------------------------------\r
-; _ToUserCode() takes control in real mode before passing control to user code.\r
-; It will be shadowed to somewhere in memory below 1MB.\r
-;------------------------------------------------------------------------------\r
-_ToUserCode PROC\r
-    mov     ss, edx                     ; set new segment selectors\r
-    mov     ds, edx\r
-    mov     es, edx\r
-    mov     fs, edx\r
-    mov     gs, edx\r
-    DB      66h\r
-    mov     ecx, 0c0000080h\r
-    mov     cr0, rax                    ; real mode starts at next instruction\r
-    rdmsr\r
-    and     ah, NOT 1\r
-    wrmsr\r
-    mov     cr4, rbp\r
-    mov     ss, esi                     ; set up 16-bit stack segment\r
-    mov     sp, bx                      ; set up 16-bit stack pointer\r
-    DB      66h                         ; make the following call 32-bit\r
-    call    @Base                       ; push eip\r
-@Base:\r
-    pop     bp                          ; ebp <- address of @Base\r
-    push    [esp + sizeof (IA32_REGS) + 2]\r
-    lea     eax, [rsi + (@RealMode - @Base)]    ; rsi is "bp" in 16-bit code\r
-    push    rax\r
-    retf                                ; execution begins at next instruction\r
-@RealMode:\r
-    DB      66h, 2eh                    ; CS and operand size override\r
-    lidt    fword ptr [rsi + (_16Idtr - @Base)]\r
-    DB      66h, 61h                    ; popad\r
-    DB      1fh                         ; pop ds\r
-    DB      07h                         ; pop es\r
-    pop     fs\r
-    pop     gs\r
-    popf                                ; popfd\r
-    lea     sp, [esp + 4]               ; skip high order 32 bits of EFlags\r
-    DB      66h                         ; make the following retf 32-bit\r
-    retf                                ; transfer control to user code\r
-_ToUserCode ENDP\r
-\r
-CODE16  = _16Code - $\r
-DATA16  = _16Data - $\r
-DATA32  = _32Data - $\r
-\r
-_NullSeg    DQ      0\r
-_16Code     LABEL   QWORD\r
-            DW      -1\r
-            DW      0\r
-            DB      0\r
-            DB      9bh\r
-            DB      8fh                 ; 16-bit segment, 4GB limit\r
-            DB      0\r
-_16Data     LABEL   QWORD\r
-            DW      -1\r
-            DW      0\r
-            DB      0\r
-            DB      93h\r
-            DB      8fh                 ; 16-bit segment, 4GB limit\r
-            DB      0\r
-_32Data     LABEL   QWORD\r
-            DW      -1\r
-            DW      0\r
-            DB      0\r
-            DB      93h\r
-            DB      0cfh                ; 16-bit segment, 4GB limit\r
-            DB      0\r
-\r
-GDT_SIZE = $ - _NullSeg\r
-\r
-;------------------------------------------------------------------------------\r
-; IA32_REGISTER_SET *\r
-; EFIAPI\r
-; InternalAsmThunk16 (\r
-;   IN      IA32_REGISTER_SET         *RegisterSet,\r
-;   IN OUT  VOID                      *Transition\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalAsmThunk16  PROC    USES    rbp rbx rsi rdi\r
-    mov     rbx, ds\r
-    push    rbx          ; Save ds segment register on the stack\r
-    mov     rbx, es\r
-    push    rbx          ; Save es segment register on the stack\r
-    mov     rbx, ss\r
-    push    rbx          ; Save ss segment register on the stack\r
-    \r
-    push    fs\r
-    push    gs\r
-    mov     rsi, rcx\r
-    movzx   r8d, (IA32_REGS ptr [rsi])._SS\r
-    mov     edi, (IA32_REGS ptr [rsi])._ESP\r
-    lea     rdi, [edi - (sizeof (IA32_REGS) + 4)]\r
-    imul    eax, r8d, 16                ; eax <- r8d(stack segment) * 16\r
-    mov     ebx, edi                    ; ebx <- stack for 16-bit code\r
-    push    sizeof (IA32_REGS) / 4\r
-    add     edi, eax                    ; edi <- linear address of 16-bit stack\r
-    pop     rcx\r
-    rep     movsd                       ; copy RegSet\r
-    lea     ecx, [rdx + (SavedCr4 - m16Start)]\r
-    mov     eax, edx                    ; eax <- transition code address\r
-    and     edx, 0fh\r
-    shl     eax, 12                     ; segment address in high order 16 bits\r
-    lea     ax, [rdx + (_BackFromUserCode - m16Start)]  ; offset address\r
-    stosd                               ; [edi] <- return address of user code\r
-  \r
-    sgdt    fword ptr [rsp + 60h]       ; save GDT stack in argument space\r
-    movzx   r10, word ptr [rsp + 60h]   ; r10 <- GDT limit \r
-    lea     r11, [rcx + (InternalAsmThunk16 - SavedCr4) + 0xf]\r
-    and     r11, 0xfffffff0             ; r11 <- 16-byte aligned shadowed GDT table in real mode buffer\r
-    \r
-    mov     word ptr [rcx + (SavedGdt - SavedCr4)], r10w      ; save the limit of shadowed GDT table\r
-    mov     qword ptr [rcx + (SavedGdt - SavedCr4) + 2], r11  ; save the base address of shadowed GDT table\r
-    \r
-    mov     rsi, qword ptr [rsp + 62h]  ; rsi <- the original GDT base address\r
-    xchg    rcx, r10                    ; save rcx to r10 and initialize rcx to be the limit of GDT table\r
-    inc     rcx                         ; rcx <- the size of memory to copy\r
-    xchg    rdi, r11                    ; save rdi to r11 and initialize rdi to the base address of shadowed GDT table\r
-    rep     movsb                       ; perform memory copy to shadow GDT table\r
-    mov     rcx, r10                    ; restore the orignal rcx before memory copy\r
-    mov     rdi, r11                    ; restore the original rdi before memory copy\r
-    \r
-    sidt    fword ptr [rsp + 50h]       ; save IDT stack in argument space\r
-    mov     rax, cr0\r
-    mov     [rcx + (SavedCr0 - SavedCr4)], eax\r
-    and     eax, 7ffffffeh              ; clear PE, PG bits\r
-    mov     rbp, cr4\r
-    mov     [rcx], ebp                  ; save CR4 in SavedCr4\r
-    and     ebp, 300h                   ; clear all but PCE and OSFXSR bits\r
-    mov     esi, r8d                    ; esi <- 16-bit stack segment\r
-    DB      6ah, DATA32                 ; push DATA32\r
-    pop     rdx                         ; rdx <- 32-bit data segment selector\r
-    lgdt    fword ptr [rcx + (_16Gdtr - SavedCr4)]\r
-    mov     ss, edx\r
-    pushfq\r
-    lea     edx, [rdx + DATA16 - DATA32]\r
-    lea     r8, @RetFromRealMode\r
-    push    r8\r
-    mov     r8d, cs\r
-    mov     [rcx + (SavedCs - SavedCr4)], r8w\r
-    mov     [rcx + (SavedSp - SavedCr4)], esp\r
-    jmp     fword ptr [rcx + (_EntryPoint - SavedCr4)]\r
-@RetFromRealMode:\r
-    popfq\r
-    lgdt    fword ptr [rsp + 60h]       ; restore protected mode GDTR\r
-    lidt    fword ptr [rsp + 50h]       ; restore protected mode IDTR\r
-    lea     eax, [rbp - sizeof (IA32_REGS)]\r
-    pop     gs\r
-    pop     fs\r
-    pop     rbx\r
-    mov     ss, rbx\r
-    pop     rbx\r
-    mov     es, rbx\r
-    pop     rbx\r
-    mov     ds, rbx\r
-    ret\r
-InternalAsmThunk16  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Wbinvd.S b/UnixPkg/Library/UnixBaseLib/X64/Wbinvd.S
deleted file mode 100644 (file)
index 52702d5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   Wbinvd.S\r
-#\r
-# Abstract:\r
-#\r
-#   AsmWbinvd function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# AsmWbinvd (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(AsmWbinvd)\r
-ASM_PFX(AsmWbinvd):\r
-    wbinvd\r
-    ret\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/Wbinvd.asm b/UnixPkg/Library/UnixBaseLib/X64/Wbinvd.asm
deleted file mode 100644 (file)
index b0807e0..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   Wbinvd.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWbinvd function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWbinvd (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWbinvd   PROC\r
-    wbinvd\r
-    ret\r
-AsmWbinvd   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteCr0.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteCr0.asm
deleted file mode 100644 (file)
index 98fef9c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteCr0.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteCr0 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteCr0 (\r
-;   UINTN  Cr0\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteCr0 PROC\r
-    mov     cr0, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteCr0 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteCr2.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteCr2.asm
deleted file mode 100644 (file)
index 3d77d6a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteCr2.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteCr2 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteCr2 (\r
-;   UINTN  Cr2\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteCr2 PROC\r
-    mov     cr2, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteCr2 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteCr3.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteCr3.asm
deleted file mode 100644 (file)
index 9b39938..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteCr3.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteCr3 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteCr3 (\r
-;   UINTN  Cr3\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteCr3 PROC\r
-    mov     cr3, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteCr3 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteCr4.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteCr4.asm
deleted file mode 100644 (file)
index 1455842..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteCr4.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteCr4 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteCr4 (\r
-;   UINTN  Cr4\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteCr4 PROC\r
-    mov     cr4, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteCr4 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr0.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr0.asm
deleted file mode 100644 (file)
index dafe9ab..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr0.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr0 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr0 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr0 PROC\r
-    mov     dr0, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr0 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr1.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr1.asm
deleted file mode 100644 (file)
index 7167f5e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr1.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr1 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr1 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr1 PROC\r
-    mov     dr1, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr1 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr2.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr2.asm
deleted file mode 100644 (file)
index c14ba34..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr2.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr2 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr2 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr2 PROC\r
-    mov     dr2, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr2 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr3.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr3.asm
deleted file mode 100644 (file)
index 8873916..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr3.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr3 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr3 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr3 PROC\r
-    mov     dr3, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr3 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr4.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr4.asm
deleted file mode 100644 (file)
index 4803525..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr4.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr4 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr4 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr4 PROC\r
-    ;\r
-    ; There's no obvious reason to access this register, since it's aliased to\r
-    ; DR6 when DE=0 or an exception generated when DE=1\r
-    ;\r
-    DB      0fh, 23h, 0e1h\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr4 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr5.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr5.asm
deleted file mode 100644 (file)
index 2cdb328..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr5.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr5 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr5 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr5 PROC\r
-    ;\r
-    ; There's no obvious reason to access this register, since it's aliased to\r
-    ; DR7 when DE=0 or an exception generated when DE=1\r
-    ;\r
-    DB      0fh, 23h, 0e9h\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr5 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr6.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr6.asm
deleted file mode 100644 (file)
index 22c9c87..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr6.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr6 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr6 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr6 PROC\r
-    mov     dr6, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr6 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteDr7.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteDr7.asm
deleted file mode 100644 (file)
index b55afd3..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteDr7.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteDr7 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINTN\r
-; EFIAPI\r
-; AsmWriteDr7 (\r
-;   IN UINTN Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteDr7 PROC\r
-    mov     dr7, rcx\r
-    mov     rax, rcx\r
-    ret\r
-AsmWriteDr7 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteGdtr.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteGdtr.asm
deleted file mode 100644 (file)
index 0cc8b7a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteGdtr.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteGdtr function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalX86WriteGdtr (\r
-;   IN      CONST IA32_DESCRIPTOR     *Idtr\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalX86WriteGdtr  PROC\r
-    lgdt    fword ptr [rcx]\r
-    ret\r
-InternalX86WriteGdtr  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteIdtr.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteIdtr.asm
deleted file mode 100644 (file)
index 01ca1c0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteIdtr.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteIdtr function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; InternalX86WriteIdtr (\r
-;   IN      CONST IA32_DESCRIPTOR     *Idtr\r
-;   );\r
-;------------------------------------------------------------------------------\r
-InternalX86WriteIdtr  PROC\r
-    pushfq\r
-    cli\r
-    lidt    fword ptr [rcx]\r
-    popfq\r
-    ret\r
-InternalX86WriteIdtr  ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteLdtr.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteLdtr.asm
deleted file mode 100644 (file)
index af67863..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteLdtr.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteLdtr function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteLdtr (\r
-;   IN UINT16 Ldtr\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteLdtr    PROC\r
-    lldt    cx\r
-    ret\r
-AsmWriteLdtr    ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm0.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm0.asm
deleted file mode 100644 (file)
index f40db03..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm0.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm0 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm0 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm0 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0c1h\r
-    ret\r
-AsmWriteMm0 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm1.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm1.asm
deleted file mode 100644 (file)
index ec17208..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm1.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm1 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm1 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm1 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0c9h\r
-    ret\r
-AsmWriteMm1 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm2.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm2.asm
deleted file mode 100644 (file)
index 38c0d5e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm2.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm2 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm2 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm2 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0d1h\r
-    ret\r
-AsmWriteMm2 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm3.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm3.asm
deleted file mode 100644 (file)
index 5f5bbdd..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm3.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm3 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm3 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm3 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0d9h\r
-    ret\r
-AsmWriteMm3 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm4.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm4.asm
deleted file mode 100644 (file)
index 7f53313..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm4.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm4 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm4 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm4 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0e1h\r
-    ret\r
-AsmWriteMm4 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm5.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm5.asm
deleted file mode 100644 (file)
index ea30bc1..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm5.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm5 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm5 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm5 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0e9h\r
-    ret\r
-AsmWriteMm5 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm6.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm6.asm
deleted file mode 100644 (file)
index aa926ae..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm6.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm6 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm6 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm6 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0f1h\r
-    ret\r
-AsmWriteMm6 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMm7.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMm7.asm
deleted file mode 100644 (file)
index 652e041..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMm7.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMm7 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmWriteMm7 (\r
-;   IN UINT64   Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMm7 PROC\r
-    ;\r
-    ; 64-bit MASM doesn't support MMX instructions, so use opcode here\r
-    ;\r
-    DB      48h, 0fh, 6eh, 0f9h\r
-    ret\r
-AsmWriteMm7 ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMsr64.asm b/UnixPkg/Library/UnixBaseLib/X64/WriteMsr64.asm
deleted file mode 100644 (file)
index 19ef572..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   WriteMsr64.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   AsmWriteMsr64 function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; UINT64\r
-; EFIAPI\r
-; AsmWriteMsr64 (\r
-;   IN UINT32  Index,\r
-;   IN UINT64  Value\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmWriteMsr64   PROC\r
-    mov     rax, rdx                    ; meanwhile, rax <- return value\r
-    shr     rdx, 20h                    ; edx:eax contains the value to write\r
-    wrmsr\r
-    ret\r
-AsmWriteMsr64   ENDP\r
-\r
-    END\r
diff --git a/UnixPkg/Library/UnixBaseLib/X64/WriteMsr64.c b/UnixPkg/Library/UnixBaseLib/X64/WriteMsr64.c
deleted file mode 100644 (file)
index 58f0754..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file\r
-  CpuBreakpoint function.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-/**\r
-  Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.\r
-**/\r
-\r
-void __writemsr (unsigned long Register, unsigned __int64 Value);\r
-\r
-#pragma intrinsic(__writemsr)\r
-\r
-/**\r
-  Write data to MSR.\r
-\r
-  @param  Index                The register index of MSR.\r
-  @param  Value                Data wants to be written.\r
-\r
-  @return Value written to MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmWriteMsr64 (\r
-  IN UINT32  Index,\r
-  IN UINT64  Value\r
-  )\r
-{\r
-  __writemsr (Index, Value);\r
-  return Value;\r
-}\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86DisablePaging32.c b/UnixPkg/Library/UnixBaseLib/X86DisablePaging32.c
deleted file mode 100644 (file)
index cf14c84..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmDisablePaging32()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Disables the 32-bit paging mode on the CPU.\r
-\r
-  Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r
-  mode. This function assumes the current execution mode is 32-paged protected\r
-  mode. This function is only available on IA-32. After the 32-bit paging mode\r
-  is disabled, control is transferred to the function specified by EntryPoint\r
-  using the new stack specified by NewStack and passing in the parameters\r
-  specified by Context1 and Context2. Context1 and Context2 are optional and\r
-  may be NULL. The function EntryPoint must never return.\r
-\r
-  If the current execution mode is not 32-bit paged mode, then ASSERT().\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  There are a number of constraints that must be followed before calling this\r
-  function:\r
-  1)  Interrupts must be disabled.\r
-  2)  The caller must be in 32-bit paged mode.\r
-  3)  CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r
-  4)  CR3 must point to valid page tables that guarantee that the pages for\r
-      this function and the stack are identity mapped.\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack after\r
-                      paging is disabled.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function as the first parameter after paging is disabled.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function as the second parameter after paging is\r
-                      disabled.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function after paging is disabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmDisablePaging32 (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  )\r
-{\r
-  ASSERT (EntryPoint != NULL);\r
-  ASSERT (NewStack != NULL);\r
-  InternalX86DisablePaging32 (EntryPoint, Context1, Context2, NewStack);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86DisablePaging64.c b/UnixPkg/Library/UnixBaseLib/X86DisablePaging64.c
deleted file mode 100644 (file)
index add86cc..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmDisablePaging64()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Disables the 64-bit paging mode on the CPU.\r
-\r
-  Disables the 64-bit paging mode on the CPU and returns to 32-bit protected\r
-  mode. This function assumes the current execution mode is 64-paging mode.\r
-  This function is only available on x64. After the 64-bit paging mode is\r
-  disabled, control is transferred to the function specified by EntryPoint\r
-  using the new stack specified by NewStack and passing in the parameters\r
-  specified by Context1 and Context2. Context1 and Context2 are optional and\r
-  may be 0. The function EntryPoint must never return.\r
-\r
-  If the current execution mode is not 64-bit paged mode, then ASSERT().\r
-  If EntryPoint is 0, then ASSERT().\r
-  If NewStack is 0, then ASSERT().\r
-\r
-  @param  Cs          The 16-bit selector to load in the CS before EntryPoint\r
-                      is called. The descriptor in the GDT that this selector\r
-                      references must be setup for 32-bit protected mode.\r
-  @param  EntryPoint  The 64-bit virtual address of the function to call with\r
-                      the new stack after paging is disabled.\r
-  @param  Context1    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the first parameter after\r
-                      paging is disabled.\r
-  @param  Context2    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the second parameter after\r
-                      paging is disabled.\r
-  @param  NewStack    The 64-bit virtual address of the new stack to use for\r
-                      the EntryPoint function after paging is disabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmDisablePaging64 (\r
-  IN      UINT16                    Cs,\r
-  IN      UINT32                    EntryPoint,\r
-  IN      UINT32                    Context1,  OPTIONAL\r
-  IN      UINT32                    Context2,  OPTIONAL\r
-  IN      UINT32                    NewStack\r
-  )\r
-{\r
-  ASSERT (EntryPoint != 0);\r
-  ASSERT (NewStack != 0);\r
-  InternalX86DisablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86EnablePaging32.c b/UnixPkg/Library/UnixBaseLib/X86EnablePaging32.c
deleted file mode 100644 (file)
index cb0ea29..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmEnablePaging32()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Enables the 32-bit paging mode on the CPU.\r
-\r
-  Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
-  must be properly initialized prior to calling this service. This function\r
-  assumes the current execution mode is 32-bit protected mode. This function is\r
-  only available on IA-32. After the 32-bit paging mode is enabled, control is\r
-  transferred to the function specified by EntryPoint using the new stack\r
-  specified by NewStack and passing in the parameters specified by Context1 and\r
-  Context2. Context1 and Context2 are optional and may be NULL. The function\r
-  EntryPoint must never return.\r
-\r
-  If the current execution mode is not 32-bit protected mode, then ASSERT().\r
-  If EntryPoint is NULL, then ASSERT().\r
-  If NewStack is NULL, then ASSERT().\r
-\r
-  There are a number of constraints that must be followed before calling this\r
-  function:\r
-  1)  Interrupts must be disabled.\r
-  2)  The caller must be in 32-bit protected mode with flat descriptors. This\r
-      means all descriptors must have a base of 0 and a limit of 4GB.\r
-  3)  CR0 and CR4 must be compatible with 32-bit protected mode with flat\r
-      descriptors.\r
-  4)  CR3 must point to valid page tables that will be used once the transition\r
-      is complete, and those page tables must guarantee that the pages for this\r
-      function and the stack are identity mapped.\r
-\r
-  @param  EntryPoint  A pointer to function to call with the new stack after\r
-                      paging is enabled.\r
-  @param  Context1    A pointer to the context to pass into the EntryPoint\r
-                      function as the first parameter after paging is enabled.\r
-  @param  Context2    A pointer to the context to pass into the EntryPoint\r
-                      function as the second parameter after paging is enabled.\r
-  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
-                      function after paging is enabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmEnablePaging32 (\r
-  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
-  IN      VOID                      *Context1,  OPTIONAL\r
-  IN      VOID                      *Context2,  OPTIONAL\r
-  IN      VOID                      *NewStack\r
-  )\r
-{\r
-  ASSERT (EntryPoint != NULL);\r
-  ASSERT (NewStack != NULL);\r
-  InternalX86EnablePaging32 (EntryPoint, Context1, Context2, NewStack);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86EnablePaging64.c b/UnixPkg/Library/UnixBaseLib/X86EnablePaging64.c
deleted file mode 100644 (file)
index 28f9f27..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmEnablePaging64()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Enables the 64-bit paging mode on the CPU.\r
-\r
-  Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
-  must be properly initialized prior to calling this service. This function\r
-  assumes the current execution mode is 32-bit protected mode with flat\r
-  descriptors. This function is only available on IA-32. After the 64-bit\r
-  paging mode is enabled, control is transferred to the function specified by\r
-  EntryPoint using the new stack specified by NewStack and passing in the\r
-  parameters specified by Context1 and Context2. Context1 and Context2 are\r
-  optional and may be 0. The function EntryPoint must never return.\r
-\r
-  If the current execution mode is not 32-bit protected mode with flat\r
-  descriptors, then ASSERT().\r
-  If EntryPoint is 0, then ASSERT().\r
-  If NewStack is 0, then ASSERT().\r
-\r
-  @param  Cs          The 16-bit selector to load in the CS before EntryPoint\r
-                      is called. The descriptor in the GDT that this selector\r
-                      references must be setup for long mode.\r
-  @param  EntryPoint  The 64-bit virtual address of the function to call with\r
-                      the new stack after paging is enabled.\r
-  @param  Context1    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the first parameter after\r
-                      paging is enabled.\r
-  @param  Context2    The 64-bit virtual address of the context to pass into\r
-                      the EntryPoint function as the second parameter after\r
-                      paging is enabled.\r
-  @param  NewStack    The 64-bit virtual address of the new stack to use for\r
-                      the EntryPoint function after paging is enabled.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmEnablePaging64 (\r
-  IN      UINT16                    Cs,\r
-  IN      UINT64                    EntryPoint,\r
-  IN      UINT64                    Context1,  OPTIONAL\r
-  IN      UINT64                    Context2,  OPTIONAL\r
-  IN      UINT64                    NewStack\r
-  )\r
-{\r
-  ASSERT (EntryPoint != 0);\r
-  ASSERT (NewStack != 0);\r
-  InternalX86EnablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86FxRestore.c b/UnixPkg/Library/UnixBaseLib/X86FxRestore.c
deleted file mode 100644 (file)
index d93cc91..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmFxRestore()\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Restores the current floating point/SSE/SSE2 context from a buffer.\r
-\r
-  Restores the current floating point/SSE/SSE2 state from the buffer specified\r
-  by Buffer. Buffer must be aligned on a 16-byte boundary. This function is\r
-  only available on IA-32 and x64.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 16-byte boundary, then ASSERT().\r
-  If Buffer was not saved with AsmFxSave(), then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a buffer to save the floating point/SSE/SSE2 context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmFxRestore (\r
-  IN      CONST IA32_FX_BUFFER      *Buffer\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (0 == ((UINTN)Buffer & 0xf));\r
-\r
-  //\r
-  // Check the flag recorded by AsmFxSave()\r
-  //\r
-  ASSERT (0xAA5555AA == *(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]));\r
-\r
-  InternalX86FxRestore (Buffer);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86FxSave.c b/UnixPkg/Library/UnixBaseLib/X86FxSave.c
deleted file mode 100644 (file)
index 2dc9350..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmFxSave()\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Save the current floating point/SSE/SSE2 context to a buffer.\r
-\r
-  Saves the current floating point/SSE/SSE2 state to the buffer specified by\r
-  Buffer. Buffer must be aligned on a 16-byte boundary. This function is only\r
-  available on IA-32 and x64.\r
-\r
-  If Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 16-byte boundary, then ASSERT().\r
-\r
-  @param  Buffer  A pointer to a buffer to save the floating point/SSE/SSE2 context.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmFxSave (\r
-  OUT     IA32_FX_BUFFER            *Buffer\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (0 == ((UINTN)Buffer & 0xf));\r
-\r
-  InternalX86FxSave (Buffer);\r
-\r
-  //\r
-  // Mark one flag at end of Buffer, it will be check by AsmFxRestor()\r
-  //\r
-  *(UINT32 *) (&Buffer[sizeof (IA32_FX_BUFFER) - 4]) = 0xAA5555AA;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86GetInterruptState.c b/UnixPkg/Library/UnixBaseLib/X86GetInterruptState.c
deleted file mode 100644 (file)
index ed3f495..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file\r
-  IA-32/x64 GetInterruptState()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-\r
-/**\r
-  Retrieves the current CPU interrupt state.\r
-\r
-  Returns TRUE is interrupts are currently enabled. Otherwise\r
-  returns FALSE.\r
-\r
-  @retval TRUE  CPU interrupts are enabled.\r
-  @retval FALSE CPU interrupts are disabled.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-GetInterruptState (\r
-  VOID\r
-  )\r
-{\r
-  IA32_EFLAGS32                     EFlags;\r
-\r
-  EFlags.UintN = AsmReadEflags ();\r
-  return (BOOLEAN)(1 == EFlags.Bits.IF);\r
-}\r
-\r
-\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86MemoryFence.c b/UnixPkg/Library/UnixBaseLib/X86MemoryFence.c
deleted file mode 100644 (file)
index 77e1c5a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file\r
-  IA-32/x64 MemoryFence().\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-/**\r
-  Used to serialize load and store operations.\r
-\r
-  All loads and stores that proceed calls to this function are guaranteed to be\r
-  globally visible when this function returns.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-MemoryFence (\r
-  VOID\r
-  )\r
-{\r
-  return;\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86Msr.c b/UnixPkg/Library/UnixBaseLib/X86Msr.c
deleted file mode 100644 (file)
index 6a6bd9e..0000000
+++ /dev/null
@@ -1,650 +0,0 @@
-/** @file\r
-  IA-32/x64 MSR functions.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-\r
-/**\r
-  Returns the lower 32-bits of a Machine Specific Register(MSR).\r
-\r
-  Reads and returns the lower 32-bits of the MSR specified by Index.\r
-  No parameter checking is performed on Index, and some Index values may cause\r
-  CPU exceptions. The caller must either guarantee that Index is valid, or the\r
-  caller must set up exception handlers to catch the exceptions. This function\r
-  is only available on IA-32 and x64.\r
-\r
-  @param  Index The 32-bit MSR index to read.\r
-\r
-  @return The lower 32 bits of the MSR identified by Index.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmReadMsr32 (\r
-  IN      UINT32                    Index\r
-  )\r
-{\r
-  return (UINT32)AsmReadMsr64 (Index);\r
-}\r
-\r
-/**\r
-  Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.\r
-  The upper 32-bits of the MSR are set to zero.\r
-\r
-  Writes the 32-bit value specified by Value to the MSR specified by Index. The\r
-  upper 32-bits of the MSR write are set to zero. The 32-bit value written to\r
-  the MSR is returned. No parameter checking is performed on Index or Value,\r
-  and some of these may cause CPU exceptions. The caller must either guarantee\r
-  that Index and Value are valid, or the caller must establish proper exception\r
-  handlers. This function is only available on IA-32 and x64.\r
-\r
-  @param  Index The 32-bit MSR index to write.\r
-  @param  Value The 32-bit value to write to the MSR.\r
-\r
-  @return Value\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmWriteMsr32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  return (UINT32)AsmWriteMsr64 (Index, Value);\r
-}\r
-\r
-/**\r
-  Reads a 64-bit MSR, performs a bitwise OR on the lower 32-bits, and\r
-  writes the result back to the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise OR\r
-  between the lower 32-bits of the read result and the value specified by\r
-  OrData, and writes the result to the 64-bit MSR specified by Index. The lower\r
-  32-bits of the value written to the MSR is returned. No parameter checking is\r
-  performed on Index or OrData, and some of these may cause CPU exceptions. The\r
-  caller must either guarantee that Index and OrData are valid, or the caller\r
-  must establish proper exception handlers. This function is only available on\r
-  IA-32 and x64.\r
-\r
-  @param  Index   The 32-bit MSR index to write.\r
-  @param  OrData  The value to OR with the read value from the MSR.\r
-\r
-  @return The lower 32-bit value written to the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrOr32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT32                    OrData\r
-  )\r
-{\r
-  return (UINT32)AsmMsrOr64 (Index, OrData);\r
-}\r
-\r
-/**\r
-  Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes\r
-  the result back to the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
-  lower 32-bits of the read result and the value specified by AndData, and\r
-  writes the result to the 64-bit MSR specified by Index. The lower 32-bits of\r
-  the value written to the MSR is returned. No parameter checking is performed\r
-  on Index or AndData, and some of these may cause CPU exceptions. The caller\r
-  must either guarantee that Index and AndData are valid, or the caller must\r
-  establish proper exception handlers. This function is only available on IA-32\r
-  and x64.\r
-\r
-  @param  Index   The 32-bit MSR index to write.\r
-  @param  AndData The value to AND with the read value from the MSR.\r
-\r
-  @return The lower 32-bit value written to the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrAnd32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT32                    AndData\r
-  )\r
-{\r
-  return (UINT32)AsmMsrAnd64 (Index, AndData);\r
-}\r
-\r
-/**\r
-  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise OR\r
-  on the lower 32-bits, and writes the result back to the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
-  lower 32-bits of the read result and the value specified by AndData\r
-  preserving the upper 32-bits, performs a bitwise OR between the\r
-  result of the AND operation and the value specified by OrData, and writes the\r
-  result to the 64-bit MSR specified by Address. The lower 32-bits of the value\r
-  written to the MSR is returned. No parameter checking is performed on Index,\r
-  AndData, or OrData, and some of these may cause CPU exceptions. The caller\r
-  must either guarantee that Index, AndData, and OrData are valid, or the\r
-  caller must establish proper exception handlers. This function is only\r
-  available on IA-32 and x64.\r
-\r
-  @param  Index   The 32-bit MSR index to write.\r
-  @param  AndData The value to AND with the read value from the MSR.\r
-  @param  OrData  The value to OR with the result of the AND operation.\r
-\r
-  @return The lower 32-bit value written to the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrAndThenOr32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT32                    AndData,\r
-  IN      UINT32                    OrData\r
-  )\r
-{\r
-  return (UINT32)AsmMsrAndThenOr64 (Index, AndData, OrData);\r
-}\r
-\r
-/**\r
-  Reads a bit field of an MSR.\r
-\r
-  Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is\r
-  specified by the StartBit and the EndBit. The value of the bit field is\r
-  returned. The caller must either guarantee that Index is valid, or the caller\r
-  must set up exception handlers to catch the exceptions. This function is only\r
-  available on IA-32 and x64.\r
-\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to read.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-\r
-  @return The bit field read from the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrBitFieldRead32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  )\r
-{\r
-  return BitFieldRead32 (AsmReadMsr32 (Index), StartBit, EndBit);\r
-}\r
-\r
-/**\r
-  Writes a bit field to an MSR.\r
-\r
-  Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit\r
-  field is specified by the StartBit and the EndBit. All other bits in the\r
-  destination MSR are preserved. The lower 32-bits of the MSR written is\r
-  returned. The caller must either guarantee that Index and the data written \r
-  is valid, or the caller must set up exception handlers to catch the exceptions. \r
-  This function is only available on IA-32 and x64.\r
-\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  Value     The new value of the bit field.\r
-\r
-  @return The lower 32-bit of the value written to the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrBitFieldWrite32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  ASSERT (EndBit < sizeof (Value) * 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT32)AsmMsrBitFieldWrite64 (Index, StartBit, EndBit, Value);\r
-}\r
-\r
-/**\r
-  Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the\r
-  result back to the bit field in the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise OR\r
-  between the read result and the value specified by OrData, and writes the\r
-  result to the 64-bit MSR specified by Index. The lower 32-bits of the value\r
-  written to the MSR are returned. Extra left bits in OrData are stripped. The\r
-  caller must either guarantee that Index and the data written is valid, or\r
-  the caller must set up exception handlers to catch the exceptions. This\r
-  function is only available on IA-32 and x64.\r
-\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  OrData    The value to OR with the read value from the MSR.\r
-\r
-  @return The lower 32-bit of the value written to the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrBitFieldOr32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < sizeof (OrData) * 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT32)AsmMsrBitFieldOr64 (Index, StartBit, EndBit, OrData);\r
-}\r
-\r
-/**\r
-  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the\r
-  result back to the bit field in the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
-  read result and the value specified by AndData, and writes the result to the\r
-  64-bit MSR specified by Index. The lower 32-bits of the value written to the\r
-  MSR are returned. Extra left bits in AndData are stripped. The caller must\r
-  either guarantee that Index and the data written is valid, or the caller must\r
-  set up exception handlers to catch the exceptions. This function is only\r
-  available on IA-32 and x64.\r
-\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  AndData   The value to AND with the read value from the MSR.\r
-\r
-  @return The lower 32-bit of the value written to the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrBitFieldAnd32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    AndData\r
-  )\r
-{\r
-  ASSERT (EndBit < sizeof (AndData) * 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT32)AsmMsrBitFieldAnd64 (Index, StartBit, EndBit, AndData);\r
-}\r
-\r
-/**\r
-  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a\r
-  bitwise OR, and writes the result back to the bit field in the\r
-  64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a\r
-  bitwise OR between the read result and the value specified by\r
-  AndData, and writes the result to the 64-bit MSR specified by Index. The\r
-  lower 32-bits of the value written to the MSR are returned. Extra left bits\r
-  in both AndData and OrData are stripped. The caller must either guarantee\r
-  that Index and the data written is valid, or the caller must set up exception\r
-  handlers to catch the exceptions. This function is only available on IA-32\r
-  and x64.\r
-\r
-  If StartBit is greater than 31, then ASSERT().\r
-  If EndBit is greater than 31, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..31.\r
-  @param  AndData   The value to AND with the read value from the MSR.\r
-  @param  OrData    The value to OR with the result of the AND operation.\r
-\r
-  @return The lower 32-bit of the value written to the MSR.\r
-\r
-**/\r
-UINT32\r
-EFIAPI\r
-AsmMsrBitFieldAndThenOr32 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT32                    AndData,\r
-  IN      UINT32                    OrData\r
-  )\r
-{\r
-  ASSERT (EndBit < sizeof (AndData) * 8);\r
-  ASSERT (StartBit <= EndBit);\r
-  return (UINT32)AsmMsrBitFieldAndThenOr64 (\r
-                   Index,\r
-                   StartBit,\r
-                   EndBit,\r
-                   AndData,\r
-                   OrData\r
-                   );\r
-}\r
-\r
-/**\r
-  Reads a 64-bit MSR, performs a bitwise OR, and writes the result\r
-  back to the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise OR\r
-  between the read result and the value specified by OrData, and writes the\r
-  result to the 64-bit MSR specified by Index. The value written to the MSR is\r
-  returned. No parameter checking is performed on Index or OrData, and some of\r
-  these may cause CPU exceptions. The caller must either guarantee that Index\r
-  and OrData are valid, or the caller must establish proper exception handlers.\r
-  This function is only available on IA-32 and x64.\r
-\r
-  @param  Index   The 32-bit MSR index to write.\r
-  @param  OrData  The value to OR with the read value from the MSR.\r
-\r
-  @return The value written back to the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrOr64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT64                    OrData\r
-  )\r
-{\r
-  return AsmWriteMsr64 (Index, AsmReadMsr64 (Index) | OrData);\r
-}\r
-\r
-/**\r
-  Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the\r
-  64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
-  read result and the value specified by OrData, and writes the result to the\r
-  64-bit MSR specified by Index. The value written to the MSR is returned. No\r
-  parameter checking is performed on Index or OrData, and some of these may\r
-  cause CPU exceptions. The caller must either guarantee that Index and OrData\r
-  are valid, or the caller must establish proper exception handlers. This\r
-  function is only available on IA-32 and x64.\r
-\r
-  @param  Index   The 32-bit MSR index to write.\r
-  @param  AndData The value to AND with the read value from the MSR.\r
-\r
-  @return The value written back to the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrAnd64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT64                    AndData\r
-  )\r
-{\r
-  return AsmWriteMsr64 (Index, AsmReadMsr64 (Index) & AndData);\r
-}\r
-\r
-/**\r
-  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise \r
-  OR, and writes the result back to the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND between read\r
-  result and the value specified by AndData, performs a bitwise OR\r
-  between the result of the AND operation and the value specified by OrData,\r
-  and writes the result to the 64-bit MSR specified by Index. The value written\r
-  to the MSR is returned. No parameter checking is performed on Index, AndData,\r
-  or OrData, and some of these may cause CPU exceptions. The caller must either\r
-  guarantee that Index, AndData, and OrData are valid, or the caller must\r
-  establish proper exception handlers. This function is only available on IA-32\r
-  and x64.\r
-\r
-  @param  Index   The 32-bit MSR index to write.\r
-  @param  AndData The value to AND with the read value from the MSR.\r
-  @param  OrData  The value to OR with the result of the AND operation.\r
-\r
-  @return The value written back to the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrAndThenOr64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT64                    AndData,\r
-  IN      UINT64                    OrData\r
-  )\r
-{\r
-  return AsmWriteMsr64 (Index, (AsmReadMsr64 (Index) & AndData) | OrData);\r
-}\r
-\r
-/**\r
-  Reads a bit field of an MSR.\r
-\r
-  Reads the bit field in the 64-bit MSR. The bit field is specified by the\r
-  StartBit and the EndBit. The value of the bit field is returned. The caller\r
-  must either guarantee that Index is valid, or the caller must set up\r
-  exception handlers to catch the exceptions. This function is only available\r
-  on IA-32 and x64.\r
-\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to read.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-\r
-  @return The value read from the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrBitFieldRead64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit\r
-  )\r
-{\r
-  return BitFieldRead64 (AsmReadMsr64 (Index), StartBit, EndBit);\r
-}\r
-\r
-/**\r
-  Writes a bit field to an MSR.\r
-\r
-  Writes Value to a bit field in a 64-bit MSR. The bit field is specified by\r
-  the StartBit and the EndBit. All other bits in the destination MSR are\r
-  preserved. The MSR written is returned. The caller must either guarantee \r
-  that Index and the data written is valid, or the caller must set up exception \r
-  handlers to catch the exceptions. This function is only available on IA-32 and x64.\r
-\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  Value     The new value of the bit field.\r
-\r
-  @return The value written back to the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrBitFieldWrite64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    Value\r
-  )\r
-{\r
-  return AsmWriteMsr64 (\r
-           Index,\r
-           BitFieldWrite64 (AsmReadMsr64 (Index), StartBit, EndBit, Value)\r
-           );\r
-}\r
-\r
-/**\r
-  Reads a bit field in a 64-bit MSR, performs a bitwise OR, and\r
-  writes the result back to the bit field in the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise OR\r
-  between the read result and the value specified by OrData, and writes the\r
-  result to the 64-bit MSR specified by Index. The value written to the MSR is\r
-  returned. Extra left bits in OrData are stripped. The caller must either\r
-  guarantee that Index and the data written is valid, or the caller must set up\r
-  exception handlers to catch the exceptions. This function is only available\r
-  on IA-32 and x64.\r
-\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  OrData    The value to OR with the read value from the bit field.\r
-\r
-  @return The value written back to the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrBitFieldOr64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    OrData\r
-  )\r
-{\r
-  return AsmWriteMsr64 (\r
-           Index,\r
-           BitFieldOr64 (AsmReadMsr64 (Index), StartBit, EndBit, OrData)\r
-           );\r
-}\r
-\r
-/**\r
-  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the\r
-  result back to the bit field in the 64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
-  read result and the value specified by AndData, and writes the result to the\r
-  64-bit MSR specified by Index. The value written to the MSR is returned.\r
-  Extra left bits in AndData are stripped. The caller must either guarantee\r
-  that Index and the data written is valid, or the caller must set up exception\r
-  handlers to catch the exceptions. This function is only available on IA-32\r
-  and x64.\r
-\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  AndData   The value to AND with the read value from the bit field.\r
-\r
-  @return The value written back to the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrBitFieldAnd64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    AndData\r
-  )\r
-{\r
-  return AsmWriteMsr64 (\r
-           Index,\r
-           BitFieldAnd64 (AsmReadMsr64 (Index), StartBit, EndBit, AndData)\r
-           );\r
-}\r
-\r
-/**\r
-  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a\r
-  bitwise OR, and writes the result back to the bit field in the\r
-  64-bit MSR.\r
-\r
-  Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by\r
-  a bitwise OR between the read result and the value specified by\r
-  AndData, and writes the result to the 64-bit MSR specified by Index. The\r
-  value written to the MSR is returned. Extra left bits in both AndData and\r
-  OrData are stripped. The caller must either guarantee that Index and the data\r
-  written is valid, or the caller must set up exception handlers to catch the\r
-  exceptions. This function is only available on IA-32 and x64.\r
-\r
-  If StartBit is greater than 63, then ASSERT().\r
-  If EndBit is greater than 63, then ASSERT().\r
-  If EndBit is less than StartBit, then ASSERT().\r
-\r
-  @param  Index     The 32-bit MSR index to write.\r
-  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
-                    Range 0..63.\r
-  @param  AndData   The value to AND with the read value from the bit field.\r
-  @param  OrData    The value to OR with the result of the AND operation.\r
-\r
-  @return The value written back to the MSR.\r
-\r
-**/\r
-UINT64\r
-EFIAPI\r
-AsmMsrBitFieldAndThenOr64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINTN                     StartBit,\r
-  IN      UINTN                     EndBit,\r
-  IN      UINT64                    AndData,\r
-  IN      UINT64                    OrData\r
-  )\r
-{\r
-  return AsmWriteMsr64 (\r
-           Index,\r
-           BitFieldAndThenOr64 (\r
-             AsmReadMsr64 (Index),\r
-             StartBit,\r
-             EndBit,\r
-             AndData,\r
-             OrData\r
-             )\r
-           );\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86ReadGdtr.c b/UnixPkg/Library/UnixBaseLib/X86ReadGdtr.c
deleted file mode 100644 (file)
index ecd2b80..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmReadGdtr()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Reads the current Global Descriptor Table Register(GDTR) descriptor.\r
-\r
-  Reads and returns the current GDTR descriptor and returns it in Gdtr. This\r
-  function is only available on IA-32 and x64.\r
-\r
-  If Gdtr is NULL, then ASSERT().\r
-\r
-  @param  Gdtr  The pointer to a GDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmReadGdtr (\r
-  OUT     IA32_DESCRIPTOR           *Gdtr\r
-  )\r
-{\r
-  ASSERT (Gdtr != NULL);\r
-  InternalX86ReadGdtr (Gdtr);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86ReadIdtr.c b/UnixPkg/Library/UnixBaseLib/X86ReadIdtr.c
deleted file mode 100644 (file)
index 392b6e3..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmReadIdtr()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.\r
-\r
-  Reads and returns the current IDTR descriptor and returns it in Idtr. This\r
-  function is only available on IA-32 and x64.\r
-\r
-  If Idtr is NULL, then ASSERT().\r
-\r
-  @param  Idtr  The pointer to a IDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmReadIdtr (\r
-  OUT     IA32_DESCRIPTOR           *Idtr\r
-  )\r
-{\r
-  ASSERT (Idtr != NULL);\r
-  InternalX86ReadIdtr (Idtr);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86Thunk.c b/UnixPkg/Library/UnixBaseLib/X86Thunk.c
deleted file mode 100644 (file)
index ae223b3..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/** @file\r
-  Real Mode Thunk Functions for IA32 and x64.\r
-\r
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-extern CONST UINT8                  m16Start;\r
-extern CONST UINT16                 m16Size;\r
-extern CONST UINT16                 mThunk16Attr;\r
-extern CONST UINT16                 m16Gdt;\r
-extern CONST UINT16                 m16GdtrBase;\r
-extern CONST UINT16                 mTransition;\r
-\r
-/**\r
-  Invokes 16-bit code in big real mode and returns the updated register set.\r
-\r
-  This function transfers control to the 16-bit code specified by CS:EIP using\r
-  the stack specified by SS:ESP in RegisterSet. The updated registers are saved\r
-  on the real mode stack and the starting address of the save area is returned.\r
-\r
-  @param  RegisterSet Values of registers before invocation of 16-bit code.\r
-  @param  Transition  The pointer to the transition code under 1MB.\r
-\r
-  @return The pointer to a IA32_REGISTER_SET structure containing the updated\r
-          register values.\r
-\r
-**/\r
-IA32_REGISTER_SET *\r
-EFIAPI\r
-InternalAsmThunk16 (\r
-  IN      IA32_REGISTER_SET         *RegisterSet,\r
-  IN OUT  VOID                      *Transition\r
-  );\r
-\r
-/**\r
-  Retrieves the properties for 16-bit thunk functions.\r
-\r
-  Computes the size of the buffer and stack below 1MB required to use the\r
-  AsmPrepareThunk16(), AsmThunk16() and AsmPrepareAndThunk16() functions. This\r
-  buffer size is returned in RealModeBufferSize, and the stack size is returned\r
-  in ExtraStackSize. If parameters are passed to the 16-bit real mode code,\r
-  then the actual minimum stack size is ExtraStackSize plus the maximum number\r
-  of bytes that need to be passed to the 16-bit real mode code.\r
-\r
-  If RealModeBufferSize is NULL, then ASSERT().\r
-  If ExtraStackSize is NULL, then ASSERT().\r
-\r
-  @param  RealModeBufferSize  A pointer to the size of the buffer below 1MB\r
-                              required to use the 16-bit thunk functions.\r
-  @param  ExtraStackSize      A pointer to the extra size of stack below 1MB\r
-                              that the 16-bit thunk functions require for\r
-                              temporary storage in the transition to and from\r
-                              16-bit real mode.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmGetThunk16Properties (\r
-  OUT     UINT32                    *RealModeBufferSize,\r
-  OUT     UINT32                    *ExtraStackSize\r
-  )\r
-{\r
-  ASSERT (RealModeBufferSize != NULL);\r
-  ASSERT (ExtraStackSize != NULL);\r
-\r
-  *RealModeBufferSize = m16Size;\r
-\r
-  //\r
-  // Extra 4 bytes for return address, and another 4 bytes for mode transition\r
-  //\r
-  *ExtraStackSize = sizeof (IA32_DWORD_REGS) + 8;\r
-}\r
-\r
-/**\r
-  Prepares all structures a code required to use AsmThunk16().\r
-\r
-  Prepares all structures and code required to use AsmThunk16().\r
-  \r
-  This interface is limited to be used in either physical mode or virtual modes with paging enabled where the\r
-  virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.\r
-\r
-  If ThunkContext is NULL, then ASSERT().\r
-\r
-  @param  ThunkContext  A pointer to the context structure that describes the\r
-                        16-bit real mode code to call.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmPrepareThunk16 (\r
-  OUT     THUNK_CONTEXT             *ThunkContext\r
-  )\r
-{\r
-  IA32_SEGMENT_DESCRIPTOR           *RealModeGdt;\r
-\r
-  ASSERT (ThunkContext != NULL);\r
-  ASSERT ((UINTN)ThunkContext->RealModeBuffer < 0x100000);\r
-  ASSERT (ThunkContext->RealModeBufferSize >= m16Size);\r
-  ASSERT ((UINTN)ThunkContext->RealModeBuffer + m16Size <= 0x100000);\r
-\r
-  CopyMem (ThunkContext->RealModeBuffer, &m16Start, m16Size);\r
-\r
-  //\r
-  // Point RealModeGdt to the GDT to be used in transition\r
-  //\r
-  // RealModeGdt[0]: Reserved as NULL descriptor\r
-  // RealModeGdt[1]: Code Segment\r
-  // RealModeGdt[2]: Data Segment\r
-  // RealModeGdt[3]: Call Gate\r
-  //\r
-  RealModeGdt = (IA32_SEGMENT_DESCRIPTOR*)(\r
-                  (UINTN)ThunkContext->RealModeBuffer + m16Gdt);\r
-\r
-  //\r
-  // Update Code & Data Segment Descriptor\r
-  //\r
-  RealModeGdt[1].Bits.BaseLow =\r
-    (UINT32)(UINTN)ThunkContext->RealModeBuffer & ~0xf;\r
-  RealModeGdt[1].Bits.BaseMid =\r
-    (UINT32)(UINTN)ThunkContext->RealModeBuffer >> 16;\r
-\r
-  //\r
-  // Update transition code entry point offset\r
-  //\r
-  *(UINT32*)((UINTN)ThunkContext->RealModeBuffer + mTransition) +=\r
-    (UINT32)(UINTN)ThunkContext->RealModeBuffer & 0xf;\r
-\r
-  //\r
-  // Update Segment Limits for both Code and Data Segment Descriptors\r
-  //\r
-  if ((ThunkContext->ThunkAttributes & THUNK_ATTRIBUTE_BIG_REAL_MODE) == 0) {\r
-    //\r
-    // Set segment limits to 64KB\r
-    //\r
-    RealModeGdt[1].Bits.LimitHigh = 0;\r
-    RealModeGdt[1].Bits.G = 0;\r
-    RealModeGdt[2].Bits.LimitHigh = 0;\r
-    RealModeGdt[2].Bits.G = 0;\r
-  }\r
-\r
-  //\r
-  // Update GDTBASE for this thunk context\r
-  //\r
-  *(VOID**)((UINTN)ThunkContext->RealModeBuffer + m16GdtrBase) = RealModeGdt;\r
-\r
-  //\r
-  // Update Thunk Attributes\r
-  //\r
-  *(UINT32*)((UINTN)ThunkContext->RealModeBuffer + mThunk16Attr) =\r
-    ThunkContext->ThunkAttributes;\r
-}\r
-\r
-/**\r
-  Transfers control to a 16-bit real mode entry point and returns the results.\r
-\r
-  Transfers control to a 16-bit real mode entry point and returns the results.\r
-  AsmPrepareThunk16() must be called with ThunkContext before this function is used.\r
-  This function must be called with interrupts disabled.\r
-\r
-  The register state from the RealModeState field of ThunkContext is restored just prior \r
-  to calling the 16-bit real mode entry point.  This includes the EFLAGS field of RealModeState, \r
-  which is used to set the interrupt state when a 16-bit real mode entry point is called.\r
-  Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of RealModeState.\r
-  The stack is initialized to the SS and ESP fields of RealModeState.  Any parameters passed to \r
-  the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function.  \r
-  The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction,\r
-  so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment \r
-  and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry \r
-  point must exit with a RETF instruction. The register state is captured into RealModeState immediately \r
-  after the RETF instruction is executed.\r
-  \r
-  If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, \r
-  or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure \r
-  the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode. \r
-  \r
-  If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, \r
-  then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode.  \r
-  This includes the base vectors, the interrupt masks, and the edge/level trigger mode.\r
-  \r
-  If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code \r
-  is invoked in big real mode.  Otherwise, the user code is invoked in 16-bit real mode with 64KB segment limits.\r
-  \r
-  If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in \r
-  ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to \r
-  disable the A20 mask.\r
-  \r
-  If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in \r
-  ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask.  If this INT 15 call fails, \r
-  then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.\r
-  \r
-  If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in \r
-  ThunkAttributes, then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.\r
-    \r
-  If ThunkContext is NULL, then ASSERT().\r
-  If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().\r
-  If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in \r
-  ThunkAttributes, then ASSERT().\r
-\r
-  This interface is limited to be used in either physical mode or virtual modes with paging enabled where the\r
-  virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.\r
-  \r
-  @param  ThunkContext  A pointer to the context structure that describes the\r
-                        16-bit real mode code to call.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmThunk16 (\r
-  IN OUT  THUNK_CONTEXT             *ThunkContext\r
-  )\r
-{\r
-  IA32_REGISTER_SET                 *UpdatedRegs;\r
-\r
-  ASSERT (ThunkContext != NULL);\r
-  ASSERT ((UINTN)ThunkContext->RealModeBuffer < 0x100000);\r
-  ASSERT (ThunkContext->RealModeBufferSize >= m16Size);\r
-  ASSERT ((UINTN)ThunkContext->RealModeBuffer + m16Size <= 0x100000);\r
-  ASSERT (((ThunkContext->ThunkAttributes & (THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 | THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL)) != \\r
-           (THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 | THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL)));\r
-           \r
-  UpdatedRegs = InternalAsmThunk16 (\r
-                  ThunkContext->RealModeState,\r
-                  ThunkContext->RealModeBuffer\r
-                  );\r
-\r
-  CopyMem (ThunkContext->RealModeState, UpdatedRegs, sizeof (*UpdatedRegs));\r
-}\r
-\r
-/**\r
-  Prepares all structures and code for a 16-bit real mode thunk, transfers\r
-  control to a 16-bit real mode entry point, and returns the results.\r
-\r
-  Prepares all structures and code for a 16-bit real mode thunk, transfers\r
-  control to a 16-bit real mode entry point, and returns the results. If the\r
-  caller only need to perform a single 16-bit real mode thunk, then this\r
-  service should be used. If the caller intends to make more than one 16-bit\r
-  real mode thunk, then it is more efficient if AsmPrepareThunk16() is called\r
-  once and AsmThunk16() can be called for each 16-bit real mode thunk.\r
-\r
-  This interface is limited to be used in either physical mode or virtual modes with paging enabled where the\r
-  virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.\r
-  \r
-  See AsmPrepareThunk16() and AsmThunk16() for the detailed description and ASSERT() conditions.\r
-\r
-  @param  ThunkContext  A pointer to the context structure that describes the\r
-                        16-bit real mode code to call.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmPrepareAndThunk16 (\r
-  IN OUT  THUNK_CONTEXT             *ThunkContext\r
-  )\r
-{\r
-  AsmPrepareThunk16 (ThunkContext);\r
-  AsmThunk16 (ThunkContext);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86WriteGdtr.c b/UnixPkg/Library/UnixBaseLib/X86WriteGdtr.c
deleted file mode 100644 (file)
index 54383d5..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmWriteGdtr()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Writes the current Global Descriptor Table Register (GDTR) descriptor.\r
-\r
-  Writes and the current GDTR descriptor specified by Gdtr. This function is\r
-  only available on IA-32 and x64.\r
-\r
-  If Gdtr is NULL, then ASSERT().\r
-\r
-  @param  Gdtr  The pointer to a GDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteGdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Gdtr\r
-  )\r
-{\r
-  ASSERT (Gdtr != NULL);\r
-  InternalX86WriteGdtr (Gdtr);\r
-}\r
diff --git a/UnixPkg/Library/UnixBaseLib/X86WriteIdtr.c b/UnixPkg/Library/UnixBaseLib/X86WriteIdtr.c
deleted file mode 100644 (file)
index d187bc2..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file\r
-  IA-32/x64 AsmWriteIdtr()\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-\r
-\r
-#include "BaseLibInternals.h"\r
-\r
-/**\r
-  Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.\r
-\r
-  Writes the current IDTR descriptor and returns it in Idtr. This function is\r
-  only available on IA-32 and x64.\r
-\r
-  If Idtr is NULL, then ASSERT().\r
-\r
-  @param  Idtr  The pointer to a IDTR descriptor.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmWriteIdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Idtr\r
-  )\r
-{\r
-  ASSERT (Idtr != NULL);\r
-  InternalX86WriteIdtr (Idtr);\r
-}\r
diff --git a/UnixPkg/Library/UnixBdsLib/BdsPlatform.c b/UnixPkg/Library/UnixBdsLib/BdsPlatform.c
deleted file mode 100644 (file)
index 671ff95..0000000
+++ /dev/null
@@ -1,565 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  BdsPlatform.c\r
-\r
-Abstract:\r
-\r
-  This file include all platform action which can be customized\r
-  by IBV/OEM.\r
-\r
---*/\r
-\r
-#include "BdsPlatform.h"\r
-\r
-UNIX_SYSTEM_CONFIGURATION mSystemConfigData;\r
-\r
-VOID\r
-SetupVariableInit (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS                      Status;\r
-  UINTN                           Size;\r
-\r
-  Size = sizeof (mSystemConfigData);\r
-  Status = gRT->GetVariable (\r
-                  L"Setup",\r
-                  &gEfiUnixSystemConfigGuid,\r
-                  NULL,\r
-                  &Size,\r
-                  (VOID *) &mSystemConfigData\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // SetupVariable is corrupt\r
-    //\r
-    mSystemConfigData.ConOutRow = PcdGet32 (PcdConOutColumn);\r
-    mSystemConfigData.ConOutColumn = PcdGet32 (PcdConOutRow);\r
-\r
-    Status = gRT->SetVariable (\r
-                    L"Setup",\r
-                    &gEfiUnixSystemConfigGuid,\r
-                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
-                    sizeof (mSystemConfigData),\r
-                    (VOID *) &mSystemConfigData\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      DEBUG ((EFI_D_ERROR, "Failed to save Setup Variable to non-volatile storage, Status = %r\n", Status));\r
-    }\r
-  }\r
-}\r
-\r
-//\r
-// BDS Platform Functions\r
-//\r
-VOID\r
-EFIAPI\r
-PlatformBdsInit (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Platform Bds init. Include the platform firmware vendor, revision\r
-  and so crc check.\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
-{\r
-  SetupVariableInit ();\r
-}\r
-\r
-EFI_STATUS\r
-PlatformBdsConnectConsole (\r
-  IN BDS_CONSOLE_CONNECT_ENTRY   *PlatformConsole\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Connect the predefined platform default console device. Always try to find\r
-  and enable the vga device if have.\r
-\r
-Arguments:\r
-\r
-  PlatformConsole         - Predfined platform default console device array.\r
\r
-Returns:\r
-\r
-  EFI_SUCCESS             - Success connect at least one ConIn and ConOut \r
-                            device, there must have one ConOut device is \r
-                            active vga device.\r
-  \r
-  EFI_STATUS              - Return the status of \r
-                            BdsLibConnectAllDefaultConsoles ()\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       Index;\r
-\r
-  Index   = 0;\r
-  Status  = EFI_SUCCESS;\r
-\r
-  //\r
-  // Have chance to connect the platform default console,\r
-  // the platform default console is the minimue device group\r
-  // the platform should support\r
-  //\r
-  while (PlatformConsole[Index].DevicePath != NULL) {\r
-    //\r
-    // Update the console variable with the connect type\r
-    //\r
-    if ((PlatformConsole[Index].ConnectType & CONSOLE_IN) == CONSOLE_IN) {\r
-      BdsLibUpdateConsoleVariable (L"ConIn", PlatformConsole[Index].DevicePath, NULL);\r
-    }\r
-\r
-    if ((PlatformConsole[Index].ConnectType & CONSOLE_OUT) == CONSOLE_OUT) {\r
-      BdsLibUpdateConsoleVariable (L"ConOut", PlatformConsole[Index].DevicePath, NULL);\r
-    }\r
-\r
-    if ((PlatformConsole[Index].ConnectType & STD_ERROR) == STD_ERROR) {\r
-      BdsLibUpdateConsoleVariable (L"ErrOut", PlatformConsole[Index].DevicePath, NULL);\r
-    }\r
-\r
-    Index++;\r
-  }\r
-  //\r
-  // Connect the all the default console with current cosole variable\r
-  //\r
-  Status = BdsLibConnectAllDefaultConsoles ();\r
-  return Status;\r
-}\r
-\r
-VOID\r
-PlatformBdsConnectSequence (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Connect with predeined platform connect sequence, \r
-  the OEM/IBV can customize with their own connect sequence.\r
-  \r
-Arguments:\r
-\r
-  None.\r
\r
-Returns:\r
-\r
-  None.\r
-  \r
---*/\r
-{\r
-  UINTN Index;\r
-\r
-  Index = 0;\r
-\r
-  //\r
-  // Here we can get the customized platform connect sequence\r
-  // Notes: we can connect with new variable which record the\r
-  // last time boots connect device path sequence\r
-  //\r
-  while (gPlatformConnectSequence[Index] != NULL) {\r
-    //\r
-    // Build the platform boot option\r
-    //\r
-    BdsLibConnectDevicePath (gPlatformConnectSequence[Index]);\r
-    Index++;\r
-  }\r
-\r
-  //\r
-  // Just use the simple policy to connect all devices\r
-  //\r
-  BdsLibConnectAll ();\r
-}\r
-\r
-VOID\r
-PlatformBdsGetDriverOption (\r
-  IN OUT LIST_ENTRY              *BdsDriverLists\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Load the predefined driver option, OEM/IBV can customize this\r
-  to load their own drivers\r
-  \r
-Arguments:\r
-\r
-  BdsDriverLists  - The header of the driver option link list.\r
\r
-Returns:\r
-\r
-  None.\r
-  \r
---*/\r
-{\r
-  UINTN Index;\r
-\r
-  Index = 0;\r
-\r
-  //\r
-  // Here we can get the customized platform driver option\r
-  //\r
-  while (gPlatformDriverOption[Index] != NULL) {\r
-    //\r
-    // Build the platform boot option\r
-    //\r
-    BdsLibRegisterNewOption (BdsDriverLists, gPlatformDriverOption[Index], NULL, L"DriverOrder");\r
-    Index++;\r
-  }\r
-\r
-}\r
-\r
-VOID\r
-PlatformBdsDiagnostics (\r
-  IN EXTENDMEM_COVERAGE_LEVEL    MemoryTestLevel,\r
-  IN BOOLEAN                     QuietBoot,\r
-  IN BASEM_MEMORY_TEST           BaseMemoryTest\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Perform the platform diagnostic, such like test memory. OEM/IBV also\r
-  can customize this fuction to support specific platform diagnostic.\r
-  \r
-Arguments:\r
-\r
-  MemoryTestLevel  - The memory test intensive level\r
-  \r
-  QuietBoot        - Indicate if need to enable the quiet boot\r
-\r
-  BaseMemoryTest   - A pointer to BdsMemoryTest()\r
\r
-Returns:\r
-\r
-  None.\r
-  \r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  //\r
-  // Here we can decide if we need to show\r
-  // the diagnostics screen\r
-  // Notes: this quiet boot code should be remove\r
-  // from the graphic lib\r
-  //\r
-  if (QuietBoot) {\r
-    EnableQuietBoot (PcdGetPtr(PcdLogoFile));\r
-    //\r
-    // Perform system diagnostic\r
-    //\r
-    Status = BaseMemoryTest (MemoryTestLevel);\r
-    if (EFI_ERROR (Status)) {\r
-      DisableQuietBoot ();\r
-    }\r
-\r
-    return ;\r
-  }\r
-  //\r
-  // Perform system diagnostic\r
-  //\r
-  Status = BaseMemoryTest (MemoryTestLevel);\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-PlatformBdsPolicyBehavior (\r
-  IN OUT LIST_ENTRY                  *DriverOptionList,\r
-  IN OUT LIST_ENTRY                  *BootOptionList,\r
-  IN PROCESS_CAPSULES                ProcessCapsules,\r
-  IN BASEM_MEMORY_TEST               BaseMemoryTest\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The function will excute with as the platform policy, current policy\r
-  is driven by boot mode. IBV/OEM can customize this code for their specific\r
-  policy action.\r
-  \r
-Arguments:\r
-\r
-  DriverOptionList - The header of the driver option link list\r
-  \r
-  BootOptionList   - The header of the boot option link list\r
-\r
-  ProcessCapsules  - A pointer to ProcessCapsules()\r
-\r
-  BaseMemoryTest   - A pointer to BaseMemoryTest()\r
-\r
-Returns:\r
-\r
-  None.\r
-  \r
---*/\r
-{\r
-  EFI_STATUS     Status;\r
-  UINT16         Timeout;\r
-  EFI_BOOT_MODE  BootMode;\r
-\r
-  //\r
-  // Init the time out value\r
-  //\r
-  Timeout = PcdGet16 (PcdPlatformBootTimeOut);\r
-\r
-  //\r
-  // Load the driver option as the driver option list\r
-  //\r
-  PlatformBdsGetDriverOption (DriverOptionList);\r
-\r
-  //\r
-  // Get current Boot Mode\r
-  //\r
-  Status = BdsLibGetBootMode (&BootMode);\r
-\r
-  //\r
-  // Go the different platform policy with different boot mode\r
-  // Notes: this part code can be change with the table policy\r
-  //\r
-  switch (BootMode) {\r
-\r
-  case BOOT_ASSUMING_NO_CONFIGURATION_CHANGES:\r
-  case BOOT_WITH_MINIMAL_CONFIGURATION:\r
-    //\r
-    // In no-configuration boot mode, we can connect the\r
-    // console directly.\r
-    //\r
-    BdsLibConnectAllDefaultConsoles ();\r
-    PlatformBdsDiagnostics (IGNORE, TRUE, BaseMemoryTest);\r
-\r
-    //\r
-    // Perform some platform specific connect sequence\r
-    //\r
-    PlatformBdsConnectSequence ();\r
-\r
-    //\r
-    // Notes: current time out = 0 can not enter the\r
-    // front page\r
-    //\r
-    PlatformBdsEnterFrontPage (Timeout, FALSE);\r
-\r
-    //\r
-    // Check the boot option with the boot option list\r
-    //\r
-    BdsLibBuildOptionFromVar (BootOptionList, L"BootOrder");\r
-    break;\r
-\r
-  case BOOT_ON_FLASH_UPDATE:\r
-    //\r
-    // Boot with the specific configuration\r
-    //\r
-    PlatformBdsConnectConsole (gPlatformConsole);\r
-    PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest);\r
-    BdsLibConnectAll ();\r
-    ProcessCapsules (BOOT_ON_FLASH_UPDATE);\r
-    break;\r
-\r
-  case BOOT_IN_RECOVERY_MODE:\r
-    //\r
-    // In recovery mode, just connect platform console\r
-    // and show up the front page\r
-    //\r
-    PlatformBdsConnectConsole (gPlatformConsole);\r
-    PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest);\r
-\r
-    //\r
-    // In recovery boot mode, we still enter to the\r
-    // frong page now\r
-    //\r
-    PlatformBdsEnterFrontPage (Timeout, FALSE);\r
-    break;\r
-\r
-  case BOOT_WITH_FULL_CONFIGURATION:\r
-  case BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS:\r
-  case BOOT_WITH_DEFAULT_SETTINGS:\r
-  default:\r
-    //\r
-    // Connect platform console\r
-    //\r
-    Status = PlatformBdsConnectConsole (gPlatformConsole);\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // Here OEM/IBV can customize with defined action\r
-      //\r
-      PlatformBdsNoConsoleAction ();\r
-    }\r
-\r
-    PlatformBdsDiagnostics (IGNORE, TRUE, BaseMemoryTest);\r
-\r
-    //\r
-    // Perform some platform specific connect sequence\r
-    //\r
-    PlatformBdsConnectSequence ();\r
-\r
-    //\r
-    // Give one chance to enter the setup if we\r
-    // have the time out\r
-    //\r
-    PlatformBdsEnterFrontPage (Timeout, FALSE);\r
-\r
-    //\r
-    // Here we have enough time to do the enumeration of boot device\r
-    //\r
-    BdsLibEnumerateAllBootOption (BootOptionList);\r
-    break;\r
-  }\r
-\r
-  return ;\r
-\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-PlatformBdsBootSuccess (\r
-  IN  BDS_COMMON_OPTION   *Option\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  Hook point after a boot attempt succeeds. We don't expect a boot option to\r
-  return, so the EFI 1.0 specification defines that you will default to an\r
-  interactive mode and stop processing the BootOrder list in this case. This\r
-  is alos a platform implementation and can be customized by IBV/OEM.\r
-\r
-Arguments:\r
-\r
-  Option - Pointer to Boot Option that succeeded to boot.\r
-\r
-Returns:\r
-  \r
-  None.\r
-\r
---*/\r
-{\r
-  CHAR16  *TmpStr;\r
-\r
-  //\r
-  // If Boot returned with EFI_SUCCESS and there is not in the boot device\r
-  // select loop then we need to pop up a UI and wait for user input.\r
-  //\r
-  TmpStr = Option->StatusString;\r
-  if (TmpStr != NULL) {\r
-    BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);\r
-    FreePool (TmpStr);\r
-  }\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-PlatformBdsBootFail (\r
-  IN  BDS_COMMON_OPTION  *Option,\r
-  IN  EFI_STATUS         Status,\r
-  IN  CHAR16             *ExitData,\r
-  IN  UINTN              ExitDataSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  Hook point after a boot attempt fails.\r
-\r
-Arguments:\r
-  \r
-  Option - Pointer to Boot Option that failed to boot.\r
-\r
-  Status - Status returned from failed boot.\r
-\r
-  ExitData - Exit data returned from failed boot.\r
-\r
-  ExitDataSize - Exit data size returned from failed boot.\r
-\r
-Returns:\r
-  \r
-  None.\r
-\r
---*/\r
-{\r
-  CHAR16  *TmpStr;\r
-\r
-  //\r
-  // If Boot returned with failed status then we need to pop up a UI and wait\r
-  // for user input.\r
-  //\r
-  TmpStr = Option->StatusString;\r
-  if (TmpStr != NULL) {\r
-    BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);\r
-    FreePool (TmpStr);\r
-  }\r
-}\r
-\r
-EFI_STATUS\r
-PlatformBdsNoConsoleAction (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  This function is remained for IBV/OEM to do some platform action,\r
-  if there no console device can be connected.\r
-\r
-Arguments:\r
-  \r
-  None.\r
-  \r
-Returns:\r
-  \r
-  EFI_SUCCESS      - Direct return success now.\r
-\r
---*/\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-PlatformBdsLockNonUpdatableFlash (\r
-  VOID\r
-  )\r
-{\r
-  return;\r
-}\r
-\r
-/**\r
-  Lock the ConsoleIn device in system table. All key\r
-  presses will be ignored until the Password is typed in. The only way to\r
-  disable the password is to type it in to a ConIn device.\r
-\r
-  @param  Password        Password used to lock ConIn device.\r
-\r
-  @retval EFI_SUCCESS     lock the Console In Spliter virtual handle successfully.\r
-  @retval EFI_UNSUPPORTED Password not found\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-LockKeyboards (\r
-  IN  CHAR16    *Password\r
-  )\r
-{\r
-    return EFI_UNSUPPORTED;\r
-}\r
diff --git a/UnixPkg/Library/UnixBdsLib/BdsPlatform.h b/UnixPkg/Library/UnixBdsLib/BdsPlatform.h
deleted file mode 100644 (file)
index d83923a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name: \r
-\r
-  BdsPlatform.h\r
-\r
-Abstract:\r
-\r
-  Head file for BDS Platform specific code\r
-\r
---*/\r
-\r
-#ifndef _BDS_PLATFORM_H\r
-#define _BDS_PLATFORM_H\r
-\r
-#include <PiDxe.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/GenericBdsLib.h>\r
-#include <Library/PlatformBdsLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-#include <Protocol/UnixThunk.h>\r
-#include <Protocol/UnixIo.h>\r
-#include <Guid/UnixSystemConfig.h>\r
-\r
-extern BDS_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];\r
-extern EFI_DEVICE_PATH_PROTOCOL   *gPlatformConnectSequence[];\r
-extern EFI_DEVICE_PATH_PROTOCOL   *gPlatformDriverOption[];\r
-\r
-#define gEndEntire \\r
-  { \\r
-    END_DEVICE_PATH_TYPE,\\r
-    END_ENTIRE_DEVICE_PATH_SUBTYPE,\\r
-    END_DEVICE_PATH_LENGTH,\\r
-    0\\r
-  }\r
-\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH  VendorDevicePath;\r
-  UINT32              Instance;\r
-} UNIX_VENDOR_DEVICE_PATH_NODE;\r
-\r
-//\r
-// Below is the platform console device path\r
-//\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH              UnixBus;\r
-  UNIX_VENDOR_DEVICE_PATH_NODE  SerialDevice;\r
-  UART_DEVICE_PATH                Uart;\r
-  VENDOR_DEVICE_PATH              TerminalType;\r
-  EFI_DEVICE_PATH_PROTOCOL        End;\r
-} UNIX_ISA_SERIAL_DEVICE_PATH;\r
-\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH              UnixBus;\r
-  UNIX_VENDOR_DEVICE_PATH_NODE  UnixUgaDevice;\r
-  EFI_DEVICE_PATH_PROTOCOL        End;\r
-} UNIX_PLATFORM_UGA_DEVICE_PATH;\r
-\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH              UnixBus;\r
-  UNIX_VENDOR_DEVICE_PATH_NODE   ConsoleDevice;\r
-  EFI_DEVICE_PATH_PROTOCOL        End;\r
-} UNIX_CONSOLE_DEVICE_PATH;\r
-//\r
-// Platform BDS Functions\r
-//\r
-VOID\r
-PlatformBdsGetDriverOption (\r
-  IN LIST_ENTRY               *BdsDriverLists\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-BdsMemoryTest (\r
-  EXTENDMEM_COVERAGE_LEVEL Level\r
-  )\r
-;\r
-\r
-\r
-VOID\r
-PlatformBdsConnectSequence (\r
-  VOID\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-ProcessCapsules (\r
-  EFI_BOOT_MODE BootMode\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-PlatformBdsConnectConsole (\r
-  IN BDS_CONSOLE_CONNECT_ENTRY   *PlatformConsole\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-PlatformBdsNoConsoleAction (\r
-  VOID\r
-  )\r
-;\r
-\r
-VOID\r
-PlatformBdsEnterFrontPage (\r
-  IN UINT16                 TimeoutDefault,\r
-  IN BOOLEAN                ConnectAllHappened\r
-  );\r
-\r
-#endif // _BDS_PLATFORM_H\r
diff --git a/UnixPkg/Library/UnixBdsLib/PlatformBds.inf b/UnixPkg/Library/UnixBdsLib/PlatformBds.inf
deleted file mode 100644 (file)
index 6974827..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-## @file\r
-# Platfrom BDS driver\r
-#\r
-# Do platform action customized by IBV/OEM.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PlatformBdsLib\r
-  FILE_GUID                      = f392b762-8985-11db-be87-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = PlatformBdsLib|DXE_DRIVER   \r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  BdsPlatform.c\r
-  PlatformData.c\r
-  BdsPlatform.h\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  MemoryAllocationLib\r
-  UefiBootServicesTableLib\r
-  UefiRuntimeServicesTableLib\r
-  BaseMemoryLib\r
-  DebugLib\r
-  PcdLib\r
-  GenericBdsLib\r
-  DevicePathLib\r
-\r
-\r
-[Guids]\r
-  gEfiUnixSystemConfigGuid\r
-\r
-[Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformBootTimeOut\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile\r
-  \r
-[Depex]\r
-  gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid\r
diff --git a/UnixPkg/Library/UnixBdsLib/PlatformData.c b/UnixPkg/Library/UnixBdsLib/PlatformData.c
deleted file mode 100644 (file)
index 449ad52..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name: \r
-\r
-  PlatformData.c\r
-\r
-Abstract:\r
-  \r
-  Defined the platform specific device path which will be used by\r
-  platform Bbd to perform the platform policy connect.\r
-\r
---*/\r
-\r
-#include "BdsPlatform.h"\r
-\r
-//\r
-// Predefined platform default time out value\r
-//\r
-UINT16                      gPlatformBootTimeOutDefault = 10;\r
-\r
-//\r
-// Platform specific keyboard device path\r
-//\r
-UNIX_PLATFORM_UGA_DEVICE_PATH gUgaDevicePath = \r
-{\r
-  {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_VENDOR_DP,\r
-      {\r
-        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
-      },\r
-      EFI_UNIX_THUNK_PROTOCOL_GUID\r
-  },\r
-  {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_VENDOR_DP,\r
-      {\r
-        (UINT8) (sizeof (UNIX_VENDOR_DEVICE_PATH_NODE)),\r
-        (UINT8) ((sizeof (UNIX_VENDOR_DEVICE_PATH_NODE)) >> 8)\r
-      },\r
-      EFI_UNIX_UGA_GUID,\r
-      0\r
-  },\r
-  gEndEntire\r
-};\r
-\r
-UNIX_PLATFORM_UGA_DEVICE_PATH gGopDevicePath = {\r
-  {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_VENDOR_DP,\r
-      {\r
-        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
-      },\r
-      EFI_UNIX_THUNK_PROTOCOL_GUID\r
-  },\r
-  {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_VENDOR_DP,\r
-      {\r
-        (UINT8) (sizeof (UNIX_VENDOR_DEVICE_PATH_NODE)),\r
-        (UINT8) ((sizeof (UNIX_VENDOR_DEVICE_PATH_NODE)) >> 8)\r
-      },\r
-      EFI_UNIX_GOP_GUID,\r
-      0\r
-  },\r
-  gEndEntire\r
-};\r
-\r
-UNIX_CONSOLE_DEVICE_PATH   gUnixConsoleDevicePath = {\r
-  {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_VENDOR_DP,\r
-      {\r
-        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
-      },\r
-      EFI_UNIX_THUNK_PROTOCOL_GUID\r
-  },\r
-  {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_VENDOR_DP,\r
-      {\r
-        (UINT8) (sizeof (UNIX_VENDOR_DEVICE_PATH_NODE)),\r
-        (UINT8) ((sizeof (UNIX_VENDOR_DEVICE_PATH_NODE)) >> 8)\r
-      },\r
-      EFI_UNIX_CONSOLE_GUID,\r
-      0  \r
-  },   \r
-  gEndEntire\r
-};\r
-//\r
-// Predefined platform default console device path\r
-//\r
-BDS_CONSOLE_CONNECT_ENTRY   gPlatformConsole[] = {\r
-  {\r
-    (EFI_DEVICE_PATH_PROTOCOL *) &gUnixConsoleDevicePath,\r
-    (CONSOLE_OUT | CONSOLE_IN)\r
-  },\r
-  {\r
-    (EFI_DEVICE_PATH_PROTOCOL *) &gUgaDevicePath,\r
-    (CONSOLE_OUT | CONSOLE_IN)\r
-  },\r
-  {\r
-    (EFI_DEVICE_PATH_PROTOCOL *) &gGopDevicePath,\r
-    (CONSOLE_OUT | CONSOLE_IN)\r
-  },\r
-  {\r
-    NULL,\r
-    0\r
-  }\r
-};\r
-\r
-//\r
-// Predefined platform specific driver option\r
-//\r
-EFI_DEVICE_PATH_PROTOCOL    *gPlatformDriverOption[] = { NULL };\r
-\r
-//\r
-// Predefined platform connect sequence\r
-//\r
-EFI_DEVICE_PATH_PROTOCOL    *gPlatformConnectSequence[] = { NULL };\r
diff --git a/UnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoader.c b/UnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoader.c
deleted file mode 100644 (file)
index 48e6461..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  TianoPeCoffLoader.c\r
-\r
-Abstract:\r
-\r
-  Wrap the Base PE/COFF loader with the PE COFF Protocol\r
-\r
-\r
---*/\r
-\r
-#include <Guid/PeiPeCoffLoader.h>\r
-\r
-#include <Library/EdkPeCoffLoaderLib.h>\r
-\r
-EFI_PEI_PE_COFF_LOADER_PROTOCOL  *mPeiEfiPeiPeCoffLoader;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeCoffLoaderConstructor (\r
-  IN EFI_FFS_FILE_HEADER      *FfsHeader,\r
-  IN EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  Status = (*PeiServices)->LocatePpi (\r
-                            PeiServices,\r
-                            &gEfiPeiPeCoffLoaderGuid,\r
-                            0,\r
-                            NULL,\r
-                            (VOID **)&mPeiEfiPeiPeCoffLoader\r
-                            );\r
-  return Status;\r
-}\r
-\r
-EFI_PEI_PE_COFF_LOADER_PROTOCOL *\r
-EFIAPI\r
-GetPeCoffLoaderProtocol (\r
-  )\r
-{\r
-  return mPeiEfiPeiPeCoffLoader;\r
-}\r
diff --git a/UnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoaderLib.inf b/UnixPkg/Library/UnixPeCoffLoaderLib/UnixPeCoffLoaderLib.inf
deleted file mode 100644 (file)
index ca2bad6..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-## @file\r
-# Component description file for the Nt32PeCoffLoaderLib library.\r
-#\r
-# EdkPeCoffLoaderLib library class for NT32 instance implemented by PeiPeCoffLoader PPI.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixPeCoffLoaderLib\r
-  FILE_GUID                      = f3cf597e-8985-11db-95f6-0040d02b1835\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = EdkPeCoffLoaderLib \r
-\r
-  CONSTRUCTOR                    = PeCoffLoaderConstructor\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  UnixPeCoffLoader.c\r
-\r
-\r
-[Guids]\r
-  gEfiPeiPeCoffLoaderGuid                       # SOMETIMES_CONSUMED\r
-\r
diff --git a/UnixPkg/License.txt b/UnixPkg/License.txt
deleted file mode 100644 (file)
index be68999..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) 2012, Intel Corporation. All rights reserved.\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions\r
-are met:\r
-\r
-* Redistributions of source code must retain the above copyright\r
-  notice, this list of conditions and the following disclaimer.\r
-* Redistributions in binary form must reproduce the above copyright\r
-  notice, this list of conditions and the following disclaimer in\r
-  the documentation and/or other materials provided with the\r
-  distribution.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\r
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
-POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/UnixPkg/MetronomeDxe/Metronome.c b/UnixPkg/MetronomeDxe/Metronome.c
deleted file mode 100644 (file)
index be2b7e7..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  Metronome.c\r
-\r
-Abstract:\r
-\r
-  UNIX Emulation Metronome Architectural Protocol Driver as defined in DXE CIS\r
-\r
---*/\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include <Protocol/Metronome.h>\r
-#include "Metronome.h"\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UnixLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-//\r
-// Global Variables\r
-//\r
-EFI_METRONOME_ARCH_PROTOCOL mMetronome = {\r
-  UnixMetronomeDriverWaitForTick,\r
-  TICK_PERIOD\r
-};\r
-\r
-//\r
-// Worker Functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixMetronomeDriverWaitForTick (\r
-  IN EFI_METRONOME_ARCH_PROTOCOL  *This,\r
-  IN UINT32                       TickNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The WaitForTick() function waits for the number of ticks specified by\r
-  TickNumber from a known time source in the platform.  If TickNumber of\r
-  ticks are detected, then EFI_SUCCESS is returned.  The actual time passed\r
-  between entry of this function and the first tick is between 0 and\r
-  TickPeriod 100 nS units.  If you want to guarantee that at least TickPeriod\r
-  time has elapsed, wait for two ticks.  This function waits for a hardware\r
-  event to determine when a tick occurs.  It is possible for interrupt\r
-  processing, or exception processing to interrupt the execution of the\r
-  WaitForTick() function.  Depending on the hardware source for the ticks, it\r
-  is possible for a tick to be missed.  This function cannot guarantee that\r
-  ticks will not be missed.  If a timeout occurs waiting for the specified\r
-  number of ticks, then EFI_TIMEOUT is returned.\r
-\r
-Arguments:\r
-\r
-  This       - The EFI_METRONOME_ARCH_PROTOCOL instance.\r
-  TickNumber - Number of ticks to wait.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The wait for the number of ticks specified by TickNumber\r
-                succeeded.\r
-\r
---*/\r
-{\r
-  UINT64  SleepTime;\r
-\r
-  //\r
-  // Calculate the time to sleep.  Win API smallest unit to sleep is 1 millisec\r
-  // Tick Period is in 100ns units, divide by 10000 to convert to ms\r
-  //\r
-  SleepTime = DivU64x32 (MultU64x32 ((UINT64) TickNumber, TICK_PERIOD) + 9999, 10000);\r
-  gUnix->Sleep ((UINT32) SleepTime);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixMetronomeDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the Metronome Architectural Protocol driver\r
-\r
-Arguments:\r
-\r
-  ImageHandle - ImageHandle of the loaded driver\r
-\r
-\r
-  SystemTable - Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Metronome Architectural Protocol created\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources available to initialize driver.\r
-\r
-  EFI_DEVICE_ERROR      - A device error occured attempting to initialize the driver.\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-\r
-  //\r
-  // Install the Metronome Architectural Protocol onto a new handle\r
-  //\r
-  Handle = NULL;\r
-  DEBUG ((EFI_D_ERROR, "*******************file %d line %d\n", __FUNCTION__, __LINE__));\r
-  Status = gBS->InstallProtocolInterface (\r
-                  &Handle,\r
-                  &gEfiMetronomeArchProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  &mMetronome\r
-                  );\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MetronomeDxe/Metronome.h b/UnixPkg/MetronomeDxe/Metronome.h
deleted file mode 100644 (file)
index 9f9c11f..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  Metronome.h\r
-\r
-Abstract:\r
-\r
-  UNIX Emulation Metronome Architectural Protocol Driver as defined in DXE CIS\r
-\r
---*/\r
-\r
-#ifndef _UNIX_THUNK_METRONOME_H_\r
-#define _UNIX_THUNK_METRONOME_H_\r
-\r
-\r
-\r
-//\r
-// Period of on tick in 100 nanosecond units\r
-//\r
-#define TICK_PERIOD 2000\r
-\r
-//\r
-// Function Prototypes\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixMetronomeDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixMetronomeDriverWaitForTick (\r
-  IN EFI_METRONOME_ARCH_PROTOCOL  *This,\r
-  IN UINT32                       TickNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  TickNumber  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/UnixPkg/MetronomeDxe/Metronome.inf b/UnixPkg/MetronomeDxe/Metronome.inf
deleted file mode 100644 (file)
index 95cd6f1..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-## @file\r
-# Unix Emulation Metronome Architectural Protocol Driver as defined in DXE CIS\r
-#\r
-# This metronome module simulates metronome by Sleep WinAPI.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Metronome\r
-  FILE_GUID                      = f348f6fe-8985-11db-b4c3-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = UnixMetronomeDriverInitialize\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  Metronome.h\r
-  Metronome.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-  \r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  UnixLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  DebugLib\r
-  BaseLib\r
-\r
-\r
-[Protocols]\r
-  gEfiMetronomeArchProtocolGuid                 # PROTOCOL ALWAYS_PRODUCED\r
-\r
-\r
-[Depex]\r
-  TRUE\r
-\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni
deleted file mode 100644 (file)
index 669654e..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c
deleted file mode 100644 (file)
index 373781a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscBaseBoardManufacturerData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer) = {\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_MANUFACTURER),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_PRODUCT_NAME),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_VERSION),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_SERIAL_NUMBER),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_ASSET_TAG),\r
-  STRING_TOKEN(STR_MISC_BASE_BOARD_CHASSIS_LOCATION),\r
-  {                         // BaseBoardFeatureFlags\r
-    1,                      // Motherboard\r
-    0,                      // RequiresDaughterCard\r
-    0,                      // Removable\r
-    1,                      // Replaceable,\r
-    0,                      // HotSwappable\r
-    0,                      // Reserved\r
-  },\r
-  EfiBaseBoardTypeUnknown,  // BaseBoardType\r
-  {                         // BaseBoardChassisLink\r
-    EFI_MISC_SUBCLASS_GUID, // ProducerName\r
-    1,                      // Instance\r
-    1,                      // SubInstance\r
-  },\r
-  0,                        // BaseBoardNumberLinks\r
-  {                         // LinkN\r
-    EFI_MISC_SUBCLASS_GUID, // ProducerName\r
-    1,                      // Instance\r
-    1,                      // SubInstance\r
-  },\r
-};\r
-\r
-/* eof - MiscBaseBoardManufacturerData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerFunction.c
deleted file mode 100644 (file)
index 0158ae9..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file\r
-  BaseBoard manufacturer information boot time changes.\r
-  SMBIOS type 2.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscBaseBoardManufacturer (Type 2).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer)\r
-{\r
-  CHAR8                           *OptionalStrStart;\r
-  UINTN                           ManuStrLen;\r
-  UINTN                           ProductStrLen;\r
-  UINTN                           VerStrLen;\r
-  UINTN                           AssertTagStrLen;\r
-  UINTN                           SerialNumStrLen;\r
-  UINTN                           ChassisStrLen;\r
-  EFI_STATUS                      Status;\r
-  EFI_STRING                      Manufacturer;\r
-  EFI_STRING                      Product;\r
-  EFI_STRING                      Version;\r
-  EFI_STRING                      SerialNumber;\r
-  EFI_STRING                      AssertTag;\r
-  EFI_STRING                      Chassis;\r
-  STRING_REF                      TokenToGet;\r
-  EFI_SMBIOS_HANDLE               SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE2              *SmbiosRecord;\r
-  EFI_MISC_BASE_BOARD_MANUFACTURER   *ForType2InputData;\r
-\r
-  ForType2InputData = (EFI_MISC_BASE_BOARD_MANUFACTURER *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);\r
-  Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ManuStrLen = StrLen(Manufacturer);\r
-  if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);\r
-  Product = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ProductStrLen = StrLen(Product);\r
-  if (ProductStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER);\r
-  SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumber);\r
-  if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG);\r
-  AssertTag = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  AssertTagStrLen = StrLen(AssertTag);\r
-  if (AssertTagStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION);\r
-  Chassis = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ChassisStrLen = StrLen(Chassis);\r
-  if (ChassisStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE3) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + ChassisStrLen +1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE3) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + ChassisStrLen +1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE2);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Manu will be the 1st optional string following the formatted structure.\r
-  // \r
-  SmbiosRecord->Manufacturer = 1;  \r
-  //\r
-  // ProductName will be the 2st optional string following the formatted structure.\r
-  // \r
-  SmbiosRecord->ProductName  = 2;  \r
-  //\r
-  // Version will be the 3rd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Version = 3;  \r
-  //\r
-  // SerialNumber will be the 4th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->SerialNumber = 4;  \r
-  //\r
-  // AssertTag will be the 5th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->AssetTag = 5;  \r
-\r
-  //\r
-  // LocationInChassis will be the 6th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->LocationInChassis = 6;  \r
-  SmbiosRecord->FeatureFlag = (*(BASE_BOARD_FEATURE_FLAGS*)&(ForType2InputData->BaseBoardFeatureFlags));\r
-  SmbiosRecord->ChassisHandle  = 0;\r
-  SmbiosRecord->BoardType      = (UINT8)ForType2InputData->BaseBoardType;\r
-  SmbiosRecord->NumberOfContainedObjectHandles = 0;\r
-  \r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  //\r
-  // Since we fill NumberOfContainedObjectHandles = 0 for simple, just after this filed to fill string\r
-  //\r
-  OptionalStrStart -= 2;\r
-  UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(Product, OptionalStrStart + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1);\r
-  UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1);\r
-  UnicodeStrToAsciiStr(AssertTag, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);\r
-  UnicodeStrToAsciiStr(Chassis, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni
deleted file mode 100644 (file)
index dda02d2..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c
deleted file mode 100644 (file)
index 5b86b8d..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscBiosVendorData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor) = {\r
-  STRING_TOKEN(STR_MISC_BIOS_VENDOR),       // BiosVendor\r
-  STRING_TOKEN(STR_MISC_BIOS_VERSION),      // BiosVersion\r
-  STRING_TOKEN(STR_MISC_BIOS_RELEASE_DATE), // BiosReleaseDate\r
-  0xBABE, // BiosStartingAddress\r
-  {       // BiosPhysicalDeviceSize\r
-    2,    // Value\r
-    3,    // Exponent\r
-  },\r
-  {       // BiosCharacteristics1\r
-    0,    // Reserved1                         :2\r
-    0,    // Unknown                           :1\r
-    1,    // BiosCharacteristicsNotSupported   :1\r
-    0,    // IsaIsSupported                    :1\r
-    0,    // McaIsSupported                    :1\r
-    0,    // EisaIsSupported                   :1\r
-    0,    // PciIsSupported                    :1\r
-    0,    // PcmciaIsSupported                 :1\r
-    0,    // PlugAndPlayIsSupported            :1\r
-    0,    // ApmIsSupported                    :1\r
-    0,    // BiosIsUpgradable                  :1\r
-    0,    // BiosShadowingAllowed              :1\r
-    0,    // VlVesaIsSupported                 :1\r
-    0,    // EscdSupportIsAvailable            :1\r
-    0,    // BootFromCdIsSupported             :1\r
-    0,    // SelectableBootIsSupported         :1\r
-    0,    // RomBiosIsSocketed                 :1\r
-    0,    // BootFromPcmciaIsSupported         :1\r
-    0,    // EDDSpecificationIsSupported       :1\r
-    0,    // JapaneseNecFloppyIsSupported      :1\r
-    0,    // JapaneseToshibaFloppyIsSupported  :1\r
-    0,    // Floppy525_360IsSupported          :1\r
-    0,    // Floppy525_12IsSupported           :1\r
-    0,    // Floppy35_720IsSupported           :1\r
-    0,    // Floppy35_288IsSupported           :1\r
-    0,    // PrintScreenIsSupported            :1\r
-    0,    // Keyboard8042IsSupported           :1\r
-    0,    // SerialIsSupported                 :1\r
-    0,    // PrinterIsSupported                :1\r
-    0,    // CgaMonoIsSupported                :1\r
-    0,    // NecPc98                           :1\r
-    0,    // AcpiIsSupported                   :1\r
-    0,    // UsbLegacyIsSupported              :1\r
-    0,    // AgpIsSupported                    :1\r
-    0,    // I20BootIsSupported                :1\r
-    0,    // Ls120BootIsSupported              :1\r
-    0,    // AtapiZipDriveBootIsSupported      :1\r
-    0,    // Boot1394IsSupported               :1\r
-    0,    // SmartBatteryIsSupported           :1\r
-    0,    // BiosBootSpecIsSupported           :1\r
-    0,    // FunctionKeyNetworkBootIsSupported :1\r
-    0     // Reserved                          :22\r
-  },\r
-  {       // BiosCharacteristics2\r
-    0,    // BiosReserved                      :16\r
-    0,    // SystemReserved                    :16\r
-    0     // Reserved                          :32\r
-  },\r
-};\r
-\r
-/* eof - MiscBiosVendorData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorFunction.c
deleted file mode 100644 (file)
index fbfb52f..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/** @file\r
-  BIOS vendor information boot time changes.\r
-  Misc. subclass type 2.\r
-  SMBIOS type 0.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-/**\r
-  This function returns the value & exponent to Base2 for a given\r
-  Hex value. This is used to calculate the BiosPhysicalDeviceSize.\r
-\r
-  @param Value                      The hex value which is to be converted into value-exponent form\r
-  @param Exponent                   The exponent out of the conversion\r
-\r
-  @retval EFI_SUCCESS               All parameters were valid and *Value & *Exponent have been set.\r
-  @retval EFI_INVALID_PARAMETER     Invalid parameter was found.\r
-  \r
-**/\r
-EFI_STATUS  \r
-GetValueExponentBase2(\r
-  IN OUT UINTN        *Value,\r
-  OUT    UINTN        *Exponent\r
-  )\r
-{\r
-  if ((Value == NULL) || (Exponent == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  while ((*Value % 2) == 0) {\r
-    *Value=*Value/2;\r
-    (*Exponent)++;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'\r
-  as the unit.\r
-\r
-  @param  Base2Data              Pointer to Base2_Data\r
-\r
-  @retval EFI_SUCCESS            Transform successfully.       \r
-  @retval EFI_INVALID_PARAMETER  Invalid parameter was found.    \r
-\r
-**/\r
-UINT16\r
-Base2ToByteWith64KUnit (\r
-  IN      EFI_EXP_BASE2_DATA  *Base2Data\r
-  )\r
-{  \r
-  UINT16              Value;\r
-  UINT16              Exponent;\r
-\r
-  Value     = Base2Data->Value;\r
-  Exponent  = Base2Data->Exponent;\r
-  Exponent -= 16;\r
-  Value <<= Exponent;\r
-\r
-  return Value;\r
-}\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscBiosVendor (Type 0).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.\r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor)\r
-{\r
-  CHAR8                 *OptionalStrStart;\r
-  UINTN                 VendorStrLen;\r
-  UINTN                 VerStrLen;\r
-  UINTN                 DateStrLen;\r
-  CHAR16                *Version;\r
-  CHAR16                *ReleaseDate;\r
-  EFI_STATUS            Status;\r
-  EFI_STRING            Char16String;\r
-  STRING_REF            TokenToGet;\r
-  STRING_REF            TokenToUpdate;\r
-  SMBIOS_TABLE_TYPE0    *SmbiosRecord;\r
-  EFI_SMBIOS_HANDLE     SmbiosHandle;\r
-  EFI_MISC_BIOS_VENDOR *ForType0InputData;\r
-\r
-  ForType0InputData        = (EFI_MISC_BIOS_VENDOR *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Version = (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString);\r
-  if (StrLen (Version) > 0) {     \r
-    TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);\r
-    HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL);\r
-  }\r
-  \r
-  ReleaseDate = (CHAR16 *) PcdGetPtr (PcdFirmwareReleaseDateString);\r
-  if (StrLen(ReleaseDate) > 0) {\r
-    TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);\r
-    HiiSetString (mHiiHandle, TokenToUpdate, ReleaseDate, NULL);\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR);\r
-  Char16String = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VendorStrLen = StrLen(Char16String);\r
-  if (VendorStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);\r
-  ReleaseDate = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  DateStrLen = StrLen(ReleaseDate);\r
-  if (DateStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;\r
-  //\r
-  // Vendor will be the 1st optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Vendor = 1;  \r
-  //\r
-  // Version will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->BiosVersion = 2;\r
-  SmbiosRecord->BiosSegment = (UINT16)ForType0InputData->BiosStartingAddress;\r
-  //\r
-  // ReleaseDate will be the 3rd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->BiosReleaseDate = 3;\r
-  //\r
-  // Nt32 has no PCD value to indicate BIOS Size, just fill 0 for simply.\r
-  //\r
-  SmbiosRecord->BiosSize = 0;\r
-  SmbiosRecord->BiosCharacteristics = *(MISC_BIOS_CHARACTERISTICS*)(&ForType0InputData->BiosCharacteristics1);\r
-  //\r
-  // CharacterExtensionBytes also store in ForType0InputData->BiosCharacteristics1 later two bytes to save size.\r
-  //\r
-  SmbiosRecord->BIOSCharacteristicsExtensionBytes[0] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 4);\r
-  SmbiosRecord->BIOSCharacteristicsExtensionBytes[1] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 5);\r
-\r
-  SmbiosRecord->SystemBiosMajorRelease = ForType0InputData->BiosMajorRelease;\r
-  SmbiosRecord->SystemBiosMinorRelease = ForType0InputData->BiosMinorRelease;\r
-  SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = ForType0InputData->BiosEmbeddedFirmwareMajorRelease;\r
-  SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = ForType0InputData->BiosEmbeddedFirmwareMinorRelease;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Char16String, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + VendorStrLen + 1);\r
-  UnicodeStrToAsciiStr(ReleaseDate, OptionalStrStart + VendorStrLen + 1 + VerStrLen + 1);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c
deleted file mode 100644 (file)
index 86fb2de..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscBootInformationData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus) = {\r
-  EfiBootInformationStatusNoError,  // BootInformationStatus\r
-  {0}                                 // BootInformationData\r
-};\r
-\r
-/* eof - MiscBootInformationData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationFunction.c
deleted file mode 100644 (file)
index fec5ecc..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/** @file\r
-  boot information boot time changes.\r
-  SMBIOS type 32.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscBootInformation (Type 32).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-\r
-MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)\r
-{\r
-  EFI_STATUS                         Status;\r
-  EFI_SMBIOS_HANDLE                  SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE32                *SmbiosRecord;\r
-  EFI_MISC_BOOT_INFORMATION_STATUS*  ForType32InputData;\r
\r
-  ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  SmbiosRecord->BootStatus = (UINT8)ForType32InputData->BootInformationStatus;\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni
deleted file mode 100644 (file)
index 177ff38..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c
deleted file mode 100644 (file)
index 4883f67..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscChassisManufacturerData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Chassis Manufacturer data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer) = {\r
-  STRING_TOKEN(STR_MISC_CHASSIS_MANUFACTURER),  // ChassisManufactrurer\r
-  STRING_TOKEN(STR_MISC_CHASSIS_VERSION),       // ChassisVersion\r
-  STRING_TOKEN(STR_MISC_CHASSIS_SERIAL_NUMBER), // ChassisSerialNumber\r
-  STRING_TOKEN(STR_MISC_CHASSIS_ASSET_TAG),     // ChassisAssetTag\r
-  {                               // ChassisTypeStatus\r
-    EfiMiscChassisTypeOther,      // ChassisType\r
-    0,                            // ChassisLockPresent\r
-    0                             // Reserved\r
-  },\r
-  EfiChassisStateOther,           // ChassisBootupState\r
-  EfiChassisStateOther,           // ChassisPowerSupplyState\r
-  EfiChassisStateOther,           // ChassisThermalState\r
-  EfiChassisSecurityStatusOther,  // ChassisSecurityState\r
-  0                               // ChassisOemDefined\r
-};\r
-\r
-/* eof - MiscChassisManufacaturerData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerFunction.c
deleted file mode 100644 (file)
index ce89603..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/** @file\r
-  Chassis manufacturer information boot time changes.\r
-  SMBIOS type 3.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscChassisManufacturer (Type 3).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer)\r
-{\r
-  CHAR8                           *OptionalStrStart;\r
-  UINTN                           ManuStrLen;\r
-  UINTN                           VerStrLen;\r
-  UINTN                           AssertTagStrLen;\r
-  UINTN                           SerialNumStrLen;\r
-  EFI_STATUS                      Status;\r
-  EFI_STRING                      Manufacturer;\r
-  EFI_STRING                      Version;\r
-  EFI_STRING                      SerialNumber;\r
-  EFI_STRING                      AssertTag;\r
-  STRING_REF                      TokenToGet;\r
-  EFI_SMBIOS_HANDLE               SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE3              *SmbiosRecord;\r
-  EFI_MISC_CHASSIS_MANUFACTURER   *ForType3InputData;\r
-\r
-  ForType3InputData = (EFI_MISC_CHASSIS_MANUFACTURER *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER);\r
-  Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ManuStrLen = StrLen(Manufacturer);\r
-  if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER);\r
-  SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumber);\r
-  if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG);\r
-  AssertTag = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  AssertTagStrLen = StrLen(AssertTag);\r
-  if (AssertTagStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE3) + ManuStrLen + 1  + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE3) + ManuStrLen + 1  + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE3);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Manu will be the 1st optional string following the formatted structure.\r
-  // \r
-  SmbiosRecord->Manufacturer = 1;  \r
-  SmbiosRecord->Type = (UINT8)ForType3InputData->ChassisType.ChassisType;\r
-  //\r
-  // Version will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Version = 2;  \r
-  //\r
-  // SerialNumber will be the 3rd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->SerialNumber = 3;  \r
-  //\r
-  // AssertTag will be the 4th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->AssetTag = 4;  \r
-  SmbiosRecord->BootupState = (UINT8)ForType3InputData->ChassisBootupState;\r
-  SmbiosRecord->PowerSupplyState = (UINT8)ForType3InputData->ChassisPowerSupplyState;\r
-  SmbiosRecord->ThermalState = (UINT8)ForType3InputData->ChassisThermalState;\r
-  SmbiosRecord->SecurityStatus = (UINT8)ForType3InputData->ChassisSecurityState;\r
-  CopyMem (SmbiosRecord->OemDefined,(UINT8*)&ForType3InputData->ChassisOemDefined, 4);\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1);\r
-  UnicodeStrToAsciiStr(AssertTag, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h b/UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h
deleted file mode 100644 (file)
index f9f64a1..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*++\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscDevicePath.h\r
-\r
-Abstract:\r
-\r
-  Misc class required EFI Device Path definitions (Ports, slots & \r
-  onboard devices)\r
-\r
---*/\r
-\r
-#ifndef _MISC_DEVICE_PATH_H\r
-#define _MISC_DEVICE_PATH_H\r
-\r
-\r
-#pragma pack(1)\r
-//\r
-// USB\r
-//\r
-\r
-/* For reference:\r
-#define USB1_1_STR  "ACPI(PNP0A03,0)/PCI(1D,0)."\r
-#define USB1_2_STR  "ACPI(PNP0A03,0)/PCI(1D,1)."\r
-#define USB1_3_STR  "ACPI(PNP0A03,0)/PCI(1D,2)."\r
-#define USB2_1_STR  "ACPI(PNP0A03,0)/PCI(1D,7)." \r
-*/\r
-\r
-//\r
-// #define acpi { 0x02, 0x01, 0x00, 0x0C, 0x0a0341d0, 0x00000000 }\r
-// #define pci( device,function)  { 0x01, 0x01, 0x00, 0x06, device, function }\r
-// #define end  { 0xFF, 0xFF, 0x00, 0x04 }\r
-//\r
-#define DP_ACPI \\r
-  { \\r
-      {ACPI_DEVICE_PATH, ACPI_DP, {(UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \\r
-      ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)}}, EISA_PNP_ID (0x0A03), 0 \\r
-  }\r
-#define DP_PCI(device, function) \\r
-  { \\r
-      {HARDWARE_DEVICE_PATH, HW_PCI_DP, {(UINT8) (sizeof (PCI_DEVICE_PATH)), (UINT8) \\r
-       ((sizeof (PCI_DEVICE_PATH)) >> 8)}}, function, device \\r
-  }\r
-#define DP_END \\r
-  { \\r
-    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0} \\r
-  }\r
-\r
-#define DP_LPC(eisaid, function) \\r
-  { \\r
-    {ACPI_DEVICE_PATH, ACPI_DP, {(UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \\r
-     ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)}}, EISA_PNP_ID (eisaid), function \\r
-  }\r
-\r
-//\r
-// Shanmu >> moved to TianoDevicePath.h\r
-//\r
-\r
-/*\r
-typedef struct _USB_PORT_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} USB_PORT_DEVICE_PATH;\r
-\r
-\r
-//IDE ??I am not sure. Should this be ATAPI_DEVICE_PATH\r
-typedef struct _IDE_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} IDE_DEVICE_PATH;\r
-\r
-//RMC Connector\r
-typedef struct _RMC_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} RMC_CONN_DEVICE_PATH;\r
-\r
-//static RMC_CONN_DEVICE_PATH mRmcConnDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x0A,0x00 ), end };\r
-\r
-//RIDE\r
-typedef struct _RIDE_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBridgeDevicePath;\r
-  PCI_DEVICE_PATH      PciBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} RIDE_DEVICE_PATH;\r
-\r
-//static RIDE_DEVICE_PATH mRideDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x02,0x00 ), end };\r
-\r
-//Gigabit NIC\r
-//typedef struct _GB_NIC_DEVICE_PATH\r
-//{\r
-//  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
-//  PCI_DEVICE_PATH            PciBridgeDevicePath;\r
-//  PCI_DEVICE_PATH            PciXBridgeDevicePath;\r
-//  PCI_DEVICE_PATH            PciXBusDevicePath;\r
-//  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-//} GB_NIC_DEVICE_PATH;\r
-\r
-//static GB_NIC_DEVICE_PATH mGbNicDevicePath = { acpi, pci( 0x03,0x00 ),pci( 0x1F,0x00 ),pci( 0x07,0x00 ), end };\r
-\r
-\r
-//P/S2 Connector\r
-typedef struct _PS2_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} PS2_CONN_DEVICE_PATH;\r
-\r
-//static PS2_CONN_DEVICE_PATH mPs2KeyboardDevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,0 ), end };\r
-//static PS2_CONN_DEVICE_PATH mPs2MouseDevicePath      = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,1 ), end };\r
-\r
-//Serial Port Connector\r
-typedef struct _SERIAL_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} SERIAL_CONN_DEVICE_PATH;\r
-\r
-//static SERIAL_CONN_DEVICE_PATH mCom1DevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,0 ), end };\r
-//static SERIAL_CONN_DEVICE_PATH mCom2DevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,1 ), end };\r
-\r
-//Parallel Port Connector\r
-typedef struct _PARALLEL_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} PARALLEL_CONN_DEVICE_PATH;\r
-\r
-//static PARALLEL_CONN_DEVICE_PATH mLpt1DevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0401,0 ), end };\r
-\r
-//Floopy Connector\r
-typedef struct _FLOOPY_CONN_DEVICE_PATH\r
-{\r
-  ACPI_HID_DEVICE_PATH    PciRootBridgeDevicePath;\r
-  PCI_DEVICE_PATH      LpcBridgeDevicePath;\r
-  ACPI_HID_DEVICE_PATH    LpcBusDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} FLOOPY_CONN_DEVICE_PATH;\r
-\r
-//static FLOOPY_CONN_DEVICE_PATH mFloopyADevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,0 ), end };\r
-//static FLOOPY_CONN_DEVICE_PATH mFloopyBDevicePath   = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,1 ), end };\r
-\r
-*/\r
-\r
-//\r
-// End Shanmu\r
-//\r
-#pragma pack()\r
-\r
-#endif\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c
deleted file mode 100644 (file)
index 4ebb633..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscNumberOfInstallableLanguagesData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA, NumberOfInstallableLanguages)\r
-= {\r
-  1,    // NumberOfInstallableLanguages\r
-  {     // LanguageFlags\r
-    0,  // AbbreviatedLanguageFormat\r
-    0   // Reserved\r
-  },\r
-  0,    // CurrentLanguageNumber\r
-};\r
-\r
-/* eof - MiscNumberOfInstallableLanguagesData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c
deleted file mode 100644 (file)
index 6eff73e..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/** @file\r
-  This driver parses the mSmbiosMiscDataTable structure and reports\r
-  any generated data.\r
-\r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-/*++\r
-  Check whether the language is supported for given HII handle\r
-\r
-  @param   HiiHandle     The HII package list handle.\r
-  @param   Offset        The offest of current lanague in the supported languages.\r
-  @param   CurrentLang   The language code.\r
-\r
-  @retval  TRUE          Supported.\r
-  @retval  FALSE         Not Supported.\r
-\r
---*/\r
-VOID\r
-EFIAPI\r
-CurrentLanguageMatch (\r
-  IN  EFI_HII_HANDLE                   HiiHandle,\r
-  OUT UINT16                           *Offset,\r
-  OUT CHAR8                            *CurrentLang\r
-  )\r
-{\r
-  CHAR8     *DefaultLang;\r
-  CHAR8     *BestLanguage;\r
-  CHAR8     *Languages;\r
-  CHAR8     *MatchLang;\r
-  CHAR8     *EndMatchLang;\r
-  UINTN     CompareLength;\r
-  \r
-  Languages = HiiGetSupportedLanguages (HiiHandle);\r
-  if (Languages == NULL) {\r
-    return;\r
-  }\r
-\r
-  GetEfiGlobalVariable2 (L"PlatformLang", (VOID**)&CurrentLang, NULL);\r
-  DefaultLang  = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);\r
-  BestLanguage = GetBestLanguage (\r
-                   Languages,\r
-                   FALSE,\r
-                   (CurrentLang != NULL) ? CurrentLang : "",\r
-                   DefaultLang,\r
-                   NULL\r
-                   );\r
-  if (BestLanguage != NULL) {\r
-    //\r
-    // Find the best matching RFC 4646 language, compute the offset.\r
-    //\r
-    CompareLength = AsciiStrLen (BestLanguage);\r
-    for (MatchLang = Languages, (*Offset) = 0; MatchLang != '\0'; (*Offset)++) {\r
-      //\r
-      // Seek to the end of current match language. \r
-      //\r
-      for (EndMatchLang = MatchLang; *EndMatchLang != '\0' && *EndMatchLang != ';'; EndMatchLang++);\r
-  \r
-      if ((EndMatchLang == MatchLang + CompareLength) && AsciiStrnCmp(MatchLang, BestLanguage, CompareLength) == 0) {\r
-        //\r
-        // Find the current best Language in the supported languages\r
-        //\r
-        break;\r
-      }\r
-      //\r
-      // best language match be in the supported language.\r
-      //\r
-      ASSERT (*EndMatchLang == ';');\r
-      MatchLang = EndMatchLang + 1;\r
-    }\r
-    FreePool (BestLanguage);\r
-  }\r
-\r
-  FreePool (Languages);\r
-  if (CurrentLang != NULL) {\r
-    FreePool (CurrentLang);\r
-  }\r
-  return ;\r
-}\r
-\r
-\r
-/**\r
-  Get next language from language code list (with separator ';').\r
-\r
-  @param  LangCode       Input: point to first language in the list. On\r
-                         Otput: point to next language in the list, or\r
-                                NULL if no more language in the list.\r
-  @param  Lang           The first language in the list.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-GetNextLanguage (\r
-  IN OUT CHAR8      **LangCode,\r
-  OUT CHAR8         *Lang\r
-  )\r
-{\r
-  UINTN  Index;\r
-  CHAR8  *StringPtr;\r
-\r
-  ASSERT (LangCode != NULL);\r
-  ASSERT (*LangCode != NULL);\r
-  ASSERT (Lang != NULL);\r
-\r
-  Index     = 0;\r
-  StringPtr = *LangCode;\r
-  while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {\r
-    Index++;\r
-  }\r
-\r
-  CopyMem (Lang, StringPtr, Index);\r
-  Lang[Index] = 0;\r
-\r
-  if (StringPtr[Index] == ';') {\r
-    Index++;\r
-  }\r
-  *LangCode = StringPtr + Index;\r
-}\r
-\r
-/**\r
-  This function returns the number of supported languages on HiiHandle.\r
-\r
-  @param   HiiHandle    The HII package list handle.\r
-\r
-  @retval  The number of supported languages.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-GetSupportedLanguageNumber (\r
-  IN EFI_HII_HANDLE    HiiHandle\r
-  )\r
-{\r
-  CHAR8   *Lang;\r
-  CHAR8   *Languages;\r
-  CHAR8   *LanguageString;\r
-  UINT16  LangNumber;\r
-  \r
-  Languages = HiiGetSupportedLanguages (HiiHandle);\r
-  if (Languages == NULL) {\r
-    return 0;\r
-  }\r
-\r
-  LangNumber = 0;\r
-  Lang = AllocatePool (AsciiStrSize (Languages));\r
-  if (Lang != NULL) {\r
-    LanguageString = Languages;\r
-    while (*LanguageString != 0) {\r
-      GetNextLanguage (&LanguageString, Lang);\r
-      LangNumber++;\r
-    }\r
-    FreePool (Lang);\r
-  }\r
-  FreePool (Languages);\r
-  return LangNumber;\r
-}\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscNumberOfInstallableLanguages (Type 13).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.\r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(NumberOfInstallableLanguages)\r
-{\r
-  UINTN                                     LangStrLen;\r
-  CHAR8                                     CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1];\r
-  CHAR8                                     *OptionalStrStart;\r
-  UINT16                                    Offset;\r
-  EFI_STATUS                                Status;\r
-  EFI_SMBIOS_HANDLE                         SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE13                       *SmbiosRecord;\r
-  EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES  *ForType13InputData;\r
\r
-  ForType13InputData = (EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  ForType13InputData->NumberOfInstallableLanguages = GetSupportedLanguageNumber (mHiiHandle);\r
-\r
-  //\r
-  // Try to check if current langcode matches with the langcodes in installed languages\r
-  //\r
-  ZeroMem(CurrentLang, SMBIOS_STRING_MAX_LENGTH + 1);\r
-  CurrentLanguageMatch (mHiiHandle, &Offset, CurrentLang);\r
-  LangStrLen = AsciiStrLen(CurrentLang);\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-\r
-  SmbiosRecord->InstallableLanguages = (UINT8)ForType13InputData->NumberOfInstallableLanguages;\r
-  SmbiosRecord->Flags = (UINT8)ForType13InputData->LanguageFlags.AbbreviatedLanguageFormat;\r
-  SmbiosRecord->CurrentLanguages = 1;\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  AsciiStrCpy(OptionalStrStart, CurrentLang);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni
deleted file mode 100644 (file)
index 782a83b..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscOemStringData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscOemStringData.c
deleted file mode 100644 (file)
index 0ec8d35..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  \r
-    MiscOemStringData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_STRING_DATA, OemString) = {\r
-  { STRING_TOKEN(STR_MISC_OEM_STRING) }\r
-};\r
-\r
-/* eof - MiscOemStringData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscOemStringFunction.c
deleted file mode 100644 (file)
index f0401ce..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/** @file\r
-  boot information boot time changes.\r
-  SMBIOS type 11.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscOemString (Type 11).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(OemString)\r
-{\r
-  UINTN                    OemStrLen;\r
-  CHAR8                    *OptionalStrStart;\r
-  EFI_STATUS               Status;\r
-  EFI_STRING               OemStr;\r
-  STRING_REF               TokenToGet;\r
-  EFI_SMBIOS_HANDLE        SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE11      *SmbiosRecord;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_OEM_STRING);\r
-  OemStr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  OemStrLen = StrLen(OemStr);\r
-  if (OemStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_OEM_STRINGS;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE11);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  SmbiosRecord->StringCount = 1;\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(OemStr, OptionalStrStart);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni
deleted file mode 100644 (file)
index 87c5a81..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c
deleted file mode 100644 (file)
index 354a7d1..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscPortInternalConnectorDesignatorData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortInternalConnectorDesignator) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR),  // PortInternalConnectorDesignator\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR),  // PortExternalConnectorDesignator\r
-  EfiPortConnectorTypeOther,  // PortInternalConnectorType\r
-  EfiPortConnectorTypeOther,  // PortExternalConnectorType\r
-  EfiPortTypeNone,            // PortType\r
-  {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath\r
-};\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortKeyboard) = {\r
-  STRING_TOKEN (STR_MISC_PORT_INTERNAL_KEYBOARD),   // PortInternalConnectorDesignator\r
-  STRING_TOKEN (STR_MISC_PORT_EXTERNAL_KEYBOARD),   // PortExternalConnectorDesignator\r
-  EfiPortConnectorTypeNone, // PortInternalConnectorType\r
-  EfiPortConnectorTypePS2,  // PortExternalConnectorType\r
-  EfiPortTypeKeyboard,      // PortType\r
-  // mPs2KbyboardDevicePath                          // PortPath\r
-  //\r
-  {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortMouse) = {\r
-  STRING_TOKEN (STR_MISC_PORT_INTERNAL_MOUSE),      // PortInternalConnectorDesignator\r
-  STRING_TOKEN (STR_MISC_PORT_EXTERNAL_MOUSE),      // PortExternalConnectorDesignator\r
-  EfiPortConnectorTypeNone, // PortInternalConnectorType\r
-  EfiPortConnectorTypePS2,  // PortExternalConnectorType\r
-  EfiPortTypeMouse,         // PortType\r
-  // mPs2MouseDevicePath                // PortPath\r
-  //\r
-  {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath\r
-};\r
-\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom1) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM1),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM1),\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortConnectorTypeDB9Female,\r
-  EfiPortTypeSerial16550ACompatible,\r
-  {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom2) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM2),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM2),\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortConnectorTypeDB9Female,\r
-  EfiPortTypeSerial16550ACompatible,\r
-  {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortExtensionPower) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_EXTENSION_POWER),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_EXTENSION_POWER),\r
-  EfiPortConnectorTypeOther,\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortTypeOther,\r
-  {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath\r
-};\r
-\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortFloppy) = {\r
-  STRING_TOKEN(STR_MISC_PORT_INTERNAL_FLOPPY),\r
-  STRING_TOKEN(STR_MISC_PORT_EXTERNAL_FLOPPY),\r
-  EfiPortConnectorTypeOnboardFloppy,\r
-  EfiPortConnectorTypeNone,\r
-  EfiPortTypeOther,\r
-  {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath\r
-};\r
-\r
-/* eof - MiscPortInternalConnectorDesignatorData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c
deleted file mode 100644 (file)
index 9f7708b..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*++\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscPortInternalConnectorDesignatorFunction.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-\r
-MISC_SMBIOS_TABLE_FUNCTION (\r
-  MiscPortInternalConnectorDesignator\r
-  )\r
-/*++\r
-Description:\r
-\r
-  This function makes boot time changes to the contents of the\r
-  MiscPortConnectorInformation (Type 8).\r
-\r
-Parameters:\r
-\r
-  RecordType\r
-    Type of record to be processed from the Data Table.\r
-    mMiscSubclassDataTable[].RecordType\r
-\r
-  RecordLen\r
-    Size of static RecordData from the Data Table.\r
-    mMiscSubclassDataTable[].RecordLen\r
-\r
-  RecordData\r
-    Pointer to copy of RecordData from the Data Table.  Changes made\r
-    to this copy will be written to the Data Hub but will not alter\r
-    the contents of the static Data Table.\r
-\r
-  LogRecordData\r
-    Set *LogRecordData to TRUE to log RecordData to Data Hub.\r
-    Set *LogRecordData to FALSE when there is no more data to log.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-    All parameters were valid and *RecordData and *LogRecordData have\r
-    been set.\r
-\r
-  EFI_UNSUPPORTED\r
-    Unexpected RecordType value.\r
-\r
-  EFI_INVALID_PARAMETER\r
-    One of the following parameter conditions was true:\r
-      RecordLen was zero.\r
-      RecordData was NULL.\r
-      LogRecordData was NULL.\r
---*/\r
-{\r
-  CHAR8                                        *OptionalStrStart;\r
-  UINTN                                        InternalRefStrLen;\r
-  UINTN                                        ExternalRefStrLen;  \r
-  EFI_STRING                                   InternalRef;\r
-  EFI_STRING                                   ExternalRef;\r
-  STRING_REF                                   TokenForInternal;\r
-  STRING_REF                                   TokenForExternal;\r
-  EFI_STATUS                                   Status;\r
-  SMBIOS_TABLE_TYPE8                           *SmbiosRecord;\r
-  EFI_SMBIOS_HANDLE                            SmbiosHandle;\r
-  EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR  *ForType8InputData;\r
-  \r
-  ForType8InputData = (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *)RecordData;\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenForInternal = 0;\r
-  TokenForExternal = 0;\r
-  \r
-  switch (ForType8InputData->PortInternalConnectorDesignator) { \r
-\r
-    case STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_KEYBOARD:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_KEYBOARD);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_KEYBOARD);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_MOUSE:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_MOUSE);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_MOUSE);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_COM1:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_COM1);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM1);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_COM2:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_COM2);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM2);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_EXTENSION_POWER:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_EXTENSION_POWER);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_EXTENSION_POWER);\r
-      break;\r
-    case STR_MISC_PORT_INTERNAL_FLOPPY:\r
-      TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_FLOPPY);\r
-      TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_FLOPPY);\r
-      break;\r
-    default:\r
-      break;\r
-  }\r
-\r
-  InternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForInternal, NULL);\r
-  InternalRefStrLen = StrLen(InternalRef);\r
-  if (InternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  ExternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForExternal, NULL);\r
-  ExternalRefStrLen = StrLen(ExternalRef);\r
-  if (ExternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE8);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  SmbiosRecord->InternalReferenceDesignator = 1;\r
-  SmbiosRecord->InternalConnectorType = (UINT8)ForType8InputData->PortInternalConnectorType;\r
-  SmbiosRecord->ExternalReferenceDesignator = 2;\r
-  SmbiosRecord->ExternalConnectorType = (UINT8)ForType8InputData->PortExternalConnectorType;\r
-  SmbiosRecord->PortType = (UINT8)ForType8InputData->PortType;\r
-  \r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(InternalRef, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(ExternalRef, OptionalStrStart + InternalRefStrLen + 1);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
-\r
-\r
-/* eof - MiscSystemManufacturerFunction.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c
deleted file mode 100644 (file)
index 33f0f6b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  \r
-    MiscResetCapabilitiesData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities) = {\r
-  {     // ResetCapabilities\r
-    0,  // Status\r
-    0,  // BootOption\r
-    0,  // BootOptionOnLimit\r
-    0,  // WatchdogTimerPresent\r
-    0   // Reserved\r
-  },\r
-  0,    // ResetCount\r
-  0,    // ResetLimit\r
-  0,    // ResetTimerInterval\r
-  0     // ResetTimeout\r
-};\r
-\r
-/* eof - MiscResetCapabilities.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesFunction.c
deleted file mode 100644 (file)
index 588f9d6..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/** @file\r
-  ResetCapabilities.\r
-  SMBIOS type 23.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscOemString (Type 11).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)\r
-{\r
-  EFI_STATUS               Status;\r
-  EFI_SMBIOS_HANDLE        SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE23      *SmbiosRecord;\r
-  EFI_MISC_RESET_CAPABILITIES   *ForType23InputData;\r
-  \r
-  ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle    = 0;  \r
-  SmbiosRecord->Capabilities  = *(UINT8*)&(ForType23InputData->ResetCapabilities);\r
-  SmbiosRecord->ResetCount    = (UINT16)ForType23InputData->ResetCount;\r
-  SmbiosRecord->ResetLimit    = (UINT16)ForType23InputData->ResetLimit;  \r
-  SmbiosRecord->TimerInterval = (UINT16)ForType23InputData->ResetTimerInterval;\r
-  SmbiosRecord->Timeout       = (UINT16)ForType23InputData->ResetTimeout;\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h
deleted file mode 100644 (file)
index b682aeb..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  MiscSubclassDriver.h\r
-\r
-Abstract:\r
-\r
-  Header file for MiscSubclass Driver.\r
-\r
---*/\r
-\r
-#ifndef _MISC_SUBCLASS_DRIVER_H\r
-#define _MISC_SUBCLASS_DRIVER_H\r
-\r
-#include <FrameworkDxe.h>\r
-#include <UnixDxe.h>\r
-#include <Guid/DataHubRecords.h>\r
-#include <IndustryStandard/SmBios.h>\r
-#include <Protocol/Smbios.h>\r
-#include <Protocol/UnixIo.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-\r
-#include <MiscDevicePath.h>\r
-#include <Protocol/FrameworkHii.h>\r
-#include <Library/HiiLib.h>\r
-\r
-//\r
-// Data table entry update function.\r
-//\r
-typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (\r
-  IN  VOID                 *RecordData,\r
-  IN  EFI_SMBIOS_PROTOCOL  *Smbios\r
-  );\r
-\r
-//\r
-// Data table entry definition.\r
-//\r
-typedef struct {\r
-  //\r
-  // intermediat input data for SMBIOS record\r
-  //\r
-  VOID                              *RecordData;\r
-  EFI_MISC_SMBIOS_DATA_FUNCTION     *Function;\r
-} EFI_MISC_SMBIOS_DATA_TABLE;\r
-\r
-//\r
-// Data Table extern definitions.\r
-//\r
-#define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \\r
-extern NAME1 NAME2 ## Data; \\r
-extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function\r
-\r
-\r
-//\r
-// Data Table entries\r
-//\r
-#define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \\r
-{ \\r
-  & NAME1 ## Data, \\r
-  & NAME2 ## Function \\r
-}\r
-\r
-//\r
-// Global definition macros.\r
-//\r
-#define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \\r
-  NAME1 NAME2 ## Data\r
-\r
-#define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \\r
-  EFI_STATUS EFIAPI NAME2 ## Function( \\r
-  IN  VOID                  *RecordData, \\r
-  IN  EFI_SMBIOS_PROTOCOL   *Smbios \\r
-  )\r
-\r
-\r
-//\r
-// Data Table Array\r
-//\r
-extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];\r
-\r
-//\r
-// Data Table Array Entries\r
-//\r
-extern UINTN                        mMiscSubclassDataTableEntries;\r
-extern UINT8                        MiscSubclassStrings[];\r
-extern EFI_HII_HANDLE               mHiiHandle;\r
-\r
-/**\r
-  Add an SMBIOS record.\r
-\r
-  @param  Smbios                The EFI_SMBIOS_PROTOCOL instance.\r
-  @param  SmbiosHandle          A unique handle will be assigned to the SMBIOS record.\r
-  @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
-                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
-                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
-                                a set of null terminated strings and a null.\r
-\r
-  @retval EFI_SUCCESS           Record was added.\r
-  @retval EFI_OUT_OF_RESOURCES  Record was not added due to lack of system resources.\r
-\r
-**/\r
-EFI_STATUS\r
-AddSmbiosRecord (\r
-  IN EFI_SMBIOS_PROTOCOL        *Smbios,\r
-  OUT EFI_SMBIOS_HANDLE         *SmbiosHandle,\r
-  IN EFI_SMBIOS_TABLE_HEADER    *Record\r
-  );\r
-\r
-#endif /* _MISC_SUBCLASS_DRIVER_H */\r
-\r
-/* eof - MiscSubclassDriver.h */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf
deleted file mode 100644 (file)
index bb7dab6..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-## @file\r
-# Misc Sub class driver\r
-#\r
-# Parses the MiscSubclassDataTable and reports any generated data to the DataHub.\r
-#  All .uni file who tagged with "ToolCode="DUMMY"" in following file list is included by\r
-#  MiscSubclassDriver.uni file, the StrGather tool will expand MiscSubclassDriver.uni file \r
-#  and parse all .uni file.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = MiscSubclass\r
-  FILE_GUID                      = f2fbd108-8985-11db-b06a-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = MiscSubclassDriverEntryPoint\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  MiscBaseBoardManufacturer.uni\r
-  MiscBaseBoardManufacturerData.c\r
-  MiscBaseBoardManufacturerFunction.c\r
-  MiscBiosVendor.uni\r
-  MiscBiosVendorData.c\r
-  MiscBiosVendorFunction.c\r
-  MiscBootInformationData.c  \r
-  MiscBootInformationFunction.c\r
-  MiscChassisManufacturer.uni\r
-  MiscChassisManufacturerData.c\r
-  MiscChassisManufacturerFunction.c\r
-  MiscNumberOfInstallableLanguagesData.c\r
-  MiscNumberOfInstallableLanguagesFunction.c\r
-  MiscOemString.uni  \r
-  MiscOemStringData.c  \r
-  MiscOemStringFunction.c  \r
-  MiscPortInternalConnectorDesignator.uni\r
-  MiscPortInternalConnectorDesignatorData.c  \r
-  MiscPortInternalConnectorDesignatorFunction.c\r
-  MiscResetCapabilitiesData.c\r
-  MiscResetCapabilitiesFunction.c\r
-  MiscSystemLanguageString.uni\r
-  MiscSystemLanguageStringData.c\r
-  MiscSystemLanguageStringFunction.c\r
-  MiscSystemManufacturer.uni\r
-  MiscSystemManufacturerData.c\r
-  MiscSystemManufacturerFunction.c\r
-  MiscSystemOptionString.uni\r
-  MiscSystemOptionStringData.c\r
-  MiscSystemOptionStringFunction.c\r
-  MiscSystemSlotDesignation.uni\r
-  MiscSystemSlotDesignationData.c\r
-  MiscSystemSlotDesignationFunction.c\r
-  MiscDevicePath.h\r
-  MiscSubClassDriver.h\r
-  MiscSubClassDriver.uni\r
-  MiscSubclassDriverDataTable.c\r
-  MiscSubclassDriverEntryPoint.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  DevicePathLib\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  HiiLib\r
-  DebugLib\r
-  BaseLib\r
-  PcdLib\r
-\r
-[Protocols]\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL_NOTIFY SOMETIMES_CONSUMED\r
-  gEfiSmbiosProtocolGuid                        # PROTOCOL ALWAYS_CONSUMED\r
-\r
-[Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySize\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang\r
-\r
-[Depex]\r
-  gEfiSmbiosProtocolGuid\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni
deleted file mode 100644 (file)
index 7a4e8a2..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c
deleted file mode 100644 (file)
index 1d0df8e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscSubclassDriverDataTable.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-\r
-//\r
-// External definitions referenced by Data Table entries.\r
-//\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer, MiscBaseBoardManufacturer);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor,MiscBiosVendor );\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus, BootInformationStatus);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer, MiscChassisManufacturer);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA,NumberOfInstallableLanguages, NumberOfInstallableLanguages);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_OEM_STRING_DATA,OemString, OemString);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortInternalConnectorDesignator, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortKeyboard, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortMouse, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom1, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom2, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortExtensionPower, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortFloppy, MiscPortInternalConnectorDesignator);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities, MiscResetCapabilities);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA,SystemLanguageString, SystemLanguageString);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer, MiscSystemManufacturer);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString, SystemOptionString);\r
-MISC_SMBIOS_TABLE_EXTERNS ( EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotDesignation, MiscSystemSlotDesignation);\r
-\r
-\r
-//\r
-// Data Table.\r
-//\r
-EFI_MISC_SMBIOS_DATA_TABLE  mMiscSubclassDataTable[] = {\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscBaseBoardManufacturer, MiscBaseBoardManufacturer),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscBiosVendor,MiscBiosVendor ),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( BootInformationStatus, BootInformationStatus),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscChassisManufacturer, MiscChassisManufacturer),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NumberOfInstallableLanguages, NumberOfInstallableLanguages),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(OemString, OemString),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortInternalConnectorDesignator, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortKeyboard, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortMouse, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortCom1, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortCom2, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortExtensionPower, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscPortFloppy, MiscPortInternalConnectorDesignator),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscResetCapabilities, MiscResetCapabilities),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(SystemLanguageString, SystemLanguageString),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscSystemManufacturer, MiscSystemManufacturer),\r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( SystemOptionString, SystemOptionString),  \r
-  MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION( MiscSystemSlotDesignation, MiscSystemSlotDesignation),  \r
-  };\r
\r
-//\r
-// Number of Data Table entries.\r
-//\r
-UINTN mMiscSubclassDataTableEntries = (sizeof mMiscSubclassDataTable) / sizeof (EFI_MISC_SMBIOS_DATA_TABLE);\r
-\r
-/* eof - MiscSubclassDriverDataTable.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
deleted file mode 100644 (file)
index 283a761..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  MiscSubclassDriverEntryPoint.c\r
-\r
-Abstract:\r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-EFI_HII_HANDLE  mHiiHandle;\r
-\r
-/**\r
-  This is the standard EFI driver point that detects whether there is a\r
-  MemoryConfigurationData Variable and, if so, reports memory configuration info\r
-  to the DataHub.\r
-\r
-  @param  ImageHandle  Handle for the image of this driver\r
-  @param  SystemTable  Pointer to the EFI System Table\r
-\r
-  @return EFI_SUCCESS if the data is successfully reported\r
-  @return EFI_NOT_FOUND if the HOB list could not be located.\r
-\r
-**/\r
-EFI_STATUS\r
-LogMemorySmbiosRecord (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS                      Status;\r
-  UINT64                          TotalMemorySize;\r
-  UINT8                           NumSlots;\r
-  SMBIOS_TABLE_TYPE19             *Type19Record;\r
-  EFI_SMBIOS_HANDLE               MemArrayMappedAddrSmbiosHandle;\r
-  EFI_SMBIOS_PROTOCOL             *Smbios;\r
-  CHAR16                          *UnixMemString;\r
-\r
-  Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);\r
-  ASSERT_EFI_ERROR (Status);\r
-  \r
-  NumSlots        = 1;\r
-\r
-  //\r
-  // Process Memory String in form size!size ...\r
-  // So 64!64 is 128 MB\r
-  //\r
-  UnixMemString   = PcdGetPtr (PcdUnixMemorySize);\r
-  for (TotalMemorySize = 0; *UnixMemString != '\0';) {\r
-    TotalMemorySize += StrDecimalToUint64 (UnixMemString);\r
-    while (*UnixMemString != '\0') {\r
-      if (*UnixMemString == '!') {\r
-        UnixMemString++;       \r
-        break;\r
-      }\r
-      UnixMemString++;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Convert Total Memory Size to based on KiloByte\r
-  //\r
-  TotalMemorySize = LShiftU64 (TotalMemorySize, 20);\r
-  //\r
-  // Generate Memory Array Mapped Address info\r
-  //\r
-  Type19Record = AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE19) + 2);\r
-  Type19Record->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS;\r
-  Type19Record->Hdr.Length = sizeof(SMBIOS_TABLE_TYPE19);\r
-  Type19Record->Hdr.Handle = 0;\r
-  Type19Record->StartingAddress = 0;\r
-  Type19Record->EndingAddress =  (UINT32)RShiftU64(TotalMemorySize, 10) - 1;\r
-  Type19Record->MemoryArrayHandle = 0;\r
-  Type19Record->PartitionWidth = (UINT8)(NumSlots); \r
-\r
-  //\r
-  // Generate Memory Array Mapped Address info (TYPE 19)\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &MemArrayMappedAddrSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type19Record);\r
-\r
-  FreePool(Type19Record);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-MiscSubclassDriverEntryPoint (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-/*++\r
-Description:\r
-\r
-  Standard EFI driver point.  This driver parses the mMiscSubclassDataTable\r
-  structure and reports any generated data to the DataHub.\r
-\r
-Arguments:\r
-\r
-  ImageHandle\r
-    Handle for the image of this driver\r
-\r
-  SystemTable\r
-    Pointer to the EFI System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-    The data was successfully reported to the Data Hub.\r
-\r
---*/\r
-{\r
-  UINTN                Index;\r
-  EFI_STATUS           EfiStatus;\r
-  EFI_SMBIOS_PROTOCOL  *Smbios;  \r
-\r
-  EfiStatus = gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);\r
-\r
-  if (EFI_ERROR(EfiStatus)) {\r
-    DEBUG((EFI_D_ERROR, "Could not locate SMBIOS protocol.  %r\n", EfiStatus));\r
-    return EfiStatus;\r
-  }\r
-\r
-  mHiiHandle = HiiAddPackages (\r
-                 &gEfiCallerIdGuid,\r
-                 NULL,\r
-                 MiscSubclassStrings,\r
-                 NULL\r
-                 );\r
-  ASSERT (mHiiHandle != NULL);\r
-\r
-  for (Index = 0; Index < mMiscSubclassDataTableEntries; ++Index) {\r
-    //\r
-    // If the entry have a function pointer, just log the data.\r
-    //\r
-    if (mMiscSubclassDataTable[Index].Function != NULL) {\r
-      EfiStatus = (*mMiscSubclassDataTable[Index].Function)(\r
-        mMiscSubclassDataTable[Index].RecordData,\r
-        Smbios\r
-        );\r
-\r
-      if (EFI_ERROR(EfiStatus)) {\r
-        DEBUG((EFI_D_ERROR, "Misc smbios store error.  Index=%d, ReturnStatus=%r\n", Index, EfiStatus));\r
-        return EfiStatus;\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // Log Memory SMBIOS Record\r
-  //\r
-  EfiStatus = LogMemorySmbiosRecord();\r
-  return EfiStatus;\r
-}\r
-\r
-/**\r
-  Add an SMBIOS record.\r
-\r
-  @param  Smbios                The EFI_SMBIOS_PROTOCOL instance.\r
-  @param  SmbiosHandle          A unique handle will be assigned to the SMBIOS record.\r
-  @param  Record                The data for the fixed portion of the SMBIOS record. The format of the record is\r
-                                determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted area is defined \r
-                                by EFI_SMBIOS_TABLE_HEADER.Length and either followed by a double-null (0x0000) or \r
-                                a set of null terminated strings and a null.\r
-\r
-  @retval EFI_SUCCESS           Record was added.\r
-  @retval EFI_OUT_OF_RESOURCES  Record was not added due to lack of system resources.\r
-\r
-**/\r
-EFI_STATUS\r
-AddSmbiosRecord (\r
-  IN EFI_SMBIOS_PROTOCOL        *Smbios,\r
-  OUT EFI_SMBIOS_HANDLE         *SmbiosHandle,\r
-  IN EFI_SMBIOS_TABLE_HEADER    *Record\r
-  )\r
-{\r
-  *SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  return Smbios->Add (\r
-                   Smbios,\r
-                   NULL,\r
-                   SmbiosHandle,\r
-                   Record\r
-                   );\r
-}\r
-\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni
deleted file mode 100644 (file)
index 709c53a..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c
deleted file mode 100644 (file)
index e6c7b23..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscSystemLanguageStringData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA, SystemLanguageString) = {\r
-  0,\r
-  STRING_TOKEN(STR_MISC_SYSTEM_LANGUAGE_STRING)\r
-};\r
-\r
-/* eof - MiscSystemLanguageStringData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringFunction.c
deleted file mode 100644 (file)
index 86d63b4..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/** @file\r
-  ResetCapabilities.\r
-  SMBIOS type 23.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscOemString (Type 11).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(SystemLanguageString)\r
-{\r
-  EFI_STATUS               Status;\r
-  EFI_SMBIOS_HANDLE        SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE13      *SmbiosRecord;\r
-  UINTN                    StrLeng;\r
-  CHAR8                    *OptionalStrStart;\r
-  EFI_STRING               Str;\r
-  STRING_REF               TokenToGet;\r
-  \r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_LANGUAGE_STRING);\r
-  Str = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  StrLeng = StrLen(Str);\r
-  if (StrLeng > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle    = 0;\r
-  SmbiosRecord->InstallableLanguages = 1;\r
-  SmbiosRecord->Flags   = 1;\r
-  SmbiosRecord->CurrentLanguages = 1;\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Str, OptionalStrStart);\r
-  \r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni
deleted file mode 100644 (file)
index 3ff890b..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c
deleted file mode 100644 (file)
index a253cca..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscSystemManufacturerData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) System Manufacturer data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer)\r
-= {\r
-  STRING_TOKEN(STR_MISC_SYSTEM_MANUFACTURER),\r
-  // SystemManufactrurer\r
-  STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME),\r
-  // SystemProductName\r
-  STRING_TOKEN(STR_MISC_SYSTEM_VERSION),\r
-  // SystemVersion\r
-  STRING_TOKEN(STR_MISC_SYSTEM_SERIAL_NUMBER),\r
-  // SystemSerialNumber\r
-  {\r
-    0xbadfaced,\r
-    0xdead,\r
-    0xbeef,\r
-    {\r
-      0x13,\r
-      0x13,\r
-      0x13,\r
-      0x13,\r
-      0x13,\r
-      0x13,\r
-      0x13,\r
-      0x13\r
-    }\r
-  },\r
-  // SystemUuid\r
-  EfiSystemWakeupTypePowerSwitch  // SystemWakeupType\r
-};\r
-\r
-/* eof - MiscSystemManufacturerData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
deleted file mode 100644 (file)
index 3582447..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscSystemManufacturerFunction.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscSystemManufacturer (Type 1).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)\r
-{\r
-  CHAR8                             *OptionalStrStart;\r
-  UINTN                             ManuStrLen;\r
-  UINTN                             VerStrLen;\r
-  UINTN                             PdNameStrLen;\r
-  UINTN                             SerialNumStrLen;\r
-  EFI_STATUS                        Status;\r
-  EFI_STRING                        Manufacturer;\r
-  EFI_STRING                        ProductName;\r
-  EFI_STRING                        Version;\r
-  EFI_STRING                        SerialNumber;\r
-  STRING_REF                        TokenToGet;\r
-  EFI_SMBIOS_HANDLE                 SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE1                *SmbiosRecord;\r
-  EFI_MISC_SYSTEM_MANUFACTURER      *ForType1InputData;\r
-\r
-  ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);\r
-  Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  ManuStrLen = StrLen(Manufacturer);\r
-  if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);\r
-  ProductName = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  PdNameStrLen = StrLen(ProductName);\r
-  if (PdNameStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);\r
-  Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  VerStrLen = StrLen(Version);\r
-  if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);\r
-  SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumber);\r
-  if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_INFORMATION;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  // \r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-  //\r
-  // Manu will be the 1st optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->Manufacturer = 1;\r
-  //\r
-  // ProductName will be the 2nd optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->ProductName = 2;  \r
-  //\r
-  // Version will be the 3rd optional string following the formatted structure.  \r
-  //\r
-  SmbiosRecord->Version = 3;  \r
-  //\r
-  // Version will be the 4th optional string following the formatted structure.\r
-  //\r
-  SmbiosRecord->SerialNumber = 4;\r
-  CopyMem ((UINT8 *) (&SmbiosRecord->Uuid),&ForType1InputData->SystemUuid,16);\r
-  SmbiosRecord->WakeUpType = (UINT8)ForType1InputData->SystemWakeupType;\r
-\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(ProductName, OptionalStrStart + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1);\r
-  UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1);\r
-\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
-\r
-/* eof - MiscSystemManufacturerFunction.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni
deleted file mode 100644 (file)
index abf2da7..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c
deleted file mode 100644 (file)
index edda875..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  MiscSystemOptionStringData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString) = {\r
-  {STRING_TOKEN(STR_MISC_SYSTEM_OPTION_STRING)}\r
-};\r
-\r
-/* eof - MiscSystemOptionStringData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringFunction.c
deleted file mode 100644 (file)
index 145603a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file\r
-  BIOS system option string boot time changes.\r
-  SMBIOS type 12.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscSystemOptionString (Type 12).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(SystemOptionString)\r
-{\r
-  CHAR8                             *OptionalStrStart;\r
-  UINTN                             OptStrLen;\r
-  EFI_STRING                        OptionString;\r
-  EFI_STATUS                        Status;\r
-  STRING_REF                        TokenToGet;\r
-  EFI_SMBIOS_HANDLE                 SmbiosHandle;\r
-  SMBIOS_TABLE_TYPE12               *SmbiosRecord;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_OPTION_STRING);\r
-  OptionString = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  OptStrLen = StrLen(OptionString);\r
-  if (OptStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
\r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE12);\r
-  //\r
-  // Make handle chosen by smbios protocol.add automatically.\r
-  //\r
-  SmbiosRecord->Hdr.Handle = 0;  \r
-\r
-  SmbiosRecord->StringCount = 1;\r
-  OptionalStrStart = (CHAR8*) (SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(OptionString, OptionalStrStart);\r
-  //\r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni
deleted file mode 100644 (file)
index 45e9ce3..0000000
Binary files a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni and /dev/null differ
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c
deleted file mode 100644 (file)
index 760138f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  \r
-    MiscSystemSlotDesignationData.c\r
-  \r
-Abstract: \r
-\r
-  This driver parses the mMiscSubclassDataTable structure and reports\r
-  any generated data to the DataHub.\r
-\r
---*/\r
-\r
-#include "MiscSubClassDriver.h"\r
-\r
-//\r
-// Static (possibly build generated) Bios Vendor data.\r
-//\r
-MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotDesignation) = {\r
-  STRING_TOKEN(STR_MISC_SYSTEM_SLOT_DESIGNATION),   // SlotDesignation\r
-  EfiSlotTypeOther,         // SlotType\r
-  EfiSlotDataBusWidthOther, // SlotDataBusWidth\r
-  EfiSlotUsageOther,        // SlotUsage\r
-  EfiSlotLengthOther,       // SlotLength\r
-  0,                        // SlotId\r
-  {                         // SlotCharacteristics\r
-    0,                      // CharacteristicsUnknown  :1;\r
-    0,                      // Provides50Volts         :1;\r
-    0,                      // Provides33Volts         :1;\r
-    0,                      // SharedSlot              :1;\r
-    0,                      // PcCard16Supported       :1;\r
-    0,                      // CardBusSupported        :1;\r
-    0,                      // ZoomVideoSupported      :1;\r
-    0,                      // ModemRingResumeSupported:1;\r
-    0,                      // PmeSignalSupported      :1;\r
-    0,                      // HotPlugDevicesSupported :1;\r
-    0,                      // SmbusSignalSupported    :1;\r
-    0                       // Reserved                :21;\r
-  },\r
-  {0, 0, {0, 0}}            // SlotDevicePath\r
-};\r
-\r
-/* eof - MiscSystemSlotsData.c */\r
diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationFunction.c
deleted file mode 100644 (file)
index 2bf8844..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/** @file\r
-  BIOS system slot designator information boot time changes.\r
-  SMBIOS type 9.\r
-\r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "MiscSubClassDriver.h"\r
-/**\r
-  This function makes boot time changes to the contents of the\r
-  MiscSystemSlotDesignator structure (Type 9).\r
-\r
-  @param  RecordData                 Pointer to copy of RecordData from the Data Table.  \r
-\r
-  @retval EFI_SUCCESS                All parameters were valid.\r
-  @retval EFI_UNSUPPORTED            Unexpected RecordType value.\r
-  @retval EFI_INVALID_PARAMETER      Invalid parameter was found.\r
-\r
-**/\r
-MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignation)\r
-{\r
-  CHAR8                              *OptionalStrStart;\r
-  UINTN                              SlotDesignationStrLen;\r
-  EFI_STATUS                         Status;\r
-  EFI_STRING                         SlotDesignation;\r
-  STRING_REF                         TokenToGet;\r
-  SMBIOS_TABLE_TYPE9                 *SmbiosRecord;\r
-  EFI_SMBIOS_HANDLE                  SmbiosHandle;\r
-  EFI_MISC_SYSTEM_SLOT_DESIGNATION*  ForType9InputData;\r
-\r
-  ForType9InputData = (EFI_MISC_SYSTEM_SLOT_DESIGNATION *)RecordData;\r
-\r
-  //\r
-  // First check for invalid parameters.\r
-  //\r
-  if (RecordData == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  TokenToGet = 0;\r
-  switch (ForType9InputData->SlotDesignation) {\r
-    case STR_MISC_SYSTEM_SLOT_DESIGNATION: \r
-      TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_DESIGNATION);\r
-      break;\r
-    default:\r
-      break;\r
-  }\r
-\r
-  SlotDesignation = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);\r
-  SlotDesignationStrLen = StrLen(SlotDesignation);\r
-  if (SlotDesignationStrLen > SMBIOS_STRING_MAX_LENGTH) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  //\r
-  // Two zeros following the last string.\r
-  //\r
-  SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE9) + SlotDesignationStrLen + 1 + 1);\r
-  ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE9) +SlotDesignationStrLen + 1 + 1);\r
-\r
-  SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_SLOTS;\r
-  SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE9);\r
-  SmbiosRecord->Hdr.Handle = 0; \r
-  SmbiosRecord->SlotDesignation = 1;\r
-  SmbiosRecord->SlotType = ForType9InputData->SlotType;\r
-  SmbiosRecord->SlotDataBusWidth = ForType9InputData->SlotDataBusWidth;\r
-  SmbiosRecord->CurrentUsage = ForType9InputData->SlotUsage;\r
-  SmbiosRecord->SlotLength = ForType9InputData->SlotLength;\r
-  SmbiosRecord->SlotID = ForType9InputData->SlotId;\r
-  \r
-  //\r
-  // Slot Characteristics\r
-  //\r
-  CopyMem ((UINT8 *) &SmbiosRecord->SlotCharacteristics1,(UINT8 *) &ForType9InputData->SlotCharacteristics,2);\r
-  OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);\r
-  UnicodeStrToAsciiStr(SlotDesignation, OptionalStrStart);\r
-  //  \r
-  // Now we have got the full smbios record, call smbios protocol to add this record.\r
-  //\r
-  Status = AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord);\r
-\r
-  FreePool(SmbiosRecord);\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
deleted file mode 100644 (file)
index 7ab629c..0000000
+++ /dev/null
@@ -1,352 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  RealTimeClock.c\r
-\r
-Abstract:\r
-\r
-  UNIX Emulation Architectural Protocol Driver as defined in Tiano\r
-\r
---*/\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include <Protocol/RealTimeClock.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UnixLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-BOOLEAN\r
-DayValid (\r
-  IN  EFI_TIME  *Time\r
-  );\r
-\r
-BOOLEAN\r
-IsLeapYear (\r
-  IN EFI_TIME   *Time\r
-  );\r
-\r
-EFI_STATUS\r
-RtcTimeFieldsValid (\r
-  IN EFI_TIME *Time\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeRealTimeClock (\r
-  IN EFI_HANDLE                          ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                    *SystemTable\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGetTime (\r
-  OUT EFI_TIME                                 * Time,\r
-  OUT EFI_TIME_CAPABILITIES                    * Capabilities OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->GetTime \r
-\r
-Arguments:\r
-\r
-  Time          - A pointer to storage that will receive a snapshot of the current time.\r
-\r
-  Capabilities  - A pointer to storage that will receive the capabilities of the real time clock\r
-                  in the platform. This includes the real time clock's resolution and accuracy.  \r
-                  All reported device capabilities are rounded up.  This is an OPTIONAL argument.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS   - The underlying GetSystemTime call occurred and returned\r
-                  Note that in the NT32 emulation, the GetSystemTime call has no return value\r
-                  thus you will always receive a EFI_SUCCESS on this.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-\r
-  //\r
-  // Check parameter for null pointer\r
-  //\r
-  if (Time == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-\r
-  }\r
-\r
-  gUnix->GetLocalTime (Time);\r
-\r
-  if (Capabilities != NULL) {\r
-    Capabilities->Resolution  = 1;\r
-    Capabilities->Accuracy    = 50000000;\r
-    Capabilities->SetsToZero  = FALSE;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSetTime (\r
-  IN EFI_TIME   *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->SetTime \r
-\r
-Arguments:\r
-\r
-  Time          - A pointer to storage containing the time and date information to\r
-                  program into the real time clock.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS           - The operation completed successfully.\r
-                  \r
-  EFI_INVALID_PARAMETER - One of the fields in Time is out of range.\r
-\r
-  EFI_DEVICE_ERROR      - The operation could not be complete due to a device error.\r
-\r
---*/\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS            Status;\r
-\r
-  if (Time == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // Make sure that the time fields are valid\r
-  //\r
-  Status = RtcTimeFieldsValid (Time);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGetWakeupTime (\r
-  OUT BOOLEAN        *Enabled,\r
-  OUT BOOLEAN        *Pending,\r
-  OUT EFI_TIME       *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->GetWakeupTime\r
-\r
-Arguments:\r
-  This          - Indicates the protocol instance structure.\r
-\r
-  Enabled       - Indicates if the alarm is currently enabled or disabled.\r
-\r
-  Pending       - Indicates if the alarm signal is pending and requires\r
-                  acknowledgement.\r
-\r
-  Time          - The current alarm setting.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS           - The operation completed successfully.\r
-                  \r
-  EFI_DEVICE_ERROR      - The operation could not be complete due to a device error.\r
-\r
-  EFI_UNSUPPORTED       - The operation is not supported on this platform.\r
-\r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSetWakeupTime (\r
-  IN BOOLEAN      Enable,\r
-  OUT EFI_TIME    *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Service routine for RealTimeClockInstance->SetWakeupTime\r
-\r
-Arguments:\r
-\r
-  Enabled       - Enable or disable the wakeup alarm.\r
-\r
-  Time          - If enable is TRUE, the time to set the wakup alarm for.\r
-                  If enable is FALSE, then this parameter is optional, and\r
-                  may be NULL.\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS           - The operation completed successfully.\r
-                  \r
-  EFI_DEVICE_ERROR      - The operation could not be complete due to a device error.\r
-\r
-  EFI_INVALID_PARAMETER - A field in Time is out of range.\r
-\r
-  EFI_UNSUPPORTED       - The operation is not supported on this platform.\r
-\r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeRealTimeClock (\r
-  IN EFI_HANDLE                            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Install Real Time Clock Protocol \r
-\r
-Arguments:\r
-  ImageHandle - Image Handle\r
-  SystemTable - Pointer to system table\r
-\r
-Returns:\r
-\r
-  EFI_SUCEESS - Real Time Clock Services are installed into the Runtime Services Table\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-  SystemTable->RuntimeServices->GetTime       = UnixGetTime;\r
-  SystemTable->RuntimeServices->SetTime       = UnixSetTime;\r
-  SystemTable->RuntimeServices->GetWakeupTime = UnixGetWakeupTime;\r
-  SystemTable->RuntimeServices->SetWakeupTime = UnixSetWakeupTime;\r
-\r
-  Handle = NULL;\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Handle,\r
-                  &gEfiRealTimeClockArchProtocolGuid,\r
-                  NULL,\r
-                  NULL\r
-                  );\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-RtcTimeFieldsValid (\r
-  IN EFI_TIME *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Arguments:\r
\r
-  Returns: \r
---*/\r
-// TODO:    Time - add argument and description to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  if (Time->Year < 1998 ||\r
-      Time->Year > 2099 ||\r
-      Time->Month < 1 ||\r
-      Time->Month > 12 ||\r
-      (!DayValid (Time)) ||\r
-      Time->Hour > 23 ||\r
-      Time->Minute > 59 ||\r
-      Time->Second > 59 ||\r
-      Time->Nanosecond > 999999999 ||\r
-      (!(Time->TimeZone == EFI_UNSPECIFIED_TIMEZONE || (Time->TimeZone >= -1440 && Time->TimeZone <= 1440))) ||\r
-      (Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT)))\r
-      ) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-BOOLEAN\r
-DayValid (\r
-  IN  EFI_TIME  *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Time  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-\r
-  STATIC const INTN  DayOfMonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\r
-\r
-  if (Time->Day < 1 ||\r
-      Time->Day > DayOfMonth[Time->Month - 1] ||\r
-      (Time->Month == 2 && (!IsLeapYear (Time) && Time->Day > 28))\r
-      ) {\r
-    return FALSE;\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
-BOOLEAN\r
-IsLeapYear (\r
-  IN EFI_TIME   *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Time  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  if (Time->Year % 4 == 0) {\r
-    if (Time->Year % 100 == 0) {\r
-      if (Time->Year % 400 == 0) {\r
-        return TRUE;\r
-      } else {\r
-        return FALSE;\r
-      }\r
-    } else {\r
-      return TRUE;\r
-    }\r
-  } else {\r
-    return FALSE;\r
-  }\r
-}\r
diff --git a/UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.inf b/UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.inf
deleted file mode 100644 (file)
index 256d74f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file\r
-# Unix Emulation Real time clock Architectural Protocol Driver as defined in TIANO\r
-#\r
-# This real time clock module simulates virtual device by time WinAPI.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = RealTimeClock\r
-  FILE_GUID                      = f3552032-8985-11db-8429-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeRealTimeClock\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  RealTimeClock.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  UnixLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  DebugLib\r
-  BaseLib\r
-\r
-\r
-[Protocols]\r
-  gEfiRealTimeClockArchProtocolGuid             # PROTOCOL ALWAYS_PRODUCED\r
-\r
-\r
-[Depex]\r
-  TRUE\r
-\r
diff --git a/UnixPkg/ResetRuntimeDxe/Reset.c b/UnixPkg/ResetRuntimeDxe/Reset.c
deleted file mode 100644 (file)
index a67d82c..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
- Reset.c\r
-\r
-Abstract:\r
-\r
-  Reset Architectural Protocol as defined in Tiano under UNIX Emulation\r
-\r
---*/\r
-\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include <Protocol/Reset.h>\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UnixLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixReset (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-UnixResetSystem (\r
-  IN EFI_RESET_TYPE   ResetType,\r
-  IN EFI_STATUS       ResetStatus,\r
-  IN UINTN            DataSize,\r
-  IN VOID             *ResetData OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixReset (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-\r
-Arguments:\r
-\r
-  ImageHandle of the loaded driver\r
-  Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  Status\r
---*/\r
-// TODO:    SystemTable - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-  SystemTable->RuntimeServices->ResetSystem = UnixResetSystem;\r
-\r
-  Handle = NULL;\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Handle,\r
-                  &gEfiResetArchProtocolGuid,\r
-                  NULL,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-UnixResetSystem (\r
-  IN EFI_RESET_TYPE   ResetType,\r
-  IN EFI_STATUS       ResetStatus,\r
-  IN UINTN            DataSize,\r
-  IN VOID             *ResetData OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ResetType   - TODO: add argument description\r
-  ResetStatus - TODO: add argument description\r
-  DataSize    - TODO: add argument description\r
-  ResetData   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       HandleCount;\r
-  EFI_HANDLE  *HandleBuffer;\r
-  UINTN       Index;\r
-\r
-  //\r
-  // Disconnect all\r
-  //\r
-  Status = gBS->LocateHandleBuffer (\r
-                  AllHandles,\r
-                  NULL,\r
-                  NULL,\r
-                  &HandleCount,\r
-                  &HandleBuffer\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    for (Index = 0; Index < HandleCount; Index++) {\r
-      Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
-    }\r
-  \r
-    gBS->FreePool (HandleBuffer);\r
-  }\r
-\r
-\r
-  //\r
-  // Discard ResetType, always return 0 as exit code\r
-  //\r
-  gUnix->Exit (0);\r
-\r
-  //\r
-  // Should never go here\r
-  //\r
-  ASSERT (FALSE);\r
-\r
-  return;\r
-}\r
diff --git a/UnixPkg/ResetRuntimeDxe/Reset.inf b/UnixPkg/ResetRuntimeDxe/Reset.inf
deleted file mode 100644 (file)
index d367dff..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file\r
-# Unix Emulation Reset Architectural Protocol Driver as defined in TIANO\r
-#\r
-# This Reset module simulates system reset by process exit on NT.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Reset\r
-  FILE_GUID                      = f3613084-8985-11db-8c26-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixReset\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  Reset.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  UnixLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  DebugLib\r
-  BaseLib\r
-\r
-\r
-[Protocols]\r
-  gEfiResetArchProtocolGuid                     # PROTOCOL ALWAYS_PRODUCED\r
-\r
-\r
-[Depex]\r
-  TRUE\r
-\r
diff --git a/UnixPkg/Sec/FwVol.c b/UnixPkg/Sec/FwVol.c
deleted file mode 100644 (file)
index 6723148..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  FwVol.c\r
-\r
-Abstract:\r
-  A simple FV stack so the SEC can extract the SEC Core from an\r
-  FV.\r
-\r
---*/\r
-\r
-#include "SecMain.h"\r
-\r
-#define GET_OCCUPIED_SIZE(ActualSize, Alignment) \\r
-  (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) & ((Alignment) - 1))\r
-\r
-EFI_FFS_FILE_STATE\r
-GetFileState (\r
-  IN UINT8                ErasePolarity,\r
-  IN EFI_FFS_FILE_HEADER  *FfsHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Returns the highest bit set of the State field\r
-\r
-Arguments:\r
-  ErasePolarity   - Erase Polarity  as defined by EFI_FVB2_ERASE_POLARITY\r
-                    in the Attributes field.\r
-  FfsHeader       - Pointer to FFS File Header.\r
-\r
-Returns:\r
-  Returns the highest bit in the State field\r
-\r
---*/\r
-{\r
-  EFI_FFS_FILE_STATE  FileState;\r
-  EFI_FFS_FILE_STATE  HighestBit;\r
-\r
-  FileState = FfsHeader->State;\r
-\r
-  if (ErasePolarity != 0) {\r
-    FileState = (EFI_FFS_FILE_STATE)~FileState;\r
-  }\r
-\r
-  HighestBit = 0x80;\r
-  while (HighestBit != 0 && (HighestBit & FileState) == 0) {\r
-    HighestBit >>= 1;\r
-  }\r
-\r
-  return HighestBit;\r
-}\r
-\r
-UINT8\r
-CalculateHeaderChecksum (\r
-  IN EFI_FFS_FILE_HEADER  *FileHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Calculates the checksum of the header of a file.\r
-\r
-Arguments:\r
-  FileHeader       - Pointer to FFS File Header.\r
-\r
-Returns:\r
-  Checksum of the header.\r
-  \r
---*/\r
-{\r
-  UINT8 *ptr;\r
-  UINTN Index;\r
-  UINT8 Sum;\r
-\r
-  Sum = 0;\r
-  ptr = (UINT8 *) FileHeader;\r
-\r
-  for (Index = 0; Index < sizeof (EFI_FFS_FILE_HEADER) - 3; Index += 4) {\r
-    Sum = (UINT8) (Sum + ptr[Index]);\r
-    Sum = (UINT8) (Sum + ptr[Index + 1]);\r
-    Sum = (UINT8) (Sum + ptr[Index + 2]);\r
-    Sum = (UINT8) (Sum + ptr[Index + 3]);\r
-  }\r
-\r
-  for (; Index < sizeof (EFI_FFS_FILE_HEADER); Index++) {\r
-    Sum = (UINT8) (Sum + ptr[Index]);\r
-  }\r
-  //\r
-  // State field (since this indicates the different state of file).\r
-  //\r
-  Sum = (UINT8) (Sum - FileHeader->State);\r
-  //\r
-  // Checksum field of the file is not part of the header checksum.\r
-  //\r
-  Sum = (UINT8) (Sum - FileHeader->IntegrityCheck.Checksum.File);\r
-\r
-  return Sum;\r
-}\r
-\r
-EFI_STATUS\r
-SecFfsFindNextFile (\r
-  IN EFI_FV_FILETYPE             SearchType,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER     **FileHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching file in the\r
-    FFS volume as defined by SearchType. The search starts from FileHeader inside\r
-    the Firmware Volume defined by FwVolHeader.\r
-\r
-Arguments:\r
-    SearchType - Filter to find only files of this type.\r
-                 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r
-    FwVolHeader - Pointer to the FV header of the volume to search.\r
-                  This parameter must point to a valid FFS volume.\r
-    FileHeader  - Pointer to the current file from which to begin searching.\r
-                  This pointer will be updated upon return to reflect the file\r
-                  found.\r
-\r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
-\r
---*/\r
-{\r
-  EFI_FFS_FILE_HEADER *FfsFileHeader;\r
-  UINT32              FileLength;\r
-  UINT32              FileOccupiedSize;\r
-  UINT32              FileOffset;\r
-  UINT64              FvLength;\r
-  UINT8               ErasePolarity;\r
-  UINT8               FileState;\r
-\r
-  FvLength = FwVolHeader->FvLength;\r
-  if (FwVolHeader->Attributes & EFI_FVB2_ERASE_POLARITY) {\r
-    ErasePolarity = 1;\r
-  } else {\r
-    ErasePolarity = 0;\r
-  }\r
-  //\r
-  // If FileHeader is not specified (NULL) start with the first file in the\r
-  // firmware volume.  Otherwise, start from the FileHeader.\r
-  //\r
-  if (*FileHeader == NULL) {\r
-    FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FwVolHeader + FwVolHeader->HeaderLength);\r
-  } else {\r
-    //\r
-    // Length is 24 bits wide so mask upper 8 bits\r
-    // FileLength is adjusted to FileOccupiedSize as it is 8 byte aligned.\r
-    //\r
-    FileLength        = *(UINT32 *) (*FileHeader)->Size & 0x00FFFFFF;\r
-    FileOccupiedSize  = GET_OCCUPIED_SIZE (FileLength, 8);\r
-    FfsFileHeader     = (EFI_FFS_FILE_HEADER *) ((UINT8 *) *FileHeader + FileOccupiedSize);\r
-  }\r
-\r
-  FileOffset = (UINT32) ((UINT8 *) FfsFileHeader - (UINT8 *) FwVolHeader);\r
-\r
-  while (FileOffset < (FvLength - sizeof (EFI_FFS_FILE_HEADER))) {\r
-    //\r
-    // Get FileState which is the highest bit of the State\r
-    //\r
-    FileState = GetFileState (ErasePolarity, FfsFileHeader);\r
-\r
-    switch (FileState) {\r
-\r
-    case EFI_FILE_HEADER_INVALID:\r
-      FileOffset += sizeof (EFI_FFS_FILE_HEADER);\r
-      FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + sizeof (EFI_FFS_FILE_HEADER));\r
-      break;\r
-\r
-    case EFI_FILE_DATA_VALID:\r
-    case EFI_FILE_MARKED_FOR_UPDATE:\r
-      if (CalculateHeaderChecksum (FfsFileHeader) == 0) {\r
-        FileLength        = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;\r
-        FileOccupiedSize  = GET_OCCUPIED_SIZE (FileLength, 8);\r
-\r
-        if ((SearchType == FfsFileHeader->Type) || (SearchType == EFI_FV_FILETYPE_ALL)) {\r
-\r
-          *FileHeader = FfsFileHeader;\r
-\r
-          return EFI_SUCCESS;\r
-        }\r
-\r
-        FileOffset += FileOccupiedSize;\r
-        FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + FileOccupiedSize);\r
-      } else {\r
-        return EFI_NOT_FOUND;\r
-      }\r
-      break;\r
-\r
-    case EFI_FILE_DELETED:\r
-      FileLength        = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;\r
-      FileOccupiedSize  = GET_OCCUPIED_SIZE (FileLength, 8);\r
-      FileOffset += FileOccupiedSize;\r
-      FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FfsFileHeader + FileOccupiedSize);\r
-      break;\r
-\r
-    default:\r
-      return EFI_NOT_FOUND;\r
-\r
-    }\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-EFI_STATUS\r
-SecFfsFindSectionData (\r
-  IN EFI_SECTION_TYPE      SectionType,\r
-  IN EFI_FFS_FILE_HEADER   *FfsFileHeader,\r
-  IN OUT VOID              **SectionData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-    Given the input file pointer, search for the next matching section in the\r
-    FFS volume.\r
-\r
-Arguments:\r
-    SearchType    - Filter to find only sections of this type.\r
-    FfsFileHeader - Pointer to the current file to search.\r
-    SectionData   - Pointer to the Section matching SectionType in FfsFileHeader.\r
-                     NULL if section not found\r
-\r
-Returns:\r
-    EFI_NOT_FOUND - No files matching the search criteria were found\r
-    EFI_SUCCESS\r
-\r
---*/\r
-{\r
-  UINT32                    FileSize;\r
-  EFI_COMMON_SECTION_HEADER *Section;\r
-  UINT32                    SectionLength;\r
-  UINT32                    ParsedLength;\r
-\r
-  //\r
-  // Size is 24 bits wide so mask upper 8 bits.\r
-  //    Does not include FfsFileHeader header size\r
-  // FileSize is adjusted to FileOccupiedSize as it is 8 byte aligned.\r
-  //\r
-  Section   = (EFI_COMMON_SECTION_HEADER *) (FfsFileHeader + 1);\r
-  FileSize  = *(UINT32 *) (FfsFileHeader->Size) & 0x00FFFFFF;\r
-  FileSize -= sizeof (EFI_FFS_FILE_HEADER);\r
-\r
-  *SectionData  = NULL;\r
-  ParsedLength  = 0;\r
-  while (ParsedLength < FileSize) {\r
-    if (Section->Type == SectionType) {\r
-      *SectionData = (VOID *) (Section + 1);\r
-      return EFI_SUCCESS;\r
-    }\r
-    //\r
-    // Size is 24 bits wide so mask upper 8 bits.\r
-    // SectionLength is adjusted it is 4 byte aligned.\r
-    // Go to the next section\r
-    //\r
-    SectionLength = *(UINT32 *) Section->Size & 0x00FFFFFF;\r
-    SectionLength = GET_OCCUPIED_SIZE (SectionLength, 4);\r
-\r
-    ParsedLength += SectionLength;\r
-    Section = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + SectionLength);\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-EFI_STATUS\r
-SecFfsFindPeiCore (\r
-  IN  EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  OUT VOID                        **Pe32Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Given the pointer to the Firmware Volume Header find the SEC\r
-  core and return it's PE32 image.\r
-\r
-Arguments:\r
-  FwVolHeader - Pointer to memory mapped FV\r
-  Pe32Data - Pointer to SEC PE32 iamge.\r
\r
-Returns:  \r
-  EFI_SUCCESS - Pe32Data is valid\r
-  other       - Failure\r
-\r
---*/\r
-{\r
-  EFI_STATUS          Status;\r
-  EFI_FFS_FILE_HEADER *FileHeader;\r
-  EFI_FV_FILETYPE     SearchType;\r
-\r
-  SearchType  = EFI_FV_FILETYPE_PEI_CORE;\r
-  FileHeader  = NULL;\r
-  do {\r
-    Status = SecFfsFindNextFile (SearchType, FwVolHeader, &FileHeader);\r
-    if (!EFI_ERROR (Status)) {\r
-      Status = SecFfsFindSectionData (EFI_SECTION_PE32, FileHeader, Pe32Data);\r
-      return Status;\r
-    }\r
-  } while (!EFI_ERROR (Status));\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/Sec/Gasket.c b/UnixPkg/Sec/Gasket.c
deleted file mode 100644 (file)
index 04c65f1..0000000
+++ /dev/null
@@ -1,456 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-  \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifdef __APPLE__\r
-\r
-#include "SecMain.h"\r
-#include "Gasket.h"\r
-\r
-//\r
-// Gasket functions for EFI_UNIX_THUNK_PROTOCOL\r
-//\r
-\r
-void \r
-GasketmsSleep (unsigned long Milliseconds)\r
-{ \r
-  GasketUintn (msSleep, Milliseconds);\r
-  return;\r
-}\r
-\r
-void \r
-Gasketexit (int status)\r
-{\r
- GasketUintn (exit, status);\r
-  return;\r
-}\r
-\r
-\r
-void \r
-GasketSetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))\r
-{\r
- GasketUint64Uintn (SetTimer, PeriodMs, (UINTN)CallBack);\r
-  return;\r
-}\r
-\r
-\r
-void \r
-GasketGetLocalTime (EFI_TIME *Time)\r
-{\r
-  GasketUintn (GetLocalTime, (UINTN)Time);\r
-  return;\r
-}\r
-\r
-\r
-struct tm *\r
-Gasketgmtime (const time_t *clock)\r
-{\r
-  return (struct tm *)(UINTN)GasketUintn (localtime, (UINTN)clock);\r
-}\r
-\r
-\r
-long \r
-GasketGetTimeZone (void)\r
-{\r
-  return  GasketVoid (GetTimeZone);\r
-}\r
-\r
-\r
-int \r
-GasketGetDayLight (void)\r
-{\r
-  return  GasketVoid (GetDayLight);\r
-}\r
-\r
-\r
-int \r
-Gasketpoll (struct pollfd *pfd, unsigned int nfds, int timeout)\r
-{\r
-  return GasketUintnUintnUintn (poll, (UINTN)pfd, nfds, timeout);\r
-}\r
-\r
-\r
-long\r
-Gasketread (int fd, void *buf, int count)\r
-{\r
-  return  GasketUintnUintnUintn (read, fd, (UINTN)buf, count);\r
-}\r
-\r
-\r
-long\r
-Gasketwrite (int fd, const void *buf, int count)\r
-{\r
-  return  GasketUintnUintnUintn (write, fd, (UINTN)buf, count);\r
-}\r
-\r
-\r
-char *\r
-Gasketgetenv (const char *name)\r
-{\r
-  return (char *)(UINTN)GasketUintn (getenv, (UINTN)name);\r
-}\r
-\r
-\r
-int \r
-Gasketopen (const char *name, int flags, int mode)\r
-{\r
-  return  GasketUintnUintnUintn (open, (UINTN)name, flags, mode);\r
-}\r
-\r
-\r
-off_t \r
-Gasketlseek (int fd, off_t off, int whence)\r
-{\r
-  if (sizeof off == 8) {\r
-    return GasketUintnUint64Uintn (lseek, fd, off, whence);\r
-  } else if (sizeof off == 4) {\r
-    return GasketUintnUintnUintn (lseek, fd, off, whence);\r
-  }\r
-}\r
-\r
-\r
-int \r
-Gasketftruncate (int fd, long int len)\r
-{\r
-  return GasketUintnUintn (ftruncate, fd, len);\r
-}\r
-\r
-\r
-int \r
-Gasketclose (int fd)\r
-{\r
-  return GasketUintn (close, fd);\r
-}\r
-\r
-\r
-int \r
-Gasketmkdir (const char *pathname, mode_t mode)\r
-{\r
-  return GasketUintnUint16 (mkdir, (UINTN)pathname, mode);\r
-}\r
-\r
-\r
-int \r
-Gasketrmdir (const char *pathname)\r
-{\r
-  return GasketUintn (rmdir, (UINTN)pathname);\r
-}\r
-\r
-\r
-int \r
-Gasketunlink (const char *pathname)\r
-{\r
-  return GasketUintn (unlink, (UINTN)pathname);\r
-}\r
-\r
-\r
-int \r
-GasketGetErrno (void)\r
-{\r
-  return  GasketVoid (GetErrno);\r
-}\r
-\r
-\r
-DIR *\r
-Gasketopendir (const char *pathname)\r
-{\r
-  return (DIR *)(UINTN)GasketUintn (opendir, (UINTN)pathname);\r
-}\r
-\r
-\r
-void \r
-Gasketrewinddir (DIR *dir)\r
-{\r
-  GasketUintn (rewinddir, (UINTN)dir);\r
-  return;\r
-}\r
-\r
-\r
-struct dirent *\r
-Gasketreaddir (DIR *dir)\r
-{\r
-  return (struct dirent *)(UINTN)GasketUintn (readdir, (UINTN)dir);\r
-}\r
-\r
-\r
-int \r
-Gasketclosedir (DIR *dir)\r
-{\r
-  return GasketUintn (closedir,  (UINTN)dir);\r
-}\r
-\r
-\r
-int \r
-Gasketstat (const char *path, STAT_FIX *buf)\r
-{\r
-  return GasketUintnUintn (stat, (UINTN)path, (UINTN)buf);\r
-}\r
-\r
-\r
-int \r
-Gasketstatfs (const char *path, struct statfs *buf)\r
-{\r
-  return GasketUintnUintn (statfs, (UINTN)path, (UINTN)buf);\r
-}\r
-\r
-\r
-int \r
-Gasketrename (const char *oldpath, const char *newpath)\r
-{\r
-  return GasketUintnUintn (rename, (UINTN)oldpath, (UINTN)newpath);\r
-}\r
-\r
-\r
-time_t \r
-Gasketmktime (struct tm *tm)\r
-{\r
-  return GasketUintn (mktime, (UINTN)tm);\r
-}\r
-\r
-\r
-int \r
-Gasketfsync (int fd)\r
-{\r
-  return GasketUintn (fsync, fd);\r
-}\r
-\r
-\r
-int \r
-Gasketchmod (const char *path, mode_t mode)\r
-{\r
-  return GasketUintnUint16 (chmod, (UINTN)path, mode);\r
-}\r
-\r
-\r
-int \r
-Gasketutime (const char *filename, const struct utimbuf *buf)\r
-{\r
-  return GasketUintnUintn (utime, (UINTN)filename, (UINTN)buf);\r
-}\r
-\r
-\r
-int \r
-Gaskettcflush (int fildes, int queue_selector)\r
-{\r
-  return GasketUintnUintn (tcflush, fildes, queue_selector);\r
-}\r
-\r
-\r
-EFI_STATUS \r
-GasketUgaCreate (struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo, CONST CHAR16 *Title)\r
-{\r
-  return GasketUintnUintn (UgaCreate, (UINTN)UgaIo, (UINTN)Title);\r
-}\r
-\r
-\r
-void \r
-Gasketperror (__const char *__s)\r
-{\r
-  GasketUintn (perror, (UINTN)__s);\r
-  return;\r
-}\r
-\r
-\r
-\r
-//\r
-// ... is always an int or pointer to device specific data structure\r
-//\r
-int \r
-Gasketioctl (int fd, unsigned long int __request, void *Arg)\r
-{\r
-  return GasketUintnUintnUintn (ioctl, fd, __request, (UINTN)Arg);\r
-}\r
-\r
-\r
-int \r
-Gasketfcntl (int __fd, int __cmd, void  *Arg)\r
-{\r
-  return GasketUintnUintnUintn (fcntl, __fd, __cmd, (UINTN)Arg);\r
-}\r
-\r
-\r
-\r
-int \r
-Gasketcfsetispeed (struct termios *__termios_p, speed_t __speed)\r
-{\r
-  return GasketUintnUintn (cfsetispeed, (UINTN)__termios_p, __speed);\r
-}\r
-\r
-\r
-int \r
-Gasketcfsetospeed (struct termios *__termios_p, speed_t __speed)\r
-{\r
-  return GasketUintnUintn (cfsetospeed, (UINTN)__termios_p, __speed);\r
-}\r
-\r
-\r
-int \r
-Gaskettcgetattr (int __fd, struct termios *__termios_p)\r
-{\r
-  return GasketUintnUintn (tcgetattr, __fd, (UINTN)__termios_p);\r
-}\r
-\r
\r
-int \r
-Gaskettcsetattr (int __fd, int __optional_actions, __const struct termios *__termios_p)\r
-{\r
-  return GasketUintnUintnUintn (tcsetattr, __fd, __optional_actions, (UINTN)__termios_p);\r
-}\r
-\r
-\r
-\r
-\r
-RETURN_STATUS\r
-GasketUnixPeCoffGetEntryPoint (\r
-  IN     VOID  *Pe32Data,\r
-  IN OUT VOID  **EntryPoint\r
-  )\r
-{\r
-  return GasketUintnUintn (SecPeCoffGetEntryPoint, (UINTN)Pe32Data, (UINTN)EntryPoint);\r
-}\r
-\r
-\r
-\r
-VOID\r
-GasketUnixPeCoffRelocateImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  GasketUintn (SecPeCoffRelocateImageExtraAction, (UINTN)ImageContext);\r
-  return;\r
-}\r
-\r
-\r
-\r
-VOID\r
-GasketUnixPeCoffUnloadImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  )\r
-{\r
-  GasketUintn (SecPeCoffLoaderUnloadImageExtraAction, (UINTN)ImageContext);\r
-  return;\r
-}\r
-\r
-\r
-//\r
-// Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL\r
-//\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaClose (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo)\r
-{\r
-  return GasketUintn (UgaClose, (UINTN)UgaIo);\r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaSize (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, UINT32 Width, UINT32 Height)\r
-{\r
-  return GasketUintnUintnUintn (UgaSize, (UINTN)UgaIo, Width, Height);\r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaCheckKey (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo)\r
-{\r
-  return GasketUintn (UgaCheckKey, (UINTN)UgaIo);\r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaKeySetState (EFI_UNIX_UGA_IO_PROTOCOL   *UgaIo, EFI_KEY_TOGGLE_STATE *KeyToggleState)\r
-{\r
-  return GasketUintnUintn (UgaGetKey, (UINTN)UgaIo, (UINTN)KeyToggleState);\r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaGetKey (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, EFI_KEY_DATA *key)\r
-{\r
-  return GasketUintnUintn (UgaGetKey, (UINTN)UgaIo, (UINTN)key);\r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaRegisterKeyNotify (\r
-  IN EFI_UNIX_UGA_IO_PROTOCOL           *UgaIo, \r
-  IN UGA_REGISTER_KEY_NOTIFY_CALLBACK   CallBack,\r
-  IN VOID                               *Context\r
-  )\r
-{\r
-  return GasketUintnUintnUintn (UgaRegisterKeyNotify, (UINTN)UgaIo, (UINTN)CallBack, (UINTN)Context);  \r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaBlt (\r
-   EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
-   IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,\r
-   IN  EFI_UGA_BLT_OPERATION                   BltOperation,\r
-   IN  UGA_BLT_ARGS                            *Args\r
-   )\r
-{\r
-  return GasketUintnUintnUintnUintn (UgaBlt, (UINTN)UgaIo, (UINTN)BltBuffer, (UINTN)BltOperation, (UINTN)Args);\r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaCheckPointer (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo)\r
-{\r
-  return GasketUintn (UgaCheckPointer, (UINTN)UgaIo);\r
-}\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaGetPointerState (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, EFI_SIMPLE_POINTER_STATE *state)\r
-{\r
-  return GasketUintnUintn (UgaGetPointerState, (UINTN)UgaIo, (UINTN)state);\r
-}\r
-\r
-void\r
-GasketUnixEnableInterrupt (void)\r
-{\r
-  GasketVoid (UnixEnableInterrupt);\r
-}\r
-\r
-void\r
-GasketUnixDisableInterrupt (void)\r
-{\r
-  GasketVoid (UnixDisableInterrupt);\r
-}\r
-\r
-\r
-int\r
-Gasketgetifaddrs (struct ifaddrs **ifap)\r
-{\r
-  return( GasketUintn( getifaddrs, ( UINTN ) ifap ) );\r
-}\r
-\r
-\r
-void\r
-Gasketfreeifaddrs (struct ifaddrs *ifap)\r
-{\r
-  GasketUintn( freeifaddrs, ( UINTN ) ifap );\r
-}\r
-\r
-\r
-int\r
-Gasketsocket (int domain, int type, int protocol )\r
-{\r
-  return( GasketUintnUintnUintn( socket, domain, type, protocol ) );\r
-}\r
-\r
-\r
-#endif\r
-\r
diff --git a/UnixPkg/Sec/Gasket.h b/UnixPkg/Sec/Gasket.h
deleted file mode 100644 (file)
index 4c75d8a..0000000
+++ /dev/null
@@ -1,594 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _GASKET_H_\r
-#define _GASKET_H_\r
-\r
-#include <Library/PeCoffLib.h>\r
-\r
-#include <Protocol/UgaDraw.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Protocol/SimpleTextInEx.h>\r
-#include <Protocol/UnixUgaIo.h>\r
-\r
-\r
-//\r
-// Gasket functions for EFI_UNIX_THUNK_PROTOCOL\r
-//\r
-\r
-void\r
-EFIAPI\r
-GasketmsSleep (unsigned long Milliseconds);\r
-\r
-void\r
-EFIAPI\r
-Gasketexit (\r
-  int status\r
-  );\r
-\r
-void\r
-EFIAPI\r
-GasketSetTimer (\r
-  UINT64 PeriodMs,\r
-  VOID (*CallBack)(UINT64 DeltaMs)\r
-  );\r
-\r
-void\r
-EFIAPI\r
-GasketGetLocalTime (\r
-  EFI_TIME *Time\r
-  );\r
-\r
-struct tm *\r
-EFIAPI\r
-Gasketgmtime (\r
-  const time_t *clock\r
-  );\r
-\r
-long\r
-EFIAPI\r
-GasketGetTimeZone (\r
-  void\r
-  );\r
-\r
-int\r
-EFIAPI\r
-GasketGetDayLight (\r
-  void\r
-  );\r
-\r
-\r
-int\r
-EFIAPI\r
-Gasketpoll (\r
-  struct pollfd *pfd,\r
-  unsigned int nfds,\r
-  int timeout\r
-  );\r
-\r
-long\r
-EFIAPI\r
-Gasketread (\r
-  int fd,\r
-  void *buf,\r
-  int count);\r
-\r
-long\r
-EFIAPI\r
-Gasketwrite (\r
-  int fd,\r
-  const void *buf,\r
-  int count\r
-  );\r
-\r
-char *\r
-EFIAPI\r
-Gasketgetenv (\r
-  const char *name\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketopen (\r
-  const char *name,\r
-  int flags,\r
-  int mode\r
-  );\r
-\r
-off_t\r
-EFIAPI\r
-Gasketlseek (\r
-  int fd,\r
-  off_t off,\r
-  int whence\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketftruncate (\r
-  int fd,\r
-  long int len\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketclose (\r
-  int fd\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketmkdir (\r
-  const char *pathname,\r
-  mode_t mode\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketrmdir (\r
-  const char *pathname\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketunlink (\r
-  const char *pathname\r
-  );\r
-\r
-int\r
-EFIAPI\r
-GasketGetErrno (\r
-  void\r
-  );\r
-\r
-DIR *\r
-EFIAPI\r
-Gasketopendir (\r
-  const char *pathname\r
-  );\r
-\r
-void\r
-EFIAPI\r
-Gasketrewinddir (\r
-  DIR *dir\r
-  );\r
-\r
-struct dirent *\r
-EFIAPI\r
-Gasketreaddir (\r
-  DIR *dir\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketclosedir (\r
-  DIR *dir\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketstat (\r
-  const char  *path, \r
-  STAT_FIX    *buf)\r
-  ;\r
-\r
-int\r
-EFIAPI\r
-Gasketstatfs (\r
-  const char      *path, \r
-  struct statfs   *buf\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketrename (\r
-  const char *oldpath,\r
-  const char *newpath\r
-  );\r
-\r
-time_t\r
-EFIAPI\r
-Gasketmktime (\r
-  struct tm *tm\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketfsync (\r
-  int fd\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketchmod (\r
-  const char *path,\r
-  mode_t mode\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketutime (\r
-  const char *filename,\r
-  const struct utimbuf *buf\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gaskettcflush (\r
-  int fildes,\r
-  int queue_selector\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaCreate (\r
-  struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo,\r
-  CONST CHAR16 *Title\r
-  );\r
-\r
-void\r
-EFIAPI\r
-Gasketperror (\r
-  __const char *__s\r
-  );\r
-\r
-//\r
-// ... is always an int or pointer to device specific data structure\r
-//\r
-\r
-int\r
-EFIAPI\r
-Gasketioctl (\r
-  int fd,\r
-  unsigned long int __request,\r
-  void *Arg\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketfcntl (\r
-  int __fd,\r
-  int __cmd,\r
-  void *Arg\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketcfsetispeed (\r
-  struct termios *__termios_p,\r
-  speed_t __speed\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketcfsetospeed (\r
-  struct termios *__termios_p,\r
-  speed_t __speed\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gaskettcgetattr (\r
-  int __fd,\r
-  struct termios *__termios_p\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gaskettcsetattr (\r
-  int __fd,\r
-  int __optional_actions,\r
-  __const struct termios *__termios_p\r
-  );\r
-\r
-int\r
-EFIAPI\r
-Gasketsigaction (\r
-  int sig,\r
-  const struct sigaction *act,\r
-  struct sigaction *oact\r
-  );\r
-\r
-int \r
-EFIAPI \r
-Gasketgetifaddrs (\r
-  struct ifaddrs **ifap\r
-  );\r
-\r
-void \r
-EFIAPI \r
-Gasketfreeifaddrs (\r
-  struct ifaddrs *ifap\r
-  );\r
-\r
-int \r
-EFIAPI \r
-Gasketsocket (\r
-  int domain, \r
-  int type, \r
-  int protocol\r
-  );\r
-\r
-void \r
-EFIAPI \r
-GasketUnixEnableInterrupt (void);\r
-\r
-void \r
-EFIAPI \r
-GasketUnixDisableInterrupt (void);\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-GasketUnixPeCoffGetEntryPoint (\r
-  IN     VOID  *Pe32Data,\r
-  IN OUT VOID  **EntryPoint\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-GasketUnixPeCoffRelocateImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-GasketUnixPeCoffUnloadImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  );\r
-\r
-\r
-\r
-UINTN\r
-EFIAPI\r
-GasketVoid (\r
-  void *api\r
-  );\r
-\r
-UINTN\r
-EFIAPI\r
-GasketUintn (\r
-  void *api,\r
-  UINTN a\r
-  );\r
-\r
-UINTN\r
-EFIAPI\r
-GasketUintnUintn (\r
-  void *api,\r
-  UINTN a,\r
-  UINTN b\r
-  );\r
-\r
-UINTN\r
-EFIAPI\r
-GasketUintnUintnUintn (\r
-  void *api,\r
-  UINTN a,\r
-  UINTN b,\r
-  UINTN c\r
-  );\r
-\r
-UINTN\r
-EFIAPI\r
-GasketUintnUintnUintnUintn (\r
-  void *api,\r
-  UINTN a,\r
-  UINTN b,\r
-  UINTN c,\r
-  UINTN d\r
-  );\r
-\r
-UINTN\r
-EFIAPI\r
-GasketUintn10Args (\r
-  void *api,\r
-  UINTN a,\r
-  UINTN b,\r
-  UINTN c,\r
-  UINTN d,\r
-  UINTN e,\r
-  UINTN f,\r
-  UINTN g,\r
-  UINTN h,\r
-  UINTN i,\r
-  UINTN j\r
-  );\r
-\r
-UINTN\r
-EFIAPI\r
-GasketUint64Uintn (\r
-  void *api,\r
-  UINT64 a,\r
-  UINTN b);\r
-\r
-UINT64\r
-EFIAPI\r
-GasketUintnUint64Uintn (\r
-  void *api,\r
-  UINTN a,\r
-  UINT64 b,\r
-  UINTN c\r
-  );\r
-\r
-UINTN\r
-EFIAPI\r
-GasketUintnUint16 (\r
-  void *api,\r
-  UINTN a,\r
-  UINT16 b\r
-  );\r
-\r
-typedef\r
-void\r
-(*CALL_BACK) (\r
-  UINT64 Delta\r
-  );\r
-\r
-UINTN\r
-ReverseGasketUint64 (\r
-  CALL_BACK CallBack,\r
-  UINT64 a\r
-  );\r
-\r
-UINTN\r
-ReverseGasketUint64Uint64 (\r
-  VOID      *CallBack,\r
-  VOID      *Context,\r
-  VOID      *Key\r
-  );\r
-\r
-//\r
-// Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL\r
-//\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaClose (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaSize (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
-  UINT32 Width,\r
-  UINT32 Height\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaCheckKey (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaGetKey (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
-  EFI_KEY_DATA              *key\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaKeySetState (\r
-   EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
-  EFI_KEY_TOGGLE_STATE *KeyToggleState\r
-  );\r
-  \r
-EFI_STATUS\r
-EFIAPI  \r
-GasketUgaRegisterKeyNotify ( \r
-  IN EFI_UNIX_UGA_IO_PROTOCOL           *UgaIo, \r
-  IN UGA_REGISTER_KEY_NOTIFY_CALLBACK   CallBack,\r
-  IN VOID                               *Context\r
-  );\r
-  \r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaBlt (\r
-  IN  EFI_UNIX_UGA_IO_PROTOCOL                *UgaIo,\r
-   IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,\r
-   IN  EFI_UGA_BLT_OPERATION                   BltOperation,\r
-  IN  UGA_BLT_ARGS                            *Args\r
-   );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketUgaCheckPointer (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
-  );\r
-\r
-EFI_STATUS \r
-EFIAPI \r
-GasketUgaGetPointerState (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, \r
-  EFI_SIMPLE_POINTER_STATE *state\r
-  );\r
-\r
-\r
-//\r
-// Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL C calls\r
-//\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UgaCreate (\r
-  EFI_UNIX_UGA_IO_PROTOCOL **Uga,\r
-  CONST CHAR16 *Title\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UgaClose (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UgaSize(\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
-  UINT32 Width,\r
-  UINT32 Height\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UgaCheckKey(\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UgaGetKey (\r
-  EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
-  EFI_KEY_DATA             *key\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UgaRegisterKeyNotify (\r
-  IN EFI_UNIX_UGA_IO_PROTOCOL           *UgaIo, \r
-  IN UGA_REGISTER_KEY_NOTIFY_CALLBACK   CallBack,\r
-  IN VOID                               *Context\r
-  );\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UgaBlt (\r
-  IN  EFI_UNIX_UGA_IO_PROTOCOL                *UgaIo,\r
-  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,\r
-  IN  EFI_UGA_BLT_OPERATION                   BltOperation,\r
-  IN  UGA_BLT_ARGS                            *Args\r
-  );\r
-\r
-EFI_STATUS \r
-EFIAPI\r
-UgaCheckPointer (\r
-  IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
-  );\r
-  \r
-EFI_STATUS\r
-EFIAPI\r
-UgaGetPointerState (\r
-  IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, \r
-  IN EFI_SIMPLE_POINTER_STATE *State\r
-  );\r
-\r
-\r
-#endif\r
-\r
-\r
diff --git a/UnixPkg/Sec/Ia32/Gasket.S b/UnixPkg/Sec/Ia32/Gasket.S
deleted file mode 100644 (file)
index 5f762a3..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# OS X Application requires 16 byte stack alignment. The problem is these\r
-# APIs are exposed to code that does not have this requirement via \r
-# EFI_UNIX_THUNK_PROTOCOL. So these are wrapper functions that make sure\r
-# the stack is aligned. This code should also work if the stack is already\r
-# aligned. Extra stack padding is really the same as local varaibles so \r
-# it gets freed by the leave instruction\r
-#\r
-# I basically used the compiler, added extra 16 bytes to the local stack and\r
-# made sure %esp ended in 0 before the call (16 byte algined)\r
-#\r
-# The EFI_UNIX_THUNK_PROTOCOL member functions call a C API that then calls \r
-# one of these generic assembly routines.  We do it that way to work around \r
-# some magic name changing that happens in C. For example stat() is _stat() \r
-# on Leopard and _stat$INDOE64 on Snow Leopard. That is why we pass stat()\r
-# into one of these gaskets from C code.\r
-#\r
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#ifdef __APPLE__\r
-\r
-  .text\r
-\r
-#------------------------------------------------------------------------------\r
-# int GasketVoid (void *api)\r
-#------------------------------------------------------------------------------    \r
-.globl _GasketVoid\r
-_GasketVoid:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $34, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintn\r
-_GasketUintn:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $50, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintnUintn\r
-_GasketUintnUintn:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $50, %esp           # sub extra 0x10 from the stack for the AND \r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, 4(%esp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintnUintnUintn\r
-_GasketUintnUintnUintn:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $50, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  20(%ebp), %eax\r
-  movl  %eax, 8(%esp)\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, 4(%esp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintnUintnUintnUintn\r
-_GasketUintnUintnUintnUintn:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $50, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  24(%ebp), %eax\r
-  movl  %eax, 12(%esp)\r
-  movl  20(%ebp), %eax\r
-  movl  %eax, 8(%esp)\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, 4(%esp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintnUintnUintnUintnUintn\r
-_GasketUintnUintnUintnUintnUintn:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $50, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  28(%ebp), %eax\r
-  movl  %eax, 16(%esp)\r
-  movl  24(%ebp), %eax\r
-  movl  %eax, 12(%esp)\r
-  movl  20(%ebp), %eax\r
-  movl  %eax, 8(%esp)\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, 4(%esp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintn10Args\r
-_GasketUintn10Args:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $82, %esp         # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp        # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  8(%ebp), %eax     \r
-  movl  %eax, -12(%ebp)\r
-  movl  48(%ebp), %eax\r
-  movl  %eax, 36(%esp)\r
-  movl  44(%ebp), %eax\r
-  movl  %eax, 32(%esp)\r
-  movl  40(%ebp), %eax\r
-  movl  %eax, 28(%esp)\r
-  movl  36(%ebp), %eax\r
-  movl  %eax, 24(%esp)\r
-  movl  32(%ebp), %eax\r
-  movl  %eax, 20(%esp)\r
-  movl  28(%ebp), %eax\r
-  movl  %eax, 16(%esp)\r
-  movl  24(%ebp), %eax\r
-  movl  %eax, 12(%esp)\r
-  movl  20(%ebp), %eax\r
-  movl  %eax, 8(%esp)\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, 4(%esp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUint64Uintn\r
-_GasketUint64Uintn:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $66, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, -32(%ebp)\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, -28(%ebp)\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  20(%ebp), %eax\r
-  movl  %eax, 8(%esp)\r
-  movl  -32(%ebp), %eax\r
-  movl  -28(%ebp), %edx\r
-  movl  %eax, (%esp)\r
-  movl  %edx, 4(%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintnUint64Uintn\r
-_GasketUintnUint64Uintn:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $66, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, -32(%ebp)\r
-  movl  20(%ebp), %eax\r
-  movl  %eax, -28(%ebp)\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  24(%ebp), %eax\r
-  movl  %eax, 12(%esp)\r
-  movl  -32(%ebp), %eax\r
-  movl  -28(%ebp), %edx\r
-  movl  %eax, 4(%esp)\r
-  movl  %edx, 8(%esp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-\r
-#------------------------------------------------------------------------------\r
-#------------------------------------------------------------------------------\r
-.globl _GasketUintnUint16\r
-_GasketUintnUint16:\r
-  pushl %ebp\r
-  movl  %esp, %ebp\r
-  subl  $66, %esp           # sub extra 0x10 from the stack for the AND\r
-  and   $-16, %esp          # stack needs to end in 0xFFFFFFF0 before call\r
-  movl  16(%ebp), %eax\r
-  movw  %ax, -28(%ebp)\r
-  movl  8(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movzwl  -28(%ebp), %eax\r
-  movl  %eax, 4(%esp)\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, (%esp)\r
-  movl  -12(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-  \r
-  \r
-.globl _ReverseGasketUint64\r
-_ReverseGasketUint64:\r
-  pushl  %ebp\r
-  movl  %esp, %ebp\r
-  subl  $40, %esp\r
-  movl  12(%ebp), %eax\r
-  movl  %eax, -16(%ebp)\r
-  movl  16(%ebp), %eax\r
-  movl  %eax, -12(%ebp)\r
-  movl  -16(%ebp), %eax\r
-  movl  -12(%ebp), %edx\r
-  movl  %eax, (%esp)\r
-  movl  %edx, 4(%esp)\r
-  movl  8(%ebp), %eax\r
-  call  *%eax\r
-  leave\r
-  ret\r
-  \r
-  \r
-.globl _ReverseGasketUint64Uint64\r
-_ReverseGasketUint64Uint64:\r
-  pushl   %ebp\r
-  movl    %esp, %ebp\r
-  subl    $56, %esp\r
-  movl    12(%ebp), %eax\r
-  movl    %eax, -32(%ebp)\r
-  movl    16(%ebp), %eax\r
-  movl    %eax, -28(%ebp)\r
-  movl    20(%ebp), %eax\r
-  movl    %eax, -40(%ebp)\r
-  movl    24(%ebp), %eax\r
-  movl    %eax, -36(%ebp)\r
-  movl    8(%ebp), %eax\r
-  movl    %eax, -12(%ebp)\r
-  movl    -40(%ebp), %eax\r
-  movl    -36(%ebp), %edx\r
-  movl    %eax, 8(%esp)\r
-  movl    %edx, 12(%esp)\r
-  movl    -32(%ebp), %eax\r
-  movl    -28(%ebp), %edx\r
-  movl    %eax, (%esp)\r
-  movl    %edx, 4(%esp)\r
-  movl    -12(%ebp), %eax\r
-  call    *%eax\r
-  leave\r
-  ret\r
-\r
-  \r
-// Sec PPI Callbacks\r
-\r
-.globl _GasketSecUnixPeiLoadFile\r
-_GasketSecUnixPeiLoadFile:\r
-  jmp    _SecUnixPeiLoadFile\r
-\r
-\r
-.globl _GasketSecUnixPeiAutoScan\r
-_GasketSecUnixPeiAutoScan:\r
-  jmp    _SecUnixPeiAutoScan\r
-\r
-\r
-.globl _GasketSecUnixUnixThunkAddress\r
-_GasketSecUnixUnixThunkAddress:\r
-  jmp    _SecUnixUnixThunkAddress\r
-\r
-\r
-.globl _GasketSecPeiReportStatusCode\r
-_GasketSecPeiReportStatusCode:\r
-  jmp    _SecPeiReportStatusCode\r
-\r
-\r
-.globl _GasketSecUnixFdAddress\r
-_GasketSecUnixFdAddress:\r
-  jmp    _SecUnixFdAddress\r
-\r
-\r
-.globl _GasketSecTemporaryRamSupport\r
-_GasketSecTemporaryRamSupport:\r
-  jmp    _SecTemporaryRamSupport\r
-  \r
-  #endif\r
diff --git a/UnixPkg/Sec/Ia32/Stack.S b/UnixPkg/Sec/Ia32/Stack.S
deleted file mode 100644 (file)
index ff5a77f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>\r
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   Stack.asm\r
-#\r
-# Abstract:\r
-#\r
-#   Switch the stack from temporary memory to permenent memory.\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# SecSwitchStack (\r
-#   UINT32   TemporaryMemoryBase,\r
-#   UINT32   PermenentMemoryBase\r
-#   );\r
-#------------------------------------------------------------------------------    \r
-\r
-#include <ProcessorBind.h>\r
-\r
-ASM_GLOBAL ASM_PFX(SecSwitchStack)\r
-ASM_PFX(SecSwitchStack):\r
-#\r
-# Save three register: eax, ebx, ecx\r
-#    \r
-    push  %eax\r
-    push  %ebx\r
-    push  %ecx\r
-    push  %edx\r
-    \r
-#\r
-# !!CAUTION!! this function address's is pushed into stack after\r
-# migration of whole temporary memory, so need save it to permenent\r
-# memory at first!\r
-#    \r
-    \r
-    movl  20(%esp), %ebx            # Save the first parameter\r
-    movl  24(%esp), %ecx            # Save the second parameter\r
-    \r
-#\r
-# Save this function's return address into permenent memory at first.\r
-# Then, Fixup the esp point to permenent memory\r
-#\r
-\r
-    movl  %esp, %eax\r
-    subl  %ebx, %eax\r
-    addl  %ecx, %eax\r
-    movl  (%esp), %edx                 # copy pushed register's value to permenent memory\r
-    movl  %edx, (%eax)\r
-    movl  4(%esp), %edx\r
-    movl  %edx, 4(%eax)\r
-    movl  8(%esp), %edx\r
-    movl  %edx, 8(%eax)\r
-    movl  12(%esp), %edx\r
-    movl  %edx, 12(%eax)\r
-    movl  16(%esp), %edx\r
-    movl  %edx, 16(%eax)\r
-    movl  %eax, %esp                   # From now, esp is pointed to permenent memory\r
-\r
-#\r
-# Fixup the ebp point to permenent memory\r
-#\r
-#ifndef __APPLE__\r
-    movl   %ebp, %eax\r
-    subl   %ebx, %eax\r
-    addl   %ecx, %eax\r
-    movl   %eax, %ebp                  # From now, ebp is pointed to permenent memory\r
-    \r
-#\r
-# Fixup callee's ebp point for PeiDispatch\r
-#    \r
-    movl   (%ebp), %eax\r
-    subl   %ebx, %eax\r
-    addl   %ecx, %eax\r
-    movl   %eax, (%ebp)                # From now, Temporary's PPI caller's stack is in permenent memory\r
-#endif    \r
-    \r
-    pop   %edx\r
-    pop   %ecx\r
-    pop   %ebx\r
-    pop   %eax\r
-    ret\r
diff --git a/UnixPkg/Sec/Ia32/SwitchStack.c b/UnixPkg/Sec/Ia32/SwitchStack.c
deleted file mode 100644 (file)
index cf5f364..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-  SecMain.c
-
-Abstract:
-  Unix emulator of SEC phase. It's really a Posix application, but this is
-  Ok since all the other modules for NT32 are NOT Posix applications.
-
-  This program processes host environment variables 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 availble for usage in PEI.
-
-  This code produces 128 K of temporary memory for the PEI stack by opening a
-  host file and mapping it directly to memory addresses.
-
-  The system.cmd script is used to set host environment variables that drive
-  the configuration opitons of the SEC.
-
---*/
-
-#include "SecMain.h"
-
-
-/**
-  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);  
-}
-
-
-
diff --git a/UnixPkg/Sec/SecMain.c b/UnixPkg/Sec/SecMain.c
deleted file mode 100644 (file)
index f0627be..0000000
+++ /dev/null
@@ -1,1340 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-  SecMain.c
-
-Abstract:
-  Unix emulator of SEC phase. It's really a Posix application, but this is
-  Ok since all the other modules for NT32 are NOT Posix applications.
-
-  This program processes host environment variables 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 availble for usage in PEI.
-
-  This code produces 128 K of temporary memory for the PEI stack by opening a
-  host file and mapping it directly to memory addresses.
-
-  The system.cmd script is used to set host environment variables that drive
-  the configuration opitons of the SEC.
-
---*/
-
-#include "SecMain.h"
-#include <sys/mman.h>
-#include <Ppi/UnixPeiLoadFile.h>
-#include <Ppi/TemporaryRamSupport.h>
-#include <dlfcn.h>
-
-#ifdef __APPLE__
-#define MAP_ANONYMOUS MAP_ANON
-char *gGdbWorkingFileName = NULL;
-#endif
-
-
-//
-// Globals
-//
-#if defined(__APPLE__) || defined(MDE_CPU_X64)
-UNIX_PEI_LOAD_FILE_PPI                    mSecUnixLoadFilePpi        = { GasketSecUnixPeiLoadFile };
-PEI_UNIX_AUTOSCAN_PPI                     mSecUnixAutoScanPpi        = { GasketSecUnixPeiAutoScan };
-PEI_UNIX_THUNK_PPI                        mSecUnixThunkPpi           = { GasketSecUnixUnixThunkAddress };
-EFI_PEI_PROGRESS_CODE_PPI                 mSecStatusCodePpi          = { GasketSecPeiReportStatusCode };
-UNIX_FWH_PPI                              mSecFwhInformationPpi      = { GasketSecUnixFdAddress };
-EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI         mSecTemporaryRamSupportPpi = { GasketSecTemporaryRamSupport };
-#else
-UNIX_PEI_LOAD_FILE_PPI                    mSecUnixLoadFilePpi        = { SecUnixPeiLoadFile };
-PEI_UNIX_AUTOSCAN_PPI                     mSecUnixAutoScanPpi        = { SecUnixPeiAutoScan };
-PEI_UNIX_THUNK_PPI                        mSecUnixThunkPpi           = { SecUnixUnixThunkAddress };
-EFI_PEI_PROGRESS_CODE_PPI                 mSecStatusCodePpi          = { SecPeiReportStatusCode };
-UNIX_FWH_PPI                              mSecFwhInformationPpi      = { SecUnixFdAddress };
-EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI         mSecTemporaryRamSupportPpi = { SecTemporaryRamSupport };
-#endif
-
-EFI_PEI_PPI_DESCRIPTOR  gPrivateDispatchTable[] = {
-  {
-    EFI_PEI_PPI_DESCRIPTOR_PPI,
-    &gUnixPeiLoadFilePpiGuid,
-    &mSecUnixLoadFilePpi
-  },
-  {
-    EFI_PEI_PPI_DESCRIPTOR_PPI,
-    &gPeiUnixAutoScanPpiGuid,
-    &mSecUnixAutoScanPpi
-  },
-  {
-    EFI_PEI_PPI_DESCRIPTOR_PPI,
-    &gPeiUnixThunkPpiGuid,
-    &mSecUnixThunkPpi
-  },
-  {
-    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,
-    &gUnixFwhPpiGuid,
-    &mSecFwhInformationPpi
-  }
-};
-
-
-//
-// Default information about where the FD is located.
-//  This array gets filled in with information from EFI_FIRMWARE_VOLUMES
-//  EFI_FIRMWARE_VOLUMES is a host environment variable set by system.cmd.
-//  The number of array elements is allocated base on parsing
-//  EFI_FIRMWARE_VOLUMES and the memory is never freed.
-//
-UINTN                                     gFdInfoCount = 0;
-UNIX_FD_INFO                                *gFdInfo;
-
-//
-// Array that supports seperate memory rantes.
-//  The memory ranges are set in system.cmd via the EFI_MEMORY_SIZE variable.
-//  The number of array elements is allocated base on parsing
-//  EFI_MEMORY_SIZE and the memory is never freed.
-//
-UINTN                                     gSystemMemoryCount = 0;
-UNIX_SYSTEM_MEMORY                       *gSystemMemory;
-
-
-
-UINTN                        mImageContextModHandleArraySize = 0;
-IMAGE_CONTEXT_TO_MOD_HANDLE  *mImageContextModHandleArray = NULL;
-
-
-VOID
-EFIAPI
-SecSwitchStack (
-  UINT32   TemporaryMemoryBase,
-  UINT32   PermenentMemoryBase
-  );
-
-EFI_PHYSICAL_ADDRESS *
-MapMemory (
-  INTN fd,
-  UINT64 length,
-  INTN   prot,
-  INTN   flags);
-
-EFI_STATUS
-MapFile (
-  IN  CHAR8                     *FileName,
-  IN OUT  EFI_PHYSICAL_ADDRESS  *BaseAddress,
-  OUT UINT64                    *Length
-  );
-
-EFI_STATUS
-EFIAPI
-SecNt32PeCoffRelocateImage (
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext
-  );
-
-
-int
-main (
-  IN  int   Argc,
-  IN  char  **Argv,
-  IN  char  **Envp
-  )
-/*++
-
-Routine Description:
-  Main entry point to SEC for Unix. This is a unix program
-
-Arguments:
-  Argc - Number of command line arguments
-  Argv - Array of command line argument strings
-  Envp - Array of environmemt variable strings
-
-Returns:
-  0 - Normal exit
-  1 - Abnormal exit
-
---*/
-{
-  EFI_STATUS            Status;
-  EFI_PHYSICAL_ADDRESS  InitialStackMemory;
-  UINT64                InitialStackMemorySize;
-  UINTN                 Index;
-  UINTN                 Index1;
-  UINTN                 Index2;
-  UINTN                 PeiIndex;
-  CHAR8                 *FileName;
-  BOOLEAN               Done;
-  VOID                  *PeiCoreFile;
-  CHAR16                *MemorySizeStr;
-  CHAR16                *FirmwareVolumesStr;
-  UINTN                 *StackPointer;
-
-  setbuf(stdout, 0);
-  setbuf(stderr, 0);
-
-  MemorySizeStr      = (CHAR16 *) PcdGetPtr (PcdUnixMemorySizeForSecMain);
-  FirmwareVolumesStr = (CHAR16 *) PcdGetPtr (PcdUnixFirmwareVolume);
-
-  printf ("\nEDK SEC Main UNIX Emulation Environment from edk2.sourceforge.net\n");
-
-#ifdef __APPLE__
-  //
-  // We can't use dlopen on OS X, so we need a scheme to get symboles into gdb
-  // We need to create a temp file that contains gdb commands so we can load
-  // symbols when we load every PE/COFF image.
-  //
-  Index = strlen (*Argv);
-  gGdbWorkingFileName = malloc (Index + strlen(".gdb") + 1);
-  strcpy (gGdbWorkingFileName, *Argv);
-  strcat (gGdbWorkingFileName, ".gdb");
-#endif
-
-
-  //
-  // Allocate space for gSystemMemory Array
-  //
-  gSystemMemoryCount  = CountSeperatorsInString (MemorySizeStr, '!') + 1;
-  gSystemMemory       = calloc (gSystemMemoryCount, sizeof (UNIX_SYSTEM_MEMORY));
-  if (gSystemMemory == NULL) {
-    printf ("ERROR : Can not allocate memory for system.  Exiting.\n");
-    exit (1);
-  }
-  //
-  // Allocate space for gSystemMemory Array
-  //
-  gFdInfoCount  = CountSeperatorsInString (FirmwareVolumesStr, '!') + 1;
-  gFdInfo       = calloc (gFdInfoCount, sizeof (UNIX_FD_INFO));
-  if (gFdInfo == NULL) {
-    printf ("ERROR : Can not allocate memory for fd info.  Exiting.\n");
-    exit (1);
-  }
-  //
-  // Setup Boot Mode. If BootModeStr == "" then BootMode = 0 (BOOT_WITH_FULL_CONFIGURATION)
-  //
-  printf ("  BootMode 0x%02x\n", (unsigned int)PcdGet32 (PcdUnixBootMode));
-
-  //
-  // Open up a 128K file 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 UnixOpenFile will allocate a new mapping
-  //
-  InitialStackMemorySize  = STACK_SIZE;
-  InitialStackMemory = (UINTN)MapMemory(0,
-          (UINT32) InitialStackMemorySize,
-          PROT_READ | PROT_WRITE | PROT_EXEC,
-          MAP_ANONYMOUS | MAP_PRIVATE);
-  if (InitialStackMemory == 0) {
-    printf ("ERROR : Can not open SecStack Exiting\n");
-    exit (1);
-  }
-
-  printf ("  SEC passing in %u KB of temp RAM at 0x%08lx to PEI\n",
-    (unsigned int)(InitialStackMemorySize / 1024),
-    (unsigned long)InitialStackMemory);
-
-  for (StackPointer = (UINTN*) (UINTN) InitialStackMemory;
-     StackPointer < (UINTN*)(UINTN)((UINTN) InitialStackMemory + (UINT64) InitialStackMemorySize);
-     StackPointer ++) {
-    *StackPointer = 0x5AA55AA5;
-  }
-
-  //
-  // Open All the firmware volumes and remember the info in the gFdInfo global
-  //
-  FileName = (CHAR8 *)malloc (StrLen (FirmwareVolumesStr) + 1);
-  if (FileName == NULL) {
-    printf ("ERROR : Can not allocate memory for firmware volume string\n");
-    exit (1);
-  }
-
-  Index2 = 0;
-  for (Done = FALSE, Index = 0, PeiIndex = 0, PeiCoreFile = NULL;
-       FirmwareVolumesStr[Index2] != 0;
-       Index++) {
-    for (Index1 = 0; (FirmwareVolumesStr[Index2] != '!') && (FirmwareVolumesStr[Index2] != 0); Index2++)
-      FileName[Index1++] = FirmwareVolumesStr[Index2];
-    if (FirmwareVolumesStr[Index2] == '!')
-      Index2++;
-    FileName[Index1]  = '\0';
-
-    //
-    // Open the FD and remmeber where it got mapped into our processes address space
-    //
-    Status = MapFile (
-          FileName,
-          &gFdInfo[Index].Address,
-          &gFdInfo[Index].Size
-          );
-    if (EFI_ERROR (Status)) {
-      printf ("ERROR : Can not open Firmware Device File %s (%x).  Exiting.\n", FileName, (unsigned int)Status);
-      exit (1);
-    }
-
-    printf ("  FD loaded from %s at 0x%08lx",
-      FileName, (unsigned long)gFdInfo[Index].Address);
-
-    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)) {
-        PeiIndex = Index;
-        printf (" contains SEC Core");
-      }
-    }
-
-    printf ("\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.
-  //
-  Index1 = 0;
-  Index = 0;
-  while (1) {
-    UINTN val = 0;
-    //
-    // Save the size of the memory.
-    //
-    while (MemorySizeStr[Index1] >= '0' && MemorySizeStr[Index1] <= '9') {
-      val = val * 10 + MemorySizeStr[Index1] - '0';
-      Index1++;
-    }
-    gSystemMemory[Index++].Size = val * 0x100000;
-    if (MemorySizeStr[Index1] == 0)
-      break;
-    Index1++;
-  }
-
-  printf ("\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.
-  //
-  printf ("ERROR : PEI Core returned\n");
-  exit (1);
-}
-
-EFI_PHYSICAL_ADDRESS *
-MapMemory (
-  INTN fd,
-  UINT64 length,
-  INTN   prot,
-  INTN   flags)
-{
-  STATIC UINTN base  = 0x40000000;
-  CONST UINTN  align = (1 << 24);
-  VOID         *res  = NULL;
-  BOOLEAN      isAligned = 0;
-
-  //
-  // Try to get an aligned block somewhere in the address space of this
-  // process.
-  //
-  while((!isAligned) && (base != 0)) {
-    res = mmap ((void *)base, length, prot, flags, fd, 0);
-    if (res == MAP_FAILED) {
-      return NULL;
-    }
-    if ((((UINTN)res) & ~(align-1)) == (UINTN)res) {
-      isAligned=1;
-    }
-    else {
-      munmap(res, length);
-      base += align;
-    }
-  }
-  return res;
-}
-
-EFI_STATUS
-MapFile (
-  IN  CHAR8                     *FileName,
-  IN OUT  EFI_PHYSICAL_ADDRESS  *BaseAddress,
-  OUT UINT64                    *Length
-  )
-/*++
-
-Routine Description:
-  Opens and memory maps a file using Unix 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 a 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
-
---*/
-{
-  int fd;
-  VOID    *res;
-  UINTN   FileSize;
-
-  fd = open (FileName, O_RDONLY);
-  if (fd < 0)
-    return EFI_NOT_FOUND;
-  FileSize = lseek (fd, 0, SEEK_END);
-
-#if 0
-  if (IsMain)
-    {
-      /* Read entry address.  */
-      lseek (fd, FileSize - 0x20, SEEK_SET);
-      if (read (fd, &EntryAddress, 4) != 4)
-  {
-    close (fd);
-    return EFI_DEVICE_ERROR;
-  }
-    }
-#endif
-
-  res = MapMemory(fd, FileSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE);
-
-  close (fd);
-
-  if (res == MAP_FAILED)
-    return EFI_DEVICE_ERROR;
-
-  *Length = (UINT64) FileSize;
-  *BaseAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) res;
-
-  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 UNIX 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 ()
-    //
-    printf ("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);
-    printf ("%s", PrintBuffer);
-  }
-
-  return EFI_SUCCESS;
-}
-
-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
-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;
-  EFI_PHYSICAL_ADDRESS        TopOfMemory;
-  VOID                        *TopOfStack;
-  UINT64                      PeiCoreSize;
-  EFI_PHYSICAL_ADDRESS        PeiCoreEntryPoint;
-  EFI_PHYSICAL_ADDRESS        PeiImageAddress;
-  EFI_SEC_PEI_HAND_OFF        *SecCoreData;
-  UINTN                       PeiStackSize;
-  EFI_PEI_PPI_DESCRIPTOR      *DispatchTable;
-  UINTN                       DispatchTableSize;
-
-  //
-  // Compute Top Of Memory for Stack and PEI Core Allocations
-  //
-  TopOfMemory  = LargestRegion + LargestRegionSize;
-  PeiStackSize = (UINTN)RShiftU64((UINT64)STACK_SIZE,1);
-
-  //
-  // |-----------| <---- TemporaryRamBase + TemporaryRamSize
-  // |   Heap    |
-  // |           |
-  // |-----------| <---- StackBase / PeiTemporaryMemoryBase
-  // |           |
-  // |  Stack    |
-  // |-----------| <---- TemporaryRamBase
-  //
-  TopOfStack  = (VOID *)(LargestRegion + PeiStackSize);
-  TopOfMemory = 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 (PcdUnixFirmwareFdSize);
-  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 = SecUnixPeiLoadFile (
-            PeiCorePe32File,
-            &PeiImageAddress,
-            &PeiCoreSize,
-            &PeiCoreEntryPoint
-            );
-  if (EFI_ERROR (Status)) {
-    return ;
-  }
-
-  DispatchTableSize = sizeof (gPrivateDispatchTable);
-  DispatchTableSize += OverrideDispatchTableExtraSize ();
-
-  DispatchTable = malloc (DispatchTableSize);
-  if (DispatchTable == NULL) {
-    return;
-  }
-
-  //
-  // Allow an override for extra PPIs to be passed up to PEI
-  // This is an easy way to enable OS specific customizations
-  //
-  OverrideDispatchTable (&gPrivateDispatchTable[0], sizeof (gPrivateDispatchTable), DispatchTable, DispatchTableSize);
-
-  //
-  // Transfer control to the PEI Core
-  //
-  PeiSwitchStacks (
-    (SWITCH_STACK_ENTRY_POINT) (UINTN) PeiCoreEntryPoint,
-    SecCoreData,
-    (VOID *)DispatchTable,
-    NULL,
-    TopOfStack
-    );
-  //
-  // If we get here, then the PEI Core returned.  This is an error
-  //
-  return ;
-}
-
-EFI_STATUS
-EFIAPI
-SecUnixPeiAutoScan (
-  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 discontiguous memory regions to be supported by the emulator.
-  It uses gSystemMemory[] and gSystemMemoryCount that were created by
-  parsing the host environment variable EFI_MEMORY_SIZE.
-  The size comes from the varaible and the address comes from the call to
-  UnixOpenFile.
-
-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
-
---*/
-{
-  void *res;
-
-  if (Index >= gSystemMemoryCount) {
-    return EFI_UNSUPPORTED;
-  }
-
-  *MemoryBase = 0;
-  res = MapMemory(0, gSystemMemory[Index].Size,
-      PROT_READ | PROT_WRITE | PROT_EXEC,
-      MAP_PRIVATE | MAP_ANONYMOUS);
-  if (res == MAP_FAILED)
-    return EFI_DEVICE_ERROR;
-  *MemorySize = gSystemMemory[Index].Size;
-  *MemoryBase = (UINTN)res;
-  gSystemMemory[Index].Memory = *MemoryBase;
-
-  return EFI_SUCCESS;
-}
-
-VOID *
-EFIAPI
-SecUnixUnixThunkAddress (
-  VOID
-  )
-/*++
-
-Routine Description:
-  Since the SEC is the only Unix program in stack it must export
-  an interface to do POSIX calls.  gUnix is initailized in UnixThunk.c.
-
-Arguments:
-  InterfaceSize - sizeof (EFI_WIN_NT_THUNK_PROTOCOL);
-  InterfaceBase - Address of the gUnix global
-
-Returns:
-  EFI_SUCCESS - Data returned
-
---*/
-{
-  return gUnix;
-}
-
-
-EFI_STATUS
-SecUnixPeiLoadFile (
-  IN  VOID                    *Pe32Data,
-  OUT EFI_PHYSICAL_ADDRESS    *ImageAddress,
-  OUT UINT64                  *ImageSize,
-  OUT 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 UNIX (not emulator) memory. Extra space is for alignment
-  //
-  ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) MapMemory (
-    0,
-    (UINT32) (ImageContext.ImageSize + (ImageContext.SectionAlignment * 2)),
-    PROT_READ | PROT_WRITE | PROT_EXEC,
-    MAP_ANONYMOUS | MAP_PRIVATE
-    );
-  if (ImageContext.ImageAddress == 0) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-
-  //
-  // Align buffer on section boundry
-  //
-  ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
-  ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));
-
-
-  Status = PeCoffLoaderLoadImage (&ImageContext);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
-
-  Status = PeCoffLoaderRelocateImage (&ImageContext);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
-
-
-  SecPeCoffRelocateImageExtraAction (&ImageContext);
-
-  //
-  // BugBug: Flush Instruction Cache Here when CPU Lib is ready
-  //
-
-  *ImageAddress = ImageContext.ImageAddress;
-  *ImageSize    = ImageContext.ImageSize;
-  *EntryPoint   = ImageContext.EntryPoint;
-
-  return EFI_SUCCESS;
-}
-
-
-RETURN_STATUS
-EFIAPI
-SecPeCoffGetEntryPoint (
-  IN     VOID  *Pe32Data,
-  IN OUT VOID  **EntryPoint
-  )
-{
-  EFI_STATUS              Status;
-  EFI_PHYSICAL_ADDRESS    ImageAddress;
-  UINT64                  ImageSize;
-  EFI_PHYSICAL_ADDRESS    PhysEntryPoint;
-
-  Status = SecUnixPeiLoadFile (Pe32Data, &ImageAddress, &ImageSize, &PhysEntryPoint);
-
-  *EntryPoint = (VOID *)(UINTN)PhysEntryPoint;
-  return Status;
-}
-
-
-
-EFI_STATUS
-EFIAPI
-SecUnixFdAddress (
-  IN     UINTN                 Index,
-  IN OUT EFI_PHYSICAL_ADDRESS  *FdBase,
-  IN OUT UINT64                *FdSize,
-  IN OUT EFI_PHYSICAL_ADDRESS  *FixUp
-  )
-/*++
-
-Routine Description:
-  Return the FD Size and base address. Since the FD is loaded from a
-  file into host 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
-  FixUp  - Difference between actual FD address and build address
-
-Returns:
-  EFI_SUCCESS     - Return the Base address and size of the FV
-  EFI_UNSUPPORTED - Index does nto map to an FD in the system
-
---*/
-{
-  if (Index >= gFdInfoCount) {
-    return EFI_UNSUPPORTED;
-  }
-
-  *FdBase = gFdInfo[Index].Address;
-  *FdSize = gFdInfo[Index].Size;
-  *FixUp  = 0;
-
-  if (*FdBase == 0 && *FdSize == 0) {
-    return EFI_UNSUPPORTED;
-  }
-
-  if (Index == 0) {
-    //
-    // FD 0 has XIP code and well known PCD values
-    // If the memory buffer could not be allocated at the FD build address
-    // the Fixup is the difference.
-    //
-    *FixUp = *FdBase - PcdGet64 (PcdUnixFdBaseAddress);
-  }
-
-  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;
-}
-
-UINTN
-CountSeperatorsInString (
-  IN  const CHAR16   *String,
-  IN  CHAR16         Seperator
-  )
-/*++
-
-Routine Description:
-  Count the number of seperators in String
-
-Arguments:
-  String    - String to process
-  Seperator - Item to count
-
-Returns:
-  Number of Seperator in String
-
---*/
-{
-  UINTN Count;
-
-  for (Count = 0; *String != '\0'; String++) {
-    if (*String == Seperator) {
-      Count++;
-    }
-  }
-
-  return Count;
-}
-
-
-EFI_STATUS
-AddHandle (
-  IN  PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext,
-  IN  VOID                                 *ModHandle
-  )
-/*++
-
-Routine Description:
-  Store the ModHandle in an array indexed by the Pdb File name.
-  The ModHandle is needed to unload the image.
-
-Arguments:
-  ImageContext - Input data returned from PE Laoder Library. Used to find the
-                 .PDB file name of the PE Image.
-  ModHandle    - Returned from LoadLibraryEx() and stored for call to
-                 FreeLibrary().
-
-Returns:
-  EFI_SUCCESS - ModHandle was stored.
-
---*/
-{
-  UINTN                       Index;
-  IMAGE_CONTEXT_TO_MOD_HANDLE *Array;
-  UINTN                       PreviousSize;
-
-
-  Array = mImageContextModHandleArray;
-  for (Index = 0; Index < mImageContextModHandleArraySize; Index++, Array++) {
-    if (Array->ImageContext == NULL) {
-      //
-      // Make a copy of the stirng and store the ModHandle
-      //
-      Array->ImageContext = ImageContext;
-      Array->ModHandle    = ModHandle;
-      return EFI_SUCCESS;
-    }
-  }
-
-  //
-  // No free space in mImageContextModHandleArray so grow it by
-  // IMAGE_CONTEXT_TO_MOD_HANDLE entires. realloc will
-  // copy the old values to the new locaiton. But it does
-  // not zero the new memory area.
-  //
-  PreviousSize = mImageContextModHandleArraySize * sizeof (IMAGE_CONTEXT_TO_MOD_HANDLE);
-  mImageContextModHandleArraySize += MAX_IMAGE_CONTEXT_TO_MOD_HANDLE_ARRAY_SIZE;
-
-  mImageContextModHandleArray = realloc (mImageContextModHandleArray, mImageContextModHandleArraySize * sizeof (IMAGE_CONTEXT_TO_MOD_HANDLE));
-  if (mImageContextModHandleArray == NULL) {
-    ASSERT (FALSE);
-    return EFI_OUT_OF_RESOURCES;
-  }
-
-  memset (mImageContextModHandleArray + PreviousSize, 0, MAX_IMAGE_CONTEXT_TO_MOD_HANDLE_ARRAY_SIZE * sizeof (IMAGE_CONTEXT_TO_MOD_HANDLE));
-
-  return AddHandle (ImageContext, ModHandle);
-}
-
-
-VOID *
-RemoveHandle (
-  IN  PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext
-  )
-/*++
-
-Routine Description:
-  Return the ModHandle and delete the entry in the array.
-
-Arguments:
-  ImageContext - Input data returned from PE Laoder Library. Used to find the
-                 .PDB file name of the PE Image.
-
-Returns:
-  ModHandle - ModHandle assoicated with ImageContext is returned
-  NULL      - No ModHandle associated with ImageContext
-
---*/
-{
-  UINTN                        Index;
-  IMAGE_CONTEXT_TO_MOD_HANDLE  *Array;
-
-  if (ImageContext->PdbPointer == NULL) {
-    //
-    // If no PDB pointer there is no ModHandle so return NULL
-    //
-    return NULL;
-  }
-
-  Array = mImageContextModHandleArray;
-  for (Index = 0; Index < mImageContextModHandleArraySize; Index++, Array++) {
-    if (Array->ImageContext == ImageContext) {
-      //
-      // If you find a match return it and delete the entry
-      //
-      Array->ImageContext = NULL;
-      return Array->ModHandle;
-    }
-  }
-
-  return NULL;
-}
-
-
-
-//
-// Target for gdb breakpoint in a script that uses gGdbWorkingFileName to source a
-// add-symbol-file command. Hey what can you say scripting in gdb is not that great....
-//
-// Put .gdbinit in the CWD where you do gdb SecMain.dll for source level debug
-//
-// cat .gdbinit
-// b SecGdbScriptBreak
-// command
-// silent
-// source SecMain.dll.gdb
-// c
-// end
-//
-VOID
-SecGdbScriptBreak (
-  VOID
-  )
-{
-}
-
-VOID
-SecUnixLoaderBreak (
-  VOID
-  )
-{
-}
-
-BOOLEAN
-IsPdbFile (
-  IN  CHAR8   *PdbFileName
-  )
-{
-  UINTN Len;
-
-  if (PdbFileName == NULL) {
-    return FALSE;
-  }
-
-  Len = strlen (PdbFileName);
-  if ((Len < 5)|| (PdbFileName[Len - 4] != '.')) {
-    return FALSE;
-  }
-
-  if ((PdbFileName[Len - 3] == 'D' || PdbFileName[Len - 3] == 'd') &&
-      (PdbFileName[Len - 2] == 'L' || PdbFileName[Len - 2] == 'l') &&
-      (PdbFileName[Len - 1] == 'L' || PdbFileName[Len - 1] == 'l')) {
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-
-#define MAX_SPRINT_BUFFER_SIZE 0x200
-
-void
-PrintLoadAddress (
-  IN PE_COFF_LOADER_IMAGE_CONTEXT          *ImageContext
-  )
-{
-  if (ImageContext->PdbPointer == NULL) {
-    fprintf (stderr,
-      "0x%08lx Loading NO DEBUG with entry point 0x%08lx\n",
-      (unsigned long)(ImageContext->ImageAddress),
-      (unsigned long)ImageContext->EntryPoint
-      );
-  } else {
-    fprintf (stderr,
-      "0x%08lx Loading %s with entry point 0x%08lx\n",
-      (unsigned long)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders),
-      ImageContext->PdbPointer,
-      (unsigned long)ImageContext->EntryPoint
-      );
-  }
-  // Keep output synced up
-  fflush (stderr);
-}
-
-
-VOID
-EFIAPI
-SecPeCoffRelocateImageExtraAction (
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext
-  )
-{
-
-#ifdef __APPLE__
-  BOOLEAN EnabledOnEntry;
-
-   //
-   // Make sure writting of the file is an atomic operation
-   //
-   if (UnixInterruptEanbled ()) {
-     UnixDisableInterrupt ();
-     EnabledOnEntry = TRUE;
-   } else {
-     EnabledOnEntry = FALSE;
-   }
-
-  PrintLoadAddress (ImageContext);
-
-  //
-  // In mach-o (OS X executable) dlopen() can only load files in the MH_DYLIB of MH_BUNDLE format.
-  // To convert to PE/COFF we need to construct a mach-o with the MH_PRELOAD format. We create
-  // .dSYM files for the PE/COFF images that can be used by gdb for source level debugging.
-  //
-  FILE  *GdbTempFile;
-
-  //
-  // In the Mach-O to PE/COFF conversion the size of the PE/COFF headers is not accounted for.
-  // Thus we need to skip over the PE/COFF header when giving load addresses for our symbol table.
-  //
-  if (ImageContext->PdbPointer != NULL && !IsPdbFile (ImageContext->PdbPointer)) {
-    //
-    // Now we have a database of the images that are currently loaded
-    //
-
-    //
-    // 'symbol-file' will clear out currnet symbol mappings in gdb.
-    // you can do a 'add-symbol-file filename address' for every image we loaded to get source
-    // level debug in gdb. Note Sec, being a true application will work differently.
-    //
-    // We add the PE/COFF header size into the image as the mach-O does not have a header in
-    // loaded into system memory.
-    //
-    // This gives us a data base of gdb commands and after something is unloaded that entry will be
-    // removed. We don't yet have the scheme of how to comunicate with gdb, but we have the
-    // data base of info ready to roll.
-    //
-    // We could use qXfer:libraries:read, but OS X GDB does not currently support it.
-    //  <library-list>
-    //    <library name="/lib/libc.so.6">   // ImageContext->PdbPointer
-    //      <segment address="0x10000000"/> // ImageContext->ImageAddress + ImageContext->SizeOfHeaders
-    //    </library>
-    //  </library-list>
-    //
-
-    //
-    // Write the file we need for the gdb script
-    //
-    GdbTempFile = fopen (gGdbWorkingFileName, "w");
-    if (GdbTempFile != NULL) {
-      fprintf (GdbTempFile, "add-symbol-file %s 0x%08lx\n", ImageContext->PdbPointer, (long unsigned int)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
-      fclose (GdbTempFile);
-
-      //
-      // Target for gdb breakpoint in a script that uses gGdbWorkingFileName to set a breakpoint.
-      // Hey what can you say scripting in gdb is not that great....
-      //
-      SecGdbScriptBreak ();
-    } else {
-      ASSERT (FALSE);
-    }
-
-    AddHandle (ImageContext, ImageContext->PdbPointer);
-
-    if (EnabledOnEntry) {
-      UnixEnableInterrupt ();
-    }
-
-    
-  }
-
-#else
-
-  void        *Handle = NULL;
-  void        *Entry = NULL;
-
-  if (ImageContext->PdbPointer == NULL) {
-    return;
-  }
-
-  if (!IsPdbFile (ImageContext->PdbPointer)) {
-    return;
-  }
-
-  fprintf (stderr,
-     "Loading %s 0x%08lx - entry point 0x%08lx\n",
-     ImageContext->PdbPointer,
-     (unsigned long)ImageContext->ImageAddress,
-     (unsigned long)ImageContext->EntryPoint);
-
-  Handle = dlopen (ImageContext->PdbPointer, RTLD_NOW);
-
-  if (Handle) {
-    Entry = dlsym (Handle, "_ModuleEntryPoint");
-  } else {
-    printf("%s\n", dlerror());
-  }
-
-  if (Entry != NULL) {
-    ImageContext->EntryPoint = (UINTN)Entry;
-    printf("Change %s Entrypoint to :0x%08lx\n", ImageContext->PdbPointer, (unsigned long)Entry);
-  }
-
-  SecUnixLoaderBreak ();
-
-#endif
-
-  return;
-}
-
-
-VOID
-EFIAPI
-SecPeCoffLoaderUnloadImageExtraAction (
-  IN PE_COFF_LOADER_IMAGE_CONTEXT         *ImageContext
-  )
-{
-  VOID *Handle;
-
-  Handle = RemoveHandle (ImageContext);
-
-#ifdef __APPLE__
-  FILE  *GdbTempFile;
-  BOOLEAN EnabledOnEntry;
-
-  if (Handle != NULL) {
-    //
-    // Need to skip .PDB files created from VC++
-    //
-    if (!IsPdbFile (ImageContext->PdbPointer)) {
-       if (UnixInterruptEanbled ()) {
-         UnixDisableInterrupt ();
-         EnabledOnEntry = TRUE;
-       } else {
-         EnabledOnEntry = FALSE;
-       }
-       
-      //
-      // Write the file we need for the gdb script
-      //
-      GdbTempFile = fopen (gGdbWorkingFileName, "w");
-      if (GdbTempFile != NULL) {
-        fprintf (GdbTempFile, "remove-symbol-file %s\n", ImageContext->PdbPointer);
-        fclose (GdbTempFile);
-
-        //
-        // Target for gdb breakpoint in a script that uses gGdbWorkingFileName to set a breakpoint.
-        // Hey what can you say scripting in gdb is not that great....
-        //
-        SecGdbScriptBreak ();
-      } else {
-        ASSERT (FALSE);
-      }
-      
-      if (EnabledOnEntry) {
-        UnixEnableInterrupt ();
-      }
-    }
-  }
-
-#else
-  //
-  // Don't want to confuse gdb with symbols for something that got unloaded
-  //
-  if (Handle != NULL) {
-    dlclose (Handle);
-  }
-
-#endif
-  return;
-}
-
-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 permenent memory.
-  //
-  CopyMem (
-    (VOID*)(UINTN)PermanentMemoryBase,
-    (VOID*)(UINTN)TemporaryMemoryBase,
-    CopySize
-    );
-
-  //
-  // SecSwitchStack function must be invoked after the memory migration
-  // immediatly, also we need fixup the stack change caused by new call into
-  // permenent memory.
-  //
-  SecSwitchStack (
-    (UINT32) TemporaryMemoryBase,
-    (UINT32) PermanentMemoryBase
-    );
-
-  //
-  // We need *not* fix the return address because currently,
-  // The PeiCore is excuted in flash.
-  //
-
-  //
-  // Simulate to invalid temporary memory, terminate temporary memory
-  //
-  //ZeroMem ((VOID*)(UINTN)TemporaryMemoryBase, CopySize);
-
-  return EFI_SUCCESS;
-}
diff --git a/UnixPkg/Sec/SecMain.h b/UnixPkg/Sec/SecMain.h
deleted file mode 100644 (file)
index dc857d8..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-\r
-Module Name:\r
-  SecMain.h\r
-\r
-Abstract:\r
-  Include file for host API based SEC\r
-\r
---*/\r
-#include <PiPei.h>\r
-\r
-#include <Protocol/UnixThunk.h>\r
-#include <Ppi/StatusCode.h>\r
-\r
-#include <Library/PeCoffLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-#include <Library/SecDispatchTableLib.h>\r
-\r
-\r
-#define STACK_SIZE                0x20000      \r
-\r
-typedef struct {\r
-  EFI_PHYSICAL_ADDRESS  Address;\r
-  UINT64                Size;\r
-} UNIX_FD_INFO;\r
-\r
-typedef struct {\r
-  EFI_PHYSICAL_ADDRESS  Memory;\r
-  UINT64                Size;\r
-} UNIX_SYSTEM_MEMORY;\r
-\r
-\r
-#define MAX_IMAGE_CONTEXT_TO_MOD_HANDLE_ARRAY_SIZE 0x100\r
-\r
-typedef struct {\r
-  PE_COFF_LOADER_IMAGE_CONTEXT   *ImageContext;\r
-  VOID                           *ModHandle;\r
-} IMAGE_CONTEXT_TO_MOD_HANDLE;\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecUnixPeiLoadFile (\r
-  VOID                  *Pe32Data,  // TODO: add IN/OUT modifier to Pe32Data\r
-  EFI_PHYSICAL_ADDRESS  *ImageAddress,  // TODO: add IN/OUT modifier to ImageAddress\r
-  UINT64                *ImageSize,  // TODO: add IN/OUT modifier to ImageSize\r
-  EFI_PHYSICAL_ADDRESS  *EntryPoint  // TODO: add IN/OUT modifier to EntryPoint\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketSecUnixPeiLoadFile (\r
-  VOID                  *Pe32Data,  // TODO: add IN/OUT modifier to Pe32Data\r
-  EFI_PHYSICAL_ADDRESS  *ImageAddress,  // TODO: add IN/OUT modifier to ImageAddress\r
-  UINT64                *ImageSize,  // TODO: add IN/OUT modifier to ImageSize\r
-  EFI_PHYSICAL_ADDRESS  *EntryPoint  // TODO: add IN/OUT modifier to EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Pe32Data      - TODO: add argument description\r
-  ImageAddress  - TODO: add argument description\r
-  ImageSize     - TODO: add argument description\r
-  EntryPoint    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecUnixPeiAutoScan (\r
-  IN  UINTN                 Index,\r
-  OUT EFI_PHYSICAL_ADDRESS  *MemoryBase,\r
-  OUT UINT64                *MemorySize\r
-  );\r
-  \r
-EFI_STATUS\r
-EFIAPI\r
-GasketSecUnixPeiAutoScan (\r
-  IN  UINTN                 Index,\r
-  OUT EFI_PHYSICAL_ADDRESS  *MemoryBase,\r
-  OUT UINT64                *MemorySize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Index       - TODO: add argument description\r
-  MemoryBase  - TODO: add argument description\r
-  MemorySize  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-VOID *\r
-EFIAPI\r
-SecUnixUnixThunkAddress (\r
-  VOID\r
-  );\r
-  \r
-VOID *\r
-EFIAPI\r
-GasketSecUnixUnixThunkAddress (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  InterfaceSize - TODO: add argument description\r
-  InterfaceBase - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecUnixUnixFwhAddress (\r
-  IN OUT UINT64                *FwhSize,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FwhBase\r
-  );\r
-  \r
-EFI_STATUS\r
-EFIAPI\r
-GasketSecUnixUnixFwhAddress (\r
-  IN OUT UINT64                *FwhSize,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FwhBase\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  FwhSize - TODO: add argument description\r
-  FwhBase - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecPeiReportStatusCode (\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
-  IN EFI_STATUS_CODE_TYPE       CodeType,\r
-  IN EFI_STATUS_CODE_VALUE      Value,\r
-  IN UINT32                     Instance,\r
-  IN CONST EFI_GUID             *CallerId,\r
-  IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r
-  );\r
-  \r
-EFI_STATUS\r
-EFIAPI\r
-GasketSecPeiReportStatusCode (\r
-  IN CONST EFI_PEI_SERVICES     **PeiServices,\r
-  IN EFI_STATUS_CODE_TYPE       CodeType,\r
-  IN EFI_STATUS_CODE_VALUE      Value,\r
-  IN UINT32                     Instance,\r
-  IN CONST EFI_GUID             *CallerId,\r
-  IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PeiServices - TODO: add argument description\r
-  CodeType    - TODO: add argument description\r
-  Value       - TODO: add argument description\r
-  Instance    - TODO: add argument description\r
-  CallerId    - TODO: add argument description\r
-  Data        - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-int\r
-main (\r
-  IN  int   Argc,\r
-  IN  char  **Argv,\r
-  IN  char  **Envp\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Argc  - TODO: add argument description\r
-  Argv  - TODO: add argument description\r
-  Envp  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-SecLoadFromCore (\r
-  IN  UINTN   LargestRegion,\r
-  IN  UINTN   LargestRegionSize,\r
-  IN  UINTN   BootFirmwareVolumeBase,\r
-  IN  VOID    *PeiCoreFile\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  LargestRegion           - TODO: add argument description\r
-  LargestRegionSize       - TODO: add argument description\r
-  BootFirmwareVolumeBase  - TODO: add argument description\r
-  PeiCoreFile             - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecLoadFile (\r
-  IN  VOID                    *Pe32Data,\r
-  IN  EFI_PHYSICAL_ADDRESS    *ImageAddress,\r
-  IN  UINT64                  *ImageSize,\r
-  IN  EFI_PHYSICAL_ADDRESS    *EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Pe32Data      - TODO: add argument description\r
-  ImageAddress  - TODO: add argument description\r
-  ImageSize     - TODO: add argument description\r
-  EntryPoint    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecFfsFindPeiCore (\r
-  IN  EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  OUT VOID                        **Pe32Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  FwVolHeader - TODO: add argument description\r
-  Pe32Data    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecFfsFindNextFile (\r
-  IN EFI_FV_FILETYPE             SearchType,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER     **FileHeader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  SearchType  - TODO: add argument description\r
-  FwVolHeader - TODO: add argument description\r
-  FileHeader  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SecFfsFindSectionData (\r
-  IN EFI_SECTION_TYPE      SectionType,\r
-  IN EFI_FFS_FILE_HEADER   *FfsFileHeader,\r
-  IN OUT VOID              **SectionData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  SectionType   - TODO: add argument description\r
-  FfsFileHeader - TODO: add argument description\r
-  SectionData   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecUnixPeCoffLoaderLoadAsDll (\r
-  IN CHAR8    *PdbFileName,\r
-  IN VOID     **ImageEntryPoint,\r
-  OUT VOID    **ModHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PdbFileName     - TODO: add argument description\r
-  ImageEntryPoint - TODO: add argument description\r
-  ModHandle       - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecUnixPeCoffLoaderFreeLibrary (\r
-  OUT VOID    *ModHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ModHandle - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecUnixFdAddress (\r
-  IN     UINTN                 Index,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FdBase,\r
-  IN OUT UINT64                *FdSize,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FixUp\r
-  )\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-GasketSecUnixFdAddress (\r
-  IN     UINTN                 Index,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FdBase,\r
-  IN OUT UINT64                *FdSize,\r
-  IN OUT EFI_PHYSICAL_ADDRESS  *FixUp\r
-  )\r
-;\r
-\r
-\r
-EFI_STATUS\r
-GetImageReadFunction (\r
-  IN PE_COFF_LOADER_IMAGE_CONTEXT          *ImageContext,\r
-  IN EFI_PHYSICAL_ADDRESS                  *TopOfMemory\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageContext  - TODO: add argument description\r
-  TopOfMemory   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecImageRead (\r
-  IN     VOID    *FileHandle,\r
-  IN     UINTN   FileOffset,\r
-  IN OUT UINTN   *ReadSize,\r
-  OUT    VOID    *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  FileHandle  - TODO: add argument description\r
-  FileOffset  - TODO: add argument description\r
-  ReadSize    - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-CHAR16                            *\r
-AsciiToUnicode (\r
-  IN  CHAR8   *Ascii,\r
-  IN  UINTN   *StrLen OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Ascii   - TODO: add argument description\r
-  StrLen  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-UINTN\r
-CountSeperatorsInString (\r
-  IN  const CHAR16   *String,\r
-  IN  CHAR16   Seperator\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  String    - TODO: add argument description\r
-  Seperator - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-SecTemporaryRamSupport (\r
-  IN CONST EFI_PEI_SERVICES   **PeiServices,\r
-  IN EFI_PHYSICAL_ADDRESS     TemporaryMemoryBase,\r
-  IN EFI_PHYSICAL_ADDRESS     PermanentMemoryBase,\r
-  IN UINTN                    CopySize\r
-  );\r
-  \r
-EFI_STATUS\r
-EFIAPI\r
-GasketSecTemporaryRamSupport (\r
-  IN CONST EFI_PEI_SERVICES   **PeiServices,\r
-  IN EFI_PHYSICAL_ADDRESS     TemporaryMemoryBase,\r
-  IN EFI_PHYSICAL_ADDRESS     PermanentMemoryBase,\r
-  IN UINTN                    CopySize\r
-  );\r
-\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-SecPeCoffGetEntryPoint (\r
-  IN     VOID  *Pe32Data,\r
-  IN OUT VOID  **EntryPoint\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-SecPeCoffRelocateImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-SecPeCoffLoaderUnloadImageExtraAction (\r
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
-  );\r
-\r
-\r
-VOID SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs));\r
-void msSleep (unsigned long Milliseconds);\r
-void GetLocalTime (EFI_TIME *Time);\r
-void TzSet (void);\r
-long GetTimeZone(void);\r
-int GetDayLight(void);\r
-int GetErrno(void);\r
-void UnixEnableInterrupt (void);\r
-void UnixDisableInterrupt (void);\r
-BOOLEAN UnixInterruptEanbled (void);\r
-\r
-\r
-\r
-extern EFI_UNIX_THUNK_PROTOCOL  *gUnix;\r
diff --git a/UnixPkg/Sec/SecMain.inf b/UnixPkg/Sec/SecMain.inf
deleted file mode 100644 (file)
index b418d54..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-## @file\r
-# Entry Point of Unix Emulator\r
-#\r
-# Main executable file of Unix Emulator that loads PEI core after initialization finished.\r
-# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
-# Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = SecMain\r
-  FILE_GUID                      = f43be88c-8985-11db-8f78-0040d02b1835\r
-  MODULE_TYPE                    = USER_DEFINED\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = main\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  UgaX11.c\r
-  UnixThunk.c\r
-  FwVol.c\r
-  SecMain.c\r
-\r
-[Sources.Ia32]\r
-  Gasket.c\r
-  Ia32/Gasket.S\r
-  Ia32/Stack.S\r
-  Ia32/SwitchStack.c\r
-\r
-[Sources.X64]\r
-#  X64/Gasket.S       # pure UNIX x86_64 ABI also need to fix issues in BaseLib\r
-  X64/MangleGasket.S  # convert between UNIX x86_64 ABI and EFI X64 ABI\r
-\r
-  X64/SwitchStack.S\r
-  X64/NameManglingFix.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  DebugLib\r
-  PcdLib\r
-  PrintLib\r
-  BaseMemoryLib\r
-  BaseLib\r
-  PeCoffLib\r
-  ReportStatusCodeLib\r
-  SecDispatchTableLib\r
-\r
-\r
-[Ppis]\r
-  gUnixPeiLoadFilePpiGuid                       # PPI ALWAYS_PRODUCED\r
-  gEfiPeiStatusCodePpiGuid                      # PPI ALWAYS_PRODUCED\r
-  gUnixFwhPpiGuid                               # PPI ALWAYS_PRODUCED\r
-  gPeiUnixAutoScanPpiGuid                       # PPI ALWAYS_PRODUCED\r
-  gPeiUnixThunkPpiGuid                          # PPI ALWAYS_PRODUCED\r
-  gEfiTemporaryRamSupportPpiGuid\r
-\r
-\r
-[Pcd]\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixBootMode\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareVolume\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySizeForSecMain\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFdBaseAddress\r
-\r
-[BuildOptions]\r
-   GCC:*_*_IA32_DLINK_FLAGS == -o "$(BIN_DIR)/SecMain" -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o -L/usr/X11R6/lib -lXext -lX11 /usr/lib/crtn.o\r
-   GCC:*_*_*_DLINK2_FLAGS == -lc\r
-   GCC:*_*_IA32_CC_FLAGS == -m32 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -idirafter/usr/include -c -include AutoGen.h\r
-   GCC:*_*_IA32_PP_FLAGS == -m32 -E -x assembler-with-cpp -include AutoGen.h\r
-   GCC:*_*_IA32_ASM_FLAGS == -m32 -c -x assembler -imacros AutoGen.h\r
-\r
-   GCC:*_*_X64_DLINK_FLAGS == -o "$(BIN_DIR)/SecMain" -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/crt1.o /usr/lib/crti.o -L/usr/X11R6/lib -lXext -lX11 /usr/lib/crtn.o\r
-   GCC:*_*_X64_CC_FLAGS == -m64 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -idirafter/usr/include -c -include AutoGen.h\r
-   GCC:*_*_X64_PP_FLAGS == -m64 -E -x assembler-with-cpp -include AutoGen.h\r
-   GCC:*_*_X64_ASM_FLAGS == -m64 -c -x assembler -imacros AutoGen.h\r
-\r
-#\r
-# Need to do this link via gcc and not ld as the pathing to libraries changes from OS version to OS version\r
-#\r
-   XCODE:*_*_IA32_DLINK_PATH == gcc\r
-   XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o "$(BIN_DIR)/SecMain" -L/usr/X11R6/lib -lXext -lX11 -framework IOKit -framework Carbon\r
-   XCODE:*_*_IA32_ASM_FLAGS == -arch i386 -g\r
-\r
-   XCODE:*_*_X64_DLINK_PATH == gcc\r
-   XCODE:*_*_X64_DLINK_FLAGS == -o "$(BIN_DIR)/SecMain" -L/usr/X11R6/lib -lXext -lX11 -lIOKit -framework Carbon\r
-   XCODE:*_*_X64_ASM_FLAGS == -g\r
diff --git a/UnixPkg/Sec/UgaX11.c b/UnixPkg/Sec/UgaX11.c
deleted file mode 100644 (file)
index 7477531..0000000
+++ /dev/null
@@ -1,865 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials                          
-are licensed and made available under the terms and conditions of the BSD License         
-which accompanies this distribution.  The full text of the license may be found at        
-http://opensource.org/licenses/bsd-license.php                                            
-                                                                                          
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
-
---*/
-#include <Common/UnixInclude.h>
-
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-#include <PiPei.h>
-#include <Protocol/SimplePointer.h>
-#include <Protocol/SimpleTextIn.h>
-#include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xos.h>
-#include <X11/extensions/XShm.h>
-#include <X11/keysym.h>
-#include <X11/cursorfont.h>
-
-#include <Protocol/UnixThunk.h>
-#include <Protocol/UnixUgaIo.h>
-
-#include <Ppi/StatusCode.h>
-
-#include <Library/PeCoffLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PrintLib.h>
-#include <Library/PcdLib.h>
-#include <Library/DebugLib.h>
-
-#include "Gasket.h"
-#include "SecMain.h"
-
-
-extern void msSleep (unsigned long Milliseconds);
-
-/* XQueryPointer  */
-
-struct uga_drv_shift_mask {
-  unsigned char shift;
-  unsigned char size;
-  unsigned char csize;
-};
-
-#define NBR_KEYS 32
-typedef struct {
-  EFI_UNIX_UGA_IO_PROTOCOL UgaIo;
-
-  Display *display;
-  int screen;      /* values for window_size in main */
-  Window win;
-  GC gc;
-  Visual *visual;
-
-  int depth;
-  unsigned int width;
-  unsigned int height;
-  unsigned int line_bytes;
-  unsigned int pixel_shift;
-  unsigned char *image_data;
-
-  struct uga_drv_shift_mask r, g, b;
-
-  int use_shm;
-  XShmSegmentInfo xshm_info;
-  XImage *image;
-
-  unsigned int key_rd;
-  unsigned int key_wr;
-  unsigned int key_count;
-  EFI_KEY_DATA keys[NBR_KEYS];
-
-  EFI_KEY_STATE KeyState;
-  
-  UGA_REGISTER_KEY_NOTIFY_CALLBACK RegisterdKeyCallback;
-  VOID                             *RegisterdKeyCallbackContext;
-  
-  int                        previous_x;
-  int                        previous_y;
-  EFI_SIMPLE_POINTER_STATE   pointer_state;
-  int                        pointer_state_changed;
-} UGA_IO_PRIVATE;
-
-void
-HandleEvents(UGA_IO_PRIVATE *drv);
-
-void
-fill_shift_mask (struct uga_drv_shift_mask *sm, unsigned long mask)
-{
-  sm->shift = 0;
-  sm->size = 0;
-  while ((mask & 1) == 0)
-    {
-      mask >>= 1;
-      sm->shift++;
-    }
-  while (mask & 1)
-    {
-      sm->size++;
-      mask >>= 1;
-    }
-  sm->csize = 8 - sm->size;
-}
-
-int
-TryCreateShmImage(UGA_IO_PRIVATE *drv)
-{
-  drv->image = XShmCreateImage (drv->display, drv->visual,
-                 drv->depth, ZPixmap, NULL, &drv->xshm_info,
-                 drv->width, drv->height);
-  if (drv->image == NULL)
-    return 0;
-
-  switch (drv->image->bitmap_unit) {
-  case 32:
-    drv->pixel_shift = 2;
-    break;
-  case 16:
-    drv->pixel_shift = 1;
-    break;
-  case 8:
-    drv->pixel_shift = 0;
-    break;
-  }
-
-  drv->xshm_info.shmid = shmget
-                          (IPC_PRIVATE, drv->image->bytes_per_line * drv->image->height,
-                          IPC_CREAT | 0777);
-  if (drv->xshm_info.shmid < 0) {
-    XDestroyImage(drv->image);
-    return 0;
-  }
-      
-  drv->image_data = shmat (drv->xshm_info.shmid, NULL, 0);
-  if(!drv->image_data) {
-    shmctl (drv->xshm_info.shmid, IPC_RMID, NULL);
-    XDestroyImage(drv->image);
-    return 0;
-  }
-  
-#ifndef __APPLE__  
-  //
-  // This closes shared memory in real time on OS X. Only closes after folks quit using
-  // it on Linux. 
-  //
-  /* Can this fail ?  */
-  shmctl (drv->xshm_info.shmid, IPC_RMID, NULL);
-#endif
-
-  drv->xshm_info.shmaddr = (char*)drv->image_data;
-  drv->image->data = (char*)drv->image_data;
-
-  if (!XShmAttach (drv->display, &drv->xshm_info)) {
-    shmdt (drv->image_data);
-    XDestroyImage(drv->image);
-    return 0;
-  }
-  return 1;
-}
-
-EFI_STATUS
-UgaClose (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo)
-{
-  UGA_IO_PRIVATE *drv = (UGA_IO_PRIVATE *)UgaIo;
-
-  if (drv == NULL)
-    return EFI_SUCCESS;
-  if (drv->image != NULL)
-    {
-      XDestroyImage(drv->image);
-
-      if (drv->use_shm)
-        shmdt (drv->image_data);
-
-      drv->image_data = NULL;
-      drv->image = NULL;
-    }
-  XDestroyWindow(drv->display, drv->win);
-  XCloseDisplay(drv->display);
-  
-#ifdef __APPLE__
-  // Free up the shared memory
-  shmctl (drv->xshm_info.shmid, IPC_RMID, NULL);
-#endif
-  
-  free(drv);
-  return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UgaSize(EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, UINT32 Width, UINT32 Height)
-{
-  UGA_IO_PRIVATE *drv = (UGA_IO_PRIVATE *)UgaIo;
-  XSizeHints size_hints;
-
-  /* Destroy current buffer if created.  */
-  if (drv->image != NULL)
-    {
-      /* Before destroy buffer, need to make sure the buffer available for access. */
-      XDestroyImage(drv->image);
-
-      if (drv->use_shm)
-        shmdt (drv->image_data);
-
-      drv->image_data = NULL;
-      drv->image = NULL;
-    }
-
-  drv->width = Width;
-  drv->height = Height;
-  XResizeWindow (drv->display, drv->win, Width, Height);
-
-  /* Allocate image.  */
-  if (XShmQueryExtension(drv->display) && TryCreateShmImage(drv)) {
-    drv->use_shm = 1;
-  } else {
-    drv->use_shm = 0;
-    if (drv->depth > 16)
-      drv->pixel_shift = 2;
-    else if (drv->depth > 8)
-      drv->pixel_shift = 1;
-    else
-      drv->pixel_shift = 0;
-      
-      drv->image_data = malloc((drv->width * drv->height) << drv->pixel_shift);
-      drv->image = XCreateImage (drv->display, drv->visual, drv->depth,
-                                  ZPixmap, 0, (char *)drv->image_data,
-                                  drv->width, drv->height,
-                                  8 << drv->pixel_shift, 0);
-    }
-  drv->line_bytes = drv->image->bytes_per_line;
-  fill_shift_mask (&drv->r, drv->image->red_mask);
-  fill_shift_mask (&drv->g, drv->image->green_mask);
-  fill_shift_mask (&drv->b, drv->image->blue_mask);
-
-  /* Set WM hints.  */
-  size_hints.flags = PSize | PMinSize | PMaxSize;
-  size_hints.min_width = size_hints.max_width = size_hints.base_width = Width;
-  size_hints.min_height = size_hints.max_height = size_hints.base_height = Height;
-  XSetWMNormalHints (drv->display, drv->win, &size_hints);
-
-  XMapWindow (drv->display, drv->win);
-  HandleEvents(drv);
-  return EFI_SUCCESS;
-}
-
-void
-handleKeyEvent(UGA_IO_PRIVATE *drv, XEvent *ev)
-{
-  KeySym keysym;
-  char str[4];
-  EFI_KEY_DATA KeyData;
-  int res;
-
-  if (drv->key_count == NBR_KEYS)
-    return;
-
-  res = XLookupString(&ev->xkey, str, sizeof(str), &keysym, NULL);
-  KeyData.Key.ScanCode = 0;
-  KeyData.Key.UnicodeChar = 0;
-  KeyData.KeyState.KeyShiftState = 0;
-
-  //
-  // KeyRelease is not supported (on Mac) so we can not easily implement Ex functions.
-  // If a modifier key is hit by its self we get a keysym. If a modfifier and key is hit
-  // we get the state bit set and keysym is the modified key. 
-  //
-  // We use lack of state bits being set to clear ToggleState and KeyShiftState. We can 
-  // also use the stat bits to set ToggleState and KeyShiftState. 
-  // Skipping EFI_SCROLL_LOCK_ACTIVE & EFI_NUM_LOCK_ACTIVE since they are not on Macs  
-  //
-  if ((ev->xkey.state & LockMask) == 0) {
-    drv->KeyState.KeyToggleState &= ~EFI_CAPS_LOCK_ACTIVE;
-  } else {
-    drv->KeyState.KeyToggleState |= EFI_CAPS_LOCK_ACTIVE;
-  }
-  
-  if ((ev->xkey.state & ControlMask) == 0) {
-    drv->KeyState.KeyShiftState &= ~(EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED);
-  } else if ((drv->KeyState.KeyShiftState & EFI_RIGHT_CONTROL_PRESSED) == 0) {
-    drv->KeyState.KeyShiftState |= EFI_LEFT_CONTROL_PRESSED;
-  }
-  
-  if ((ev->xkey.state & ShiftMask) == 0) {
-    drv->KeyState.KeyShiftState &= ~(EFI_RIGHT_SHIFT_PRESSED | EFI_LEFT_SHIFT_PRESSED);
-  } else if ((drv->KeyState.KeyShiftState & EFI_RIGHT_SHIFT_PRESSED) == 0) {
-    drv->KeyState.KeyShiftState |= EFI_LEFT_SHIFT_PRESSED;
-  }
-  
-  if ((ev->xkey.state & Mod2Mask) == 0) {
-    drv->KeyState.KeyShiftState &= ~(EFI_RIGHT_LOGO_PRESSED | EFI_LEFT_LOGO_PRESSED);
-  } else if ((drv->KeyState.KeyShiftState & EFI_RIGHT_LOGO_PRESSED) == 0) {
-    drv->KeyState.KeyShiftState |= EFI_LEFT_LOGO_PRESSED;
-  }
-
-  if ((ev->xkey.state & 0x2000) == 0) {
-    drv->KeyState.KeyShiftState &= ~(EFI_LEFT_ALT_PRESSED);
-  } else {
-    drv->KeyState.KeyShiftState |= EFI_LEFT_ALT_PRESSED;
-  }
-  
-  
-  switch (keysym) {
-  case XK_Control_R:
-    drv->KeyState.KeyShiftState |= EFI_RIGHT_CONTROL_PRESSED;
-    break;
-  case XK_Control_L:
-    drv->KeyState.KeyShiftState |= EFI_LEFT_CONTROL_PRESSED;
-    break;
-
-  case XK_Shift_R:
-    drv->KeyState.KeyShiftState |= EFI_RIGHT_SHIFT_PRESSED;
-    break;
-  case XK_Shift_L:
-    drv->KeyState.KeyShiftState |= EFI_LEFT_SHIFT_PRESSED;
-    break;
-  
-  case XK_Mode_switch:
-    drv->KeyState.KeyShiftState |= EFI_LEFT_ALT_PRESSED;
-    break;
-
-  case XK_Meta_R:
-    drv->KeyState.KeyShiftState |= EFI_RIGHT_LOGO_PRESSED;
-    break;
-  case XK_Meta_L:
-    drv->KeyState.KeyShiftState |= EFI_LEFT_LOGO_PRESSED;
-    break;
-
-  case XK_Home:       KeyData.Key.ScanCode = SCAN_HOME;       break;
-  case XK_End:        KeyData.Key.ScanCode = SCAN_END;        break;
-  case XK_Left:       KeyData.Key.ScanCode = SCAN_LEFT;       break;
-  case XK_Right:      KeyData.Key.ScanCode = SCAN_RIGHT;      break;
-  case XK_Up:         KeyData.Key.ScanCode = SCAN_UP;         break;
-  case XK_Down:       KeyData.Key.ScanCode = SCAN_DOWN;       break;
-  case XK_Delete:     KeyData.Key.ScanCode = SCAN_DELETE;     break;
-  case XK_Insert:     KeyData.Key.ScanCode = SCAN_INSERT;     break;
-  case XK_Page_Up:    KeyData.Key.ScanCode = SCAN_PAGE_UP;    break;
-  case XK_Page_Down:  KeyData.Key.ScanCode = SCAN_PAGE_DOWN;  break;
-  case XK_Escape:     KeyData.Key.ScanCode = SCAN_ESC;        break;
-  case XK_Pause:      KeyData.Key.ScanCode = SCAN_PAUSE;      break;
-
-  case XK_F1:   KeyData.Key.ScanCode = SCAN_F1;   break;
-  case XK_F2:   KeyData.Key.ScanCode = SCAN_F2;   break;
-  case XK_F3:   KeyData.Key.ScanCode = SCAN_F3;   break;
-  case XK_F4:   KeyData.Key.ScanCode = SCAN_F4;   break;
-  case XK_F5:   KeyData.Key.ScanCode = SCAN_F5;   break;
-  case XK_F6:   KeyData.Key.ScanCode = SCAN_F6;   break;
-  case XK_F7:   KeyData.Key.ScanCode = SCAN_F7;   break;
-  case XK_F8:   KeyData.Key.ScanCode = SCAN_F8;   break;
-  case XK_F9:   KeyData.Key.ScanCode = SCAN_F9;   break;
-
-  default:
-    if (res == 1) {
-      KeyData.Key.UnicodeChar = str[0];
-    } else {
-      return;
-    }
-  }
-
-  // The global state is our state
-  KeyData.KeyState.KeyShiftState = drv->KeyState.KeyShiftState;
-  KeyData.KeyState.KeyToggleState = drv->KeyState.KeyToggleState;
-
-  CopyMem (&drv->keys[drv->key_wr], &KeyData, sizeof (EFI_KEY_DATA));
-  drv->key_wr = (drv->key_wr + 1) % NBR_KEYS;
-  drv->key_count++;
-  
-  
-#if defined(__APPLE__) || defined(MDE_CPU_X64)
-  ReverseGasketUint64Uint64 (drv->RegisterdKeyCallback ,drv->RegisterdKeyCallbackContext, &KeyData);
-#else
-  drv->RegisterdKeyCallback (drv->RegisterdKeyCallbackContext, &KeyData);
-#endif
-
-  
-}
-
-
-void
-handleMouseMoved(UGA_IO_PRIVATE *drv, XEvent *ev)
-{
-  if ( ev->xmotion.x != drv->previous_x )
-  {
-    drv->pointer_state.RelativeMovementX += ( ev->xmotion.x - drv->previous_x );
-  drv->previous_x = ev->xmotion.x;
-  drv->pointer_state_changed = 1;
-  }
-
-  if ( ev->xmotion.y != drv->previous_y )
-  {
-    drv->pointer_state.RelativeMovementY += ( ev->xmotion.y - drv->previous_y );
-    drv->previous_y = ev->xmotion.y;
-  drv->pointer_state_changed = 1;
-  }
-
-  drv->pointer_state.RelativeMovementZ = 0;
-}
-
-void
-handleMouseDown(UGA_IO_PRIVATE *drv, XEvent *ev, BOOLEAN Pressed)
-{
-  if ( ev->xbutton.button == Button1 )
-  {
-    drv->pointer_state_changed = ( drv->pointer_state.LeftButton != Pressed );
-  drv->pointer_state.LeftButton = Pressed;
-  }
-  if ( ev->xbutton.button == Button2 )
-  {
-    drv->pointer_state_changed = ( drv->pointer_state.RightButton != Pressed );
-  drv->pointer_state.RightButton = Pressed;
-  }
-}
-
-void
-Redraw(UGA_IO_PRIVATE *drv, UINTN X, UINTN Y, UINTN Width, UINTN Height)
-{
-  if (drv->use_shm)
-    XShmPutImage (drv->display, drv->win, drv->gc, drv->image,
-                   X, Y, X, Y, Width, Height, False);
-  else
-    XPutImage (drv->display, drv->win, drv->gc, drv->image,
-                X, Y, X, Y, Width, Height);
-  XFlush(drv->display);
-}
-
-void
-HandleEvent(UGA_IO_PRIVATE *drv, XEvent *ev)
-{
-  switch (ev->type)
-    {
-    case Expose:
-      Redraw(drv, ev->xexpose.x, ev->xexpose.y,
-        ev->xexpose.width, ev->xexpose.height);
-      break;
-    case GraphicsExpose:
-      Redraw(drv, ev->xgraphicsexpose.x, ev->xgraphicsexpose.y,
-        ev->xgraphicsexpose.width, ev->xgraphicsexpose.height);
-      break;
-    case KeyPress:
-      handleKeyEvent(drv, ev);
-      break;
-    case KeyRelease:
-      break;
-    case MappingNotify:
-      XRefreshKeyboardMapping(&ev->xmapping);
-      break;
-    case MotionNotify:
-      handleMouseMoved(drv, ev);
-      break;
-    case ButtonPress:
-      handleMouseDown(drv, ev, TRUE);
-    break;
-    case ButtonRelease:
-      handleMouseDown(drv, ev, FALSE);
-    break;
-#if 0
-    case DestroyNotify:
-      XCloseDisplay (drv->display);
-      exit (1);
-      break;
-#endif
-    case NoExpose:
-    default:
-      break;
-    }
-}
-
-void
-HandleEvents(UGA_IO_PRIVATE *drv)
-{
-  while (XPending(drv->display) != 0)
-    {
-      XEvent ev;
-
-      XNextEvent (drv->display, &ev);
-      HandleEvent(drv, &ev);
-    }
-}
-
-unsigned long
-UgaPixelToColor (UGA_IO_PRIVATE *drv, EFI_UGA_PIXEL pixel)
-{
-  return ((pixel.Red >> drv->r.csize) << drv->r.shift)
-    | ((pixel.Green >> drv->g.csize) << drv->g.shift)
-    | ((pixel.Blue >> drv->b.csize) << drv->b.shift);
-}
-
-EFI_UGA_PIXEL
-UgaColorToPixel (UGA_IO_PRIVATE *drv, unsigned long val)
-{
-  EFI_UGA_PIXEL res;
-
-  memset (&res, 0, sizeof (EFI_UGA_PIXEL));
-  /* FIXME: should round instead of truncate.  */
-  res.Red = (val >> drv->r.shift) << drv->r.csize;
-  res.Green = (val >> drv->g.shift) << drv->g.csize;
-  res.Blue = (val >> drv->b.shift) << drv->b.csize;
-
-  return res;
-}
-
-STATIC EFI_STATUS
-CheckKeyInternal( UGA_IO_PRIVATE *drv, BOOLEAN delay )
-{
-  HandleEvents(drv);
-  if (drv->key_count != 0)
-    return EFI_SUCCESS;
-  if ( delay )
-    /* EFI is polling.  Be CPU-friendly.  */
-    msSleep (20);
-    return EFI_NOT_READY;
-  }
-
-EFI_STATUS
-UgaCheckKey(EFI_UNIX_UGA_IO_PROTOCOL *UgaIo)
-{
-  UGA_IO_PRIVATE  *drv = (UGA_IO_PRIVATE *)UgaIo;
-  return( CheckKeyInternal( drv, TRUE ) );
-}
-
-EFI_STATUS
-EFIAPI
-UgaGetKey (
-  IN  EFI_UNIX_UGA_IO_PROTOCOL  *UgaIo, 
-  IN  EFI_KEY_DATA              *KeyData
-  )
-{
-  UGA_IO_PRIVATE *drv = (UGA_IO_PRIVATE *)UgaIo;
-  EFI_STATUS status;
-
-  status = CheckKeyInternal(drv, FALSE);
-  if (status != EFI_SUCCESS)
-    return status;
-
-  CopyMem (KeyData, &drv->keys[drv->key_rd], sizeof (EFI_KEY_DATA));
-  drv->key_rd = (drv->key_rd + 1) % NBR_KEYS;
-  drv->key_count--;
-  return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-UgaKeySetState (
-  IN EFI_UNIX_UGA_IO_PROTOCOL   *UgaIo, 
-  IN EFI_KEY_TOGGLE_STATE       *KeyToggleState
-  )
-{
-  UGA_IO_PRIVATE  *drv = (UGA_IO_PRIVATE *)UgaIo;
-//  XKeyEvent       event;
-  
-  if (*KeyToggleState & EFI_CAPS_LOCK_ACTIVE) {
-    if ((drv->KeyState.KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == 0) {
-      //
-      // We could create an XKeyEvent and send a XK_Caps_Lock to
-      // the UGA/GOP Window
-      //
-    }
-  }
-    
-  drv->KeyState.KeyToggleState = *KeyToggleState;
-  return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-UgaRegisterKeyNotify (
-  IN EFI_UNIX_UGA_IO_PROTOCOL           *UgaIo, 
-  IN UGA_REGISTER_KEY_NOTIFY_CALLBACK   CallBack,
-  IN VOID                               *Context
-  )
-{
-  UGA_IO_PRIVATE  *drv = (UGA_IO_PRIVATE *)UgaIo;
-
-  drv->RegisterdKeyCallback = CallBack;
-  drv->RegisterdKeyCallbackContext = Context;
-
-  return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-UgaBlt(
-  IN EFI_UNIX_UGA_IO_PROTOCOL                 *UgaIo,
-  IN  EFI_UGA_PIXEL                           *BltBuffer OPTIONAL,
-  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
-  IN  UGA_BLT_ARGS                            *Args
-  )
-{
-  UGA_IO_PRIVATE *Private = (UGA_IO_PRIVATE *)UgaIo;
-  UINTN             DstY;
-  UINTN             SrcY;
-  UINTN             DstX;
-  UINTN             SrcX;
-  UINTN             Index;
-  EFI_UGA_PIXEL     *Blt;
-  UINT8             *Dst;
-  UINT8             *Src;
-  UINTN             Nbr;
-  unsigned long     Color;
-
-  //
-  //  Check bounds
-  //
-  if (BltOperation == EfiUgaVideoToBltBuffer
-      || BltOperation == EfiUgaVideoToVideo) {
-    //
-    // Source is Video.
-    //
-    if (Args->SourceY + Args->Height > Private->height) {
-      return EFI_INVALID_PARAMETER;
-    }
-
-    if (Args->SourceX + Args->Width > Private->width) {
-      return EFI_INVALID_PARAMETER;
-    }
-  }
-
-  if (BltOperation == EfiUgaBltBufferToVideo
-      || BltOperation == EfiUgaVideoToVideo
-      || BltOperation == EfiUgaVideoFill) {
-    //
-    // Destination is Video
-    //
-    if (Args->DestinationY + Args->Height > Private->height) {
-      return EFI_INVALID_PARAMETER;
-    }
-
-    if (Args->DestinationX + Args->Width > Private->width) {
-      return EFI_INVALID_PARAMETER;
-    }
-  }
-
-  switch (BltOperation) {
-  case EfiUgaVideoToBltBuffer:
-    Blt = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY * Args->Delta) + Args->DestinationX * sizeof (EFI_UGA_PIXEL));
-    Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
-    for (SrcY = Args->SourceY; SrcY < (Args->Height + Args->SourceY); SrcY++) {
-      for (SrcX = Args->SourceX; SrcX < (Args->Width + Args->SourceX); SrcX++) {
-        *Blt++ = UgaColorToPixel(Private,
-                                  XGetPixel(Private->image, SrcX, SrcY));
-      }
-      Blt = (EFI_UGA_PIXEL *) ((UINT8 *) Blt + Args->Delta);
-    }
-    break;
-  case EfiUgaBltBufferToVideo:
-    Blt = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY * Args->Delta) + Args->SourceX * sizeof (EFI_UGA_PIXEL));
-    Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
-    for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
-      for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
-        XPutPixel(Private->image, DstX, DstY, UgaPixelToColor(Private, *Blt));
-        Blt++;
-      }
-      Blt = (EFI_UGA_PIXEL *) ((UINT8 *) Blt + Args->Delta);
-    }
-    break;
-  case EfiUgaVideoToVideo:
-    Dst = Private->image_data + (Args->DestinationX << Private->pixel_shift)
-      + Args->DestinationY * Private->line_bytes;
-    Src = Private->image_data + (Args->SourceX << Private->pixel_shift)
-      + Args->SourceY * Private->line_bytes;
-    Nbr = Args->Width << Private->pixel_shift;
-    if (Args->DestinationY < Args->SourceY) {
-      for (Index = 0; Index < Args->Height; Index++) {
-        memcpy (Dst, Src, Nbr);
-        Dst += Private->line_bytes;
-        Src += Private->line_bytes;
-      }
-    }
-    else {
-      Dst += (Args->Height - 1) * Private->line_bytes;
-      Src += (Args->Height - 1) * Private->line_bytes;
-      for (Index = 0; Index < Args->Height; Index++) {
-      //
-      // Source and Destination Y may be equal, therefore Dst and Src may
-      // overlap.
-      //
-      memmove (Dst, Src, Nbr);
-      Dst -= Private->line_bytes;
-      Src -= Private->line_bytes;
-      }
-    }
-    break;
-  case EfiUgaVideoFill:
-    Color = UgaPixelToColor(Private, *BltBuffer);
-    for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
-      for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
-        XPutPixel(Private->image, DstX, DstY, Color);
-      }
-    }
-    break;
-  default:
-      return EFI_INVALID_PARAMETER;
-  }
-
-  //
-  //  Refresh screen.
-  //
-  switch (BltOperation) {
-  case EfiUgaVideoToVideo:
-    XCopyArea(Private->display, Private->win, Private->win, Private->gc,
-               Args->SourceX, Args->SourceY, Args->Width, Args->Height, Args->DestinationX, Args->DestinationY);
-    while (1) {
-      XEvent ev;
-
-      XNextEvent (Private->display, &ev);
-      HandleEvent(Private, &ev);
-      if (ev.type == NoExpose || ev.type == GraphicsExpose)
-        break;
-    }
-    break;
-  case EfiUgaVideoFill:
-    Color = UgaPixelToColor(Private, *BltBuffer);
-    XSetForeground(Private->display, Private->gc, Color);
-    XFillRectangle(Private->display, Private->win, Private->gc,
-                    Args->DestinationX, Args->DestinationY, Args->Width, Args->Height);
-    XFlush(Private->display);
-    break;
-  case EfiUgaBltBufferToVideo:
-    Redraw(Private, Args->DestinationX, Args->DestinationY, Args->Width, Args->Height);
-    break;
-  default:
-    break;
-  }
-  return EFI_SUCCESS;
-}
-
-STATIC EFI_STATUS
-CheckPointerInternal( UGA_IO_PRIVATE *drv, BOOLEAN delay )
-{
-  HandleEvents(drv);
-  if (drv->pointer_state_changed != 0)
-    return EFI_SUCCESS;
-  if ( delay )
-    /* EFI is polling.  Be CPU-friendly.  */
-    msSleep (20);
-  return EFI_NOT_READY;
-}
-
-EFI_STATUS
-UgaCheckPointer(EFI_UNIX_UGA_IO_PROTOCOL *UgaIo)
-{
-  UGA_IO_PRIVATE  *drv = (UGA_IO_PRIVATE *)UgaIo;
-  return( CheckPointerInternal( drv, TRUE ) );
-}
-
-EFI_STATUS
-UgaGetPointerState (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, EFI_SIMPLE_POINTER_STATE *state)
-{
-  UGA_IO_PRIVATE *drv = (UGA_IO_PRIVATE *)UgaIo;
-  EFI_STATUS status;
-
-  status = CheckPointerInternal( drv, FALSE );
-  if (status != EFI_SUCCESS)
-    return status;
-  
-  memcpy( state, &drv->pointer_state, sizeof( EFI_SIMPLE_POINTER_STATE ) );
-
-  drv->pointer_state.RelativeMovementX = 0;
-  drv->pointer_state.RelativeMovementY = 0;
-  drv->pointer_state.RelativeMovementZ = 0;
-  drv->pointer_state_changed = 0;
-  return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UgaCreate (EFI_UNIX_UGA_IO_PROTOCOL **Uga, CONST CHAR16 *Title)
-{
-  UGA_IO_PRIVATE *drv;
-  unsigned int border_width = 0;
-  char *display_name = NULL;
-  int title_len;
-
-  drv = (UGA_IO_PRIVATE *)calloc (1, sizeof (UGA_IO_PRIVATE));
-  if (drv == NULL)
-    return EFI_OUT_OF_RESOURCES;
-
-#if defined(__APPLE__) || defined(MDE_CPU_X64)
-//
-//
-//
-  drv->UgaIo.UgaClose    = GasketUgaClose; 
-  drv->UgaIo.UgaSize     = GasketUgaSize;
-  drv->UgaIo.UgaCheckKey = GasketUgaCheckKey;
-  drv->UgaIo.UgaGetKey   = GasketUgaGetKey;
-  drv->UgaIo.UgaKeySetState         = GasketUgaKeySetState;
-  drv->UgaIo.UgaRegisterKeyNotify   = GasketUgaRegisterKeyNotify;
-  drv->UgaIo.UgaBlt      = GasketUgaBlt;
-  drv->UgaIo.UgaCheckPointer        = GasketUgaCheckPointer;
-  drv->UgaIo.UgaGetPointerState     = GasketUgaGetPointerState;
-#else
-  drv->UgaIo.UgaClose = UgaClose;
-  drv->UgaIo.UgaSize = UgaSize;
-  drv->UgaIo.UgaCheckKey = UgaCheckKey;
-  drv->UgaIo.UgaGetKey = UgaGetKey;
-  drv->UgaIo.UgaKeySetState         = UgaKeySetState;
-  drv->UgaIo.UgaRegisterKeyNotify   = UgaRegisterKeyNotify;
-  drv->UgaIo.UgaBlt = UgaBlt;
-  drv->UgaIo.UgaCheckPointer        = UgaCheckPointer;
-  drv->UgaIo.UgaGetPointerState     = UgaGetPointerState;
-#endif
-  
-  
-
-  drv->key_count = 0;
-  drv->key_rd = 0;
-  drv->key_wr = 0;
-  drv->KeyState.KeyShiftState  = EFI_SHIFT_STATE_VALID;
-  drv->KeyState.KeyToggleState = EFI_TOGGLE_STATE_VALID;
-  drv->RegisterdKeyCallback = NULL;
-  drv->RegisterdKeyCallbackContext = NULL;
-  
-  
-  drv->display = XOpenDisplay (display_name);
-  if (drv->display == NULL)
-    {
-      fprintf (stderr, "uga: cannot connect to X server %s\n",
-                XDisplayName (display_name));
-      free (drv);
-      return EFI_DEVICE_ERROR;
-    }
-  drv->screen = DefaultScreen (drv->display);
-  drv->visual = DefaultVisual (drv->display, drv->screen);
-  drv->win = XCreateSimpleWindow
-               (drv->display, RootWindow (drv->display, drv->screen),
-                0, 0, 4, 4, border_width,
-                WhitePixel (drv->display, drv->screen),
-                BlackPixel (drv->display, drv->screen));
-
-  drv->depth = DefaultDepth (drv->display, drv->screen);
-  XDefineCursor (drv->display, drv->win, XCreateFontCursor (drv->display, XC_pirate)); 
-
-  /* Compute title len and convert to Ascii.  */
-  for (title_len = 0; Title[title_len] != 0; title_len++)
-    ;
-  {
-    char title[title_len + 1];
-    int i;
-    for (i = 0; i < title_len; i++)
-      title[i] = Title[i];
-    title[i] = 0;
-    
-    XStoreName (drv->display, drv->win, title);
-  }
-
-  XSelectInput (drv->display, drv->win,
-                 ExposureMask | KeyPressMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask );
-  drv->gc = DefaultGC (drv->display, drv->screen);
-
-  *Uga = (EFI_UNIX_UGA_IO_PROTOCOL *)drv;
-  return EFI_SUCCESS;
-}
diff --git a/UnixPkg/Sec/UnixThunk.c b/UnixPkg/Sec/UnixThunk.c
deleted file mode 100644 (file)
index eb9e536..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials                          
-are licensed and made available under the terms and conditions of the BSD License         
-which accompanies this distribution.  The full text of the license may be found at        
-http://opensource.org/licenses/bsd-license.php                                            
-                                                                                          
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
-
-Module Name:
-
-  UnixThunk.c
-
-Abstract:
-
-  Since the SEC is the only program in our emulation we 
-  must use a Tiano mechanism to export APIs to other modules.
-  This is the role of the EFI_UNIX_THUNK_PROTOCOL.
-
-  The mUnixThunkTable exists so that a change to EFI_UNIX_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 crash.
-  
-
-  gUnix is a a public exported global that contains the initialized
-  data.
-
---*/
-
-#include "SecMain.h"
-#include "Uefi.h"
-#include "Library/UnixLib.h"
-
-#if defined(__APPLE__) || defined(MDE_CPU_X64)
-#include "Gasket.h"
-#endif
-
-int settimer_initialized;
-struct timeval settimer_timeval;
-void (*settimer_callback)(UINT64 delta);
-
-BOOLEAN gEmulatorInterruptEnabled = FALSE;
-
-
-void
-settimer_handler (int sig)
-{
-  struct timeval timeval;
-  UINT64 delta;
-
-  gettimeofday (&timeval, NULL);
-  delta = ((UINT64)timeval.tv_sec * 1000) + (timeval.tv_usec / 1000)
-    - ((UINT64)settimer_timeval.tv_sec * 1000) 
-    - (settimer_timeval.tv_usec / 1000);
-  settimer_timeval = timeval;
-  
-  if (settimer_callback) {
-#if defined(__APPLE__) || defined(MDE_CPU_X64)
-   ReverseGasketUint64 (settimer_callback, delta);
-#else
-    (*settimer_callback)(delta);
-#endif
-  }
-}
-
-VOID
-SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))
-{
-  struct itimerval timerval;
-  UINT32 remainder;
-
-  if (!settimer_initialized) {
-    struct sigaction act;
-
-    settimer_initialized = 1;
-    act.sa_handler = settimer_handler;
-    act.sa_flags = 0;
-    sigemptyset (&act.sa_mask);
-    gEmulatorInterruptEnabled = TRUE;
-    if (sigaction (SIGALRM, &act, NULL) != 0) {
-      printf ("SetTimer: sigaction error %s\n", strerror (errno));
-    }
-    if (gettimeofday (&settimer_timeval, NULL) != 0) {
-      printf ("SetTimer: gettimeofday error %s\n", strerror (errno));
-    }
-  }
-  timerval.it_value.tv_sec = DivU64x32(PeriodMs, 1000);
-  DivU64x32Remainder(PeriodMs, 1000, &remainder);
-  timerval.it_value.tv_usec = remainder * 1000;
-  timerval.it_value.tv_sec = DivU64x32(PeriodMs, 1000);
-  timerval.it_interval = timerval.it_value;
-  
-  if (setitimer (ITIMER_REAL, &timerval, NULL) != 0) {
-    printf ("SetTimer: setitimer error %s\n", strerror (errno));
-  }
-  settimer_callback = CallBack;
-}
-
-
-void
-UnixEnableInterrupt (void)
-{
-  sigset_t  sigset;
-
-  gEmulatorInterruptEnabled = TRUE;
-  // Since SetTimer() uses SIGALRM we emulate turning on and off interrupts 
-  // by enabling/disabling SIGALRM.
-  sigemptyset (&sigset);
-  sigaddset (&sigset, SIGALRM);
-  sigprocmask (SIG_UNBLOCK, &sigset, NULL);
-}
-
-
-void
-UnixDisableInterrupt (void)
-{
-  sigset_t  sigset;
-
-  // Since SetTimer() uses SIGALRM we emulate turning on and off interrupts 
-  // by enabling/disabling SIGALRM.
-  sigemptyset (&sigset);
-  sigaddset (&sigset, SIGALRM);
-  sigprocmask (SIG_BLOCK, &sigset, NULL);
-  gEmulatorInterruptEnabled = FALSE;
-}
-
-
-BOOLEAN
-UnixInterruptEanbled (void)
-{
-  return gEmulatorInterruptEnabled;
-}
-
-
-
-void
-msSleep (unsigned long Milliseconds)
-{
-  struct timespec rq, rm;
-  struct timeval  start, end;
-  unsigned long  MicroSec;
-  
-  rq.tv_sec = Milliseconds / 1000;
-  rq.tv_nsec = (Milliseconds % 1000) * 1000000;
-
-  //
-  // nanosleep gets interrupted by our timer tic. 
-  // we need to track wall clock time or we will stall for way too long
-  //
-  gettimeofday (&start, NULL);
-  end.tv_sec  = start.tv_sec + rq.tv_sec;
-  MicroSec = (start.tv_usec + rq.tv_nsec/1000);
-  end.tv_usec = MicroSec % 1000000;
-  if (MicroSec > 1000000) {
-    end.tv_sec++;
-  }
-
-  while (nanosleep (&rq, &rm) == -1) {
-    if (errno != EINTR) {
-      break;
-    }
-    gettimeofday (&start, NULL);
-    if (start.tv_sec > end.tv_sec) {
-      break;
-    } if ((start.tv_sec == end.tv_sec) && (start.tv_usec > end.tv_usec)) {
-      break;
-    }
-    rq = rm;
-  } 
-}
-
-void
-GetLocalTime (EFI_TIME *Time)
-{
-  struct tm *tm;
-  time_t t;
-
-  t = time (NULL);
-  tm = localtime (&t);
-
-  Time->Year = 1900 + tm->tm_year;
-  Time->Month = tm->tm_mon + 1;
-  Time->Day = tm->tm_mday;
-  Time->Hour = tm->tm_hour;
-  Time->Minute = tm->tm_min;
-  Time->Second = tm->tm_sec;
-  Time->Nanosecond = 0;
-  Time->TimeZone = GetTimeZone ();
-  Time->Daylight = (daylight ? EFI_TIME_ADJUST_DAYLIGHT : 0)
-    | (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0);
-}
-
-void
-TzSet (void)
-{
-  STATIC int done = 0;
-  if (!done) {
-    tzset ();
-    done = 1;
-  }
-}
-
-long
-GetTimeZone(void)
-{
-  TzSet ();
-  return timezone;
-}
-
-int
-GetDayLight(void)
-{
-  TzSet ();
-  return daylight;
-}
-
-int
-GetErrno(void)
-{
-  return errno;
-}
-
-
-extern EFI_STATUS
-UgaCreate(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo, CONST CHAR16 *Title);
-
-EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {
-  EFI_UNIX_THUNK_PROTOCOL_SIGNATURE,
-#if defined(__APPLE__) || defined(MDE_CPU_X64)
-//
-// Mac OS X requires the stack to be 16-byte aligned for IA-32. So on an OS X build
-// we add an assembly wrapper that makes sure the stack ges aligned. 
-// This has the nice benfit of being able to run EFI ABI code, like the EFI shell
-// that is checked in to source control in the OS X version of the emulator
-//
-  GasketmsSleep, /* Sleep */
-  Gasketexit, /* Exit */
-  GasketSetTimer,
-  GasketGetLocalTime,
-  Gasketgmtime,
-  GasketGetTimeZone,
-  GasketGetDayLight,
-  Gasketpoll,
-  Gasketread,
-  Gasketwrite,
-  Gasketgetenv,
-  Gasketopen,
-  Gasketlseek,
-  Gasketftruncate,
-  Gasketclose,
-  Gasketmkdir,
-  Gasketrmdir,
-  Gasketunlink,
-  GasketGetErrno,
-  Gasketopendir,
-  Gasketrewinddir,
-  Gasketreaddir,
-  Gasketclosedir,
-  Gasketstat,
-  Gasketstatfs,
-  Gasketrename,
-  Gasketmktime,
-  Gasketfsync,
-  Gasketchmod,
-  Gasketutime,
-  Gaskettcflush,
-  GasketUgaCreate,
-  Gasketperror,
-  Gasketioctl,
-  Gasketfcntl,
-  Gasketcfsetispeed,
-  Gasketcfsetospeed,
-  Gaskettcgetattr,
-  Gaskettcsetattr,
-  GasketUnixPeCoffGetEntryPoint,                
-  GasketUnixPeCoffRelocateImageExtraAction,     
-  GasketUnixPeCoffUnloadImageExtraAction,  
-  
-  GasketUnixEnableInterrupt,
-  GasketUnixDisableInterrupt,
-
-  Gasketgetifaddrs,
-  Gasketfreeifaddrs,
-  Gasketsocket,
-
-#else
-  msSleep, /* Sleep */
-  exit, /* Exit */
-  SetTimer,
-  GetLocalTime,
-  gmtime,
-  GetTimeZone,
-  GetDayLight,
-  (UnixPoll)poll,
-  (UnixRead)read,
-  (UnixWrite)write,
-  getenv,
-  (UnixOpen)open,
-  (UnixSeek)lseek,
-  (UnixFtruncate)ftruncate,
-  close,
-  mkdir,
-  rmdir,
-  unlink,
-  GetErrno,
-  opendir,
-  rewinddir,
-  readdir,
-  closedir,
-  (UnixStat)stat,
-  statfs,
-  rename,
-  mktime,
-  fsync,
-  chmod,
-  utime,
-  tcflush,
-  UgaCreate,
-  perror,
-  ioctl,
-  fcntl,
-  cfsetispeed,
-  cfsetospeed,
-  tcgetattr,
-  tcsetattr,
-  SecPeCoffGetEntryPoint,
-  SecPeCoffRelocateImageExtraAction,
-  SecPeCoffLoaderUnloadImageExtraAction,
-  UnixEnableInterrupt,
-  UnixDisableInterrupt,
-  getifaddrs,
-  freeifaddrs,
-  socket
-#endif
-};
-
-
-EFI_UNIX_THUNK_PROTOCOL *gUnix = &mUnixThunkTable;
diff --git a/UnixPkg/Sec/X64/MangleGasket.S b/UnixPkg/Sec/X64/MangleGasket.S
deleted file mode 100644 (file)
index ea1e6aa..0000000
+++ /dev/null
@@ -1,1294 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# This template was generated from GasketEfiTemplate.c Unix x86_64 ABI
-#
-# The EFI_UNIX_THUNK_PROTOCOL member functions call these these generic assembly 
-# routines.  
-#
-# Some OS X POSIX calls get name mangled in C code and we need to fill in a C global
-# to get the correct binding (does not work from assembly). So we have 4 functions
-# that do an indirect call, while the others call POSIX APIs directly
-#
-# movq  _gUnixRmDir@GOTPCREL(%rip), %rax 
-#
-#
-# UNIX Arg passing: RCX, RDX,  R8,  R9
-# EFI  Arg passing: RDI, RSI, RDX, RCX, R8, R9
-#                   Callee allocates 32 bytes on stack to spill registers
-# RSI, RDI calle-save on EFI, scatch on UNIX callign
-#
-#
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution.  The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-//
-// Gaskets are EFI ABI to UNIX ABI calls
-// EFI ABI code will sub 40 (0x28) from %rsp before calling a function
-//  This is the 32 (0x20) byte to spill registers and 8 bytes to align stack on 16 byte boundry.
-//
-  .text
-
-// 32 byte shadow to spill rcx-r9, 8 bytes to align stack on 16 byte boundry
-// Any call with 0 - 4 arguments allocates 40 bytes on the stack.
-// For more than 4 args you always have to increase in quanta of 16 so 5 or 6 args is 56, 
-// 7 or 8 args is 72, and 9 or 10 args is 88
-#define EFI_STACK_SHADOW_SPACE          40  
-#define EFI_STACK_SHADOW_SPACE_5_6      56  
-#define EFI_STACK_SHADOW_SPACE_7_8      72 
-#define EFI_STACK_SHADOW_SPACE_9_10     88 
-
-
-
-  .text
-
-
-ASM_GLOBAL ASM_PFX(Gasketrmdir)
-ASM_PFX(Gasketrmdir):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  movq  ASM_PFX(gUnixRmDir)@GOTPCREL(%rip), %rax  // Get function name mangled by C
-  movq  (%rax), %rax
-  call  *%rax
-
-
-  popq  %rdi          // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketopendir)
-ASM_PFX(Gasketopendir):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  movq  ASM_PFX(gUnixOpenDir)@GOTPCREL(%rip), %rax  // Get function name mangled by C
-  movq  (%rax), %rax
-  call  *%rax
-  
-  popq  %rdi             // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(Gasketstat)
-ASM_PFX(Gasketstat):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  movq  ASM_PFX(gUnixStat)@GOTPCREL(%rip), %rax   // Get function name mangled by C
-  movq  (%rax), %rax
-  call  *%rax
-  
-
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-  
-  
-ASM_GLOBAL ASM_PFX(Gasketstatfs)
-ASM_PFX(Gasketstatfs):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  movq  ASM_PFX(gUnixStatFs)@GOTPCREL(%rip), %rax   // Get function name mangled by C
-  movq  (%rax), %rax
-  call  *%rax
-  
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-  
-ASM_GLOBAL ASM_PFX(Gasketrewinddir)
-ASM_PFX(Gasketrewinddir):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-  
-  movq    %rcx, %rdi    // Swizzle args 
-
-  movq  ASM_PFX(gUnixRewinddir)@GOTPCREL(%rip), %rax   // Get function name mangled by C
-  movq  (%rax), %rax
-  call  *%rax
-  
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-  
-ASM_GLOBAL ASM_PFX(Gasketreaddir)
-ASM_PFX(Gasketreaddir):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-  
-  movq    %rcx, %rdi    // Swizzle args 
-
-  movq  ASM_PFX(gUnixReaddir)@GOTPCREL(%rip), %rax   // Get function name mangled by C
-  movq  (%rax), %rax
-  call  *%rax
-  
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-  
-
-ASM_GLOBAL ASM_PFX(GasketmsSleep)
-ASM_PFX(GasketmsSleep):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call  ASM_PFX(msSleep)
-  
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-  
-  
-ASM_GLOBAL ASM_PFX(Gasketexit)
-ASM_PFX(Gasketexit):
-  movq    %rcx, %rdi    // Swizzle args 
-  call  ASM_PFX(exit)           // Less to do as we will never return to EFI ABI world
-LDEAD_LOOP:
-  jmp  LDEAD_LOOP       // _exit should never return
-
-
-
-ASM_GLOBAL ASM_PFX(GasketSetTimer)
-ASM_PFX(GasketSetTimer):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq    %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq    %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call  ASM_PFX(SetTimer)
-  
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-  
-ASM_GLOBAL ASM_PFX(GasketGetLocalTime)
-ASM_PFX(GasketGetLocalTime):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call  ASM_PFX(GetLocalTime)
-
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-  
-
-ASM_GLOBAL ASM_PFX(Gasketgmtime)
-ASM_PFX(Gasketgmtime):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call  ASM_PFX(localtime)
-
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(GasketGetTimeZone)
-ASM_PFX(GasketGetTimeZone):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  call  ASM_PFX(GetTimeZone)
-
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-  
-ASM_GLOBAL ASM_PFX(GasketGetDayLight)
-ASM_PFX(GasketGetDayLight):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  call  ASM_PFX(GetDayLight)
-
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketpoll)
-ASM_PFX(Gasketpoll):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(poll)
-
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(Gasketread)
-ASM_PFX(Gasketread):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(read)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketwrite)
-ASM_PFX(Gasketwrite):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(write)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketgetenv)
-ASM_PFX(Gasketgetenv):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(getenv)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketopen)
-ASM_PFX(Gasketopen):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(open)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketlseek)
-ASM_PFX(Gasketlseek):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(lseek)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketftruncate)
-ASM_PFX(Gasketftruncate):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(ftruncate)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketclose)
-ASM_PFX(Gasketclose):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(close)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(Gasketmkdir)
-ASM_PFX(Gasketmkdir):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(mkdir)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketunlink)
-ASM_PFX(Gasketunlink):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(unlink)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketGetErrno)
-ASM_PFX(GasketGetErrno):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  call  ASM_PFX(GetErrno)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-ASM_GLOBAL ASM_PFX(Gasketclosedir)
-ASM_PFX(Gasketclosedir):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(closedir)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketrename)
-ASM_PFX(Gasketrename):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(rename)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketmktime)
-ASM_PFX(Gasketmktime):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(mktime)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketfsync)
-ASM_PFX(Gasketfsync):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(fsync)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketchmod)
-ASM_PFX(Gasketchmod):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(chmod)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketutime)
-ASM_PFX(Gasketutime):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(utime)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gaskettcflush)
-ASM_PFX(Gaskettcflush):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(tcflush)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaCreate)
-ASM_PFX(GasketUgaCreate):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(UgaCreate)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketperror)
-ASM_PFX(Gasketperror):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(perror)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketioctl)
-ASM_PFX(Gasketioctl):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(UnixIoCtl1)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketfcntl)
-ASM_PFX(Gasketfcntl):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(UnixFcntl1)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(Gasketcfsetispeed)
-ASM_PFX(Gasketcfsetispeed):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(cfsetispeed)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(Gasketcfsetospeed)
-ASM_PFX(Gasketcfsetospeed):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(cfsetospeed)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gaskettcgetattr)
-ASM_PFX(Gaskettcgetattr):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(tcgetattr)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gaskettcsetattr)
-ASM_PFX(Gaskettcsetattr):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(tcsetattr)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUnixPeCoffGetEntryPoint)
-ASM_PFX(GasketUnixPeCoffGetEntryPoint):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(SecPeCoffGetEntryPoint)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(GasketUnixPeCoffRelocateImageExtraAction)
-ASM_PFX(GasketUnixPeCoffRelocateImageExtraAction):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(SecPeCoffRelocateImageExtraAction)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUnixPeCoffUnloadImageExtraAction)
-ASM_PFX(GasketUnixPeCoffUnloadImageExtraAction):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(SecPeCoffLoaderUnloadImageExtraAction)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-
-
-ASM_GLOBAL ASM_PFX(Gasketsocket)
-ASM_PFX(Gasketsocket):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(socket)
-  
-
-  popq  %rdi            // restore state
-  popq  %rsi
-  popq  %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(Gasketgetifaddrs)
-ASM_PFX(Gasketgetifaddrs):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(getifaddrs)
-  
-
-  popq  %rbp
-  popq  %rsi
-  popq  %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(Gasketfreeifaddrs)
-ASM_PFX(Gasketfreeifaddrs):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(freeifaddrs)
-  
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaClose)
-ASM_PFX(GasketUgaClose):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(UgaClose)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaSize)
-ASM_PFX(GasketUgaSize):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(UgaSize)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaCheckKey)
-ASM_PFX(GasketUgaCheckKey):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(UgaCheckKey)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaGetKey)
-ASM_PFX(GasketUgaGetKey):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(UgaGetKey)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-ASM_GLOBAL ASM_PFX(GasketUgaKeySetState)
-ASM_PFX(GasketUgaKeySetState):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(UgaKeySetState)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaRegisterKeyNotify)
-ASM_PFX(GasketUgaRegisterKeyNotify):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(UgaRegisterKeyNotify)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaBlt)
-ASM_PFX(GasketUgaBlt):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-  movq    %r9,  %rcx
-
-  call    ASM_PFX(UgaBlt)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaCheckPointer)
-ASM_PFX(GasketUgaCheckPointer):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-
-  call    ASM_PFX(UgaCheckPointer)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUgaGetPointerState)
-ASM_PFX(GasketUgaGetPointerState):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-
-  call    ASM_PFX(UgaGetPointerState)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketUnixEnableInterrupt)
-ASM_PFX(GasketUnixEnableInterrupt):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  call    ASM_PFX(UnixEnableInterrupt)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-ASM_GLOBAL ASM_PFX(GasketUnixDisableInterrupt)
-ASM_PFX(GasketUnixDisableInterrupt):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  call    ASM_PFX(UnixDisableInterrupt)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-//
-// UNIX ABI to EFI ABI call
-//
-// UINTN
-// ReverseGasketUint64 (
-//   void *Api,
-//   UINTN Arg1
-//   );
-ASM_GLOBAL ASM_PFX(ReverseGasketUint64)
-ASM_PFX(ReverseGasketUint64):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  movq    %rdi, %rax    // Swizzle args 
-  movq    %rsi, %rcx     
-
-  subq  $32, %rsp        // 32-byte shadow space
-  call  *%rax
-  addq  $32, %rsp
-
-  popq   %rbp          
-  ret
-
-//
-// UNIX ABI to EFI ABI call
-//
-// UINTN
-// ReverseGasketUint64Uint64 (
-//   void *Api,
-//   UINTN Arg1
-//   UINTN Arg2
-//   );
-ASM_GLOBAL ASM_PFX(ReverseGasketUint64Uint64)
-ASM_PFX(ReverseGasketUint64Uint64):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  movq    %rdi, %rax    // Swizzle args 
-  movq    %rsi, %rcx     
-
-  subq  $32, %rsp        // 32-byte shadow space
-  call  *%rax
-  addq  $32, %rsp
-
-  popq   %rbp          
-  ret
-  
-
-// Sec PPI Callbacks
-
-ASM_GLOBAL ASM_PFX(GasketSecUnixPeiLoadFile)
-ASM_PFX(GasketSecUnixPeiLoadFile):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-  movq    %r9,  %rcx
-
-  call    ASM_PFX(SecUnixPeiLoadFile)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-ASM_GLOBAL ASM_PFX(GasketSecUnixPeiAutoScan)
-ASM_PFX(GasketSecUnixPeiAutoScan):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-
-  call    ASM_PFX(SecUnixPeiAutoScan)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-ASM_GLOBAL ASM_PFX(GasketSecUnixUnixThunkAddress)
-ASM_PFX(GasketSecUnixUnixThunkAddress):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  call    ASM_PFX(SecUnixUnixThunkAddress)
-  
-
-  popq    %rdi
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketSecPeiReportStatusCode)
-ASM_PFX(GasketSecPeiReportStatusCode):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-  movq    %r9,  %rcx
-  movq    $0,   %r8     // BugBug: This should come from the stack
-  movq    $0,   %r9     //         But we can cheat since they are optional for bringup....
-
-  call    ASM_PFX(SecPeiReportStatusCode)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-ASM_GLOBAL ASM_PFX(GasketSecUnixFdAddress)
-ASM_PFX(GasketSecUnixFdAddress):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-  movq    %r9,  %rcx
-
-  call    ASM_PFX(SecUnixFdAddress)
-
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-
-ASM_GLOBAL ASM_PFX(GasketSecTemporaryRamSupport)
-ASM_PFX(GasketSecTemporaryRamSupport):
-  pushq   %rbp            // stack frame is for the debugger
-  movq    %rsp, %rbp
-
-  pushq   %rsi          // %rsi & %rdi are volatile in Unix and callee-save in EFI ABI
-  pushq   %rdi
-
-  movq    %rcx, %rdi    // Swizzle args 
-  movq    %rdx, %rsi     
-  movq    %r8,  %rdx
-  movq    %r9,  %rcx
-
-  call    ASM_PFX(SecTemporaryRamSupport)
-  
-  popq    %rdi          // restore state
-  popq    %rsi
-  popq    %rbp
-  ret
-
-
-
-
-
diff --git a/UnixPkg/Sec/X64/NameManglingFix.c b/UnixPkg/Sec/X64/NameManglingFix.c
deleted file mode 100644 (file)
index a3fd6a6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-  \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "SecMain.h"\r
-\r
-//\r
-// OS X Posix does some strange name mangling on these names in C.\r
-// If you call from assembler you get the wrong version of the function\r
-// So these globals get you the correct name mangled functions that can\r
-// be accessed from assembly\r
-//\r
-UnixRmDir     gUnixRmDir     = rmdir;\r
-UnixOpenDir   gUnixOpenDir   = opendir;\r
-UnixStat      gUnixStat      = (UnixStat)stat;\r
-UnixStatFs    gUnixStatFs    = statfs;\r
-UnixReadDir   gUnixReaddir   = readdir;\r
-UnixRewindDir gUnixRewinddir = rewinddir;\r
-\r
-int\r
-UnixIoCtl1 (\r
-  int               fd, \r
-  unsigned long int __request, \r
-  UINTN             Arg\r
-  ) \r
-{\r
-  return ioctl (fd, __request, Arg);\r
-}\r
-\r
-int\r
-UnixFcntl1 (int __fd, int __cmd, UINTN Arg)\r
-{\r
-  return fcntl (__fd, __cmd, Arg);\r
-}
\ No newline at end of file
diff --git a/UnixPkg/Sec/X64/SwitchStack.S b/UnixPkg/Sec/X64/SwitchStack.S
deleted file mode 100644 (file)
index e9adefc..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#------------------------------------------------------------------------------\r
-#\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php.\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   SwitchStack.S\r
-#\r
-# Abstract:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# Routine Description:\r
-#\r
-#   Routine for switching stacks with 3 parameters EFI ABI\r
-#   Convert UNIX to EFI ABI\r
-#\r
-# Arguments:\r
-#\r
-#   (rdi) EntryPoint    - Entry point with new stack.\r
-#   (rsi) Context1      - Parameter1 for entry point. (rcx)\r
-#   (rdx) Context2      - Parameter2 for entry point. (rdx) \r
-#   (rcx) Context3      - Parameter3 for entry point. (r8)\r
-#   (r8)  NewStack      - The pointer to new stack.\r
-#\r
-# Returns:\r
-#\r
-#   None\r
-#\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(PeiSwitchStacks)\r
-ASM_PFX(PeiSwitchStacks):\r
-    pushq   %rbp            // stack frame is for the debugger\r
-    movq    %rsp, %rbp\r
-\r
-    movq    %r8,  %rsp\r
-    \r
-    movq    %rdi, %rax\r
-    movq    %rsi, %rcx\r
-    movq    %rcx, %r8    \r
-    \r
-    #\r
-    # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,\r
-    # in case the callee wishes to spill them.\r
-    #\r
-    subq    $32, %rsp  // 32-byte shadow space plus alignment pad\r
-    call    *%rax\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# Routine Description:\r
-#\r
-#   Routine for switching stacks with 3 parameters UNIX ABI\r
-#\r
-# Arguments:\r
-#\r
-#   (rdi) EntryPoint    - Entry point with new stack.\r
-#   (rsi) Context1      - Parameter1 for entry point.\r
-#   (rdx) Context2      - Parameter2 for entry point.\r
-#   (rcx) Context3      - Parameter3 for entry point.\r
-#   (r8)  NewStack      - The pointer to new stack.\r
-#\r
-# Returns:\r
-#\r
-#   None\r
-#\r
-#------------------------------------------------------------------------------\r
-ASM_GLOBAL ASM_PFX(UnixPeiSwitchStacks)\r
-ASM_PFX(UnixPeiSwitchStacks):\r
-    pushq   %rbp            // stack frame is for the debugger\r
-    movq    %rsp, %rbp\r
-\r
-    mov     %rdi, %rax\r
-    mov     %rsi, %rdi\r
-    mov     %rdx, %rsi\r
-    mov     %rcx, %rdx\r
-    mov     %r8,  %rsp\r
-    \r
-    \r
-    #\r
-    # Reserve space for redzone on the stack,\r
-    # in case the callee wishes to spill them.\r
-    #\r
-    lea     -0x80(%rsp), %rsp\r
-    call    *%rax\r
-\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# SecSwitchStack (\r
-#   UINT32   TemporaryMemoryBase, // Rcx, Rdi\r
-#   UINT32   PermenentMemoryBase  // Rdx, Rsi\r
-#   );\r
-#------------------------------------------------------------------------------    \r
-ASM_GLOBAL ASM_PFX(SecSwitchStack)\r
-ASM_PFX(SecSwitchStack):\r
-  pushq   %rbp            // stack frame is for the debugger\r
-  movq    %rsp, %rbp\r
-\r
-  mov     %rsp, %rax\r
-  sub     %rdi, %rax\r
-  add     %rsi, %rax\r
-  mov    (%rip), %r10\r
-  mov    %r10, (%rax) \r
-  \r
-  popq   %rbp\r
-  ret\r
-  \r
-  
\ No newline at end of file
diff --git a/UnixPkg/TimerDxe/Timer.c b/UnixPkg/TimerDxe/Timer.c
deleted file mode 100644 (file)
index 5314d11..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  Timer.c\r
-\r
-Abstract:\r
-\r
-  UNIX Emulation Timer Architectural Protocol Driver as defined in DXE CIS\r
-\r
-  This Timer module uses an UNIX Thread to simulate the timer-tick driven\r
-  timer service.  In the future, the Thread creation should possibly be\r
-  abstracted by the CPU architectural protocol\r
-\r
---*/\r
-#include "PiDxe.h"\r
-#include <Protocol/Timer.h>\r
-#include <Protocol/Cpu.h>\r
-#include "Timer.h"\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include "UnixDxe.h"\r
-#include <Library/UnixLib.h>\r
-\r
-//\r
-// Pointer to the CPU Architectural Protocol instance\r
-//\r
-EFI_CPU_ARCH_PROTOCOL   *mCpu;\r
-\r
-//\r
-// The Timer Architectural Protocol that this driver produces\r
-//\r
-EFI_TIMER_ARCH_PROTOCOL mTimer = {\r
-  UnixTimerDriverRegisterHandler,\r
-  UnixTimerDriverSetTimerPeriod,\r
-  UnixTimerDriverGetTimerPeriod,\r
-  UnixTimerDriverGenerateSoftInterrupt\r
-};\r
-\r
-//\r
-// The notification function to call on every timer interrupt\r
-//\r
-EFI_TIMER_NOTIFY        mTimerNotifyFunction = NULL;\r
-\r
-//\r
-// The current period of the timer interrupt\r
-//\r
-UINT64                  mTimerPeriodMs;\r
-\r
-\r
-VOID\r
-EFIAPI\r
-TimerCallback (UINT64 DeltaMs)\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  wTimerID  - TODO: add argument description\r
-  msg       - TODO: add argument description\r
-  dwUser    - TODO: add argument description\r
-  dw1       - TODO: add argument description\r
-  dw2       - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_TPL           OriginalTPL;\r
-  EFI_TIMER_NOTIFY  CallbackFunction;\r
-\r
-\r
-  OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
-\r
-  if (OriginalTPL < TPL_HIGH_LEVEL) {\r
-    CallbackFunction = mTimerNotifyFunction;\r
-\r
-    //\r
-    // Only invoke the callback function if a Non-NULL handler has been\r
-    // registered. Assume all other handlers are legal.\r
-    //\r
-    if (CallbackFunction != NULL) {\r
-      CallbackFunction ((UINT64) (DeltaMs * 10000));\r
-    }\r
-  }\r
-\r
-  gBS->RestoreTPL (OriginalTPL);\r
-\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverRegisterHandler (\r
-  IN EFI_TIMER_ARCH_PROTOCOL           *This,\r
-  IN EFI_TIMER_NOTIFY                  NotifyFunction\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function registers the handler NotifyFunction so it is called every time\r
-  the timer interrupt fires.  It also passes the amount of time since the last\r
-  handler call to the NotifyFunction.  If NotifyFunction is NULL, then the\r
-  handler is unregistered.  If the handler is registered, then EFI_SUCCESS is\r
-  returned.  If the CPU does not support registering a timer interrupt handler,\r
-  then EFI_UNSUPPORTED is returned.  If an attempt is made to register a handler\r
-  when a handler is already registered, then EFI_ALREADY_STARTED is returned.\r
-  If an attempt is made to unregister a handler when a handler is not registered,\r
-  then EFI_INVALID_PARAMETER is returned.  If an error occurs attempting to\r
-  register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR\r
-  is returned.\r
-\r
-Arguments:\r
-\r
-  This           - The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  NotifyFunction - The function to call when a timer interrupt fires.  This\r
-                   function executes at TPL_HIGH_LEVEL.  The DXE Core will\r
-                   register a handler for the timer interrupt, so it can know\r
-                   how much time has passed.  This information is used to\r
-                   signal timer based events.  NULL will unregister the handler.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The timer handler was registered.\r
-\r
-  EFI_UNSUPPORTED       - The platform does not support timer interrupts.\r
-\r
-  EFI_ALREADY_STARTED   - NotifyFunction is not NULL, and a handler is already\r
-                          registered.\r
-\r
-  EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not\r
-                          previously registered.\r
-\r
-  EFI_DEVICE_ERROR      - The timer handler could not be registered.\r
-\r
---*/\r
-{\r
-  //\r
-  // Check for invalid parameters\r
-  //\r
-  if (NotifyFunction == NULL && mTimerNotifyFunction == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (NotifyFunction != NULL && mTimerNotifyFunction != NULL) {\r
-    return EFI_ALREADY_STARTED;\r
-  }\r
-\r
-  if (NotifyFunction == NULL) {\r
-    /* Disable timer.  */\r
-    gUnix->SetTimer (0, TimerCallback);\r
-  } else if (mTimerNotifyFunction == NULL) {\r
-    /* Enable Timer.  */\r
-    gUnix->SetTimer (mTimerPeriodMs, TimerCallback);\r
-  }\r
-  mTimerNotifyFunction = NotifyFunction;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverSetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN UINT64                   TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function adjusts the period of timer interrupts to the value specified\r
-  by TimerPeriod.  If the timer period is updated, then the selected timer\r
-  period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned.  If\r
-  the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.\r
-  If an error occurs while attempting to update the timer period, then the\r
-  timer hardware will be put back in its state prior to this call, and\r
-  EFI_DEVICE_ERROR is returned.  If TimerPeriod is 0, then the timer interrupt\r
-  is disabled.  This is not the same as disabling the CPU's interrupts.\r
-  Instead, it must either turn off the timer hardware, or it must adjust the\r
-  interrupt controller so that a CPU interrupt is not generated when the timer\r
-  interrupt fires.\r
-\r
-Arguments:\r
-\r
-  This        - The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  TimerPeriod - The rate to program the timer interrupt in 100 nS units.  If\r
-                the timer hardware is not programmable, then EFI_UNSUPPORTED is\r
-                returned.  If the timer is programmable, then the timer period\r
-                will be rounded up to the nearest timer period that is supported\r
-                by the timer hardware.  If TimerPeriod is set to 0, then the\r
-                timer interrupts will be disabled.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS      - The timer period was changed.\r
-\r
-  EFI_UNSUPPORTED  - The platform cannot change the period of the timer interrupt.\r
-\r
-  EFI_DEVICE_ERROR - The timer period could not be changed due to a device error.\r
-\r
---*/\r
-{\r
-\r
-  //\r
-  // If TimerPeriod is 0, then the timer thread should be canceled\r
-  // If the TimerPeriod is valid, then create and/or adjust the period of the timer thread\r
-  //\r
-  if (TimerPeriod == 0\r
-      || ((TimerPeriod > TIMER_MINIMUM_VALUE)\r
-    && (TimerPeriod < TIMER_MAXIMUM_VALUE))) {\r
-    mTimerPeriodMs = DivU64x32 (TimerPeriod + 5000, 10000);\r
-\r
-    gUnix->SetTimer (mTimerPeriodMs, TimerCallback);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverGetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL            *This,\r
-  OUT UINT64                            *TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function retrieves the period of timer interrupts in 100 ns units,\r
-  returns that value in TimerPeriod, and returns EFI_SUCCESS.  If TimerPeriod\r
-  is NULL, then EFI_INVALID_PARAMETER is returned.  If a TimerPeriod of 0 is\r
-  returned, then the timer is currently disabled.\r
-\r
-Arguments:\r
-\r
-  This        - The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  TimerPeriod - A pointer to the timer period to retrieve in 100 ns units.  If\r
-                0 is returned, then the timer is currently disabled.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The timer period was returned in TimerPeriod.\r
-\r
-  EFI_INVALID_PARAMETER - TimerPeriod is NULL.\r
-\r
---*/\r
-{\r
-  if (TimerPeriod == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *TimerPeriod = mTimerPeriodMs * 10000;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverGenerateSoftInterrupt (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function generates a soft timer interrupt. If the platform does not support soft\r
-  timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.\r
-  If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()\r
-  service, then a soft timer interrupt will be generated. If the timer interrupt is\r
-  enabled when this service is called, then the registered handler will be invoked. The\r
-  registered handler should not be able to distinguish a hardware-generated timer\r
-  interrupt from a software-generated timer interrupt.\r
-\r
-Arguments:\r
-\r
-  This  -  The EFI_TIMER_ARCH_PROTOCOL instance.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS       - The soft timer interrupt was generated.\r
-\r
-  EFI_UNSUPPORTEDT  - The platform does not support the generation of soft timer interrupts.\r
-\r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the Timer Architectural Protocol driver\r
-\r
-Arguments:\r
-\r
-  ImageHandle - ImageHandle of the loaded driver\r
-\r
-  SystemTable - Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Timer Architectural Protocol created\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources available to initialize driver.\r
-\r
-  EFI_DEVICE_ERROR      - A device error occured attempting to initialize the driver.\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-  //\r
-  // Make sure the Timer Architectural Protocol is not already installed in the system\r
-  //\r
-  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiTimerArchProtocolGuid);\r
-\r
-  //\r
-  // Get the CPU Architectural Protocol instance\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (void *)&mCpu);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Install the Timer Architectural Protocol onto a new handle\r
-  //\r
-  Handle = NULL;\r
-  Status = gBS->InstallProtocolInterface (\r
-                  &Handle,\r
-                  &gEfiTimerArchProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  &mTimer\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Start the timer thread at the default timer period\r
-  //\r
-  Status = mTimer.SetTimerPeriod (&mTimer, DEFAULT_TIMER_TICK_DURATION);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/TimerDxe/Timer.h b/UnixPkg/TimerDxe/Timer.h
deleted file mode 100644 (file)
index c1888a4..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  Timer.h\r
-\r
-Abstract:\r
-\r
-  UNIX Emulation Architectural Protocol Driver as defined in Tiano.\r
-  This Timer module uses an UNIX Thread to simulate the timer-tick driven\r
-  timer service.\r
-\r
---*/\r
-\r
-#ifndef _TIMER_H_\r
-#define _TIMER_H_\r
-\r
-\r
-\r
-\r
-//\r
-// Legal timer value range in 100 ns units\r
-//\r
-#define TIMER_MINIMUM_VALUE 0\r
-#define TIMER_MAXIMUM_VALUE (0x100000000ULL - 1)\r
-\r
-//\r
-// Default timer value in 100 ns units (50 ms)\r
-//\r
-#define DEFAULT_TIMER_TICK_DURATION 500000\r
-\r
-//\r
-// Function Prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverInitialize (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverRegisterHandler (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN EFI_TIMER_NOTIFY         NotifyFunction\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This            - TODO: add argument description\r
-  NotifyFunction  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverSetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This,\r
-  IN UINT64                   TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  TimerPeriod - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverGetTimerPeriod (\r
-  IN EFI_TIMER_ARCH_PROTOCOL   *This,\r
-  OUT UINT64                   *TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  TimerPeriod - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixTimerDriverGenerateSoftInterrupt (\r
-  IN EFI_TIMER_ARCH_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/UnixPkg/TimerDxe/Timer.inf b/UnixPkg/TimerDxe/Timer.inf
deleted file mode 100644 (file)
index c4b9a31..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-## @file\r
-# Unix Emulation Timer Architectural Protocol Driver as defined in DXE CIS\r
-#\r
-# This Timer module uses an NT Thread to simulate the timer-tick driven\r
-#  timer service. In the future, the Thread creation should possibly be \r
-#  abstracted by the CPU architectural protocol\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Timer\r
-  FILE_GUID                      = f36d49b4-8985-11db-809b-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = UnixTimerDriverInitialize\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  Timer.c\r
-  Timer.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  UnixLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  DebugLib\r
-  BaseLib\r
-\r
-\r
-[Protocols]\r
-  gEfiCpuArchProtocolGuid                       # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiTimerArchProtocolGuid                     # PROTOCOL ALWAYS_PRODUCED\r
-\r
-\r
-[Depex]\r
-  gEfiCpuArchProtocolGuid\r
-\r
diff --git a/UnixPkg/UnixAutoScanPei/UnixAutoScan.c b/UnixPkg/UnixAutoScanPei/UnixAutoScan.c
deleted file mode 100644 (file)
index 4b61dc7..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  UnixAutoscan.c\r
-\r
-Abstract:\r
-  This PEIM to abstract memory auto-scan in an Unix environment.\r
-\r
-Revision History\r
-\r
---*/\r
-\r
-#include "PiPei.h"\r
-#include <Ppi/UnixAutoScan.h>\r
-#include <Ppi/MemoryDiscovered.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/PeiServicesTablePointerLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeUnixAutoScan (\r
-  IN       EFI_PEI_FILE_HANDLE       FileHandle,\r
-  IN CONST EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Perform a call-back into the SEC simulator to get a memory value\r
-\r
-Arguments:\r
-  FfsHeader   - General purpose data available to every PEIM\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_PEI_PPI_DESCRIPTOR      *PpiDescriptor;\r
-  PEI_UNIX_AUTOSCAN_PPI      *PeiUnixService;\r
-  UINT64                      MemorySize;\r
-  EFI_PHYSICAL_ADDRESS        MemoryBase;\r
-  UINTN                       Index;\r
-  EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;\r
-\r
-\r
-  DEBUG ((EFI_D_ERROR, "Unix Autoscan PEIM Loaded\n"));\r
-\r
-  //\r
-  // Get the PEI UNIX Autoscan PPI\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-             &gPeiUnixAutoScanPpiGuid, // GUID\r
-             0,                      // INSTANCE\r
-             &PpiDescriptor,         // EFI_PEI_PPI_DESCRIPTOR\r
-             (VOID **)&PeiUnixService           // PPI\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Index = 0;\r
-  do {\r
-    Status = PeiUnixService->UnixAutoScan (Index, &MemoryBase, &MemorySize);\r
-    if (!EFI_ERROR (Status)) {\r
-      Attributes =\r
-        (\r
-          EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
-          EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
-          EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |\r
-          EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |\r
-          EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |\r
-          EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE\r
-        );\r
-\r
-      if (Index == 0) {\r
-        //\r
-        // Register the memory with the PEI Core\r
-        //\r
-        Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize);\r
-        ASSERT_EFI_ERROR (Status);\r
-\r
-        Attributes |= EFI_RESOURCE_ATTRIBUTE_TESTED;\r
-      }\r
-      \r
-      BuildResourceDescriptorHob (\r
-        EFI_RESOURCE_SYSTEM_MEMORY,\r
-        Attributes,\r
-        MemoryBase,\r
-        MemorySize\r
-        );\r
-    }\r
-    Index++;\r
-  } while (!EFI_ERROR (Status));\r
-\r
-  //\r
-  // Build the CPU hob with 36-bit addressing and 16-bits of IO space.\r
-  //\r
-  BuildCpuHob (36, 16);\r
-  \r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixAutoScanPei/UnixAutoScan.inf b/UnixPkg/UnixAutoScanPei/UnixAutoScan.inf
deleted file mode 100644 (file)
index efa813a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-## @file\r
-# Component description file for UnixAutoScan module\r
-#\r
-# This module abstracts memory auto-scan in a Unix environment.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixAutoScan\r
-  FILE_GUID                      = f3f36cb0-8985-11db-b195-0040d02b1835\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = PeimInitializeUnixAutoScan\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  UnixAutoScan.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  PeiServicesTablePointerLib\r
-  PeiServicesLib\r
-  HobLib\r
-  BaseMemoryLib\r
-  BaseLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-\r
-[Ppis]\r
-  gEfiPeiMemoryDiscoveredPpiGuid                # PPI ALWAYS_PRODUCED\r
-  gPeiUnixAutoScanPpiGuid                       # PPI ALWAYS_CONSUMED\r
-\r
-\r
-[Depex]\r
-  gPeiUnixAutoScanPpiGuid AND gEfiPeiMasterBootModePpiGuid\r
-\r
diff --git a/UnixPkg/UnixBlockIoDxe/ComponentName.c b/UnixPkg/UnixBlockIoDxe/ComponentName.c
deleted file mode 100644 (file)
index 986e8c4..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixBlockIo.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-EFI_COMPONENT_NAME_PROTOCOL     gUnixBlockIoComponentName = {\r
-  UnixBlockIoComponentNameGetDriverName,\r
-  UnixBlockIoComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-EFI_UNICODE_STRING_TABLE mUnixBlockIoDriverNameTable[] = {\r
-  { "eng", L"Unix Block I/O Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language \r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned \r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixBlockIoComponentName.SupportedLanguages,\r
-          mUnixBlockIoDriverNameTable,\r
-          DriverName\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by \r
-                       This is managing.  This handle specifies the controller \r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name \r
-                       of.  This is an optional parameter that may be NULL.  It \r
-                       will be NULL for device drivers.  It will also be NULL \r
-                       for a bus drivers that wish to retrieve the name of the \r
-                       bus controller.  It will not be NULL for a bus driver \r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by \r
-                       ControllerHandle and ChildHandle in the language specified\r
-                       by Language from the point of view of the driver specified\r
-                       by This. \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
-                            language specified by Language for the driver \r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently managing \r
-                            the controller specified by ControllerHandle and \r
-                            ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_BLOCK_IO_PROTOCOL   *BlockIo;\r
-  UNIX_BLOCK_IO_PRIVATE *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-             &gEfiUnixIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiBlockIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);\r
-\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixBlockIoComponentName.SupportedLanguages,\r
-          Private->ControllerNameTable,\r
-          ControllerName\r
-          );\r
-}\r
diff --git a/UnixPkg/UnixBlockIoDxe/DriverConfiguration.c b/UnixPkg/UnixBlockIoDxe/DriverConfiguration.c
deleted file mode 100644 (file)
index 245aab6..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2005, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  DriverConfiguration.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixBlockIo.h"\r
-\r
-//\r
-// EFI Driver Configuration Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationSetOptions (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  CHAR8                                                  *Language,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationOptionsValid (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle  OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationForceDefaults (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  UINT32                                                 DefaultType,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  );\r
-\r
-//\r
-// EFI Driver Configuration Protocol\r
-//\r
-EFI_DRIVER_CONFIGURATION_PROTOCOL gUnixBlockIoDriverConfiguration = {\r
-  UnixBlockIoDriverConfigurationSetOptions,\r
-  UnixBlockIoDriverConfigurationOptionsValid,\r
-  UnixBlockIoDriverConfigurationForceDefaults,\r
-  LANGUAGESUPPORTED\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationSetOptions (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  CHAR8                                                  *Language,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Allows the user to set controller specific options for a controller that a \r
-    driver is currently managing.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to set options on.\r
-    ChildHandle      - The handle of the child controller to set options on.  This\r
-                       is an optional parameter that may be NULL.  It will be NULL \r
-                       for device drivers, and for a bus drivers that wish to set \r
-                       options for the bus controller.  It will not be NULL for a \r
-                       bus driver that wishes to set options for one of its child \r
-                       controllers.\r
-    Language         - A pointer to a three character ISO 639-2 language identifier.\r
-                       This is the language of the user interface that should be \r
-                       presented to the user, and it must match one of the languages \r
-                       specified in SupportedLanguages.  The number of languages \r
-                       supported by a driver is up to the driver writer.\r
-    ActionRequired   - A pointer to the action that the calling agent is required \r
-                       to perform when this function returns.  See "Related \r
-                       Definitions" for a list of the actions that the calling \r
-                       agent is required to perform prior to accessing \r
-                       ControllerHandle again.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The driver specified by This successfully set the \r
-                            configuration options for the controller specified \r
-                            by ControllerHandle..\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support setting \r
-                            configuration options for the controller specified by \r
-                            ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempt to set the \r
-                            configuration options for the controller specified \r
-                            by ControllerHandle and ChildHandle.\r
-    EFI_OUT_RESOURCES     - There are not enough resources available to set the \r
-                            configuration options for the controller specified \r
-                            by ControllerHandle and ChildHandle.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  CHAR8                 *SupportedLanguage;\r
-\r
-  SupportedLanguage = This->SupportedLanguages;\r
-\r
-  Status            = EFI_UNSUPPORTED;\r
-  while (*SupportedLanguage != 0) {\r
-    if (AsciiStrnCmp (Language, SupportedLanguage, 3)) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-\r
-    SupportedLanguage += 3;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (ActionRequired == NULL || ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *ActionRequired = EfiDriverConfigurationActionNone;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationOptionsValid (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle  OPTIONAL\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Tests to see if a controller's current configuration options are valid.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to test if it's current \r
-                       configuration options are valid.\r
-    ChildHandle      - The handle of the child controller to test if it's current\r
-                       configuration options are valid.  This is an optional \r
-                       parameter that may be NULL.  It will be NULL for device \r
-                       drivers.  It will also be NULL for a bus drivers that wish\r
-                       to test the configuration options for the bus controller.\r
-                       It will not be NULL for a bus driver that wishes to test \r
-                       configuration options for one of its child controllers.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The controller specified by ControllerHandle and \r
-                            ChildHandle that is being managed by the driver \r
-                            specified by This has a valid set of  configuration\r
-                            options.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently \r
-                            managing the controller specified by ControllerHandle \r
-                            and ChildHandle.\r
-    EFI_DEVICE_ERROR      - The controller specified by ControllerHandle and \r
-                            ChildHandle that is being managed by the driver \r
-                            specified by This has an invalid set of configuration \r
-                            options.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationForceDefaults (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  UINT32                                                 DefaultType,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Forces a driver to set the default configuration options for a controller.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to force default configuration options on.\r
-    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.\r
-    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.\r
-    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.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the configuration type specified by DefaultType.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempt to force the default configuration options on the controller specified by  ControllerHandle and ChildHandle.\r
-    EFI_OUT_RESOURCES     - There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (ActionRequired == NULL || ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *ActionRequired = EfiDriverConfigurationActionNone;\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/UnixBlockIoDxe/DriverDiagnostics.c b/UnixPkg/UnixBlockIoDxe/DriverDiagnostics.c
deleted file mode 100644 (file)
index 69ba61d..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2005, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  DriverDiagnostics.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixBlockIo.h"\r
-\r
-//\r
-// EFI Driver Diagnostics Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverDiagnosticsRunDiagnostics (\r
-  IN  EFI_DRIVER_DIAGNOSTICS_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                    ControllerHandle,\r
-  IN  EFI_HANDLE                                    ChildHandle  OPTIONAL,\r
-  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                    DiagnosticType,\r
-  IN  CHAR8                                         *Language,\r
-  OUT EFI_GUID                                      **ErrorType,\r
-  OUT UINTN                                         *BufferSize,\r
-  OUT CHAR16                                        **Buffer\r
-  );\r
-\r
-//\r
-// EFI Driver Diagnostics Protocol\r
-//\r
-EFI_DRIVER_DIAGNOSTICS_PROTOCOL gUnixBlockIoDriverDiagnostics = {\r
-  UnixBlockIoDriverDiagnosticsRunDiagnostics,\r
-  LANGUAGESUPPORTED\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverDiagnosticsRunDiagnostics (\r
-  IN  EFI_DRIVER_DIAGNOSTICS_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                    ControllerHandle,\r
-  IN  EFI_HANDLE                                    ChildHandle  OPTIONAL,\r
-  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                    DiagnosticType,\r
-  IN  CHAR8                                         *Language,\r
-  OUT EFI_GUID                                      **ErrorType,\r
-  OUT UINTN                                         *BufferSize,\r
-  OUT CHAR16                                        **Buffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Runs diagnostics on a controller.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to run diagnostics on.\r
-    ChildHandle      - The handle of the child controller to run diagnostics on  \r
-                       This is an optional parameter that may be NULL.  It will \r
-                       be NULL for device drivers.  It will also be NULL for a \r
-                       bus drivers that wish to run diagnostics on the bus \r
-                       controller.  It will not be NULL for a bus driver that \r
-                       wishes to run diagnostics on one of its child controllers.\r
-    DiagnosticType   - Indicates type of diagnostics to perform on the controller \r
-                       specified by ControllerHandle and ChildHandle.   See \r
-                       "Related Definitions" for the list of supported types.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language in which the optional \r
-                       error message should be returned in Buffer, and it must \r
-                       match one of the languages specified in SupportedLanguages.\r
-                       The number of languages supported by a driver is up to \r
-                       the driver writer.  \r
-    ErrorType        - A GUID that defines the format of the data returned in \r
-                       Buffer.  \r
-    BufferSize       - The size, in bytes, of the data returned in Buffer.  \r
-    Buffer           - A buffer that contains a Null-terminated Unicode string \r
-                       plus some additional data whose format is defined by \r
-                       ErrorType.  Buffer is allocated by this function with \r
-                       AllocatePool(), and it is the caller's responsibility \r
-                       to free it with a call to FreePool().  \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The controller specified by ControllerHandle and \r
-                            ChildHandle passed the diagnostic.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r
-                            EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ErrorType is NULL.\r
-    EFI_INVALID_PARAMETER - BufferType is NULL.\r
-    EFI_INVALID_PARAMETER - Buffer is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support \r
-                            running diagnostics for the controller specified \r
-                            by ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            type of diagnostic specified by DiagnosticType.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-    EFI_OUT_OF_RESOURCES  - There are not enough resources available to complete\r
-                            the diagnostics.\r
-    EFI_OUT_OF_RESOURCES  - There are not enough resources available to return\r
-                            the status information in ErrorType, BufferSize, \r
-                            and Buffer.\r
-    EFI_DEVICE_ERROR      - The controller specified by ControllerHandle and \r
-                            ChildHandle did not pass the diagnostic.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  CHAR8                 *SupportedLanguage;\r
-\r
-  if (Language         == NULL ||\r
-      ErrorType        == NULL ||\r
-      Buffer           == NULL ||\r
-      ControllerHandle == NULL ||\r
-      BufferSize       == NULL) {\r
-\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  SupportedLanguage = This->SupportedLanguages;\r
-\r
-  Status            = EFI_UNSUPPORTED;\r
-  while (*SupportedLanguage != 0) {\r
-    if (AsciiStrnCmp (Language, SupportedLanguage, 3)) {\r
-      Status = EFI_SUCCESS;\r
-      break;\r
-    }\r
-\r
-    SupportedLanguage += 3;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  *ErrorType  = NULL;\r
-  *BufferSize = 0;\r
-  if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {\r
-    *ErrorType  = &gEfiBlockIoProtocolGuid;\r
-    *BufferSize = 0x60;\r
-    gBS->AllocatePool (EfiBootServicesData, (UINTN) (*BufferSize),\r
-           (void *)Buffer);\r
-    CopyMem (*Buffer, L"Unix Block I/O Driver Diagnostics Failed\n", *BufferSize);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/UnixBlockIoDxe/EntryPoint.c b/UnixPkg/UnixBlockIoDxe/EntryPoint.c
deleted file mode 100644 (file)
index 1abe7fe..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**@file\r
-  Entry Point Source file.\r
-\r
-  This file contains the user entry point \r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-   This program and the accompanying materials\r
-   are licensed and made available under the terms and conditions of the BSD License\r
-   which accompanies this distribution. The full text of the license may be found at\r
-   http://opensource.org/licenses/bsd-license.php\r
-   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-**/\r
-\r
-\r
-\r
-#include "UnixBlockIo.h"\r
-\r
-/**\r
-  The user Entry Point for module UnixBlockIo. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixBlockIo(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  Status = EfiLibInstallAllDriverProtocols (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gUnixBlockIoDriverBinding,\r
-             ImageHandle,\r
-             &gUnixBlockIoComponentName,\r
-             NULL,\r
-             &gUnixBlockIoDriverDiagnostics\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixBlockIoDxe/UnixBlockIo.c b/UnixPkg/UnixBlockIoDxe/UnixBlockIo.c
deleted file mode 100644 (file)
index 2de6cc6..0000000
+++ /dev/null
@@ -1,1288 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixBlockIo.c\r
-\r
-Abstract:\r
-\r
-  Produce block IO abstractions for real devices on your PC using Posix APIs.\r
-  The configuration of what devices to mount or emulate comes from UNIX \r
-  environment variables. The variables must be visible to the Microsoft* \r
-  Developer Studio for them to work.\r
-\r
-  <F>ixed       - Fixed disk like a hard drive.\r
-  <R>emovable   - Removable media like a floppy or CD-ROM.\r
-  Read <O>nly   - Write protected device.\r
-  Read <W>rite  - Read write device.\r
-  <block count> - Decimal number of blocks a device supports.\r
-  <block size>  - Decimal number of bytes per block.\r
-\r
-  UNIX envirnonment variable contents. '<' and '>' are not part of the variable, \r
-  they are just used to make this help more readable. There should be no \r
-  spaces between the ';'. Extra spaces will break the variable. A '!' is \r
-  used to seperate multiple devices in a variable.\r
-\r
-  EFI_UNIX_VIRTUAL_DISKS = \r
-    <F | R><O | W>;<block count>;<block size>[!...]\r
-\r
-  EFI_UNIX_PHYSICAL_DISKS =\r
-    <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]\r
-\r
-  Virtual Disks: These devices use a file to emulate a hard disk or removable\r
-                 media device. \r
-                 \r
-    Thus a 20 MB emulated hard drive would look like:\r
-    EFI_UNIX_VIRTUAL_DISKS=FW;40960;512\r
-\r
-    A 1.44MB emulated floppy with a block size of 1024 would look like:\r
-    EFI_UNIX_VIRTUAL_DISKS=RW;1440;1024\r
-\r
-  Physical Disks: These devices use UNIX to open a real device in your system\r
-\r
-    Thus a 120 MB floppy would look like:\r
-    EFI_UNIX_PHYSICAL_DISKS=B:RW;245760;512\r
-\r
-    Thus a standard CD-ROM floppy would look like:\r
-    EFI_UNIX_PHYSICAL_DISKS=Z:RO;307200;2048\r
-\r
-\r
-  * Other names and brands may be claimed as the property of others.\r
-\r
---*/\r
-\r
-#include <fcntl.h>\r
-#include <unistd.h>\r
-#include "UnixBlockIo.h"\r
-\r
-//\r
-// Block IO protocol member functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoReadBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  OUT VOID                  *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoWriteBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  IN VOID                   *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoFlushBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoResetBlock (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN BOOLEAN                ExtendedVerification\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                  - TODO: add argument description\r
-  ExtendedVerification  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Private Worker functions\r
-//\r
-EFI_STATUS\r
-UnixBlockIoCreateMapping (\r
-  IN EFI_UNIX_IO_PROTOCOL             *UnixIo,\r
-  IN EFI_HANDLE                         EfiDeviceHandle,\r
-  IN CHAR16                             *Filename,\r
-  IN BOOLEAN                            ReadOnly,\r
-  IN BOOLEAN                            RemovableMedia,\r
-  IN UINTN                              NumberOfBlocks,\r
-  IN UINTN                              BlockSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  UnixIo         - TODO: add argument description\r
-  EfiDeviceHandle - TODO: add argument description\r
-  Filename        - TODO: add argument description\r
-  ReadOnly        - TODO: add argument description\r
-  RemovableMedia  - TODO: add argument description\r
-  NumberOfBlocks  - TODO: add argument description\r
-  BlockSize       - TODO: add argument description\r
-  DeviceType      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-UnixBlockIoReadWriteCommon (\r
-  IN  UNIX_BLOCK_IO_PRIVATE *Private,\r
-  IN UINT32                   MediaId,\r
-  IN EFI_LBA                  Lba,\r
-  IN UINTN                    BufferSize,\r
-  IN VOID                     *Buffer,\r
-  IN CHAR8                    *CallerName\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private     - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-  CallerName  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-UnixBlockIoError (\r
-  IN UNIX_BLOCK_IO_PRIVATE      *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-UnixBlockIoOpenDevice (\r
-  UNIX_BLOCK_IO_PRIVATE         *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-CHAR16                                    *\r
-GetNextElementPastTerminator (\r
-  IN  CHAR16  *EnvironmentVariable,\r
-  IN  CHAR16  Terminator\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  EnvironmentVariable - TODO: add argument description\r
-  Terminator          - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-EFI_DRIVER_BINDING_PROTOCOL gUnixBlockIoDriverBinding = {\r
-  UnixBlockIoDriverBindingSupported,\r
-  UnixBlockIoDriverBindingStart,\r
-  UnixBlockIoDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID **)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Make sure the UnixThunkProtocol is valid\r
-  //\r
-  Status = EFI_UNSUPPORTED;\r
-  if (UnixIo->UnixThunk->Signature == EFI_UNIX_THUNK_PROTOCOL_SIGNATURE) {\r
-\r
-    //\r
-    // Check the GUID to see if this is a handle type the driver supports\r
-    //\r
-    if (CompareGuid (UnixIo->TypeGuid, &gEfiUnixVirtualDisksGuid) ) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_UNIX_IO_PROTOCOL       *UnixIo;\r
-  CHAR16                      Buffer[FILENAME_BUFFER_SIZE];\r
-  CHAR16                      *Str;\r
-  BOOLEAN                     RemovableMedia;\r
-  BOOLEAN                     WriteProtected;\r
-  UINTN                       NumberOfBlocks;\r
-  UINTN                       BlockSize;\r
-  INTN                        i;\r
-\r
-  //\r
-  // Grab the protocols we need\r
-  //\r
-  \r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Set DiskType\r
-  //\r
-  if (!CompareGuid (UnixIo->TypeGuid, &gEfiUnixVirtualDisksGuid)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  Status  = EFI_NOT_FOUND;\r
-  //  Extract filename.\r
-  Str     = UnixIo->EnvString;\r
-  i = 0;\r
-  while (*Str && *Str != ':')\r
-    Buffer[i++] = *Str++;\r
-  Buffer[i] = 0;\r
-  if (*Str != ':') {\r
-    goto Done;\r
-  }\r
-\r
-  Str++;\r
-\r
-  RemovableMedia = FALSE;\r
-  WriteProtected = TRUE;\r
-  NumberOfBlocks = 0;\r
-  BlockSize = 512;\r
-  do {\r
-    if (*Str == 'R' || *Str == 'F') {\r
-      RemovableMedia = (BOOLEAN) (*Str == 'R');\r
-      Str++;\r
-    }\r
-    if (*Str == 'O' || *Str == 'W') {\r
-      WriteProtected  = (BOOLEAN) (*Str == 'O');\r
-      Str++;\r
-    }\r
-    if (*Str == 0)\r
-      break;\r
-    if (*Str != ';')\r
-      goto Done;\r
-    Str++;\r
-\r
-    NumberOfBlocks  = Atoi (Str);\r
-    Str       = GetNextElementPastTerminator (Str, ';');\r
-    if (NumberOfBlocks == 0)\r
-      break;\r
-\r
-    BlockSize = Atoi (Str);\r
-    if (BlockSize != 0)\r
-      Str       = GetNextElementPastTerminator (Str, ';');\r
-  } while (0);\r
-\r
-  //\r
-  // If we get here the variable is valid so do the work.\r
-  //\r
-  Status = UnixBlockIoCreateMapping (\r
-              UnixIo,\r
-              Handle,\r
-              Buffer,\r
-              WriteProtected,\r
-              RemovableMedia,\r
-              NumberOfBlocks,\r
-              BlockSize\r
-              );\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_BLOCK_IO_PROTOCOL   *BlockIo;\r
-  EFI_STATUS              Status;\r
-  UNIX_BLOCK_IO_PRIVATE *Private;\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiBlockIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);\r
-\r
-  //\r
-  // BugBug: If we need to kick people off, we need to make Uninstall Close the handles.\r
-  //         We could pass in our image handle or FLAG our open to be closed via\r
-  //         Unistall (== to saying any CloseProtocol will close our open)\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  Private->EfiHandle,\r
-                  &gEfiBlockIoProtocolGuid,\r
-                  &Private->BlockIo,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-\r
-    Status = gBS->CloseProtocol (\r
-                    Handle,\r
-                    &gEfiUnixIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Handle\r
-                    );\r
-\r
-    //\r
-    // Shut down our device\r
-    //\r
-    Private->UnixThunk->Close (Private->fd);\r
-\r
-    //\r
-    // Free our instance data\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-    gBS->FreePool (Private);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-CHAR16 *\r
-GetNextElementPastTerminator (\r
-  IN  CHAR16  *EnvironmentVariable,\r
-  IN  CHAR16  Terminator\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Worker function to parse environment variables.\r
-\r
-Arguments:\r
-  EnvironmentVariable - Envirnment variable to parse.\r
-\r
-  Terminator          - Terminator to parse for.\r
-\r
-Returns: \r
-\r
-  Pointer to next eliment past the first occurence of Terminator or the '\0'\r
-  at the end of the string.\r
-\r
---*/\r
-{\r
-  CHAR16  *Ptr;\r
-\r
-  for (Ptr = EnvironmentVariable; *Ptr != '\0'; Ptr++) {\r
-    if (*Ptr == Terminator) {\r
-      Ptr++;\r
-      break;\r
-    }\r
-  }\r
-\r
-  return Ptr;\r
-}\r
-\r
-EFI_STATUS\r
-UnixBlockIoCreateMapping (\r
-  IN EFI_UNIX_IO_PROTOCOL             *UnixIo,\r
-  IN EFI_HANDLE                         EfiDeviceHandle,\r
-  IN CHAR16                             *Filename,\r
-  IN BOOLEAN                            ReadOnly,\r
-  IN BOOLEAN                            RemovableMedia,\r
-  IN UINTN                              NumberOfBlocks,\r
-  IN UINTN                              BlockSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  UnixIo         - TODO: add argument description\r
-  EfiDeviceHandle - TODO: add argument description\r
-  Filename        - TODO: add argument description\r
-  ReadOnly        - TODO: add argument description\r
-  RemovableMedia  - TODO: add argument description\r
-  NumberOfBlocks  - TODO: add argument description\r
-  BlockSize       - TODO: add argument description\r
-  DeviceType      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_BLOCK_IO_PROTOCOL   *BlockIo;\r
-  UNIX_BLOCK_IO_PRIVATE *Private;\r
-  UINTN                   Index;\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (UNIX_BLOCK_IO_PRIVATE),\r
-                  (void *)&Private\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  EfiInitializeLock (&Private->Lock, TPL_NOTIFY);\r
-\r
-  Private->UnixThunk = UnixIo->UnixThunk;\r
-\r
-  Private->Signature  = UNIX_BLOCK_IO_PRIVATE_SIGNATURE;\r
-  Private->LastBlock  = NumberOfBlocks - 1;\r
-  Private->BlockSize  = BlockSize;\r
-\r
-  for (Index = 0; Filename[Index] != 0; Index++) {\r
-    Private->Filename[Index] = Filename[Index];\r
-  }\r
-\r
-  Private->Filename[Index]      = 0;\r
-\r
-  Private->Mode                 = (ReadOnly ? O_RDONLY : O_RDWR);\r
-\r
-  Private->NumberOfBlocks       = NumberOfBlocks;\r
-  Private->fd                   = -1;\r
-\r
-  Private->ControllerNameTable  = NULL;\r
-\r
-  AddUnicodeString (\r
-    "eng",\r
-    gUnixBlockIoComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    Filename\r
-    );\r
-\r
-  BlockIo = &Private->BlockIo;\r
-  BlockIo->Revision = EFI_BLOCK_IO_PROTOCOL_REVISION;\r
-  BlockIo->Media = &Private->Media;\r
-  BlockIo->Media->BlockSize = Private->BlockSize;\r
-  BlockIo->Media->LastBlock = Private->NumberOfBlocks - 1;\r
-  BlockIo->Media->MediaId = 0;;\r
-\r
-  BlockIo->Reset = UnixBlockIoResetBlock;\r
-  BlockIo->ReadBlocks = UnixBlockIoReadBlocks;\r
-  BlockIo->WriteBlocks = UnixBlockIoWriteBlocks;\r
-  BlockIo->FlushBlocks = UnixBlockIoFlushBlocks;\r
-\r
-  BlockIo->Media->ReadOnly = ReadOnly;\r
-  BlockIo->Media->RemovableMedia = RemovableMedia;\r
-  BlockIo->Media->LogicalPartition = FALSE;\r
-  BlockIo->Media->MediaPresent = TRUE;\r
-  BlockIo->Media->WriteCaching = FALSE;\r
-\r
-  BlockIo->Media->IoAlign = 1;\r
-\r
-  Private->EfiHandle  = EfiDeviceHandle;\r
-  Status              = UnixBlockIoOpenDevice (Private);\r
-  if (!EFI_ERROR (Status)) {\r
-\r
-    Status = gBS->InstallMultipleProtocolInterfaces (\r
-                    &Private->EfiHandle,\r
-                    &gEfiBlockIoProtocolGuid,\r
-                    &Private->BlockIo,\r
-                    NULL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      FreeUnicodeStringTable (Private->ControllerNameTable);\r
-      gBS->FreePool (Private);\r
-    }\r
-\r
-    DEBUG ((EFI_D_ERROR, "BlockDevice added: %s\n", Filename));\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-UnixBlockIoOpenDevice (\r
-  UNIX_BLOCK_IO_PRIVATE                 *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  UINT64                FileSize;\r
-  UINT64                EndOfFile;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  BlockIo = &Private->BlockIo;\r
-  EfiAcquireLock (&Private->Lock);\r
-\r
-  //\r
-  // If the device is already opened, close it\r
-  //\r
-  if (Private->fd >= 0) {\r
-    BlockIo->Reset (BlockIo, FALSE);\r
-  }\r
-\r
-  //\r
-  // Open the device\r
-  //\r
-  Private->fd = Private->UnixThunk->Open (Private->Filename, Private->Mode, 0644);\r
-  if (Private->fd < 0) {\r
-    DEBUG ((EFI_D_INFO, "PlOpenBlock: Could not open %a\n", Private->Filename));\r
-    BlockIo->Media->MediaPresent  = FALSE;\r
-    Status                        = EFI_NO_MEDIA;\r
-    goto Done;\r
-  }\r
-\r
-  if (!BlockIo->Media->MediaPresent) {\r
-    //\r
-    // BugBug: try to emulate if a CD appears - notify drivers to check it out\r
-    //\r
-    BlockIo->Media->MediaPresent = TRUE;\r
-    EfiReleaseLock (&Private->Lock);\r
-    EfiAcquireLock (&Private->Lock);\r
-  }\r
-\r
-  //\r
-  // get the size of the file\r
-  //\r
-  Status = SetFilePointer64 (Private, 0, &FileSize, SEEK_END);\r
-  if (EFI_ERROR (Status)) {\r
-    FileSize = MultU64x32 (Private->NumberOfBlocks, Private->BlockSize);\r
-    DEBUG ((EFI_D_ERROR, "PlOpenBlock: Could not get filesize of %a\n", Private->Filename));\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  if (Private->NumberOfBlocks == 0) {\r
-    Private->NumberOfBlocks = DivU64x32 (FileSize, Private->BlockSize);\r
-    Private->LastBlock = Private->NumberOfBlocks - 1;\r
-    Private->Media.LastBlock = Private->LastBlock;\r
-  }\r
-\r
-  EndOfFile = MultU64x32 (Private->NumberOfBlocks, Private->BlockSize);\r
-\r
-  if (FileSize != EndOfFile) {\r
-    //\r
-    // file is not the proper size, change it\r
-    //\r
-    DEBUG ((EFI_D_INIT, "PlOpenBlock: Initializing block device: %a\n", Private->Filename));\r
-\r
-    //\r
-    // first set it to 0\r
-    //\r
-    Private->UnixThunk->FTruncate (Private->fd, 0);\r
-\r
-    //\r
-    // then set it to the needed file size (OS will zero fill it)\r
-    //\r
-    Private->UnixThunk->FTruncate (Private->fd, EndOfFile);\r
-  }\r
-\r
-  DEBUG ((EFI_D_INIT, "%HPlOpenBlock: opened %a%N\n", Private->Filename));\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-    if (Private->fd >= 0) {\r
-      BlockIo->Reset (BlockIo, FALSE);\r
-    }\r
-  }\r
-\r
-  EfiReleaseLock (&Private->Lock);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-UnixBlockIoError (\r
-  IN UNIX_BLOCK_IO_PRIVATE      *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  return EFI_DEVICE_ERROR;\r
-\r
-#if 0\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  EFI_STATUS            Status;\r
-  BOOLEAN               ReinstallBlockIoFlag;\r
-\r
-\r
-  BlockIo = &Private->BlockIo;\r
-\r
-  switch (Private->UnixThunk->GetLastError ()) {\r
-\r
-  case ERROR_NOT_READY:\r
-    Status                        = EFI_NO_MEDIA;\r
-    BlockIo->Media->ReadOnly      = FALSE;\r
-    BlockIo->Media->MediaPresent  = FALSE;\r
-    ReinstallBlockIoFlag          = FALSE;\r
-    break;\r
-\r
-  case ERROR_WRONG_DISK:\r
-    BlockIo->Media->ReadOnly      = FALSE;\r
-    BlockIo->Media->MediaPresent  = TRUE;\r
-    BlockIo->Media->MediaId += 1;\r
-    ReinstallBlockIoFlag  = TRUE;\r
-    Status                = EFI_MEDIA_CHANGED;\r
-    break;\r
-\r
-  case ERROR_WRITE_PROTECT:\r
-    BlockIo->Media->ReadOnly  = TRUE;\r
-    ReinstallBlockIoFlag      = FALSE;\r
-    Status                    = EFI_WRITE_PROTECTED;\r
-    break;\r
-\r
-  default:\r
-    ReinstallBlockIoFlag  = FALSE;\r
-    Status                = EFI_DEVICE_ERROR;\r
-    break;\r
-  }\r
-\r
-  if (ReinstallBlockIoFlag) {\r
-    BlockIo->Reset (BlockIo, FALSE);\r
-\r
-    gBS->ReinstallProtocolInterface (\r
-          Private->EfiHandle,\r
-          &gEfiBlockIoProtocolGuid,\r
-          BlockIo,\r
-          BlockIo\r
-          );\r
-  }\r
-\r
-  return Status;\r
-#endif\r
-}\r
-\r
-EFI_STATUS\r
-UnixBlockIoReadWriteCommon (\r
-  IN  UNIX_BLOCK_IO_PRIVATE     *Private,\r
-  IN UINT32                       MediaId,\r
-  IN EFI_LBA                      Lba,\r
-  IN UINTN                        BufferSize,\r
-  IN VOID                         *Buffer,\r
-  IN CHAR8                        *CallerName\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private     - TODO: add argument description\r
-  MediaId     - TODO: add argument description\r
-  Lba         - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-  CallerName  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_NO_MEDIA - TODO: Add description for return value\r
-  EFI_MEDIA_CHANGED - TODO: Add description for return value\r
-  EFI_INVALID_PARAMETER - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-  EFI_BAD_BUFFER_SIZE - TODO: Add description for return value\r
-  EFI_INVALID_PARAMETER - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       BlockSize;\r
-  UINT64      LastBlock;\r
-  INT64       DistanceToMove;\r
-  UINT64      DistanceMoved;\r
-\r
-  if (Private->fd < 0) {\r
-    Status = UnixBlockIoOpenDevice (Private);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  if (!Private->Media.MediaPresent) {\r
-    DEBUG ((EFI_D_INIT, "%s: No Media\n", CallerName));\r
-    return EFI_NO_MEDIA;\r
-  }\r
-\r
-  if (Private->Media.MediaId != MediaId) {\r
-    return EFI_MEDIA_CHANGED;\r
-  }\r
-\r
-  if ((UINTN) Buffer % Private->Media.IoAlign != 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  //\r
-  // Verify buffer size\r
-  //\r
-  BlockSize = Private->BlockSize;\r
-  if (BufferSize == 0) {\r
-    DEBUG ((EFI_D_INIT, "%s: Zero length read\n", CallerName));\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if ((BufferSize % BlockSize) != 0) {\r
-    DEBUG ((EFI_D_INIT, "%s: Invalid read size\n", CallerName));\r
-    return EFI_BAD_BUFFER_SIZE;\r
-  }\r
-\r
-  LastBlock = Lba + (BufferSize / BlockSize) - 1;\r
-  if (LastBlock > Private->LastBlock) {\r
-    DEBUG ((EFI_D_INIT, "ReadBlocks: Attempted to read off end of device\n"));\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  //\r
-  // Seek to End of File\r
-  //\r
-  DistanceToMove = MultU64x32 (Lba, BlockSize);\r
-  Status = SetFilePointer64 (Private, DistanceToMove, &DistanceMoved, SEEK_SET);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_INIT, "WriteBlocks: SetFilePointer failed\n"));\r
-    return UnixBlockIoError (Private);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoReadBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  OUT VOID                  *Buffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Read BufferSize bytes from Lba into Buffer.\r
-\r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    MediaId    - Id of the media, changes every time the media is replaced.\r
-    Lba        - The starting Logical Block Address to read from\r
-    BufferSize - Size of Buffer, must be a multiple of device block size.\r
-    Buffer     - Buffer containing read data\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The data was read correctly from the device.\r
-    EFI_DEVICE_ERROR      - The device reported an error while performing the read.\r
-    EFI_NO_MEDIA          - There is no media in the device.\r
-    EFI_MEDIA_CHANGED     - The MediaId does not matched the current device.\r
-    EFI_BAD_BUFFER_SIZE   - The Buffer was not a multiple of the block size of the \r
-                            device.\r
-    EFI_INVALID_PARAMETER - The read request contains device addresses that are not \r
-                            valid for the device.\r
-\r
---*/\r
-{\r
-  UNIX_BLOCK_IO_PRIVATE *Private;\r
-  ssize_t                 len;\r
-  EFI_STATUS              Status;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  Private = UNIX_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Status  = UnixBlockIoReadWriteCommon (Private, MediaId, Lba, BufferSize, Buffer, "UnixReadBlocks");\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  len = Private->UnixThunk->Read (Private->fd, Buffer, BufferSize);\r
-  if (len != BufferSize) {\r
-    DEBUG ((EFI_D_INIT, "ReadBlocks: ReadFile failed.\n"));\r
-    Status = UnixBlockIoError (Private);\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // If we wrote then media is present.\r
-  //\r
-  This->Media->MediaPresent = TRUE;\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoWriteBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN UINT32                 MediaId,\r
-  IN EFI_LBA                Lba,\r
-  IN UINTN                  BufferSize,\r
-  IN VOID                   *Buffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Write BufferSize bytes from Lba into Buffer.\r
-\r
-  Arguments:\r
-    This       - Protocol instance pointer.\r
-    MediaId    - Id of the media, changes every time the media is replaced.\r
-    Lba        - The starting Logical Block Address to read from\r
-    BufferSize - Size of Buffer, must be a multiple of device block size.\r
-    Buffer     - Buffer containing read data\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The data was written correctly to the device.\r
-    EFI_WRITE_PROTECTED   - The device can not be written to.\r
-    EFI_DEVICE_ERROR      - The device reported an error while performing the write.\r
-    EFI_NO_MEDIA          - There is no media in the device.\r
-    EFI_MEDIA_CHNAGED     - The MediaId does not matched the current device.\r
-    EFI_BAD_BUFFER_SIZE   - The Buffer was not a multiple of the block size of the \r
-                            device.\r
-    EFI_INVALID_PARAMETER - The write request contains a LBA that is not \r
-                            valid for the device.\r
-\r
---*/\r
-{\r
-  UNIX_BLOCK_IO_PRIVATE *Private;\r
-  ssize_t                 len;\r
-  EFI_STATUS              Status;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  Private = UNIX_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Status  = UnixBlockIoReadWriteCommon (Private, MediaId, Lba, BufferSize, Buffer, "UnixWriteBlocks");\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  len = Private->UnixThunk->Write (Private->fd, Buffer, BufferSize);\r
-  if (len != BufferSize) {\r
-    DEBUG ((EFI_D_INIT, "ReadBlocks: WriteFile failed.\n"));\r
-    Status = UnixBlockIoError (Private);\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // If the write succeeded, we are not write protected and media is present.\r
-  //\r
-  This->Media->MediaPresent = TRUE;\r
-  This->Media->ReadOnly     = FALSE;\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoFlushBlocks (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Flush the Block Device.\r
-\r
-  Arguments:\r
-    This             - Protocol instance pointer.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - All outstanding data was written to the device\r
-    EFI_DEVICE_ERROR - The device reported an error while writting back the data\r
-    EFI_NO_MEDIA     - There is no media in the device.\r
-\r
---*/\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoResetBlock (\r
-  IN EFI_BLOCK_IO_PROTOCOL  *This,\r
-  IN BOOLEAN                ExtendedVerification\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Reset the Block Device.\r
-\r
-  Arguments:\r
-    This                 - Protocol instance pointer.\r
-    ExtendedVerification - Driver may perform diagnostics on reset.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The device was reset.\r
-    EFI_DEVICE_ERROR      - The device is not functioning properly and could \r
-                            not be reset.\r
-\r
---*/\r
-{\r
-  UNIX_BLOCK_IO_PRIVATE *Private;\r
-  EFI_TPL               OldTpl;\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
-  Private = UNIX_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (Private->fd >= 0) {\r
-    Private->UnixThunk->Close (Private->fd);\r
-    Private->fd = -1;\r
-  }\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-UINTN\r
-Atoi (\r
-  CHAR16  *String\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Convert a unicode string to a UINTN\r
-\r
-Arguments:\r
-\r
-  String - Unicode string.\r
-\r
-Returns: \r
-\r
-  UINTN of the number represented by String.  \r
-\r
---*/\r
-{\r
-  UINTN   Number;\r
-  CHAR16  *Str;\r
-\r
-  //\r
-  // skip preceeding white space\r
-  //\r
-  Str = String;\r
-  while ((*Str) && (*Str == ' ')) {\r
-    Str++;\r
-  }\r
-  //\r
-  // Convert ot a Number\r
-  //\r
-  Number = 0;\r
-  while (*Str != '\0') {\r
-    if ((*Str >= '0') && (*Str <= '9')) {\r
-      Number = (Number * 10) +*Str - '0';\r
-    } else {\r
-      break;\r
-    }\r
-\r
-    Str++;\r
-  }\r
-\r
-  return Number;\r
-}\r
-\r
-EFI_STATUS\r
-SetFilePointer64 (\r
-  IN  UNIX_BLOCK_IO_PRIVATE    *Private,\r
-  IN  INT64                      DistanceToMove,\r
-  OUT UINT64                     *NewFilePointer,\r
-  IN  INT32                      MoveMethod\r
-  )\r
-/*++\r
-\r
-This function extends the capability of SetFilePointer to accept 64 bit parameters\r
-\r
---*/\r
-// TODO: function comment is missing 'Routine Description:'\r
-// TODO: function comment is missing 'Arguments:'\r
-// TODO: function comment is missing 'Returns:'\r
-// TODO:    Private - add argument and description to function comment\r
-// TODO:    DistanceToMove - add argument and description to function comment\r
-// TODO:    NewFilePointer - add argument and description to function comment\r
-// TODO:    MoveMethod - add argument and description to function comment\r
-{\r
-  EFI_STATUS    Status;\r
-  off_t         res;\r
-\r
-  Status = EFI_SUCCESS;\r
-  res = Private->UnixThunk->Lseek(Private->fd, DistanceToMove, MoveMethod);\r
-  if (res == -1) {\r
-    Status = EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (NewFilePointer != NULL) {\r
-    *NewFilePointer = res;\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixBlockIoDxe/UnixBlockIo.h b/UnixPkg/UnixBlockIoDxe/UnixBlockIo.h
deleted file mode 100644 (file)
index a7e3f96..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixBlockIo.h\r
-\r
-Abstract:\r
-\r
-  Produce block IO abstractions for real devices on your PC using Posix APIs.\r
-  The configuration of what devices to mount or emulate comes from UNIX \r
-  environment variables. The variables must be visible to the Microsoft* \r
-  Developer Studio for them to work.\r
-\r
-  * Other names and brands may be claimed as the property of others.\r
-\r
---*/\r
-\r
-#ifndef _UNIX_BLOCK_IO_H_\r
-#define _UNIX_BLOCK_IO_H_\r
-\r
-#include "PiDxe.h"\r
-#include <Protocol/BlockIo.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include "UnixDxe.h"\r
-\r
-#define FILENAME_BUFFER_SIZE  80\r
-\r
-//\r
-// Language supported for driverconfiguration protocol\r
-//\r
-#define LANGUAGESUPPORTED "eng"\r
-\r
-#define UNIX_BLOCK_IO_PRIVATE_SIGNATURE SIGNATURE_32 ('L', 'X', 'b', 'k')\r
-typedef struct {\r
-  UINTN                       Signature;\r
-\r
-  EFI_LOCK                    Lock;\r
-\r
-  char                        Filename[FILENAME_BUFFER_SIZE];\r
-  UINTN                       ReadMode;\r
-  UINTN                       Mode;\r
-\r
-  int                         fd;\r
-\r
-  UINT64                      LastBlock;\r
-  UINTN                       BlockSize;\r
-  UINT64                      NumberOfBlocks;\r
-\r
-  EFI_HANDLE                  EfiHandle;\r
-  EFI_BLOCK_IO_PROTOCOL       BlockIo;\r
-  EFI_BLOCK_IO_MEDIA          Media;\r
-\r
-  EFI_UNICODE_STRING_TABLE    *ControllerNameTable;\r
-\r
-  EFI_UNIX_THUNK_PROTOCOL   *UnixThunk;\r
-\r
-} UNIX_BLOCK_IO_PRIVATE;\r
-\r
-#define UNIX_BLOCK_IO_PRIVATE_DATA_FROM_THIS(a) \\r
-         CR(a, UNIX_BLOCK_IO_PRIVATE, BlockIo, UNIX_BLOCK_IO_PRIVATE_SIGNATURE)\r
-\r
-#define LIST_BUFFER_SIZE  512\r
-\r
-//\r
-// Block I/O Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL        gUnixBlockIoDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL        gUnixBlockIoComponentName;\r
-extern EFI_DRIVER_CONFIGURATION_PROTOCOL  gUnixBlockIoDriverConfiguration;\r
-extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL    gUnixBlockIoDriverDiagnostics;\r
-\r
-//\r
-// EFI Driver Binding Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-SetFilePointer64 (\r
-  IN  UNIX_BLOCK_IO_PRIVATE    *Private,\r
-  IN  INT64                      DistanceToMove,\r
-  OUT UINT64                     *NewFilePointer,\r
-  IN  INT32                      MoveMethod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private         - TODO: add argument description\r
-  DistanceToMove  - TODO: add argument description\r
-  NewFilePointer  - TODO: add argument description\r
-  MoveMethod      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-UINTN\r
-Atoi (\r
-  CHAR16  *String\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  String  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/UnixPkg/UnixBlockIoDxe/UnixBlockIo.inf b/UnixPkg/UnixBlockIoDxe/UnixBlockIo.inf
deleted file mode 100644 (file)
index fbdbdd7..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-## @file\r
-# Block Io driver\r
-#\r
-# Produce block IO abstractions for real devices on your PC using Unix APIs.\r
-#  The configuration of what devices to mount or emulate comes from\r
-#  environment variables.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixBlockIo\r
-  FILE_GUID                      = f3085888-8985-11db-9c93-0040d02b1835\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixBlockIo\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-#  DRIVER_BINDING                =  gUnixBlockIoDriverBinding                    \r
-#  COMPONENT_NAME                =  gUnixBlockIoComponentName                    \r
-#  DRIVER_DIAG                   =  gUnixBlockIoDriverDiagnostics                \r
-#\r
-\r
-[Sources]\r
-  DriverDiagnostics.c\r
-  DriverConfiguration.c\r
-  ComponentName.c\r
-  UnixBlockIo.c\r
-  UnixBlockIo.h\r
-  EntryPoint.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiUnixPhysicalDisksGuid                    # SOMETIMES_CONSUMED\r
-  gEfiUnixVirtualDisksGuid                     # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gEfiBlockIoProtocolGuid                       # PROTOCOL BY_START\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL TO_START\r
-\r
diff --git a/UnixPkg/UnixBusDriverDxe/ComponentName.c b/UnixPkg/UnixBusDriverDxe/ComponentName.c
deleted file mode 100644 (file)
index 432c6d8..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixBusDriver.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-EFI_COMPONENT_NAME_PROTOCOL     gUnixBusDriverComponentName = {\r
-  UnixBusDriverComponentNameGetDriverName,\r
-  UnixBusDriverComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-EFI_UNICODE_STRING_TABLE mUnixBusDriverNameTable[] = {\r
-  { "eng", L"Unix Bus Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language \r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned \r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixBusDriverComponentName.SupportedLanguages,\r
-          mUnixBusDriverNameTable,\r
-          DriverName\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by \r
-                       This is managing.  This handle specifies the controller \r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name \r
-                       of.  This is an optional parameter that may be NULL.  It \r
-                       will be NULL for device drivers.  It will also be NULL \r
-                       for a bus drivers that wish to retrieve the name of the \r
-                       bus controller.  It will not be NULL for a bus driver \r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by \r
-                       ControllerHandle and ChildHandle in the language specified\r
-                       by Language from the point of view of the driver specified\r
-                       by This. \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
-                            language specified by Language for the driver \r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently managing \r
-                            the controller specified by ControllerHandle and \r
-                            ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-  UNIX_IO_DEVICE        *Private;\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gUnixBusDriverBinding.DriverBindingHandle,\r
-             &gEfiUnixThunkProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // This is a bus driver, so ChildHandle can not be NULL.\r
-  //\r
-  if (ChildHandle == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Status = EfiTestChildHandle (\r
-             ControllerHandle,\r
-             ChildHandle,\r
-             &gEfiUnixThunkProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ChildHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID**)&UnixIo,\r
-                  gUnixBusDriverBinding.DriverBindingHandle,\r
-                  ChildHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_IO_DEVICE_FROM_THIS (UnixIo);\r
-\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixBusDriverComponentName.SupportedLanguages,\r
-          Private->ControllerNameTable,\r
-          ControllerName\r
-          );\r
-}\r
diff --git a/UnixPkg/UnixBusDriverDxe/EntryPoint.c b/UnixPkg/UnixBusDriverDxe/EntryPoint.c
deleted file mode 100644 (file)
index b226e29..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**@file\r
-  Entry Point Source file.\r
-\r
-  This file contains the user entry point \r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-   This program and the accompanying materials\r
-   are licensed and made available under the terms and conditions of the BSD License\r
-   which accompanies this distribution. The full text of the license may be found at\r
-   http://opensource.org/licenses/bsd-license.php\r
-   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-**/\r
-\r
-\r
-\r
-#include "UnixBusDriver.h"\r
-\r
-/**\r
-  The user Entry Point for module UnixBusDriver. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixBusDriver(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  Status = EfiLibInstallAllDriverProtocols (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gUnixBusDriverBinding,\r
-             ImageHandle,\r
-             &gUnixBusDriverComponentName,\r
-             NULL,\r
-             NULL\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixBusDriverDxe/UnixBusDriver.c b/UnixPkg/UnixBusDriverDxe/UnixBusDriver.c
deleted file mode 100644 (file)
index e1ec083..0000000
+++ /dev/null
@@ -1,724 +0,0 @@
-/*+++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixBusDriver.c\r
-\r
-Abstract:\r
-\r
-This following section documents the environment variables for the UNIX \r
-build.  These variables are used to define the (virtual) hardware \r
-configuration of the UNIX environment\r
-\r
-A ! can be used to seperate multiple instances in a variable. Each \r
-instance represents a seperate hardware device. \r
-\r
-EFI_UNIX_PHYSICAL_DISKS - maps to drives on your system\r
-EFI_UNIX_VIRTUAL_DISKS  - maps to a device emulated by a file\r
-EFI_UNIX_FILE_SYSTEM    - mouts a directory as a file system\r
-EFI_UNIX_CONSOLE        - make a logical comand line window (only one!)\r
-EFI_UNIX_UGA            - Builds UGA Windows of Width and Height\r
-\r
- <F>ixed       - Fixed disk like a hard drive.\r
- <R>emovable   - Removable media like a floppy or CD-ROM.\r
- Read <O>nly   - Write protected device.\r
- Read <W>rite  - Read write device.\r
- <block count> - Decimal number of blocks a device supports.\r
- <block size>  - Decimal number of bytes per block.\r
-\r
- UNIX envirnonment variable contents. '<' and '>' are not part of the variable, \r
- they are just used to make this help more readable. There should be no \r
- spaces between the ';'. Extra spaces will break the variable. A '!' is  \r
- used to seperate multiple devices in a variable.\r
-\r
- EFI_UNIX_VIRTUAL_DISKS = \r
-   <F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- EFI_UNIX_PHYSICAL_DISKS =\r
-   <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- Virtual Disks: These devices use a file to emulate a hard disk or removable\r
-                media device. \r
-                \r
-   Thus a 20 MB emulated hard drive would look like:\r
-   EFI_UNIX_VIRTUAL_DISKS=FW;40960;512\r
-\r
-   A 1.44MB emulated floppy with a block size of 1024 would look like:\r
-   EFI_UNIX_VIRTUAL_DISKS=RW;1440;1024\r
-\r
- Physical Disks: These devices use UNIX to open a real device in your system\r
-\r
-   Thus a 120 MB floppy would look like:\r
-   EFI_UNIX_PHYSICAL_DISKS=B:RW;245760;512\r
-\r
-   Thus a standard CD-ROM floppy would look like:\r
-   EFI_UNIX_PHYSICAL_DISKS=Z:RO;307200;2048\r
-\r
- EFI_UNIX_FILE_SYSTEM = \r
-   <directory path>[!...]\r
-\r
-   Mounting the two directories C:\FOO and C:\BAR would look like:\r
-   EFI_UNIX_FILE_SYSTEM=c:\foo!c:\bar\r
-\r
- EFI_UNIX_CONSOLE = \r
-   <window title>\r
-\r
-   Declaring a text console window with the title "My EFI Console" woild look like:\r
-   EFI_UNIX_CONSOLE=My EFI Console\r
-\r
- EFI_UNIX_UGA = \r
-   <width> <height>[!...]\r
-\r
-   Declaring a two UGA windows with resolutions of 800x600 and 1024x768 would look like:\r
-   Example : EFI_UNIX_UGA=800 600!1024 768\r
-\r
- EFI_UNIX_PASS_THROUGH =\r
-   <BaseAddress>;<Bus#>;<Device#>;<Function#>\r
-\r
-   Declaring a base address of 0xE0000000 (used for PCI Express devices)\r
-   and having NT32 talk to a device located at bus 0, device 1, function 0:\r
-   Example : EFI_UNIX_PASS_THROUGH=E000000;0;1;0\r
-\r
----*/\r
-\r
-#include "UnixBusDriver.h"\r
-\r
-//\r
-// Define GUID for the Unix Bus Driver\r
-//\r
-EFI_GUID gUnixBusDriverGuid = {\r
-  0x419f582, 0x625, 0x4531, {0x8a, 0x33, 0x85, 0xa9, 0x96, 0x5c, 0x95, 0xbc}\r
-};\r
-\r
-//\r
-// DriverBinding protocol global\r
-//\r
-EFI_DRIVER_BINDING_PROTOCOL           gUnixBusDriverBinding = {\r
-  UnixBusDriverBindingSupported,\r
-  UnixBusDriverBindingStart,\r
-  UnixBusDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-#define UNIX_PCD_ARRAY_SIZE (sizeof(mPcdEnvironment)/sizeof(UNIX_PCD_ENTRY))\r
-\r
-//\r
-// Table to map UNIX Environment variable to the GUID that should be in\r
-// device path.\r
-//\r
-UNIX_PCD_ENTRY  mPcdEnvironment[] = {\r
-  {PcdToken(PcdUnixConsole),           &gEfiUnixConsoleGuid},\r
-  {PcdToken(PcdUnixUga),               &gEfiUnixUgaGuid},\r
-  {PcdToken(PcdUnixGop),               &gEfiUnixGopGuid},\r
-  {PcdToken(PcdUnixFileSystem),        &gEfiUnixFileSystemGuid},\r
-  {PcdToken(PcdUnixSerialPort),        &gEfiUnixSerialPortGuid},\r
-  {PcdToken(PcdUnixVirtualDisk),       &gEfiUnixVirtualDisksGuid},\r
-  {PcdToken(PcdUnixPhysicalDisk),      &gEfiUnixPhysicalDisksGuid},\r
-  {PcdToken(PcdUnixCpuModel),          &gEfiUnixCPUModelGuid},\r
-  {PcdToken(PcdUnixCpuSpeed),          &gEfiUnixCPUSpeedGuid},\r
-  {PcdToken(PcdUnixMemorySize),        &gEfiUnixMemoryGuid},\r
-  {PcdToken(PcdUnixNetworkInterface),  &gEfiUnixNetworkGuid}\r
-};\r
-\r
-VOID *\r
-AllocateMemory (\r
-  IN  UINTN   Size\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-  VOID        *Buffer;\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  Size,\r
-                  (VOID *)&Buffer\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    ASSERT (FALSE);\r
-    return NULL;\r
-  }\r
-  return Buffer;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                Status;\r
-  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
-  EFI_UNIX_THUNK_PROTOCOL *UnixThunk;\r
-  UINTN                     Index;\r
-\r
-  //\r
-  // Check the contents of the first Device Path Node of RemainingDevicePath to make sure\r
-  // it is a legal Device Path Node for this bus driver's children.\r
-  //\r
-  if (RemainingDevicePath != NULL) {\r
-    //\r
-    // Check if RemainingDevicePath is the End of Device Path Node, \r
-    // if yes, go on checking other conditions\r
-    //\r
-    if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath isn't the End of Device Path Node,\r
-      // check its validation\r
-      //\r
-      if (RemainingDevicePath->Type != HARDWARE_DEVICE_PATH ||\r
-          RemainingDevicePath->SubType != HW_VENDOR_DP ||\r
-          DevicePathNodeLength(RemainingDevicePath) != sizeof(UNIX_VENDOR_DEVICE_PATH_NODE)) {\r
-        return EFI_UNSUPPORTED;\r
-      }\r
-  \r
-      for (Index = 0; Index < UNIX_PCD_ARRAY_SIZE; Index++) {\r
-        if (CompareGuid (&((VENDOR_DEVICE_PATH *) RemainingDevicePath)->Guid, mPcdEnvironment[Index].DevicePathGuid)) {\r
-          break;\r
-        }\r
-      }\r
-  \r
-      if (Index >= UNIX_PCD_ARRAY_SIZE) {\r
-        return EFI_UNSUPPORTED;\r
-      }\r
-    }\r
-  }\r
-  \r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixThunkProtocolGuid,\r
-                  (VOID **)&UnixThunk,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        ControllerHandle,\r
-        &gEfiUnixThunkProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle\r
-        );\r
-\r
-  //\r
-  // Open the EFI Device Path protocol needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **)&ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Since we call through UnixThunk we need to make sure it's valid\r
-  //\r
-  Status = EFI_SUCCESS;\r
-  if (UnixThunk->Signature != EFI_UNIX_THUNK_PROTOCOL_SIGNATURE) {\r
-    Status = EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Close protocol, don't use device path protocol in the Support() function\r
-  //\r
-  gBS->CloseProtocol (\r
-        ControllerHandle,\r
-        &gEfiDevicePathProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                      Status;\r
-  EFI_STATUS                      InstallStatus;\r
-  EFI_UNIX_THUNK_PROTOCOL         *UnixThunk;\r
-  EFI_DEVICE_PATH_PROTOCOL        *ParentDevicePath;\r
-  UNIX_BUS_DEVICE                 *UnixBusDevice;\r
-  UNIX_IO_DEVICE                  *UnixDevice;\r
-  UINTN                           Index;\r
-  CHAR16                          *StartString;\r
-  CHAR16                          *SubString;\r
-  UINT16                          Count;\r
-  UINTN                           StringSize;\r
-  UINT16                          ComponentName[MAX_UNIX_ENVIRNMENT_VARIABLE_LENGTH];\r
-  UNIX_VENDOR_DEVICE_PATH_NODE  *Node;\r
-  BOOLEAN                         CreateDevice;\r
-  CHAR16                          *TempStr;\r
-  CHAR16                          *PcdTempStr;\r
-  UINTN                           TempStrSize;\r
-\r
-  Status = EFI_UNSUPPORTED;\r
-\r
-  //\r
-  // Grab the protocols we need\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **)&ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    return Status;\r
-  }\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixThunkProtocolGuid,\r
-                  (VOID **)&UnixThunk,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    return Status;\r
-  }\r
-\r
-  if (Status != EFI_ALREADY_STARTED) {\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    sizeof (UNIX_BUS_DEVICE),\r
-                    (VOID *) &UnixBusDevice\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    UnixBusDevice->Signature           = UNIX_BUS_DEVICE_SIGNATURE;\r
-    UnixBusDevice->ControllerNameTable = NULL;\r
-\r
-    AddUnicodeString (\r
-      "eng",\r
-      gUnixBusDriverComponentName.SupportedLanguages,\r
-      &UnixBusDevice->ControllerNameTable,\r
-      L"Unix Bus Controller"\r
-      );\r
-\r
-    Status = gBS->InstallMultipleProtocolInterfaces (\r
-                    &ControllerHandle,\r
-                    &gUnixBusDriverGuid,\r
-                    UnixBusDevice,\r
-                    NULL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      FreeUnicodeStringTable (UnixBusDevice->ControllerNameTable);\r
-      gBS->FreePool (UnixBusDevice);\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Loop on the Variable list. Parse each variable to produce a set of handles that\r
-  // represent virtual hardware devices.\r
-  //\r
-  InstallStatus   = EFI_NOT_FOUND;\r
-  for (Index = 0; Index < UNIX_PCD_ARRAY_SIZE; Index++) {\r
-    PcdTempStr = (VOID *)LibPcdGetPtr (mPcdEnvironment[Index].Token);\r
-    ASSERT (PcdTempStr != NULL);\r
-\r
-    TempStrSize = StrLen (PcdTempStr);\r
-    TempStr = AllocateMemory ((TempStrSize * sizeof (CHAR16)) + 1);\r
-    StrCpy (TempStr, PcdTempStr);\r
-\r
-    StartString = TempStr;\r
-\r
-    //\r
-    // Parse the environment variable into sub strings using '!' as a delimator.\r
-    // Each substring needs it's own handle to be added to the system. This code\r
-    // does not understand the sub string. Thats the device drivers job.\r
-    //\r
-    Count = 0;\r
-    while (*StartString != '\0') {\r
-\r
-      //\r
-      // Find the end of the sub string\r
-      //\r
-      SubString = StartString;\r
-      while (*SubString != '\0' && *SubString != '!') {\r
-        SubString++;\r
-      }\r
-\r
-      if (*SubString == '!') {\r
-        //\r
-        // Replace token with '\0' to make sub strings. If this is the end\r
-        //  of the string SubString will already point to NULL.\r
-        //\r
-        *SubString = '\0';\r
-        SubString++;\r
-      }\r
-\r
-      CreateDevice = TRUE;\r
-      if (RemainingDevicePath != NULL) {\r
-        CreateDevice  = FALSE;\r
-        //\r
-        // Check if RemainingDevicePath is the End of Device Path Node, \r
-        // if yes, don't create any child device \r
-        //\r
-        if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-          //\r
-          // If RemainingDevicePath isn't the End of Device Path Node,\r
-          // check its validation\r
-          //\r
-          Node          = (UNIX_VENDOR_DEVICE_PATH_NODE *) RemainingDevicePath;\r
-          if (Node->VendorDevicePath.Header.Type == HARDWARE_DEVICE_PATH &&\r
-              Node->VendorDevicePath.Header.SubType == HW_VENDOR_DP &&\r
-              DevicePathNodeLength (&Node->VendorDevicePath.Header) == sizeof (UNIX_VENDOR_DEVICE_PATH_NODE)\r
-              ) {\r
-            if (CompareGuid (&Node->VendorDevicePath.Guid, mPcdEnvironment[Index].DevicePathGuid) &&\r
-                Node->Instance == Count\r
-                ) {\r
-              CreateDevice = TRUE;\r
-            }\r
-          }\r
-        }\r
-      }\r
-\r
-      if (CreateDevice) {\r
-        //\r
-        // Allocate instance structure, and fill in parent information.\r
-        //\r
-        UnixDevice = AllocateMemory (sizeof (UNIX_IO_DEVICE));\r
-        if (UnixDevice == NULL) {\r
-          return EFI_OUT_OF_RESOURCES;\r
-        }\r
-\r
-        UnixDevice->Handle             = NULL;\r
-        UnixDevice->ControllerHandle   = ControllerHandle;\r
-        UnixDevice->ParentDevicePath   = ParentDevicePath;\r
-\r
-        UnixDevice->UnixIo.UnixThunk   = UnixThunk;\r
-\r
-        //\r
-        // Plus 2 to account for the NULL at the end of the Unicode string\r
-        //\r
-        StringSize = (UINTN) ((UINT8 *) SubString - (UINT8 *) StartString) + sizeof (CHAR16);\r
-        UnixDevice->UnixIo.EnvString = AllocateMemory (StringSize);\r
-        if (UnixDevice->UnixIo.EnvString != NULL) {\r
-          CopyMem (UnixDevice->UnixIo.EnvString, StartString, StringSize);\r
-        }\r
-\r
-        UnixDevice->ControllerNameTable = NULL;\r
-\r
-  //  FIXME: check size\r
-        StrCpy(ComponentName, UnixDevice->UnixIo.EnvString);\r
-\r
-        UnixDevice->DevicePath = UnixBusCreateDevicePath (\r
-                                    ParentDevicePath,\r
-                                    mPcdEnvironment[Index].DevicePathGuid,\r
-                                    Count\r
-                                    );\r
-        if (UnixDevice->DevicePath == NULL) {\r
-          gBS->FreePool (UnixDevice);\r
-          return EFI_OUT_OF_RESOURCES;\r
-        }\r
-\r
-        AddUnicodeString (\r
-          "eng",\r
-          gUnixBusDriverComponentName.SupportedLanguages,\r
-          &UnixDevice->ControllerNameTable,\r
-          ComponentName\r
-          );\r
-\r
-        UnixDevice->UnixIo.TypeGuid       = mPcdEnvironment[Index].DevicePathGuid;\r
-        UnixDevice->UnixIo.InstanceNumber = Count;\r
-\r
-        UnixDevice->Signature              = UNIX_IO_DEVICE_SIGNATURE;\r
-\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &UnixDevice->Handle,\r
-                        &gEfiDevicePathProtocolGuid,\r
-                        UnixDevice->DevicePath,\r
-                        &gEfiUnixIoProtocolGuid,\r
-                        &UnixDevice->UnixIo,\r
-                        NULL\r
-                        );\r
-        if (EFI_ERROR (Status)) {\r
-          FreeUnicodeStringTable (UnixDevice->ControllerNameTable);\r
-          gBS->FreePool (UnixDevice);\r
-        } else {\r
-          //\r
-          // Open For Child Device\r
-          //\r
-          Status = gBS->OpenProtocol (\r
-                          ControllerHandle,\r
-                          &gEfiUnixThunkProtocolGuid,\r
-                          (VOID **)&UnixThunk,\r
-                          This->DriverBindingHandle,\r
-                          UnixDevice->Handle,\r
-                          EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-                          );\r
-          if (!EFI_ERROR (Status)) {\r
-            InstallStatus = EFI_SUCCESS;\r
-          }\r
-        }\r
-      }\r
-\r
-      //\r
-      // Parse Next sub string. This will point to '\0' if we are at the end.\r
-      //\r
-      Count++;\r
-      StartString = SubString;\r
-    }\r
-\r
-    gBS->FreePool (TempStr);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-    None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                Status;\r
-  UINTN                     Index;\r
-  BOOLEAN                   AllChildrenStopped;\r
-  EFI_UNIX_IO_PROTOCOL    *UnixIo;\r
-  UNIX_BUS_DEVICE         *UnixBusDevice;\r
-  UNIX_IO_DEVICE          *UnixDevice;\r
-  EFI_UNIX_THUNK_PROTOCOL *UnixThunk;\r
-\r
-  //\r
-  // Complete all outstanding transactions to Controller.\r
-  // Don't allow any new transaction to Controller to be started.\r
-  //\r
-\r
-  if (NumberOfChildren == 0) {\r
-    //\r
-    // Close the bus driver\r
-    //\r
-    Status = gBS->OpenProtocol (\r
-                    ControllerHandle,\r
-                    &gUnixBusDriverGuid,\r
-                    (VOID **)&UnixBusDevice,\r
-                    This->DriverBindingHandle,\r
-                    ControllerHandle,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    gBS->UninstallMultipleProtocolInterfaces (\r
-          ControllerHandle,\r
-          &gUnixBusDriverGuid,\r
-          UnixBusDevice,\r
-          NULL\r
-          );\r
-\r
-    FreeUnicodeStringTable (UnixBusDevice->ControllerNameTable);\r
-\r
-    gBS->FreePool (UnixBusDevice);\r
-\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixThunkProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiDevicePathProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  AllChildrenStopped = TRUE;\r
-\r
-  for (Index = 0; Index < NumberOfChildren; Index++) {\r
-\r
-    Status = gBS->OpenProtocol (\r
-                    ChildHandleBuffer[Index],\r
-                    &gEfiUnixIoProtocolGuid,\r
-                    (VOID **)&UnixIo,\r
-                    This->DriverBindingHandle,\r
-                    ControllerHandle,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-    if (!EFI_ERROR (Status)) {\r
-\r
-      UnixDevice = UNIX_IO_DEVICE_FROM_THIS (UnixIo);\r
-\r
-      Status = gBS->CloseProtocol (\r
-                      ControllerHandle,\r
-                      &gEfiUnixThunkProtocolGuid,\r
-                      This->DriverBindingHandle,\r
-                      UnixDevice->Handle\r
-                      );\r
-\r
-      Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                      UnixDevice->Handle,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      UnixDevice->DevicePath,\r
-                      &gEfiUnixIoProtocolGuid,\r
-                      &UnixDevice->UnixIo,\r
-                      NULL\r
-                      );\r
-\r
-      if (EFI_ERROR (Status)) {\r
-        gBS->OpenProtocol (\r
-              ControllerHandle,\r
-              &gEfiUnixThunkProtocolGuid,\r
-              (VOID **) &UnixThunk,\r
-              This->DriverBindingHandle,\r
-              UnixDevice->Handle,\r
-              EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-              );\r
-      } else {\r
-        //\r
-        // Close the child handle\r
-        //\r
-        FreeUnicodeStringTable (UnixDevice->ControllerNameTable);\r
-        gBS->FreePool (UnixDevice);\r
-      }\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      AllChildrenStopped = FALSE;\r
-    }\r
-  }\r
-\r
-  if (!AllChildrenStopped) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-UnixBusCreateDevicePath (\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  *RootDevicePath,\r
-  IN  EFI_GUID                  *Guid,\r
-  IN  UINT16                    InstanceNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Create a device path node using Guid and InstanceNumber and append it to\r
-  the passed in RootDevicePath\r
-\r
-Arguments:\r
-  RootDevicePath - Root of the device path to return.\r
-\r
-  Guid           - GUID to use in vendor device path node.\r
-\r
-  InstanceNumber - Instance number to use in the vendor device path. This\r
-                    argument is needed to make sure each device path is unique.\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_PATH_PROTOCOL \r
-\r
---*/\r
-{\r
-  UNIX_VENDOR_DEVICE_PATH_NODE  DevicePath;\r
-\r
-  DevicePath.VendorDevicePath.Header.Type     = HARDWARE_DEVICE_PATH;\r
-  DevicePath.VendorDevicePath.Header.SubType  = HW_VENDOR_DP;\r
-  SetDevicePathNodeLength (&DevicePath.VendorDevicePath.Header, sizeof (UNIX_VENDOR_DEVICE_PATH_NODE));\r
-\r
-  //\r
-  // The GUID defines the Class\r
-  //\r
-  CopyMem (&DevicePath.VendorDevicePath.Guid, Guid, sizeof (EFI_GUID));\r
-\r
-  //\r
-  // Add an instance number so we can make sure there are no Device Path\r
-  // duplication.\r
-  //\r
-  DevicePath.Instance = InstanceNumber;\r
-\r
-  return AppendDevicePathNode (\r
-          RootDevicePath,\r
-          (EFI_DEVICE_PATH_PROTOCOL *) &DevicePath\r
-          );\r
-}\r
diff --git a/UnixPkg/UnixBusDriverDxe/UnixBusDriver.h b/UnixPkg/UnixBusDriverDxe/UnixBusDriver.h
deleted file mode 100644 (file)
index bf3f6f9..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixBusDriver.h\r
-\r
-Abstract:\r
-\r
-This following section documents the PCD for the Unix \r
-build.  These variables are used to define the (virtual) hardware \r
-configuration of the Unix environment\r
-\r
-A ! can be used to seperate multiple instances in a variable. Each \r
-instance represents a seperate hardware device. \r
-\r
-EFI_UNIX_PHYSICAL_DISKS - maps to drives on your system\r
-EFI_UNIX_VIRTUAL_DISKS  - maps to a device emulated by a file\r
-EFI_UNIX_FILE_SYSTEM    - mouts a directory as a file system\r
-EFI_UNIX_CONSOLE        - make a logical comand line window (only one!)\r
-EFI_UNIX_UGA            - Builds UGA Windows of Width and Height\r
-EFI_UNIX_SERIAL_PORT    - maps physical serial ports\r
-EFI_UNIX_PASS_THRU      - associates a device with our PCI support\r
-\r
- <F>ixed       - Fixed disk like a hard drive.\r
- <R>emovable   - Removable media like a floppy or CD-ROM.\r
- Read <O>nly   - Write protected device.\r
- Read <W>rite  - Read write device.\r
- <block count> - Decimal number of blocks a device supports.\r
- <block size>  - Decimal number of bytes per block.\r
-\r
- UNIX envirnonment variable contents. '<' and '>' are not part of the variable, \r
- they are just used to make this help more readable. There should be no \r
- spaces between the ';'. Extra spaces will break the variable. A '!' is  \r
- used to seperate multiple devices in a variable.\r
-\r
- EFI_UNIX_VIRTUAL_DISKS = \r
-   <F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- EFI_UNIX_PHYSICAL_DISKS =\r
-   <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]\r
-\r
- Virtual Disks: These devices use a file to emulate a hard disk or removable\r
-                media device. \r
-                \r
-   Thus a 20 MB emulated hard drive would look like:\r
-   EFI_UNIX_VIRTUAL_DISKS=FW;40960;512\r
-\r
-   A 1.44MB emulated floppy with a block size of 1024 would look like:\r
-   EFI_UNIX_VIRTUAL_DISKS=RW;1440;1024\r
-\r
- Physical Disks: These devices use UNIX to open a real device in your system\r
-\r
-   Thus a 120 MB floppy would look like:\r
-   EFI_UNIX_PHYSICAL_DISKS=B:RW;245760;512\r
-\r
-   Thus a standard CD-ROM floppy would look like:\r
-   EFI_UNIX_PHYSICAL_DISKS=Z:RO;307200;2048\r
-\r
- EFI_UNIX_FILE_SYSTEM = \r
-   <directory path>[!...]\r
-\r
-   Mounting the two directories C:\FOO and C:\BAR would look like:\r
-   EFI_UNIX_FILE_SYSTEM=c:\foo!c:\bar\r
-\r
- EFI_UNIX_CONSOLE = \r
-   <window title>\r
-\r
-   Declaring a text console window with the title "My EFI Console" woild look like:\r
-   EFI_UNIX_CONSOLE=My EFI Console\r
-\r
- EFI_UNIX_UGA = \r
-   <width> <height>[!...]\r
-\r
-   Declaring a two UGA windows with resolutions of 800x600 and 1024x768 would look like:\r
-   Example : EFI_UNIX_UGA=800 600!1024 768\r
-\r
- EFI_UNIX_SERIAL_PORT = \r
-   <port name>[!...]\r
-\r
-   Declaring two serial ports on COM1 and COM2 would look like:\r
-   Example : EFI_UNIX_SERIAL_PORT=COM1!COM2\r
-\r
- EFI_UNIX_PASS_THROUGH =\r
-   <BaseAddress>;<Bus#>;<Device#>;<Function#>\r
-\r
-   Declaring a base address of 0xE0000000 (used for PCI Express devices)\r
-   and having NT32 talk to a device located at bus 0, device 1, function 0:\r
-   Example : EFI_UNIX_PASS_THROUGH=E000000;0;1;0\r
-\r
----*/\r
-\r
-#ifndef __UNIX_BUS_DRIVER_H__\r
-#define __UNIX_BUS_DRIVER_H__\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include <Protocol/Pcd.h>\r
-#include <Protocol/DevicePath.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixBusDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixBusDriverComponentName;\r
-\r
-//\r
-// Unix Bus Driver Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gUnixBusDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gUnixBusDriverComponentName;\r
-\r
-//\r
-// Unix Bus Controller Structure\r
-//\r
-#define UNIX_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('L', 'X', 'B', 'D')\r
-\r
-typedef struct {\r
-  UINT64                    Signature;\r
-  EFI_UNICODE_STRING_TABLE  *ControllerNameTable;\r
-} UNIX_BUS_DEVICE;\r
-\r
-//\r
-// Unix Child Device Controller Structure\r
-//\r
-#define UNIX_IO_DEVICE_SIGNATURE  SIGNATURE_32 ('L', 'X', 'V', 'D')\r
-\r
-typedef struct {\r
-  UINT64                    Signature;\r
-  EFI_HANDLE                Handle;\r
-  EFI_UNIX_IO_PROTOCOL     UnixIo;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-\r
-  //\r
-  // Private data about the parent\r
-  //\r
-  EFI_HANDLE                ControllerHandle;\r
-  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
-\r
-  EFI_UNICODE_STRING_TABLE  *ControllerNameTable;\r
-\r
-} UNIX_IO_DEVICE;\r
-\r
-#define UNIX_IO_DEVICE_FROM_THIS(a) \\r
-  CR(a, UNIX_IO_DEVICE, UnixIo, UNIX_IO_DEVICE_SIGNATURE)\r
-\r
-//\r
-// This is the largest env variable we can parse\r
-//\r
-#define MAX_UNIX_ENVIRNMENT_VARIABLE_LENGTH 512\r
-\r
-typedef struct {\r
-  UINTN               Token;\r
-  EFI_GUID            *DevicePathGuid;\r
-} UNIX_PCD_ENTRY;\r
-\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH  VendorDevicePath;\r
-  UINT32              Instance;\r
-} UNIX_VENDOR_DEVICE_PATH_NODE;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuIoInitialize (\r
-  IN EFI_HANDLE                            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Driver Binding Protocol function prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     Handle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL    *This,\r
-  IN EFI_HANDLE                     ParentHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  ParentHandle        - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBusDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Unix Bus Driver private worker functions\r
-//\r
-EFI_DEVICE_PATH_PROTOCOL  *\r
-UnixBusCreateDevicePath (\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  *RootDevicePath,\r
-  IN  EFI_GUID                  *Guid,\r
-  IN  UINT16                    InstanceNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  RootDevicePath  - TODO: add argument description\r
-  Guid            - TODO: add argument description\r
-  InstanceNumber  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-\r
-#endif\r
diff --git a/UnixPkg/UnixBusDriverDxe/UnixBusDriver.inf b/UnixPkg/UnixBusDriverDxe/UnixBusDriver.inf
deleted file mode 100644 (file)
index b5eb940..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-## @file\r
-# Unix Bus driver\r
-#\r
-# This following section documents the envirnoment variables for the Win NT\r
-#  build. These variables are used to define the (virtual) hardware\r
-#  configuration of the NT environment\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixBusDriver\r
-  FILE_GUID                      = f320d656-8985-11db-90e0-0040d02b1835\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixBusDriver\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-#  DRIVER_BINDING                =  gUnixBusDriverBinding                        \r
-#  COMPONENT_NAME                =  gUnixBusDriverComponentName                  \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  UnixBusDriver.c\r
-  UnixBusDriver.h\r
-  EntryPoint.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  DevicePathLib\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  PcdLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiUnixConsoleGuid                          # ALWAYS_CONSUMED\r
-  gEfiUnixUgaGuid                              # ALWAYS_CONSUMED\r
-  gEfiUnixGopGuid                              # ALWAYS_CONSUMED\r
-  gEfiUnixSerialPortGuid                       # ALWAYS_CONSUMED\r
-  gEfiUnixFileSystemGuid                       # ALWAYS_CONSUMED\r
-  gEfiUnixPhysicalDisksGuid                    # ALWAYS_CONSUMED\r
-  gEfiUnixVirtualDisksGuid                     # ALWAYS_CONSUMED\r
-  gEfiUnixCPUModelGuid\r
-  gEfiUnixCPUSpeedGuid\r
-  gEfiUnixMemoryGuid\r
-  gEfiUnixNetworkGuid\r
-\r
-\r
-[Protocols]\r
-  gPcdProtocolGuid                              # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL TO_START\r
-  gEfiUnixThunkProtocolGuid                     # PROTOCOL TO_START\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL BY_START\r
-\r
-\r
-[Pcd]\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixSerialPort\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySize\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuSpeed\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuModel\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixPhysicalDisk\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixVirtualDisk\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFileSystem\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixUga\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixGop\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixConsole\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixNetworkInterface\r
-\r
diff --git a/UnixPkg/UnixConsoleDxe/ComponentName.c b/UnixPkg/UnixConsoleDxe/ComponentName.c
deleted file mode 100644 (file)
index f9bd509..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "Console.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-EFI_COMPONENT_NAME_PROTOCOL     gUnixConsoleComponentName = {\r
-  UnixConsoleComponentNameGetDriverName,\r
-  UnixConsoleComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-EFI_UNICODE_STRING_TABLE mUnixConsoleDriverNameTable[] = {\r
-  { "eng", L"Unix Text Console Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language \r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned \r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixConsoleComponentName.SupportedLanguages,\r
-          mUnixConsoleDriverNameTable,\r
-          DriverName\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by \r
-                       This is managing.  This handle specifies the controller \r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name \r
-                       of.  This is an optional parameter that may be NULL.  It \r
-                       will be NULL for device drivers.  It will also be NULL \r
-                       for a bus drivers that wish to retrieve the name of the \r
-                       bus controller.  It will not be NULL for a bus driver \r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by \r
-                       ControllerHandle and ChildHandle in the language specified\r
-                       by Language from the point of view of the driver specified\r
-                       by This. \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
-                            language specified by Language for the driver \r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently managing \r
-                            the controller specified by ControllerHandle and \r
-                            ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                      Status;\r
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *SimpleTextOut;\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gUnixConsoleDriverBinding.DriverBindingHandle,\r
-             &gEfiUnixIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get out context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiSimpleTextOutProtocolGuid,\r
-                  (void *)&SimpleTextOut,\r
-                  gUnixConsoleDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (SimpleTextOut);\r
-\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixConsoleComponentName.SupportedLanguages,\r
-          Private->ControllerNameTable,\r
-          ControllerName\r
-          );\r
-}\r
diff --git a/UnixPkg/UnixConsoleDxe/Console.c b/UnixPkg/UnixConsoleDxe/Console.c
deleted file mode 100644 (file)
index d96646c..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2005, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  Console.c\r
-\r
-Abstract:\r
-\r
-  Console based on Posix APIs. \r
-\r
---*/\r
-\r
-#include "Console.h"\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  );\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gUnixConsoleDriverBinding = {\r
-  UnixConsoleDriverBindingSupported,\r
-  UnixConsoleDriverBindingStart,\r
-  UnixConsoleDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Make sure that the Unix Thunk Protocol is valid\r
-  //\r
-  Status = EFI_UNSUPPORTED;\r
-  if (UnixIo->UnixThunk->Signature == EFI_UNIX_THUNK_PROTOCOL_SIGNATURE) {\r
-\r
-    //\r
-    // Check the GUID to see if this is a handle type the driver supports\r
-    //\r
-    if (CompareGuid (UnixIo->TypeGuid, &gEfiUnixConsoleGuid)) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS                      Status;\r
-  EFI_UNIX_IO_PROTOCOL          *UnixIo;\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  //\r
-  // Grab the IO abstraction we need to get any work done\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (UNIX_SIMPLE_TEXT_PRIVATE_DATA),\r
-                  (void *)&Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  ZeroMem (Private, sizeof (UNIX_SIMPLE_TEXT_PRIVATE_DATA));\r
-\r
-  Private->Signature  = UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE;\r
-  Private->Handle     = Handle;\r
-  Private->UnixIo    = UnixIo;\r
-  Private->UnixThunk = UnixIo->UnixThunk;\r
-\r
-  UnixSimpleTextOutOpenWindow (Private);\r
-  UnixSimpleTextInAttachToWindow (Private);\r
-\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Handle,\r
-                  &gEfiSimpleTextOutProtocolGuid,\r
-                  &Private->SimpleTextOut,\r
-                  &gEfiSimpleTextInProtocolGuid,\r
-                  &Private->SimpleTextIn,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-Done:\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-  if (Private != NULL) {\r
-\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-#if 0\r
-    if (Private->NtOutHandle != NULL) {\r
-      Private->UnixThunk->CloseHandle (Private->NtOutHandle);\r
-    }\r
-#endif\r
-\r
-    if (Private->SimpleTextIn.WaitForKey != NULL) {\r
-      gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
-    }\r
-\r
-    gBS->FreePool (Private);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixConsoleDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_UNSUPPORTED - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *SimpleTextOut;\r
-  EFI_STATUS                      Status;\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  //\r
-  // Kick people off our interface???\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiSimpleTextOutProtocolGuid,\r
-                  (void *)&SimpleTextOut,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (SimpleTextOut);\r
-\r
-  ASSERT (Private->Handle == Handle);\r
-\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  Handle,\r
-                  &gEfiSimpleTextOutProtocolGuid,\r
-                  &Private->SimpleTextOut,\r
-                  &gEfiSimpleTextInProtocolGuid,\r
-                  &Private->SimpleTextIn,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-\r
-    //\r
-    // Shut down our device\r
-    //\r
-    Status = gBS->CloseProtocol (\r
-                    Handle,\r
-                    &gEfiUnixIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Handle\r
-                    );\r
-\r
-    Status = gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
-    ASSERT_EFI_ERROR (Status);\r
-\r
-#if 0\r
-    Private->UnixThunk->CloseHandle (Private->NtOutHandle);\r
-#endif\r
-    //\r
-    // DO NOT close Private->NtInHandle. It points to StdIn and not\r
-    //  the Private->NtOutHandle is StdIn and should not be closed!\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-    gBS->FreePool (Private);\r
-  }\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixConsoleDxe/Console.h b/UnixPkg/UnixConsoleDxe/Console.h
deleted file mode 100644 (file)
index dd80a63..0000000
+++ /dev/null
@@ -1,519 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  Console.h\r
-\r
-Abstract:\r
-\r
-  Console based on Posix APIs.\r
-\r
-  This file attaches a SimpleTextIn protocol to a previously open window.\r
-  \r
-  The constructor for this protocol depends on an open window. Currently\r
-  the SimpleTextOut protocol creates a window when it's constructor is called.\r
-  Thus this code must run after the constructor for the SimpleTextOut \r
-  protocol\r
-  \r
---*/\r
-\r
-#ifndef _CONSOLE_H_\r
-#define _CONSOLE_H_\r
-\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include <Protocol/UnixIo.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Protocol/SimpleTextOut.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixConsoleDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixConsoleComponentName;\r
-\r
-#define UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE \\r
-          SIGNATURE_32('U','X','s','c')\r
-\r
-typedef struct {\r
-  UINT64                        Signature;\r
-\r
-  EFI_HANDLE                    Handle;\r
-\r
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  SimpleTextOut;\r
-  EFI_SIMPLE_TEXT_OUTPUT_MODE   SimpleTextOutMode;\r
-\r
-  EFI_UNIX_IO_PROTOCOL        *UnixIo;\r
-  EFI_UNIX_THUNK_PROTOCOL     *UnixThunk;\r
-\r
-  //\r
-  // SimpleTextOut Private Data including Posix types.\r
-  //\r
-  //  HANDLE                        NtOutHandle;\r
-  //  HANDLE                        NtInHandle;\r
-\r
-  //COORD                         MaxScreenSize;\r
-  //COORD                         Position;\r
-  //WORD                          Attribute;\r
-  BOOLEAN                       CursorEnable;\r
-\r
-  EFI_SIMPLE_TEXT_INPUT_PROTOCOL   SimpleTextIn;\r
-\r
-  EFI_UNICODE_STRING_TABLE      *ControllerNameTable;\r
-\r
-} UNIX_SIMPLE_TEXT_PRIVATE_DATA;\r
-\r
-#define UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS(a) \\r
-         CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextOut, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)\r
-\r
-#define UNIX_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS(a) \\r
-         CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextIn, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)\r
-\r
-//\r
-// Console Globale Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gUnixConsoleDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gUnixConsoleComponentName;\r
-\r
-typedef struct {\r
-  UINTN ColumnsX;\r
-  UINTN RowsY;\r
-} UNIX_SIMPLE_TEXT_OUT_MODE;\r
-\r
-#if 0\r
-//\r
-// Simple Text Out protocol member functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutReset (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL     *This,\r
-  IN BOOLEAN                          ExtendedVerification\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                  - TODO: add argument description\r
-  ExtendedVerification  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutOutputString (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN CHAR16                         *String\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  String  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutTestString (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN CHAR16                         *String\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  String  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutQueryMode (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN UINTN                          ModeNumber,\r
-  OUT UINTN                         *Columns,\r
-  OUT UINTN                         *Rows\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  ModeNumber  - TODO: add argument description\r
-  Columns     - TODO: add argument description\r
-  Rows        - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetMode (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN UINTN                          ModeNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  ModeNumber  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetAttribute (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN UINTN                          Attribute\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This      - TODO: add argument description\r
-  Attribute - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutClearScreen (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetCursorPosition (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN UINTN                          Column,\r
-  IN UINTN                          Row\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Column  - TODO: add argument description\r
-  Row     - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutEnableCursor (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN BOOLEAN                        Enable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Enable  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
-//\r
-// Simple Text Out constructor and destructor.\r
-//\r
-EFI_STATUS\r
-UnixSimpleTextOutOpenWindow (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-UnixSimpleTextOutCloseWindow (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Console - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#if 0\r
-//\r
-// Simple Text In protocol member functions.\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextInReset (\r
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,\r
-  IN BOOLEAN                              ExtendedVerification\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                  - TODO: add argument description\r
-  ExtendedVerification  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextInReadKeyStroke (\r
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,\r
-  OUT EFI_INPUT_KEY                       *Key\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-  Key   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EFIAPI\r
-UnixSimpleTextInWaitForKey (\r
-  IN EFI_EVENT          Event,\r
-  IN VOID               *Context\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Event   - TODO: add argument description\r
-  Context - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
-//\r
-// Simple Text In constructor\r
-//\r
-EFI_STATUS\r
-UnixSimpleTextInAttachToWindow (\r
-  IN  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Main Entry Point\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixConsole (\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-AppendDevicePathInstanceToVar (\r
-  IN  CHAR16                    *VariableName,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  *DevicePathInstance\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  VariableName        - TODO: add argument description\r
-  DevicePathInstance  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/UnixPkg/UnixConsoleDxe/ConsoleIn.c b/UnixPkg/UnixConsoleDxe/ConsoleIn.c
deleted file mode 100644 (file)
index 08100bc..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  ConsoleIn.c\r
-\r
-Abstract:\r
-\r
-  Console based on Posix APIs.\r
-\r
-  This file attaches a SimpleTextIn protocol to a previously open window.\r
-\r
-  The constructor for this protocol depends on an open window. Currently\r
-  the SimpleTextOut protocol creates a window when it's constructor is called.\r
-  Thus this code must run after the constructor for the SimpleTextOut\r
-  protocol\r
-\r
---*/\r
-\r
-#include "Console.h"\r
-#include <sys/poll.h>\r
-\r
-//\r
-// Private worker functions\r
-//\r
-EFI_STATUS\r
-UnixSimpleTextInCheckKey (\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA  *Private\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextInReset (\r
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,\r
-  IN BOOLEAN                              ExtendedVerification\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                  - TODO: add argument description\r
-  ExtendedVerification  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS (This);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-UnixConvertInputRecordToEfiKey (\r
-  IN  char c,\r
-  OUT EFI_INPUT_KEY   *Key\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  InputRecord - TODO: add argument description\r
-  Key         - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_NOT_READY - TODO: Add description for return value\r
-  EFI_NOT_READY - TODO: Add description for return value\r
-  EFI_NOT_READY - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  Key->ScanCode     = 0;\r
-  if (c == '\n')\r
-    c = '\r';\r
-  Key->UnicodeChar  = c;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextInReadKeyStroke (\r
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,\r
-  OUT EFI_INPUT_KEY                       *Key\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-  Key   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_NOT_READY - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_STATUS                      Status;\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-  char c;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Status  = UnixSimpleTextInCheckKey (Private);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (Private->UnixThunk->Read (0, &c, 1) != 1)\r
-    return EFI_NOT_READY;\r
-  Status = UnixConvertInputRecordToEfiKey (c, Key);\r
-\r
-  return Status;\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-UnixSimpleTextInWaitForKey (\r
-  IN EFI_EVENT          Event,\r
-  IN VOID               *Context\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Event   - TODO: add argument description\r
-  Context - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-  EFI_STATUS                      Status;\r
-\r
-  Private = (UNIX_SIMPLE_TEXT_PRIVATE_DATA *) Context;\r
-  Status  = UnixSimpleTextInCheckKey (Private);\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->SignalEvent (Event);\r
-  }\r
-}\r
-\r
-EFI_STATUS\r
-UnixSimpleTextInCheckKey (\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA   *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  struct pollfd pfd;\r
-\r
-  pfd.fd = 0;\r
-  pfd.events = POLLIN;\r
-  if (Private->UnixThunk->Poll (&pfd, 1, 0) <= 0) {\r
-    return EFI_NOT_READY;\r
-  }\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-UnixSimpleTextInAttachToWindow (\r
-  IN  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  Private->SimpleTextIn.Reset         = UnixSimpleTextInReset;\r
-  Private->SimpleTextIn.ReadKeyStroke = UnixSimpleTextInReadKeyStroke;\r
-\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_WAIT,\r
-                  TPL_NOTIFY,\r
-                  UnixSimpleTextInWaitForKey,\r
-                  Private,\r
-                  &Private->SimpleTextIn.WaitForKey\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixConsoleDxe/ConsoleOut.c b/UnixPkg/UnixConsoleDxe/ConsoleOut.c
deleted file mode 100644 (file)
index 0244e0b..0000000
+++ /dev/null
@@ -1,620 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ConsoleOut.c\r
-\r
-Abstract:\r
-\r
-  Console based on Posix APIs. \r
-\r
-  This file creates an Posix window and attaches a SimpleTextOut protocol.\r
-\r
---*/\r
-\r
-#include "Console.h"\r
-//\r
-// Private worker functions.\r
-//\r
-\r
-#if 0\r
-VOID\r
-UnixSimpleTextOutScrollScreen (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console\r
-  );\r
-\r
-#endif\r
-VOID\r
-UnixSimpleTextOutPutChar (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA     *Console,\r
-  IN      CHAR16                              Char\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetAttribute (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN UINTN                          Attribute\r
-  );\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetMode (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL           *This,\r
-  IN UINTN                                  ModeNumber\r
-  );\r
-\r
-//\r
-// Modeule Global for Simple Text Out Mode.\r
-//\r
-#define MAX_SIMPLE_TEXT_OUT_MODE  \\r
-        (sizeof(mUnixSimpleTextOutSupportedModes)/sizeof(UNIX_SIMPLE_TEXT_OUT_MODE))\r
-\r
-UNIX_SIMPLE_TEXT_OUT_MODE  mUnixSimpleTextOutSupportedModes[] = {\r
-  { 80, 25 },         \r
-#if 0\r
-  { 80, 50 },         \r
-  { 80, 43 },         \r
-  { 100, 100 },       \r
-  { 100, 999 }         \r
-#endif\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutReset (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL         *This,\r
-  IN BOOLEAN                              ExtendedVerification\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                  - TODO: add argument description\r
-  ExtendedVerification  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  UnixSimpleTextOutSetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));\r
-\r
-  UnixSimpleTextOutSetMode (This, 0);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutOutputString (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL           *This,\r
-  IN CHAR16                                 *String\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  String  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-  CHAR16                          *Str;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  for (Str = String; *Str != '\0'; Str++) {\r
-    switch (*Str) {\r
-#if 0\r
-    case '\n':\r
-      if (Private->Position.Y == (Private->MaxScreenSize.Y - 1)) {\r
-        UnixSimpleTextOutScrollScreen (Private);\r
-      }\r
-\r
-      if (Private->Position.Y < (Private->MaxScreenSize.Y - 1)) {\r
-        Private->Position.Y++;\r
-        This->Mode->CursorRow++;\r
-      }\r
-      break;\r
-\r
-    case '\r':\r
-      Private->Position.X      = 0;\r
-      This->Mode->CursorColumn  = 0;\r
-      break;\r
-\r
-    case '\b':\r
-      if (Private->Position.X > 0) {\r
-        Private->Position.X--;\r
-        This->Mode->CursorColumn--;\r
-      }\r
-      break;\r
-\r
-#endif\r
-    default:\r
-      UnixSimpleTextOutPutChar (Private, *Str);\r
-    }\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-UnixSimpleTextOutPutChar (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA   *Console,\r
-  IN      CHAR16                            Char\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Console - TODO: add argument description\r
-  Char    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  char c = Char;\r
-  Console->UnixThunk->Write (1, &c, 1);\r
-}\r
-\r
-#if 0\r
-VOID\r
-UnixSimpleTextOutScrollScreen (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Console - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-}\r
-#endif\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutTestString (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL           *This,\r
-  IN CHAR16                                 *String\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  String  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  //\r
-  // BugBug: The correct answer would be a function of what code pages\r
-  //         are currently loaded? For now we will just return success.\r
-  //\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutQueryMode (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL           *This,\r
-  IN UINTN                                  ModeNumber,\r
-  OUT UINTN                                 *Columns,\r
-  OUT UINTN                                 *Rows\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  ModeNumber  - TODO: add argument description\r
-  Columns     - TODO: add argument description\r
-  Rows        - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_INVALID_PARAMETER - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (ModeNumber > MAX_SIMPLE_TEXT_OUT_MODE) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *Columns  = mUnixSimpleTextOutSupportedModes[ModeNumber].ColumnsX;\r
-  *Rows     = mUnixSimpleTextOutSupportedModes[ModeNumber].RowsY;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetMode (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL           *This,\r
-  IN UINTN                                  ModeNumber\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  ModeNumber  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_INVALID_PARAMETER - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (ModeNumber > MAX_SIMPLE_TEXT_OUT_MODE) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-\r
-  This->Mode->Mode = (INT32) ModeNumber;\r
-\r
-  This->EnableCursor (This, TRUE);\r
-  This->ClearScreen (This);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetAttribute (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN UINTN                          Attribute\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This      - TODO: add argument description\r
-  Attribute - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  Private               = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-#if 0\r
-  Private->Attribute    = (WORD) Attribute;\r
-#endif\r
-  This->Mode->Attribute = (INT32) Attribute;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutClearScreen (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-  //  DWORD                           ConsoleWindow;\r
-\r
-  Private = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  This->SetCursorPosition (This, 0, 0);\r
-  Private->UnixThunk->Write (1, "\e[2J", 4);\r
-\r
-\r
-#if 0\r
-  Private->UnixThunk->FillConsoleOutputCharacter (\r
-                        Private->NtOutHandle,\r
-                        ' ',\r
-                        Private->MaxScreenSize.X * Private->MaxScreenSize.Y,\r
-                        Private->Possition,\r
-                        &ConsoleWindow\r
-                        );\r
-  Private->UnixThunk->FillConsoleOutputAttribute (\r
-                        Private->NtOutHandle,\r
-                        Private->Attribute,\r
-                        Private->MaxScreenSize.X * Private->MaxScreenSize.Y,\r
-                        Private->Possition,\r
-                        &ConsoleWindow\r
-                        );\r
-#endif\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutSetCursorPosition (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL           *This,\r
-  IN UINTN                                  Column,\r
-  IN UINTN                                  Row\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Column  - TODO: add argument description\r
-  Row     - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  char buf[12];\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-\r
-  Private                   = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-#if 0\r
-  Private->Position.X      = (WORD) Column;\r
-#endif\r
-  This->Mode->CursorColumn  = (INT32) Column;\r
-\r
-#if 0\r
-  Private->Position.Y      = (WORD) Row;\r
-#endif\r
-  This->Mode->CursorRow     = (INT32) Row;\r
-#if 0\r
-  Private->UnixThunk->SetConsoleCursorPosition (Private->NtOutHandle, Private->Possition);\r
-#endif\r
-\r
-  buf[0] = '\e';\r
-  buf[1] = '[';\r
-  buf[2] = '0' + ((Row / 100) % 10);\r
-  buf[3] = '0' + ((Row / 10) % 10);\r
-  buf[4] = '0' + ((Row / 1) % 10);\r
-  buf[5] = ';';\r
-  buf[6] = '0' + ((Column / 100) % 10);\r
-  buf[7] = '0' + ((Column / 10) % 10);\r
-  buf[8] = '0' + ((Column / 1) % 10);\r
-  buf[9] = 'H';\r
-  Private->UnixThunk->Write (1, buf, 10);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleTextOutEnableCursor (\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,\r
-  IN BOOLEAN                        Enable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Enable  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private;\r
-#if 0\r
-  CONSOLE_CURSOR_INFO             Info;\r
-#endif\r
-\r
-  Private                   = UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS (This);\r
-  Private->CursorEnable     = Enable;\r
-  This->Mode->CursorVisible = Enable;\r
-\r
-#if 0\r
-  Private->UnixThunk->GetConsoleCursorInfo (Private->NtOutHandle, &Info);\r
-  Info.bVisible = Enable;\r
-  Private->UnixThunk->SetConsoleCursorInfo (Private->NtOutHandle, &Info);\r
-#endif\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-UnixSimpleTextOutOpenWindow (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *SimpleTextOut;\r
-  CHAR16                        *WindowName;\r
-\r
-  //WindowName          = Private->UnixIo->EnvString;\r
-#if 0\r
-  Private->Attribute  = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY;\r
-  if (*WindowName == '?') {\r
-    Private->Attribute  = BACKGROUND_RED | FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN;\r
-    WindowName          = L"EFI Emulator Error Console";\r
-  }\r
-#endif\r
-    WindowName          = L"EFI Emulator Error Console";\r
-\r
-  AddUnicodeString (\r
-    "eng",\r
-    gUnixConsoleComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    WindowName\r
-    );\r
-\r
-  //\r
-  // Fill in protocol member functions\r
-  //\r
-  SimpleTextOut                     = &Private->SimpleTextOut;\r
-  SimpleTextOut->Reset              = UnixSimpleTextOutReset;\r
-  SimpleTextOut->OutputString       = UnixSimpleTextOutOutputString;\r
-  SimpleTextOut->TestString         = UnixSimpleTextOutTestString;\r
-  SimpleTextOut->QueryMode          = UnixSimpleTextOutQueryMode;\r
-  SimpleTextOut->SetMode            = UnixSimpleTextOutSetMode;\r
-  SimpleTextOut->SetAttribute       = UnixSimpleTextOutSetAttribute;\r
-  SimpleTextOut->ClearScreen        = UnixSimpleTextOutClearScreen;\r
-  SimpleTextOut->SetCursorPosition  = UnixSimpleTextOutSetCursorPosition;\r
-  SimpleTextOut->EnableCursor       = UnixSimpleTextOutEnableCursor;\r
-\r
-  //\r
-  // Initialize SimpleTextOut protocol mode structure\r
-  //\r
-  SimpleTextOut->Mode             = &Private->SimpleTextOutMode;\r
-  SimpleTextOut->Mode->MaxMode    = MAX_SIMPLE_TEXT_OUT_MODE;\r
-  SimpleTextOut->Mode->Attribute  = 0; //FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY;\r
-\r
-#if 0\r
-  //\r
-  // Open the window an initialize it!\r
-  //\r
-  Private->NtOutHandle = Private->UnixThunk->CreateConsoleScreenBuffer (\r
-                                                GENERIC_WRITE | GENERIC_READ,\r
-                                                FILE_SHARE_WRITE | FILE_SHARE_READ,\r
-                                                NULL,\r
-                                                CONSOLE_TEXTMODE_BUFFER,\r
-                                                NULL\r
-                                                );\r
-  Private->UnixThunk->SetConsoleTitle (WindowName);\r
-#endif\r
-\r
-  return SimpleTextOut->SetMode (SimpleTextOut, 0);\r
-}\r
-\r
-EFI_STATUS\r
-UnixSimpleTextOutCloseWindow (\r
-  IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Console - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-#if 0\r
-  Console->UnixThunk->CloseHandle (Console->NtOutHandle);\r
-#endif\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/UnixConsoleDxe/EntryPoint.c b/UnixPkg/UnixConsoleDxe/EntryPoint.c
deleted file mode 100644 (file)
index 62d8013..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**@file\r
-  Entry Point Source file.\r
-\r
-  This file contains the user entry point \r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-   This program and the accompanying materials\r
-   are licensed and made available under the terms and conditions of the BSD License\r
-   which accompanies this distribution. The full text of the license may be found at\r
-   http://opensource.org/licenses/bsd-license.php\r
-   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-**/\r
-\r
-\r
-\r
-#include "Console.h"\r
-\r
-/**\r
-  The user Entry Point for module UnixConsole. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixConsole(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  Status = EfiLibInstallAllDriverProtocols (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gUnixConsoleDriverBinding,\r
-             ImageHandle,\r
-             &gUnixConsoleComponentName,\r
-             NULL,\r
-             NULL\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixConsoleDxe/UnixConsole.inf b/UnixPkg/UnixConsoleDxe/UnixConsole.inf
deleted file mode 100644 (file)
index a3e1313..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-## @file\r
-# Console Dxe driver\r
-#\r
-# Simulate console with Unix API\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixConsole\r
-  FILE_GUID                      = f314a8cc-8985-11db-9f69-0040d02b1835\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixConsole\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-#  DRIVER_BINDING                =  gUnixConsoleDriverBinding                    \r
-#  COMPONENT_NAME                =  gUnixConsoleComponentName                    \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  ConsoleOut.c\r
-  ConsoleIn.c\r
-  Console.c\r
-  Console.h\r
-  EntryPoint.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Protocols]\r
-  gEfiSimpleTextInProtocolGuid                  # PROTOCOL BY_START\r
-  gEfiSimpleTextOutProtocolGuid                 # PROTOCOL BY_START\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL TO_START\r
-\r
-[Guids]\r
-  gEfiUnixConsoleGuid\r
diff --git a/UnixPkg/UnixFirmwareVolumePei/UnixFwh.c b/UnixPkg/UnixFirmwareVolumePei/UnixFwh.c
deleted file mode 100644 (file)
index b135f6d..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  UnixFwh.c\r
-    \r
-Abstract:\r
-  PEIM to abstract construction of firmware volume in an Unix environment.\r
-\r
-Revision History\r
-\r
---*/\r
-\r
-#include "PiPei.h"\r
-#include <Ppi/UnixFwh.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/PeiServicesTablePointerLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeUnixFwh (\r
-  IN       EFI_PEI_FILE_HANDLE       FileHandle,\r
-  IN CONST EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Perform a call-back into the SEC simulator to get address of the Firmware Hub\r
-\r
-Arguments:\r
-  FfsHeader   - Ffs Header availible to every PEIM\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  EFI_PEI_PPI_DESCRIPTOR      *PpiDescriptor;\r
-  UNIX_FWH_PPI                *FwhPpi;\r
-  EFI_PHYSICAL_ADDRESS        FdBase;\r
-  EFI_PHYSICAL_ADDRESS        FdFixUp;\r
-  EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;\r
-  UINT64                      FdSize;\r
-  UINTN                       Index;\r
-\r
-  DEBUG ((EFI_D_ERROR, "Unix Firmware Volume PEIM Loaded\n"));\r
-\r
-  //\r
-  // Get the Fwh Information PPI\r
-  //\r
-  Status = (**PeiServices).LocatePpi (\r
-                            PeiServices,\r
-                            &gUnixFwhPpiGuid, // GUID\r
-                            0,              // INSTANCE\r
-                            &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR\r
-                            (VOID **)&FwhPpi         // PPI\r
-                            );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Index = 0;\r
-  do {\r
-    //\r
-    // Get information about all the FD's in the system\r
-    //\r
-    Status = FwhPpi->UnixFwh (Index, &FdBase, &FdSize, &FdFixUp);\r
-    if (!EFI_ERROR (Status)) {\r
-      //\r
-      // Assume the FD starts with an FV header\r
-      //\r
-      FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) FdBase;\r
-\r
-      //\r
-      // Make an FV Hob for the first FV in the FD\r
-      //\r
-      BuildFvHob (FdBase, FvHeader->FvLength);\r
-\r
-      if (Index == 0) {\r
-        //\r
-        // Assume the first FD was produced by the NT32.DSC\r
-        //  All these strange offests are needed to keep in\r
-        //  sync with the FlashMap and NT32.dsc file\r
-        //\r
-        BuildResourceDescriptorHob (\r
-          EFI_RESOURCE_FIRMWARE_DEVICE,\r
-          (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),\r
-          FdBase,\r
-          ( \r
-            FvHeader->FvLength + \r
-            PcdGet32 (PcdFlashNvStorageVariableSize) +\r
-            PcdGet32 (PcdFlashNvStorageFtwWorkingSize) +\r
-            PcdGet32 (PcdFlashNvStorageFtwSpareSize) +\r
-            PcdGet32 (PcdUnixFlashNvStorageEventLogSize)\r
-          )\r
-        );\r
-\r
-        //\r
-        // Hard code the address of the spare block and variable services.\r
-        //  Assume it's a hard coded offset from FV0 in FD0.\r
-        //\r
-        FdSize  = \r
-          PcdGet32 (PcdFlashNvStorageVariableSize) +\r
-          PcdGet32 (PcdFlashNvStorageFtwWorkingSize) +\r
-          PcdGet32 (PcdFlashNvStorageFtwSpareSize) +\r
-          PcdGet32 (PcdUnixFlashNvStorageEventLogSize);\r
-\r
-        BuildFvHob (FdFixUp + PcdGet64 (PcdUnixFlashNvStorageVariableBase), FdSize);\r
-      } else {\r
-        //\r
-        // For other FD's just map them in.\r
-        //\r
-        BuildResourceDescriptorHob (\r
-          EFI_RESOURCE_FIRMWARE_DEVICE,\r
-          (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),\r
-          FdBase,\r
-          FdSize\r
-          );\r
-      }\r
-    }\r
-\r
-    Index++;\r
-  } while (!EFI_ERROR (Status));\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf b/UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf
deleted file mode 100644 (file)
index b5f68d7..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-## @file\r
-# Component description file for WinNtFwh module\r
-#\r
-# This PEIM will produce the HOB to describe Firmware Volume, Firmware Devices\r
-#  on the NT32 emulator.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixFwh\r
-  FILE_GUID                      = f40b7864-8985-11db-af21-0040d02b1835\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = PeimInitializeUnixFwh\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  UnixFwh.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  PeiServicesTablePointerLib\r
-  PeiServicesLib\r
-  HobLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-[Pcd]\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogSize\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageVariableBase\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-\r
-[Ppis]\r
-  gUnixFwhPpiGuid                               # PPI ALWAYS_CONSUMED\r
-\r
-[Depex]\r
-  gUnixFwhPpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid\r
-\r
diff --git a/UnixPkg/UnixFlashMapPei/FlashMap.c b/UnixPkg/UnixFlashMapPei/FlashMap.c
deleted file mode 100644 (file)
index 786fdd0..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  FlashMap.c\r
-   \r
-Abstract:\r
-\r
-  PEIM to build GUIDed HOBs for platform specific flash map\r
-\r
---*/\r
-\r
-\r
-#include "PiPei.h"\r
-\r
-#include <Guid/SystemNvDataGuid.h>\r
-#include <Ppi/UnixFwh.h>\r
-#include <Protocol/FirmwareVolumeBlock.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/PeiServicesTablePointerLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeFlashMap (\r
-  IN       EFI_PEI_FILE_HANDLE       FileHandle,\r
-  IN CONST EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Build GUIDed HOBs for platform specific flash map\r
-  \r
-Arguments:\r
-  FfsHeader   - A pointer to the EFI_FFS_FILE_HEADER structure.\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-  EFI_STATUS\r
-\r
---*/\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  UNIX_FWH_PPI            *UnixFwhPpi;\r
-  EFI_PEI_PPI_DESCRIPTOR  *PpiDescriptor;\r
-  EFI_PHYSICAL_ADDRESS    FdBase;\r
-  EFI_PHYSICAL_ADDRESS    FdFixUp;\r
-  UINT64                  FdSize;\r
-\r
-  DEBUG ((EFI_D_ERROR, "UnixPkg Flash Map PEIM Loaded\n"));\r
-\r
-  //\r
-  // Get the Fwh Information PPI\r
-  //\r
-  Status = PeiServicesLocatePpi (\r
-            &gUnixFwhPpiGuid, // GUID\r
-            0,              // INSTANCE\r
-            &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR\r
-            (VOID **)&UnixFwhPpi       // PPI\r
-            );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Assume that FD0 contains the Flash map.\r
-  //\r
-  Status = UnixFwhPpi->UnixFwh (0, &FdBase, &FdSize, &FdFixUp);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  \r
-  PcdSet64 (PcdFlashNvStorageVariableBase64, PcdGet64 (PcdUnixFlashNvStorageVariableBase) + FdFixUp);\r
-  PcdSet64 (PcdFlashNvStorageFtwWorkingBase64, PcdGet64 (PcdUnixFlashNvStorageFtwWorkingBase) + FdFixUp);\r
-  PcdSet64 (PcdFlashNvStorageFtwSpareBase64, PcdGet64 (PcdUnixFlashNvStorageFtwSpareBase) + FdFixUp);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/UnixFlashMapPei/FlashMap.inf b/UnixPkg/UnixFlashMapPei/FlashMap.inf
deleted file mode 100644 (file)
index da9f861..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-## @file\r
-# Component description file for FlashMap PEI module\r
-#\r
-# This module installs FlashMap PPI which is used to get flash layout information.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = PeiFlashMap\r
-  FILE_GUID                      = f417814a-8985-11db-8983-0040d02b1835\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = PeimInitializeFlashMap\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  FlashMap.c\r
-\r
-[Packages]\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  PcdLib\r
-  BaseMemoryLib\r
-  PeiServicesTablePointerLib\r
-  PeiServicesLib\r
-  HobLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-[Protocols]\r
-  gEfiFirmwareVolumeBlockProtocolGuid           # PROTOCOL ALWAYS_CONSUMED\r
-\r
-\r
-[Ppis]\r
-  gUnixFwhPpiGuid                               # PPI ALWAYS_CONSUMED\r
-\r
-[Pcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64\r
-\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwWorkingBase\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwSpareBase\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageVariableBase\r
-\r
-[Depex]\r
-  gPcdPpiGuid\r
-\r
diff --git a/UnixPkg/UnixGopDxe/ComponentName.c b/UnixPkg/UnixGopDxe/ComponentName.c
deleted file mode 100644 (file)
index 468a805..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixGop.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGopComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGopComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-EFI_COMPONENT_NAME_PROTOCOL     gUnixGopComponentName = {\r
-  UnixGopComponentNameGetDriverName,\r
-  UnixGopComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUnixGopComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) UnixGopComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) UnixGopComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-EFI_UNICODE_STRING_TABLE mUnixGopDriverNameTable[] = {\r
-  { "eng", L"Unix GOP Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGopComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mUnixGopDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gUnixGopComponentName)\r
-           );\r
-}\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGopComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  EFI_STATUS                    Status;\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput;\r
-  GOP_PRIVATE_DATA              *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gUnixGopDriverBinding.DriverBindingHandle,\r
-             &gEfiUnixIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiGraphicsOutputProtocolGuid,\r
-                  (VOID **)&GraphicsOutput,\r
-                  gUnixGopDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = GOP_PRIVATE_DATA_FROM_THIS (GraphicsOutput);\r
-\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           Private->ControllerNameTable,\r
-           ControllerName,\r
-           (BOOLEAN)(This == &gUnixGopComponentName)\r
-           );\r
-\r
-}\r
diff --git a/UnixPkg/UnixGopDxe/UnixGop.h b/UnixPkg/UnixGopDxe/UnixGop.h
deleted file mode 100644 (file)
index bd29b69..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>
-This program and the accompanying materials                          
-are licensed and made available under the terms and conditions of the BSD License         
-which accompanies this distribution.  The full text of the license may be found at        
-http://opensource.org/licenses/bsd-license.php                                            
-                                                                                          
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
-
-Module Name:
-
-  UnixGop.h
-
-Abstract:
-
-  Private data for the Gop driver that is bound to the Unix Thunk protocol 
-
---*/
-
-#ifndef _UNIX_UGA_H_
-#define _UNIX_UGA_H_
-
-#include <PiDxe.h>
-#include "UnixDxe.h"
-#include <Library/DebugLib.h>
-#include <Library/BaseLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-
-#include <Protocol/GraphicsOutput.h>
-#include <Protocol/SimpleTextIn.h>
-#include <Protocol/SimpleTextInEx.h>
-#include <Protocol/SimplePointer.h>
-#include "Protocol/UnixUgaIo.h"
-
-#include <Guid/EventGroup.h>
-
-
-
-#define MAX_Q 256
-
-typedef struct {
-  UINTN         Front;
-  UINTN         Rear;
-  UINTN         Count;
-  EFI_INPUT_KEY Q[MAX_Q];
-} GOP_QUEUE_FIXED;
-
-#define UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('U', 'g', 'S', 'n')
-typedef struct _UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY {
-  UINTN                                 Signature;
-  EFI_KEY_DATA                          KeyData;
-  EFI_KEY_NOTIFY_FUNCTION               KeyNotificationFn;
-  EFI_EVENT                             Event;
-  LIST_ENTRY                            NotifyEntry;
-} UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY;
-  
-#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
-
-typedef struct {
-  UINT32                     HorizontalResolution;
-  UINT32                     VerticalResolution;
-  UINT32                     ColorDepth;
-  UINT32                     RefreshRate;
-} GOP_MODE_DATA;
-
-
-
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixGopComponentName;
-
-#define UNIX_UGA_CLASS_NAME       L"UnixGopWindow"
-
-#define GOP_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('G', 'o', 'p', 'N')
-typedef struct {
-  UINT64                      Signature;
-
-  EFI_HANDLE                        Handle;
-  EFI_GRAPHICS_OUTPUT_PROTOCOL      GraphicsOutput;
-  EFI_SIMPLE_TEXT_INPUT_PROTOCOL    SimpleTextIn;
-  EFI_SIMPLE_POINTER_PROTOCOL       SimplePointer;
-
-  EFI_UNIX_THUNK_PROTOCOL         *UnixThunk;
-  EFI_UNIX_UGA_IO_PROTOCOL        *UgaIo;
-
-  EFI_UNICODE_STRING_TABLE        *ControllerNameTable;
-
-  EFI_SIMPLE_POINTER_MODE         PointerMode;
-  //
-  // GOP Private Data for QueryMode ()
-  //
-  GOP_MODE_DATA                   *ModeData;
-
-
-  //
-  // UGA Private Data knowing when to start hardware
-  //
-  BOOLEAN                           HardwareNeedsStarting;
-
-  CHAR16                            *WindowName;
-
-  GOP_QUEUE_FIXED                   Queue;
-
-  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInEx;
-  EFI_KEY_STATE                     KeyState;
-  LIST_ENTRY                        NotifyList;
-
-
-} GOP_PRIVATE_DATA;
-
-
-#define GOP_PRIVATE_DATA_FROM_THIS(a)  \
-         CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)
-
-#define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a)  \
-         CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)
-
-#define GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS(a)  \
-         CR(a, GOP_PRIVATE_DATA, SimpleTextInEx, GOP_PRIVATE_DATA_SIGNATURE)
-
-#define GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS(a)  \
-         CR(a, GOP_PRIVATE_DATA, SimplePointer, GOP_PRIVATE_DATA_SIGNATURE)
-
-
-//
-// Global Protocol Variables
-//
-extern EFI_DRIVER_BINDING_PROTOCOL  gUnixGopDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL  gUnixGopComponentName;
-extern EFI_COMPONENT_NAME2_PROTOCOL gUnixGopComponentName2;
-
-//
-// Gop Hardware abstraction internal worker functions
-//
-EFI_STATUS
-UnixGopSupported (
-  IN  EFI_UNIX_IO_PROTOCOL  *UnixIo
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  UnixIo - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixGopConstructor (
-  IN  GOP_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixGopDestructor (
-  IN  GOP_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-//
-// EFI 1.1 driver model prototypes for Win UNIX UGA
-//
-
-EFI_STATUS
-EFIAPI
-UnixGopInitialize (
-  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
-UnixGopDriverBindingSupported (
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
-  IN  EFI_HANDLE                      Handle,
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This                - TODO: add argument description
-  Handle              - TODO: add argument description
-  RemainingDevicePath - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-UnixGopDriverBindingStart (
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
-  IN  EFI_HANDLE                      Handle,
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This                - TODO: add argument description
-  Handle              - TODO: add argument description
-  RemainingDevicePath - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-UnixGopDriverBindingStop (
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,
-  IN  EFI_HANDLE                   Handle,
-  IN  UINTN                        NumberOfChildren,
-  IN  EFI_HANDLE                   *ChildHandleBuffer
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This              - TODO: add argument description
-  Handle            - TODO: add argument description
-  NumberOfChildren  - TODO: add argument description
-  ChildHandleBuffer - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-GopPrivateAddQ (
-  IN  GOP_PRIVATE_DATA    *Private,
-  IN  EFI_INPUT_KEY       Key
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-  Key     - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixGopInitializeSimpleTextInForWindow (
-  IN  GOP_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixGopInitializeSimplePointerForWindow (
-  IN  GOP_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-#endif
diff --git a/UnixPkg/UnixGopDxe/UnixGop.inf b/UnixPkg/UnixGopDxe/UnixGop.inf
deleted file mode 100644 (file)
index e11a709..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-## @file\r
-# Uga driver\r
-#\r
-# UGA is short hand for Universal Graphics Abstraction protocol.\r
-#  This file is a verision of UgaIo the uses UnixThunk system calls as an IO\r
-#  abstraction. For a PCI device UnixIo would be replaced with\r
-#  a PCI IO abstraction that abstracted a specific PCI device.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixUga\r
-  FILE_GUID                      = f33cad86-8985-11db-8040-0040d02b1835\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixGop\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-#  DRIVER_BINDING                =  gUnixUgaDriverBinding                        \r
-#  COMPONENT_NAME                =  gUnixUgaComponentName                        \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  UnixGopScreen.c\r
-  UnixGopDriver.c\r
-  UnixGopInput.c\r
-  UnixGop.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiEventExitBootServicesGuid                 # SOMETIMES_CONSUMED  Create Event: EVENT_GROUP_GUID\r
-  gEfiUnixGopGuid                              # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gEfiGraphicsOutputProtocolGuid\r
-  gEfiSimpleTextInProtocolGuid                  # PROTOCOL BY_START\r
-  gEfiSimpleTextInputExProtocolGuid             # PROTOCOL BY_START\r
-  gEfiSimplePointerProtocolGuid                 # PROTOCOL BY_START\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL TO_START\r
-\r
diff --git a/UnixPkg/UnixGopDxe/UnixGopDriver.c b/UnixPkg/UnixGopDxe/UnixGopDriver.c
deleted file mode 100644 (file)
index dd3cd4a..0000000
+++ /dev/null
@@ -1,396 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixGopDriver.c\r
-\r
-Abstract:\r
-\r
-  This file implements the EFI 1.1 Device Driver model requirements for UGA\r
-\r
-  UGA is short hand for Universal Graphics Abstraction protocol.\r
-\r
-  This file is a verision of UgaIo the uses UnixThunk system calls as an IO \r
-  abstraction. For a PCI device UnixIo would be replaced with\r
-  a PCI IO abstraction that abstracted a specific PCI device. \r
-\r
---*/\r
-\r
-#include "UnixGop.h"\r
-\r
-\r
-EFI_STATUS\r
-FreeNotifyList (\r
-  IN OUT LIST_ENTRY           *ListHead\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-  ListHead   - The list head\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Free the notify list successfully\r
-  EFI_INVALID_PARAMETER - ListHead is invalid.\r
-\r
---*/\r
-{\r
-  UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY *NotifyNode;\r
-\r
-  if (ListHead == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  while (!IsListEmpty (ListHead)) {\r
-    NotifyNode = CR (\r
-                   ListHead->ForwardLink, \r
-                   UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY, \r
-                   NotifyEntry, \r
-                   UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE\r
-                   );\r
-    RemoveEntryList (ListHead->ForwardLink);\r
-    gBS->FreePool (NotifyNode);\r
-  }\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGopDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID **)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = UnixGopSupported (UnixIo);\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGopDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-{\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-  EFI_STATUS              Status;\r
-  GOP_PRIVATE_DATA        *Private;\r
-\r
-  //\r
-  // Grab the protocols we need\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID **)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Allocate Private context data for SGO inteface.\r
-  //\r
-  Private = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (GOP_PRIVATE_DATA),\r
-                  (VOID **)&Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Set up context record\r
-  //\r
-  Private->Signature           = GOP_PRIVATE_DATA_SIGNATURE;\r
-  Private->Handle              = Handle;\r
-  Private->UnixThunk           = UnixIo->UnixThunk;\r
-\r
-  Private->ControllerNameTable  = NULL;\r
-\r
-  AddUnicodeString (\r
-    "eng",\r
-    gUnixGopComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    UnixIo->EnvString\r
-    );\r
-  AddUnicodeString2 (\r
-    "en",\r
-    gUnixGopComponentName2.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    UnixIo->EnvString,\r
-    FALSE\r
-    );\r
-\r
-  Private->WindowName = UnixIo->EnvString;\r
-\r
-  Status              = UnixGopConstructor (Private);\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Publish the Gop interface to the world\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Private->Handle,\r
-                  &gEfiGraphicsOutputProtocolGuid,    &Private->GraphicsOutput,\r
-                  &gEfiSimpleTextInProtocolGuid,      &Private->SimpleTextIn,\r
-                  &gEfiSimplePointerProtocolGuid,     &Private->SimplePointer,\r
-//                  &gEfiSimpleTextInputExProtocolGuid, &Private->SimpleTextInEx,\r
-                  NULL\r
-                  );\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-\r
-    if (Private != NULL) {\r
-      //\r
-      // On Error Free back private data\r
-      //\r
-      if (Private->ControllerNameTable != NULL) {\r
-        FreeUnicodeStringTable (Private->ControllerNameTable);\r
-      }\r
-      if (Private->SimpleTextIn.WaitForKey != NULL) {\r
-        gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
-      }\r
-      if (Private->SimpleTextInEx.WaitForKeyEx != NULL) {\r
-        gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx);\r
-      }\r
-      FreeNotifyList (&Private->NotifyList);\r
-\r
-      gBS->FreePool (Private);\r
-    }\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixGopDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    NumberOfChildren - add argument and description to function comment\r
-// TODO:    ChildHandleBuffer - add argument and description to function comment\r
-// TODO:    EFI_NOT_STARTED - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-{\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
-  EFI_STATUS                   Status;\r
-  GOP_PRIVATE_DATA             *Private;\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiGraphicsOutputProtocolGuid,\r
-                  (VOID **)&GraphicsOutput,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // If the GOP interface does not exist the driver is not started\r
-    //\r
-    return EFI_NOT_STARTED;\r
-  }\r
-\r
-  //\r
-  // Get our private context information\r
-  //\r
-  Private = GOP_PRIVATE_DATA_FROM_THIS (GraphicsOutput);\r
-\r
-  //\r
-  // Remove the SGO interface from the system\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  Private->Handle,\r
-                  &gEfiGraphicsOutputProtocolGuid,    &Private->GraphicsOutput,\r
-                  &gEfiSimpleTextInProtocolGuid,      &Private->SimpleTextIn,\r
-                  &gEfiSimplePointerProtocolGuid,     &Private->SimplePointer,\r
-//                  &gEfiSimpleTextInputExProtocolGuid, &Private->SimpleTextInEx,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Shutdown the hardware\r
-    //\r
-    Status = UnixGopDestructor (Private);\r
-    if (EFI_ERROR (Status)) {\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-\r
-    //\r
-    // Free our instance data\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-    \r
-    Status = gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
-    ASSERT_EFI_ERROR (Status);\r
-    \r
-    Status = gBS->CloseEvent (Private->SimpleTextInEx.WaitForKeyEx);\r
-    ASSERT_EFI_ERROR (Status);\r
-    \r
-    FreeNotifyList (&Private->NotifyList);\r
-\r
-    gBS->FreePool (Private);\r
-\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gUnixGopDriverBinding = {\r
-  UnixGopDriverBindingSupported,\r
-  UnixGopDriverBindingStart,\r
-  UnixGopDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-\r
-\r
-/**\r
-  The user Entry Point for module UnixGop. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixGop (\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  Status = EfiLibInstallDriverBindingComponentName2 (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gUnixGopDriverBinding,\r
-             ImageHandle,\r
-             &gUnixGopComponentName,\r
-             &gUnixGopComponentName2\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
-\r
diff --git a/UnixPkg/UnixGopDxe/UnixGopInput.c b/UnixPkg/UnixGopDxe/UnixGopInput.c
deleted file mode 100644 (file)
index 89087d0..0000000
+++ /dev/null
@@ -1,884 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>
-Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
---*/
-
-#include "UnixGop.h"
-
-
-BOOLEAN
-GopPrivateIsKeyRegistered (
-  IN EFI_KEY_DATA  *RegsiteredData,
-  IN EFI_KEY_DATA  *InputData
-  )
-/*++
-
-Routine Description:
-
-Arguments:
-
-  RegsiteredData    - A pointer to a buffer that is filled in with the keystroke 
-                      state data for the key that was registered.
-  InputData         - A pointer to a buffer that is filled in with the keystroke 
-                      state data for the key that was pressed.
-
-Returns:
-  TRUE              - Key be pressed matches a registered key.
-  FLASE             - Match failed. 
-  
---*/
-{
-  ASSERT (RegsiteredData != NULL && InputData != NULL);
-  
-  if ((RegsiteredData->Key.ScanCode    != InputData->Key.ScanCode) ||
-      (RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar)) {
-    return FALSE;  
-  }      
-  
-  //
-  // Assume KeyShiftState/KeyToggleState = 0 in Registered key data means these state could be ignored.
-  //
-  if (RegsiteredData->KeyState.KeyShiftState != 0 &&
-      RegsiteredData->KeyState.KeyShiftState != InputData->KeyState.KeyShiftState) {
-    return FALSE;    
-  }   
-  if (RegsiteredData->KeyState.KeyToggleState != 0 &&
-      RegsiteredData->KeyState.KeyToggleState != InputData->KeyState.KeyToggleState) {
-    return FALSE;    
-  }     
-  
-  return TRUE;
-
-}
-
-
-VOID
-EFIAPI
-GopPrivateInvokeRegisteredFunction (
-  IN VOID           *Context,
-  IN EFI_KEY_DATA   *KeyData
-  )
-{ 
-  LIST_ENTRY                        *Link;
-  UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY  *CurrentNotify;
-  GOP_PRIVATE_DATA                  *Private = (GOP_PRIVATE_DATA *)Context;
-  
-  for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {
-    CurrentNotify = CR (
-                      Link, 
-                      UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY, 
-                      NotifyEntry, 
-                      UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE
-                      );
-    if (GopPrivateIsKeyRegistered (&CurrentNotify->KeyData, KeyData)) { 
-      // We could be called at a high TPL so signal an event to call the registered function 
-      // at a lower TPL.
-      gBS->SignalEvent (CurrentNotify->Event);
-    }
-  }    
-}
-
-
-
-//
-// Simple Text In implementation.
-//
-
-/**
-  Reset the input device and optionally run diagnostics
-
-  @param  This                 Protocol instance pointer.
-  @param  ExtendedVerification Driver may perform diagnostics on reset.
-
-  @retval EFI_SUCCESS          The device was reset.
-  @retval EFI_DEVICE_ERROR     The device is not functioning properly and could not be reset.
-
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimpleTextInReset (
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL       *This,
-  IN BOOLEAN                              ExtendedVerification
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-  EFI_KEY_DATA      KeyData;
-  EFI_TPL           OldTpl;
-
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_SUCCESS;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
-  //
-  // A reset is draining the Queue
-  //
-  while (Private->UgaIo->UgaGetKey (Private->UgaIo, &KeyData) == EFI_SUCCESS)
-    ;
-
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-  return EFI_SUCCESS;
-}
-
-
-/**
-  Reads the next keystroke from the input device. The WaitForKey Event can
-  be used to test for existence of a keystroke via WaitForEvent () call.
-
-  @param  This  Protocol instance pointer.
-  @param  Key   A pointer to a buffer that is filled in with the keystroke
-                information for the key that was pressed.
-
-  @retval EFI_SUCCESS      The keystroke information was returned.
-  @retval EFI_NOT_READY    There was no keystroke data available.
-  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
-                           hardware errors.
-
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimpleTextInReadKeyStroke (
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL       *This,
-  OUT EFI_INPUT_KEY                       *Key
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-  EFI_KEY_DATA      KeyData;
-
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_NOT_READY;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaGetKey(Private->UgaIo, &KeyData);
-  CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));
-
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-
-  return Status;
-}
-
-
-
-/**
-  SimpleTextIn and SimpleTextInEx Notify Wait Event 
-
-  @param  Event                 Event whose notification function is being invoked.
-  @param  Context               Pointer to GOP_PRIVATE_DATA.
-
-**/
-VOID
-EFIAPI
-UnixGopSimpleTextInWaitForKey (
-  IN EFI_EVENT          Event,
-  IN VOID               *Context
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-
-  Private = (GOP_PRIVATE_DATA *) Context;
-  if (Private->UgaIo == NULL) {
-    return;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaCheckKey (Private->UgaIo);
-  if (!EFI_ERROR (Status)) {
-    //
-    // If a there is a key in the queue signal our event.
-    //
-    gBS->SignalEvent (Event);
-  }
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-}
-
-
-//
-// Simple Text Input Ex protocol functions
-//
-
-
-/**
-  The Reset() function resets the input device hardware. As part
-  of initialization process, the firmware/device will make a quick
-  but reasonable attempt to verify that the device is functioning.
-  If the ExtendedVerification flag is TRUE the firmware may take
-  an extended amount of time to verify the device is operating on
-  reset. Otherwise the reset operation is to occur as quickly as
-  possible. The hardware verification process is not defined by
-  this specification and is left up to the platform firmware or
-  driver to implement.
-
-  @param This                 A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
-
-  @param ExtendedVerification Indicates that the driver may
-                              perform a more exhaustive
-                              verification operation of the
-                              device during reset.
-
-
-  @retval EFI_SUCCESS       The device was reset.
-  
-  @retval EFI_DEVICE_ERROR  The device is not functioning
-                            correctly and could not be reset.
-
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimpleTextInExResetEx (
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
-  IN BOOLEAN                            ExtendedVerification
-  )
-/*++
-
-  Routine Description:
-    Reset the input device and optionaly run diagnostics
-
-  Arguments:
-    This                 - Protocol instance pointer.
-    ExtendedVerification - Driver may perform diagnostics on reset.
-
-  Returns:
-    EFI_SUCCESS           - The device was reset.
-
---*/
-{
-  GOP_PRIVATE_DATA *Private;
-
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
-  
-  return EFI_SUCCESS;
-}
-
-
-
-/**
-  The function reads the next keystroke from the input device. If
-  there is no pending keystroke the function returns
-  EFI_NOT_READY. If there is a pending keystroke, then
-  KeyData.Key.ScanCode is the EFI scan code defined in Error!
-  Reference source not found. The KeyData.Key.UnicodeChar is the
-  actual printable character or is zero if the key does not
-  represent a printable character (control key, function key,
-  etc.). The KeyData.KeyState is shift state for the character
-  reflected in KeyData.Key.UnicodeChar or KeyData.Key.ScanCode .
-  When interpreting the data from this function, it should be
-  noted that if a class of printable characters that are
-  normally adjusted by shift modifiers (e.g. Shift Key + "f"
-  key) would be presented solely as a KeyData.Key.UnicodeChar
-  without the associated shift state. So in the previous example
-  of a Shift Key + "f" key being pressed, the only pertinent
-  data returned would be KeyData.Key.UnicodeChar with the value
-  of "F". This of course would not typically be the case for
-  non-printable characters such as the pressing of the Right
-  Shift Key + F10 key since the corresponding returned data
-  would be reflected both in the KeyData.KeyState.KeyShiftState
-  and KeyData.Key.ScanCode values. UEFI drivers which implement
-  the EFI_SIMPLE_TEXT_INPUT_EX protocol are required to return
-  KeyData.Key and KeyData.KeyState values. These drivers must
-  always return the most current state of
-  KeyData.KeyState.KeyShiftState and
-  KeyData.KeyState.KeyToggleState. It should also be noted that
-  certain input devices may not be able to produce shift or toggle
-  state information, and in those cases the high order bit in the
-  respective Toggle and Shift state fields should not be active.
-
-  
-  @param This     A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
-
-  @param KeyData  A pointer to a buffer that is filled in with
-                  the keystroke state data for the key that was
-                  pressed.
-
-  
-  @retval EFI_SUCCESS     The keystroke information was
-                          returned.
-  
-  @retval EFI_NOT_READY   There was no keystroke data available.
-                          EFI_DEVICE_ERROR The keystroke
-                          information was not returned due to
-                          hardware errors.
-
-
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimpleTextInExReadKeyStrokeEx (
-  IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
-  OUT EFI_KEY_DATA                      *KeyData
-  )
-/*++
-
-  Routine Description:
-    Reads the next keystroke from the input device. The WaitForKey Event can 
-    be used to test for existance of a keystroke via WaitForEvent () call.
-
-  Arguments:
-    This       - Protocol instance pointer.
-    KeyData    - A pointer to a buffer that is filled in with the keystroke 
-                 state data for the key that was pressed.
-
-  Returns:
-    EFI_SUCCESS           - The keystroke information was returned.
-    EFI_NOT_READY         - There was no keystroke data availiable.
-    EFI_DEVICE_ERROR      - The keystroke information was not returned due to 
-                            hardware errors.
-    EFI_INVALID_PARAMETER - KeyData is NULL.                        
-
---*/
-{
-  EFI_STATUS        Status;
-  GOP_PRIVATE_DATA  *Private;
-  EFI_TPL           OldTpl;
-
-
-  if (KeyData == NULL) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_NOT_READY;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaGetKey(Private->UgaIo, KeyData);
-
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-
-  return Status;
-}
-
-
-
-/**
-  The SetState() function allows the input device hardware to
-  have state settings adjusted.
-  
-  @param This           A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
-  
-  @param KeyToggleState Pointer to the EFI_KEY_TOGGLE_STATE to
-                        set the state for the input device.
-  
-  
-  @retval EFI_SUCCESS       The device state was set appropriately.
-
-  @retval EFI_DEVICE_ERROR  The device is not functioning
-                            correctly and could not have the
-                            setting adjusted.
-
-  @retval EFI_UNSUPPORTED   The device does not support the
-                            ability to have its state set.
-
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimpleTextInExSetState (
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
-  IN EFI_KEY_TOGGLE_STATE               *KeyToggleState
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_NOT_READY;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaKeySetState (Private->UgaIo, KeyToggleState);
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-
-  return Status;
-}
-
-
-/**
-  SimpleTextIn and SimpleTextInEx Notify Wait Event 
-
-  @param  Event                 Event whose notification function is being invoked.
-  @param  Context               Pointer to GOP_PRIVATE_DATA.
-
-**/
-VOID
-EFIAPI
-UnixGopRegisterKeyCallback (
-  IN EFI_EVENT          Event,
-  IN VOID               *Context
-  )
-{
-  UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY *ExNotify = (UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY *)Context;
-  
-  ExNotify->KeyNotificationFn (&ExNotify->KeyData);
-}
-
-
-
-/**
-  The RegisterKeystrokeNotify() function registers a function
-  which will be called when a specified keystroke will occur.
-  
-  @param This                     A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
-  
-  @param KeyData                  A pointer to a buffer that is filled in with
-                                  the keystroke information for the key that was
-                                  pressed.
-  
-  @param KeyNotificationFunction  Points to the function to be
-                                  called when the key sequence
-                                  is typed specified by KeyData.
-  
-  
-  @param NotifyHandle             Points to the unique handle assigned to
-                                  the registered notification.
-  
-  @retval EFI_SUCCESS           The device state was set
-                                appropriately.
-
-  @retval EFI_OUT_OF_RESOURCES  Unable to allocate necessary
-                                data structures.
-
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimpleTextInExRegisterKeyNotify (
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
-  IN EFI_KEY_DATA                       *KeyData,
-  IN EFI_KEY_NOTIFY_FUNCTION            KeyNotificationFunction,
-  OUT VOID                              **NotifyHandle
-  )
-{
-  EFI_STATUS                          Status;
-  GOP_PRIVATE_DATA                    *Private;
-  UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY    *CurrentNotify;
-  LIST_ENTRY                          *Link;
-  UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY    *NewNotify;
-
-  if (KeyData == NULL || KeyNotificationFunction == NULL || NotifyHandle == NULL) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
-
-  //
-  // Return EFI_SUCCESS if the (KeyData, NotificationFunction) is already registered.
-  //
-  for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {
-    CurrentNotify = CR (
-                      Link, 
-                      UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY, 
-                      NotifyEntry, 
-                      UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE
-                      );
-    if (GopPrivateIsKeyRegistered (&CurrentNotify->KeyData, KeyData)) { 
-      if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
-        *NotifyHandle = CurrentNotify;
-        return EFI_SUCCESS;
-      }
-    }
-  }    
-  
-  //
-  // Allocate resource to save the notification function
-  //  
-  NewNotify = (UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY *) AllocateZeroPool (sizeof (UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY));
-  if (NewNotify == NULL) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-
-  NewNotify->Signature         = UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE;     
-  NewNotify->KeyNotificationFn = KeyNotificationFunction;
-  CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData));
-  InsertTailList (&Private->NotifyList, &NewNotify->NotifyEntry);
-  
-  Status = gBS->CreateEvent (
-                  EVT_NOTIFY_SIGNAL,
-                  TPL_NOTIFY,
-                  UnixGopRegisterKeyCallback,
-                  NewNotify,
-                  NewNotify->Event
-                  );
-  ASSERT_EFI_ERROR (Status);
-
-
-  *NotifyHandle = NewNotify;  
-  
-  return EFI_SUCCESS;
-  
-}
-
-
-/**
-  The UnregisterKeystrokeNotify() function removes the
-  notification which was previously registered.
-  
-  @param This               A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance.
-  
-  @param NotificationHandle The handle of the notification
-                            function being unregistered.
-  
-  @retval EFI_SUCCESS The device state was set appropriately.
-  
-  @retval EFI_INVALID_PARAMETER The NotificationHandle is
-                                invalid.
-
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimpleTextInExUnregisterKeyNotify (
-  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
-  IN VOID                               *NotificationHandle
-  )
-/*++
-
-  Routine Description:
-    Remove a registered notification function from a particular keystroke.
-
-  Arguments:
-    This                    - Protocol instance pointer.    
-    NotificationHandle      - The handle of the notification function being unregistered.
-
-  Returns:
-    EFI_SUCCESS             - The notification function was unregistered successfully.
-    EFI_INVALID_PARAMETER   - The NotificationHandle is invalid.
-                              
---*/   
-{
-  GOP_PRIVATE_DATA                   *Private;
-  LIST_ENTRY                         *Link;
-  UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY *CurrentNotify;
-
-  if (NotificationHandle == NULL) {
-    return EFI_INVALID_PARAMETER;
-  } 
-
-  if (((UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY *) NotificationHandle)->Signature != UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE) {
-    return EFI_INVALID_PARAMETER;
-  } 
-
-  Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
-
-  for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {
-    CurrentNotify = CR (
-                      Link, 
-                      UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY, 
-                      NotifyEntry, 
-                      UNIX_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE
-                      );       
-    if (CurrentNotify == NotificationHandle) {
-      //
-      // Remove the notification function from NotifyList and free resources
-      //
-      RemoveEntryList (&CurrentNotify->NotifyEntry);    
-      
-      gBS->CloseEvent (CurrentNotify->Event);
-
-      gBS->FreePool (CurrentNotify);            
-      return EFI_SUCCESS;
-    }
-  }
-
-  //
-  // Can not find the specified Notification Handle
-  //
-  return EFI_INVALID_PARAMETER;
-}
-
-
-
-/**
-  Initialize SimplelTextIn and SimpleTextInEx protocols in the Private
-  context structure.
-
-  @param  Private               Context structure to fill in. 
-
-  @return EFI_SUCCESS           Initialization was a success
-
-**/
-EFI_STATUS
-UnixGopInitializeSimpleTextInForWindow (
-  IN  GOP_PRIVATE_DATA    *Private
-  )
-{
-  EFI_STATUS  Status;
-
-  //
-  // Initialize Simple Text In protoocol
-  //
-  Private->SimpleTextIn.Reset         = UnixGopSimpleTextInReset;
-  Private->SimpleTextIn.ReadKeyStroke = UnixGopSimpleTextInReadKeyStroke;
-
-  Status = gBS->CreateEvent (
-                  EVT_NOTIFY_WAIT,
-                  TPL_NOTIFY,
-                  UnixGopSimpleTextInWaitForKey,
-                  Private,
-                  &Private->SimpleTextIn.WaitForKey
-                  );
-  ASSERT_EFI_ERROR (Status);
-  
-  
-  //
-  // Initialize Simple Text In Ex
-  //
-  
-  Private->SimpleTextInEx.Reset               = UnixGopSimpleTextInExResetEx;
-  Private->SimpleTextInEx.ReadKeyStrokeEx     = UnixGopSimpleTextInExReadKeyStrokeEx;
-  Private->SimpleTextInEx.SetState            = UnixGopSimpleTextInExSetState;
-  Private->SimpleTextInEx.RegisterKeyNotify   = UnixGopSimpleTextInExRegisterKeyNotify;
-  Private->SimpleTextInEx.UnregisterKeyNotify = UnixGopSimpleTextInExUnregisterKeyNotify;
-
-  Private->SimpleTextInEx.Reset (&Private->SimpleTextInEx, FALSE);
-  
-  InitializeListHead (&Private->NotifyList);
-
-  Status = gBS->CreateEvent (
-                  EVT_NOTIFY_WAIT,
-                  TPL_NOTIFY,
-                  UnixGopSimpleTextInWaitForKey,
-                  Private,
-                  &Private->SimpleTextInEx.WaitForKeyEx
-                  );
-  ASSERT_EFI_ERROR (Status);
-
-
-  return Status;
-}
-
-
-
-
-
-
-
-//
-// Simple Pointer implementation.
-//
-
-
-/**                                                                 
-  Resets the pointer device hardware.
-    
-  @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
-                                instance.                                   
-  @param  ExtendedVerification  Indicates that the driver may perform a more exhaustive
-                                verification operation of the device during reset.                                       
-                                
-  @retval EFI_SUCCESS           The device was reset.
-  @retval EFI_DEVICE_ERROR      The device is not functioning correctly and could not be reset.  
-                                   
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimplePointerReset (
-  IN EFI_SIMPLE_POINTER_PROTOCOL          *This,
-  IN BOOLEAN                              ExtendedVerification
-  )
-{
-  GOP_PRIVATE_DATA             *Private;
-  EFI_SIMPLE_POINTER_STATE     State;
-  EFI_TPL                      OldTpl;
-
-  Private = GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_SUCCESS;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
-  //
-  // A reset is draining the Queue
-  //
-  while (Private->UgaIo->UgaGetPointerState (Private->UgaIo, &State) == EFI_SUCCESS)
-    ;
-
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-  return EFI_SUCCESS;
-}
-
-
-/**                                                                 
-  Retrieves the current state of a pointer device.
-    
-  @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
-                                instance.                                   
-  @param  State                 A pointer to the state information on the pointer device.
-                                
-  @retval EFI_SUCCESS           The state of the pointer device was returned in State.
-  @retval EFI_NOT_READY         The state of the pointer device has not changed since the last call to
-                                GetState().                                                           
-  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to retrieve the pointer device's
-                                current state.                                                           
-                                   
-**/
-EFI_STATUS
-EFIAPI
-UnixGopSimplePointerGetState (
-  IN EFI_SIMPLE_POINTER_PROTOCOL          *This,
-  IN OUT EFI_SIMPLE_POINTER_STATE         *State
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-
-  Private = GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_NOT_READY;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaGetPointerState (Private->UgaIo, State);
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-
-  return Status;
-}
-
-
-/**
-  SimplePointer Notify Wait Event 
-
-  @param  Event                 Event whose notification function is being invoked.
-  @param  Context               Pointer to GOP_PRIVATE_DATA.
-
-**/
-VOID
-EFIAPI
-UnixGopSimplePointerWaitForInput (
-  IN EFI_EVENT          Event,
-  IN VOID               *Context
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-
-  Private = (GOP_PRIVATE_DATA *) Context;
-  if (Private->UgaIo == NULL) {
-    return;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaCheckPointer (Private->UgaIo);
-  if (!EFI_ERROR (Status)) {
-    //
-    // If the pointer state has changed, signal our event.
-    //
-    gBS->SignalEvent (Event);
-  }
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-}
-
-
-/**
-  SimplePointer constructor 
-
-  @param  Private Context structure to fill in.      
-
-  @retval EFI_SUCCESS Constructor had success        
-
-**/
-EFI_STATUS
-UnixGopInitializeSimplePointerForWindow (
-  IN  GOP_PRIVATE_DATA    *Private
-  )
-{
-  EFI_STATUS  Status;
-
-  //
-  // Initialize Simple Pointer protoocol
-  //
-  Private->PointerMode.ResolutionX = 1;
-  Private->PointerMode.ResolutionY = 1;
-  Private->PointerMode.ResolutionZ = 1;
-  Private->PointerMode.LeftButton  = TRUE;
-  Private->PointerMode.RightButton = TRUE;
-
-  Private->SimplePointer.Reset     = UnixGopSimplePointerReset;
-  Private->SimplePointer.GetState  = UnixGopSimplePointerGetState;
-  Private->SimplePointer.Mode      = &Private->PointerMode;
-
-  Status = gBS->CreateEvent (
-                  EVT_NOTIFY_WAIT,
-                  TPL_NOTIFY,
-                  UnixGopSimplePointerWaitForInput,
-                  Private,
-                  &Private->SimplePointer.WaitForInput
-                  );
-
-  return Status;
-}
diff --git a/UnixPkg/UnixGopDxe/UnixGopScreen.c b/UnixPkg/UnixGopDxe/UnixGopScreen.c
deleted file mode 100644 (file)
index ed2a3e7..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-    UnixGopScreen.c
-
-Abstract:
-
-  This file produces the graphics abstration of UGA. It is called by
-  UnixGopDriver.c file which deals with the EFI 1.1 driver model.
-  This file just does graphics.
-
---*/
-
-#include "UnixGop.h"
-
-EFI_UNIX_THUNK_PROTOCOL *mUnix;
-EFI_EVENT               mGopScreenExitBootServicesEvent;
-
-GOP_MODE_DATA mGopModeData[] = {
-    { 800,  600, 0, 0 },
-    { 640,  480, 0, 0 },
-    { 720,  400, 0, 0 },
-    {1024,  768, 0, 0 },
-    {1280, 1024, 0, 0 }
-    };
-
-
-EFI_STATUS
-UnixGopStartWindow (
-  IN  GOP_PRIVATE_DATA    *Private,
-  IN  UINT32              HorizontalResolution,
-  IN  UINT32              VerticalResolution,
-  IN  UINT32              ColorDepth,
-  IN  UINT32              RefreshRate
-  );
-
-VOID
-EFIAPI
-KillUgaGopThread (
-  IN EFI_EVENT  Event,
-  IN VOID       *Context
-  );
-
-//
-// UGA Protocol Member Functions
-//
-
-EFI_STATUS
-EFIAPI
-UnixGopQuerytMode (
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL          *This,
-  IN  UINT32                                ModeNumber,
-  OUT UINTN                                 *SizeOfInfo,
-  OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-
-  Private = GOP_PRIVATE_DATA_FROM_THIS (This);
-
-  if (Info == NULL || SizeOfInfo == NULL || (UINTN) ModeNumber >= This->Mode->MaxMode) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-  if (*Info == NULL) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-
-  *SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
-
-  (*Info)->Version = 0;
-  (*Info)->HorizontalResolution = Private->ModeData[ModeNumber].HorizontalResolution;
-  (*Info)->VerticalResolution   = Private->ModeData[ModeNumber].VerticalResolution;
-  (*Info)->PixelFormat = PixelBltOnly;
-  (*Info)->PixelsPerScanLine = (*Info)->HorizontalResolution;
-
-  return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-EFIAPI
-UnixGopSetMode (
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL  *This,
-  IN  UINT32                        ModeNumber
-  )
-{
-  EFI_STATUS                      Status;
-  GOP_PRIVATE_DATA                *Private;
-  GOP_MODE_DATA                   *ModeData;
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL   Fill;
-
-  Private = GOP_PRIVATE_DATA_FROM_THIS (This);
-
-  if (ModeNumber >= This->Mode->MaxMode) {
-    return EFI_UNSUPPORTED;
-  }
-
-  ModeData = &Private->ModeData[ModeNumber];
-  This->Mode->Mode = ModeNumber;
-  Private->GraphicsOutput.Mode->Info->HorizontalResolution = ModeData->HorizontalResolution;
-  Private->GraphicsOutput.Mode->Info->VerticalResolution = ModeData->VerticalResolution;
-  Private->GraphicsOutput.Mode->Info->PixelsPerScanLine = ModeData->HorizontalResolution;
-
-  if (Private->HardwareNeedsStarting) {
-    Status = UnixGopStartWindow (
-              Private,
-              ModeData->HorizontalResolution,
-              ModeData->VerticalResolution,
-              ModeData->ColorDepth,
-              ModeData->RefreshRate
-              );
-    if (EFI_ERROR (Status)) {
-      return EFI_DEVICE_ERROR;
-    }
-
-    Private->HardwareNeedsStarting = FALSE;
-  }
-  
-  
-  Status = Private->UgaIo->UgaSize(
-                            Private->UgaIo,
-                            ModeData->HorizontalResolution,
-                            ModeData->VerticalResolution
-                            );
-
-
-  Fill.Red                      = 0x7f;
-  Fill.Green                    = 0x7F;
-  Fill.Blue                     = 0x7f;
-  This->Blt (
-          This,
-          &Fill,
-          EfiBltVideoFill,
-          0,
-          0,
-          0,
-          0,
-          ModeData->HorizontalResolution,
-          ModeData->VerticalResolution,
-          ModeData->HorizontalResolution * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-          );
-  return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-EFIAPI
-UnixGopBlt (
-  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL            *This,
-  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer,   OPTIONAL
-  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,
-  IN  UINTN                                   SourceX,
-  IN  UINTN                                   SourceY,
-  IN  UINTN                                   DestinationX,
-  IN  UINTN                                   DestinationY,
-  IN  UINTN                                   Width,
-  IN  UINTN                                   Height,
-  IN  UINTN                                   Delta         OPTIONAL
-  )
-{
-  GOP_PRIVATE_DATA  *Private;
-  EFI_TPL           OriginalTPL;
-  EFI_STATUS        Status;
-  UGA_BLT_ARGS      GopBltArgs;
-
-  Private = GOP_PRIVATE_DATA_FROM_THIS (This);
-
-  if ((BltOperation < 0) || (BltOperation >= EfiGraphicsOutputBltOperationMax)) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  if (Width == 0 || Height == 0) {
-    return EFI_INVALID_PARAMETER;
-  }
-  //
-  // If Delta is zero, then the entire BltBuffer is being used, so Delta
-  // is the number of bytes in each row of BltBuffer.  Since BltBuffer is Width pixels size,
-  // the number of bytes in each row can be computed.
-  //
-  if (Delta == 0) {
-    Delta = Width * sizeof (EFI_UGA_PIXEL);
-  }
-
-  //
-  // We have to raise to TPL Notify, so we make an atomic write the frame buffer.
-  // We would not want a timer based event (Cursor, ...) to come in while we are
-  // doing this operation.
-  //
-  OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
-
-  //
-  // Pack UGA Draw protocol parameters to UGA_BLT_ARGS structure to adapt to
-  // GopBlt() API of Unix UGA IO protocol.
-  //
-  GopBltArgs.DestinationX = DestinationX;
-  GopBltArgs.DestinationY = DestinationY;
-  GopBltArgs.Height       = Height;
-  GopBltArgs.Width        = Width;
-  GopBltArgs.SourceX      = SourceX;
-  GopBltArgs.SourceY      = SourceY;
-  GopBltArgs.Delta        = Delta;
-  Status = Private->UgaIo->UgaBlt (
-                            Private->UgaIo,
-                            (EFI_UGA_PIXEL *)BltBuffer,
-                            (EFI_UGA_BLT_OPERATION)BltOperation,
-                            &GopBltArgs
-                            );
-
-  gBS->RestoreTPL (OriginalTPL);
-
-  return Status;
-}
-
-
-//
-// Construction and Destruction functions
-//
-
-EFI_STATUS
-UnixGopSupported (
-  IN  EFI_UNIX_IO_PROTOCOL  *UnixIo
-  )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
-  None
-
---*/
-// TODO:    UnixIo - add argument and description to function comment
-// TODO:    EFI_UNSUPPORTED - add return value to function comment
-// TODO:    EFI_SUCCESS - add return value to function comment
-{
-  //
-  // Check to see if the IO abstraction represents a device type we support.
-  //
-  // This would be replaced a check of PCI subsystem ID, etc.
-  //
-  if (!CompareGuid (UnixIo->TypeGuid, &gEfiUnixGopGuid)) {
-    return EFI_UNSUPPORTED;
-  }
-
-  return EFI_SUCCESS;
-}
-
-
-VOID
-EFIAPI
-GopPrivateInvokeRegisteredFunction (
-  IN VOID           *Context,
-  IN EFI_KEY_DATA   *KeyData
-  );
-
-
-EFI_STATUS
-UnixGopStartWindow (
-  IN  GOP_PRIVATE_DATA    *Private,
-  IN  UINT32              HorizontalResolution,
-  IN  UINT32              VerticalResolution,
-  IN  UINT32              ColorDepth,
-  IN  UINT32              RefreshRate
-  )
-{
-  EFI_STATUS          Status;
-
-  mUnix  = Private->UnixThunk;
-
-  //
-  // Register to be notified on exit boot services so we can destroy the window.
-  //
-  Status = gBS->CreateEvent (
-                  EVT_SIGNAL_EXIT_BOOT_SERVICES,
-                  TPL_CALLBACK,
-                  KillUgaGopThread,
-                  Private,
-                  &mGopScreenExitBootServicesEvent
-                  );
-
-  Status = Private->UnixThunk->UgaCreate (&Private->UgaIo, Private->WindowName);
-  if (!EFI_ERROR (Status)) {
-    // Register callback to support RegisterKeyNotify()
-    Status  = Private->UgaIo->UgaRegisterKeyNotify (Private->UgaIo, GopPrivateInvokeRegisteredFunction, Private);
-    ASSERT_EFI_ERROR (Status);
-  }
-  return Status;
-}
-
-EFI_STATUS
-UnixGopConstructor (
-  GOP_PRIVATE_DATA    *Private
-  )
-{
-  Private->ModeData = mGopModeData;
-
-  Private->GraphicsOutput.QueryMode      = UnixGopQuerytMode;
-  Private->GraphicsOutput.SetMode        = UnixGopSetMode;
-  Private->GraphicsOutput.Blt            = UnixGopBlt;
-
-  //
-  // Allocate buffer for Graphics Output Protocol mode information
-  //
-  Private->GraphicsOutput.Mode = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));
-  if (Private->GraphicsOutput.Mode == NULL) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-  Private->GraphicsOutput.Mode->Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-  if (Private->GraphicsOutput.Mode->Info == NULL) {
-    return EFI_OUT_OF_RESOURCES;
-  }
-
-  Private->GraphicsOutput.Mode->MaxMode = sizeof(mGopModeData) / sizeof(GOP_MODE_DATA);
-  //
-  // Till now, we have no idea about the window size.
-  //
-  Private->GraphicsOutput.Mode->Mode = GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER;
-  Private->GraphicsOutput.Mode->Info->Version = 0;
-  Private->GraphicsOutput.Mode->Info->HorizontalResolution = 0;
-  Private->GraphicsOutput.Mode->Info->VerticalResolution = 0;
-  Private->GraphicsOutput.Mode->Info->PixelFormat = PixelBltOnly;
-  Private->GraphicsOutput.Mode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
-  Private->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) NULL;
-  Private->GraphicsOutput.Mode->FrameBufferSize = 0;
-
-  Private->HardwareNeedsStarting  = TRUE;
-  Private->UgaIo                  = NULL;
-
-  UnixGopInitializeSimpleTextInForWindow (Private);
-
-  UnixGopInitializeSimplePointerForWindow (Private);
-
-  return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-UnixGopDestructor (
-  GOP_PRIVATE_DATA     *Private
-  )
-{
-  if (!Private->HardwareNeedsStarting) {
-    Private->UgaIo->UgaClose (Private->UgaIo);
-    Private->UgaIo = NULL;
-  }
-
-  //
-  // Free graphics output protocol occupied resource
-  //
-  if (Private->GraphicsOutput.Mode != NULL) {
-    if (Private->GraphicsOutput.Mode->Info != NULL) {
-      FreePool (Private->GraphicsOutput.Mode->Info);
-    }
-    FreePool (Private->GraphicsOutput.Mode);
-  }
-
-  return EFI_SUCCESS;
-}
-
-VOID
-EFIAPI
-KillUgaGopThread (
-  IN EFI_EVENT  Event,
-  IN VOID       *Context
-  )
-/*++
-
-Routine Description:
-
-  This is the UGA screen's callback notification function for exit-boot-services.
-  All we do here is call UnixGopDestructor().
-
-Arguments:
-
-  Event   - not used
-  Context - pointer to the Private structure.
-
-Returns:
-
-  None.
-
---*/
-{
-  EFI_STATUS  Status;
-  Status = UnixGopDestructor (Context);
-}
diff --git a/UnixPkg/UnixPkg.dec b/UnixPkg/UnixPkg.dec
deleted file mode 100644 (file)
index 7f7d516..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-## @file\r
-#\r
-# This is the Unix Emulation Environment Platform\r
-#\r
-# Reference platform implementation using an emulator.\r
-# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#    This program and the accompanying materials are licensed and made available \r
-#    under the terms and conditions of the BSD License which accompanies this distribution.\r
-#    The full text of the license may be found at http://opensource.org/licenses/bsd-license.php\r
-#    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES\r
-#    OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-##\r
-\r
-[Defines]\r
-  DEC_SPECIFICATION              = 0x00010005\r
-  PACKAGE_NAME                   = EdkUnixPkg\r
-  PACKAGE_GUID                   = f2805c44-8985-11db-9e98-0040d02b1835\r
-  PACKAGE_VERSION                = 0.1\r
-\r
-[Includes]\r
-  Include\r
-\r
-[LibraryClasses]\r
-  UnixLib|Include/Library/UnixLib.h\r
-\r
-[Guids]\r
-  gEfiUnixPkgTokenSpaceGuid      = {0xf2b6838c, 0x8985, 0x11db, {0x9d, 0x1c, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixVirtualDisksGuid       = {0xf2ba331a, 0x8985, 0x11db, {0xa4, 0x06, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixPhysicalDisksGuid      = {0xf2bdcc96, 0x8985, 0x11db, {0x87, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixFileSystemGuid         = {0xf2c16b9e, 0x8985, 0x11db, {0x92, 0xc8, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixUgaGuid                = {0xf2c8b80e, 0x8985, 0x11db, {0x93, 0xf1, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixGopGuid                = {0xbace07c2, 0x8987, 0x11db, {0xa5, 0x9a, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixConsoleGuid            = {0xf2cc5d06, 0x8985, 0x11db, {0xbb, 0x19, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixMemoryGuid             = {0xf2d006cc, 0x8985, 0x11db, {0xa4, 0x72, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixCPUModelGuid           = {0xf2d3b330, 0x8985, 0x11db, {0x8a, 0xa3, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixCPUSpeedGuid           = {0xf2d74e5a, 0x8985, 0x11db, {0x97, 0x05, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixSerialPortGuid         = {0x6d3a727d, 0x66c8, 0x4d19, {0x87, 0xe6, 0x02, 0x15, 0x86, 0x14, 0x90, 0xf3}}\r
-  gEfiUnixSystemConfigGuid       = {0x375ea976, 0x3ccd, 0x4e74, {0xa8, 0x45, 0x26, 0xb9, 0xb3, 0x24, 0xb1, 0x3c}}\r
-  gEfiUnixNetworkGuid            = {0x081603B4, 0x0F1D, 0x4022, {0xB6, 0xFD, 0x4C, 0xE3, 0x5E, 0x09, 0xA1, 0xA6}}\r
-\r
-[Ppis]\r
-  gPeiUnixAutoScanPpiGuid        = {0xf2ed3d14, 0x8985, 0x11db, {0xb0, 0x57, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gUnixFwhPpiGuid                = {0xf2f0dc30, 0x8985, 0x11db, {0xa1, 0x5b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gUnixPeiLoadFilePpiGuid        = {0xf2f48768, 0x8985, 0x11db, {0xb8, 0xda, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gPeiUnixThunkPpiGuid           = {0xf2f830f2, 0x8985, 0x11db, {0x80, 0x6b, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-\r
-[Protocols]\r
-  gEfiUnixIoProtocolGuid         = {0xf2e23f54, 0x8985, 0x11db, {0xac, 0x79, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixUgaIoProtocolGuid      = {0xf2e5e2c6, 0x8985, 0x11db, {0xa1, 0x91, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-  gEfiUnixThunkProtocolGuid      = {0xf2e98868, 0x8985, 0x11db, {0x9a, 0x59, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35}}\r
-\r
-[PcdsFixedAtBuild]\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageVariableBase|0x0|UINT64|0x00001014\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwSpareBase|0x0|UINT64|0x00001015\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwWorkingBase|0x0|UINT64|0x00001016\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFdBaseAddress|0x0|UINT64|0x00001017\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogBase|0x0|UINT64|0x0000100e\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogSize|0x0|UINT32|0x0000100f\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoveryBase|0x0|UINT64|0x00001010\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoverySize|0x0|UINT32|0x00001011\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize|0x0|UINT32|0x00001012\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareBlockSize|0|UINT32|0x00001013\r
-\r
-[PcdsFixedAtBuild, PcdsPatchableInModule]\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixBootMode|1|UINT32|0x00001006\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareVolume|L"..\\Fv\\Fv_Recovery.fd"|VOID*|0x00001009\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySizeForSecMain|L"64!64"|VOID*|0x0000100c\r
-  \r
-[PcdsDynamic, PcdsDynamicEx]\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixPhysicalDisk|L"E:RW;245760;512"|VOID*|0x00001000\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixVirtualDisk|L"FW;40960;512"|VOID*|0x00001001\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixUga|L"UGA Window"|VOID*|0x00001003\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixGop|L"GOP Window"|VOID*|0x00001018\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFileSystem|L".!..\\..\\..\\..\\..\\EdkShellBinPkg\\bin\\ia32\\Apps"|VOID*|0x00001004\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySize|L"64!64"|VOID*|0x00001005\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuModel|L"Intel(R) Processor Model"|VOID*|0x00001007\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuSpeed|L"3000"|VOID*|0x00001008\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixConsole|L"Bus Driver Console Window"|VOID*|0x0000100a\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixSerialPort|L"/dev/ttyS0"|VOID*|0x00001002\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixNetworkInterface|L"en0"|VOID*|0x0000100d\r
diff --git a/UnixPkg/UnixPkg.dsc b/UnixPkg/UnixPkg.dsc
deleted file mode 100644 (file)
index 1ea4eb8..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-## @file\r
-#\r
-# EFI/Framework Emulation Platform with UEFI HII interface supported.\r
-#\r
-# The Emulation Platform can be used to debug individual modules, prior to creating\r
-#       a real platform. This also provides an example for how an DSC is created.\r
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#    This program and the accompanying materials\r
-#    are licensed and made available under the terms and conditions of the BSD License\r
-#    which accompanies this distribution. The full text of the license may be found at\r
-#    http://opensource.org/licenses/bsd-license.php\r
-#\r
-#    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-##\r
-\r
-################################################################################\r
-#\r
-# Defines Section - statements that will be processed to create a Makefile.\r
-#\r
-################################################################################\r
-[Defines]\r
-  PLATFORM_NAME                  = Unix\r
-  PLATFORM_GUID                  = 7b3c1fb4-8986-11db-b5b2-0040d02b1835\r
-  PLATFORM_VERSION               = 0.3\r
-  DSC_SPECIFICATION              = 0x00010005\r
-  OUTPUT_DIRECTORY               = Build/Unix\r
-  SUPPORTED_ARCHITECTURES        = IA32\r
-  BUILD_TARGETS                  = DEBUG|RELEASE\r
-  SKUID_IDENTIFIER               = DEFAULT\r
-  FLASH_DEFINITION               = UnixPkg/UnixPkg.fdf\r
-\r
-################################################################################\r
-#\r
-# SKU Identification section - list of all SKU IDs supported by this Platform.\r
-#\r
-################################################################################\r
-[SkuIds]\r
-  0|DEFAULT\r
-\r
-################################################################################\r
-#\r
-# Library Class section - list of all Library Classes needed by this Platform.\r
-#\r
-################################################################################\r
-[LibraryClasses]\r
-  #\r
-  # Entry point\r
-  #\r
-  PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
-  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
-  DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
-  UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
-  UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
-  #\r
-  # Basic\r
-  #\r
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
-  SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf\r
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
-  CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
-  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
-  PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
-  #\r
-  # UEFI & PI\r
-  #\r
-  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
-  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
-  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf\r
-  UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
-  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
-  UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
-  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
-  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
-  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf\r
-  DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
-  #\r
-  # Generic Modules\r
-  #\r
-  UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf\r
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf\r
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf\r
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf\r
-  OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
-  GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf\r
-  SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf\r
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
-  SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf\r
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf\r
-  #\r
-  # Platform\r
-  #\r
-  PlatformBdsLib|UnixPkg/Library/UnixBdsLib/PlatformBds.inf\r
-  #\r
-  # Misc\r
-  #\r
-  DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
-  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
-  PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
-  DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
-  SecDispatchTableLib|UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.inf\r
-  CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
-\r
-[LibraryClasses.common.USER_DEFINED]\r
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
-  PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/PeiUnixOemHookStatusCodeLib/PeiUnixOemHookStatusCodeLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
-\r
-[LibraryClasses.common.PEIM, LibraryClasses.common.PEI_CORE]\r
-  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
-  PeCoffGetEntryPointLib|UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/EdkUnixPeiPeCoffGetEntryPointLib.inf\r
-  PeCoffExtraActionLib|UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf\r
-  ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf\r
-\r
-[LibraryClasses.common.PEIM]\r
-  PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/PeiUnixOemHookStatusCodeLib/PeiUnixOemHookStatusCodeLib.inf\r
-\r
-[LibraryClasses.common.PEI_CORE]\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-\r
-[LibraryClasses.common.DXE_CORE]\r
-  HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf\r
-  MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  PeCoffExtraActionLib|UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf\r
-  ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
-\r
-[LibraryClasses.common.DXE_SMM_DRIVER]\r
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/DxeUnixOemHookStatusCodeLib/DxeUnixOemHookStatusCodeLib.inf\r
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
-\r
-[LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.UEFI_APPLICATION]\r
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  UnixLib|UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/DxeUnixOemHookStatusCodeLib/DxeUnixOemHookStatusCodeLib.inf\r
-  PeCoffExtraActionLib|UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf\r
-\r
-[LibraryClasses.common.UEFI_APPLICATION]\r
-  PrintLib|MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf\r
-\r
-[LibraryClasses.X64]\r
-  BaseLib|UnixPkg/Library/UnixBaseLib/UnixBaseLib.inf\r
-\r
-################################################################################\r
-#\r
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform.\r
-#\r
-################################################################################\r
-[PcdsFeatureFlag]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseOEM|TRUE\r
-\r
-[PcdsFixedAtBuild]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE\r
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000040\r
-  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0f\r
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x1f\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0x0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x0\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize|0x002a0000\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareBlockSize|0x10000\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareVolume|L"../FV/FV_RECOVERY.fd"\r
-\r
-################################################################################\r
-#\r
-# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform\r
-#\r
-################################################################################\r
-\r
-[PcdsDynamicDefault.common.DEFAULT]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0\r
-\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixConsole|L"Bus Driver Console Window"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixUga|L"UGA Window"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFileSystem|L".!../../../../EdkShellBinPkg/Bin/Ia32/Apps"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixVirtualDisk|L"disk1.img:FW"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixPhysicalDisk|L"E:RW;245760;512"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuModel|L"Intel(R) Processor Model"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuSpeed|L"3000"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySize|L"128!128"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixSerialPort|L"/dev/ttyS0!/dev/ttyS1"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixNetworkInterface|L"en0"\r
-\r
-[PcdsDynamicHii.common.DEFAULT]\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|L"SetupConsoleConfig"|gEfiGlobalVariableGuid|0x0|80\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|L"SetupConsoleConfig"|gEfiGlobalVariableGuid|0x4|25\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|10\r
-  \r
-###################################################################################################\r
-#\r
-# Components Section - list of the modules and components that will be processed by compilation\r
-#                      tools and the EDK II tools to generate PE32/PE32+/Coff image files.\r
-#\r
-# Note: The EDK II DSC file is not used to specify how compiled binary images get placed\r
-#       into firmware volume images. This section is just a list of modules to compile from\r
-#       source into UEFI-compliant binaries.\r
-#       It is the FDF file that contains information on combining binary files into firmware\r
-#       volume images, whose concept is beyond UEFI and is described in PI specification.\r
-#       Binary modules do not need to be listed in this section, as they should be\r
-#       specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),\r
-#       Logo (Logo.bmp), and etc.\r
-#       There may also be modules listed in this section that are not required in the FDF file,\r
-#       When a module listed here is excluded from FDF file, then UEFI-compliant binary will be\r
-#       generated for it, but the binary will not be put into any firmware volume.\r
-#\r
-###################################################################################################\r
-[Components]\r
-  ##\r
-  #  SEC Phase modules\r
-  ##\r
-  UnixPkg/Sec/SecMain.inf\r
-\r
-  ##\r
-  #  PEI Phase modules\r
-  ##\r
-  MdeModulePkg/Core/Pei/PeiMain.inf\r
-  MdeModulePkg/Universal/PCD/Pei/Pcd.inf  {\r
-   <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf\r
-  UnixPkg/BootModePei/BootModePei.inf\r
-  UnixPkg/UnixFlashMapPei/FlashMap.inf\r
-  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
-  UnixPkg/UnixAutoScanPei/UnixAutoScan.inf\r
-  UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf\r
-  UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.inf\r
-  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
-\r
-  ##\r
-  #  DXE Phase modules\r
-  ##\r
-  MdeModulePkg/Core/Dxe/DxeMain.inf {\r
-    <LibraryClasses>\r
-      NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf\r
-      NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf\r
-  }\r
-  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-\r
-  UnixPkg/MetronomeDxe/Metronome.inf\r
-  UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.inf\r
-  UnixPkg/ResetRuntimeDxe/Reset.inf\r
-  MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
-  UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf\r
-  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
-  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf\r
-  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf\r
-  UnixPkg/UnixThunkDxe/UnixThunk.inf\r
-  UnixPkg/CpuRuntimeDxe/Cpu.inf\r
-  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
-  UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf\r
-  UnixPkg/TimerDxe/Timer.inf\r
-  IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf\r
-  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
-  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
-  MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
-  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
-  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
-  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
-  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
-  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
-  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf\r
-  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
-  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
-  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
-  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
-  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
-  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf\r
-  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf\r
-  IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf\r
-  UnixPkg/UnixBusDriverDxe/UnixBusDriver.inf\r
-\r
-  UnixPkg/UnixBlockIoDxe/UnixBlockIo.inf\r
-  UnixPkg/UnixSerialIoDxe/UnixSerialIo.inf\r
-  UnixPkg/UnixUgaDxe/UnixUga.inf\r
-  UnixPkg/UnixGopDxe/UnixGop.inf\r
-  \r
-  UnixPkg/UnixConsoleDxe/UnixConsole.inf\r
-  UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.inf\r
-  MdeModulePkg/Application/HelloWorld/HelloWorld.inf\r
-\r
-  #\r
-  # Network stack drivers\r
-  #\r
-!if $(NETWORK_SUPPORT)\r
-  UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
-!endif\r
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
-  MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf\r
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf\r
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
-\r
-  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf\r
-  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
-  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
-  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
-  MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-\r
-!if $(COMPILE_BINS)\r
-  FatPkg/EnhancedFatDxe/Fat.inf\r
-!endif\r
-\r
diff --git a/UnixPkg/UnixPkg.fdf b/UnixPkg/UnixPkg.fdf
deleted file mode 100644 (file)
index 42e73a2..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-## @file\r
-# This is Unix FDF file with UEFI HII features enabled\r
-#\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#    This program and the accompanying materials\r
-#    are licensed and made available under the terms and conditions of the BSD License\r
-#    which accompanies this distribution. The full text of the license may be found at\r
-#    http://opensource.org/licenses/bsd-license.php\r
-#\r
-#    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-\r
-################################################################################\r
-#\r
-# FD Section\r
-# The [FD] Section is made up of the definition statements and a\r
-# description of what goes into  the Flash Device Image.  Each FD section\r
-# defines one flash "device" image.  A flash device image may be one of\r
-# the following: Removable media bootable image (like a boot floppy\r
-# image,) an Option ROM image (that would be "flashed" into an add-in\r
-# card,) a System "Flash"  image (that would be burned into a system's\r
-# flash) or an Update ("Capsule") image that will be used to update and\r
-# existing system flash.\r
-#\r
-################################################################################\r
-[FD.Fv_Recovery]\r
-#\r
-# In OS X PEIMs are really XIP, so we need to make this address match the malloced \r
-# buffer for the FD (0x41000000). If this address does not match the FV will get\r
-# relocated in place (works, but not a great idea).\r
-#\r
-BaseAddress   = 0x41000000|gEfiUnixPkgTokenSpaceGuid.PcdUnixFdBaseAddress   #The base address of the FLASH Device.\r
-Size          = 0x00300000|gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize  #The size in bytes of the FLASH Device\r
-ErasePolarity = 1\r
-BlockSize     = 0x10000\r
-NumBlocks     = 0x30\r
-\r
-################################################################################\r
-#\r
-# Following are lists of FD Region layout which correspond to the locations of different\r
-# images within the flash device.\r
-#\r
-# Regions must be defined in ascending order and may not overlap.\r
-#\r
-# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by\r
-# the pipe "|" character, followed by the size of the region, also in hex with the leading\r
-# "0x" characters. Like:\r
-# Offset|Size\r
-# PcdOffsetCName|PcdSizeCName\r
-# RegionType <FV, DATA, or FILE>\r
-#\r
-################################################################################\r
-0x00000000|0x002e0000\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoveryBase|gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoverySize\r
-FV = FvRecovery\r
-\r
-0x002e0000|0x0000c000\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-#NV_VARIABLE_STORE\r
-DATA = {\r
-  ## This is the EFI_FIRMWARE_VOLUME_HEADER\r
-  # ZeroVector []\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  # FileSystemGuid: gEfiSystemNvDataFvGuid         =\r
-  #  { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}\r
-  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,\r
-  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,\r
-  # FvLength: 0x20000\r
-  0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  # Signature "_FVH"       #Attributes\r
-  0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00,\r
-  # HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision\r
-  0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02,\r
-  # Blockmap[0]: 2 Blocks * 0x10000 Bytes / Block\r
-  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,\r
-  # Blockmap[1]: End\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  ## This is the VARIABLE_STORE_HEADER\r
-  #Signature: gEfiVariableGuid =\r
-  #  { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}\r
-  0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,\r
-  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,\r
-  #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xBFB8\r
-  # This can speed up the Variable Dispatch a bit.\r
-  0xB8, 0xBF, 0x00, 0x00,\r
-  #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32\r
-  0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
-}\r
-\r
-0x002ec000|0x00002000\r
-#NV_EVENT_LOG\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogBase|gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogSize\r
-\r
-0x002ee000|0x00002000\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-#NV_FTW_WORKING\r
-DATA = {\r
-  # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEfiSystemNvDataFvGuid         =\r
-  #  { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}\r
-  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,\r
-  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,\r
-  # Crc:UINT32            #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved\r
-  0x77, 0x13, 0x9B, 0xD7, 0xFE, 0xFF, 0xFF, 0xFF,\r
-  # WriteQueueSize: UINT64\r
-  0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
-}\r
-\r
-0x002f0000|0x00010000\r
-#NV_FTW_SPARE\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-\r
-################################################################################\r
-#\r
-# FV Section\r
-#\r
-# [FV] section is used to define what components or modules are placed within a flash\r
-# device file.  This section also defines order the components and modules are positioned\r
-# within the image.  The [FV] section consists of define statements, set statements and\r
-# module statements.\r
-#\r
-################################################################################\r
-[FV.FvRecovery]\r
-FvAlignment        = 16         #FV alignment and FV attributes setting.\r
-ERASE_POLARITY     = 1\r
-MEMORY_MAPPED      = TRUE\r
-STICKY_WRITE       = TRUE\r
-LOCK_CAP           = TRUE\r
-LOCK_STATUS        = TRUE\r
-WRITE_DISABLED_CAP = TRUE\r
-WRITE_ENABLED_CAP  = TRUE\r
-WRITE_STATUS       = TRUE\r
-WRITE_LOCK_CAP     = TRUE\r
-WRITE_LOCK_STATUS  = TRUE\r
-READ_DISABLED_CAP  = TRUE\r
-READ_ENABLED_CAP   = TRUE\r
-READ_STATUS        = TRUE\r
-READ_LOCK_CAP      = TRUE\r
-READ_LOCK_STATUS   = TRUE\r
-\r
-################################################################################\r
-#\r
-# The INF statements point to EDK component and EDK II module INF files, which will be placed into this FV image.\r
-# Parsing tools will scan the INF file to determine the type of component or module.\r
-# The component or module type is used to reference the standard rules\r
-# defined elsewhere in the FDF file.\r
-#\r
-# The format for INF statements is:\r
-# INF $(PathAndInfFileName)\r
-#\r
-################################################################################\r
-##\r
-#  PEI Phase modules\r
-##\r
-##\r
-#  PEI Apriori file example, more PEIM module added later.\r
-##\r
-APRIORI PEI {\r
-  INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf\r
-  INF  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf\r
-  }\r
-APRIORI DXE {\r
-  INF  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
-  INF  IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf\r
-  INF  UnixPkg/MetronomeDxe/Metronome.inf\r
-  }\r
-INF  MdeModulePkg/Core/Pei/PeiMain.inf\r
-INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf\r
-INF  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf\r
-INF  UnixPkg/BootModePei/BootModePei.inf\r
-INF  UnixPkg/UnixFlashMapPei/FlashMap.inf\r
-INF  UnixPkg/UnixAutoScanPei/UnixAutoScan.inf\r
-INF  UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf\r
-INF  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
-INF  UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.inf\r
-INF  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
-\r
-##\r
-#  DXE Phase modules\r
-##\r
-INF  MdeModulePkg/Core/Dxe/DxeMain.inf\r
-INF  IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
-INF  UnixPkg/MetronomeDxe/Metronome.inf\r
-INF  UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.inf\r
-INF  UnixPkg/ResetRuntimeDxe/Reset.inf\r
-INF  MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
-INF  UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf\r
-INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
-INF  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf\r
-INF  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf\r
-INF  UnixPkg/UnixThunkDxe/UnixThunk.inf\r
-INF  UnixPkg/CpuRuntimeDxe/Cpu.inf\r
-INF  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
-INF  UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf\r
-INF  UnixPkg/TimerDxe/Timer.inf\r
-INF  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
-INF  MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
-INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
-INF  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
-INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
-INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
-INF  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
-INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf\r
-INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf\r
-INF  IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf\r
-INF  UnixPkg/UnixBusDriverDxe/UnixBusDriver.inf\r
\r
-INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf\r
-INF  UnixPkg/UnixBlockIoDxe/UnixBlockIo.inf\r
-INF  UnixPkg/UnixSerialIoDxe/UnixSerialIo.inf\r
-#INF  UnixPkg/UnixUgaDxe/UnixUga.inf\r
-INF  UnixPkg/UnixGopDxe/UnixGop.inf\r
-\r
-#INF  UnixPkg/UnixConsoleDxe/UnixConsole.inf\r
-INF  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
-INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
-INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
-INF  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf \r
-INF  UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.inf\r
-INF  MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf\r
-INF  MdeModulePkg/Application/HelloWorld/HelloWorld.inf\r
-\r
-#\r
-# Network stack drivers\r
-#\r
-!if $(NETWORK_SUPPORT)\r
-INF  UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
-!endif\r
-INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
-INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
-INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
-INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
-INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf\r
-INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
-\r
-#\r
-# Build from source or use checked in binary\r
-#\r
-!if $(COMPILE_BINS)\r
-INF FatPkg/EnhancedFatDxe/Fat.inf\r
-!else\r
-INF  RuleOverride = BINARY USE = IA32 FatBinPkg/EnhancedFatDxe/Fat.inf\r
-!endif\r
-\r
-# If  you build GccShellPkg you can source level debug shell\r
-#FILE APPLICATION = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile) {\r
-#  SECTION PE32 =Build/GccShellPkg/DEBUG_XCODE32/IA32/ShellFull.efi\r
-#}\r
-INF  RuleOverride = BINARY USE = IA32 EdkShellBinPkg/FullShell/FullShell.inf\r
-\r
-\r
-FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {\r
-  SECTION RAW = MdeModulePkg/Logo/Logo.bmp\r
-}\r
-   \r
-   \r
-################################################################################\r
-#  \r
-# Rules are use with the [FV] section's module INF type to define\r
-# how an FFS file is created for a given INF file. The following Rule are the default\r
-# rules for the different module type. User can add the customized rules to define the\r
-# content of the FFS file.\r
-#  \r
-################################################################################\r
-   \r
-   \r
-############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section   # \r
-############################################################################\r
-#  \r
-#[Rule.Common.DXE_DRIVER]\r
-#  FILE DRIVER = $(NAMED_GUID) {\r
-#    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-#    COMPRESS PI_STD {\r
-#      GUIDED {\r
-#        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-#        UI       STRING="$(MODULE_NAME)" Optional\r
-#        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-#      }\r
-#    }\r
-#  }\r
-#\r
-############################################################################\r
-\r
-[Rule.Common.PEI_CORE]\r
-  FILE PEI_CORE = $(NAMED_GUID) {\r
-    PE32     PE32    Align=32       $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-    UI       STRING ="$(MODULE_NAME)" Optional         \r
-    VERSION  STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)    \r
-  }\r
-\r
-[Rule.Common.PEIM]\r
-  FILE PEIM = $(NAMED_GUID) {\r
-     PEI_DEPEX PEI_DEPEX Optional        $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-     PE32      PE32   Align=32       $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-     UI       STRING="$(MODULE_NAME)" Optional         \r
-     VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)   \r
-  }\r
-\r
-[Rule.Common.DXE_CORE]\r
-  FILE DXE_CORE = $(NAMED_GUID) {\r
-    COMPRESS PI_STD {\r
-      PE32     PE32           $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-      UI       STRING="$(MODULE_NAME)" Optional\r
-      VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.DXE_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.DXE_RUNTIME_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_APPLICATION]\r
-  FILE APPLICATION = $(NAMED_GUID) {\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-  \r
-  \r
-[Rule.Common.UEFI_DRIVER.BINARY]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX DXE_DEPEX Optional      |.depex\r
-    PE32      PE32                    |.efi\r
-    UI        STRING="$(MODULE_NAME)" Optional\r
-    VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-  }\r
-\r
-[Rule.Common.UEFI_APPLICATION.BINARY]\r
-  FILE APPLICATION = $(NAMED_GUID) {\r
-    PE32      PE32                    |.efi\r
-    UI        STRING="$(MODULE_NAME)" Optional\r
-    VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-  }\r
-\r
diff --git a/UnixPkg/UnixPkgX64.dsc b/UnixPkg/UnixPkgX64.dsc
deleted file mode 100644 (file)
index a2e5452..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-## @file\r
-#\r
-# EFI/Framework Emulation Platform with UEFI HII interface supported.\r
-#\r
-# The Emulation Platform can be used to debug individual modules, prior to creating\r
-#       a real platform. This also provides an example for how an DSC is created.\r
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-# Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-#\r
-#    This program and the accompanying materials\r
-#    are licensed and made available under the terms and conditions of the BSD License\r
-#    which accompanies this distribution. The full text of the license may be found at\r
-#    http://opensource.org/licenses/bsd-license.php\r
-#\r
-#    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-##\r
-\r
-################################################################################\r
-#\r
-# Defines Section - statements that will be processed to create a Makefile.\r
-#\r
-################################################################################\r
-[Defines]\r
-  PLATFORM_NAME                  = Unix\r
-  PLATFORM_GUID                  = 7b3c1fb4-8986-11db-b5b2-0040d02b1835\r
-  PLATFORM_VERSION               = 0.3\r
-  DSC_SPECIFICATION              = 0x00010005\r
-  OUTPUT_DIRECTORY               = Build/UnixX64\r
-  SUPPORTED_ARCHITECTURES        = X64\r
-  BUILD_TARGETS                  = DEBUG|RELEASE\r
-  SKUID_IDENTIFIER               = DEFAULT\r
-  FLASH_DEFINITION               = UnixPkg/UnixPkgX64.fdf\r
-\r
-################################################################################\r
-#\r
-# SKU Identification section - list of all SKU IDs supported by this Platform.\r
-#\r
-################################################################################\r
-[SkuIds]\r
-  0|DEFAULT\r
-\r
-################################################################################\r
-#\r
-# Library Class section - list of all Library Classes needed by this Platform.\r
-#\r
-################################################################################\r
-[LibraryClasses]\r
-  #\r
-  # Entry point\r
-  #\r
-  PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf\r
-  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
-  DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf\r
-  UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
-  UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
-  #\r
-  # Basic\r
-  #\r
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
-  SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf\r
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
-  CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
-  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
-  PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
-  #\r
-  # UEFI & PI\r
-  #\r
-  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
-  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
-  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf\r
-  UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
-  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
-  UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
-  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
-  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
-  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf\r
-  DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
-  #\r
-  # Generic Modules\r
-  #\r
-  UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf\r
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf\r
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf\r
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf\r
-  OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
-  GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf\r
-  SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf\r
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
-  SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf\r
-  CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf\r
-  #\r
-  # Platform\r
-  #\r
-  PlatformBdsLib|UnixPkg/Library/UnixBdsLib/PlatformBds.inf\r
-  #\r
-  # Misc\r
-  #\r
-  DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
-  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
-  PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
-  DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
-  SecDispatchTableLib|UnixPkg/Library/SecDispatchTableLib/SecDispatchTableLib.inf\r
-  LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
-  CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
-\r
-[LibraryClasses.common.USER_DEFINED]\r
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
-  PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/PeiUnixOemHookStatusCodeLib/PeiUnixOemHookStatusCodeLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
-\r
-[LibraryClasses.common.PEIM, LibraryClasses.common.PEI_CORE]\r
-  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf\r
-  PeCoffGetEntryPointLib|UnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/EdkUnixPeiPeCoffGetEntryPointLib.inf\r
-  PeCoffExtraActionLib|UnixPkg/Library/PeiUnixPeCoffExtraActionLib/PeiUnixPeCoffExtraActionLib.inf\r
-  ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf\r
-\r
-[LibraryClasses.common.PEIM]\r
-  PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/PeiUnixOemHookStatusCodeLib/PeiUnixOemHookStatusCodeLib.inf\r
-\r
-[LibraryClasses.common.PEI_CORE]\r
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-\r
-[LibraryClasses.common.DXE_CORE]\r
-  HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf\r
-  MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  PeCoffExtraActionLib|UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf\r
-  ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
-\r
-[LibraryClasses.common.DXE_SMM_DRIVER]\r
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/DxeUnixOemHookStatusCodeLib/DxeUnixOemHookStatusCodeLib.inf\r
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
-\r
-[LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.UEFI_APPLICATION]\r
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
-  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
-  ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf\r
-  UnixLib|UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf\r
-  OemHookStatusCodeLib|UnixPkg/Library/DxeUnixOemHookStatusCodeLib/DxeUnixOemHookStatusCodeLib.inf\r
-  PeCoffExtraActionLib|UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.inf\r
-\r
-[LibraryClasses.common.UEFI_APPLICATION]\r
-  PrintLib|MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf\r
-\r
-[LibraryClasses.X64]\r
-  # turn off CR3 write so that DXE IPL will not crash emulator\r
-  BaseLib|UnixPkg/Library/UnixBaseLib/UnixBaseLib.inf\r
-\r
-################################################################################\r
-#\r
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform.\r
-#\r
-################################################################################\r
-[PcdsFeatureFlag]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseOEM|TRUE\r
-\r
-[PcdsFixedAtBuild]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE\r
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000040\r
-  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0f\r
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x1f\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule|0x0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule|0x0\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize|0x002a0000\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareBlockSize|0x10000\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareVolume|L"../FV/FV_RECOVERY.fd"\r
-\r
-################################################################################\r
-#\r
-# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform\r
-#\r
-################################################################################\r
-\r
-[PcdsDynamicDefault.common.DEFAULT]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixConsole|L"Bus Driver Console Window"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixUga|L"UGA Window"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixFileSystem|L".!../../../../EdkShellBinPkg/Bin/Ia32/Apps"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixVirtualDisk|L"disk1.img:FW"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixPhysicalDisk|L"E:RW;245760;512"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuModel|L"Intel(R) Processor Model"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixCpuSpeed|L"3000"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySize|L"128!128"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixSerialPort|L"/dev/ttyS0!/dev/ttyS1"\r
-  gEfiUnixPkgTokenSpaceGuid.PcdUnixNetworkInterface|L"en0"\r
-\r
-[PcdsDynamicHii.common.DEFAULT]\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutColumn|L"SetupConsoleConfig"|gEfiGlobalVariableGuid|0x0|80\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupConOutRow|L"SetupConsoleConfig"|gEfiGlobalVariableGuid|0x4|25\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|10\r
-\r
-[BuildOptions]\r
-  # Magic to make system include files work\r
-  XCODE:*_XCLANG_*_CC_FLAGS = -U __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -D __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1060 -D __APPLE__ -I/System/Library/Frameworks -I/Library/Frameworks\r
-  XCODE:*_XCLANG_*_PP_FLAGS = -U __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -D __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1060 -D __APPLE__ -I/System/Library/Frameworks -I/Library/Frameworks\r
-\r
-\r
-###################################################################################################\r
-#\r
-# Components Section - list of the modules and components that will be processed by compilation\r
-#                      tools and the EDK II tools to generate PE32/PE32+/Coff image files.\r
-#\r
-# Note: The EDK II DSC file is not used to specify how compiled binary images get placed\r
-#       into firmware volume images. This section is just a list of modules to compile from\r
-#       source into UEFI-compliant binaries.\r
-#       It is the FDF file that contains information on combining binary files into firmware\r
-#       volume images, whose concept is beyond UEFI and is described in PI specification.\r
-#       Binary modules do not need to be listed in this section, as they should be\r
-#       specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),\r
-#       Logo (Logo.bmp), and etc.\r
-#       There may also be modules listed in this section that are not required in the FDF file,\r
-#       When a module listed here is excluded from FDF file, then UEFI-compliant binary will be\r
-#       generated for it, but the binary will not be put into any firmware volume.\r
-#\r
-###################################################################################################\r
-[Components]\r
-!if $(SEC_ONLY)\r
-  ##\r
-  #  SEC Phase modules\r
-  ##\r
-  UnixPkg/Sec/SecMain.inf\r
-!else\r
-  ##\r
-  #  PEI Phase modules\r
-  ##\r
-  MdeModulePkg/Core/Pei/PeiMain.inf\r
-  MdeModulePkg/Universal/PCD/Pei/Pcd.inf  {\r
-   <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf\r
-  UnixPkg/BootModePei/BootModePei.inf\r
-  UnixPkg/UnixFlashMapPei/FlashMap.inf\r
-  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
-  UnixPkg/UnixAutoScanPei/UnixAutoScan.inf\r
-  UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf\r
-  UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.inf\r
-  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
-\r
-  ##\r
-  #  DXE Phase modules\r
-  ##\r
-  MdeModulePkg/Core/Dxe/DxeMain.inf {\r
-    <LibraryClasses>\r
-      NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf\r
-      NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf\r
-  }\r
-  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-\r
-  UnixPkg/MetronomeDxe/Metronome.inf\r
-  UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.inf\r
-  UnixPkg/ResetRuntimeDxe/Reset.inf\r
-  MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
-  UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf\r
-  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
-  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf\r
-  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf\r
-  UnixPkg/UnixThunkDxe/UnixThunk.inf\r
-  UnixPkg/CpuRuntimeDxe/Cpu.inf\r
-  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
-  UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf\r
-  UnixPkg/TimerDxe/Timer.inf\r
-  IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf\r
-  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
-  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
-  MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
-  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
-  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
-  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
-  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
-  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
-  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf\r
-  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
-  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
-  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
-  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
-  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
-  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf\r
-  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf\r
-  IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf\r
-  UnixPkg/UnixBusDriverDxe/UnixBusDriver.inf\r
-\r
-  UnixPkg/UnixBlockIoDxe/UnixBlockIo.inf\r
-  UnixPkg/UnixSerialIoDxe/UnixSerialIo.inf\r
-  UnixPkg/UnixUgaDxe/UnixUga.inf\r
-  UnixPkg/UnixGopDxe/UnixGop.inf\r
-  UnixPkg/UnixConsoleDxe/UnixConsole.inf\r
-  UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.inf\r
-  MdeModulePkg/Application/HelloWorld/HelloWorld.inf\r
-\r
-  #\r
-  # Network stack drivers\r
-  #\r
-!if $(NETWORK_SUPPORT)\r
-  UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
-!endif\r
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
-  MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf\r
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf\r
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
-\r
-  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf\r
-  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
-  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
-  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
-  MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf {\r
-    <LibraryClasses>\r
-      PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
-  }\r
-\r
-!if $(COMPILE_BINS)\r
-  FatPkg/EnhancedFatDxe/Fat.inf\r
-!endif\r
-!endif  \r
diff --git a/UnixPkg/UnixPkgX64.fdf b/UnixPkg/UnixPkgX64.fdf
deleted file mode 100644 (file)
index 6ac1cdc..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-## @file\r
-# This is Unix FDF file with UEFI HII features enabled\r
-#\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
-# Portions copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>\r
-#\r
-#    This program and the accompanying materials\r
-#    are licensed and made available under the terms and conditions of the BSD License\r
-#    which accompanies this distribution. The full text of the license may be found at\r
-#    http://opensource.org/licenses/bsd-license.php\r
-#\r
-#    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-\r
-################################################################################\r
-#\r
-# FD Section\r
-# The [FD] Section is made up of the definition statements and a\r
-# description of what goes into  the Flash Device Image.  Each FD section\r
-# defines one flash "device" image.  A flash device image may be one of\r
-# the following: Removable media bootable image (like a boot floppy\r
-# image,) an Option ROM image (that would be "flashed" into an add-in\r
-# card,) a System "Flash"  image (that would be burned into a system's\r
-# flash) or an Update ("Capsule") image that will be used to update and\r
-# existing system flash.\r
-#\r
-################################################################################\r
-[FD.Fv_Recovery]\r
-#\r
-# In OS X PEIMs are really XIP, so we need to make this address match the malloced \r
-# buffer for the FD (0x41000000). If this address does not match the FV will get\r
-# relocated in place (works, but not a great idea).\r
-#\r
-BaseAddress   = 0x102000000|gEfiUnixPkgTokenSpaceGuid.PcdUnixFdBaseAddress   #The base address of the FLASH Device.\r
-Size          = 0x005a0000|gEfiUnixPkgTokenSpaceGuid.PcdUnixFirmwareFdSize  #The size in bytes of the FLASH Device\r
-ErasePolarity = 1\r
-BlockSize     = 0x10000\r
-NumBlocks     = 0x5a\r
-\r
-################################################################################\r
-#\r
-# Following are lists of FD Region layout which correspond to the locations of different\r
-# images within the flash device.\r
-#\r
-# Regions must be defined in ascending order and may not overlap.\r
-#\r
-# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by\r
-# the pipe "|" character, followed by the size of the region, also in hex with the leading\r
-# "0x" characters. Like:\r
-# Offset|Size\r
-# PcdOffsetCName|PcdSizeCName\r
-# RegionType <FV, DATA, or FILE>\r
-#\r
-################################################################################\r
-0x00000000|0x00580000\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoveryBase|gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashFvRecoverySize\r
-FV = FvRecovery\r
-\r
-0x00580000|0x0000c000\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
-#NV_VARIABLE_STORE\r
-DATA = {\r
-  ## This is the EFI_FIRMWARE_VOLUME_HEADER\r
-  # ZeroVector []\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  # FileSystemGuid: gEfiSystemNvDataFvGuid         =\r
-  #  { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}\r
-  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,\r
-  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,\r
-  # FvLength: 0x20000\r
-  0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  # Signature "_FVH"       #Attributes\r
-  0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00,\r
-  # HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision\r
-  0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02,\r
-  # Blockmap[0]: 2 Blocks * 0x10000 Bytes / Block\r
-  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,\r
-  # Blockmap[1]: End\r
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\r
-  ## This is the VARIABLE_STORE_HEADER\r
-  #Signature: gEfiVariableGuid =\r
-  #  { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}\r
-  0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,\r
-  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,\r
-  #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xBFB8\r
-  # This can speed up the Variable Dispatch a bit.\r
-  0xB8, 0xBF, 0x00, 0x00,\r
-  #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32\r
-  0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
-}\r
-\r
-0x0058c000|0x00002000\r
-#NV_EVENT_LOG\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogBase|gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageEventLogSize\r
-\r
-0x0058e000|0x00002000\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
-#NV_FTW_WORKING\r
-DATA = {\r
-  # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEfiSystemNvDataFvGuid         =\r
-  #  { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}\r
-  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,\r
-  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,\r
-  # Crc:UINT32            #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved\r
-  0x77, 0x13, 0x9B, 0xD7, 0xFE, 0xFF, 0xFF, 0xFF,\r
-  # WriteQueueSize: UINT64\r
-  0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
-}\r
-\r
-0x00590000|0x00010000\r
-#NV_FTW_SPARE\r
-gEfiUnixPkgTokenSpaceGuid.PcdUnixFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
-\r
-################################################################################\r
-#\r
-# FV Section\r
-#\r
-# [FV] section is used to define what components or modules are placed within a flash\r
-# device file.  This section also defines order the components and modules are positioned\r
-# within the image.  The [FV] section consists of define statements, set statements and\r
-# module statements.\r
-#\r
-################################################################################\r
-[FV.FvRecovery]\r
-FvAlignment        = 16         #FV alignment and FV attributes setting.\r
-ERASE_POLARITY     = 1\r
-MEMORY_MAPPED      = TRUE\r
-STICKY_WRITE       = TRUE\r
-LOCK_CAP           = TRUE\r
-LOCK_STATUS        = TRUE\r
-WRITE_DISABLED_CAP = TRUE\r
-WRITE_ENABLED_CAP  = TRUE\r
-WRITE_STATUS       = TRUE\r
-WRITE_LOCK_CAP     = TRUE\r
-WRITE_LOCK_STATUS  = TRUE\r
-READ_DISABLED_CAP  = TRUE\r
-READ_ENABLED_CAP   = TRUE\r
-READ_STATUS        = TRUE\r
-READ_LOCK_CAP      = TRUE\r
-READ_LOCK_STATUS   = TRUE\r
-\r
-################################################################################\r
-#\r
-# The INF statements point to EDK component and EDK II module INF files, which will be placed into this FV image.\r
-# Parsing tools will scan the INF file to determine the type of component or module.\r
-# The component or module type is used to reference the standard rules\r
-# defined elsewhere in the FDF file.\r
-#\r
-# The format for INF statements is:\r
-# INF $(PathAndInfFileName)\r
-#\r
-################################################################################\r
-##\r
-#  PEI Phase modules\r
-##\r
-##\r
-#  PEI Apriori file example, more PEIM module added later.\r
-##\r
-APRIORI PEI {\r
-  INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf\r
-  INF  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf\r
-  }\r
-APRIORI DXE {\r
-  INF  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
-  INF  IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf\r
-  INF  UnixPkg/MetronomeDxe/Metronome.inf\r
-  }\r
-INF  MdeModulePkg/Core/Pei/PeiMain.inf\r
-INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf\r
-INF  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf\r
-INF  UnixPkg/BootModePei/BootModePei.inf\r
-INF  UnixPkg/UnixFlashMapPei/FlashMap.inf\r
-INF  UnixPkg/UnixAutoScanPei/UnixAutoScan.inf\r
-INF  UnixPkg/UnixFirmwareVolumePei/UnixFwh.inf\r
-INF  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
-INF  UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.inf\r
-INF  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
-\r
-##\r
-#  DXE Phase modules\r
-##\r
-INF  MdeModulePkg/Core/Dxe/DxeMain.inf\r
-INF  IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
-INF  UnixPkg/MetronomeDxe/Metronome.inf\r
-INF  UnixPkg/RealTimeClockRuntimeDxe/RealTimeClock.inf\r
-INF  UnixPkg/ResetRuntimeDxe/Reset.inf\r
-INF  MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
-INF  UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf\r
-INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
-INF  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf\r
-INF  MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf\r
-INF  UnixPkg/UnixThunkDxe/UnixThunk.inf\r
-INF  UnixPkg/CpuRuntimeDxe/Cpu.inf\r
-INF  MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
-INF  UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf\r
-INF  UnixPkg/TimerDxe/Timer.inf\r
-INF  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
-INF  MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
-INF  MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
-INF  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
-INF  MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
-INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
-INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
-INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
-INF  MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
-INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf\r
-INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf\r
-INF  IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf\r
-INF  UnixPkg/UnixBusDriverDxe/UnixBusDriver.inf\r
\r
-INF  MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf\r
-INF  UnixPkg/UnixBlockIoDxe/UnixBlockIo.inf\r
-INF  UnixPkg/UnixSerialIoDxe/UnixSerialIo.inf\r
-#INF  UnixPkg/UnixUgaDxe/UnixUga.inf\r
-INF  UnixPkg/UnixGopDxe/UnixGop.inf\r
-#INF  UnixPkg/UnixConsoleDxe/UnixConsole.inf\r
-INF  MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
-INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
-INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
-INF  IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf \r
-INF  UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.inf\r
-INF  MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf\r
-INF  MdeModulePkg/Application/HelloWorld/HelloWorld.inf\r
-\r
-#\r
-# Network stack drivers\r
-#\r
-!if $(NETWORK_SUPPORT)\r
-INF  UnixPkg/UnixSnpDxe/UnixSnpDxe.inf\r
-!endif\r
-INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
-INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
-INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
-INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
-INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf\r
-INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf\r
-INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
-\r
\r
-!if $(COMPILE_BINS)\r
-INF FatPkg/EnhancedFatDxe/Fat.inf\r
-\r
- FILE APPLICATION = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile) {\r
-  SECTION PE32 =Build/GccShellPkg/DEBUG_UNIXPKG/X64/ShellFull.efi\r
- }\r
-!else\r
-# Used checked in Visual Studio binaries\r
-INF  RuleOverride = BINARY USE = X64 FatBinPkg/EnhancedFatDxe/Fat.inf\r
-INF  RuleOverride = BINARY USE = X64 EdkShellBinPkg/FullShell/FullShell.inf\r
-!endif\r
-\r
-FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {\r
-        SECTION RAW = MdeModulePkg/Logo/Logo.bmp\r
-      }\r
-   \r
-   \r
-################################################################################\r
-#  \r
-# Rules are use with the [FV] section's module INF type to define\r
-# how an FFS file is created for a given INF file. The following Rule are the default\r
-# rules for the different module type. User can add the customized rules to define the\r
-# content of the FFS file.\r
-#  \r
-################################################################################\r
-   \r
-   \r
-############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section   # \r
-############################################################################\r
-#  \r
-#[Rule.Common.DXE_DRIVER]\r
-#  FILE DRIVER = $(NAMED_GUID) {\r
-#    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-#    COMPRESS PI_STD {\r
-#      GUIDED {\r
-#        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-#        UI       STRING="$(MODULE_NAME)" Optional\r
-#        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-#      }\r
-#    }\r
-#  }\r
-#\r
-############################################################################\r
-\r
-[Rule.Common.PEI_CORE]\r
-  FILE PEI_CORE = $(NAMED_GUID) {\r
-    PE32     PE32    Align=32       $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-    UI       STRING ="$(MODULE_NAME)" Optional         \r
-    VERSION  STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)    \r
-  }\r
-\r
-[Rule.Common.PEIM]\r
-  FILE PEIM = $(NAMED_GUID) {\r
-     PEI_DEPEX PEI_DEPEX Optional        $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-     PE32      PE32   Align=32       $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-     UI       STRING="$(MODULE_NAME)" Optional         \r
-     VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)   \r
-  }\r
-\r
-[Rule.Common.DXE_CORE]\r
-  FILE DXE_CORE = $(NAMED_GUID) {\r
-    COMPRESS PI_STD {\r
-      PE32     PE32           $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-      UI       STRING="$(MODULE_NAME)" Optional\r
-      VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.DXE_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.DXE_RUNTIME_DRIVER]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX    DXE_DEPEX Optional      $(INF_OUTPUT)/$(MODULE_NAME).depex\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_APPLICATION]\r
-  FILE APPLICATION = $(NAMED_GUID) {\r
-    COMPRESS PI_STD {\r
-      GUIDED {\r
-        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi\r
-        UI       STRING="$(MODULE_NAME)" Optional\r
-        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-      }\r
-    }\r
-  }\r
-\r
-[Rule.Common.UEFI_DRIVER.BINARY]\r
-  FILE DRIVER = $(NAMED_GUID) {\r
-    DXE_DEPEX DXE_DEPEX Optional      |.depex\r
-    PE32      PE32                    |.efi\r
-    UI        STRING="$(MODULE_NAME)" Optional\r
-    VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-  }\r
-\r
-[Rule.Common.UEFI_APPLICATION.BINARY]\r
-  FILE APPLICATION = $(NAMED_GUID) {\r
-    PE32      PE32                    |.efi\r
-    UI        STRING="$(MODULE_NAME)" Optional\r
-    VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)\r
-  }\r
-\r
diff --git a/UnixPkg/UnixSerialIoDxe/ComponentName.c b/UnixPkg/UnixSerialIoDxe/ComponentName.c
deleted file mode 100644 (file)
index 833be2e..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixSerialIo.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-EFI_COMPONENT_NAME_PROTOCOL     gUnixSerialIoComponentName = {\r
-  UnixSerialIoComponentNameGetDriverName,\r
-  UnixSerialIoComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-EFI_UNICODE_STRING_TABLE mUnixSerialIoDriverNameTable[] = {\r
-  { "eng", L"Unix Serial I/O Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language \r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned \r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixSerialIoComponentName.SupportedLanguages,\r
-          mUnixSerialIoDriverNameTable,\r
-          DriverName\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by \r
-                       This is managing.  This handle specifies the controller \r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name \r
-                       of.  This is an optional parameter that may be NULL.  It \r
-                       will be NULL for device drivers.  It will also be NULL \r
-                       for a bus drivers that wish to retrieve the name of the \r
-                       bus controller.  It will not be NULL for a bus driver \r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by \r
-                       ControllerHandle and ChildHandle in the language specified\r
-                       by Language from the point of view of the driver specified\r
-                       by This. \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
-                            language specified by Language for the driver \r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently managing \r
-                            the controller specified by ControllerHandle and \r
-                            ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                    Status;\r
-  EFI_SERIAL_IO_PROTOCOL        *SerialIo;\r
-  UNIX_SERIAL_IO_PRIVATE_DATA *Private;\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gUnixSerialIoDriverBinding.DriverBindingHandle,\r
-             &gEfiUnixIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // This is a bus driver, so ChildHandle must not be NULL.\r
-  //\r
-  if (ChildHandle == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Status = EfiTestChildHandle (\r
-             ControllerHandle,\r
-             ChildHandle,\r
-             &gEfiUnixIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ChildHandle,\r
-                  &gEfiSerialIoProtocolGuid,\r
-                  (VOID**)&SerialIo,\r
-                  gUnixSerialIoDriverBinding.DriverBindingHandle,\r
-                  ChildHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (SerialIo);\r
-\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixSerialIoComponentName.SupportedLanguages,\r
-          Private->ControllerNameTable,\r
-          ControllerName\r
-          );\r
-}\r
diff --git a/UnixPkg/UnixSerialIoDxe/EntryPoint.c b/UnixPkg/UnixSerialIoDxe/EntryPoint.c
deleted file mode 100644 (file)
index 06056df..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**@file\r
-  Entry Point Source file.\r
-\r
-  This file contains the user entry point \r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-   This program and the accompanying materials\r
-   are licensed and made available under the terms and conditions of the BSD License\r
-   which accompanies this distribution. The full text of the license may be found at\r
-   http://opensource.org/licenses/bsd-license.php\r
-   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-**/\r
-\r
-#include "UnixSerialIo.h"\r
-\r
-/**\r
-  The user Entry Point for module UnixSerialIo. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixSerialIo(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  Status = EfiLibInstallAllDriverProtocols (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gUnixSerialIoDriverBinding,\r
-             ImageHandle,\r
-             &gUnixSerialIoComponentName,\r
-             NULL,\r
-             NULL\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixSerialIoDxe/UnixSerialIo.c b/UnixPkg/UnixSerialIoDxe/UnixSerialIo.c
deleted file mode 100644 (file)
index b197ae6..0000000
+++ /dev/null
@@ -1,1704 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  UnixSerialIo.c\r
-\r
-Abstract:\r
-\r
-  Our DriverBinding member functions operate on the handles\r
-  created by the NT Bus driver.\r
-\r
-  Handle(1) - UnixIo - DevicePath(1)\r
-\r
-  If a serial port is added to the system this driver creates a new handle.\r
-  The new handle is required, since the serial device must add an UART device\r
-  pathnode.\r
-\r
-  Handle(2) - SerialIo - DevicePath(1)\UART\r
-\r
-  The driver then adds a gEfiUnixSerialPortGuid as a protocol to Handle(1).\r
-  The instance data for this protocol is the private data used to create\r
-  Handle(2).\r
-\r
-  Handle(1) - UnixIo - DevicePath(1) - UnixSerialPort\r
-\r
-  If the driver is unloaded Handle(2) is removed from the system and\r
-  gEfiUnixSerialPortGuid is removed from Handle(1).\r
-\r
-  Note: Handle(1) is any handle created by the Win NT Bus driver that is passed\r
-  into the DriverBinding member functions of this driver. This driver requires\r
-  a Handle(1) to contain a UnixIo protocol, a DevicePath protocol, and\r
-  the TypeGuid in the UnixIo must be gEfiUnixSerialPortGuid.\r
-\r
-  If Handle(1) contains a gEfiUnixSerialPortGuid protocol then the driver is\r
-  loaded on the device.\r
-\r
---*/\r
-\r
-#include "UnixSerialIo.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gUnixSerialIoDriverBinding = {\r
-  UnixSerialIoDriverBindingSupported,\r
-  UnixSerialIoDriverBindingStart,\r
-  UnixSerialIoDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-/**\r
-  Check the device path node whether it's the Flow Control node or not.\r
-\r
-  @param[in] FlowControl    The device path node to be checked.\r
-  \r
-  @retval TRUE              It's the Flow Control node.\r
-  @retval FALSE             It's not.\r
-\r
-**/\r
-BOOLEAN\r
-IsUartFlowControlNode (\r
-  IN UART_FLOW_CONTROL_DEVICE_PATH *FlowControl\r
-  )\r
-{\r
-  return (BOOLEAN) (\r
-           (DevicePathType (FlowControl) == MESSAGING_DEVICE_PATH) &&\r
-           (DevicePathSubType (FlowControl) == MSG_VENDOR_DP) &&\r
-           (CompareGuid (&FlowControl->Guid, &gEfiUartDevicePathGuid))\r
-           );\r
-}\r
-\r
-/**\r
-  Check the device path node whether it contains Flow Control node or not.\r
-\r
-  @param[in] DevicePath     The device path to be checked.\r
-  \r
-  @retval TRUE              It contains the Flow Control node.\r
-  @retval FALSE             It doesn't.\r
-\r
-**/\r
-BOOLEAN\r
-ContainsFlowControl (\r
-  IN EFI_DEVICE_PATH_PROTOCOL      *DevicePath\r
-  )\r
-{\r
-  while (!IsDevicePathEnd (DevicePath)) {\r
-    if (IsUartFlowControlNode ((UART_FLOW_CONTROL_DEVICE_PATH *) DevicePath)) {\r
-      return TRUE;\r
-    }\r
-    DevicePath = NextDevicePathNode (DevicePath);\r
-  }\r
-\r
-  return FALSE;\r
-}\r
-\r
-UINTN\r
-ConvertBaud2Unix (\r
-  UINT64 BaudRate\r
-  )\r
-{\r
-  switch (BaudRate) {\r
-  case 0:\r
-    return 0; // Don't use B0 as it is also used in EFI #includes as a name so termios.h #define \r
-              // can break the build.\r
-  case 50:\r
-    return B50;\r
-  case 75:\r
-    return B75;\r
-  case 110:\r
-    return B110;\r
-  case 134:\r
-    return B134;\r
-  case 150:\r
-    return B150;\r
-  case 200:\r
-    return B200;\r
-  case 300:\r
-    return B300;\r
-  case 600:\r
-    return B600;\r
-  case 1200:\r
-    return B1200;\r
-  case 1800:\r
-    return B1800;\r
-  case 2400:\r
-    return B2400;\r
-  case 4800:\r
-    return B4800;\r
-  case 9600:\r
-    return B9600;\r
-  case 19200:\r
-    return B19200;\r
-  case 38400:\r
-    return B38400;\r
-  case 57600:\r
-    return B57600;\r
-  case 115200:\r
-    return B115200;\r
-  case 230400:\r
-    return B230400;\r
-  case 460800:\r
-    return B460800;\r
-  case 500000:\r
-    return B500000;\r
-  case 576000:\r
-    return B576000;\r
-  case 921600:\r
-    return B921600;\r
-  case 1000000:\r
-    return B1000000;\r
-  case 1152000:\r
-    return B1152000;\r
-  case 1500000:\r
-    return B1500000;\r
-  case 2000000:\r
-    return B2000000;\r
-  case 2500000:\r
-    return B2500000;\r
-  case 3000000:\r
-    return B3000000;\r
-  case 3500000:\r
-    return B3500000;\r
-  case 4000000:\r
-    return B4000000;\r
-  case __MAX_BAUD:\r
-  default:\r
-    DEBUG ((EFI_D_ERROR, "Invalid Baud Rate Parameter!\r\n"));\r
-  }\r
-  return -1;\r
-}\r
-\r
-UINTN\r
-ConvertByteSize2Unix (\r
-  UINT8 DataBit\r
-  )\r
-{\r
-  switch (DataBit) {\r
-  case 5:\r
-    return CS5;\r
-  case 6:\r
-    return CS6;\r
-  case 7:\r
-    return CS7;\r
-  case 8:\r
-    return CS8;\r
-  default:\r
-    DEBUG ((EFI_D_ERROR, "Invalid Data Size Parameter!\r\n"));\r
-  }\r
-  return -1;\r
-}\r
-\r
-VOID\r
-ConvertParity2Unix (\r
-  struct termios    *Options,\r
-  EFI_PARITY_TYPE   Parity\r
-  )\r
-{\r
-  switch (Parity) {\r
-  case NoParity:\r
-    Options->c_cflag &= ~PARENB;\r
-    break;\r
-  case EvenParity:\r
-    Options->c_cflag |= PARENB;\r
-    break;\r
-  case OddParity:\r
-    Options->c_cflag |= PARENB;\r
-    Options->c_cflag |= PARODD;\r
-    break;\r
-  case MarkParity:\r
-    Options->c_cflag = PARENB | CMSPAR | PARODD;\r
-    break;\r
-  case SpaceParity:\r
-    Options->c_cflag |= PARENB | CMSPAR;\r
-    Options->c_cflag &= ~PARODD;\r
-    break;\r
-  default:\r
-    DEBUG ((EFI_D_ERROR, "Invalid Parity Parameter!\r\n"));\r
-  }\r
-}\r
-\r
-VOID\r
-ConvertStopBit2Unix (\r
-  struct termios      *Options,\r
-  EFI_STOP_BITS_TYPE  StopBits\r
-  )\r
-{\r
-  switch (StopBits) {\r
-  case TwoStopBits:\r
-    Options->c_cflag |= CSTOPB;\r
-    break;\r
-  case OneStopBit:\r
-  case OneFiveStopBits:\r
-  case DefaultStopBits:\r
-    Options->c_cflag &= ~CSTOPB;\r
-  }\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  The implementation of EFI_DRIVER_BINDING_PROTOCOL.EFI_DRIVER_BINDING_SUPPORTED.\r
-\r
-Arguments:\r
-  \r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                          Status;\r
-  EFI_DEVICE_PATH_PROTOCOL            *ParentDevicePath;\r
-  EFI_UNIX_IO_PROTOCOL                *UnixIo;\r
-  UART_DEVICE_PATH                    *UartNode;\r
-  EFI_DEVICE_PATH_PROTOCOL            *DevicePath;\r
-  UART_FLOW_CONTROL_DEVICE_PATH       *FlowControlNode;\r
-  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
-  UINTN                               EntryCount;\r
-  UINTN                               Index;\r
-  BOOLEAN                             RemainingDevicePathContainsFlowControl; \r
-\r
-  //\r
-  // Check RemainingDevicePath validation\r
-  //\r
-  if (RemainingDevicePath != NULL) {\r
-    //\r
-    // Check if RemainingDevicePath is the End of Device Path Node, \r
-    // if yes, go on checking other conditions\r
-    //\r
-    if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath isn't the End of Device Path Node,\r
-      // check its validation\r
-      //\r
-      Status = EFI_UNSUPPORTED;\r
-      UartNode  = (UART_DEVICE_PATH *) RemainingDevicePath;\r
-      if (UartNode->Header.Type != MESSAGING_DEVICE_PATH ||\r
-          UartNode->Header.SubType != MSG_UART_DP ||\r
-          DevicePathNodeLength((EFI_DEVICE_PATH_PROTOCOL *)UartNode) != sizeof(UART_DEVICE_PATH)) {\r
-        goto Error;\r
-      }\r
-      if (UartNode->BaudRate < 0 || UartNode->BaudRate > SERIAL_PORT_MAX_BAUD_RATE) {\r
-        goto Error;\r
-      }\r
-      if (UartNode->Parity < NoParity || UartNode->Parity > SpaceParity) {\r
-        goto Error;\r
-      }\r
-      if (UartNode->DataBits < 5 || UartNode->DataBits > 8) {\r
-        goto Error;\r
-      }\r
-      if (UartNode->StopBits < OneStopBit || UartNode->StopBits > TwoStopBits) {\r
-        goto Error;\r
-      }\r
-      if ((UartNode->DataBits == 5) && (UartNode->StopBits == TwoStopBits)) {\r
-        goto Error;\r
-      }\r
-      if ((UartNode->DataBits >= 6) && (UartNode->DataBits <= 8) && (UartNode->StopBits == OneFiveStopBits)) {\r
-        goto Error;\r
-      }\r
-\r
-      FlowControlNode = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (UartNode);\r
-      if (IsUartFlowControlNode (FlowControlNode)) {\r
-        //\r
-        // If the second node is Flow Control Node,\r
-        //   return error when it request other than hardware flow control.\r
-        //\r
-        if ((FlowControlNode->FlowControlMap & ~UART_FLOW_CONTROL_HARDWARE) != 0) {\r
-          goto Error;\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID**)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    if (RemainingDevicePath == NULL || IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath is NULL or is the End of Device Path Node\r
-      //\r
-      return EFI_SUCCESS;\r
-    }\r
-    //\r
-    // When the driver has produced device path with flow control node but RemainingDevicePath only contains UART node,\r
-    //   return unsupported, and vice versa.\r
-    //\r
-    Status = gBS->OpenProtocolInformation (\r
-                    Handle,\r
-                    &gEfiUnixIoProtocolGuid,\r
-                    &OpenInfoBuffer,\r
-                    &EntryCount\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    //\r
-    // See if RemainingDevicePath has a Flow Control device path node\r
-    //\r
-    RemainingDevicePathContainsFlowControl = ContainsFlowControl (RemainingDevicePath);\r
-\r
-    for (Index = 0; Index < EntryCount; Index++) {\r
-      if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
-        Status = gBS->OpenProtocol (\r
-                        OpenInfoBuffer[Index].ControllerHandle,\r
-                        &gEfiDevicePathProtocolGuid,\r
-                        (VOID **) &DevicePath,\r
-                        This->DriverBindingHandle,\r
-                        Handle,\r
-                        EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                        );\r
-        if (!EFI_ERROR (Status)) {\r
-          if (RemainingDevicePathContainsFlowControl ^ ContainsFlowControl (DevicePath)) {\r
-            Status = EFI_UNSUPPORTED;\r
-          }\r
-        }\r
-        break;\r
-      }\r
-    }\r
-    FreePool (OpenInfoBuffer);\r
-    return Status;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  //\r
-  // Open the EFI Device Path protocol needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID**)&ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Close protocol, don't use device path protocol in the Support() function\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiDevicePathProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  //\r
-  // Make sure that the Unix Thunk Protocol is valid\r
-  //\r
-  if (UnixIo->UnixThunk->Signature != EFI_UNIX_THUNK_PROTOCOL_SIGNATURE) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Check the GUID to see if this is a handle type the driver supports\r
-  //\r
-  if (!CompareGuid (UnixIo->TypeGuid, &gEfiUnixSerialPortGuid)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Error;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-\r
-Error:\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                          Status;\r
-  EFI_UNIX_IO_PROTOCOL                *UnixIo;\r
-  UNIX_SERIAL_IO_PRIVATE_DATA         *Private;\r
-  UINTN                               UnixHandle;\r
-  UART_DEVICE_PATH                    UartNode;\r
-  EFI_DEVICE_PATH_PROTOCOL            *ParentDevicePath;\r
-  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
-  UINTN                               EntryCount;\r
-  UINTN                               Index;\r
-  EFI_SERIAL_IO_PROTOCOL              *SerialIo;\r
-  CHAR8                               AsciiDevName[1024];\r
-  UART_DEVICE_PATH                    *Uart;\r
-  UINT32                              FlowControlMap;\r
-  UART_FLOW_CONTROL_DEVICE_PATH       *FlowControl;\r
-  EFI_DEVICE_PATH_PROTOCOL            *TempDevicePath;\r
-  UINT32                              Control;\r
-\r
-  DEBUG ((EFI_D_INFO, "SerialIo drive binding start!\r\n"));\r
-  Private   = NULL;\r
-  UnixHandle  = -1;\r
-\r
-  //\r
-  // Get the Parent Device Path\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID**)&ParentDevicePath,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Grab the IO abstraction we need to get any work done\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID**)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiDevicePathProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-    return Status;\r
-  }\r
-\r
-  if (Status == EFI_ALREADY_STARTED) {\r
-\r
-    if (RemainingDevicePath == NULL || IsDevicePathEnd (RemainingDevicePath)) {\r
-      //\r
-      // If RemainingDevicePath is NULL or is the End of Device Path Node\r
-      //\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    //\r
-    // Make sure a child handle does not already exist.  This driver can only\r
-    // produce one child per serial port.\r
-    //\r
-    Status = gBS->OpenProtocolInformation (\r
-                    Handle,\r
-                    &gEfiUnixIoProtocolGuid,\r
-                    &OpenInfoBuffer,\r
-                    &EntryCount\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    Status = EFI_ALREADY_STARTED;\r
-    for (Index = 0; Index < EntryCount; Index++) {\r
-      if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
-        Status = gBS->OpenProtocol (\r
-                        OpenInfoBuffer[Index].ControllerHandle,\r
-                        &gEfiSerialIoProtocolGuid,\r
-                        (VOID**)&SerialIo,\r
-                        This->DriverBindingHandle,\r
-                        Handle,\r
-                        EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                        );\r
-        if (!EFI_ERROR (Status)) {\r
-          Uart   = (UART_DEVICE_PATH *) RemainingDevicePath;\r
-          Status = SerialIo->SetAttributes (\r
-                               SerialIo,\r
-                               Uart->BaudRate,\r
-                               SerialIo->Mode->ReceiveFifoDepth,\r
-                               SerialIo->Mode->Timeout,\r
-                               (EFI_PARITY_TYPE) Uart->Parity,\r
-                               Uart->DataBits,\r
-                               (EFI_STOP_BITS_TYPE) Uart->StopBits\r
-                               );\r
-\r
-          FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (Uart);\r
-          if (!EFI_ERROR (Status) && IsUartFlowControlNode (FlowControl)) {\r
-            Status = SerialIo->GetControl (SerialIo, &Control);\r
-            if (!EFI_ERROR (Status)) {\r
-              if (FlowControl->FlowControlMap == UART_FLOW_CONTROL_HARDWARE) {\r
-                Control |= EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE;\r
-              } else {\r
-                Control &= ~EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE;\r
-              }\r
-              //\r
-              // Clear the bits that are not allowed to pass to SetControl\r
-              //\r
-              Control &= (EFI_SERIAL_REQUEST_TO_SEND | EFI_SERIAL_DATA_TERMINAL_READY |\r
-                          EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE | EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE | \r
-                          EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE);\r
-              Status = SerialIo->SetControl (SerialIo, Control);\r
-            }\r
-          }\r
-        }\r
-        break;\r
-      }\r
-    }\r
-\r
-    FreePool (OpenInfoBuffer);\r
-    return Status;\r
-  }\r
-\r
-  FlowControl    = NULL;\r
-  FlowControlMap = 0;\r
-  if (RemainingDevicePath == NULL) {\r
-    //\r
-    // Build the device path by appending the UART node to the ParentDevicePath\r
-    // from the UnixIo handle. The Uart setings are zero here, since\r
-    // SetAttribute() will update them to match the default setings.\r
-    //\r
-    ZeroMem (&UartNode, sizeof (UART_DEVICE_PATH));\r
-    UartNode.Header.Type     = MESSAGING_DEVICE_PATH;\r
-    UartNode.Header.SubType  = MSG_UART_DP;\r
-    SetDevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *) &UartNode, sizeof (UART_DEVICE_PATH));\r
-\r
-  } else if (!IsDevicePathEnd (RemainingDevicePath)) {\r
-    //\r
-    // If RemainingDevicePath isn't the End of Device Path Node, \r
-    // only scan the specified device by RemainingDevicePath\r
-    //\r
-    //\r
-    // Match the configuration of the RemainingDevicePath. IsHandleSupported()\r
-    // already checked to make sure the RemainingDevicePath contains settings\r
-    // that we can support.\r
-    //\r
-    CopyMem (&UartNode, RemainingDevicePath, sizeof (UART_DEVICE_PATH));\r
-    FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) NextDevicePathNode (RemainingDevicePath);\r
-    if (IsUartFlowControlNode (FlowControl)) {\r
-      FlowControlMap = FlowControl->FlowControlMap;\r
-    } else {\r
-      FlowControl    = NULL;\r
-    }\r
-\r
-  } else {\r
-    //\r
-    // If RemainingDevicePath is the End of Device Path Node,\r
-    // skip enumerate any device and return EFI_SUCESSS\r
-    // \r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Check to see if we can access the hardware device. If it's Open in Unix we\r
-  // will not get access.\r
-  //\r
-  UnicodeStrToAsciiStr(UnixIo->EnvString, AsciiDevName);\r
-  UnixHandle = UnixIo->UnixThunk->Open (AsciiDevName, O_RDWR | O_NOCTTY, 0);\r
-  \r
-  if (UnixHandle == -1) {\r
-    DEBUG ((EFI_D_INFO, "Failed to open serial device, %s!\r\n", UnixIo->EnvString ));\r
-    UnixIo->UnixThunk->Perror (AsciiDevName);\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Error;\r
-  }\r
-  DEBUG ((EFI_D_INFO, "Success to open serial device %s, Hanle = 0x%x \r\n", UnixIo->EnvString, UnixHandle));\r
-\r
-  //\r
-  // Construct Private data\r
-  //\r
-  Private = AllocatePool (sizeof (UNIX_SERIAL_IO_PRIVATE_DATA));\r
-  if (Private == NULL) {\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // This signature must be valid before any member function is called\r
-  //\r
-  Private->Signature              = UNIX_SERIAL_IO_PRIVATE_DATA_SIGNATURE;\r
-  Private->UnixHandle             = UnixHandle;\r
-  Private->ControllerHandle       = Handle;\r
-  Private->Handle                 = NULL;\r
-  Private->UnixThunk              = UnixIo->UnixThunk;\r
-  Private->ParentDevicePath       = ParentDevicePath;\r
-  Private->ControllerNameTable    = NULL;\r
-\r
-  Private->SoftwareLoopbackEnable = FALSE;\r
-  Private->HardwareLoopbackEnable = FALSE;\r
-  Private->HardwareFlowControl    = (BOOLEAN) (FlowControlMap == UART_FLOW_CONTROL_HARDWARE);\r
-  Private->Fifo.First             = 0;\r
-  Private->Fifo.Last              = 0;\r
-  Private->Fifo.Surplus           = SERIAL_MAX_BUFFER_SIZE;\r
-\r
-  CopyMem (&Private->UartDevicePath, &UartNode, sizeof (UART_DEVICE_PATH));\r
-\r
-  AddUnicodeString (\r
-    "eng",\r
-    gUnixSerialIoComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    UnixIo->EnvString\r
-    );\r
-\r
-  Private->SerialIo.Revision      = SERIAL_IO_INTERFACE_REVISION;\r
-  Private->SerialIo.Reset         = UnixSerialIoReset;\r
-  Private->SerialIo.SetAttributes = UnixSerialIoSetAttributes;\r
-  Private->SerialIo.SetControl    = UnixSerialIoSetControl;\r
-  Private->SerialIo.GetControl    = UnixSerialIoGetControl;\r
-  Private->SerialIo.Write         = UnixSerialIoWrite;\r
-  Private->SerialIo.Read          = UnixSerialIoRead;\r
-  Private->SerialIo.Mode          = &Private->SerialIoMode;\r
-\r
-\r
-\r
-  //\r
-  // Build the device path by appending the UART node to the ParentDevicePath\r
-  // from the UnixIo handle. The Uart setings are zero here, since\r
-  // SetAttribute() will update them to match the current setings.\r
-  //\r
-  Private->DevicePath = AppendDevicePathNode (\r
-                          ParentDevicePath,\r
-                          (EFI_DEVICE_PATH_PROTOCOL *) &Private->UartDevicePath\r
-                          );\r
-  //\r
-  // Only produce the FlowControl node when remaining device path has it\r
-  //\r
-  if (FlowControl != NULL) {\r
-    TempDevicePath = Private->DevicePath;\r
-    if (TempDevicePath != NULL) {\r
-      Private->DevicePath = AppendDevicePathNode (\r
-                              TempDevicePath,\r
-                              (EFI_DEVICE_PATH_PROTOCOL *) FlowControl\r
-                              );\r
-      FreePool (TempDevicePath);\r
-    }\r
-  }\r
-  if (Private->DevicePath == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Fill in Serial I/O Mode structure based on either the RemainingDevicePath or defaults.\r
-  //\r
-  Private->SerialIoMode.ControlMask       = SERIAL_CONTROL_MASK;\r
-  Private->SerialIoMode.Timeout           = SERIAL_TIMEOUT_DEFAULT;\r
-  Private->SerialIoMode.BaudRate          = Private->UartDevicePath.BaudRate;\r
-  Private->SerialIoMode.ReceiveFifoDepth  = SERIAL_FIFO_DEFAULT;\r
-  Private->SerialIoMode.DataBits          = Private->UartDevicePath.DataBits;\r
-  Private->SerialIoMode.Parity            = Private->UartDevicePath.Parity;\r
-  Private->SerialIoMode.StopBits          = Private->UartDevicePath.StopBits;\r
-\r
-  //\r
-  // Issue a reset to initialize the COM port\r
-  //\r
-  Status = Private->SerialIo.Reset (&Private->SerialIo);\r
-  if (EFI_ERROR (Status)) {\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Create new child handle\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Private->Handle,\r
-                  &gEfiSerialIoProtocolGuid,\r
-                  &Private->SerialIo,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  Private->DevicePath,\r
-                  NULL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Error;\r
-  }\r
-\r
-  //\r
-  // Open For Child Device\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID**)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Private->Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Error;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-\r
-Error:\r
-  //\r
-  // Use the Stop() function to free all resources allocated in Start()\r
-  //\r
-  if (Private != NULL) {\r
-    if (Private->Handle != NULL) {\r
-      This->Stop (This, Handle, 1, &Private->Handle);\r
-    } else {\r
-      if (UnixHandle != -1) {\r
-        Private->UnixThunk->Close (UnixHandle);\r
-      }\r
-\r
-      if (Private->DevicePath != NULL) {\r
-        FreePool (Private->DevicePath);\r
-      }\r
-\r
-      FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-      FreePool (Private);\r
-    }\r
-  }\r
-\r
-  This->Stop (This, Handle, 0, NULL);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  EFI_STATUS                    Status;\r
-  UINTN                         Index;\r
-  BOOLEAN                       AllChildrenStopped;\r
-  EFI_SERIAL_IO_PROTOCOL        *SerialIo;\r
-  UNIX_SERIAL_IO_PRIVATE_DATA   *Private;\r
-  EFI_UNIX_IO_PROTOCOL          *UnixIo;\r
-\r
-  //\r
-  // Complete all outstanding transactions to Controller.\r
-  // Don't allow any new transaction to Controller to be started.\r
-  //\r
-\r
-  if (NumberOfChildren == 0) {\r
-    //\r
-    // Close the bus driver\r
-    //\r
-    Status = gBS->CloseProtocol (\r
-                    Handle,\r
-                    &gEfiUnixIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Handle\r
-                    );\r
-    Status = gBS->CloseProtocol (\r
-                    Handle,\r
-                    &gEfiDevicePathProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    Handle\r
-                    );\r
-    return Status;\r
-  }\r
-\r
-  AllChildrenStopped = TRUE;\r
-\r
-  for (Index = 0; Index < NumberOfChildren; Index++) {\r
-    Status = gBS->OpenProtocol (\r
-                    ChildHandleBuffer[Index],\r
-                    &gEfiSerialIoProtocolGuid,\r
-                    (VOID**)&SerialIo,\r
-                    This->DriverBindingHandle,\r
-                    Handle,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-    if (!EFI_ERROR (Status)) {\r
-      Private = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (SerialIo);\r
-\r
-      ASSERT (Private->Handle == ChildHandleBuffer[Index]);\r
-\r
-      Status = gBS->CloseProtocol (\r
-                      Handle,\r
-                      &gEfiUnixIoProtocolGuid,\r
-                      This->DriverBindingHandle,\r
-                      ChildHandleBuffer[Index]\r
-                      );\r
-\r
-      Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                      ChildHandleBuffer[Index],\r
-                      &gEfiSerialIoProtocolGuid,\r
-                      &Private->SerialIo,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      Private->DevicePath,\r
-                      NULL\r
-                      );\r
-\r
-      if (EFI_ERROR (Status)) {\r
-        gBS->OpenProtocol (\r
-              Handle,\r
-              &gEfiUnixIoProtocolGuid,\r
-              (VOID **) &UnixIo,\r
-              This->DriverBindingHandle,\r
-              ChildHandleBuffer[Index],\r
-              EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-              );\r
-      } else {\r
-        Private->UnixThunk->Close (Private->UnixHandle);\r
-\r
-        FreePool (Private->DevicePath);\r
-\r
-        FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-        FreePool (Private);\r
-      }\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      AllChildrenStopped = FALSE;\r
-    }\r
-  }\r
-\r
-  if (!AllChildrenStopped) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-//\r
-// Serial IO Protocol member functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoReset (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  UNIX_SERIAL_IO_PRIVATE_DATA *Private;\r
-  EFI_TPL                      Tpl;\r
-  UINTN                        UnixStatus;\r
-\r
-  Tpl         = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private     = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  UnixStatus  = Private->UnixThunk->Tcflush (\r
-                                    Private->UnixHandle, \r
-                                    TCIOFLUSH\r
-                                    );\r
-  switch (UnixStatus) {\r
-  case EBADF:\r
-    DEBUG ((EFI_D_ERROR, "Invalid handle of serial device!\r\n"));\r
-    return EFI_DEVICE_ERROR;\r
-  case EINVAL:\r
-    DEBUG ((EFI_D_ERROR, "Invalid queue selector!\r\n"));\r
-    return EFI_DEVICE_ERROR;\r
-  case ENOTTY:\r
-    DEBUG ((EFI_D_ERROR, "The file associated with serial's handle is not a terminal!\r\n"));\r
-    return EFI_DEVICE_ERROR;\r
-  default:\r
-    DEBUG ((EFI_D_ERROR, "The serial IO device is reset successfully!\r\n"));\r
-  }\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return This->SetAttributes (\r
-                This,\r
-                This->Mode->BaudRate,\r
-                This->Mode->ReceiveFifoDepth,\r
-                This->Mode->Timeout,\r
-                This->Mode->Parity,\r
-                (UINT8) This->Mode->DataBits,\r
-                This->Mode->StopBits\r
-                );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoSetAttributes (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT64                 BaudRate,\r
-  IN UINT32                 ReceiveFifoDepth,\r
-  IN UINT32                 Timeout,\r
-  IN EFI_PARITY_TYPE        Parity,\r
-  IN UINT8                  DataBits,\r
-  IN EFI_STOP_BITS_TYPE     StopBits\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function is used to set the attributes.\r
-\r
-Arguments:\r
-\r
-  This              - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.\r
-  BaudRate          - The Baud rate of the serial device.\r
-  ReceiveFifoDepth  - The request depth of fifo on receive side.\r
-  Timeout           - the request timeout for a single charact.\r
-  Parity            - The type of parity used in serial device.\r
-  DataBits          - Number of deata bits used in serial device.\r
-  StopBits          - Number of stop bits used in serial device.\r
-\r
-Returns:\r
-  Status code\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  EFI_STATUS                    Status;\r
-  UNIX_SERIAL_IO_PRIVATE_DATA   *Private;\r
-  UART_DEVICE_PATH              *Uart;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-  Private = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  //\r
-  //  Some of our arguments have defaults if a null value is passed in, and\r
-  //   we must set the default values if a null argument is passed in.\r
-  //\r
-  if (BaudRate == 0) {\r
-    BaudRate = SERIAL_BAUD_DEFAULT;\r
-  }\r
-\r
-  if (ReceiveFifoDepth == 0) {\r
-    ReceiveFifoDepth = SERIAL_FIFO_DEFAULT;\r
-  }\r
-\r
-  if (Timeout == 0) {\r
-    Timeout = SERIAL_TIMEOUT_DEFAULT;\r
-  }\r
-\r
-  if (Parity == DefaultParity) {\r
-    Parity = NoParity;\r
-  }\r
-\r
-  if (DataBits == 0) {\r
-    DataBits = SERIAL_DATABITS_DEFAULT;\r
-  }\r
-\r
-  if (StopBits == DefaultStopBits) {\r
-    StopBits = OneStopBit;\r
-  }\r
-\r
-  //\r
-  // See if the new attributes already match the current attributes\r
-  //\r
-  if (Private->UartDevicePath.BaudRate       == BaudRate         &&\r
-      Private->UartDevicePath.DataBits       == DataBits         &&\r
-      Private->UartDevicePath.Parity         == Parity           &&\r
-      Private->UartDevicePath.StopBits       == StopBits         &&\r
-      Private->SerialIoMode.ReceiveFifoDepth == ReceiveFifoDepth &&\r
-      Private->SerialIoMode.Timeout          == Timeout             ) {\r
-    gBS->RestoreTPL(Tpl);\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Try to get options from serial device.\r
-  // \r
-  if (Private->UnixThunk->Tcgetattr (Private->UnixHandle, &Private->UnixTermios) == -1) {\r
-    Private->UnixThunk->Perror ("IoSetAttributes");\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // Setting Baud Rate\r
-  // \r
-  Private->UnixThunk->Cfsetispeed (&Private->UnixTermios, ConvertBaud2Unix(BaudRate));\r
-  Private->UnixThunk->Cfsetospeed (&Private->UnixTermios, ConvertBaud2Unix(BaudRate));\r
-  //\r
-  // Setting DataBits \r
-  // \r
-  Private->UnixTermios.c_cflag &= ~CSIZE;\r
-  Private->UnixTermios.c_cflag |= ConvertByteSize2Unix (DataBits);\r
-  //\r
-  // Setting Parity\r
-  // \r
-  ConvertParity2Unix (&Private->UnixTermios, Parity);\r
-  //\r
-  // Setting StopBits\r
-  // \r
-  ConvertStopBit2Unix (&Private->UnixTermios, StopBits);\r
-  //\r
-  // Raw input\r
-  // \r
-  Private->UnixTermios.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);\r
-  //\r
-  // Raw output\r
-  // \r
-  Private->UnixTermios.c_oflag &= ~OPOST;\r
-  //\r
-  // Support hardware flow control \r
-  // \r
-  Private->UnixTermios.c_cflag &= ~CRTSCTS;;\r
-  //\r
-  // Time out\r
-  // \r
-  Private->UnixTermios.c_cc[VMIN]  = 0;\r
-  Private->UnixTermios.c_cc[VTIME] = (Timeout/1000000) * 10;\r
-\r
-  //\r
-  // Set the options\r
-  // \r
-  if (-1 == Private->UnixThunk->Tcsetattr (\r
-                        Private->UnixHandle, \r
-                        TCSANOW, \r
-                        &Private->UnixTermios\r
-                        )) {\r
-    DEBUG ((EFI_D_INFO, "Fail to set options for serial device!\r\n"));\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  //  Update mode\r
-  //\r
-  Private->SerialIoMode.BaudRate          = BaudRate;\r
-  Private->SerialIoMode.ReceiveFifoDepth  = ReceiveFifoDepth;\r
-  Private->SerialIoMode.Timeout           = Timeout;\r
-  Private->SerialIoMode.Parity            = Parity;\r
-  Private->SerialIoMode.DataBits          = DataBits;\r
-  Private->SerialIoMode.StopBits          = StopBits;\r
-\r
-  //\r
-  // See if Device Path Node has actually changed\r
-  //\r
-  if (Private->UartDevicePath.BaudRate     == BaudRate &&\r
-      Private->UartDevicePath.DataBits     == DataBits &&\r
-      Private->UartDevicePath.Parity       == Parity   &&\r
-      Private->UartDevicePath.StopBits     == StopBits    ) {\r
-    gBS->RestoreTPL(Tpl);\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Update the device path\r
-  //\r
-  Private->UartDevicePath.BaudRate  = BaudRate;\r
-  Private->UartDevicePath.DataBits  = DataBits;\r
-  Private->UartDevicePath.Parity    = (UINT8) Parity;\r
-  Private->UartDevicePath.StopBits  = (UINT8) StopBits;\r
-\r
-  Status = EFI_SUCCESS;\r
-  if (Private->Handle != NULL) {\r
-    Uart = (UART_DEVICE_PATH *) (\r
-             (UINTN) Private->DevicePath\r
-             + GetDevicePathSize (Private->ParentDevicePath)\r
-             - END_DEVICE_PATH_LENGTH\r
-             );\r
-    CopyMem (Uart, &Private->UartDevicePath, sizeof (UART_DEVICE_PATH));\r
-    Status = gBS->ReinstallProtocolInterface (\r
-                    Private->Handle,\r
-                    &gEfiDevicePathProtocolGuid,\r
-                    Private->DevicePath,\r
-                    Private->DevicePath\r
-                    );\r
-  }\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoSetControl (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT32                 Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SERIAL_IO_PRIVATE_DATA   *Private;\r
-  UINTN                         Result;\r
-  UINTN                         IoStatus;\r
-  struct termios                Options;\r
-  EFI_TPL                       Tpl;\r
-  UART_FLOW_CONTROL_DEVICE_PATH *FlowControl;\r
-  EFI_STATUS                    Status;\r
-\r
-  //\r
-  // first determine the parameter is invalid\r
-  //\r
-  if (Control & (~(EFI_SERIAL_REQUEST_TO_SEND | EFI_SERIAL_DATA_TERMINAL_READY |\r
-                   EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE | EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE | \r
-                   EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE))) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Result  = Private->UnixThunk->IoCtl (Private->UnixHandle, TIOCMGET, &IoStatus);\r
-\r
-  if (Result == -1) {\r
-    Private->UnixThunk->Perror ("SerialSetControl");\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Private->HardwareFlowControl    = FALSE;\r
-  Private->SoftwareLoopbackEnable = FALSE;\r
-  Private->HardwareLoopbackEnable = FALSE;\r
-\r
-  if (Control & EFI_SERIAL_REQUEST_TO_SEND) {\r
-    Options.c_cflag |= TIOCM_RTS;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_DATA_TERMINAL_READY) {\r
-    Options.c_cflag |= TIOCM_DTR;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) {\r
-    Private->HardwareFlowControl = TRUE;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE) {\r
-    Private->SoftwareLoopbackEnable = TRUE;\r
-  }\r
-\r
-  if (Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) {\r
-    Private->HardwareLoopbackEnable = TRUE;\r
-  }\r
-\r
-  Result  = Private->UnixThunk->IoCtl (Private->UnixHandle, TIOCMSET, &IoStatus);\r
-\r
-  if (Result == -1) {\r
-    Private->UnixThunk->Perror ("SerialSetControl");\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Status = EFI_SUCCESS;\r
-  if (Private->Handle != NULL) {\r
-    FlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) (\r
-                    (UINTN) Private->DevicePath\r
-                    + GetDevicePathSize (Private->ParentDevicePath)\r
-                    - END_DEVICE_PATH_LENGTH\r
-                    + sizeof (UART_DEVICE_PATH)\r
-                    );\r
-    if (IsUartFlowControlNode (FlowControl) &&\r
-        ((FlowControl->FlowControlMap == UART_FLOW_CONTROL_HARDWARE) ^ Private->HardwareFlowControl)) {\r
-      //\r
-      // Flow Control setting is changed, need to reinstall device path protocol\r
-      //\r
-      FlowControl->FlowControlMap = Private->HardwareFlowControl ? UART_FLOW_CONTROL_HARDWARE : 0;\r
-      Status = gBS->ReinstallProtocolInterface (\r
-                      Private->Handle,\r
-                      &gEfiDevicePathProtocolGuid,\r
-                      Private->DevicePath,\r
-                      Private->DevicePath\r
-                      );\r
-    }\r
-  }\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoGetControl (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  OUT UINT32                  *Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SERIAL_IO_PRIVATE_DATA *Private;\r
-  UINTN                       Result;\r
-  UINTN                       Status;\r
-  UINT32                      Bits;\r
-  EFI_TPL                     Tpl;\r
-  UINTN                       Bytes;\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-  Result  = Private->UnixThunk->IoCtl (Private->UnixHandle, TIOCMGET, &Status);\r
-  if (Result == -1) {\r
-    Private->UnixThunk->Perror ("SerialGetControl");\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Bits = 0;\r
-  if ((Status & TIOCM_CTS) == TIOCM_CTS) {\r
-    Bits |= EFI_SERIAL_CLEAR_TO_SEND;\r
-  }\r
-\r
-  if ((Status & TIOCM_DSR) == TIOCM_DSR) {\r
-    Bits |= EFI_SERIAL_DATA_SET_READY;\r
-  }\r
-\r
-  if ((Status & TIOCM_DTR) == TIOCM_DTR) {\r
-    Bits |= EFI_SERIAL_DATA_TERMINAL_READY;\r
-  }\r
-\r
-  if ((Status & TIOCM_RTS) == TIOCM_RTS) {\r
-    Bits |= EFI_SERIAL_REQUEST_TO_SEND;\r
-  }\r
-\r
-  if ((Status & TIOCM_RNG) == TIOCM_RNG) {\r
-    Bits |= EFI_SERIAL_RING_INDICATE;\r
-  }\r
-\r
-  if ((Status & TIOCM_CAR) == TIOCM_CAR) {\r
-    Bits |= EFI_SERIAL_CARRIER_DETECT;\r
-  }\r
-\r
-  if (Private->HardwareFlowControl) {\r
-    Bits |= EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE;\r
-  }\r
-\r
-  if (Private->SoftwareLoopbackEnable) {\r
-    Bits |= EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE;\r
-  }\r
-\r
-  if (Private->HardwareLoopbackEnable) {\r
-    Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;\r
-  }\r
-\r
-  Result = Private->UnixThunk->IoCtl (Private->UnixHandle, FIONREAD, &Bytes);\r
-  if (Result == -1) {\r
-    Private->UnixThunk->Perror ("SerialGetControl");\r
-    gBS->RestoreTPL (Tpl);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  if (Bytes == 0) {\r
-    Bits |= EFI_SERIAL_INPUT_BUFFER_EMPTY;\r
-  }\r
-\r
-  *Control = Bits;\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoWrite (\r
-  IN EFI_SERIAL_IO_PROTOCOL   *This,\r
-  IN OUT UINTN                *BufferSize,\r
-  IN VOID                     *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SERIAL_IO_PRIVATE_DATA   *Private;\r
-  EFI_STATUS                    Status;\r
-  UINT8                         *ByteBuffer;\r
-  UINT32                        TotalBytesWritten;\r
-  UINT32                        BytesToGo;\r
-  UINT32                        BytesWritten;\r
-  UINT32                        Index;\r
-  UINT32                        Control;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Tpl               = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private           = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This); \r
-\r
-  ByteBuffer        = (UINT8 *) Buffer;\r
-  Status = EFI_SUCCESS;\r
-  TotalBytesWritten = 0;\r
-\r
-  if (Private->SoftwareLoopbackEnable || Private->HardwareLoopbackEnable) {\r
-    for (Index = 0; Index < *BufferSize; Index++) {\r
-      if (IsaSerialFifoAdd (&Private->Fifo, ByteBuffer[Index]) == EFI_SUCCESS) {\r
-        TotalBytesWritten++;\r
-      } else {\r
-        break;\r
-      }\r
-    }\r
-  } else {\r
-    BytesToGo = (*BufferSize);\r
-\r
-    do {\r
-      if (Private->HardwareFlowControl) {\r
-        //\r
-        // Send RTS\r
-        //\r
-        UnixSerialIoGetControl (&Private->SerialIo, &Control);\r
-        Control |= EFI_SERIAL_REQUEST_TO_SEND;\r
-        UnixSerialIoSetControl (&Private->SerialIo, Control);\r
-      }\r
-\r
-      //\r
-      //  Do the write\r
-      //\r
-      BytesWritten = Private->UnixThunk->Write ( \r
-                                           Private->UnixHandle,\r
-                                           &ByteBuffer[TotalBytesWritten],\r
-                                           BytesToGo\r
-                                           );\r
-      if (BytesWritten == -1) {\r
-        Status = EFI_DEVICE_ERROR;\r
-        break;\r
-      }\r
-\r
-      if (Private->HardwareFlowControl) {\r
-        //\r
-        // Assert RTS\r
-        //\r
-        UnixSerialIoGetControl (&Private->SerialIo, &Control);\r
-        Control &= ~ (UINT32) EFI_SERIAL_REQUEST_TO_SEND;\r
-        UnixSerialIoSetControl (&Private->SerialIo, Control);\r
-      }\r
-\r
-      TotalBytesWritten += BytesWritten;\r
-      BytesToGo -= BytesWritten;\r
-    } while (BytesToGo > 0);\r
-  }\r
-\r
-  *BufferSize = TotalBytesWritten;\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoRead (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  IN  OUT UINTN               *BufferSize,\r
-  OUT VOID                    *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_DEVICE_ERROR - TODO: Add description for return value\r
-\r
---*/\r
-{\r
-  UNIX_SERIAL_IO_PRIVATE_DATA   *Private;\r
-  UINT32                        BytesRead;\r
-  EFI_STATUS                    Status;\r
-  UINT32                        Index;\r
-  UINT8                         Data;\r
-  UINT32                        Control;\r
-  EFI_TPL                       Tpl;\r
-\r
-  Tpl     = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
-  Private = UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  //\r
-  //  Do the read\r
-  //\r
-  if (Private->SoftwareLoopbackEnable || Private->HardwareLoopbackEnable) {\r
-    for (Index = 0, BytesRead = 0; Index < *BufferSize; Index++) {\r
-      if (IsaSerialFifoRemove (&Private->Fifo, &Data) == EFI_SUCCESS) {\r
-        ((UINT8 *) Buffer)[Index] = Data;\r
-        BytesRead++;\r
-      } else {\r
-        break;\r
-      }\r
-    }\r
-  } else {\r
-    if (Private->HardwareFlowControl) {\r
-      UnixSerialIoGetControl (&Private->SerialIo, &Control);\r
-      Control |= EFI_SERIAL_DATA_TERMINAL_READY;\r
-      UnixSerialIoSetControl (&Private->SerialIo, Control);\r
-    }\r
-\r
-    BytesRead = Private->UnixThunk->Read (Private->UnixHandle, Buffer, *BufferSize);\r
-    if (Private->HardwareFlowControl) {\r
-      UnixSerialIoGetControl (&Private->SerialIo, &Control);\r
-      Control &= ~ (UINT32) EFI_SERIAL_DATA_TERMINAL_READY;\r
-      UnixSerialIoSetControl (&Private->SerialIo, Control);\r
-    }\r
-\r
-  }\r
-\r
-  if (BytesRead != *BufferSize) {\r
-    Status = EFI_TIMEOUT;\r
-  } else {\r
-    Status = EFI_SUCCESS;\r
-  }\r
-\r
-  *BufferSize = (UINTN) BytesRead;\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Status;\r
-}\r
-\r
-BOOLEAN\r
-IsaSerialFifoFull (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Detect whether specific FIFO is full or not\r
-\r
-  Arguments:\r
-  Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-\r
-  Returns:\r
-  TRUE:  the FIFO is full\r
-  FALSE: the FIFO is not full\r
-\r
---*/\r
-{\r
-  if (Fifo->Surplus == 0) {\r
-    return TRUE;\r
-  }\r
-\r
-  return FALSE;\r
-}\r
-\r
-BOOLEAN\r
-IsaSerialFifoEmpty (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Detect whether specific FIFO is empty or not\r
-\r
-  Arguments:\r
-    Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-\r
-  Returns:\r
-    TRUE:  the FIFO is empty\r
-    FALSE: the FIFO is not empty\r
-\r
---*/\r
-{\r
-  if (Fifo->Surplus == SERIAL_MAX_BUFFER_SIZE) {\r
-    return TRUE;\r
-  }\r
-\r
-  return FALSE;\r
-}\r
-\r
-EFI_STATUS\r
-IsaSerialFifoAdd (\r
-  IN SERIAL_DEV_FIFO *Fifo,\r
-  IN UINT8           Data\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Add data to specific FIFO\r
-\r
-  Arguments:\r
-    Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8: the data added to FIFO\r
-\r
-  Returns:\r
-    EFI_SUCCESS:  Add data to specific FIFO successfully\r
-    EFI_OUT_RESOURCE: Failed to add data because FIFO is already full\r
-\r
---*/\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
-{\r
-  //\r
-  // if FIFO full can not add data\r
-  //\r
-  if (IsaSerialFifoFull (Fifo)) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // FIFO is not full can add data\r
-  //\r
-  Fifo->Data[Fifo->Last] = Data;\r
-  Fifo->Surplus--;\r
-  Fifo->Last++;\r
-  if (Fifo->Last >= SERIAL_MAX_BUFFER_SIZE) {\r
-    Fifo->Last = 0;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-IsaSerialFifoRemove (\r
-  IN  SERIAL_DEV_FIFO *Fifo,\r
-  OUT UINT8           *Data\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-  Remove data from specific FIFO\r
-\r
-  Arguments:\r
-    Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8*: the data removed from FIFO\r
-\r
-  Returns:\r
-    EFI_SUCCESS:  Remove data from specific FIFO successfully\r
-    EFI_OUT_RESOURCE: Failed to remove data because FIFO is empty\r
-\r
---*/\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
-{\r
-  //\r
-  // if FIFO is empty, no data can remove\r
-  //\r
-  if (IsaSerialFifoEmpty (Fifo)) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // FIFO is not empty, can remove data\r
-  //\r
-  *Data = Fifo->Data[Fifo->First];\r
-  Fifo->Surplus++;\r
-  Fifo->First++;\r
-  if (Fifo->First >= SERIAL_MAX_BUFFER_SIZE) {\r
-    Fifo->First = 0;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/UnixPkg/UnixSerialIoDxe/UnixSerialIo.h b/UnixPkg/UnixSerialIoDxe/UnixSerialIo.h
deleted file mode 100644 (file)
index 704b54e..0000000
+++ /dev/null
@@ -1,571 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixSerialIo.h\r
-\r
-Abstract:\r
-\r
-\r
---*/\r
-\r
-#ifndef _UNIXPKG_SERIAL_IO_\r
-#define _UNIXPKG_SERIAL_IO_\r
-\r
-#include <Common/UnixInclude.h>\r
-\r
-#include <Uefi.h>\r
-#include <Protocol/SerialIo.h>\r
-#include <Protocol/DevicePath.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include "UnixDxe.h"\r
-\r
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixSerialIoDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixSerialIoComponentName;\r
-\r
-#define SERIAL_MAX_BUFFER_SIZE  256\r
-#define TIMEOUT_STALL_INTERVAL  10\r
-\r
-typedef struct {\r
-  UINT32  First;\r
-  UINT32  Last;\r
-  UINT32  Surplus;\r
-  UINT8   Data[SERIAL_MAX_BUFFER_SIZE];\r
-} SERIAL_DEV_FIFO;\r
-\r
-#define UNIX_SERIAL_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('U', 'N', 's', 'i')\r
-typedef struct {\r
-  UINT64                    Signature;\r
-\r
-  //\r
-  // Protocol data for the new handle we are going to add\r
-  //\r
-  EFI_HANDLE                Handle;\r
-  EFI_SERIAL_IO_PROTOCOL    SerialIo;\r
-  EFI_SERIAL_IO_MODE        SerialIoMode;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-\r
-  //\r
-  // Private Data\r
-  //\r
-  EFI_HANDLE                ControllerHandle;\r
-  EFI_DEVICE_PATH_PROTOCOL  *ParentDevicePath;\r
-  UART_DEVICE_PATH          UartDevicePath;\r
-  EFI_UNIX_THUNK_PROTOCOL   *UnixThunk;\r
-\r
-  EFI_UNICODE_STRING_TABLE  *ControllerNameTable;\r
-\r
-  //\r
-  // Private NT type Data;\r
-  //\r
-  UINTN                       UnixHandle;\r
-  struct termios              UnixTermios;\r
-\r
-  BOOLEAN                   SoftwareLoopbackEnable;\r
-  BOOLEAN                   HardwareFlowControl;\r
-  BOOLEAN                   HardwareLoopbackEnable;\r
-\r
-  SERIAL_DEV_FIFO           Fifo;\r
-\r
-} UNIX_SERIAL_IO_PRIVATE_DATA;\r
-\r
-#define UNIX_SERIAL_IO_PRIVATE_DATA_FROM_THIS(a) \\r
-         CR(a, UNIX_SERIAL_IO_PRIVATE_DATA, SerialIo, UNIX_SERIAL_IO_PRIVATE_DATA_SIGNATURE)\r
-\r
-//\r
-// Global Protocol Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gUnixSerialIoDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gUnixSerialIoComponentName;\r
-\r
-//\r
-// Macros to convert EFI serial types to NT serial types.\r
-//\r
-\r
-//\r
-// one second\r
-//\r
-#define SERIAL_TIMEOUT_DEFAULT  (1000 * 1000) \r
-#define SERIAL_BAUD_DEFAULT     115200\r
-#define SERIAL_FIFO_DEFAULT     14\r
-#define SERIAL_DATABITS_DEFAULT 8\r
-#define SERIAL_PARITY_DEFAULT   DefaultParity\r
-#define SERIAL_STOPBITS_DEFAULT DefaultStopBits\r
-\r
-#define SERIAL_CONTROL_MASK     (EFI_SERIAL_CLEAR_TO_SEND                | \\r
-                                 EFI_SERIAL_DATA_SET_READY               | \\r
-                                 EFI_SERIAL_RING_INDICATE                | \\r
-                                 EFI_SERIAL_CARRIER_DETECT               | \\r
-                                 EFI_SERIAL_REQUEST_TO_SEND              | \\r
-                                 EFI_SERIAL_DATA_TERMINAL_READY          | \\r
-                                 EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE     | \\r
-                                 EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE     | \\r
-                                 EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE | \\r
-                                 EFI_SERIAL_INPUT_BUFFER_EMPTY)\r
-\r
-#define ConvertBaud2Nt(x)       (DWORD) x\r
-#define ConvertData2Nt(x)       (BYTE) x\r
-\r
-#define ConvertParity2Nt(x)              \\r
-    (BYTE) (                             \\r
-    x == DefaultParity ? NOPARITY    :   \\r
-    x == NoParity      ? NOPARITY    :   \\r
-    x == EvenParity    ? EVENPARITY  :   \\r
-    x == OddParity     ? ODDPARITY   :   \\r
-    x == MarkParity    ? MARKPARITY  :   \\r
-    x == SpaceParity   ? SPACEPARITY : 0 \\r
-    )\r
-\r
-#define ConvertStop2Nt(x)                 \\r
-    (BYTE) (                                \\r
-    x == DefaultParity   ? ONESTOPBIT   :   \\r
-    x == OneFiveStopBits ? ONE5STOPBITS :   \\r
-    x == TwoStopBits     ? TWOSTOPBITS  : 0 \\r
-    )\r
-\r
-#define ConvertTime2Nt(x) ((x) / 1000)\r
-\r
-//\r
-// 115400 baud with rounding errors\r
-//\r
-#define SERIAL_PORT_MAX_BAUD_RATE 115400  \r
-\r
-//\r
-// Fix the differences issue of linux header files termios.h \r
-// \r
-#ifndef B460800\r
-#define B460800 0010004\r
-#endif\r
-#ifndef B500000\r
-#define   B500000 0010005\r
-#endif\r
-#ifndef B576000\r
-#define   B576000 0010006\r
-#endif\r
-#ifndef B921600\r
-#define   B921600 0010007\r
-#endif\r
-#ifndef B1000000\r
-#define  B1000000 0010010\r
-#endif\r
-#ifndef B1152000\r
-#define  B1152000 0010011\r
-#endif\r
-#ifndef B1500000\r
-#define  B1500000 0010012\r
-#endif\r
-#ifndef B2000000\r
-#define  B2000000 0010013\r
-#endif\r
-#ifndef B2500000\r
-#define  B2500000 0010014\r
-#endif\r
-#ifndef B3000000\r
-#define  B3000000 0010015\r
-#endif\r
-#ifndef B3500000\r
-#define  B3500000 0010016\r
-#endif\r
-#ifndef B4000000\r
-#define  B4000000 0010017\r
-#endif\r
-#ifndef __MAX_BAUD\r
-#define __MAX_BAUD B4000000\r
-#endif\r
-#ifndef CMSPAR\r
-#define CMSPAR    010000000000    /* mark or space (stick) parity */\r
-#endif\r
-#ifndef FIONREAD\r
-#define FIONREAD  0x541B\r
-#endif\r
-//\r
-// Function Prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixSerialIo (\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ImageHandle - TODO: add argument description\r
-  SystemTable - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Handle              - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  UINTN                         NumberOfChildren,\r
-  IN  EFI_HANDLE                    *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  Handle            - TODO: add argument description\r
-  NumberOfChildren  - TODO: add argument description\r
-  ChildHandleBuffer - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoReset (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoSetAttributes (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT64                 BaudRate,\r
-  IN UINT32                 ReceiveFifoDepth,\r
-  IN UINT32                 Timeout,\r
-  IN EFI_PARITY_TYPE        Parity,\r
-  IN UINT8                  DataBits,\r
-  IN EFI_STOP_BITS_TYPE     StopBits\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - TODO: add argument description\r
-  BaudRate          - TODO: add argument description\r
-  ReceiveFifoDepth  - TODO: add argument description\r
-  Timeout           - TODO: add argument description\r
-  Parity            - TODO: add argument description\r
-  DataBits          - TODO: add argument description\r
-  StopBits          - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoSetControl (\r
-  IN EFI_SERIAL_IO_PROTOCOL *This,\r
-  IN UINT32                 Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoGetControl (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  OUT UINT32                  *Control\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This    - TODO: add argument description\r
-  Control - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoWrite (\r
-  IN EFI_SERIAL_IO_PROTOCOL   *This,\r
-  IN OUT UINTN                *BufferSize,\r
-  IN VOID                     *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSerialIoRead (\r
-  IN  EFI_SERIAL_IO_PROTOCOL  *This,\r
-  IN  OUT UINTN               *BufferSize,\r
-  OUT VOID                    *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This        - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-IsaSerialFifoFull (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-IsaSerialFifoEmpty (\r
-  IN SERIAL_DEV_FIFO *Fifo\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-IsaSerialFifoAdd (\r
-  IN SERIAL_DEV_FIFO *Fifo,\r
-  IN UINT8           Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-  Data  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-IsaSerialFifoRemove (\r
-  IN  SERIAL_DEV_FIFO *Fifo,\r
-  OUT UINT8           *Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Fifo  - TODO: add argument description\r
-  Data  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-IsaSerialReceiveTransmit (\r
-  UNIX_SERIAL_IO_PRIVATE_DATA     *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Private - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/UnixPkg/UnixSerialIoDxe/UnixSerialIo.inf b/UnixPkg/UnixSerialIoDxe/UnixSerialIo.inf
deleted file mode 100644 (file)
index 01b3d2f..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-## @file\r
-# Serial I/O driver\r
-#\r
-# Our DriverBinding member functions operate on the handles\r
-#  created by the Unix Bus driver\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixSerialIo\r
-  FILE_GUID                      = 600F2BF2-63A7-48ca-9FD0-A3450B87EE05\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixSerialIo\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32\r
-#\r
-#  DRIVER_BINDING                =  gUnixSerialIoDriverBinding                   \r
-#  COMPONENT_NAME                =  gUnixSerialIoComponentName                   \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  UnixSerialIo.c\r
-  UnixSerialIo.h\r
-  EntryPoint.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  MemoryAllocationLib\r
-  DevicePathLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiUnixSerialPortGuid                        # ALWAYS_CONSUMED\r
-  gEfiUartDevicePathGuid                        # BY_START\r
-\r
-[Protocols]\r
-  gEfiSerialIoProtocolGuid                      # PROTOCOL BY_START\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL TO_START\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL TO_START\r
-\r
diff --git a/UnixPkg/UnixSimpleFileSystemDxe/ComponentName.c b/UnixPkg/UnixSimpleFileSystemDxe/ComponentName.c
deleted file mode 100644 (file)
index dce6435..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixSimpleFileSystem.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                                        *This,\r
-  IN  EFI_HANDLE                                                         ControllerHandle,\r
-  IN  EFI_HANDLE                                                         ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                                              *Language,\r
-  OUT CHAR16                                                             **ControllerName\r
-  );\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-EFI_COMPONENT_NAME_PROTOCOL     gUnixSimpleFileSystemComponentName = {\r
-  UnixSimpleFileSystemComponentNameGetDriverName,\r
-  UnixSimpleFileSystemComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-EFI_UNICODE_STRING_TABLE mUnixSimpleFileSystemDriverNameTable[] = {\r
-  {\r
-    "eng",\r
-    L"Unix Simple File System Driver"\r
-  },\r
-  {\r
-    NULL,\r
-    NULL\r
-  }\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language \r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned \r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixSimpleFileSystemComponentName.SupportedLanguages,\r
-          mUnixSimpleFileSystemDriverNameTable,\r
-          DriverName\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                                        *This,\r
-  IN  EFI_HANDLE                                                         ControllerHandle,\r
-  IN  EFI_HANDLE                                                         ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                                              *Language,\r
-  OUT CHAR16                                                             **ControllerName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by \r
-                       This is managing.  This handle specifies the controller \r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name \r
-                       of.  This is an optional parameter that may be NULL.  It \r
-                       will be NULL for device drivers.  It will also be NULL \r
-                       for a bus drivers that wish to retrieve the name of the \r
-                       bus controller.  It will not be NULL for a bus driver \r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by \r
-                       ControllerHandle and ChildHandle in the language specified\r
-                       by Language from the point of view of the driver specified\r
-                       by This. \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
-                            language specified by Language for the driver \r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently managing \r
-                            the controller specified by ControllerHandle and \r
-                            ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                        Status;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL   *SimpleFileSystem;\r
-  UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gUnixSimpleFileSystemDriverBinding.DriverBindingHandle,\r
-             &gEfiUnixIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  (VOID**)&SimpleFileSystem,\r
-                  gUnixSimpleFileSystemDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (SimpleFileSystem);\r
-\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixSimpleFileSystemComponentName.SupportedLanguages,\r
-          Private->ControllerNameTable,\r
-          ControllerName\r
-          );\r
-}\r
diff --git a/UnixPkg/UnixSimpleFileSystemDxe/EntryPoint.c b/UnixPkg/UnixSimpleFileSystemDxe/EntryPoint.c
deleted file mode 100644 (file)
index 4002ffd..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/**@file\r
-  Entry Point Source file.\r
-\r
-  This file contains the user entry point \r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-   This program and the accompanying materials\r
-   are licensed and made available under the terms and conditions of the BSD License\r
-   which accompanies this distribution. The full text of the license may be found at\r
-   http://opensource.org/licenses/bsd-license.php\r
-   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-**/\r
-\r
-\r
-\r
-#include "UnixSimpleFileSystem.h"\r
-\r
-/**\r
-  The user Entry Point for module UnixSimpleFileSystem. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixSimpleFileSystem(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  Status = EfiLibInstallAllDriverProtocols (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gUnixSimpleFileSystemDriverBinding,\r
-             ImageHandle,\r
-             &gUnixSimpleFileSystemComponentName,\r
-             NULL,\r
-             NULL\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c b/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.c
deleted file mode 100644 (file)
index 0bd1c65..0000000
+++ /dev/null
@@ -1,2193 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixSimpleFileSystem.c\r
-\r
-Abstract:\r
-\r
-  Produce Simple File System abstractions for directories on your PC using Posix APIs.\r
-  The configuration of what devices to mount or emulate comes from UNIX \r
-  environment variables. The variables must be visible to the Microsoft* \r
-  Developer Studio for them to work.\r
-\r
-  * Other names and brands may be claimed as the property of others.\r
-\r
---*/\r
-\r
-#include "UnixSimpleFileSystem.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gUnixSimpleFileSystemDriverBinding = {\r
-  UnixSimpleFileSystemDriverBindingSupported,\r
-  UnixSimpleFileSystemDriverBindingStart,\r
-  UnixSimpleFileSystemDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-\r
-CHAR16 *\r
-EfiStrChr (\r
-  IN CHAR16   *Str,\r
-  IN CHAR16   Chr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Locate the first occurance of a character in a string.\r
-\r
-Arguments:\r
-\r
-  Str - Pointer to NULL terminated unicode string.\r
-  Chr - Character to locate.\r
-\r
-Returns:\r
-\r
-  If Str is NULL, then NULL is returned.\r
-  If Chr is not contained in Str, then NULL is returned.\r
-  If Chr is contained in Str, then a pointer to the first occurance of Chr in Str is returned.\r
-\r
---*/\r
-{\r
-  if (Str == NULL) {\r
-    return Str;\r
-  }\r
-\r
-  while (*Str != '\0' && *Str != Chr) {\r
-    ++Str;\r
-  }\r
-\r
-  return (*Str == Chr) ? Str : NULL;\r
-}\r
-\r
-BOOLEAN\r
-IsZero (\r
-  IN VOID   *Buffer,\r
-  IN UINTN  Length\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Buffer  - TODO: add argument description\r
-  Length  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  if (Buffer == NULL || Length == 0) {\r
-    return FALSE;\r
-  }\r
-\r
-  if (*(UINT8 *) Buffer != 0) {\r
-    return FALSE;\r
-  }\r
-\r
-  if (Length > 1) {\r
-    if (!CompareMem (Buffer, (UINT8 *) Buffer + 1, Length - 1)) {\r
-      return FALSE;\r
-    }\r
-  }\r
-\r
-  return TRUE;\r
-}\r
-\r
-VOID\r
-CutPrefix (\r
-  IN  CHAR8  *Str,\r
-  IN  UINTN   Count\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Str   - TODO: add argument description\r
-  Count - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  CHAR8  *Pointer;\r
-\r
-  if (AsciiStrLen (Str) < Count) {\r
-    ASSERT (0);\r
-  }\r
-\r
-  for (Pointer = Str; *(Pointer + Count); Pointer++) {\r
-    *Pointer = *(Pointer + Count);\r
-  }\r
-\r
-  *Pointer = *(Pointer + Count);\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Check to see if the driver supports a given controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to test.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS         - The device specified by ControllerHandle and RemainingDevicePath is supported by the driver\r
-                        specified by This.\r
-\r
-  EFI_ALREADY_STARTED - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        the driver specified by This.\r
-\r
-  EFI_ACCESS_DENIED   - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        a different driver or an application that requires exclusive access.\r
-\r
-  EFI_UNSUPPORTED     - The device specified by ControllerHandle and RemainingDevicePath is not supported by the\r
-                        driver specified by This.\r
-\r
---*/\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID **)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Make sure GUID is for a File System handle.\r
-  //\r
-  Status = EFI_UNSUPPORTED;\r
-  if (CompareGuid (UnixIo->TypeGuid, &gEfiUnixFileSystemGuid)) {\r
-    Status = EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        ControllerHandle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Starts a device controller or a bus controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to start.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The device or bus controller has been started.\r
-\r
-  EFI_DEVICE_ERROR      - The device could not be started due to a device failure.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The request could not be completed due to lack of resources.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                        Status;\r
-  EFI_UNIX_IO_PROTOCOL            *UnixIo;\r
-  UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-  INTN i;\r
-\r
-  Private = NULL;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID **)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Validate GUID\r
-  //\r
-  if (!CompareGuid (UnixIo->TypeGuid, &gEfiUnixFileSystemGuid)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (UNIX_SIMPLE_FILE_SYSTEM_PRIVATE),\r
-                  (VOID **)&Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  Private->Signature  = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE;\r
-  Private->UnixThunk = UnixIo->UnixThunk;\r
-  Private->FilePath   = NULL;\r
-  Private->VolumeLabel = NULL;\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrLen (UnixIo->EnvString) + 1,\r
-                  (VOID **)&Private->FilePath\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  for (i = 0; UnixIo->EnvString[i] != 0; i++)\r
-    Private->FilePath[i] = UnixIo->EnvString[i];\r
-  Private->FilePath[i] = 0;\r
-\r
-  Private->VolumeLabel      = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (L"EFI_EMULATED"),\r
-                  (VOID **)&Private->VolumeLabel\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  StrCpy (Private->VolumeLabel, L"EFI_EMULATED");\r
-\r
-  Private->SimpleFileSystem.Revision    = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION;\r
-  Private->SimpleFileSystem.OpenVolume  = UnixSimpleFileSystemOpenVolume;\r
-\r
-  Private->ControllerNameTable = NULL;\r
-\r
-  AddUnicodeString (\r
-    "eng",\r
-    gUnixSimpleFileSystemComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    UnixIo->EnvString\r
-    );\r
-\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  &Private->SimpleFileSystem,\r
-                  NULL\r
-                  );\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-\r
-    if (Private != NULL) {\r
-\r
-      if (Private->VolumeLabel != NULL)\r
-  gBS->FreePool (Private->VolumeLabel);\r
-      if (Private->FilePath != NULL)\r
-  gBS->FreePool (Private->FilePath);\r
-      FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-      gBS->FreePool (Private);\r
-    }\r
-\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle  - A handle to the device to be stopped.\r
-\r
-  NumberOfChildren  - The number of child device handles in ChildHandleBuffer.\r
-\r
-  ChildHandleBuffer - An array of child device handles to be freed.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS       - The device has been stopped.\r
-\r
-  EFI_DEVICE_ERROR  - The device could not be stopped due to a device failure.\r
-\r
---*/\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-{\r
-  EFI_STATUS                        Status;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL   *SimpleFileSystem;\r
-  UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  (VOID **)&SimpleFileSystem,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (SimpleFileSystem);\r
-\r
-  //\r
-  // Uninstall the Simple File System Protocol from ControllerHandle\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  ControllerHandle,\r
-                  &gEfiSimpleFileSystemProtocolGuid,\r
-                  &Private->SimpleFileSystem,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    Status = gBS->CloseProtocol (\r
-                    ControllerHandle,\r
-                    &gEfiUnixIoProtocolGuid,\r
-                    This->DriverBindingHandle,\r
-                    ControllerHandle\r
-                    );\r
-  }\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Free our instance data\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-    gBS->FreePool (Private);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemOpenVolume (\r
-  IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL  *This,\r
-  OUT EFI_FILE_PROTOCOL               **Root\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open the root directory on a volume.\r
-\r
-Arguments:\r
-\r
-  This  - A pointer to the volume to open.\r
-\r
-  Root  - A pointer to storage for the returned opened file handle of the root directory.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The volume was opened.\r
-\r
-  EFI_UNSUPPORTED       - The volume does not support the requested file system type.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The file volume could not be opened due to lack of resources.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS                        Status;\r
-  UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *Private;\r
-  UNIX_EFI_FILE_PRIVATE           *PrivateFile;\r
-  EFI_TPL                           OldTpl;\r
-\r
-  if (This == NULL || Root == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  Private     = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  PrivateFile = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (UNIX_EFI_FILE_PRIVATE),\r
-                  (VOID **)&PrivateFile\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  PrivateFile->FileName = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  AsciiStrSize (Private->FilePath),\r
-                  (VOID **)&PrivateFile->FileName\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  AsciiStrCpy (PrivateFile->FileName, Private->FilePath);\r
-  PrivateFile->Signature            = UNIX_EFI_FILE_PRIVATE_SIGNATURE;\r
-  PrivateFile->UnixThunk           = Private->UnixThunk;\r
-  PrivateFile->SimpleFileSystem     = This;\r
-  PrivateFile->IsRootDirectory      = TRUE;\r
-  PrivateFile->IsDirectoryPath      = TRUE;\r
-  PrivateFile->IsOpenedByRead       = TRUE;\r
-  PrivateFile->EfiFile.Revision     = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION;\r
-  PrivateFile->EfiFile.Open         = UnixSimpleFileSystemOpen;\r
-  PrivateFile->EfiFile.Close        = UnixSimpleFileSystemClose;\r
-  PrivateFile->EfiFile.Delete       = UnixSimpleFileSystemDelete;\r
-  PrivateFile->EfiFile.Read         = UnixSimpleFileSystemRead;\r
-  PrivateFile->EfiFile.Write        = UnixSimpleFileSystemWrite;\r
-  PrivateFile->EfiFile.GetPosition  = UnixSimpleFileSystemGetPosition;\r
-  PrivateFile->EfiFile.SetPosition  = UnixSimpleFileSystemSetPosition;\r
-  PrivateFile->EfiFile.GetInfo      = UnixSimpleFileSystemGetInfo;\r
-  PrivateFile->EfiFile.SetInfo      = UnixSimpleFileSystemSetInfo;\r
-  PrivateFile->EfiFile.Flush        = UnixSimpleFileSystemFlush;\r
-  PrivateFile->fd                   = -1;\r
-  PrivateFile->Dir                  = NULL;\r
-  PrivateFile->Dirent               = NULL;\r
-  \r
-  *Root = &PrivateFile->EfiFile;\r
-\r
-  PrivateFile->Dir = PrivateFile->UnixThunk->OpenDir(PrivateFile->FileName);\r
-\r
-  if (PrivateFile->Dir == NULL) {\r
-    Status = EFI_ACCESS_DENIED;\r
-  }\r
-  else {\r
-    Status = EFI_SUCCESS;\r
-  }\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-    if (PrivateFile) {\r
-      if (PrivateFile->FileName) {\r
-        gBS->FreePool (PrivateFile->FileName);\r
-      }\r
-\r
-      gBS->FreePool (PrivateFile);\r
-    }\r
-    \r
-    *Root = NULL;\r
-  }\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemOpen (\r
-  IN  EFI_FILE_PROTOCOL   *This,\r
-  OUT EFI_FILE_PROTOCOL   **NewHandle,\r
-  IN  CHAR16              *FileName,\r
-  IN  UINT64              OpenMode,\r
-  IN  UINT64              Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open a file relative to the source file location.\r
-\r
-Arguments:\r
-\r
-  This        - A pointer to the source file location.\r
-\r
-  NewHandle   - Pointer to storage for the new file handle.\r
-\r
-  FileName    - Pointer to the file name to be opened.\r
-\r
-  OpenMode    - File open mode information.\r
-\r
-  Attributes  - File creation attributes.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file was opened.\r
-\r
-  EFI_NOT_FOUND         - The file could not be found in the volume.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The volume or file is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources were available to open the file.\r
-\r
-  EFI_VOLUME_FULL       - There is not enough space left to create the new file.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_FILE_PROTOCOL                 *Root;\r
-  UNIX_EFI_FILE_PRIVATE           *PrivateFile;\r
-  UNIX_EFI_FILE_PRIVATE           *NewPrivateFile;\r
-  UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *PrivateRoot;\r
-  EFI_STATUS                        Status;\r
-  CHAR16                            *Src;\r
-  char                              *Dst;\r
-  CHAR8                             *RealFileName;\r
-  char                              *ParseFileName;\r
-  char                              *GuardPointer;\r
-  CHAR8                             TempChar;\r
-  UINTN                             Count;\r
-  BOOLEAN                           TrailingDash;\r
-  BOOLEAN                           LoopFinish;\r
-  UINTN                             InfoSize;\r
-  EFI_FILE_INFO                     *Info;\r
-\r
-  TrailingDash = FALSE;\r
-\r
-  //\r
-  // Check for obvious invalid parameters.\r
-  //\r
-  if (This == NULL || NewHandle == NULL || FileName == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  switch (OpenMode) {\r
-  case EFI_FILE_MODE_CREATE | EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE:\r
-    if (Attributes &~EFI_FILE_VALID_ATTR) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    if (Attributes & EFI_FILE_READ_ONLY) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-  //\r
-  // fall through\r
-  //\r
-  case EFI_FILE_MODE_READ:\r
-  case EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE:\r
-    break;\r
-\r
-  default:\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-\r
-  PrivateFile     = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-  PrivateRoot     = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
-  NewPrivateFile  = NULL;\r
-\r
-  //\r
-  // BUGBUG: assume an open of root\r
-  // if current location, return current data\r
-  //\r
-  if (StrCmp (FileName, L"\\") == 0\r
-      || (StrCmp (FileName, L".") == 0 && PrivateFile->IsRootDirectory)) {\r
-    //\r
-    // BUGBUG: assume an open root\r
-    //\r
-OpenRoot:\r
-    Status          = UnixSimpleFileSystemOpenVolume (PrivateFile->SimpleFileSystem, &Root);\r
-    NewPrivateFile  = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (Root);\r
-    goto Done;\r
-  }\r
-\r
-  if (FileName[StrLen (FileName) - 1] == L'\\') {\r
-    TrailingDash                        = TRUE;\r
-    FileName[StrLen (FileName) - 1]  = 0;\r
-  }\r
-\r
-  //\r
-  // Attempt to open the file\r
-  //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (UNIX_EFI_FILE_PRIVATE),\r
-                  (VOID **)&NewPrivateFile\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  CopyMem (NewPrivateFile, PrivateFile, sizeof (UNIX_EFI_FILE_PRIVATE));\r
-\r
-  NewPrivateFile->FileName = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  AsciiStrSize (PrivateFile->FileName) + 1 + StrLen (FileName) + 1,\r
-                  (VOID **)&NewPrivateFile->FileName\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  if (*FileName == L'\\') {\r
-    AsciiStrCpy (NewPrivateFile->FileName, PrivateRoot->FilePath);\r
-    // Skip first '\'.\r
-    Src = FileName + 1;\r
-  } else {\r
-    AsciiStrCpy (NewPrivateFile->FileName, PrivateFile->FileName);\r
-    Src = FileName;\r
-  }\r
-  Dst = NewPrivateFile->FileName + AsciiStrLen(NewPrivateFile->FileName);\r
-  GuardPointer = NewPrivateFile->FileName + AsciiStrLen(PrivateRoot->FilePath);\r
-  *Dst++ = '/';\r
-  // Convert unicode to ascii and '\' to '/'\r
-  while (*Src) {\r
-    if (*Src == '\\')\r
-      *Dst++ = '/';\r
-    else\r
-      *Dst++ = *Src;\r
-    Src++;\r
-  }\r
-  *Dst = 0;\r
-      \r
-\r
-  //\r
-  // Get rid of . and .., except leading . or ..\r
-  //\r
-\r
-  //\r
-  // GuardPointer protect simplefilesystem root path not be destroyed\r
-  //\r
-\r
-  LoopFinish    = FALSE;\r
-\r
-  while (!LoopFinish) {\r
-\r
-    LoopFinish = TRUE;\r
-\r
-    for (ParseFileName = GuardPointer; *ParseFileName; ParseFileName++) {\r
-      if (*ParseFileName == '.' &&\r
-          (*(ParseFileName + 1) == 0 || *(ParseFileName + 1) == '/') &&\r
-          *(ParseFileName - 1) == '/'\r
-          ) {\r
-\r
-        //\r
-        // cut /.\r
-        //\r
-        CutPrefix (ParseFileName - 1, 2);\r
-        LoopFinish = FALSE;\r
-        break;\r
-      }\r
-\r
-      if (*ParseFileName == '.' &&\r
-          *(ParseFileName + 1) == '.' &&\r
-          (*(ParseFileName + 2) == 0 || *(ParseFileName + 2) == '/') &&\r
-          *(ParseFileName - 1) == '/'\r
-          ) {\r
-\r
-        ParseFileName--;\r
-        Count = 3;\r
-\r
-        while (ParseFileName != GuardPointer) {\r
-          ParseFileName--;\r
-          Count++;\r
-          if (*ParseFileName == '/') {\r
-            break;\r
-          }\r
-        }\r
-\r
-        //\r
-        // cut /.. and its left directory\r
-        //\r
-        CutPrefix (ParseFileName, Count);\r
-        LoopFinish = FALSE;\r
-        break;\r
-      }\r
-    }\r
-  }\r
-\r
-  if (AsciiStrCmp (NewPrivateFile->FileName, PrivateRoot->FilePath) == 0) {\r
-    NewPrivateFile->IsRootDirectory = TRUE;\r
-    gBS->FreePool (NewPrivateFile->FileName);\r
-    gBS->FreePool (NewPrivateFile);\r
-    goto OpenRoot;\r
-  }\r
-\r
-  RealFileName = NewPrivateFile->FileName + AsciiStrLen(NewPrivateFile->FileName) - 1;\r
-  while (RealFileName > NewPrivateFile->FileName && *RealFileName != '/')\r
-    RealFileName--;\r
-\r
-  TempChar            = *(RealFileName - 1);\r
-  *(RealFileName - 1) = 0;\r
-\r
-  *(RealFileName - 1)             = TempChar;\r
-\r
-\r
-\r
-  //\r
-  // Test whether file or directory\r
-  //\r
-  NewPrivateFile->IsRootDirectory = FALSE;\r
-  NewPrivateFile->fd = -1;\r
-  NewPrivateFile->Dir = NULL;\r
-  if (OpenMode & EFI_FILE_MODE_CREATE) {\r
-    if (Attributes & EFI_FILE_DIRECTORY) {\r
-      NewPrivateFile->IsDirectoryPath = TRUE;\r
-    } else {\r
-      NewPrivateFile->IsDirectoryPath = FALSE;\r
-    }\r
-  } else {\r
-    STAT_FIX finfo;\r
-    int res = NewPrivateFile->UnixThunk->Stat (NewPrivateFile->FileName, &finfo);\r
-    if (res == 0 && S_ISDIR(finfo.st_mode))\r
-      NewPrivateFile->IsDirectoryPath = TRUE;\r
-    else\r
-      NewPrivateFile->IsDirectoryPath = FALSE;\r
-  }\r
-\r
-  if (OpenMode & EFI_FILE_MODE_WRITE) {\r
-    NewPrivateFile->IsOpenedByRead = FALSE;\r
-  } else {\r
-    NewPrivateFile->IsOpenedByRead = TRUE;\r
-  }\r
-\r
-  Status = EFI_SUCCESS;\r
-\r
-  //\r
-  // deal with directory\r
-  //\r
-  if (NewPrivateFile->IsDirectoryPath) {\r
-\r
-    if ((OpenMode & EFI_FILE_MODE_CREATE)) {\r
-      //\r
-      // Create a directory\r
-      //\r
-      if (NewPrivateFile->UnixThunk->MkDir (NewPrivateFile->FileName, 0777) != 0) {\r
-  INTN LastError;\r
-\r
-        LastError = PrivateFile->UnixThunk->GetErrno ();\r
-        if (LastError != EEXIST) {\r
-          //gBS->FreePool (TempFileName);\r
-          Status = EFI_ACCESS_DENIED;\r
-          goto Done;\r
-        }\r
-      }\r
-    }\r
-\r
-    NewPrivateFile->Dir = NewPrivateFile->UnixThunk->OpenDir\r
-      (NewPrivateFile->FileName);\r
-\r
-    if (NewPrivateFile->Dir == NULL) {\r
-      if (PrivateFile->UnixThunk->GetErrno () == EACCES) {\r
-        Status                    = EFI_ACCESS_DENIED;\r
-      } else {\r
-        Status = EFI_NOT_FOUND;\r
-      }\r
-\r
-      goto Done;\r
-    }\r
-\r
-  } else {\r
-    //\r
-    // deal with file\r
-    //\r
-    NewPrivateFile->fd = NewPrivateFile->UnixThunk->Open\r
-      (NewPrivateFile->FileName,\r
-       ((OpenMode & EFI_FILE_MODE_CREATE) ? O_CREAT : 0)\r
-       | (NewPrivateFile->IsOpenedByRead ? O_RDONLY : O_RDWR),\r
-       0666);\r
-    if (NewPrivateFile->fd < 0) {\r
-      if (PrivateFile->UnixThunk->GetErrno () == ENOENT) {\r
-  Status = EFI_NOT_FOUND;\r
-      } else {\r
-  Status = EFI_ACCESS_DENIED;\r
-      }\r
-    }\r
-  }\r
-\r
-  if ((OpenMode & EFI_FILE_MODE_CREATE) && Status == EFI_SUCCESS) {\r
-    //\r
-    // Set the attribute\r
-    //\r
-    InfoSize  = 0;\r
-    Info      = NULL;\r
-\r
-    Status    = UnixSimpleFileSystemGetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, &InfoSize, Info);\r
-\r
-    if (Status != EFI_BUFFER_TOO_SMALL) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    InfoSize,\r
-                    (VOID **)&Info\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    Status = UnixSimpleFileSystemGetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, &InfoSize, Info);\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    Info->Attribute = Attributes;\r
-\r
-    UnixSimpleFileSystemSetInfo (&NewPrivateFile->EfiFile, &gEfiFileInfoGuid, InfoSize, Info);\r
-  }\r
-\r
-Done: ;\r
-  if (TrailingDash) {\r
-    FileName[StrLen (FileName) + 1]  = 0;\r
-    FileName[StrLen (FileName)]      = L'\\';\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    if (NewPrivateFile) {\r
-      if (NewPrivateFile->FileName) {\r
-        gBS->FreePool (NewPrivateFile->FileName);\r
-      }\r
-\r
-      gBS->FreePool (NewPrivateFile);\r
-    }\r
-  } else {\r
-    *NewHandle = &NewPrivateFile->EfiFile;\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemClose (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close the specified file handle.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The file handle has been closed.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  UNIX_EFI_FILE_PRIVATE *PrivateFile;\r
-  EFI_TPL                OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  if (PrivateFile->fd >= 0) {\r
-    PrivateFile->UnixThunk->Close (PrivateFile->fd);\r
-  }\r
-  if (PrivateFile->Dir != NULL) {\r
-    PrivateFile->UnixThunk->CloseDir (PrivateFile->Dir);\r
-  }\r
-\r
-  PrivateFile->fd = -1;\r
-  PrivateFile->Dir = NULL;\r
-\r
-  if (PrivateFile->FileName) {\r
-    gBS->FreePool (PrivateFile->FileName);\r
-  }\r
-\r
-  gBS->FreePool (PrivateFile);\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDelete (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close and delete a file.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS             - The file handle was closed and deleted.\r
-\r
-  EFI_WARN_DELETE_FAILURE - The handle was closed but could not be deleted.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  UNIX_EFI_FILE_PRIVATE   *PrivateFile;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
-  PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  Status      = EFI_WARN_DELETE_FAILURE;\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    if (PrivateFile->Dir != NULL) {\r
-      PrivateFile->UnixThunk->CloseDir (PrivateFile->Dir);\r
-      PrivateFile->Dir = NULL;\r
-    }\r
-\r
-    if (PrivateFile->UnixThunk->RmDir (PrivateFile->FileName) == 0) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-  } else {\r
-    PrivateFile->UnixThunk->Close (PrivateFile->fd);\r
-    PrivateFile->fd = -1;\r
-\r
-    if (!PrivateFile->IsOpenedByRead) {\r
-      if (!PrivateFile->UnixThunk->UnLink (PrivateFile->FileName)) {\r
-        Status = EFI_SUCCESS;\r
-      }\r
-    }\r
-  }\r
-\r
-  gBS->FreePool (PrivateFile->FileName);\r
-  gBS->FreePool (PrivateFile);\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-}\r
-\r
-VOID\r
-UnixSystemTimeToEfiTime (\r
-  EFI_UNIX_THUNK_PROTOCOL        *UnixThunk,\r
-  IN time_t                 SystemTime,\r
-  OUT EFI_TIME              *Time\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  SystemTime  - TODO: add argument description\r
-  TimeZone    - TODO: add argument description\r
-  Time        - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  struct tm *tm;\r
-  tm = UnixThunk->GmTime (&SystemTime);\r
-  Time->Year   = tm->tm_year;\r
-  Time->Month  = tm->tm_mon + 1;\r
-  Time->Day    = tm->tm_mday;\r
-  Time->Hour   = tm->tm_hour;\r
-  Time->Minute = tm->tm_min;\r
-  Time->Second = tm->tm_sec;\r
-  Time->Nanosecond  = 0;\r
-\r
-  Time->TimeZone    = UnixThunk->GetTimeZone ();\r
-\r
-  if (UnixThunk->GetDayLight ()) {\r
-    Time->Daylight = EFI_TIME_ADJUST_DAYLIGHT;\r
-  }\r
-}\r
-\r
-EFI_STATUS\r
-UnixSimpleFileSystemFileInfo (\r
-  UNIX_EFI_FILE_PRIVATE          *PrivateFile,\r
-  IN     CHAR8                    *FileName,\r
-  IN OUT UINTN                    *BufferSize,\r
-  OUT    VOID                     *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PrivateFile - TODO: add argument description\r
-  BufferSize  - TODO: add argument description\r
-  Buffer      - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  UINTN                       Size;\r
-  UINTN                       NameSize;\r
-  UINTN                       ResultSize;\r
-  EFI_FILE_INFO               *Info;\r
-  CHAR8                       *RealFileName;\r
-  CHAR8                       *TempPointer;\r
-  CHAR16                      *BufferFileName;\r
-  STAT_FIX                    buf;\r
-\r
-  if (FileName != NULL) {\r
-    RealFileName = FileName;\r
-  }\r
-  else if (PrivateFile->IsRootDirectory) {\r
-    RealFileName = "";\r
-  } else {\r
-    RealFileName  = PrivateFile->FileName;\r
-  }\r
-\r
-  TempPointer   = RealFileName;\r
-  while (*TempPointer) {\r
-    if (*TempPointer == '/') {\r
-      RealFileName = TempPointer + 1;\r
-    }\r
-\r
-    TempPointer++;\r
-  }\r
-\r
-  Size        = SIZE_OF_EFI_FILE_INFO;\r
-  NameSize    = AsciiStrSize (RealFileName) * 2;\r
-  ResultSize  = Size + NameSize;\r
-\r
-  if (*BufferSize < ResultSize) {\r
-    *BufferSize = ResultSize;\r
-    return EFI_BUFFER_TOO_SMALL;\r
-  }\r
-  if (PrivateFile->UnixThunk->Stat (\r
-          FileName == NULL ? PrivateFile->FileName : FileName,\r
-    &buf) < 0)\r
-    return EFI_DEVICE_ERROR;\r
-\r
-  Status  = EFI_SUCCESS;\r
-\r
-  Info    = Buffer;\r
-  ZeroMem (Info, ResultSize);\r
-\r
-  Info->Size = ResultSize;\r
-  Info->FileSize      = buf.st_size;\r
-  Info->PhysicalSize  = MultU64x32 (buf.st_blocks, buf.st_blksize);\r
-\r
-  UnixSystemTimeToEfiTime (PrivateFile->UnixThunk, buf.st_ctime, &Info->CreateTime);\r
-  UnixSystemTimeToEfiTime (PrivateFile->UnixThunk, buf.st_atime, &Info->LastAccessTime);\r
-  UnixSystemTimeToEfiTime (PrivateFile->UnixThunk, buf.st_mtime, &Info->ModificationTime);\r
-\r
-  if (!(buf.st_mode & S_IWUSR)) {\r
-    Info->Attribute |= EFI_FILE_READ_ONLY;\r
-  }\r
-\r
-  if (S_ISDIR(buf.st_mode)) {\r
-    Info->Attribute |= EFI_FILE_DIRECTORY;\r
-  }\r
-\r
-\r
-  BufferFileName = (CHAR16 *)((CHAR8 *) Buffer + Size);\r
-  while (*RealFileName)\r
-    *BufferFileName++ = *RealFileName++;\r
-  *BufferFileName = 0;\r
-\r
-  *BufferSize = ResultSize;\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemRead (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Read data from a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to a returned open file handle.\r
-\r
-  BufferSize  - On input, the size of the Buffer.  On output, the number of bytes stored in the Buffer.\r
-\r
-  Buffer      - Pointer to the first byte of the read Buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was read.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The supplied buffer size was too small to store the current directory entry.\r
-                          *BufferSize has been updated with the size needed to complete the request.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  UNIX_EFI_FILE_PRIVATE *PrivateFile;\r
-  EFI_STATUS              Status;\r
-  INTN                    Res;\r
-  UINTN                   Size;\r
-  UINTN                   NameSize;\r
-  UINTN                   ResultSize;\r
-  CHAR8                   *FullFileName;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL || BufferSize == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-  \r
-  if ((*BufferSize != 0) && (Buffer == NULL)) {\r
-    // Buffer can be NULL  if *BufferSize is zero\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
-  PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (!PrivateFile->IsDirectoryPath) {\r
-\r
-    if (PrivateFile->fd < 0) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-    Res = PrivateFile->UnixThunk->Read (\r
-           PrivateFile->fd,\r
-           Buffer,\r
-           *BufferSize);\r
-    if (Res < 0) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-    *BufferSize = Res;\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Read on a directory.\r
-  //\r
-  if (PrivateFile->Dir == NULL) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->Dirent == NULL) {\r
-    PrivateFile->Dirent = PrivateFile->UnixThunk->ReadDir (PrivateFile->Dir);\r
-    if (PrivateFile->Dirent == NULL) {\r
-      *BufferSize = 0;\r
-      Status = EFI_SUCCESS;\r
-      goto Done;\r
-    }\r
-  }\r
-\r
-  Size        = SIZE_OF_EFI_FILE_INFO;\r
-  NameSize    = AsciiStrLen (PrivateFile->Dirent->d_name) + 1;\r
-  ResultSize  = Size + 2 * NameSize;\r
-\r
-  if (*BufferSize < ResultSize) {\r
-    *BufferSize = ResultSize;\r
-    Status = EFI_BUFFER_TOO_SMALL;\r
-    goto Done;\r
-  }\r
-  Status  = EFI_SUCCESS;\r
-\r
-  *BufferSize = ResultSize;\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  AsciiStrLen(PrivateFile->FileName) + 1 + NameSize,\r
-                  (VOID **)&FullFileName\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-      \r
-  AsciiStrCpy(FullFileName, PrivateFile->FileName);\r
-  AsciiStrCat(FullFileName, "/");\r
-  AsciiStrCat(FullFileName, PrivateFile->Dirent->d_name);\r
-  Status = UnixSimpleFileSystemFileInfo (PrivateFile,\r
-            FullFileName,\r
-            BufferSize,\r
-            Buffer);\r
-  gBS->FreePool (FullFileName);\r
-\r
-  PrivateFile->Dirent = NULL;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemWrite (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  IN     VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Write data to a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to an opened file handle.\r
-\r
-  BufferSize  - On input, the number of bytes in the Buffer to write to the file.  On output, the number of bytes\r
-                of data written to the file.\r
-\r
-  Buffer      - Pointer to the first by of data in the buffer to write to the file.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was written to the file.\r
-\r
-  EFI_UNSUPPORTED       - Writes to an open directory are not supported.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  UNIX_EFI_FILE_PRIVATE *PrivateFile;\r
-  UINTN                 Res;\r
-  EFI_STATUS            Status;\r
-  EFI_TPL               OldTpl;\r
-\r
-  if (This == NULL || BufferSize == NULL || Buffer == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->fd < 0) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (PrivateFile->IsOpenedByRead) {\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-\r
-  Res = PrivateFile->UnixThunk->Write (\r
-          PrivateFile->fd,\r
-          Buffer,\r
-          *BufferSize);\r
-  if (Res == (UINTN)-1) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-  *BufferSize = Res;\r
-  Status = EFI_SUCCESS;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-\r
-  //\r
-  // bugbug: need to access unix error reporting\r
-  //\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemSetPosition (\r
-  IN EFI_FILE_PROTOCOL  *This,\r
-  IN UINT64             Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - The byte position from the start of the file to set.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been changed.\r
-\r
-  EFI_UNSUPPORTED - The seek request for non-zero is not supported for directories.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  UNIX_EFI_FILE_PRIVATE *PrivateFile;\r
-  UINT64                  Pos;\r
-  EFI_TPL                 OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
-  PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    if (Position != 0) {\r
-      Status = EFI_UNSUPPORTED;\r
-      goto Done;\r
-    }\r
-\r
-    if (PrivateFile->Dir == NULL) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-    PrivateFile->UnixThunk->RewindDir (PrivateFile->Dir);\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  } else {\r
-    if (Position == (UINT64) -1) {\r
-      Pos = PrivateFile->UnixThunk->Lseek (PrivateFile->fd, 0, SEEK_END);\r
-    } else {\r
-      Pos = PrivateFile->UnixThunk->Lseek (PrivateFile->fd, Position, SEEK_SET);\r
-    }\r
-    Status = (Pos == (UINT64) -1) ? EFI_DEVICE_ERROR : EFI_SUCCESS;\r
-  }\r
-\r
-Done:\r
-    gBS->RestoreTPL (OldTpl);\r
-    return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemGetPosition (\r
-  IN  EFI_FILE_PROTOCOL   *This,\r
-  OUT UINT64              *Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - Pointer to storage for the current position.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been reported.\r
-\r
-  EFI_UNSUPPORTED - Not valid for directories.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS            Status;\r
-  UNIX_EFI_FILE_PRIVATE *PrivateFile;\r
-  EFI_TPL               OldTpl;\r
-\r
-  if (This == NULL || Position == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
-  PrivateFile   = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    Status = EFI_UNSUPPORTED;\r
-  } else {\r
-    *Position = PrivateFile->UnixThunk->Lseek (PrivateFile->fd, 0, SEEK_CUR);\r
-    Status = (*Position == (UINT64) -1) ? EFI_DEVICE_ERROR : EFI_SUCCESS;\r
-  }\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemGetInfo (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN     EFI_GUID           *InformationType,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Return information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID describing the type of information to be returned.\r
-\r
-  BufferSize      - On input, the size of the information buffer.  On output, the number of bytes written to the\r
-                    information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The requested information has been written into the buffer.\r
-\r
-  EFI_UNSUPPORTED       - The InformationType is not known.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The buffer size was too small to contain the requested information.  The buffer size has\r
-                          been updated with the size needed to complete the requested operation.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  EFI_STATUS                        Status;\r
-  UNIX_EFI_FILE_PRIVATE           *PrivateFile;\r
-  EFI_FILE_SYSTEM_INFO              *FileSystemInfoBuffer;\r
-  INTN                              UnixStatus;\r
-  UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *PrivateRoot;\r
-  struct statfs                     buf;\r
-  EFI_TPL                           OldTpl;\r
-\r
-  if (This == NULL || InformationType == NULL || BufferSize == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-    \r
-  PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-  PrivateRoot = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
-\r
-  Status      = EFI_UNSUPPORTED;\r
-\r
-  if (CompareGuid (InformationType, &gEfiFileInfoGuid)) {\r
-    Status = UnixSimpleFileSystemFileInfo (PrivateFile, NULL, BufferSize, Buffer);\r
-  } else if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) {\r
-    if (*BufferSize < SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel)) {\r
-      *BufferSize = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel);\r
-      Status = EFI_BUFFER_TOO_SMALL;\r
-      goto Done;\r
-    }\r
-\r
-    UnixStatus = PrivateFile->UnixThunk->StatFs (PrivateFile->FileName, &buf);\r
-    if (UnixStatus < 0) {\r
-        Status = EFI_DEVICE_ERROR;\r
-        goto Done;\r
-    }\r
-\r
-    FileSystemInfoBuffer            = (EFI_FILE_SYSTEM_INFO *) Buffer;\r
-    FileSystemInfoBuffer->Size      = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel);\r
-    FileSystemInfoBuffer->ReadOnly  = FALSE;\r
-\r
-    //\r
-    // Succeeded\r
-    //\r
-    FileSystemInfoBuffer->VolumeSize  = MultU64x32 (buf.f_blocks, buf.f_bsize);\r
-    FileSystemInfoBuffer->FreeSpace   = MultU64x32 (buf.f_bavail, buf.f_bsize);\r
-    FileSystemInfoBuffer->BlockSize   = buf.f_bsize;\r
-\r
-\r
-    StrCpy ((CHAR16 *) FileSystemInfoBuffer->VolumeLabel, PrivateRoot->VolumeLabel);\r
-    *BufferSize = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel);\r
-    Status      = EFI_SUCCESS;\r
-  } else if (CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {\r
-    if (*BufferSize < StrSize (PrivateRoot->VolumeLabel)) {\r
-      *BufferSize = StrSize (PrivateRoot->VolumeLabel);\r
-      Status = EFI_BUFFER_TOO_SMALL;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy ((CHAR16 *) Buffer, PrivateRoot->VolumeLabel);\r
-    *BufferSize = StrSize (PrivateRoot->VolumeLabel);\r
-    Status      = EFI_SUCCESS;\r
-  }\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemSetInfo (\r
-  IN EFI_FILE_PROTOCOL*This,\r
-  IN EFI_GUID         *InformationType,\r
-  IN UINTN            BufferSize,\r
-  IN VOID             *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID identifying the type of information to set.\r
-\r
-  BufferSize      - Number of bytes of data in the information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of data in the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file or volume information has been updated.\r
-\r
-  EFI_UNSUPPORTED       - The information identifier is not recognised.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
-  EFI_BAD_BUFFER_SIZE   - The buffer size is smaller than the type indicated by InformationType.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  UNIX_SIMPLE_FILE_SYSTEM_PRIVATE *PrivateRoot;\r
-  UNIX_EFI_FILE_PRIVATE           *PrivateFile;\r
-  EFI_FILE_INFO                     *OldFileInfo;\r
-  EFI_FILE_INFO                     *NewFileInfo;\r
-  EFI_STATUS                        Status;\r
-  UINTN                             OldInfoSize;\r
-  EFI_TPL                           OldTpl;\r
-  mode_t                            NewAttr;\r
-  STAT_FIX                          OldAttr;\r
-  CHAR8                             *OldFileName;\r
-  CHAR8                             *NewFileName;\r
-  CHAR8                             *CharPointer;\r
-  BOOLEAN                           AttrChangeFlag;\r
-  BOOLEAN                           NameChangeFlag;\r
-  BOOLEAN                           SizeChangeFlag;\r
-  BOOLEAN                           TimeChangeFlag;\r
-  struct tm                         NewLastAccessSystemTime;\r
-  struct tm                         NewLastWriteSystemTime;\r
-  EFI_FILE_SYSTEM_INFO              *NewFileSystemInfo;\r
-  CHAR8                             *AsciiFilePtr;\r
-  CHAR16                            *UnicodeFilePtr;\r
-  INTN                              UnixStatus;\r
-\r
-  //\r
-  // Check for invalid parameters.\r
-  //\r
-  if (This == NULL || InformationType == NULL || BufferSize == 0 || Buffer == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
-  //\r
-  // Initialise locals.\r
-  //\r
-  PrivateFile               = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-  PrivateRoot               = UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
-\r
-  Status                    = EFI_UNSUPPORTED;\r
-  OldFileInfo               = NewFileInfo = NULL;\r
-  OldFileName               = NewFileName = NULL;\r
-  AttrChangeFlag = NameChangeFlag = SizeChangeFlag = TimeChangeFlag = FALSE;\r
-\r
-  //\r
-  // Set file system information.\r
-  //\r
-  if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) {\r
-    if (BufferSize < SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->VolumeLabel)) {\r
-      Status = EFI_BAD_BUFFER_SIZE;\r
-      goto Done;\r
-    }\r
-\r
-    NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer;\r
-\r
-    gBS->FreePool (PrivateRoot->VolumeLabel);\r
-\r
-    PrivateRoot->VolumeLabel = NULL;\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    StrSize (NewFileSystemInfo->VolumeLabel),\r
-                    (VOID **)&PrivateRoot->VolumeLabel\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (PrivateRoot->VolumeLabel, NewFileSystemInfo->VolumeLabel);\r
-\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Set volume label information.\r
-  //\r
-  if (CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {\r
-    if (BufferSize < StrSize (PrivateRoot->VolumeLabel)) {\r
-      Status = EFI_BAD_BUFFER_SIZE;\r
-      goto Done;\r
-    }\r
-\r
-    StrCpy (PrivateRoot->VolumeLabel, (CHAR16 *) Buffer);\r
-\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  if (!CompareGuid (InformationType, &gEfiFileInfoGuid)) {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto Done;\r
-  }\r
-\r
-  if (BufferSize < SIZE_OF_EFI_FILE_INFO) {\r
-    Status = EFI_BAD_BUFFER_SIZE;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Set file/directory information.\r
-  //\r
-\r
-  //\r
-  // Check for invalid set file information parameters.\r
-  //\r
-  NewFileInfo = (EFI_FILE_INFO *) Buffer;\r
-\r
-  if ((NewFileInfo->Size <= SIZE_OF_EFI_FILE_INFO) ||\r
-      (NewFileInfo->Attribute &~(EFI_FILE_VALID_ATTR)) ||\r
-      (sizeof (UINTN) == 4 && NewFileInfo->Size > 0xFFFFFFFF)\r
-      ) {\r
-    Status = EFI_INVALID_PARAMETER;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // bugbug: - This is not safe.  We need something like EfiStrMaxSize()\r
-  // that would have an additional parameter that would be the size\r
-  // of the string array just in case there are no NULL characters in\r
-  // the string array.\r
-  //\r
-  //\r
-  // Get current file information so we can determine what kind\r
-  // of change request this is.\r
-  //\r
-  OldInfoSize = 0;\r
-  Status      = UnixSimpleFileSystemFileInfo (PrivateFile, NULL, &OldInfoSize, NULL);\r
-\r
-  if (Status != EFI_BUFFER_TOO_SMALL) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  Status = gBS->AllocatePool (EfiBootServicesData, OldInfoSize,\r
-            (VOID **)&OldFileInfo);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  Status = UnixSimpleFileSystemFileInfo (PrivateFile, NULL, &OldInfoSize, OldFileInfo);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  AsciiStrSize (PrivateFile->FileName),\r
-                  (VOID **)&OldFileName\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  AsciiStrCpy (OldFileName, PrivateFile->FileName);\r
-\r
-  //\r
-  // Make full pathname from new filename and rootpath.\r
-  //\r
-  if (NewFileInfo->FileName[0] == '\\') {\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    AsciiStrLen (PrivateRoot->FilePath) + 1 + StrLen (NewFileInfo->FileName) + 1,\r
-                    (VOID **)&NewFileName\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    AsciiStrCpy (NewFileName, PrivateRoot->FilePath);\r
-    AsciiFilePtr = NewFileName + AsciiStrLen(NewFileName);\r
-    UnicodeFilePtr = NewFileInfo->FileName + 1;\r
-    *AsciiFilePtr++ ='/';\r
-  } else {\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    AsciiStrLen (PrivateFile->FileName) + 2 + StrLen (NewFileInfo->FileName) + 1,\r
-                    (VOID **)&NewFileName\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    AsciiStrCpy (NewFileName, PrivateRoot->FilePath);\r
-    AsciiFilePtr = NewFileName + AsciiStrLen(NewFileName);\r
-    if ((AsciiFilePtr[-1] != '/') && (NewFileInfo->FileName[0] != '/')) {\r
-      // make sure there is a / between Root FilePath and NewFileInfo Filename\r
-      AsciiFilePtr[0] = '/';      \r
-      AsciiFilePtr[1] = '\0';\r
-      AsciiFilePtr++;\r
-    }\r
-    UnicodeFilePtr = NewFileInfo->FileName;\r
-  }\r
-  // Convert to ascii.\r
-  while (*UnicodeFilePtr) {\r
-    *AsciiFilePtr++ = *UnicodeFilePtr++;\r
-  }\r
-  *AsciiFilePtr = 0;\r
-\r
-\r
-  //\r
-  // Is there an attribute change request?\r
-  //\r
-  if (NewFileInfo->Attribute != OldFileInfo->Attribute) {\r
-    if ((NewFileInfo->Attribute & EFI_FILE_DIRECTORY) != (OldFileInfo->Attribute & EFI_FILE_DIRECTORY)) {\r
-      Status = EFI_INVALID_PARAMETER;\r
-      goto Done;\r
-    }\r
-\r
-    AttrChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // Is there a name change request?\r
-  // bugbug: - Need EfiStrCaseCmp()\r
-  //\r
-  if (StrCmp (NewFileInfo->FileName, OldFileInfo->FileName)) {\r
-    NameChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // Is there a size change request?\r
-  //\r
-  if (NewFileInfo->FileSize != OldFileInfo->FileSize) {\r
-    SizeChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // Is there a time stamp change request?\r
-  //\r
-  if (!IsZero (&NewFileInfo->CreateTime, sizeof (EFI_TIME)) &&\r
-      CompareMem (&NewFileInfo->CreateTime, &OldFileInfo->CreateTime, sizeof (EFI_TIME))\r
-        ) {\r
-    TimeChangeFlag = TRUE;\r
-  } else if (!IsZero (&NewFileInfo->LastAccessTime, sizeof (EFI_TIME)) &&\r
-           CompareMem (&NewFileInfo->LastAccessTime, &OldFileInfo->LastAccessTime, sizeof (EFI_TIME))\r
-            ) {\r
-    TimeChangeFlag = TRUE;\r
-  } else if (!IsZero (&NewFileInfo->ModificationTime, sizeof (EFI_TIME)) &&\r
-           CompareMem (&NewFileInfo->ModificationTime, &OldFileInfo->ModificationTime, sizeof (EFI_TIME))\r
-            ) {\r
-    TimeChangeFlag = TRUE;\r
-  }\r
-\r
-  //\r
-  // All done if there are no change requests being made.\r
-  //\r
-  if (!(AttrChangeFlag || NameChangeFlag || SizeChangeFlag || TimeChangeFlag)) {\r
-    Status = EFI_SUCCESS;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Set file or directory information.\r
-  //\r
-  if (PrivateFile->UnixThunk->Stat (OldFileName, &OldAttr) != 0) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  //\r
-  // Name change.\r
-  //\r
-  if (NameChangeFlag) {\r
-    //\r
-    // Close the handles first\r
-    //\r
-    if (PrivateFile->IsOpenedByRead) {\r
-      Status = EFI_ACCESS_DENIED;\r
-      goto Done;\r
-    }\r
-\r
-    for (CharPointer = NewFileName; *CharPointer != 0 && *CharPointer != L'/'; CharPointer++) {\r
-    }\r
-\r
-    if (*CharPointer != 0) {\r
-      Status = EFI_ACCESS_DENIED;\r
-      goto Done;\r
-    }\r
-\r
-    UnixStatus = PrivateFile->UnixThunk->Rename (OldFileName, NewFileName);\r
-\r
-    if (UnixStatus == 0) {\r
-      //\r
-      // modify file name\r
-      //\r
-      gBS->FreePool (PrivateFile->FileName);\r
-\r
-      Status = gBS->AllocatePool (\r
-                      EfiBootServicesData,\r
-                      AsciiStrSize (NewFileName),\r
-                      (VOID **)&PrivateFile->FileName\r
-                      );\r
-\r
-      if (EFI_ERROR (Status)) {\r
-        goto Done;\r
-      }\r
-\r
-      AsciiStrCpy (PrivateFile->FileName, NewFileName);\r
-    } else {\r
-      Status    = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-  }\r
-\r
-  //\r
-  //  Size change\r
-  //\r
-  if (SizeChangeFlag) {\r
-    if (PrivateFile->IsDirectoryPath) {\r
-      Status = EFI_UNSUPPORTED;\r
-      goto Done;\r
-    }\r
-\r
-    if (PrivateFile->IsOpenedByRead || OldFileInfo->Attribute & EFI_FILE_READ_ONLY) {\r
-      Status = EFI_ACCESS_DENIED;\r
-      goto Done;\r
-    }\r
-\r
-    if (PrivateFile->UnixThunk->FTruncate (PrivateFile->fd, NewFileInfo->FileSize) != 0) {\r
-      Status = EFI_DEVICE_ERROR;\r
-      goto Done;\r
-    }\r
-\r
-  }\r
-\r
-  //\r
-  // Time change\r
-  //\r
-  if (TimeChangeFlag) {\r
-    struct utimbuf utime;\r
-\r
-    NewLastAccessSystemTime.tm_year    = NewFileInfo->LastAccessTime.Year;\r
-    NewLastAccessSystemTime.tm_mon     = NewFileInfo->LastAccessTime.Month;\r
-    NewLastAccessSystemTime.tm_mday    = NewFileInfo->LastAccessTime.Day;\r
-    NewLastAccessSystemTime.tm_hour    = NewFileInfo->LastAccessTime.Hour;\r
-    NewLastAccessSystemTime.tm_min     = NewFileInfo->LastAccessTime.Minute;\r
-    NewLastAccessSystemTime.tm_sec     = NewFileInfo->LastAccessTime.Second;\r
-    NewLastAccessSystemTime.tm_isdst   = 0;\r
-\r
-    utime.actime = PrivateFile->UnixThunk->MkTime (&NewLastAccessSystemTime);\r
-\r
-    NewLastWriteSystemTime.tm_year    = NewFileInfo->ModificationTime.Year;\r
-    NewLastWriteSystemTime.tm_mon     = NewFileInfo->ModificationTime.Month;\r
-    NewLastWriteSystemTime.tm_mday    = NewFileInfo->ModificationTime.Day;\r
-    NewLastWriteSystemTime.tm_hour    = NewFileInfo->ModificationTime.Hour;\r
-    NewLastWriteSystemTime.tm_min     = NewFileInfo->ModificationTime.Minute;\r
-    NewLastWriteSystemTime.tm_sec     = NewFileInfo->ModificationTime.Second;\r
-    NewLastWriteSystemTime.tm_isdst   = 0;\r
-\r
-    utime.modtime = PrivateFile->UnixThunk->MkTime (&NewLastWriteSystemTime);\r
-\r
-    if (utime.actime == (time_t)-1 || utime.modtime == (time_t)-1) {\r
-      goto Done;\r
-    }\r
-\r
-    if (PrivateFile->UnixThunk->UTime (PrivateFile->FileName, &utime) == -1) {\r
-      goto Done;\r
-    }\r
-  }\r
-\r
-  //\r
-  // No matter about AttrChangeFlag, Attribute must be set.\r
-  // Because operation before may cause attribute change.\r
-  //\r
-  NewAttr = OldAttr.st_mode;\r
-\r
-  if (NewFileInfo->Attribute & EFI_FILE_READ_ONLY) {\r
-    NewAttr &= ~(S_IRUSR | S_IRGRP | S_IROTH);\r
-  } else {\r
-    NewAttr |= S_IRUSR;\r
-  }\r
-\r
-  UnixStatus = PrivateFile->UnixThunk->Chmod (NewFileName, NewAttr);\r
-  if (UnixStatus != 0) {\r
-    Status    = EFI_DEVICE_ERROR;\r
-  }\r
-\r
-Done:\r
-  if (OldFileInfo != NULL) {\r
-    gBS->FreePool (OldFileInfo);\r
-  }\r
-\r
-  if (OldFileName != NULL) {\r
-    gBS->FreePool (OldFileName);\r
-  }\r
-\r
-  if (NewFileName != NULL) {\r
-    gBS->FreePool (NewFileName);\r
-  }\r
-\r
-  gBS->RestoreTPL (OldTpl);\r
-  \r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemFlush (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Flush all modified data to the media.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to an opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data has been flushed.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures have been corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-// TODO:    EFI_INVALID_PARAMETER - add return value to function comment\r
-{\r
-  UNIX_EFI_FILE_PRIVATE     *PrivateFile;\r
-  EFI_STATUS                Status;\r
-  EFI_TPL                   OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = EFI_SUCCESS;\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-  \r
-  PrivateFile = UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
-\r
-\r
-  if (PrivateFile->IsDirectoryPath) {\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->IsOpenedByRead) {\r
-    Status = EFI_ACCESS_DENIED;\r
-    goto Done;\r
-  }\r
-\r
-  if (PrivateFile->fd < 0) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
-  }\r
-\r
-  PrivateFile->UnixThunk->FSync (PrivateFile->fd) == 0 ? EFI_SUCCESS : EFI_DEVICE_ERROR;\r
-\r
-Done:\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-\r
-  //\r
-  // bugbug: - Use Unix error reporting.\r
-  //\r
-}\r
-\r
-\r
diff --git a/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h b/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.h
deleted file mode 100644 (file)
index e4d4d30..0000000
+++ /dev/null
@@ -1,599 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixSimpleFileSystem.h\r
-\r
-Abstract:\r
-\r
-  Produce Simple File System abstractions for a directory on your PC using Unix APIs.\r
-  The configuration of what devices to mount or emulate comes from  \r
-  environment variables.\r
-\r
---*/\r
-\r
-#ifndef _UNIX_SIMPLE_FILE_SYSTEM_H_\r
-#define _UNIX_SIMPLE_FILE_SYSTEM_H_\r
-\r
-#include "PiDxe.h"\r
-#include <Guid/FileSystemInfo.h>\r
-#include <Guid/FileInfo.h>\r
-#include <Guid/FileSystemVolumeLabelInfo.h>\r
-#include <Protocol/SimpleFileSystem.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include "UnixDxe.h"\r
-\r
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixSimpleFileSystemDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixSimpleFileSystemComponentName;\r
-\r
-\r
-#define UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE SIGNATURE_32 ('L', 'X', 'f', 's')\r
-\r
-typedef struct {\r
-  UINTN                           Signature;\r
-  EFI_UNIX_THUNK_PROTOCOL        *UnixThunk;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFileSystem;\r
-  CHAR8                           *FilePath;\r
-  CHAR16                          *VolumeLabel;\r
-  EFI_UNICODE_STRING_TABLE        *ControllerNameTable;\r
-} UNIX_SIMPLE_FILE_SYSTEM_PRIVATE;\r
-\r
-#define UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS(a) \\r
-  CR (a, \\r
-      UNIX_SIMPLE_FILE_SYSTEM_PRIVATE, \\r
-      SimpleFileSystem, \\r
-      UNIX_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE \\r
-      )\r
-\r
-#define UNIX_EFI_FILE_PRIVATE_SIGNATURE SIGNATURE_32 ('l', 'o', 'f', 's')\r
-\r
-typedef struct {\r
-  UINTN                           Signature;\r
-  EFI_UNIX_THUNK_PROTOCOL        *UnixThunk;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;\r
-  EFI_FILE_PROTOCOL               EfiFile;\r
-  INTN                            fd;\r
-  DIR                             *Dir;\r
-  BOOLEAN                         IsRootDirectory;\r
-  BOOLEAN                         IsDirectoryPath;\r
-  BOOLEAN                         IsOpenedByRead;\r
-  char                            *FileName;\r
-  struct dirent                   *Dirent;\r
-} UNIX_EFI_FILE_PRIVATE;\r
-\r
-#define UNIX_EFI_FILE_PRIVATE_DATA_FROM_THIS(a) \\r
-  CR (a, \\r
-      UNIX_EFI_FILE_PRIVATE, \\r
-      EfiFile, \\r
-      UNIX_EFI_FILE_PRIVATE_SIGNATURE \\r
-      )\r
-\r
-//\r
-// Global Protocol Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gUnixSimpleFileSystemDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gUnixSimpleFileSystemComponentName;\r
-\r
-//\r
-// Driver Binding protocol member functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath  OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Check to see if the driver supports a given controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to test.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS         - The device specified by ControllerHandle and RemainingDevicePath is supported by the driver\r
-                        specified by This.\r
-\r
-  EFI_ALREADY_STARTED - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        the driver specified by This.\r
-\r
-  EFI_ACCESS_DENIED   - The device specified by ControllerHandle and RemainingDevicePath is already being managed by\r
-                        a different driver or an application that requires exclusive access.\r
-\r
-  EFI_UNSUPPORTED     - The device specified by ControllerHandle and RemainingDevicePath is not supported by the\r
-                        driver specified by This.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    ControllerHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath  OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Starts a device controller or a bus controller.\r
-\r
-Arguments:\r
-\r
-  This                - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle    - EFI handle of the controller to start.\r
-\r
-  RemainingDevicePath - Pointer to remaining portion of a device path.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The device or bus controller has been started.\r
-\r
-  EFI_DEVICE_ERROR      - The device could not be started due to a device failure.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The request could not be completed due to lack of resources.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer  OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  This              - A pointer to an instance of the EFI_DRIVER_BINDING_PROTOCOL.\r
-\r
-  ControllerHandle  - A handle to the device to be stopped.\r
-\r
-  NumberOfChildren  - The number of child device handles in ChildHandleBuffer.\r
-\r
-  ChildHandleBuffer - An array of child device handles to be freed.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS       - The device has been stopped.\r
-\r
-  EFI_DEVICE_ERROR  - The device could not be stopped due to a device failure.\r
-\r
---*/\r
-;\r
-\r
-//\r
-// Simple File System protocol member functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemOpenVolume (\r
-  IN  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,\r
-  OUT EFI_FILE_PROTOCOL               **Root\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open the root directory on a volume.\r
-\r
-Arguments:\r
-\r
-  This  - A pointer to the volume to open.\r
-\r
-  Root  - A pointer to storage for the returned opened file handle of the root directory.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The volume was opened.\r
-\r
-  EFI_UNSUPPORTED       - The volume does not support the requested file system type.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - The file volume could not be opened due to lack of resources.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemOpen (\r
-  IN  EFI_FILE_PROTOCOL   *This,\r
-  OUT EFI_FILE_PROTOCOL   **NewHandle,\r
-  IN  CHAR16              *FileName,\r
-  IN  UINT64              OpenMode,\r
-  IN  UINT64              Attributes\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Open a file relative to the source file location.\r
-\r
-Arguments:\r
-\r
-  This        - A pointer to the source file location.\r
-\r
-  NewHandle   - Pointer to storage for the new file handle.\r
-\r
-  FileName    - Pointer to the file name to be opened.\r
-\r
-  OpenMode    - File open mode information.\r
-\r
-  Attributes  - File creation attributes.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file was opened.\r
-\r
-  EFI_NOT_FOUND         - The file could not be found in the volume.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_MEDIA_CHANGED     - The device has new media or the media is no longer supported.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The volume or file is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The service denied access to the file.\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources were available to open the file.\r
-\r
-  EFI_VOLUME_FULL       - There is not enough space left to create the new file.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemClose (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close the specified file handle.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The file handle has been closed.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemDelete (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Close and delete a file.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to a returned opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS             - The file handle was closed and deleted.\r
-\r
-  EFI_WARN_DELETE_FAILURE - The handle was closed but could not be deleted.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemRead (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Read data from a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to a returned open file handle.\r
-\r
-  BufferSize  - On input, the size of the Buffer.  On output, the number of bytes stored in the Buffer.\r
-\r
-  Buffer      - Pointer to the first byte of the read Buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was read.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupted.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The supplied buffer size was too small to store the current directory entry.\r
-                          *BufferSize has been updated with the size needed to complete the request.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemWrite (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN OUT UINTN              *BufferSize,\r
-  IN     VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Write data to a file.\r
-\r
-Arguments:\r
-\r
-  This        - Pointer to an opened file handle.\r
-\r
-  BufferSize  - On input, the number of bytes in the Buffer to write to the file.  On output, the number of bytes\r
-                of data written to the file.\r
-\r
-  Buffer      - Pointer to the first by of data in the buffer to write to the file.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data was written to the file.\r
-\r
-  EFI_UNSUPPORTED       - Writes to an open directory are not supported.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemSetPosition (\r
-  IN EFI_FILE_PROTOCOL  *This,\r
-  IN UINT64             Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - The byte position from the start of the file to set.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been changed.\r
-\r
-  EFI_UNSUPPORTED - The seek request for non-zero is not supported for directories.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemGetPosition (\r
-  IN  EFI_FILE_PROTOCOL   *This,\r
-  OUT UINT64              *Position\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get a file's current position.\r
-\r
-Arguments:\r
-\r
-  This      - Pointer to an opened file handle.\r
-\r
-  Position  - Pointer to storage for the current position.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS     - The file position has been reported.\r
-\r
-  EFI_UNSUPPORTED - Not valid for directories.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemGetInfo (\r
-  IN     EFI_FILE_PROTOCOL  *This,\r
-  IN     EFI_GUID           *InformationType,\r
-  IN OUT UINTN              *BufferSize,\r
-  OUT    VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Return information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID describing the type of information to be returned.\r
-\r
-  BufferSize      - On input, the size of the information buffer.  On output, the number of bytes written to the\r
-                    information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The requested information has been written into the buffer.\r
-\r
-  EFI_UNSUPPORTED       - The InformationType is not known.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_BUFFER_TOO_SMALL  - The buffer size was too small to contain the requested information.  The buffer size has\r
-                          been updated with the size needed to complete the requested operation.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemSetInfo (\r
-  IN EFI_FILE_PROTOCOL  *This,\r
-  IN EFI_GUID           *InformationType,\r
-  IN UINTN              BufferSize,\r
-  IN VOID               *Buffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Set information about a file or volume.\r
-\r
-Arguments:\r
-\r
-  This            - Pointer to an opened file handle.\r
-\r
-  InformationType - GUID identifying the type of information to set.\r
-\r
-  BufferSize      - Number of bytes of data in the information buffer.\r
-\r
-  Buffer          - Pointer to the first byte of data in the information buffer.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The file or volume information has been updated.\r
-\r
-  EFI_UNSUPPORTED       - The information identifier is not recognised.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures are corrupt.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
-  EFI_BAD_BUFFER_SIZE   - The buffer size is smaller than the type indicated by InformationType.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSimpleFileSystemFlush (\r
-  IN EFI_FILE_PROTOCOL  *This\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Flush all modified data to the media.\r
-\r
-Arguments:\r
-\r
-  This  - Pointer to an opened file handle.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The data has been flushed.\r
-\r
-  EFI_NO_MEDIA          - The device has no media.\r
-\r
-  EFI_DEVICE_ERROR      - The device reported an error.\r
-\r
-  EFI_VOLUME_CORRUPTED  - The file system structures have been corrupted.\r
-\r
-  EFI_WRITE_PROTECTED   - The file, directory, volume, or device is write protected.\r
-\r
-  EFI_ACCESS_DENIED     - The file was opened read-only.\r
-\r
-  EFI_VOLUME_FULL       - The volume is full.\r
-\r
---*/\r
-;\r
-\r
-#endif /* _UNIX_SIMPLE_FILE_SYSTEM_H_ */\r
-\r
-/* eof - UnixSimpleFileSystem.h */\r
diff --git a/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.inf b/UnixPkg/UnixSimpleFileSystemDxe/UnixSimpleFileSystem.inf
deleted file mode 100644 (file)
index 44d0362..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-## @file\r
-# Simple filesystem driver\r
-#\r
-# Produce Simple File System abstractions for directories on your PC using Unix APIs.\r
-#  The configuration of what devices to mount or emulate comes from\r
-#  environment variables.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixSimpleFileSystem\r
-  FILE_GUID                      = f330834e-8985-11db-a295-0040d02b1835\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixSimpleFileSystem\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-#  DRIVER_BINDING                =  gUnixSimpleFileSystemDriverBinding           \r
-#  COMPONENT_NAME                =  gUnixSimpleFileSystemComponentName           \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  UnixSimpleFileSystem.c\r
-  UnixSimpleFileSystem.h\r
-  EntryPoint.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiFileSystemVolumeLabelInfoIdGuid           # SOMETIMES_CONSUMED\r
-  gEfiFileInfoGuid                              # SOMETIMES_CONSUMED\r
-  gEfiFileSystemInfoGuid                        # SOMETIMES_CONSUMED\r
-  gEfiUnixFileSystemGuid                       # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gEfiSimpleFileSystemProtocolGuid              # PROTOCOL BY_START\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL TO_START\r
-\r
diff --git a/UnixPkg/UnixSnpDxe/ComponentName.c b/UnixPkg/UnixSnpDxe/ComponentName.c
deleted file mode 100644 (file)
index ce2880b..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/** @file\r
-\r
- Copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-\r
-    This program and the accompanying materials\r
-    are licensed and made available under the terms and conditions of the BSD License\r
-    which accompanies this distribution. The full text of the license may be found at\r
-    http://opensource.org/licenses/bsd-license.php\r
-\r
-    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
--**/\r
-\r
-#include "UnixSnp.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gUnixSnpDriverComponentName = {\r
-  UnixSnpDriverComponentNameGetDriverName,\r
-  UnixSnpDriverComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUnixSnpDriverComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) UnixSnpDriverComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) UnixSnpDriverComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUnixSnpDriverNameTable[] = {\r
-  {\r
-    "eng;en",\r
-    L"Unix SNP Driver"\r
-  },\r
-  {\r
-    NULL,\r
-    NULL\r
-  }\r
-};\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-{\r
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mUnixSnpDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gUnixSnpDriverComponentName)\r
-           );\r
-}\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 4646 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
diff --git a/UnixPkg/UnixSnpDxe/UnixSnp.c b/UnixPkg/UnixSnpDxe/UnixSnp.c
deleted file mode 100644 (file)
index b910041..0000000
+++ /dev/null
@@ -1,1791 +0,0 @@
-/** @file\r
-\r
- Copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-\r
-    This program and the accompanying materials\r
-    are licensed and made available under the terms and conditions of the BSD License\r
-    which accompanies this distribution. The full text of the license may be found at\r
-    http://opensource.org/licenses/bsd-license.php\r
-\r
-    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  UnixSnp.c\r
-\r
-Abstract:\r
-\r
--**/\r
-\r
-#include <Library/PrintLib.h>\r
-\r
-#include "UnixSnp.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gUnixSnpDriverBinding =\r
-{\r
-  UnixSnpDriverBindingSupported,\r
-  UnixSnpDriverBindingStart,\r
-  UnixSnpDriverBindingStop,\r
-  0xA,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-/**\r
-  Changes the state of a network interface from "stopped" to "started".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStart(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This\r
-  );\r
-  \r
-/**\r
-  Changes the state of a network interface from "started" to "stopped".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStop(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This\r
-  );\r
-  \r
-/**\r
-  Resets a network adapter and allocates the transmit and receive buffers \r
-  required by the network interface; optionally, also requests allocation \r
-  of additional transmit and receive buffers.\r
-\r
-  @param  This              Protocol instance pointer.\r
-  @param  ExtraRxBufferSize The size, in bytes, of the extra receive buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-  @param  ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpInitialize(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN UINTN              ExtraRxBufferSize OPTIONAL,\r
-  IN UINTN              ExtraTxBufferSize OPTIONAL\r
-  );\r
-  \r
-/**\r
-  Resets a network adapter and re-initializes it with the parameters that were \r
-  provided in the previous call to Initialize().  \r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ExtendedVerification Indicates that the driver may perform a more\r
-                               exhaustive verification operation of the device\r
-                               during reset.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpReset(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              ExtendedVerification\r
-  );\r
-\r
-/**\r
-  Resets a network adapter and leaves it in a state that is safe for \r
-  another driver to initialize.\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpShutdown(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This\r
-  );\r
-\r
-/**\r
-  Manages the multicast receive filters of a network interface.\r
-\r
-  @param  This               Protocol instance pointer.\r
-  @param  EnableBits         A bit mask of receive filters to enable on the network interface.\r
-  @param  DisableBits        A bit mask of receive filters to disable on the network interface.\r
-  @param  ResetMcastFilter   Set to TRUE to reset the contents of the multicast receive\r
-                             filters on the network interface to their default values.\r
-  @param  McastFilterCount   Number of multicast HW MAC addresses in the new\r
-                             MCastFilter list. This value must be less than or equal to\r
-                             the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This\r
-                             field is optional if ResetMCastFilter is TRUE.\r
-  @param  McastFilter        A pointer to a list of new multicast receive filter HW MAC\r
-                             addresses. This list will replace any existing multicast\r
-                             HW MAC address list. This field is optional if\r
-                             ResetMCastFilter is TRUE.\r
-\r
-  @retval EFI_SUCCESS           The multicast receive filter list was updated.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpReceiveFilters(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN UINT32              EnableBits,\r
-  IN UINT32              DisableBits,\r
-  IN BOOLEAN              ResetMcastFilter,\r
-  IN UINTN              McastFilterCount OPTIONAL,\r
-  IN EFI_MAC_ADDRESS*          McastFilter OPTIONAL\r
-  );\r
-\r
-/**\r
-  Modifies or resets the current station address, if supported.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  Reset        Flag used to reset the station address to the network interfaces\r
-                       permanent address.\r
-  @param  NewMacAddr   New station address to be used for the network interface.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStationAddress(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              Reset,\r
-  IN EFI_MAC_ADDRESS*          NewMacAddr OPTIONAL\r
-  );\r
-\r
-/**\r
-  Resets or collects the statistics on a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  Reset           Set to TRUE to reset the statistics for the network interface.\r
-  @param  StatisticsSize  On input the size, in bytes, of StatisticsTable. On\r
-                          output the size, in bytes, of the resulting table of\r
-                          statistics.\r
-  @param  StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
-                          contains the statistics.\r
-\r
-  @retval EFI_SUCCESS           The statistics were collected from the network interface.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStatistics(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              Reset,\r
-  IN OUT UINTN*            StatisticsSize OPTIONAL,\r
-  OUT EFI_NETWORK_STATISTICS*      StatisticsTable OPTIONAL\r
-  );\r
-  \r
-/**\r
-  Converts a multicast IP address to a multicast HW MAC address.\r
-  \r
-  @param  This  Protocol instance pointer.\r
-  @param  Ipv6  Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set\r
-                to FALSE if the multicast IP address is IPv4 [RFC 791].\r
-  @param  Ip    The multicast IP address that is to be converted to a multicast\r
-                HW MAC address.\r
-  @param  Mac   The multicast HW MAC address that is to be generated from IP.\r
-\r
-  @retval EFI_SUCCESS           The multicast IP address was mapped to the multicast\r
-                                HW MAC address.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpMcastIptoMac(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              Ipv6,\r
-  IN EFI_IP_ADDRESS*          Ip,\r
-  OUT EFI_MAC_ADDRESS*        Mac\r
-  );\r
-\r
-/**\r
-  Performs read and write operations on the NVRAM device attached to a \r
-  network interface.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  ReadOrWrite  TRUE for read operations, FALSE for write operations.\r
-  @param  Offset       Byte offset in the NVRAM device at which to start the read or\r
-                       write operation. This must be a multiple of NvRamAccessSize and\r
-                       less than NvRamSize.\r
-  @param  BufferSize   The number of bytes to read or write from the NVRAM device.\r
-                       This must also be a multiple of NvramAccessSize.\r
-  @param  Buffer       A pointer to the data buffer.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpNvdata(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              ReadOrWrite,\r
-  IN UINTN              Offset,\r
-  IN UINTN              BufferSize,\r
-  IN OUT VOID*            Buffer\r
-  );\r
-\r
-/**\r
-  Reads the current interrupt status and recycled transmit buffer status from \r
-  a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  InterruptStatus A pointer to the bit mask of the currently active interrupts\r
-                          If this is NULL, the interrupt status will not be read from\r
-                          the device. If this is not NULL, the interrupt status will\r
-                          be read from the device. When the  interrupt status is read,\r
-                          it will also be cleared. Clearing the transmit  interrupt\r
-                          does not empty the recycled transmit buffer array.\r
-  @param  TxBuffer        Recycled transmit buffer address. The network interface will\r
-                          not transmit if its internal recycled transmit buffer array\r
-                          is full. Reading the transmit buffer does not clear the\r
-                          transmit interrupt. If this is NULL, then the transmit buffer\r
-                          status will not be read. If there are no transmit buffers to\r
-                          recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpGetStatus(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  OUT UINT32*              InterruptStatus,\r
-  OUT VOID**              TxBuffer\r
-  );\r
-\r
-/**\r
-  Places a packet in the transmit queue of a network interface.\r
-\r
-  @param  This       Protocol instance pointer.\r
-  @param  HeaderSize The size, in bytes, of the media header to be filled in by\r
-                     the Transmit() function. If HeaderSize is non-zero, then it\r
-                     must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
-                     and Protocol parameters must not be NULL.\r
-  @param  BufferSize The size, in bytes, of the entire packet (media header and\r
-                     data) to be transmitted through the network interface.\r
-  @param  Buffer     A pointer to the packet (media header followed by data) to be\r
-                     transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
-                     then the media header in Buffer must already be filled in by the\r
-                     caller. If HeaderSize is non-zero, then the media header will be\r
-                     filled in by the Transmit() function.\r
-  @param  SrcAddr    The source HW MAC address. If HeaderSize is zero, then this parameter\r
-                     is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
-                     This->Mode->CurrentAddress is used for the source HW MAC address.\r
-  @param  DestAddr   The destination HW MAC address. If HeaderSize is zero, then this\r
-                     parameter is ignored.\r
-  @param  Protocol   The type of header to build. If HeaderSize is zero, then this\r
-                     parameter is ignored. See RFC 1700, section "Ether Types", for\r
-                     examples.\r
-\r
-  @retval EFI_SUCCESS           The packet was placed on the transmit queue.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-  @retval EFI_ACCESS_DENIED     Error acquire global lock for operation.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpTransmit(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN UINTN              HeaderSize,\r
-  IN UINTN              BufferSize,\r
-  IN VOID*              Buffer,\r
-  IN EFI_MAC_ADDRESS*          SrcAddr OPTIONAL,\r
-  IN EFI_MAC_ADDRESS*          DestAddr OPTIONAL,\r
-  IN UINT16*              Protocol OPTIONAL\r
-  );\r
-\r
-/**\r
-  Receives a packet from a network interface.\r
-\r
-  @param  This             Protocol instance pointer.\r
-  @param  HeaderSize       The size, in bytes, of the media header received on the network\r
-                           interface. If this parameter is NULL, then the media header size\r
-                           will not be returned.\r
-  @param  BuffSize         On entry, the size, in bytes, of Buffer. On exit, the size, in\r
-                           bytes, of the packet that was received on the network interface.\r
-  @param  Buffer           A pointer to the data buffer to receive both the media header and\r
-                           the data.\r
-  @param  SourceAddr       The source HW MAC address. If this parameter is NULL, the\r
-                           HW MAC source address will not be extracted from the media\r
-                           header.\r
-  @param  DestinationAddr  The destination HW MAC address. If this parameter is NULL,\r
-                           the HW MAC destination address will not be extracted from the\r
-                           media header.\r
-  @param  Protocol         The media header type. If this parameter is NULL, then the\r
-                           protocol will not be extracted from the media header. See\r
-                           RFC 1700 section "Ether Types" for examples.\r
-\r
-  @retval  EFI_SUCCESS           The received data was stored in Buffer, and BufferSize has\r
-                                 been updated to the number of bytes received.\r
-  @retval  EFI_NOT_READY         The network interface is too busy to accept this transmit\r
-                                 request.\r
-  @retval  EFI_BUFFER_TOO_SMALL  The BufferSize parameter is too small.\r
-  @retval  EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-  @retval  EFI_ACCESS_DENIED     Error acquire global lock for operation.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpReceive(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  OUT UINTN*              HeaderSize OPTIONAL,\r
-  IN OUT UINTN*            BuffSize,\r
-  OUT VOID*              Buffer,\r
-  OUT EFI_MAC_ADDRESS*        SourceAddr OPTIONAL,\r
-  OUT EFI_MAC_ADDRESS*        DestinationAddr OPTIONAL,\r
-  OUT UINT16*              Protocol OPTIONAL\r
-  );\r
-\r
-VOID\r
-EFIAPI\r
-UnixSnpWaitForPacketNotify(\r
-  IN EFI_EVENT            Event,\r
-  IN VOID*              Private\r
-  );\r
-\r
-//\r
-// Strange, but there doesn't appear to be any structure for the Ethernet header in edk2...\r
-//\r
-\r
-typedef struct\r
-{\r
-  UINT8                DstAddr[ NET_ETHER_ADDR_LEN ];\r
-  UINT8                SrcAddr[ NET_ETHER_ADDR_LEN ];\r
-  UINT16                Type;\r
-} EthernetHeader;\r
-\r
-UNIX_SNP_PRIVATE_DATA gUnixSnpPrivateTemplate =\r
-{\r
-  UNIX_SNP_PRIVATE_DATA_SIGNATURE,      // Signature\r
-  NULL,                    // UnixThunk\r
-  NULL,                    // DeviceHandle\r
-  NULL,                    // DevicePath\r
-  { 0 },                    // MacAddress\r
-  NULL,                    // InterfaceName\r
-  0,                      // ReadBufferSize\r
-  NULL,                    // ReadBuffer\r
-  NULL,                    // CurrentReadPointer\r
-  NULL,                    // EndReadPointer\r
-  0,                      // BpfFd\r
-  {                    // Snp\r
-    EFI_SIMPLE_NETWORK_PROTOCOL_REVISION,  // Revision\r
-    UnixSnpStart,              // Start\r
-    UnixSnpStop,              // Stop\r
-    UnixSnpInitialize,            // Initialize\r
-    UnixSnpReset,              // Reset\r
-    UnixSnpShutdown,            // Shutdown\r
-    UnixSnpReceiveFilters,          // ReceiveFilters\r
-    UnixSnpStationAddress,          // StationAddress\r
-    UnixSnpStatistics,            // Statistics\r
-    UnixSnpMcastIptoMac,          // MCastIpToMac\r
-    UnixSnpNvdata,              // NvData\r
-    UnixSnpGetStatus,            // GetStatus\r
-    UnixSnpTransmit,            // Transmit\r
-    UnixSnpReceive,              // Receive\r
-    NULL,                  // WaitForPacket\r
-    NULL                  // Mode\r
-  },\r
-  {                    // Mode\r
-    EfiSimpleNetworkStopped,        //  State\r
-    NET_ETHER_ADDR_LEN,            //  HwAddressSize\r
-    NET_ETHER_HEADER_SIZE,          //  MediaHeaderSize\r
-    1500,                  //  MaxPacketSize\r
-    0,                    //  NvRamSize\r
-    0,                    //  NvRamAccessSize\r
-    0,                    //  ReceiveFilterMask\r
-    0,                    //  ReceiveFilterSetting\r
-    MAX_MCAST_FILTER_CNT,          //  MaxMCastFilterCount\r
-    0,                    //  MCastFilterCount\r
-    {\r
-      0\r
-    },                    //  MCastFilter\r
-    {\r
-      0\r
-    },                    //  CurrentAddress\r
-    {\r
-      0\r
-    },                    //  BroadcastAddress\r
-    {\r
-      0\r
-    },                    //  PermanentAddress\r
-    NET_IFTYPE_ETHERNET,          //  IfType\r
-    FALSE,                  //  MacAddressChangeable\r
-    FALSE,                  //  MultipleTxSupported\r
-    FALSE,                  //  MediaPresentSupported\r
-    TRUE                  //  MediaPresent\r
-  }\r
-};\r
-\r
-STATIC EFI_STATUS\r
-GetInterfaceMacAddr(\r
-  IN UNIX_SNP_PRIVATE_DATA*      Private,\r
-  IN EFI_UNIX_IO_PROTOCOL*      UnixIo\r
-  )\r
-{\r
-  struct ifaddrs*            IfAddrs;\r
-  struct ifaddrs*            If;\r
-  struct sockaddr_dl*          IfSdl;\r
-  EFI_STATUS              Status;\r
-  INTN                Result;\r
-\r
-  Result = UnixIo->UnixThunk->GetIfAddrs( &IfAddrs );\r
-  if ( Result != 0 )\r
-  {\r
-    return( EFI_UNSUPPORTED );\r
-  }\r
-\r
-  //\r
-  // Convert the interface name to ASCII so we can find it.\r
-  //\r
-  Private->InterfaceName = AllocateZeroPool( StrLen( UnixIo->EnvString ) );\r
-\r
-  if ( !Private->InterfaceName )\r
-  {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto Exit;\r
-  }\r
-\r
-  UnicodeStrToAsciiStr( UnixIo->EnvString, Private->InterfaceName );\r
-\r
-  If = IfAddrs;\r
-\r
-  while ( If != NULL )\r
-  {\r
-    IfSdl = ( struct sockaddr_dl * ) If->ifa_addr;\r
-\r
-    if ( IfSdl->sdl_family == AF_LINK )\r
-    {\r
-      if ( !AsciiStrCmp( Private->InterfaceName, If->ifa_name ) )\r
-      {\r
-        CopyMem( &Private->MacAddress, LLADDR( IfSdl ), NET_ETHER_ADDR_LEN );\r
-\r
-        Status = EFI_SUCCESS;\r
-        break;\r
-      }\r
-    }\r
-\r
-    If = If->ifa_next;\r
-  }\r
-\r
-Exit:\r
-  ( VOID ) UnixIo->UnixThunk->FreeIfAddrs( IfAddrs );\r
-\r
-  return( Status );\r
-}\r
-\r
-\r
-STATIC EFI_STATUS\r
-OpenBpfFileDescriptor(\r
-  IN UNIX_SNP_PRIVATE_DATA*    Private,\r
-  OUT INTN*            Fd\r
-  )\r
-{\r
-  CHAR8              BfpDeviceName[ 256 ];\r
-  INTN              Index;\r
-  EFI_STATUS            Status = EFI_OUT_OF_RESOURCES;\r
-  INTN              Result;\r
-\r
-  //\r
-  // Open a Berkeley Packet Filter device.  This must be done as root, so this is probably\r
-  // the place which is most likely to fail...\r
-  //\r
-  for ( Index = 0; TRUE; Index++ )\r
-  {\r
-    AsciiSPrint( BfpDeviceName, sizeof( BfpDeviceName ), "/dev/bpf%d", Index );\r
-\r
-    *Fd = Private->UnixThunk->Open( BfpDeviceName, O_RDWR, 0 );\r
-\r
-    if ( *Fd >= 0 )\r
-    {\r
-      Status = EFI_SUCCESS;\r
-      break;\r
-    }\r
-\r
-    Result = Private->UnixThunk->GetErrno();\r
-    if ( Result == EACCES )\r
-    {\r
-      DEBUG( ( EFI_D_ERROR, "Permissions on '%a' are incorrect.  Fix with 'sudo chmod 666 %a'.\n",\r
-          BfpDeviceName, BfpDeviceName ) );\r
-    }\r
-    if ( Result != EBUSY )\r
-    {\r
-      break;\r
-    }\r
-  }\r
-\r
-  return( Status );\r
-}\r
-\r
-\r
-/**\r
-  Test to see if this driver supports ControllerHandle. This service\r
-  is called by the EFI boot service ConnectController(). In\r
-  order to make drivers as small as possible, there are a few calling\r
-  restrictions for this service. ConnectController() must\r
-  follow these calling restrictions. If any other agent wishes to call\r
-  Supported() it must also follow these calling restrictions.\r
-\r
-  @param  This                Protocol instance pointer.\r
-  @param  ControllerHandle    Handle of device to test\r
-  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
-                              device to start.\r
-\r
-  @retval EFI_SUCCESS         This driver supports this device\r
-  @retval EFI_UNSUPPORTED     This driver does not support this device\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverBindingSupported(\r
-  IN EFI_DRIVER_BINDING_PROTOCOL*    This,\r
-  IN EFI_HANDLE            ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL*    RemainingDevicePath OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_IO_PROTOCOL*        UnixIo;\r
-\r
-  //\r
-  // Open the I/O abstraction needed to perform the supported test.\r
-  //\r
-  Status = gBS->OpenProtocol(\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          ( VOID ** ) &UnixIo,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle,\r
-          EFI_OPEN_PROTOCOL_BY_DRIVER\r
-          );\r
-\r
-  if ( EFI_ERROR( Status ) )\r
-  {\r
-    return( Status );\r
-  }\r
-\r
-  //\r
-  // Validate GUID\r
-  //\r
-  Status = EFI_UNSUPPORTED;\r
-  if ( CompareGuid( UnixIo->TypeGuid, &gEfiUnixNetworkGuid ) )\r
-  {\r
-    Status = EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Close the I/O abstraction used to perform the supported test.\r
-  //\r
-  gBS->CloseProtocol(\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-  return( Status );\r
-}\r
-\r
-\r
-/**\r
-  Start this driver on ControllerHandle. This service is called by the\r
-  EFI boot service ConnectController(). In order to make\r
-  drivers as small as possible, there are a few calling restrictions for\r
-  this service. ConnectController() must follow these\r
-  calling restrictions. If any other agent wishes to call Start() it\r
-  must also follow these calling restrictions.\r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ControllerHandle     Handle of device to bind driver to\r
-  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
-                               device to start.\r
-\r
-  @retval EFI_SUCCESS          Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverBindingStart(\r
-  IN EFI_DRIVER_BINDING_PROTOCOL*    This,\r
-  IN EFI_HANDLE            ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL*    RemainingDevicePath OPTIONAL\r
-  )\r
-{\r
-  MAC_ADDR_DEVICE_PATH      Node;\r
-  EFI_DEVICE_PATH_PROTOCOL*    ParentDevicePath = NULL;\r
-  EFI_UNIX_IO_PROTOCOL*      UnixIo;\r
-  UNIX_SNP_PRIVATE_DATA*      Private = NULL;\r
-  EFI_STATUS            Status;\r
-  BOOLEAN              CreateDevice;\r
-\r
-  //\r
-  // Grab the protocols we need.\r
-  //\r
-  Status = gBS->OpenProtocol(\r
-          ControllerHandle,\r
-          &gEfiDevicePathProtocolGuid,\r
-          ( VOID ** ) &ParentDevicePath,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle,\r
-          EFI_OPEN_PROTOCOL_BY_DRIVER\r
-          );\r
-  if ( EFI_ERROR( Status ) )\r
-  {\r
-    goto ErrorExit;\r
-  }\r
-\r
-  //\r
-  // Open the I/O abstraction needed to perform the supported test.\r
-  //\r
-  Status = gBS->OpenProtocol(\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          ( VOID ** ) &UnixIo,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle,\r
-          EFI_OPEN_PROTOCOL_BY_DRIVER\r
-          );\r
-  if ( EFI_ERROR( Status ) )\r
-  {\r
-    goto ErrorExit;\r
-  }\r
-\r
-  //\r
-  // Validate GUID\r
-  //\r
-  if ( !CompareGuid( UnixIo->TypeGuid, &gEfiUnixNetworkGuid ) )\r
-  {\r
-    Status = EFI_UNSUPPORTED;\r
-    goto ErrorExit;\r
-  }\r
-\r
-  CreateDevice = TRUE;\r
-  if ( ( RemainingDevicePath != NULL ) && IsDevicePathEnd( RemainingDevicePath ) )\r
-  {\r
-    CreateDevice = FALSE;\r
-  }\r
-\r
-  if ( CreateDevice )\r
-  {\r
-    //\r
-    //  Allocate the private data.\r
-    //\r
-    Private = AllocateCopyPool( sizeof( UNIX_SNP_PRIVATE_DATA ), &gUnixSnpPrivateTemplate );\r
-    if ( Private == NULL )\r
-    {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto ErrorExit;\r
-    }\r
-\r
-    Status = GetInterfaceMacAddr( Private, UnixIo );\r
-    if ( EFI_ERROR( Status ) )\r
-    {\r
-      goto ErrorExit;\r
-    }\r
-\r
-    Private->UnixThunk = UnixIo->UnixThunk;\r
-\r
-    Private->Snp.Mode = &Private->Mode;\r
-\r
-    //\r
-    // Set the broadcast address.\r
-    //\r
-    SetMem( &Private->Mode.BroadcastAddress, sizeof( EFI_MAC_ADDRESS ), 0xFF );\r
-\r
-    CopyMem( &Private->Mode.CurrentAddress, &Private->MacAddress, sizeof( EFI_MAC_ADDRESS ) );\r
-    CopyMem( &Private->Mode.PermanentAddress, &Private->MacAddress, sizeof( EFI_MAC_ADDRESS ) );\r
-\r
-    //\r
-    // Since the fake SNP is based on a real NIC, to avoid conflict with the host NIC\r
-    // network stack, we use a different MAC address.\r
-    // So just change the last byte of the MAC address for the real NIC.\r
-    //\r
-    Private->Mode.CurrentAddress.Addr[ NET_ETHER_ADDR_LEN - 1 ]++;\r
-\r
-    //\r
-    // Build the device path by appending the MAC node to the ParentDevicePath\r
-    // from the UnixIo handle.\r
-    //\r
-    ZeroMem( &Node, sizeof( MAC_ADDR_DEVICE_PATH ) );\r
-\r
-    Node.Header.Type  = MESSAGING_DEVICE_PATH;\r
-    Node.Header.SubType  = MSG_MAC_ADDR_DP;\r
-    Node.IfType      = Private->Mode.IfType;\r
-\r
-    SetDevicePathNodeLength( ( EFI_DEVICE_PATH_PROTOCOL * ) &Node, sizeof( MAC_ADDR_DEVICE_PATH ) );\r
-\r
-    CopyMem( &Node.MacAddress, &Private->Mode.CurrentAddress, sizeof( EFI_MAC_ADDRESS ) );\r
-\r
-    //\r
-    // Build the device path by appending the MAC node to the ParentDevicePath from the UnixIo handle.\r
-    //\r
-    Private->DevicePath = AppendDevicePathNode( ParentDevicePath, ( EFI_DEVICE_PATH_PROTOCOL * ) &Node );\r
-    if ( Private->DevicePath == NULL )\r
-    {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto ErrorExit;\r
-    }\r
-\r
-    Status = gBS->InstallMultipleProtocolInterfaces(\r
-            &Private->DeviceHandle,\r
-            &gEfiSimpleNetworkProtocolGuid,\r
-            &Private->Snp,\r
-            &gEfiDevicePathProtocolGuid,\r
-            Private->DevicePath,\r
-            NULL\r
-            );\r
-    if ( EFI_ERROR( Status ) )\r
-    {\r
-      goto ErrorExit;\r
-    }\r
-\r
-    Status = gBS->OpenProtocol(\r
-            ControllerHandle,\r
-            &gEfiUnixIoProtocolGuid,\r
-            ( VOID ** ) &UnixIo,\r
-            This->DriverBindingHandle,\r
-            Private->DeviceHandle,\r
-            EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-            );\r
-    if ( EFI_ERROR( Status ) )\r
-    {\r
-      goto ErrorExit;\r
-    }\r
-  }\r
-  return( Status );\r
-\r
-ErrorExit:\r
-  if ( Private->InterfaceName != NULL )\r
-  {\r
-    FreePool( Private->InterfaceName );\r
-    Private->InterfaceName = NULL;\r
-  }\r
-  if ( Private != NULL )\r
-  {\r
-    FreePool( Private );\r
-  }\r
-  if ( ParentDevicePath != NULL )\r
-  {\r
-    gBS->CloseProtocol(\r
-          ControllerHandle,\r
-          &gEfiDevicePathProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-  }\r
-\r
-  return( Status );\r
-}\r
-\r
-/**\r
-  Stop this driver on ControllerHandle. This service is called by the\r
-  EFI boot service DisconnectController(). In order to\r
-  make drivers as small as possible, there are a few calling\r
-  restrictions for this service. DisconnectController()\r
-  must follow these calling restrictions. If any other agent wishes\r
-  to call Stop() it must also follow these calling restrictions.\r
-  \r
-  @param  This              Protocol instance pointer.\r
-  @param  ControllerHandle  Handle of device to stop driver on\r
-  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
-                            children is zero stop the entire bus driver.\r
-  @param  ChildHandleBuffer List of Child Handles to Stop.\r
-\r
-  @retval EFI_SUCCESS       Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverBindingStop(\r
-  IN EFI_DRIVER_BINDING_PROTOCOL*    This,\r
-  IN EFI_HANDLE            ControllerHandle,\r
-  IN UINTN              NumberOfChildren,\r
-  IN EFI_HANDLE*            ChildHandleBuffer\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private = NULL;\r
-  EFI_SIMPLE_NETWORK_PROTOCOL*    Snp;\r
-  EFI_STATUS              Status;\r
-\r
-  //\r
-  // Get our context back.\r
-  //\r
-  Status = gBS->OpenProtocol(\r
-        ControllerHandle,\r
-        &gEfiSimpleNetworkProtocolGuid,\r
-        ( VOID ** ) &Snp,\r
-        This->DriverBindingHandle,\r
-        ControllerHandle,\r
-        EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-        );\r
-  if ( EFI_ERROR( Status ) )\r
-  {\r
-    return( EFI_UNSUPPORTED );\r
-  }\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( Snp );\r
-\r
-  Status = gBS->CloseProtocol(\r
-        ControllerHandle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Private->DeviceHandle\r
-        );\r
-\r
-  Status = gBS->UninstallMultipleProtocolInterfaces(\r
-        Private->DeviceHandle,\r
-        &gEfiSimpleNetworkProtocolGuid,\r
-        &Private->Snp,\r
-        &gEfiDevicePathProtocolGuid,\r
-        Private->DevicePath,\r
-        NULL\r
-        );\r
-\r
-  FreePool( Private->InterfaceName );\r
-  FreePool( Private->DevicePath );\r
-  FreePool( Private );\r
-\r
-  return( EFI_SUCCESS );\r
-}\r
-\r
-\r
-/**\r
-  Changes the state of a network interface from "stopped" to "started".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStart(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This\r
-  )\r
-{\r
-  STATIC struct bpf_insn        FilterInstructionTemplate[] =\r
-  {\r
-    // Load 4 bytes from the destination MAC address.\r
-    BPF_STMT( BPF_LD + BPF_W + BPF_ABS, OFFSET_OF( EthernetHeader, DstAddr[ 0 ] ) ),\r
-\r
-    // Compare to first 4 bytes of fake MAC address.\r
-    BPF_JUMP( BPF_JMP + BPF_JEQ + BPF_K, 0x12345678, 0, 3 ),\r
-\r
-    // Load remaining 2 bytes from the destination MAC address.\r
-    BPF_STMT( BPF_LD + BPF_H + BPF_ABS, OFFSET_OF( EthernetHeader, DstAddr[ 4 ] ) ),\r
-\r
-    // Compare to remaining 2 bytes of fake MAC address.\r
-    BPF_JUMP( BPF_JMP + BPF_JEQ + BPF_K, 0x9ABC, 5, 0 ),\r
-\r
-    // Load 4 bytes from the destination MAC address.\r
-    BPF_STMT( BPF_LD + BPF_W + BPF_ABS, OFFSET_OF( EthernetHeader, DstAddr[ 0 ] ) ),\r
-\r
-    // Compare to first 4 bytes of broadcast MAC address.\r
-    BPF_JUMP( BPF_JMP + BPF_JEQ + BPF_K, 0xFFFFFFFF, 0, 2 ),\r
-\r
-    // Load remaining 2 bytes from the destination MAC address.\r
-    BPF_STMT( BPF_LD + BPF_H + BPF_ABS, OFFSET_OF( EthernetHeader, DstAddr[ 4 ] ) ),\r
-\r
-    // Compare to remaining 2 bytes of broadcast MAC address.\r
-    BPF_JUMP( BPF_JMP + BPF_JEQ + BPF_K, 0xFFFF, 1, 0 ),\r
-\r
-    // Reject packet.\r
-    BPF_STMT( BPF_RET + BPF_K, 0 ),\r
-\r
-    // Receive entire packet.\r
-    BPF_STMT( BPF_RET + BPF_K, -1 )\r
-  };\r
-  struct ifreq            BoundIf;\r
-  struct bpf_program          BpfProgram;\r
-  struct bpf_insn*          FilterProgram;\r
-  UNIX_SNP_PRIVATE_DATA*        Private;\r
-  EFI_STATUS              Status;\r
-  UINT32                Temp32;\r
-  INTN                Fd;\r
-  INTN                Result;\r
-  INTN                Value;\r
-  UINT16                Temp16;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-  switch ( Private->Snp.Mode->State )\r
-  {\r
-    case EfiSimpleNetworkStopped:\r
-      break;\r
-\r
-    case EfiSimpleNetworkStarted:\r
-    case EfiSimpleNetworkInitialized:\r
-      return( EFI_ALREADY_STARTED );\r
-      break;\r
-\r
-    default:\r
-      return( EFI_DEVICE_ERROR );\r
-      break;\r
-  }\r
-\r
-  if ( Private->BpfFd == 0 )\r
-  {\r
-    Status = OpenBpfFileDescriptor( Private, &Fd );\r
-\r
-    if ( EFI_ERROR( Status ) )\r
-    {\r
-      goto ErrorExit;\r
-    }\r
-\r
-    Private->BpfFd = Fd;\r
-\r
-    //\r
-    // Associate our interface with this BPF file descriptor.\r
-    //\r
-    AsciiStrCpy( BoundIf.ifr_name, Private->InterfaceName );\r
-    Result = Private->UnixThunk->IoCtl( Private->BpfFd, BIOCSETIF, &BoundIf );\r
-\r
-    if ( Result < 0 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-    //\r
-    // Enable immediate mode and find out the buffer size.\r
-    //\r
-    Value = 1;\r
-    Result = Private->UnixThunk->IoCtl( Private->BpfFd, BIOCIMMEDIATE, &Value );\r
-\r
-    if ( Result < 0 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-    //\r
-    // Enable non-blocking I/O.\r
-    //\r
-\r
-    Value = Private->UnixThunk->Fcntl( Private->BpfFd, F_GETFL, 0 );\r
-\r
-    if ( Value == -1 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-    Value |= O_NONBLOCK;\r
-\r
-    Result = Private->UnixThunk->Fcntl( Private->BpfFd, F_SETFL, (void *) Value );\r
-\r
-    if ( Result == -1 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-    //\r
-    // Disable "header complete" flag.  This means the supplied source MAC address is\r
-    // what goes on the wire.\r
-    //\r
-    Value = 1;\r
-    Result = Private->UnixThunk->IoCtl( Private->BpfFd, BIOCSHDRCMPLT, &Value );\r
-\r
-    if ( Result < 0 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-    Result = Private->UnixThunk->IoCtl( Private->BpfFd, BIOCGBLEN, &Value );\r
-\r
-    if ( Result < 0 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-    //\r
-    // Allocate read buffer.\r
-    //\r
-    Private->ReadBufferSize = Value;\r
-    Private->ReadBuffer = AllocateZeroPool( Private->ReadBufferSize );\r
-    if ( Private->ReadBuffer == NULL )\r
-    {\r
-      Status = EFI_OUT_OF_RESOURCES;\r
-      goto ErrorExit;\r
-    }\r
-\r
-    Private->CurrentReadPointer = Private->EndReadPointer = Private->ReadBuffer;\r
-\r
-    //\r
-    // Install our packet filter: successful reads should only produce broadcast or unitcast\r
-    // packets directed to our fake MAC address.\r
-    //\r
-    FilterProgram = AllocateCopyPool( sizeof( FilterInstructionTemplate ), &FilterInstructionTemplate );\r
-    if ( FilterProgram == NULL )\r
-    {\r
-      goto ErrorExit;\r
-    }\r
-\r
-    //\r
-    // Insert out fake MAC address into the filter.  The data has to be host endian.\r
-    //\r
-    CopyMem( &Temp32, &Private->Mode.CurrentAddress.Addr[ 0 ], sizeof( UINT32 ) );\r
-    FilterProgram[ 1 ].k = NTOHL( Temp32 );\r
-    CopyMem( &Temp16, &Private->Mode.CurrentAddress.Addr[ 4 ], sizeof( UINT16 ) );\r
-    FilterProgram[ 3 ].k = NTOHS( Temp16 );\r
-\r
-    BpfProgram.bf_len = sizeof( FilterInstructionTemplate ) / sizeof( struct bpf_insn );\r
-    BpfProgram.bf_insns = FilterProgram;\r
-\r
-    Result = Private->UnixThunk->IoCtl( Private->BpfFd, BIOCSETF, &BpfProgram );\r
-\r
-    if ( Result < 0 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-    FreePool( FilterProgram );\r
-\r
-    //\r
-    // Enable promiscuous mode.\r
-    //\r
-\r
-    Result = Private->UnixThunk->IoCtl( Private->BpfFd, BIOCPROMISC, 0 );\r
-\r
-    if ( Result < 0 )\r
-    {\r
-      goto DeviceErrorExit;\r
-    }\r
-\r
-\r
-    Private->Snp.Mode->State = EfiSimpleNetworkStarted;      \r
-  }\r
-\r
-  return( Status );\r
-\r
-DeviceErrorExit:\r
-  Status = EFI_DEVICE_ERROR;\r
-ErrorExit:\r
-  if ( Private->ReadBuffer != NULL )\r
-  {\r
-    FreePool( Private->ReadBuffer );\r
-    Private->ReadBuffer = NULL;\r
-  }\r
-  return( Status );\r
-}\r
-\r
-\r
-/**\r
-  Changes the state of a network interface from "started" to "stopped".\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStop(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private = EFI_SUCCESS;\r
-  EFI_STATUS              Status;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-  switch ( Private->Snp.Mode->State )\r
-  {\r
-    case EfiSimpleNetworkStarted:\r
-      break;\r
-\r
-    case EfiSimpleNetworkStopped:\r
-      return( EFI_NOT_STARTED );\r
-      break;\r
-\r
-    default:\r
-      return( EFI_DEVICE_ERROR );\r
-      break;\r
-  }\r
-\r
-  if ( Private->BpfFd != 0 )\r
-  {\r
-    Private->UnixThunk->Close( Private->BpfFd );\r
-    Private->BpfFd = 0;\r
-  }\r
-\r
-  if ( Private->ReadBuffer != NULL )\r
-  {\r
-    FreePool( Private->ReadBuffer );\r
-    Private->CurrentReadPointer = Private->EndReadPointer = Private->ReadBuffer = NULL;\r
-  }\r
-\r
-  Private->Snp.Mode->State = EfiSimpleNetworkStopped;\r
-\r
-  return( Status );\r
-}\r
-\r
-\r
-/**\r
-  Resets a network adapter and allocates the transmit and receive buffers \r
-  required by the network interface; optionally, also requests allocation \r
-  of additional transmit and receive buffers.\r
-\r
-  @param  This              Protocol instance pointer.\r
-  @param  ExtraRxBufferSize The size, in bytes, of the extra receive buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-  @param  ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space\r
-                            that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the extra\r
-                            buffer, and the caller will not know if it is actually\r
-                            being used.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpInitialize(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN UINTN              ExtraRxBufferSize OPTIONAL,\r
-  IN UINTN              ExtraTxBufferSize OPTIONAL\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private = EFI_SUCCESS;\r
-  EFI_STATUS              Status;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-  switch ( Private->Snp.Mode->State )\r
-  {\r
-    case EfiSimpleNetworkStarted:\r
-      break;\r
-\r
-    case EfiSimpleNetworkStopped:\r
-      return( EFI_NOT_STARTED );\r
-      break;\r
-\r
-    default:\r
-      return( EFI_DEVICE_ERROR );\r
-      break;\r
-  }\r
-\r
-#if 0\r
-  Status = gBS->CreateEvent(\r
-          EVT_NOTIFY_WAIT,\r
-          TPL_NOTIFY,\r
-          UnixSnpWaitForPacketNotify,\r
-          Private,\r
-          &Private->Snp.WaitForPacket\r
-          );\r
-#endif\r
-\r
-  if ( !EFI_ERROR( Status ) )\r
-  {\r
-    Private->Mode.MCastFilterCount = 0;\r
-    Private->Mode.ReceiveFilterSetting = 0;\r
-    ZeroMem( Private->Mode.MCastFilter, sizeof( Private->Mode.MCastFilter ) );\r
-\r
-    Private->Snp.Mode->State = EfiSimpleNetworkInitialized;\r
-  }\r
-\r
-  return( Status );\r
-}\r
-\r
-/**\r
-  Resets a network adapter and re-initializes it with the parameters that were \r
-  provided in the previous call to Initialize().  \r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ExtendedVerification Indicates that the driver may perform a more\r
-                               exhaustive verification operation of the device\r
-                               during reset.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpReset(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              ExtendedVerification\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private;\r
-  EFI_STATUS              Success = EFI_SUCCESS;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-  switch ( Private->Snp.Mode->State )\r
-  {\r
-    case EfiSimpleNetworkInitialized:\r
-      break;\r
-\r
-    case EfiSimpleNetworkStopped:\r
-      return( EFI_NOT_STARTED );\r
-      break;\r
-\r
-    default:\r
-      return( EFI_DEVICE_ERROR );\r
-      break;\r
-  }\r
-\r
-  return( Success );\r
-}\r
-\r
-/**\r
-  Resets a network adapter and leaves it in a state that is safe for \r
-  another driver to initialize.\r
-\r
-  @param  This Protocol instance pointer.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpShutdown(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private;\r
-  EFI_STATUS              Success = EFI_SUCCESS;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-  switch ( Private->Snp.Mode->State )\r
-  {\r
-    case EfiSimpleNetworkInitialized:\r
-      break;\r
-\r
-    case EfiSimpleNetworkStopped:\r
-      return( EFI_NOT_STARTED );\r
-      break;\r
-\r
-    default:\r
-      return( EFI_DEVICE_ERROR );\r
-      break;\r
-  }\r
-\r
-  Private->Snp.Mode->State = EfiSimpleNetworkStarted;\r
-\r
-  Private->Mode.ReceiveFilterSetting = 0;\r
-  Private->Mode.MCastFilterCount = 0;\r
-  ZeroMem( Private->Mode.MCastFilter, sizeof( Private->Mode.MCastFilter ) );\r
-\r
-  if ( Private->Snp.WaitForPacket != NULL )\r
-  {\r
-    gBS->CloseEvent( Private->Snp.WaitForPacket );\r
-    Private->Snp.WaitForPacket = NULL;\r
-  }\r
-\r
-  if ( Private->BpfFd != 0 )\r
-  {\r
-    Private->UnixThunk->Close( Private->BpfFd );\r
-    Private->BpfFd = 0;\r
-  }\r
-\r
-  if ( Private->ReadBuffer != NULL )\r
-  {\r
-    FreePool( Private->ReadBuffer );\r
-    Private->CurrentReadPointer = Private->EndReadPointer = Private->ReadBuffer = NULL;\r
-  }\r
-\r
-  return( Success );\r
-}\r
-\r
-/**\r
-  Manages the multicast receive filters of a network interface.\r
-\r
-  @param  This               Protocol instance pointer.\r
-  @param  EnableBits         A bit mask of receive filters to enable on the network interface.\r
-  @param  DisableBits        A bit mask of receive filters to disable on the network interface.\r
-  @param  ResetMcastFilter   Set to TRUE to reset the contents of the multicast receive\r
-                             filters on the network interface to their default values.\r
-  @param  McastFilterCount   Number of multicast HW MAC addresses in the new\r
-                             MCastFilter list. This value must be less than or equal to\r
-                             the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This\r
-                             field is optional if ResetMCastFilter is TRUE.\r
-  @param  McastFilter        A pointer to a list of new multicast receive filter HW MAC\r
-                             addresses. This list will replace any existing multicast\r
-                             HW MAC address list. This field is optional if\r
-                             ResetMCastFilter is TRUE.\r
-\r
-  @retval EFI_SUCCESS           The multicast receive filter list was updated.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpReceiveFilters(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN UINT32              EnableBits,\r
-  IN UINT32              DisableBits,\r
-  IN BOOLEAN              ResetMcastFilter,\r
-  IN UINTN              McastFilterCount OPTIONAL,\r
-  IN EFI_MAC_ADDRESS*          McastFilter OPTIONAL\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-//  ReturnValue = GlobalData->NtNetUtilityTable.SetReceiveFilter (\r
-//                                                Instance->InterfaceInfo.InterfaceIndex,\r
-//                                                EnableBits,\r
-//                                                McastFilterCount,\r
-//                                                McastFilter\r
-//                                                );\r
-\r
-  // For now, just succeed...\r
-  return( EFI_SUCCESS );\r
-}\r
-\r
-/**\r
-  Modifies or resets the current station address, if supported.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  Reset        Flag used to reset the station address to the network interfaces\r
-                       permanent address.\r
-  @param  NewMacAddr   New station address to be used for the network interface.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStationAddress(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              Reset,\r
-  IN EFI_MAC_ADDRESS*          NewMacAddr OPTIONAL\r
-  )\r
-{\r
-  return( EFI_UNSUPPORTED );\r
-}\r
-\r
-/**\r
-  Resets or collects the statistics on a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  Reset           Set to TRUE to reset the statistics for the network interface.\r
-  @param  StatisticsSize  On input the size, in bytes, of StatisticsTable. On\r
-                          output the size, in bytes, of the resulting table of\r
-                          statistics.\r
-  @param  StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
-                          contains the statistics.\r
-\r
-  @retval EFI_SUCCESS           The statistics were collected from the network interface.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpStatistics(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              Reset,\r
-  IN OUT UINTN*            StatisticsSize OPTIONAL,\r
-  OUT EFI_NETWORK_STATISTICS*      StatisticsTable OPTIONAL\r
-  )\r
-{\r
-  return( EFI_UNSUPPORTED );\r
-}\r
-\r
-/**\r
-  Converts a multicast IP address to a multicast HW MAC address.\r
-\r
-  @param  This Protocol instance pointer.\r
-  @param  Ipv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set\r
-               to FALSE if the multicast IP address is IPv4 [RFC 791].\r
-  @param  Ip   The multicast IP address that is to be converted to a multicast\r
-               HW MAC address.\r
-  @param  Mac  The multicast HW MAC address that is to be generated from IP.\r
-\r
-  @retval EFI_SUCCESS           The multicast IP address was mapped to the multicast\r
-                                HW MAC address.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
-                                size needed to hold the statistics is returned in\r
-                                StatisticsSize.\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpMcastIptoMac(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              Ipv6,\r
-  IN EFI_IP_ADDRESS*          Ip,\r
-  OUT EFI_MAC_ADDRESS*        Mac\r
-  )\r
-{\r
-  return( EFI_UNSUPPORTED );\r
-}\r
-\r
-\r
-/**\r
-  Performs read and write operations on the NVRAM device attached to a \r
-  network interface.\r
-\r
-  @param  This         Protocol instance pointer.\r
-  @param  ReadOrWrite  TRUE for read operations, FALSE for write operations.\r
-  @param  Offset       Byte offset in the NVRAM device at which to start the read or\r
-                       write operation. This must be a multiple of NvRamAccessSize and\r
-                       less than NvRamSize.\r
-  @param  BufferSize   The number of bytes to read or write from the NVRAM device.\r
-                       This must also be a multiple of NvramAccessSize.\r
-  @param  Buffer       A pointer to the data buffer.\r
-\r
-  @retval EFI_UNSUPPORTED       Not supported yet.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpNvdata(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN BOOLEAN              ReadOrWrite,\r
-  IN UINTN              Offset,\r
-  IN UINTN              BufferSize,\r
-  IN OUT VOID*            Buffer\r
-  )\r
-{\r
-  return( EFI_UNSUPPORTED );\r
-}\r
-\r
-\r
-/**\r
-  Reads the current interrupt status and recycled transmit buffer status from \r
-  a network interface.\r
-\r
-  @param  This            Protocol instance pointer.\r
-  @param  InterruptStatus A pointer to the bit mask of the currently active interrupts\r
-                          If this is NULL, the interrupt status will not be read from\r
-                          the device. If this is not NULL, the interrupt status will\r
-                          be read from the device. When the  interrupt status is read,\r
-                          it will also be cleared. Clearing the transmit  interrupt\r
-                          does not empty the recycled transmit buffer array.\r
-  @param  TxBuffer        Recycled transmit buffer address. The network interface will\r
-                          not transmit if its internal recycled transmit buffer array\r
-                          is full. Reading the transmit buffer does not clear the\r
-                          transmit interrupt. If this is NULL, then the transmit buffer\r
-                          status will not be read. If there are no transmit buffers to\r
-                          recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
-\r
-  @retval EFI_SUCCESS           Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpGetStatus(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  OUT UINT32*              InterruptStatus,\r
-  OUT VOID**              TxBuffer\r
-  )\r
-{\r
-  if ( TxBuffer != NULL )\r
-  {\r
-    *( ( UINT8 ** ) TxBuffer ) = ( UINT8 * ) 1;\r
-  }\r
-\r
-  if ( InterruptStatus != NULL )\r
-  {\r
-    *InterruptStatus = EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;\r
-  }\r
-\r
-  return( EFI_SUCCESS );\r
-}\r
-\r
-\r
-/**\r
-  Places a packet in the transmit queue of a network interface.\r
-\r
-  @param  This       Protocol instance pointer.\r
-  @param  HeaderSize The size, in bytes, of the media header to be filled in by\r
-                     the Transmit() function. If HeaderSize is non-zero, then it\r
-                     must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
-                     and Protocol parameters must not be NULL.\r
-  @param  BufferSize The size, in bytes, of the entire packet (media header and\r
-                     data) to be transmitted through the network interface.\r
-  @param  Buffer     A pointer to the packet (media header followed by data) to be\r
-                     transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
-                     then the media header in Buffer must already be filled in by the\r
-                     caller. If HeaderSize is non-zero, then the media header will be\r
-                     filled in by the Transmit() function.\r
-  @param  SrcAddr    The source HW MAC address. If HeaderSize is zero, then this parameter\r
-                     is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
-                     This->Mode->CurrentAddress is used for the source HW MAC address.\r
-  @param  DestAddr   The destination HW MAC address. If HeaderSize is zero, then this\r
-                     parameter is ignored.\r
-  @param  Protocol   The type of header to build. If HeaderSize is zero, then this\r
-                     parameter is ignored. See RFC 1700, section "Ether Types", for\r
-                     examples.\r
-\r
-  @retval EFI_SUCCESS           The packet was placed on the transmit queue.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpTransmit(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  IN UINTN              HeaderSize,\r
-  IN UINTN              BufferSize,\r
-  IN VOID*              Buffer,\r
-  IN EFI_MAC_ADDRESS*          SrcAddr OPTIONAL,\r
-  IN EFI_MAC_ADDRESS*          DestAddr OPTIONAL,\r
-  IN UINT16*              Protocol OPTIONAL\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private;\r
-  EthernetHeader*            EnetHeader;\r
-  INTN                Result;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-  if ( This->Mode->State < EfiSimpleNetworkStarted )\r
-  {\r
-    return( EFI_NOT_STARTED );\r
-  }\r
-\r
-  if ( HeaderSize != 0 )\r
-  {\r
-    if ( ( DestAddr == NULL ) || ( Protocol == NULL ) || ( HeaderSize != This->Mode->MediaHeaderSize ) )\r
-    {\r
-      return( EFI_INVALID_PARAMETER );\r
-    }\r
-\r
-    if ( SrcAddr == NULL )\r
-    {\r
-      SrcAddr = &This->Mode->CurrentAddress;\r
-    }\r
-\r
-    EnetHeader = ( EthernetHeader * ) Buffer;\r
-\r
-    CopyMem( EnetHeader->DstAddr, DestAddr, NET_ETHER_ADDR_LEN );\r
-    CopyMem( EnetHeader->SrcAddr, SrcAddr, NET_ETHER_ADDR_LEN );\r
-\r
-    EnetHeader->Type = HTONS( *Protocol );\r
-  }\r
-\r
-  Result = Private->UnixThunk->Write( Private->BpfFd, Buffer, BufferSize );\r
-\r
-  if ( Result < 0 )\r
-  {\r
-    return( EFI_DEVICE_ERROR );\r
-  }\r
-  else\r
-  {\r
-    return( EFI_SUCCESS );\r
-  }\r
-}\r
-\r
-/**\r
-  Receives a packet from a network interface.\r
-\r
-  @param  This             Protocol instance pointer.\r
-  @param  HeaderSize       The size, in bytes, of the media header received on the network\r
-                           interface. If this parameter is NULL, then the media header size\r
-                           will not be returned.\r
-  @param  BuffSize         On entry, the size, in bytes, of Buffer. On exit, the size, in\r
-                           bytes, of the packet that was received on the network interface.\r
-  @param  Buffer           A pointer to the data buffer to receive both the media header and\r
-                           the data.\r
-  @param  SourceAddr       The source HW MAC address. If this parameter is NULL, the\r
-                           HW MAC source address will not be extracted from the media\r
-                           header.\r
-  @param  DestinationAddr  The destination HW MAC address. If this parameter is NULL,\r
-                           the HW MAC destination address will not be extracted from the\r
-                           media header.\r
-  @param  Protocol         The media header type. If this parameter is NULL, then the\r
-                           protocol will not be extracted from the media header. See\r
-                           RFC 1700 section "Ether Types" for examples.\r
-\r
-  @retval EFI_SUCCESS           The received data was stored in Buffer, and BufferSize has\r
-                                been updated to the number of bytes received.\r
-  @retval EFI_NOT_READY         The network interface is too busy to accept this transmit\r
-                                request.\r
-  @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_BUFFER_TOO_SMALL  The BufferSize parameter is too small.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpReceive(\r
-  IN EFI_SIMPLE_NETWORK_PROTOCOL*    This,\r
-  OUT UINTN*              HeaderSize OPTIONAL,\r
-  IN OUT UINTN*            BuffSize,\r
-  OUT VOID*              Buffer,\r
-  OUT EFI_MAC_ADDRESS*        SourceAddr OPTIONAL,\r
-  OUT EFI_MAC_ADDRESS*        DestinationAddr OPTIONAL,\r
-  OUT UINT16*              Protocol OPTIONAL\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private;\r
-  struct bpf_hdr*            BpfHeader;\r
-  EthernetHeader*            EnetHeader;\r
-  EFI_STATUS              Status = EFI_SUCCESS;\r
-  INTN                Result;\r
-\r
-  if ( This->Mode->State < EfiSimpleNetworkStarted )\r
-  {\r
-    return( EFI_NOT_STARTED );\r
-  }\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( This );\r
-\r
-  //\r
-  // Do we have any remaining packets from the previous read?\r
-  //\r
-  if ( Private->CurrentReadPointer >= Private->EndReadPointer )\r
-  {\r
-    Result = Private->UnixThunk->Read( Private->BpfFd, Private->ReadBuffer, Private->ReadBufferSize );\r
-\r
-    if ( Result < 0 )\r
-    {\r
-      Result = Private->UnixThunk->GetErrno();\r
-\r
-      //\r
-      // EAGAIN means that there's no I/O outstanding against this file descriptor.\r
-      //\r
-      if ( Result == EAGAIN )\r
-      {\r
-        return( EFI_NOT_READY );\r
-      }\r
-      else\r
-      {\r
-        return( EFI_DEVICE_ERROR );\r
-      }\r
-    }\r
-\r
-    if ( Result == 0 )\r
-    {\r
-      return( EFI_NOT_READY );\r
-    }\r
-\r
-    Private->CurrentReadPointer = Private->ReadBuffer;\r
-    Private->EndReadPointer = Private->CurrentReadPointer + Result;\r
-  }\r
-\r
-  BpfHeader = Private->CurrentReadPointer;\r
-  EnetHeader = Private->CurrentReadPointer + BpfHeader->bh_hdrlen;\r
-\r
-  if ( BpfHeader->bh_caplen > *BuffSize )\r
-  {\r
-    *BuffSize = BpfHeader->bh_caplen;\r
-    return( EFI_BUFFER_TOO_SMALL );\r
-  }\r
-\r
-  CopyMem( Buffer, EnetHeader, BpfHeader->bh_caplen );\r
-  *BuffSize = BpfHeader->bh_caplen;\r
-\r
-  if ( HeaderSize != NULL )\r
-  {\r
-    *HeaderSize = sizeof( EthernetHeader );\r
-  }\r
-\r
-  if ( DestinationAddr != NULL )\r
-  {\r
-    ZeroMem( DestinationAddr, sizeof( EFI_MAC_ADDRESS ) );\r
-    CopyMem( DestinationAddr, EnetHeader->DstAddr, NET_ETHER_ADDR_LEN );\r
-  }\r
-\r
-  if ( SourceAddr != NULL )\r
-  {\r
-    ZeroMem( SourceAddr, sizeof( EFI_MAC_ADDRESS ) );\r
-    CopyMem( SourceAddr, EnetHeader->SrcAddr, NET_ETHER_ADDR_LEN );\r
-  }\r
-\r
-  if ( Protocol != NULL )\r
-  {\r
-    *Protocol = NTOHS( EnetHeader->Type );\r
-  }\r
-\r
-  Private->CurrentReadPointer += BPF_WORDALIGN( BpfHeader->bh_hdrlen + BpfHeader->bh_caplen );\r
-\r
-  return( Status );\r
-}\r
-\r
-\r
-VOID\r
-EFIAPI\r
-UnixSnpWaitForPacketNotify(\r
-  IN EFI_EVENT            Event,\r
-  IN VOID*              Context\r
-  )\r
-{\r
-  UNIX_SNP_PRIVATE_DATA*        Private;\r
-\r
-  Private = UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS( Context );\r
-\r
-  if ( Private->Snp.Mode->State < EfiSimpleNetworkStarted )\r
-  {\r
-    return;\r
-  }\r
-}\r
-\r
-\r
-/**\r
-  This is the declaration of an EFI image entry point. This entry point is\r
-  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
-  both device drivers and bus drivers.\r
-\r
-  @param  ImageHandle           The firmware allocated handle for the UEFI image.\r
-  @param  SystemTable           A pointer to the EFI System Table.\r
-\r
-  @retval EFI_SUCCESS           The operation completed successfully.\r
-  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
-\r
-**/\r
-EFI_STATUS\r
-InitializeUnixSnpDriver(\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE*    SystemTable\r
-  )\r
-{\r
-  EFI_STATUS            Status;\r
-\r
-  //\r
-  // Install the Driver Protocols\r
-  //\r
-\r
-  Status = EfiLibInstallDriverBindingComponentName2(\r
-          ImageHandle,\r
-          SystemTable,\r
-          &gUnixSnpDriverBinding,\r
-          ImageHandle,\r
-          &gUnixSnpDriverComponentName,\r
-          &gUnixSnpDriverComponentName2\r
-          );\r
-\r
-  return( Status );\r
-}\r
diff --git a/UnixPkg/UnixSnpDxe/UnixSnp.h b/UnixPkg/UnixSnpDxe/UnixSnp.h
deleted file mode 100644 (file)
index 532119a..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/** @file\r
-\r
- Copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-\r
-    This program and the accompanying materials\r
-    are licensed and made available under the terms and conditions of the BSD License\r
-    which accompanies this distribution. The full text of the license may be found at\r
-    http://opensource.org/licenses/bsd-license.php\r
-\r
-    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-\r
-  UnixSnp.h\r
-\r
-Abstract:\r
-\r
--**/\r
-\r
-#ifndef _UNIX_SNP_H_\r
-#define _UNIX_SNP_H_\r
-\r
-#include <Uefi.h>\r
-\r
-#include <Protocol/SimpleNetwork.h>\r
-#include <Protocol/DevicePath.h>\r
-#include <Protocol/UnixIo.h>\r
-\r
-\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/NetLib.h>\r
-\r
-#define NET_ETHER_HEADER_SIZE     14\r
-\r
-//\r
-//  Private data for driver.\r
-//\r
-#define UNIX_SNP_PRIVATE_DATA_SIGNATURE SIGNATURE_32( 'U', 'S', 'N', 'P' )\r
-\r
-typedef struct\r
-{\r
-  UINT32                Signature;\r
-\r
-  EFI_UNIX_THUNK_PROTOCOL*      UnixThunk;\r
-\r
-  EFI_HANDLE              DeviceHandle;\r
-  EFI_DEVICE_PATH_PROTOCOL*      DevicePath;\r
-\r
-  EFI_MAC_ADDRESS            MacAddress;\r
-\r
-  CHAR8*                InterfaceName;\r
-  INTN                ReadBufferSize;\r
-  VOID*                ReadBuffer;\r
-  //\r
-  // Two walking pointers to manage the multiple packets that can be returned\r
-  // in a single read.\r
-  //\r
-  VOID*                CurrentReadPointer;\r
-  VOID*                EndReadPointer;\r
-\r
-  INTN                BpfFd;\r
-\r
-  EFI_SIMPLE_NETWORK_PROTOCOL      Snp;\r
-  EFI_SIMPLE_NETWORK_MODE        Mode;\r
-} UNIX_SNP_PRIVATE_DATA;\r
-\r
-#define UNIX_SNP_PRIVATE_DATA_FROM_SNP_THIS(a) \\r
-      CR( a, UNIX_SNP_PRIVATE_DATA, Snp, UNIX_SNP_PRIVATE_DATA_SIGNATURE )\r
-\r
-extern EFI_DRIVER_BINDING_PROTOCOL    gUnixSnpDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL    gUnixSnpDriverComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL   gUnixSnpDriverComponentName2;\r
-\r
-/**\r
-  Test to see if this driver supports ControllerHandle. This service\r
-  is called by the EFI boot service ConnectController(). In\r
-  order to make drivers as small as possible, there are a few calling\r
-  restrictions for this service. ConnectController() must\r
-  follow these calling restrictions. If any other agent wishes to call\r
-  Supported() it must also follow these calling restrictions.\r
-\r
-  @param  This                Protocol instance pointer.\r
-  @param  ControllerHandle    Handle of device to test\r
-  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
-                              device to start.\r
-\r
-  @retval EFI_SUCCESS         This driver supports this device\r
-  @retval EFI_UNSUPPORTED     This driver does not support this device\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
-  IN EFI_HANDLE                   ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  );\r
-\r
-/**\r
-  Start this driver on ControllerHandle. This service is called by the\r
-  EFI boot service ConnectController(). In order to make\r
-  drivers as small as possible, there are a few calling restrictions for\r
-  this service. ConnectController() must follow these\r
-  calling restrictions. If any other agent wishes to call Start() it\r
-  must also follow these calling restrictions.\r
-\r
-  @param  This                 Protocol instance pointer.\r
-  @param  ControllerHandle     Handle of device to bind driver to\r
-  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
-                               device to start.\r
-\r
-  @retval EFI_SUCCESS          Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverBindingStart (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
-  IN EFI_HANDLE                   ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  );\r
-\r
-/**\r
-  Stop this driver on ControllerHandle. This service is called by the\r
-  EFI boot service DisconnectController(). In order to\r
-  make drivers as small as possible, there are a few calling\r
-  restrictions for this service. DisconnectController()\r
-  must follow these calling restrictions. If any other agent wishes\r
-  to call Stop() it must also follow these calling restrictions.\r
-  \r
-  @param  This              Protocol instance pointer.\r
-  @param  ControllerHandle  Handle of device to stop driver on\r
-  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
-                            children is zero stop the entire bus driver.\r
-  @param  ChildHandleBuffer List of Child Handles to Stop.\r
-\r
-  @retval EFI_SUCCESS       Always succeeds.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-UnixSnpDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   ControllerHandle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  );\r
-\r
-#endif  // _UNIX_SNP_H_\r
diff --git a/UnixPkg/UnixSnpDxe/UnixSnpDxe.inf b/UnixPkg/UnixSnpDxe/UnixSnpDxe.inf
deleted file mode 100644 (file)
index 21e833b..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-## @file\r
-# Component name for module UnixSnpDxe\r
-#\r
-# Copyright (c) 2010, Apple, Inc. All rights reserved.<BR>\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#    This program and the accompanying materials\r
-#    are licensed and made available under the terms and conditions of the BSD License\r
-#    which accompanies this distribution. The full text of the license may be found at\r
-#    http://opensource.org/licenses/bsd-license.php\r
-#\r
-#    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixSnpDxe\r
-  FILE_GUID                      = 20BAF49B-036D-4CA6-8FAF-583ED2737F95\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixSnpDriver\r
-#  UNLOAD_IMAGE                   = UnixSnpUnload\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources.common]\r
-  ComponentName.c\r
-  UnixSnp.h\r
-  UnixSnp.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-[LibraryClasses]\r
-  DevicePathLib\r
-  UefiLib\r
-  UefiBootServicesTableLib\r
-  BaseMemoryLib\r
-  DebugLib\r
-  UefiDriverEntryPoint\r
-  NetLib\r
-\r
-[Protocols]\r
-  gEfiSimpleNetworkProtocolGuid                 # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiUnixIoProtocolGuid                                               # PROTOCOL ALWAYS_CONSUMED\r
-\r
-[Guids]\r
-  gEfiUnixNetworkGuid                                                  # GUID ALWAYS_CONSUMED\r
diff --git a/UnixPkg/UnixThunkDxe/UnixThunk.c b/UnixPkg/UnixThunkDxe/UnixThunk.c
deleted file mode 100644 (file)
index d9a857d..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixThunk.c\r
-\r
-Abstract:\r
-\r
-  Produce UnixThunk protocol and it's associated device path and controller \r
-  state protocols. UnixThunk is to the emulation environment as \r
-  PCI_ROOT_BRIGE is to real hardware. The UnixBusDriver is the child of this\r
-  driver.\r
-\r
-  Since we are a root hardware abstraction we do not install a Driver Binding\r
-  protocol on this handle. This driver can only support one one UnixThunk protocol\r
-  in the system, since the device path is hard coded.\r
-\r
---*/\r
-#include "PiDxe.h"\r
-#include "UnixDxe.h"\r
-#include "UnixThunk.h"\r
-#include <Protocol/DevicePath.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UnixLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-//\r
-// WinNtThunk Device Path Protocol Instance\r
-//\r
-UNIX_THUNK_DEVICE_PATH mUnixThunkDevicePath = {\r
-  {\r
-    {\r
-      HARDWARE_DEVICE_PATH,\r
-      HW_VENDOR_DP,\r
-      {\r
-        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
-        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
-      }\r
-    },\r
-    EFI_UNIX_THUNK_PROTOCOL_GUID,\r
-  },\r
-  {\r
-    END_DEVICE_PATH_TYPE,\r
-    END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
-    {\r
-      END_DEVICE_PATH_LENGTH,\r
-      0\r
-    }\r
-  }\r
-};\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixThunk (\r
-  IN EFI_HANDLE                            ImageHandle,\r
-  IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Install UnixThunk Protocol and it's associated Device Path protocol\r
-\r
-Arguments:\r
-  (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns:\r
-  EFI_SUCEESS - UnixThunk protocol is added or error status from \r
-                gBS->InstallMultiProtocolInterfaces().\r
-\r
---*/\r
-// TODO:    ImageHandle - add argument and description to function comment\r
-// TODO:    SystemTable - add argument and description to function comment\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  ControllerHandle;\r
-\r
-  ControllerHandle = NULL;\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &ControllerHandle,\r
-                  &gEfiUnixThunkProtocolGuid,\r
-                  gUnix,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  &mUnixThunkDevicePath,\r
-                  NULL\r
-                  );\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixThunkDxe/UnixThunk.h b/UnixPkg/UnixThunkDxe/UnixThunk.h
deleted file mode 100644 (file)
index c41f868..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixThunk.h\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-// TODO: add protective #ifndef\r
-\r
-\r
-//\r
-// WinNtThunk Device Path Protocol Instance Type\r
-//\r
-typedef struct {\r
-  VENDOR_DEVICE_PATH        Vendor;\r
-  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
-} UNIX_THUNK_DEVICE_PATH;\r
-\r
diff --git a/UnixPkg/UnixThunkDxe/UnixThunk.inf b/UnixPkg/UnixThunkDxe/UnixThunk.inf
deleted file mode 100644 (file)
index 67decf5..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-## @file\r
-# A DXE driver to produce EFI_UNIX_THUNK_PROTOCOL\r
-#\r
-# EFI_UNIX_THUNK_PROTOCOL is a table of pointers to various Unix APIs used by various drivers to accomplish certain task in a Unix emulator.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixThunk\r
-  FILE_GUID                      = f38610fc-8985-11db-82d4-0040d02b1835\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixThunk\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  UnixThunk.c\r
-  UnixThunk.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  UnixLib\r
-  UefiDriverEntryPoint\r
-  UefiLib\r
-  DebugLib\r
-  DevicePathLib\r
-\r
-\r
-\r
-[Protocols]\r
-  gEfiDevicePathProtocolGuid                    # PROTOCOL ALWAYS_PRODUCED\r
-  gEfiUnixThunkProtocolGuid                     # PROTOCOL ALWAYS_PRODUCED\r
-\r
-\r
-[Depex]\r
-  TRUE\r
-\r
diff --git a/UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.c b/UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.c
deleted file mode 100644 (file)
index 81cb210..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-    UnixStuff.c\r
-    \r
-Abstract:\r
-\r
-    Tiano PEIM to abstract construction of firmware volume in a Unix environment.\r
-\r
-Revision History\r
-\r
---*/\r
-\r
-#include "PiPei.h"\r
-#include <Ppi/UnixThunk.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/PeimEntryPoint.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/PeiServicesTablePointerLib.h>\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeUnixStuff (\r
-  IN       EFI_PEI_FILE_HANDLE       FileHandle,\r
-  IN CONST EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Perform a call-back into the SEC simulator to get Unix Stuff\r
-\r
-Arguments:\r
-\r
-  PeiServices - General purpose services available to every PEIM.\r
-    \r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    FfsHeader - add argument and description to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_PEI_PPI_DESCRIPTOR  *PpiDescriptor;\r
-  PEI_UNIX_THUNK_PPI     *PeiUnixService;\r
-  VOID                    *Ptr;\r
-\r
-  DEBUG ((EFI_D_ERROR, "Unix Stuff PEIM Loaded\n"));\r
-\r
-  Status = (**PeiServices).LocatePpi (\r
-                            PeiServices,\r
-                            &gPeiUnixThunkPpiGuid,  // GUID\r
-                            0,                    // INSTANCE\r
-                            &PpiDescriptor,       // EFI_PEI_PPI_DESCRIPTOR\r
-                            (VOID **)&PeiUnixService         // PPI\r
-                            );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Ptr = PeiUnixService->UnixThunk ();\r
-\r
-  BuildGuidDataHob (\r
-    &gEfiUnixThunkProtocolGuid,         // Guid\r
-    &Ptr,                                // Buffer\r
-    sizeof (VOID *)                      // Sizeof Buffer\r
-    );\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.inf b/UnixPkg/UnixThunkPpiToProtocolPei/UnixThunkPpiToProtocol.inf
deleted file mode 100644 (file)
index 79f73e7..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-## @file\r
-# Stuff driver\r
-#\r
-# Tiano PEIM to abstract construction of firmware volume in a Unix environment.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixThunkPpiToProtocol\r
-  FILE_GUID                      = f4239aa2-8985-11db-af82-0040d02b1835\r
-  MODULE_TYPE                    = PEIM\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = PeimInitializeUnixStuff\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  UnixThunkPpiToProtocol.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  PeiServicesTablePointerLib\r
-  PeiServicesLib\r
-  HobLib\r
-  PeimEntryPoint\r
-  DebugLib\r
-\r
-\r
-[Protocols]\r
-  gEfiUnixThunkProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED\r
-\r
-\r
-[Ppis]\r
-  gPeiUnixThunkPpiGuid                          # PPI ALWAYS_CONSUMED\r
-\r
-\r
-[Depex]\r
-  gPeiUnixThunkPpiGuid AND gEfiPeiMemoryDiscoveredPpiGuid\r
-\r
diff --git a/UnixPkg/UnixUgaDxe/ComponentName.c b/UnixPkg/UnixUgaDxe/ComponentName.c
deleted file mode 100644 (file)
index 4ba081b..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  ComponentName.c\r
-\r
-Abstract:\r
-\r
---*/\r
-\r
-#include "UnixUga.h"\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixUgaComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixUgaComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-EFI_COMPONENT_NAME_PROTOCOL     gUnixUgaComponentName = {\r
-  UnixUgaComponentNameGetDriverName,\r
-  UnixUgaComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-EFI_UNICODE_STRING_TABLE mUnixUgaDriverNameTable[] = {\r
-  { "eng", L"Unix Universal Graphics Adapter Driver" },\r
-  { NULL , NULL }\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixUgaComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language \r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned \r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixUgaComponentName.SupportedLanguages,\r
-          mUnixUgaDriverNameTable,\r
-          DriverName\r
-          );\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixUgaComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by \r
-                       This is managing.  This handle specifies the controller \r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name \r
-                       of.  This is an optional parameter that may be NULL.  It \r
-                       will be NULL for device drivers.  It will also be NULL \r
-                       for a bus drivers that wish to retrieve the name of the \r
-                       bus controller.  It will not be NULL for a bus driver \r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by \r
-                       ControllerHandle and ChildHandle in the language specified\r
-                       by Language from the point of view of the driver specified\r
-                       by This. \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
-                            language specified by Language for the driver \r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently managing \r
-                            the controller specified by ControllerHandle and \r
-                            ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r
-  UGA_PRIVATE_DATA      *Private;\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Make sure this driver is currently managing ControllerHandle\r
-  //\r
-  Status = EfiTestManagedDevice (\r
-             ControllerHandle,\r
-             gUnixUgaDriverBinding.DriverBindingHandle,\r
-             &gEfiUnixIoProtocolGuid\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  //\r
-  // Get our context back\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUgaDrawProtocolGuid,\r
-                  (VOID **)&UgaDraw,\r
-                  gUnixUgaDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (UgaDraw);\r
-\r
-  return LookupUnicodeString (\r
-          Language,\r
-          gUnixUgaComponentName.SupportedLanguages,\r
-          Private->ControllerNameTable,\r
-          ControllerName\r
-          );\r
-}\r
diff --git a/UnixPkg/UnixUgaDxe/EntryPoint.c b/UnixPkg/UnixUgaDxe/EntryPoint.c
deleted file mode 100644 (file)
index 857f475..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**@file\r
-  Entry Point Source file.\r
-\r
-  This file contains the user entry point \r
-\r
-  Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-   This program and the accompanying materials\r
-   are licensed and made available under the terms and conditions of the BSD License\r
-   which accompanies this distribution. The full text of the license may be found at\r
-   http://opensource.org/licenses/bsd-license.php\r
-   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-**/\r
-\r
-#include "UnixUga.h"\r
-\r
-/**\r
-  The user Entry Point for module UnixUga. The user code starts with this function.\r
-\r
-  @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
-  @param[in] SystemTable    A pointer to the EFI System Table.\r
-  \r
-  @retval EFI_SUCCESS       The entry point is executed successfully.\r
-  @retval other             Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeUnixUga(\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-\r
-  Status = EfiLibInstallAllDriverProtocols (\r
-             ImageHandle,\r
-             SystemTable,\r
-             &gUnixUgaDriverBinding,\r
-             ImageHandle,\r
-             &gUnixUgaComponentName,\r
-             NULL,\r
-             NULL\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  return Status;\r
-}\r
diff --git a/UnixPkg/UnixUgaDxe/UnixUga.h b/UnixPkg/UnixUgaDxe/UnixUga.h
deleted file mode 100644 (file)
index e1e61f7..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials                          
-are licensed and made available under the terms and conditions of the BSD License         
-which accompanies this distribution.  The full text of the license may be found at        
-http://opensource.org/licenses/bsd-license.php                                            
-                                                                                          
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
-
-Module Name:
-
-  UnixUga.h
-
-Abstract:
-
-  Private data for the Uga driver that is bound to the Unix Thunk protocol 
-
---*/
-
-#ifndef _UNIX_UGA_H_
-#define _UNIX_UGA_H_
-
-#include "PiDxe.h"
-#include <Guid/EventGroup.h>
-#include <Protocol/SimpleTextIn.h>
-#include <Protocol/SimplePointer.h>
-#include <Protocol/UgaDraw.h>
-#include "Protocol/UnixUgaIo.h"
-#include <Library/DebugLib.h>
-#include <Library/BaseLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include "UnixDxe.h"
-
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixUgaDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixUgaComponentName;
-
-#define UNIX_UGA_CLASS_NAME       L"UnixUgaWindow"
-
-#define UGA_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('S', 'g', 'o', 'N')
-typedef struct {
-  UINT64                      Signature;
-
-  EFI_HANDLE                  Handle;
-  EFI_UGA_DRAW_PROTOCOL       UgaDraw;
-  EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;
-  EFI_SIMPLE_POINTER_PROTOCOL SimplePointer;
-
-  EFI_UNIX_THUNK_PROTOCOL   *UnixThunk;
-
-  EFI_UNICODE_STRING_TABLE    *ControllerNameTable;
-
-  //
-  // UGA Private Data for GetMode ()
-  //
-  UINT32                      HorizontalResolution;
-  UINT32                      VerticalResolution;
-  UINT32                      ColorDepth;
-  UINT32                      RefreshRate;
-
-  EFI_SIMPLE_POINTER_MODE     PointerMode;
-
-  //
-  // UGA Private Data knowing when to start hardware
-  //
-  BOOLEAN                     HardwareNeedsStarting;
-
-  CHAR16                      *WindowName;
-
-  EFI_UNIX_UGA_IO_PROTOCOL    *UgaIo;
-
-} UGA_PRIVATE_DATA;
-
-#define UGA_DRAW_PRIVATE_DATA_FROM_THIS(a)  \
-         CR(a, UGA_PRIVATE_DATA, UgaDraw, UGA_PRIVATE_DATA_SIGNATURE)
-
-#define UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS(a)  \
-         CR(a, UGA_PRIVATE_DATA, SimpleTextIn, UGA_PRIVATE_DATA_SIGNATURE)
-
-#define UGA_PRIVATE_DATA_FROM_POINTER_THIS(a)  \
-         CR(a, UGA_PRIVATE_DATA, SimplePointer, UGA_PRIVATE_DATA_SIGNATURE)
-
-//
-// Global Protocol Variables
-//
-extern EFI_DRIVER_BINDING_PROTOCOL  gUnixUgaDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL  gUnixUgaComponentName;
-
-//
-// Uga Hardware abstraction internal worker functions
-//
-EFI_STATUS
-UnixUgaSupported (
-  IN  EFI_UNIX_IO_PROTOCOL  *UnixIo
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  UnixIo - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaConstructor (
-  IN  UGA_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaDestructor (
-  IN  UGA_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-//
-// EFI 1.1 driver model prototypes for Win UNIX UGA
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaInitialize (
-  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
-UnixUgaDriverBindingSupported (
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
-  IN  EFI_HANDLE                      Handle,
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This                - TODO: add argument description
-  Handle              - TODO: add argument description
-  RemainingDevicePath - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingStart (
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,
-  IN  EFI_HANDLE                      Handle,
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This                - TODO: add argument description
-  Handle              - TODO: add argument description
-  RemainingDevicePath - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingStop (
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,
-  IN  EFI_HANDLE                   Handle,
-  IN  UINTN                        NumberOfChildren,
-  IN  EFI_HANDLE                   *ChildHandleBuffer
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This              - TODO: add argument description
-  Handle            - TODO: add argument description
-  NumberOfChildren  - TODO: add argument description
-  ChildHandleBuffer - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UgaPrivateAddQ (
-  IN  UGA_PRIVATE_DATA    *Private,
-  IN  EFI_INPUT_KEY       Key
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-  Key     - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaInitializeSimpleTextInForWindow (
-  IN  UGA_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaInitializeSimplePointerForWindow (
-  IN  UGA_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-;
-#endif
diff --git a/UnixPkg/UnixUgaDxe/UnixUga.inf b/UnixPkg/UnixUgaDxe/UnixUga.inf
deleted file mode 100644 (file)
index 5cba658..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-## @file\r
-# Uga driver\r
-#\r
-# UGA is short hand for Universal Graphics Abstraction protocol.\r
-#  This file is a verision of UgaIo the uses UnixThunk system calls as an IO\r
-#  abstraction. For a PCI device UnixIo would be replaced with\r
-#  a PCI IO abstraction that abstracted a specific PCI device.\r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-##\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UnixUga\r
-  FILE_GUID                      = f33cad86-8985-11db-8040-0040d02b1835\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InitializeUnixUga\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-#  DRIVER_BINDING                =  gUnixUgaDriverBinding                        \r
-#  COMPONENT_NAME                =  gUnixUgaComponentName                        \r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  UnixUgaScreen.c\r
-  UnixUgaDriver.c\r
-  UnixUgaInput.c\r
-  UnixUga.h\r
-  EntryPoint.c\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  UnixPkg/UnixPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  UefiLib\r
-  UefiDriverEntryPoint\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiEventExitBootServicesGuid                 # SOMETIMES_CONSUMED  Create Event: EVENT_GROUP_GUID\r
-  gEfiUnixUgaGuid                              # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gEfiSimpleTextInProtocolGuid                  # PROTOCOL BY_START\r
-  gEfiSimplePointerProtocolGuid                 # PROTOCOL BY_START\r
-  gEfiUnixUgaIoProtocolGuid                     # PROTOCOL BY_START\r
-  gEfiUgaDrawProtocolGuid                       # PROTOCOL BY_START\r
-  gEfiUnixIoProtocolGuid                        # PROTOCOL TO_START\r
-\r
diff --git a/UnixPkg/UnixUgaDxe/UnixUgaDriver.c b/UnixPkg/UnixUgaDxe/UnixUgaDriver.c
deleted file mode 100644 (file)
index 99aa115..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  UnixUgaDriver.c\r
-\r
-Abstract:\r
-\r
-  This file implements the EFI 1.1 Device Driver model requirements for UGA\r
-\r
-  UGA is short hand for Universal Graphics Abstraction protocol.\r
-\r
-  This file is a verision of UgaIo the uses UnixThunk system calls as an IO \r
-  abstraction. For a PCI device UnixIo would be replaced with\r
-  a PCI IO abstraction that abstracted a specific PCI device. \r
-\r
---*/\r
-\r
-#include "UnixUga.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gUnixUgaDriverBinding = {\r
-  UnixUgaDriverBindingSupported,\r
-  UnixUgaDriverBindingStart,\r
-  UnixUgaDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixUgaDriverBindingSupported (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-\r
-  //\r
-  // Open the IO Abstraction(s) needed to perform the supported test\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID **)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = UnixUgaSupported (UnixIo);\r
-\r
-  //\r
-  // Close the I/O Abstraction(s) used to perform the supported test\r
-  //\r
-  gBS->CloseProtocol (\r
-        Handle,\r
-        &gEfiUnixIoProtocolGuid,\r
-        This->DriverBindingHandle,\r
-        Handle\r
-        );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixUgaDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
-  IN  EFI_HANDLE                      Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL        *RemainingDevicePath\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    RemainingDevicePath - add argument and description to function comment\r
-// TODO:    EFI_UNSUPPORTED - add return value to function comment\r
-{\r
-  EFI_UNIX_IO_PROTOCOL  *UnixIo;\r
-  EFI_STATUS              Status;\r
-  UGA_PRIVATE_DATA        *Private;\r
-\r
-  //\r
-  // Grab the protocols we need\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (VOID **)&UnixIo,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Allocate Private context data for SGO inteface.\r
-  //\r
-  Private = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (UGA_PRIVATE_DATA),\r
-                  (VOID **)&Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Set up context record\r
-  //\r
-  Private->Signature            = UGA_PRIVATE_DATA_SIGNATURE;\r
-  Private->Handle               = Handle;\r
-  Private->UnixThunk           = UnixIo->UnixThunk;\r
-\r
-  Private->ControllerNameTable  = NULL;\r
-\r
-  AddUnicodeString (\r
-    "eng",\r
-    gUnixUgaComponentName.SupportedLanguages,\r
-    &Private->ControllerNameTable,\r
-    UnixIo->EnvString\r
-    );\r
-\r
-  Private->WindowName = UnixIo->EnvString;\r
-\r
-  Status              = UnixUgaConstructor (Private);\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Publish the Uga interface to the world\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Private->Handle,\r
-                  &gEfiUgaDrawProtocolGuid,\r
-                  &Private->UgaDraw,\r
-                  &gEfiSimpleTextInProtocolGuid,\r
-                  &Private->SimpleTextIn,\r
-                  &gEfiSimplePointerProtocolGuid,\r
-                  &Private->SimplePointer,\r
-                  NULL\r
-                  );\r
-\r
-Done:\r
-  if (EFI_ERROR (Status)) {\r
-\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-\r
-    if (Private != NULL) {\r
-      //\r
-      // On Error Free back private data\r
-      //\r
-      if (Private->ControllerNameTable != NULL) {\r
-        FreeUnicodeStringTable (Private->ControllerNameTable);\r
-      }\r
-\r
-      gBS->FreePool (Private);\r
-    }\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixUgaDriverBindingStop (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
-  IN  EFI_HANDLE                   Handle,\r
-  IN  UINTN                        NumberOfChildren,\r
-  IN  EFI_HANDLE                   *ChildHandleBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    Handle - add argument and description to function comment\r
-// TODO:    NumberOfChildren - add argument and description to function comment\r
-// TODO:    ChildHandleBuffer - add argument and description to function comment\r
-// TODO:    EFI_NOT_STARTED - add return value to function comment\r
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment\r
-{\r
-  EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r
-  EFI_STATUS            Status;\r
-  UGA_PRIVATE_DATA      *Private;\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  Handle,\r
-                  &gEfiUgaDrawProtocolGuid,\r
-                  (VOID **)&UgaDraw,\r
-                  This->DriverBindingHandle,\r
-                  Handle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // If the UGA interface does not exist the driver is not started\r
-    //\r
-    return EFI_NOT_STARTED;\r
-  }\r
-\r
-  //\r
-  // Get our private context information\r
-  //\r
-  Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (UgaDraw);\r
-\r
-  //\r
-  // Remove the SGO interface from the system\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  Private->Handle,\r
-                  &gEfiUgaDrawProtocolGuid,\r
-                  &Private->UgaDraw,\r
-                  &gEfiSimpleTextInProtocolGuid,\r
-                  &Private->SimpleTextIn,\r
-                  &gEfiSimplePointerProtocolGuid,\r
-                  &Private->SimplePointer,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Shutdown the hardware\r
-    //\r
-    Status = UnixUgaDestructor (Private);\r
-    if (EFI_ERROR (Status)) {\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-\r
-    gBS->CloseProtocol (\r
-          Handle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          Handle\r
-          );\r
-\r
-    //\r
-    // Free our instance data\r
-    //\r
-    FreeUnicodeStringTable (Private->ControllerNameTable);\r
-\r
-    gBS->FreePool (Private);\r
-\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
diff --git a/UnixPkg/UnixUgaDxe/UnixUgaInput.c b/UnixPkg/UnixUgaDxe/UnixUgaInput.c
deleted file mode 100644 (file)
index be38379..0000000
+++ /dev/null
@@ -1,418 +0,0 @@
-/*++
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-  UnixUgaInput.c
-
-Abstract:
-
-  This file produces the Simple Text In for an Uga window.
-
-  This stuff is linked at the hip to the Window, since the window
-  processing is done in a thread kicked off in UnixUgaImplementation.c
-
-  Since the window information is processed in an other thread we need
-  a keyboard Queue to pass data about. The Simple Text In code just
-  takes data off the Queue. The WinProc message loop takes keyboard input
-  and places it in the Queue.
-
---*/
-
-#include "UnixUga.h"
-
-//
-// Simple Text In implementation.
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimpleTextInReset (
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,
-  IN BOOLEAN                              ExtendedVerification
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This                  - TODO: add argument description
-  ExtendedVerification  - TODO: add argument description
-
-Returns:
-
-  EFI_SUCCESS - TODO: Add description for return value
-
---*/
-{
-  UGA_PRIVATE_DATA  *Private;
-  EFI_KEY_DATA      Key;
-  EFI_TPL           OldTpl;
-
-  Private = UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_SUCCESS;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
-  //
-  // A reset is draining the Queue
-  //
-  while (Private->UgaIo->UgaGetKey (Private->UgaIo, &Key) == EFI_SUCCESS)
-    ;
-
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-  return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimpleTextInReadKeyStroke (
-  IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,
-  OUT EFI_INPUT_KEY                          *Key
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This  - TODO: add argument description
-  Key   - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-{
-  UGA_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-  EFI_KEY_DATA      KeyData;
-  
-  Private = UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_NOT_READY;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaGetKey(Private->UgaIo, &KeyData);
-  CopyMem (Key, &KeyData, sizeof (EFI_INPUT_KEY));
-  
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-
-  return Status;
-}
-
-VOID
-EFIAPI
-UnixUgaSimpleTextInWaitForKey (
-  IN EFI_EVENT          Event,
-  IN VOID               *Context
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Event   - TODO: add argument description
-  Context - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-{
-  UGA_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-
-  Private = (UGA_PRIVATE_DATA *) Context;
-  if (Private->UgaIo == NULL) {
-    return;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaCheckKey(Private->UgaIo);
-  if (!EFI_ERROR (Status)) {
-    //
-    // If a there is a key in the queue signal our event.
-    //
-    gBS->SignalEvent (Event);
-  }
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-}
-
-//
-// Simple Pointer implementation.
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimplePointerReset (
-  IN EFI_SIMPLE_POINTER_PROTOCOL          *This,
-  IN BOOLEAN                              ExtendedVerification
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This                  - TODO: add argument description
-  ExtendedVerification  - TODO: add argument description
-
-Returns:
-
-  EFI_SUCCESS - TODO: Add description for return value
-
---*/
-{
-  UGA_PRIVATE_DATA             *Private;
-  EFI_SIMPLE_POINTER_STATE     State;
-  EFI_TPL                      OldTpl;
-
-  Private = UGA_PRIVATE_DATA_FROM_POINTER_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_SUCCESS;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
-  //
-  // A reset is draining the Queue
-  //
-  while (Private->UgaIo->UgaGetPointerState(Private->UgaIo, &State) == EFI_SUCCESS)
-    ;
-
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-  return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimplePointerGetState (
-  IN EFI_SIMPLE_POINTER_PROTOCOL          *This,
-  IN OUT EFI_SIMPLE_POINTER_STATE         *State
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  This  - TODO: add argument description
-  Key   - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-{
-  UGA_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-
-  Private = UGA_PRIVATE_DATA_FROM_POINTER_THIS (This);
-  if (Private->UgaIo == NULL) {
-    return EFI_NOT_READY;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaGetPointerState(Private->UgaIo, State);
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-
-  return Status;
-}
-
-VOID
-EFIAPI
-UnixUgaSimplePointerWaitForInput (
-  IN EFI_EVENT          Event,
-  IN VOID               *Context
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Event   - TODO: add argument description
-  Context - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-{
-  UGA_PRIVATE_DATA  *Private;
-  EFI_STATUS        Status;
-  EFI_TPL           OldTpl;
-
-  Private = (UGA_PRIVATE_DATA *) Context;
-  if (Private->UgaIo == NULL) {
-    return;
-  }
-
-  //
-  // Enter critical section
-  //
-  OldTpl  = gBS->RaiseTPL (TPL_NOTIFY);
-
-  Status  = Private->UgaIo->UgaCheckPointer(Private->UgaIo);
-  if (!EFI_ERROR (Status)) {
-    //
-    // If the pointer state has changed, signal our event.
-    //
-    gBS->SignalEvent (Event);
-  }
-  //
-  // Leave critical section and return
-  //
-  gBS->RestoreTPL (OldTpl);
-}
-
-EFI_STATUS
-UnixUgaInitializeSimpleTextInForWindow (
-  IN  UGA_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-{
-  EFI_STATUS  Status;
-
-  //
-  // Initialize Simple Text In protoocol
-  //
-  Private->SimpleTextIn.Reset         = UnixUgaSimpleTextInReset;
-  Private->SimpleTextIn.ReadKeyStroke = UnixUgaSimpleTextInReadKeyStroke;
-
-  Status = gBS->CreateEvent (
-                  EVT_NOTIFY_WAIT,
-                  TPL_NOTIFY,
-                  UnixUgaSimpleTextInWaitForKey,
-                  Private,
-                  &Private->SimpleTextIn.WaitForKey
-                  );
-
-  return Status;
-}
-
-EFI_STATUS
-UnixUgaInitializeSimplePointerForWindow (
-  IN  UGA_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-{
-  EFI_STATUS  Status;
-
-  //
-  // Initialize Simple Pointer protoocol
-  //
-  Private->PointerMode.ResolutionX = 1;
-  Private->PointerMode.ResolutionY = 1;
-  Private->PointerMode.LeftButton  = TRUE;
-  Private->PointerMode.RightButton = TRUE;
-
-  Private->SimplePointer.Reset     = UnixUgaSimplePointerReset;
-  Private->SimplePointer.GetState  = UnixUgaSimplePointerGetState;
-  Private->SimplePointer.Mode      = &Private->PointerMode;
-
-  Status = gBS->CreateEvent (
-                  EVT_NOTIFY_WAIT,
-                  TPL_NOTIFY,
-                  UnixUgaSimplePointerWaitForInput,
-                  Private,
-                  &Private->SimplePointer.WaitForInput
-                  );
-
-  return Status;
-}
diff --git a/UnixPkg/UnixUgaDxe/UnixUgaScreen.c b/UnixPkg/UnixUgaDxe/UnixUgaScreen.c
deleted file mode 100644 (file)
index 470a788..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-    UnixUgaScreen.c
-
-Abstract:
-
-  This file produces the graphics abstration of UGA. It is called by
-  UnixUgaDriver.c file which deals with the EFI 1.1 driver model.
-  This file just does graphics.
-
---*/
-
-#include "UnixUga.h"
-
-EFI_UNIX_THUNK_PROTOCOL *mUnix;
-EFI_EVENT          mUgaScreenExitBootServicesEvent;
-
-EFI_STATUS
-UnixUgaStartWindow (
-  IN  UGA_PRIVATE_DATA    *Private,
-  IN  UINT32              HorizontalResolution,
-  IN  UINT32              VerticalResolution,
-  IN  UINT32              ColorDepth,
-  IN  UINT32              RefreshRate
-  );
-
-VOID
-EFIAPI
-KillNtUgaThread (
-  IN EFI_EVENT  Event,
-  IN VOID       *Context
-  );
-
-//
-// UGA Protocol Member Functions
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaGetMode (
-  EFI_UGA_DRAW_PROTOCOL *This,
-  UINT32                *HorizontalResolution,
-  UINT32                *VerticalResolution,
-  UINT32                *ColorDepth,
-  UINT32                *RefreshRate
-  )
-/*++
-
-  Routine Description:
-    Return the current video mode information.
-
-  Arguments:
-    This                  - Protocol instance pointer.
-    HorizontalResolution  - Current video horizontal resolution in pixels
-    VerticalResolution    - Current video Vertical resolution in pixels
-    ColorDepth            - Current video color depth in bits per pixel
-    RefreshRate           - Current video refresh rate in Hz.
-
-  Returns:
-    EFI_SUCCESS     - Mode information returned.
-    EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
-    EFI_INVALID_PARAMETER - One of the input args was NULL.
-
---*/
-// TODO:    ADD IN/OUT description here
-{
-  UGA_PRIVATE_DATA  *Private;
-
-  Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (This);
-
-  if (Private->HardwareNeedsStarting) {
-    return EFI_NOT_STARTED;
-  }
-
-  if ((HorizontalResolution == NULL) ||
-      (VerticalResolution   == NULL) ||
-      (ColorDepth           == NULL) ||
-      (RefreshRate          == NULL)) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  *HorizontalResolution = Private->HorizontalResolution;
-  *VerticalResolution   = Private->VerticalResolution;
-  *ColorDepth           = Private->ColorDepth;
-  *RefreshRate          = Private->RefreshRate;
-  return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaSetMode (
-  EFI_UGA_DRAW_PROTOCOL *This,
-  UINT32                HorizontalResolution,
-  UINT32                VerticalResolution,
-  UINT32                ColorDepth,
-  UINT32                RefreshRate
-  )
-/*++
-
-  Routine Description:
-    Return the current video mode information.
-
-  Arguments:
-    This                  - Protocol instance pointer.
-    HorizontalResolution  - Current video horizontal resolution in pixels
-    VerticalResolution    - Current video Vertical resolution in pixels
-    ColorDepth            - Current video color depth in bits per pixel
-    RefreshRate           - Current video refresh rate in Hz.
-
-  Returns:
-    EFI_SUCCESS     - Mode information returned.
-    EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
-    EFI_INVALID_PARAMETER - One of the input args was NULL.
-
---*/
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment
-// TODO:    EFI_DEVICE_ERROR - add return value to function comment
-// TODO:    ADD IN/OUT description here
-{
-  EFI_STATUS        Status;
-  UGA_PRIVATE_DATA  *Private;
-  EFI_UGA_PIXEL     Fill;
-
-  Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (This);
-
-  if (Private->HardwareNeedsStarting) {
-    Status = UnixUgaStartWindow (
-              Private,
-              HorizontalResolution,
-              VerticalResolution,
-              ColorDepth,
-              RefreshRate
-              );
-    if (EFI_ERROR (Status)) {
-      return EFI_DEVICE_ERROR;
-    }
-
-    Private->HardwareNeedsStarting = FALSE;
-  }
-  Status = Private->UgaIo->UgaSize(Private->UgaIo,
-             HorizontalResolution,
-             VerticalResolution);
-
-  Private->HorizontalResolution = HorizontalResolution;
-  Private->VerticalResolution   = VerticalResolution;
-  Private->ColorDepth           = ColorDepth;
-  Private->RefreshRate          = RefreshRate;
-
-  Fill.Red                      = 0x7f;
-  Fill.Green                    = 0x7F;
-  Fill.Blue                     = 0x7f;
-  This->Blt (
-          This,
-          &Fill,
-          EfiUgaVideoFill,
-          0,
-          0,
-          0,
-          0,
-          HorizontalResolution,
-          VerticalResolution,
-          HorizontalResolution * sizeof (EFI_UGA_PIXEL)
-          );
-  return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaBlt (
-  IN  EFI_UGA_DRAW_PROTOCOL                   *This,
-  IN  EFI_UGA_PIXEL                           *BltBuffer, OPTIONAL
-  IN  EFI_UGA_BLT_OPERATION                   BltOperation,
-  IN  UINTN                                   SourceX,
-  IN  UINTN                                   SourceY,
-  IN  UINTN                                   DestinationX,
-  IN  UINTN                                   DestinationY,
-  IN  UINTN                                   Width,
-  IN  UINTN                                   Height,
-  IN  UINTN                                   Delta         OPTIONAL
-  )
-/*++
-
-  Routine Description:
-    Blt pixels from the rectangle (Width X Height) formed by the BltBuffer
-    onto the graphics screen starting a location (X, Y). (0, 0) is defined as
-    the upper left hand side of the screen. (X, Y) can be outside of the
-    current screen geometry and the BltBuffer will be cliped when it is
-    displayed. X and Y can be negative or positive. If Width or Height is
-    bigger than the current video screen the image will be clipped.
-
-  Arguments:
-    This          - Protocol instance pointer.
-    X             - X location on graphics screen.
-    Y             - Y location on the graphics screen.
-    Width         - Width of BltBuffer.
-    Height        - Hight of BltBuffer
-    BltOperation  - Operation to perform on BltBuffer and video memory
-    BltBuffer     - Buffer containing data to blt into video buffer. This
-                    buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
-    SourceX       - If the BltOperation is a EfiCopyBlt this is the source
-                    of the copy. For other BLT operations this argument is not
-                    used.
-    SourceX       - If the BltOperation is a EfiCopyBlt this is the source
-                    of the copy. For other BLT operations this argument is not
-                    used.
-
-  Returns:
-    EFI_SUCCESS           - The palette is updated with PaletteArray.
-    EFI_INVALID_PARAMETER - BltOperation is not valid.
-    EFI_DEVICE_ERROR      - A hardware error occured writting to the video
-                             buffer.
-
---*/
-// TODO:    SourceY - add argument and description to function comment
-// TODO:    DestinationX - add argument and description to function comment
-// TODO:    DestinationY - add argument and description to function comment
-// TODO:    Delta - add argument and description to function comment
-{
-  UGA_PRIVATE_DATA  *Private;
-  EFI_TPL           OriginalTPL;
-  EFI_STATUS        Status;
-  UGA_BLT_ARGS      UgaBltArgs;
-
-  Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (This);
-
-  if ((BltOperation < 0) || (BltOperation >= EfiUgaBltMax)) {
-    return EFI_INVALID_PARAMETER;
-  }
-
-  if (Width == 0 || Height == 0) {
-    return EFI_INVALID_PARAMETER;
-  }
-  //
-  // If Delta is zero, then the entire BltBuffer is being used, so Delta
-  // is the number of bytes in each row of BltBuffer.  Since BltBuffer is Width pixels size,
-  // the number of bytes in each row can be computed.
-  //
-  if (Delta == 0) {
-    Delta = Width * sizeof (EFI_UGA_PIXEL);
-  }
-
-  //
-  // We have to raise to TPL Notify, so we make an atomic write the frame buffer.
-  // We would not want a timer based event (Cursor, ...) to come in while we are
-  // doing this operation.
-  //
-  OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
-
-  //
-  // Pack UGA Draw protocol parameters to UGA_BLT_ARGS structure to adapt to
-  // UgaBlt() API of Unix UGA IO protocol.
-  //
-  UgaBltArgs.DestinationX = DestinationX;
-  UgaBltArgs.DestinationY = DestinationY;
-  UgaBltArgs.Height       = Height;
-  UgaBltArgs.Width        = Width;
-  UgaBltArgs.SourceX      = SourceX;
-  UgaBltArgs.SourceY      = SourceY;
-  UgaBltArgs.Delta        = Delta;
-  Status = Private->UgaIo->UgaBlt (Private->UgaIo,
-             BltBuffer,
-             BltOperation,
-             &UgaBltArgs
-             );
-
-  gBS->RestoreTPL (OriginalTPL);
-
-  return Status;
-}
-
-
-//
-// Construction and Destruction functions
-//
-
-EFI_STATUS
-UnixUgaSupported (
-  IN  EFI_UNIX_IO_PROTOCOL  *UnixIo
-  )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
-  None
-
---*/
-// TODO:    UnixIo - add argument and description to function comment
-// TODO:    EFI_UNSUPPORTED - add return value to function comment
-// TODO:    EFI_SUCCESS - add return value to function comment
-{
-  //
-  // Check to see if the IO abstraction represents a device type we support.
-  //
-  // This would be replaced a check of PCI subsystem ID, etc.
-  //
-  if (!CompareGuid (UnixIo->TypeGuid, &gEfiUnixUgaGuid)) {
-    return EFI_UNSUPPORTED;
-  }
-
-  return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-UnixUgaStartWindow (
-  IN  UGA_PRIVATE_DATA    *Private,
-  IN  UINT32              HorizontalResolution,
-  IN  UINT32              VerticalResolution,
-  IN  UINT32              ColorDepth,
-  IN  UINT32              RefreshRate
-  )
-/*++
-
-Routine Description:
-
-  TODO: Add function description
-
-Arguments:
-
-  Private               - TODO: add argument description
-  HorizontalResolution  - TODO: add argument description
-  VerticalResolution    - TODO: add argument description
-  ColorDepth            - TODO: add argument description
-  RefreshRate           - TODO: add argument description
-
-Returns:
-
-  TODO: add return values
-
---*/
-{
-  EFI_STATUS          Status;
-
-  mUnix  = Private->UnixThunk;
-
-  Private->HorizontalResolution = HorizontalResolution;
-  Private->VerticalResolution   = VerticalResolution;
-
-  //
-  // Register to be notified on exit boot services so we can destroy the window.
-  //
-  Status = gBS->CreateEvent (
-                  EVT_SIGNAL_EXIT_BOOT_SERVICES,
-                  TPL_CALLBACK,
-                  KillNtUgaThread,
-                  Private,
-                  &mUgaScreenExitBootServicesEvent
-                  );
-
-  Status = Private->UnixThunk->UgaCreate(&Private->UgaIo, Private->WindowName);
-  return Status;
-}
-
-EFI_STATUS
-UnixUgaConstructor (
-  UGA_PRIVATE_DATA    *Private
-  )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
-  None
-
---*/
-// TODO:    Private - add argument and description to function comment
-// TODO:    EFI_SUCCESS - add return value to function comment
-{
-
-  Private->UgaDraw.GetMode        = UnixUgaGetMode;
-  Private->UgaDraw.SetMode        = UnixUgaSetMode;
-  Private->UgaDraw.Blt            = UnixUgaBlt;
-
-  Private->HardwareNeedsStarting  = TRUE;
-  Private->UgaIo = NULL;
-
-  UnixUgaInitializeSimpleTextInForWindow (Private);
-
-  UnixUgaInitializeSimplePointerForWindow (Private);
-
-  return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UnixUgaDestructor (
-  UGA_PRIVATE_DATA     *Private
-  )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
-  None
-
---*/
-// TODO:    Private - add argument and description to function comment
-// TODO:    EFI_SUCCESS - add return value to function comment
-{
-  if (!Private->HardwareNeedsStarting) {
-    Private->UgaIo->UgaClose(Private->UgaIo);
-    Private->UgaIo = NULL;
-  }
-
-  return EFI_SUCCESS;
-}
-
-VOID
-EFIAPI
-KillNtUgaThread (
-  IN EFI_EVENT  Event,
-  IN VOID       *Context
-  )
-/*++
-
-Routine Description:
-
-  This is the UGA screen's callback notification function for exit-boot-services.
-  All we do here is call UnixUgaDestructor().
-
-Arguments:
-
-  Event   - not used
-  Context - pointer to the Private structure.
-
-Returns:
-
-  None.
-
---*/
-{
-  EFI_STATUS  Status;
-  Status = UnixUgaDestructor (Context);
-}
diff --git a/UnixPkg/Xcode/xcode_project/XcodeBuild.sh b/UnixPkg/Xcode/xcode_project/XcodeBuild.sh
deleted file mode 100755 (executable)
index 453aac1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-#
-# External makefile Xcode project project uses this script to build and clean from the Xcode GUI
-#
-
-# force exit on error
-set -e
-
-#
-# Source the workspace and set up the environment variables we need
-#
-cd ../..
-./build.sh $1 $2 $3 $4 $5 $6 $8
diff --git a/UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj/default.pbxuser b/UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj/default.pbxuser
deleted file mode 100644 (file)
index f3db667..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-// !$*UTF8*$!
-{
-       08FB7793FE84155DC02AAC07 /* Project object */ = {
-               activeBuildConfigurationName = Debug;
-               activeExecutable = BA11A1010FB10BCE00D06FEC /* SecMain.dll */;
-               activeTarget = D28A88AD04BDD90700651E21 /* xcode_project */;
-               breakpoints = (
-                       BA11A11A0FB10E0700D06FEC /* SecGdbScriptBreak */,
-               );
-               codeSenseManager = BA11A0FE0FB10B4800D06FEC /* Code sense */;
-               executables = (
-                       BA11A1010FB10BCE00D06FEC /* SecMain.dll */,
-               );
-               perUserDictionary = {
-                       "PBXConfiguration.PBXBreakpointsDataSource.v1:1CA1AED706398EBD00589147" = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       20,
-                                       20,
-                                       198,
-                                       20,
-                                       99,
-                                       99,
-                                       29,
-                                       20,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXBreakpointsDataSource_ActionID,
-                                       PBXBreakpointsDataSource_TypeID,
-                                       PBXBreakpointsDataSource_BreakpointID,
-                                       PBXBreakpointsDataSource_UseID,
-                                       PBXBreakpointsDataSource_LocationID,
-                                       PBXBreakpointsDataSource_ConditionID,
-                                       PBXBreakpointsDataSource_IgnoreCountID,
-                                       PBXBreakpointsDataSource_ContinueID,
-                               );
-                       };
-                       PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       22,
-                                       300,
-                                       229,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXExecutablesDataSource_ActiveFlagID,
-                                       PBXExecutablesDataSource_NameID,
-                                       PBXExecutablesDataSource_CommentsID,
-                               );
-                       };
-                       PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       20,
-                                       341,
-                                       20,
-                                       48,
-                                       43,
-                                       43,
-                                       20,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXFileDataSource_FiletypeID,
-                                       PBXFileDataSource_Filename_ColumnID,
-                                       PBXFileDataSource_Built_ColumnID,
-                                       PBXFileDataSource_ObjectSize_ColumnID,
-                                       PBXFileDataSource_Errors_ColumnID,
-                                       PBXFileDataSource_Warnings_ColumnID,
-                                       PBXFileDataSource_Target_ColumnID,
-                               );
-                       };
-                       PBXPerProjectTemplateStateSaveDate = 263260969;
-                       PBXWorkspaceStateSaveDate = 263260969;
-               };
-               sourceControlManager = BA11A0FD0FB10B4800D06FEC /* Source Control */;
-               userBuildSettings = {
-               };
-       };
-       BA11A0FD0FB10B4800D06FEC /* Source Control */ = {
-               isa = PBXSourceControlManager;
-               fallbackIsa = XCSourceControlManager;
-               isSCMEnabled = 0;
-               repositoryNamesForRoots = {
-               };
-               scmConfiguration = {
-               };
-       };
-       BA11A0FE0FB10B4800D06FEC /* Code sense */ = {
-               isa = PBXCodeSenseManager;
-               indexTemplatePath = "";
-       };
-       BA11A1010FB10BCE00D06FEC /* SecMain.dll */ = {
-               isa = PBXExecutable;
-               activeArgIndices = (
-               );
-               argumentStrings = (
-               );
-               autoAttachOnCrash = 1;
-               breakpointsEnabled = 1;
-               configStateDict = {
-                       "PBXLSLaunchAction-0" = {
-                               PBXLSLaunchAction = 0;
-                               PBXLSLaunchStartAction = 1;
-                               PBXLSLaunchStdioStyle = 2;
-                               PBXLSLaunchStyle = 0;
-                               class = PBXLSRunLaunchConfig;
-                               commandLineArgs = (
-                               );
-                               displayName = "Executable Runner";
-                               environment = {
-                               };
-                               identifier = com.apple.Xcode.launch.runConfig;
-                               remoteHostInfo = "";
-                               startActionInfo = "";
-                       };
-                       "PBXLSLaunchAction-1" = {
-                               PBXLSLaunchAction = 1;
-                               PBXLSLaunchStartAction = 1;
-                               PBXLSLaunchStdioStyle = 2;
-                               PBXLSLaunchStyle = 0;
-                               class = PBXGDB_LaunchConfig;
-                               commandLineArgs = (
-                               );
-                               displayName = GDB;
-                               environment = {
-                               };
-                               identifier = com.apple.Xcode.launch.GDBMI_Config;
-                               remoteHostInfo = "";
-                               startActionInfo = "";
-                       };
-               };
-               customDataFormattersEnabled = 0;
-               dataTipCustomDataFormattersEnabled = 1;
-               dataTipShowTypeColumn = 1;
-               dataTipSortType = 0;
-               debuggerPlugin = GDBDebugging;
-               disassemblyDisplayState = 0;
-               dylibVariantSuffix = "";
-               enableDebugStr = 1;
-               environmentEntries = (
-               );
-               executableSystemSymbolLevel = 0;
-               executableUserSymbolLevel = 0;
-               launchableReference = BA11A1020FB10BCE00D06FEC /* SecMain.dll */;
-               libgmallocEnabled = 0;
-               name = SecMain.dll;
-               savedGlobals = {
-               };
-               showTypeColumn = 0;
-               sourceDirectories = (
-               );
-               startupPath = ../../../Build/Unix/DEBUG_XCODE32/IA32;
-       };
-       BA11A1020FB10BCE00D06FEC /* SecMain.dll */ = {
-               isa = PBXFileReference;
-               lastKnownFileType = "compiled.mach-o.executable";
-               name = SecMain.dll;
-               path = ../../../Build/Unix/DEBUG_XCODE32/IA32/SecMain;
-               sourceTree = SOURCE_ROOT;
-       };
-       BA11A11A0FB10E0700D06FEC /* SecGdbScriptBreak */ = {
-               isa = PBXSymbolicBreakpoint;
-               actions = (
-                       BA11A11E0FB10E2200D06FEC /* XCBreakpointCommandAction */,
-               );
-               breakpointStyle = 1;
-               continueAfterActions = 1;
-               countType = 0;
-               delayBeforeContinue = 0;
-               hitCount = 0;
-               ignoreCount = 0;
-               location = SecMain;
-               modificationTime = 263261853.260195;
-               originalNumberOfMultipleMatches = 1;
-               state = 1;
-               symbolName = SecGdbScriptBreak;
-       };
-       BA11A11E0FB10E2200D06FEC /* XCBreakpointCommandAction */ = {
-               isa = XCBreakpointCommandAction;
-               command = "source SecMain.gdb";
-               fallbackIsa = XCBreakpointAction;
-               logCommand = 0;
-               useDebuggerSideImplementation = 1;
-       };
-       D28A88AD04BDD90700651E21 /* xcode_project */ = {
-               activeExec = 0;
-       };
-}
diff --git a/UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj/project.pbxproj b/UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj/project.pbxproj
deleted file mode 100644 (file)
index 87eb84d..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-// !$*UTF8*$!
-{
-       archiveVersion = 1;
-       classes = {
-       };
-       objectVersion = 45;
-       objects = {
-
-/* Begin PBXGroup section */
-               08FB7794FE84155DC02AAC07 /* xcode_project */ = {
-                       isa = PBXGroup;
-                       children = (
-                       );
-                       name = xcode_project;
-                       sourceTree = "<group>";
-               };
-/* End PBXGroup section */
-
-/* Begin PBXLegacyTarget section */
-               D28A88AD04BDD90700651E21 /* xcode_project */ = {
-                       isa = PBXLegacyTarget;
-                       buildArgumentsString = "$(ACTION)";
-                       buildConfigurationList = 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "xcode_project" */;
-                       buildPhases = (
-                       );
-                       buildToolPath = ./XcodeBuild.sh;
-                       buildWorkingDirectory = "";
-                       dependencies = (
-                       );
-                       name = xcode_project;
-                       passBuildSettingsInEnvironment = 1;
-                       productName = xcode_project;
-               };
-/* End PBXLegacyTarget section */
-
-/* Begin PBXProject section */
-               08FB7793FE84155DC02AAC07 /* Project object */ = {
-                       isa = PBXProject;
-                       buildConfigurationList = 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "xcode_project" */;
-                       compatibilityVersion = "Xcode 3.1";
-                       hasScannedForEncodings = 1;
-                       mainGroup = 08FB7794FE84155DC02AAC07 /* xcode_project */;
-                       projectDirPath = "";
-                       projectRoot = "";
-                       targets = (
-                               D28A88AD04BDD90700651E21 /* xcode_project */,
-                       );
-               };
-/* End PBXProject section */
-
-/* Begin XCBuildConfiguration section */
-               1DEB919008733D9F0010E9CD /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               PRODUCT_NAME = xcode_project;
-                       };
-                       name = Debug;
-               };
-               1DEB919108733D9F0010E9CD /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               PRODUCT_NAME = xcode_project;
-                       };
-                       name = Release;
-               };
-               1DEB919408733D9F0010E9CD /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               ONLY_ACTIVE_ARCH = YES;
-                               PREBINDING = NO;
-                               SDKROOT = macosx10.6;
-                       };
-                       name = Debug;
-               };
-               1DEB919508733D9F0010E9CD /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               PREBINDING = NO;
-                               SDKROOT = macosx10.6;
-                       };
-                       name = Release;
-               };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-               1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "xcode_project" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               1DEB919008733D9F0010E9CD /* Debug */,
-                               1DEB919108733D9F0010E9CD /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "xcode_project" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               1DEB919408733D9F0010E9CD /* Debug */,
-                               1DEB919508733D9F0010E9CD /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-/* End XCConfigurationList section */
-       };
-       rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/UnixPkg/Xcode/xcode_project64/XcodeBuild.sh b/UnixPkg/Xcode/xcode_project64/XcodeBuild.sh
deleted file mode 100755 (executable)
index 0ccda8f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-#
-# External makefile Xcode project project uses this script to build and clean from the Xcode GUI
-#
-
-# force exit on error
-set -e
-
-#
-# Source the workspace and set up the environment variables we need
-#
-cd ../..
-echo `pwd`
-./build64.sh $1 $2 $3 $4 $5 $6 $8
diff --git a/UnixPkg/Xcode/xcode_project64/xcode_project.xcodeproj/default.pbxuser b/UnixPkg/Xcode/xcode_project64/xcode_project.xcodeproj/default.pbxuser
deleted file mode 100644 (file)
index c0d3198..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-// !$*UTF8*$!
-{
-       08FB7793FE84155DC02AAC07 /* Project object */ = {
-               activeBuildConfigurationName = Debug;
-               activeExecutable = BA11A1010FB10BCE00D06FEC /* SecMain.dll */;
-               activeTarget = D28A88AD04BDD90700651E21 /* xcode_project */;
-               breakpoints = (
-                       BA11A11A0FB10E0700D06FEC /* SecGdbScriptBreak */,
-               );
-               codeSenseManager = BA11A0FE0FB10B4800D06FEC /* Code sense */;
-               executables = (
-                       BA11A1010FB10BCE00D06FEC /* SecMain.dll */,
-               );
-               perUserDictionary = {
-                       "PBXConfiguration.PBXBreakpointsDataSource.v1:1CA1AED706398EBD00589147" = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       20,
-                                       20,
-                                       198,
-                                       20,
-                                       99,
-                                       99,
-                                       29,
-                                       20,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXBreakpointsDataSource_ActionID,
-                                       PBXBreakpointsDataSource_TypeID,
-                                       PBXBreakpointsDataSource_BreakpointID,
-                                       PBXBreakpointsDataSource_UseID,
-                                       PBXBreakpointsDataSource_LocationID,
-                                       PBXBreakpointsDataSource_ConditionID,
-                                       PBXBreakpointsDataSource_IgnoreCountID,
-                                       PBXBreakpointsDataSource_ContinueID,
-                               );
-                       };
-                       PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       22,
-                                       300,
-                                       229,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXExecutablesDataSource_ActiveFlagID,
-                                       PBXExecutablesDataSource_NameID,
-                                       PBXExecutablesDataSource_CommentsID,
-                               );
-                       };
-                       PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
-                               PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
-                               PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
-                               PBXFileTableDataSourceColumnWidthsKey = (
-                                       20,
-                                       341,
-                                       20,
-                                       48,
-                                       43,
-                                       43,
-                                       20,
-                               );
-                               PBXFileTableDataSourceColumnsKey = (
-                                       PBXFileDataSource_FiletypeID,
-                                       PBXFileDataSource_Filename_ColumnID,
-                                       PBXFileDataSource_Built_ColumnID,
-                                       PBXFileDataSource_ObjectSize_ColumnID,
-                                       PBXFileDataSource_Errors_ColumnID,
-                                       PBXFileDataSource_Warnings_ColumnID,
-                                       PBXFileDataSource_Target_ColumnID,
-                               );
-                       };
-                       PBXPerProjectTemplateStateSaveDate = 263260969;
-                       PBXWorkspaceStateSaveDate = 263260969;
-               };
-               sourceControlManager = BA11A0FD0FB10B4800D06FEC /* Source Control */;
-               userBuildSettings = {
-               };
-       };
-       BA11A0FD0FB10B4800D06FEC /* Source Control */ = {
-               isa = PBXSourceControlManager;
-               fallbackIsa = XCSourceControlManager;
-               isSCMEnabled = 0;
-               repositoryNamesForRoots = {
-               };
-               scmConfiguration = {
-               };
-       };
-       BA11A0FE0FB10B4800D06FEC /* Code sense */ = {
-               isa = PBXCodeSenseManager;
-               indexTemplatePath = "";
-       };
-       BA11A1010FB10BCE00D06FEC /* SecMain.dll */ = {
-               isa = PBXExecutable;
-               activeArgIndices = (
-               );
-               argumentStrings = (
-               );
-               autoAttachOnCrash = 1;
-               breakpointsEnabled = 1;
-               configStateDict = {
-                       "PBXLSLaunchAction-0" = {
-                               PBXLSLaunchAction = 0;
-                               PBXLSLaunchStartAction = 1;
-                               PBXLSLaunchStdioStyle = 2;
-                               PBXLSLaunchStyle = 0;
-                               class = PBXLSRunLaunchConfig;
-                               commandLineArgs = (
-                               );
-                               displayName = "Executable Runner";
-                               environment = {
-                               };
-                               identifier = com.apple.Xcode.launch.runConfig;
-                               remoteHostInfo = "";
-                               startActionInfo = "";
-                       };
-                       "PBXLSLaunchAction-1" = {
-                               PBXLSLaunchAction = 1;
-                               PBXLSLaunchStartAction = 1;
-                               PBXLSLaunchStdioStyle = 2;
-                               PBXLSLaunchStyle = 0;
-                               class = PBXGDB_LaunchConfig;
-                               commandLineArgs = (
-                               );
-                               displayName = GDB;
-                               environment = {
-                               };
-                               identifier = com.apple.Xcode.launch.GDBMI_Config;
-                               remoteHostInfo = "";
-                               startActionInfo = "";
-                       };
-               };
-               customDataFormattersEnabled = 0;
-               dataTipCustomDataFormattersEnabled = 1;
-               dataTipShowTypeColumn = 1;
-               dataTipSortType = 0;
-               debuggerPlugin = GDBDebugging;
-               disassemblyDisplayState = 0;
-               dylibVariantSuffix = "";
-               enableDebugStr = 1;
-               environmentEntries = (
-               );
-               executableSystemSymbolLevel = 0;
-               executableUserSymbolLevel = 0;
-               launchableReference = BA11A1020FB10BCE00D06FEC /* SecMain.dll */;
-               libgmallocEnabled = 0;
-               name = SecMain.dll;
-               savedGlobals = {
-               };
-               showTypeColumn = 0;
-               sourceDirectories = (
-               );
-               startupPath = ../../../Build/UnixX64/DEBUG_UNIXPKG/X64;
-       };
-       BA11A1020FB10BCE00D06FEC /* SecMain.dll */ = {
-               isa = PBXFileReference;
-               lastKnownFileType = "compiled.mach-o.executable";
-               name = SecMain.dll;
-               path = ../../../Build/UnixX64/DEBUG_UNIXPKG/X64/SecMain;
-               sourceTree = SOURCE_ROOT;
-       };
-       BA11A11A0FB10E0700D06FEC /* SecGdbScriptBreak */ = {
-               isa = PBXSymbolicBreakpoint;
-               actions = (
-                       BA11A11E0FB10E2200D06FEC /* XCBreakpointCommandAction */,
-               );
-               breakpointStyle = 1;
-               continueAfterActions = 1;
-               countType = 0;
-               delayBeforeContinue = 0;
-               hitCount = 0;
-               ignoreCount = 0;
-               location = SecMain;
-               modificationTime = 263261853.260195;
-               originalNumberOfMultipleMatches = 1;
-               state = 1;
-               symbolName = SecGdbScriptBreak;
-       };
-       BA11A11E0FB10E2200D06FEC /* XCBreakpointCommandAction */ = {
-               isa = XCBreakpointCommandAction;
-               command = "source SecMain.gdb";
-               fallbackIsa = XCBreakpointAction;
-               logCommand = 0;
-               useDebuggerSideImplementation = 1;
-       };
-       D28A88AD04BDD90700651E21 /* xcode_project */ = {
-               activeExec = 0;
-       };
-}
diff --git a/UnixPkg/Xcode/xcode_project64/xcode_project.xcodeproj/project.pbxproj b/UnixPkg/Xcode/xcode_project64/xcode_project.xcodeproj/project.pbxproj
deleted file mode 100644 (file)
index fd9b2e8..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-// !$*UTF8*$!
-{
-       archiveVersion = 1;
-       classes = {
-       };
-       objectVersion = 45;
-       objects = {
-
-/* Begin PBXGroup section */
-               08FB7794FE84155DC02AAC07 /* xcode_project */ = {
-                       isa = PBXGroup;
-                       children = (
-                       );
-                       name = xcode_project;
-                       sourceTree = "<group>";
-               };
-/* End PBXGroup section */
-
-/* Begin PBXLegacyTarget section */
-               D28A88AD04BDD90700651E21 /* xcode_project */ = {
-                       isa = PBXLegacyTarget;
-                       buildArgumentsString = "$(ACTION)";
-                       buildConfigurationList = 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "xcode_project" */;
-                       buildPhases = (
-                       );
-                       buildToolPath = ./XcodeBuild.sh;
-                       buildWorkingDirectory = "";
-                       dependencies = (
-                       );
-                       name = xcode_project;
-                       passBuildSettingsInEnvironment = 1;
-                       productName = xcode_project;
-               };
-/* End PBXLegacyTarget section */
-
-/* Begin PBXProject section */
-               08FB7793FE84155DC02AAC07 /* Project object */ = {
-                       isa = PBXProject;
-                       buildConfigurationList = 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "xcode_project" */;
-                       compatibilityVersion = "Xcode 3.1";
-                       hasScannedForEncodings = 1;
-                       mainGroup = 08FB7794FE84155DC02AAC07 /* xcode_project */;
-                       projectDirPath = "";
-                       projectRoot = "";
-                       targets = (
-                               D28A88AD04BDD90700651E21 /* xcode_project */,
-                       );
-               };
-/* End PBXProject section */
-
-/* Begin XCBuildConfiguration section */
-               1DEB919008733D9F0010E9CD /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               PRODUCT_NAME = xcode_project;
-                       };
-                       name = Debug;
-               };
-               1DEB919108733D9F0010E9CD /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               PRODUCT_NAME = xcode_project;
-                       };
-                       name = Release;
-               };
-               1DEB919408733D9F0010E9CD /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ARCHS = "$(ARCHS_STANDARD_64_BIT)";
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               ONLY_ACTIVE_ARCH = YES;
-                               PREBINDING = NO;
-                               SDKROOT = macosx10.6;
-                       };
-                       name = Debug;
-               };
-               1DEB919508733D9F0010E9CD /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ARCHS = "$(ARCHS_STANDARD_64_BIT)";
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               PREBINDING = NO;
-                               SDKROOT = macosx10.6;
-                       };
-                       name = Release;
-               };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-               1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "xcode_project" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               1DEB919008733D9F0010E9CD /* Debug */,
-                               1DEB919108733D9F0010E9CD /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "xcode_project" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               1DEB919408733D9F0010E9CD /* Debug */,
-                               1DEB919508733D9F0010E9CD /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-/* End XCConfigurationList section */
-       };
-       rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/UnixPkg/build.sh b/UnixPkg/build.sh
deleted file mode 100755 (executable)
index 5d3d8a5..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution.  The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-set -e
-shopt -s nocasematch
-
-
-#
-# Setup workspace if it is not set
-#
-if [ -z "$WORKSPACE" ]
-then
-  echo Initializing workspace
-  if [ ! -e `pwd`/edksetup.sh ]
-  then
-    cd ..
-  fi
-# This version is for the tools in the BaseTools project.
-# this assumes svn pulls have the same root dir
-#  export EDK_TOOLS_PATH=`pwd`/../BaseTools
-# This version is for the tools source in edk2
-  export EDK_TOOLS_PATH=`pwd`/BaseTools
-  echo $EDK_TOOLS_PATH
-  source edksetup.sh BaseTools
-else
-  echo Building from: $WORKSPACE
-fi
-
-#
-# Pick a default tool type for a given OS
-#
-TARGET_TOOLS=MYTOOLS
-NETWORK_SUPPORT=
-case `uname` in
-  CYGWIN*) echo Cygwin not fully supported yet. ;;
-  Darwin*)
-      Major=$(uname -r | cut -f 1 -d '.')
-      if [[ $Major == 9 ]]
-      then
-        echo UnixPkg requires Snow Leopard or later OS
-        exit 1
-      else
-        TARGET_TOOLS=XCODE32
-      fi
-      NETWORK_SUPPORT="-D NETWORK_SUPPORT"
-      ;;
-  Linux*) TARGET_TOOLS=ELFGCC ;;
-
-esac
-
-BUILD_ROOT_ARCH=$WORKSPACE/Build/Unix/DEBUG_"$TARGET_TOOLS"/IA32
-
-if  [[ ! -f `which build` || ! -f `which GenFv` ]];
-then
-  # build the tools if they don't yet exist. Bin scheme
-  echo Building tools as they are not in the path
-  make -C $WORKSPACE/BaseTools
-elif [[ ( -f `which build` ||  -f `which GenFv` )  && ! -d  $EDK_TOOLS_PATH/Source/C/bin ]];
-then
-  # build the tools if they don't yet exist. BinWrapper scheme
-  echo Building tools no $EDK_TOOLS_PATH/Source/C/bin directory
-  make -C $WORKSPACE/BaseTools
-else
-  echo using prebuilt tools
-fi
-
-
-for arg in "$@"
-do
-  if [[ $arg == run ]]; then
-    case `uname` in
-      Darwin*)
-        #
-        # On Darwin we can't use dlopen, so we have to load the real PE/COFF images.
-        # This .gdbinit script sets a breakpoint that loads symbols for the PE/COFFEE
-        # images that get loaded in SecMain
-        #
-        cp $WORKSPACE/UnixPkg/.gdbinit $WORKSPACE/Build/Unix/DEBUG_"$TARGET_TOOLS"/IA32
-        ;;
-    esac
-
-    /usr/bin/gdb $BUILD_ROOT_ARCH/SecMain -q -cd=$BUILD_ROOT_ARCH
-    exit
-  fi
-
-  if [[ $arg == cleanall ]]; then
-    make -C $WORKSPACE/BaseTools clean
-    build -p $WORKSPACE/GccShellPkg/GccShellPkg.dsc -a IA32 -t $TARGET_TOOLS -n 3 clean
-    exit $?
-  fi
-
-  if [[ $arg == clean ]]; then
-    build -p $WORKSPACE/GccShellPkg/GccShellPkg.dsc -a IA32 -t $TARGET_TOOLS -n 3 clean
-    exit $?
-  fi
-
-  if [[ $arg == shell ]]; then
-    build -p $WORKSPACE/GccShellPkg/GccShellPkg.dsc -a IA32 -t $TARGET_TOOLS -n 3 $2 $3 $4 $5 $6 $7 $8
-    exit $?
-  fi
-done
-
-
-#
-# Build the edk2 UnixPkg
-#
-echo $PATH
-echo `which build`
-build -p $WORKSPACE/UnixPkg/UnixPkg.dsc         -a IA32 -t $TARGET_TOOLS $NETWORK_SUPPORT -n 3 $1 $2 $3 $4 $5 $6 $7 $8
-echo NOTE: UnixPkg is deprecated. Please see UnixPkg/Deprecated.txt for more information.
-exit $?
-
diff --git a/UnixPkg/build64.sh b/UnixPkg/build64.sh
deleted file mode 100755 (executable)
index 7f2206f..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution.  The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-set -e
-shopt -s nocasematch
-
-
-#
-# Setup workspace if it is not set
-#
-if [ -z "$WORKSPACE" ]
-then
-  echo Initializing workspace
-  if [ ! -e `pwd`/edksetup.sh ]
-  then
-    cd ..
-  fi
-# This version is for the tools in the BaseTools project.
-# this assumes svn pulls have the same root dir
-#  export EDK_TOOLS_PATH=`pwd`/../BaseTools
-# This version is for the tools source in edk2
-  export EDK_TOOLS_PATH=`pwd`/BaseTools
-  echo $EDK_TOOLS_PATH
-  source edksetup.sh BaseTools
-else
-  echo Building from: $WORKSPACE
-fi
-
-#
-# Pick a default tool type for a given OS
-#
-TARGET_TOOLS=MYTOOLS
-UNIXPKG_TOOLS=GCC44
-NETWORK_SUPPORT=
-case `uname` in
-  CYGWIN*) echo Cygwin not fully supported yet. ;;
-  Darwin*)
-      Major=$(uname -r | cut -f 1 -d '.')
-      if [[ $Major == 9 ]]
-      then
-        echo UnixPkg requires Snow Leopard or later OS
-        exit 1
-      else
-        TARGET_TOOLS=XCODE32
-        UNIXPKG_TOOLS=XCLANG
-      fi
-      NETWORK_SUPPORT="-D NETWORK_SUPPORT"
-      ;;
-  Linux*) TARGET_TOOLS=ELFGCC ;;
-
-esac
-
-BUILD_ROOT_ARCH=$WORKSPACE/Build/UnixX64/DEBUG_"$UNIXPKG_TOOLS"/X64
-
-if  [[ ! -f `which build` || ! -f `which GenFv` ]];
-then
-  # build the tools if they don't yet exist. Bin scheme
-  echo Building tools as they are not in the path
-  make -C $WORKSPACE/BaseTools
-elif [[ ( -f `which build` ||  -f `which GenFv` )  && ! -d  $EDK_TOOLS_PATH/Source/C/bin ]];
-then
-  # build the tools if they don't yet exist. BinWrapper scheme
-  echo Building tools no $EDK_TOOLS_PATH/Source/C/bin directory
-  make -C $WORKSPACE/BaseTools
-else
-  echo using prebuilt tools
-fi
-
-
-for arg in "$@"
-do
-  if [[ $arg == run ]]; then
-    case `uname` in
-      Darwin*)
-        #
-        # On Darwin we can't use dlopen, so we have to load the real PE/COFF images.
-        # This .gdbinit script sets a breakpoint that loads symbols for the PE/COFFEE
-        # images that get loaded in SecMain
-        #
-        cp $WORKSPACE/UnixPkg/.gdbinit $WORKSPACE/Build/UnixX64/DEBUG_"$UNIXPKG_TOOLS"/X64
-        ;;
-    esac
-
-    /usr/bin/gdb $BUILD_ROOT_ARCH/SecMain -q -cd=$BUILD_ROOT_ARCH
-    exit
-  fi
-
-  if [[ $arg == cleanall ]]; then
-    make -C $WORKSPACE/BaseTools clean
-    build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $TARGET_TOOLS -D SEC_ONLY -n 3 clean
-    build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $UNIXPKG_TOOLS -n 3 clean
-    exit $?
-  fi
-
-  if [[ $arg == clean ]]; then
-    build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $TARGET_TOOLS -D SEC_ONLY -n 3 clean
-    build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $UNIXPKG_TOOLS -n 3 clean
-    exit $?
-  fi
-
-  if [[ $arg == shell ]]; then
-    build -p $WORKSPACE/GccShellPkg/GccShellPkg.dsc -a X64 -t $UNIXPKG_TOOLS -n 3 $2 $3 $4 $5 $6 $7 $8
-    exit $?
-  fi
-done
-
-
-#
-# Build the edk2 UnixPkg
-#
-echo $PATH
-echo `which build`
-build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc      -a X64 -t $TARGET_TOOLS -D SEC_ONLY -n 3 $1 $2 $3 $4 $5 $6 $7 $8  modules
-build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc      -a X64 -t $UNIXPKG_TOOLS $NETWORK_SUPPORT -n 3 $1 $2 $3 $4 $5 $6 $7 $8
-cp $WORKSPACE/Build/UnixX64/DEBUG_"$TARGET_TOOLS"/X64/SecMain $WORKSPACE/Build/UnixX64/DEBUG_"$UNIXPKG_TOOLS"/X64
-echo NOTE: UnixPkg is deprecated. Please see UnixPkg/Deprecated.txt for more information.
-exit $?
-
diff --git a/UnixPkg/readme.txt b/UnixPkg/readme.txt
deleted file mode 100644 (file)
index 4166306..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-Deprecation Notice
-==================
-UnixPkg is deprecated. Please see UnixPkg/Deprecated.txt for more information.
-
-Unix Simulation Platform
-========================
-
-UnixPkg is one of platform package which can be built to a platform's firmware from UnixPkg.dsc file.
-And this package provide a simulation platform under *INUX environment in IA32 architecture.
-
-- Same points between real platform and simulation platform:
-  1) Unix simulation platform also run with firmware device image built from UnixPkg
-  2) The working flow of simulation platform also contains SEC/PEI/DXE phase.
-
-- Different points between real platform and simulation platform:
-  1) The SEC phase in simulation platform in fact is a *INUX native application which can be run from *INUX shell;
-  2) The device in simulation platform is not real hardware but simulation component in API level;
-  3) The ThunkBus driver in simulation platform will get virtual device's desription from PCD and create virtual Device
-
-Build
-=====
-UnixPkg is built with following command:
-  build -p UnixPkg/UnixPkg.dsc -a IA32 -t ELFGCC
-  Notes: ELFGCC is defined in <Workspace>/Conf/tools_def.txt file. This tool chain use native gcc/binutil instead of 
-         cross-compiler like UNIXGCC tool chain.
-
-On Mac OS X you can cd into UnixPkg directory and execute ./build.sh to build. This does not require
-setting up the environment like running the build command. Note Snow Leopard or later is required. 
-This script should also work for any *INUX, but has not been tested. 
-
-./build.sh run will lanuch the emulator in gdb so you can source level debug via gdb. 
-
-
-Notes:
-=====
-On Mac OS X Snow Leopard you can use Xcode 3.2 as a GUI debugger. 
-Launch Xcode and open UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj
-Under the build menu chose build and debug. shift-cmd-B shows the build results.
-
-Under most *INUX the EFI executables are placed in the emulated EFI memory by the EFI PE/COFF loader
-but dlopen() is used to also load the image into the process to support source level debug. 
-The entry point for the image is moved from the EFI emulator memory into the dlopen() image. This
-is not the case for Mac OS X. On Mac OS X a debugger script is used and the real EFI images in
-the emulator are the ones being debugged. 
-
-Also on Mac OS X the stack alignment requirements for IA-32 are 16 bytes and this is more strict
-than the EFI ABI. To work around this gasket code was introduced to ensure the stack is always
-16 byte aligned when making any POSIX call on Mac OS X. 
-
-To build PE/COFF images with Xcode 3.2 and extra tool call mtoc is required to convert Mach-O 
-images into PE/COFF images. The tool only supports EFI PE/COFF images and the instructions on 
-how to download it are on the edk2 website.
-
-FAQ
-===
-1, I fail to build UnixPkg due to "X11/extensions/XShm.h: No such file or directory"?
-   The display adapter in UnixPkg is a virtual device written in X11 API. The library of x11proto-xext-dev is required
-   for building.
-
-2, I fail to build UnixPkg due to "/usr/bin/ld: cannot find -lXext"?   
-   libxext-dev library is required for building.
-