Unix version of EFI emulator
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2182 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
87
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.c
Normal file
87
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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:
|
||||
|
||||
Produce UnixThunk protocol and it's associated device path and controller
|
||||
state protocols. UnixThunk is to the emulation environment as
|
||||
PCI_ROOT_BRIGE is to real hardware. The UnixBusDriver is the child of this
|
||||
driver.
|
||||
|
||||
Since we are a root hardware abstraction we do not install a Driver Binding
|
||||
protocol on this handle. This driver can only support one one UnixThunk protocol
|
||||
in the system, since the device path is hard coded.
|
||||
|
||||
--*/
|
||||
|
||||
#include "UnixThunk.h"
|
||||
|
||||
//
|
||||
// WinNtThunk Device Path Protocol Instance
|
||||
//
|
||||
static UNIX_THUNK_DEVICE_PATH mUnixThunkDevicePath = {
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
|
||||
EFI_UNIX_THUNK_PROTOCOL_GUID,
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
END_DEVICE_PATH_LENGTH,
|
||||
0
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeUnixThunk (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Install UnixThunk Protocol and it's associated Device Path protocol
|
||||
|
||||
Arguments:
|
||||
(Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
|
||||
|
||||
Returns:
|
||||
EFI_SUCEESS - UnixThunk protocol is added or error status from
|
||||
gBS->InstallMultiProtocolInterfaces().
|
||||
|
||||
--*/
|
||||
// TODO: ImageHandle - add argument and description to function comment
|
||||
// TODO: SystemTable - add argument and description to function comment
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE ControllerHandle;
|
||||
|
||||
ControllerHandle = NULL;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&ControllerHandle,
|
||||
&gEfiUnixThunkProtocolGuid,
|
||||
gUnix,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mUnixThunkDevicePath,
|
||||
NULL
|
||||
);
|
||||
|
||||
return Status;
|
||||
}
|
27
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.dxs
Normal file
27
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.dxs
Normal file
@@ -0,0 +1,27 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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.dxs
|
||||
|
||||
Abstract:
|
||||
|
||||
Dependency expression source file.
|
||||
|
||||
--*/
|
||||
|
||||
#include <AutoGen.h>
|
||||
#include <DxeDepex.h>
|
||||
|
||||
DEPENDENCY_START
|
||||
TRUE
|
||||
DEPENDENCY_END
|
30
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.h
Normal file
30
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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:
|
||||
|
||||
--*/
|
||||
|
||||
// TODO: add protective #ifndef
|
||||
|
||||
|
||||
//
|
||||
// WinNtThunk Device Path Protocol Instance Type
|
||||
//
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH Vendor;
|
||||
EFI_DEVICE_PATH_PROTOCOL EndDevicePath;
|
||||
} UNIX_THUNK_DEVICE_PATH;
|
||||
|
69
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.msa
Normal file
69
EdkUnixPkg/Dxe/UnixThunk/UnixThunk/UnixThunk.msa
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">
|
||||
<MsaHeader>
|
||||
<ModuleName>UnixThunk</ModuleName>
|
||||
<ModuleType>DXE_DRIVER</ModuleType>
|
||||
<GuidValue>f38610fc-8985-11db-82d4-0040d02b1835</GuidValue>
|
||||
<Version>1.0</Version>
|
||||
<Abstract>A DXE driver to produce EFI_UNIX_THUNK_PROTOCOL</Abstract>
|
||||
<Description>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.</Description>
|
||||
<Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
|
||||
<License>All rights reserved. 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.</License>
|
||||
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
|
||||
</MsaHeader>
|
||||
<ModuleDefinitions>
|
||||
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
|
||||
<BinaryModule>false</BinaryModule>
|
||||
<OutputFileBasename>UnixThunk</OutputFileBasename>
|
||||
</ModuleDefinitions>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>DebugLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiDriverEntryPoint</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UnixLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>MemoryAllocationLib</Keyword>
|
||||
</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">
|
||||
<Keyword>UefiBootServicesTableLib</Keyword>
|
||||
</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>UnixThunk.h</Filename>
|
||||
<Filename>UnixThunk.c</Filename>
|
||||
<Filename>UnixThunk.dxs</Filename>
|
||||
</SourceFiles>
|
||||
<PackageDependencies>
|
||||
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
|
||||
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
|
||||
<Package PackageGuid="f2805c44-8985-11db-9e98-0040d02b1835"/>
|
||||
</PackageDependencies>
|
||||
<Protocols>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiUnixThunkProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
<Protocol Usage="ALWAYS_PRODUCED">
|
||||
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
|
||||
</Protocol>
|
||||
</Protocols>
|
||||
<Externs>
|
||||
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
|
||||
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
|
||||
<Extern>
|
||||
<ModuleEntryPoint>InitializeUnixThunk</ModuleEntryPoint>
|
||||
</Extern>
|
||||
</Externs>
|
||||
</ModuleSurfaceArea>
|
Reference in New Issue
Block a user