loader.efi: efi variable rework and lsefi command added
This update does add diag and debug capabilities to interpret the efi variables, configuration and protocols (lsefi). The side effect is that we add/update bunch of related headers.
This commit is contained in:
parent
993b1e419c
commit
6564182252
37
stand/efi/include/Guid/MemoryTypeInformation.h
Normal file
37
stand/efi/include/Guid/MemoryTypeInformation.h
Normal file
@ -0,0 +1,37 @@
|
||||
/* $FreeBSD$ */
|
||||
/** @file
|
||||
This file defines:
|
||||
* Memory Type Information GUID for HOB and Variable.
|
||||
* Memory Type Information Variable Name.
|
||||
* Memory Type Information GUID HOB data structure.
|
||||
|
||||
The memory type information HOB and variable can
|
||||
be used to store the information for each memory type in Variable or HOB.
|
||||
|
||||
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 that 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 __MEMORY_TYPE_INFORMATION_GUID_H__
|
||||
#define __MEMORY_TYPE_INFORMATION_GUID_H__
|
||||
|
||||
#define EFI_MEMORY_TYPE_INFORMATION_GUID \
|
||||
{ 0x4c19049f,0x4137,0x4dd3, { 0x9c,0x10,0x8b,0x97,0xa8,0x3f,0xfd,0xfa } }
|
||||
|
||||
#define EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME "MemoryTypeInformation"
|
||||
|
||||
extern EFI_GUID gEfiMemoryTypeInformationGuid;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Type; ///< EFI memory type defined in UEFI specification.
|
||||
UINT32 NumberOfPages; ///< The pages of this type memory.
|
||||
} EFI_MEMORY_TYPE_INFORMATION;
|
||||
|
||||
#endif
|
32
stand/efi/include/Guid/MtcVendor.h
Normal file
32
stand/efi/include/Guid/MtcVendor.h
Normal file
@ -0,0 +1,32 @@
|
||||
/* $FreeBSD$ */
|
||||
/** @file
|
||||
GUID is for MTC variable.
|
||||
|
||||
Copyright (c) 2011, 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 that 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 __MTC_VENDOR_GUID_H__
|
||||
#define __MTC_VENDOR_GUID_H__
|
||||
|
||||
//
|
||||
// Vendor GUID of the variable for the high part of monotonic counter (UINT32).
|
||||
//
|
||||
#define MTC_VENDOR_GUID \
|
||||
{ 0xeb704011, 0x1402, 0x11d3, { 0x8e, 0x77, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } }
|
||||
|
||||
//
|
||||
// Name of the variable for the high part of monotonic counter
|
||||
//
|
||||
#define MTC_VARIABLE_NAME "MTC"
|
||||
|
||||
extern EFI_GUID gMtcVendorGuid;
|
||||
|
||||
#endif
|
26
stand/efi/include/Guid/ZeroGuid.h
Normal file
26
stand/efi/include/Guid/ZeroGuid.h
Normal file
@ -0,0 +1,26 @@
|
||||
/* $FreeBSD$ */
|
||||
/** @file
|
||||
GUID has all zero values.
|
||||
|
||||
Copyright (c) 2011, 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 that 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 __ZERO_GUID_H__
|
||||
#define __ZERO_GUID_H__
|
||||
|
||||
#define ZERO_GUID \
|
||||
{ \
|
||||
0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} \
|
||||
}
|
||||
|
||||
extern EFI_GUID gZeroGuid;
|
||||
|
||||
#endif
|
53
stand/efi/include/Protocol/EdidActive.h
Normal file
53
stand/efi/include/Protocol/EdidActive.h
Normal file
@ -0,0 +1,53 @@
|
||||
/* $FreeBSD$ */
|
||||
/** @file
|
||||
EDID Active Protocol from the UEFI 2.0 specification.
|
||||
|
||||
Placed on the video output device child handle that is actively displaying output.
|
||||
|
||||
Copyright (c) 2006 - 2012, 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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __EDID_ACTIVE_H__
|
||||
#define __EDID_ACTIVE_H__
|
||||
|
||||
#define EFI_EDID_ACTIVE_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xbd8c1056, 0x9f36, 0x44ec, {0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 } \
|
||||
}
|
||||
|
||||
///
|
||||
/// This protocol contains the EDID information for an active video output device. This is either the
|
||||
/// EDID information retrieved from the EFI_EDID_OVERRIDE_PROTOCOL if an override is
|
||||
/// available, or an identical copy of the EDID information from the
|
||||
/// EFI_EDID_DISCOVERED_PROTOCOL if no overrides are available.
|
||||
///
|
||||
typedef struct {
|
||||
///
|
||||
/// The size, in bytes, of the Edid buffer. 0 if no EDID information
|
||||
/// is available from the video output device. Otherwise, it must be a
|
||||
/// minimum of 128 bytes.
|
||||
///
|
||||
UINT32 SizeOfEdid;
|
||||
|
||||
///
|
||||
/// A pointer to a read-only array of bytes that contains the EDID
|
||||
/// information for an active video output device. This pointer is
|
||||
/// NULL if no EDID information is available for the video output
|
||||
/// device. The minimum size of a valid Edid buffer is 128 bytes.
|
||||
/// EDID information is defined in the E-EDID EEPROM
|
||||
/// specification published by VESA (www.vesa.org).
|
||||
///
|
||||
UINT8 *Edid;
|
||||
} EFI_EDID_ACTIVE_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiEdidActiveProtocolGuid;
|
||||
|
||||
#endif
|
51
stand/efi/include/Protocol/EdidDiscovered.h
Normal file
51
stand/efi/include/Protocol/EdidDiscovered.h
Normal file
@ -0,0 +1,51 @@
|
||||
/* $FreeBSD$ */
|
||||
/** @file
|
||||
EDID Discovered Protocol from the UEFI 2.0 specification.
|
||||
|
||||
This protocol is placed on the video output device child handle. It represents
|
||||
the EDID information being used for the output device represented by the child handle.
|
||||
|
||||
Copyright (c) 2006 - 2012, 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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __EDID_DISCOVERED_H__
|
||||
#define __EDID_DISCOVERED_H__
|
||||
|
||||
#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x1c0c34f6, 0xd380, 0x41fa, {0xa0, 0x49, 0x8a, 0xd0, 0x6c, 0x1a, 0x66, 0xaa } \
|
||||
}
|
||||
|
||||
///
|
||||
/// This protocol contains the EDID information retrieved from a video output device.
|
||||
///
|
||||
typedef struct {
|
||||
///
|
||||
/// The size, in bytes, of the Edid buffer. 0 if no EDID information
|
||||
/// is available from the video output device. Otherwise, it must be a
|
||||
/// minimum of 128 bytes.
|
||||
///
|
||||
UINT32 SizeOfEdid;
|
||||
|
||||
///
|
||||
/// A pointer to a read-only array of bytes that contains the EDID
|
||||
/// information for an active video output device. This pointer is
|
||||
/// NULL if no EDID information is available for the video output
|
||||
/// device. The minimum size of a valid Edid buffer is 128 bytes.
|
||||
/// EDID information is defined in the E-EDID EEPROM
|
||||
/// specification published by VESA (www.vesa.org).
|
||||
///
|
||||
UINT8 *Edid;
|
||||
} EFI_EDID_DISCOVERED_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiEdidDiscoveredProtocolGuid;
|
||||
|
||||
#endif
|
68
stand/efi/include/Protocol/EdidOverride.h
Normal file
68
stand/efi/include/Protocol/EdidOverride.h
Normal file
@ -0,0 +1,68 @@
|
||||
/* $FreeBSD$ */
|
||||
/** @file
|
||||
EDID Override Protocol from the UEFI 2.0 specification.
|
||||
|
||||
Allow platform to provide EDID information to the producer of the Graphics Output
|
||||
protocol.
|
||||
|
||||
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.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __EDID_OVERRIDE_H__
|
||||
#define __EDID_OVERRIDE_H__
|
||||
|
||||
#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x48ecb431, 0xfb72, 0x45c0, {0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 } \
|
||||
}
|
||||
|
||||
typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL;
|
||||
|
||||
#define EFI_EDID_OVERRIDE_DONT_OVERRIDE 0x01
|
||||
#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02
|
||||
|
||||
/**
|
||||
Returns policy information and potentially a replacement EDID for the specified video output device.
|
||||
|
||||
@param This The EFI_EDID_OVERRIDE_PROTOCOL instance.
|
||||
@param ChildHandle A child handle produced by the Graphics Output EFI
|
||||
driver that represents a video output device.
|
||||
@param Attributes The attributes associated with ChildHandle video output device.
|
||||
@param EdidSize A pointer to the size, in bytes, of the Edid buffer.
|
||||
@param Edid A pointer to callee allocated buffer that contains the EDID that
|
||||
should be used for ChildHandle. A value of NULL
|
||||
represents no EDID override for ChildHandle.
|
||||
|
||||
@retval EFI_SUCCESS Valid overrides returned for ChildHandle.
|
||||
@retval EFI_UNSUPPORTED ChildHandle has no overrides.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID)(
|
||||
IN EFI_EDID_OVERRIDE_PROTOCOL *This,
|
||||
IN EFI_HANDLE *ChildHandle,
|
||||
OUT UINT32 *Attributes,
|
||||
IN OUT UINTN *EdidSize,
|
||||
IN OUT UINT8 **Edid
|
||||
);
|
||||
|
||||
///
|
||||
/// This protocol is produced by the platform to allow the platform to provide
|
||||
/// EDID information to the producer of the Graphics Output protocol.
|
||||
///
|
||||
struct _EFI_EDID_OVERRIDE_PROTOCOL {
|
||||
EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEfiEdidOverrideProtocolGuid;
|
||||
|
||||
#endif
|
@ -43,8 +43,10 @@ Revision History
|
||||
#include "efibind.h"
|
||||
#include "efidef.h"
|
||||
#include "efidevp.h"
|
||||
#include "efipciio.h"
|
||||
#include "efiprot.h"
|
||||
#include "eficon.h"
|
||||
#include "eficonsctl.h"
|
||||
#include "efiser.h"
|
||||
#include "efi_nii.h"
|
||||
#include "efipxebc.h"
|
||||
@ -53,6 +55,11 @@ Revision History
|
||||
#include "efifs.h"
|
||||
#include "efierr.h"
|
||||
#include "efigop.h"
|
||||
#include "efiip.h"
|
||||
#include "efiudp.h"
|
||||
#include "efitcp.h"
|
||||
#include "efipoint.h"
|
||||
#include "efiuga.h"
|
||||
|
||||
/*
|
||||
* FreeBSD UUID
|
||||
|
@ -218,9 +218,13 @@ VOID
|
||||
{ 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} }
|
||||
|
||||
// Variable attributes
|
||||
#define EFI_VARIABLE_NON_VOLATILE 0x00000001
|
||||
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
|
||||
#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
|
||||
#define EFI_VARIABLE_NON_VOLATILE 0x00000001
|
||||
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
|
||||
#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
|
||||
#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
|
||||
#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
|
||||
#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
|
||||
#define EFI_VARIABLE_APPEND_WRITE 0x00000040
|
||||
|
||||
// Variable size limitation
|
||||
#define EFI_MAXIMUM_VARIABLE_SIZE 1024
|
||||
@ -911,4 +915,282 @@ typedef struct _EFI_SYSTEM_TABLE {
|
||||
|
||||
} EFI_SYSTEM_TABLE;
|
||||
|
||||
/*
|
||||
* unlisted GUID's..
|
||||
*/
|
||||
#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \
|
||||
{ 0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7} }
|
||||
|
||||
#define EFI_DRIVER_CONFIGURATION2_PROTOCOL_GUID \
|
||||
{ 0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe} }
|
||||
|
||||
#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
|
||||
{ 0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_DRIVER_BINDING_PROTOCOL_GUID \
|
||||
{ 0x18A031AB, 0xB443, 0x4D1A, \
|
||||
{ 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 } \
|
||||
}
|
||||
|
||||
#define EFI_TAPE_IO_PROTOCOL_GUID \
|
||||
{ 0x1e93e633, 0xd65a, 0x459e, \
|
||||
{ 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \
|
||||
}
|
||||
|
||||
#define EFI_SCSI_IO_PROTOCOL_GUID \
|
||||
{ 0x932f47e6, 0x2362, 0x4002, \
|
||||
{ 0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \
|
||||
}
|
||||
|
||||
#define EFI_USB2_HC_PROTOCOL_GUID \
|
||||
{ 0x3e745226, 0x9818, 0x45b6, \
|
||||
{ 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } \
|
||||
}
|
||||
|
||||
#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
|
||||
{ 0x2755590C, 0x6F3C, 0x42FA, \
|
||||
{ 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \
|
||||
}
|
||||
|
||||
#define EFI_DEBUGPORT_PROTOCOL_GUID \
|
||||
{ 0xEBA4E8D2, 0x3858, 0x41EC, \
|
||||
{ 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
|
||||
}
|
||||
|
||||
#define EFI_DECOMPRESS_PROTOCOL_GUID \
|
||||
{ 0xd8117cfe, 0x94a6, 0x11d4, \
|
||||
{ 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
|
||||
}
|
||||
|
||||
#define EFI_ACPI_TABLE_PROTOCOL_GUID \
|
||||
{ 0xffe06bdd, 0x6107, 0x46a6, \
|
||||
{ 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c} \
|
||||
}
|
||||
|
||||
#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \
|
||||
{ 0x587e72d7, 0xcc50, 0x4f79, \
|
||||
{ 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } \
|
||||
}
|
||||
|
||||
#define EFI_HII_DATABASE_PROTOCOL_GUID \
|
||||
{ 0xef9fc172, 0xa1b2, 0x4693, \
|
||||
{ 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } \
|
||||
}
|
||||
|
||||
#define EFI_HII_STRING_PROTOCOL_GUID \
|
||||
{ 0xfd96974, 0x23aa, 0x4cdc, \
|
||||
{ 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } \
|
||||
}
|
||||
|
||||
#define EFI_HII_IMAGE_PROTOCOL_GUID \
|
||||
{ 0x31a6406a, 0x6bdf, 0x4e46, \
|
||||
{ 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } \
|
||||
}
|
||||
|
||||
#define EFI_HII_FONT_PROTOCOL_GUID \
|
||||
{ 0xe9ca4775, 0x8657, 0x47fc, \
|
||||
{ 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } \
|
||||
}
|
||||
#define EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID \
|
||||
{ 0x330d4706, 0xf2a0, 0x4e4f, \
|
||||
{ 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } \
|
||||
}
|
||||
|
||||
#define EFI_COMPONENT_NAME_PROTOCOL_GUID \
|
||||
{ 0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
|
||||
{ 0x6a7a5cff, 0xe8d9, 0x4f70, \
|
||||
{ 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14} \
|
||||
}
|
||||
|
||||
#define EFI_USB_IO_PROTOCOL_GUID \
|
||||
{ 0x2B2F68D6, 0x0CD2, 0x44cf, \
|
||||
{ 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \
|
||||
}
|
||||
#define EFI_HCDP_TABLE_GUID \
|
||||
{ 0xf951938d, 0x620b, 0x42ef, \
|
||||
{ 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \
|
||||
}
|
||||
|
||||
#define EFI_DEVICE_TREE_GUID \
|
||||
{ 0xb1b621d5, 0xf19c, 0x41a5, \
|
||||
{ 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \
|
||||
}
|
||||
|
||||
#define EFI_VENDOR_APPLE_GUID \
|
||||
{ 0x2B0585EB, 0xD8B8, 0x49A9, \
|
||||
{ 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \
|
||||
}
|
||||
|
||||
#define EFI_CONSOLE_IN_DEVICE_GUID \
|
||||
{ 0xd3b36f2b, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_CONSOLE_OUT_DEVICE_GUID \
|
||||
{ 0xd3b36f2c, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_STANDARD_ERROR_DEVICE_GUID \
|
||||
{ 0xd3b36f2d, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \
|
||||
{ 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} }
|
||||
|
||||
#define EFI_FORM_BROWSER2_PROTOCOL_GUID \
|
||||
{ 0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58} }
|
||||
|
||||
#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{ 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3} }
|
||||
|
||||
#define EFI_ARP_PROTOCOL_GUID \
|
||||
{ 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c} }
|
||||
|
||||
#define EFI_IP4_CONFIG_PROTOCOL_GUID \
|
||||
{ 0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e} }
|
||||
|
||||
#define EFI_IP6_CONFIG_PROTOCOL_GUID \
|
||||
{ 0x937fe521, 0x95ae, 0x4d1a, {0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a} }
|
||||
|
||||
#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{ 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c} }
|
||||
|
||||
#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \
|
||||
{ 0x7ab33a91, 0xace5, 0x4326, {0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16} }
|
||||
|
||||
#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{ 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F} }
|
||||
|
||||
#define EFI_MTFTP4_PROTOCOL_GUID \
|
||||
{ 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b} }
|
||||
|
||||
#define EFI_MTFTP6_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{ 0xd9760ff3, 0x3cca, 0x4267, {0x80, 0xf9, 0x75, 0x27, 0xfa, 0xfa, 0x42, 0x23} }
|
||||
|
||||
#define EFI_MTFTP6_PROTOCOL_GUID \
|
||||
{ 0xbf0a78ba, 0xec29, 0x49cf, {0xa1, 0xc9, 0x7a, 0xe5, 0x4e, 0xab, 0x6a, 0x51} }
|
||||
|
||||
#define EFI_DHCP4_PROTOCOL_GUID \
|
||||
{ 0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56} }
|
||||
|
||||
#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{ 0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80} }
|
||||
|
||||
#define EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID \
|
||||
{ 0x9fb9a8a1, 0x2f4a, 0x43a6, {0x88, 0x9c, 0xd0, 0xf7, 0xb6, 0xc4, 0x7a, 0xd5} }
|
||||
|
||||
#define EFI_DHCP6_PROTOCOL_GUID \
|
||||
{ 0x87c8bad7, 0x595, 0x4053, {0x82, 0x97, 0xde, 0xde, 0x39, 0x5f, 0x5d, 0x5b} }
|
||||
|
||||
#define EFI_SCSI_PASS_THRU_PROTOCOL_GUID \
|
||||
{ 0xa59e8fcf, 0xbda0, 0x43bb, {0x90, 0xb1, 0xd3, 0x73, 0x2e, 0xca, 0xa8, 0x77} }
|
||||
|
||||
#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \
|
||||
{ 0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe} }
|
||||
|
||||
#define EFI_DISK_INFO_PROTOCOL_GUID \
|
||||
{ 0xd432a67f, 0x14dc, 0x484b, {0xb3, 0xbb, 0x3f, 0x2, 0x91, 0x84, 0x93, 0x27} }
|
||||
|
||||
#define EFI_ISA_IO_PROTOCOL_GUID \
|
||||
{ 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_VLAN_CONFIG_PROTOCOL_GUID \
|
||||
{ 0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74} }
|
||||
|
||||
#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \
|
||||
{ 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9} }
|
||||
|
||||
#define EFI_ISA_ACPI_PROTOCOL_GUID \
|
||||
{ 0x64a892dc, 0x5561, 0x4536, {0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55} }
|
||||
|
||||
#define EFI_PCI_ENUMERATION_COMPLETE_GUID \
|
||||
{ 0x30cfe3e7, 0x3de1, 0x4586, {0xbe, 0x20, 0xde, 0xab, 0xa1, 0xb3, 0xb7, 0x93} }
|
||||
|
||||
#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
|
||||
{ 0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
|
||||
|
||||
#define EFI_DRIVER_DIAGNOSTICS2_PROTOCOL_GUID \
|
||||
{ 0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63} }
|
||||
|
||||
#define EFI_CAPSULE_ARCH_PROTOCOL_GUID \
|
||||
{ 0x5053697e, 0x2cbc, 0x4819, {0x90, 0xd9, 0x05, 0x80, 0xde, 0xee, 0x57, 0x54} }
|
||||
|
||||
#define EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID \
|
||||
{0x1da97072, 0xbddc, 0x4b30, {0x99, 0xf1, 0x72, 0xa0, 0xb5, 0x6f, 0xff, 0x2a} }
|
||||
|
||||
#define EFI_REALTIME_CLOCK_ARCH_PROTOCOL_GUID \
|
||||
{0x27cfac87, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_MP_SERVICES_PROTOCOL_GUID \
|
||||
{ 0x3fdda605, 0xa76e, 0x4f46, {0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08} }
|
||||
|
||||
#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \
|
||||
{ 0x1e5668e2, 0x8481, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
|
||||
|
||||
#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \
|
||||
{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} }
|
||||
|
||||
#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \
|
||||
{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} }
|
||||
|
||||
#define EFI_ACPI_SUPPORT_PROTOCOL_GUID \
|
||||
{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} }
|
||||
|
||||
#define EFI_BDS_ARCH_PROTOCOL_GUID \
|
||||
{ 0x665e3ff6, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_METRONOME_ARCH_PROTOCOL_GUID \
|
||||
{ 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
|
||||
|
||||
#define EFI_TIMER_ARCH_PROTOCOL_GUID \
|
||||
{ 0x26baccb3, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
|
||||
|
||||
#define EFI_DPC_PROTOCOL_GUID \
|
||||
{ 0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6} }
|
||||
|
||||
#define EFI_PRINT2_PROTOCOL_GUID \
|
||||
{ 0xf05976ef, 0x83f1, 0x4f3d, {0x86, 0x19, 0xf7, 0x59, 0x5d, 0x41, 0xe5, 0x38} }
|
||||
|
||||
#define EFI_RESET_ARCH_PROTOCOL_GUID \
|
||||
{ 0x27cfac88, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
|
||||
#define EFI_CPU_ARCH_PROTOCOL_GUID \
|
||||
{ 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
|
||||
|
||||
#define EFI_CPU_IO2_PROTOCOL_GUID \
|
||||
{ 0xad61f191, 0xae5f, 0x4c0e, {0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f} }
|
||||
|
||||
#define EFI_LEGACY_8259_PROTOCOL_GUID \
|
||||
{ 0x38321dba, 0x4fe0, 0x4e17, {0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1} }
|
||||
|
||||
#define EFI_SECURITY_ARCH_PROTOCOL_GUID \
|
||||
{ 0xa46423e3, 0x4617, 0x49f1, {0xb9, 0xff, 0xd1, 0xbf, 0xa9, 0x11, 0x58, 0x39} }
|
||||
|
||||
#define EFI_SECURITY2_ARCH_PROTOCOL_GUID \
|
||||
{ 0x94ab2f58, 0x1438, 0x4ef1, {0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0x0e, 0x68} }
|
||||
|
||||
#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \
|
||||
{ 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33} }
|
||||
|
||||
#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \
|
||||
{ 0xd2b2b828, 0x826, 0x48a7, {0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0} }
|
||||
|
||||
#define EFI_DATA_HUB_PROTOCOL_GUID \
|
||||
{ 0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
|
||||
|
||||
#define PCD_PROTOCOL_GUID \
|
||||
{ 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7} }
|
||||
|
||||
#define EFI_PCD_PROTOCOL_GUID \
|
||||
{ 0x13a3f0f6, 0x264a, 0x3ef0, {0xf2, 0xe0, 0xde, 0xc5, 0x12, 0x34, 0x2f, 0x34} }
|
||||
|
||||
#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \
|
||||
{ 0x8f644fa9, 0xe850, 0x4db1, {0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } }
|
||||
|
||||
#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \
|
||||
{ 0x220e73b6, 0x6bdb, 0x4413, { 0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a } }
|
||||
|
||||
#define EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID \
|
||||
{ 0x7aa35a69, 0x506c, 0x444f, {0xa7, 0xaf, 0x69, 0x4b, 0xf5, 0x6f, 0x71, 0xc8} }
|
||||
|
||||
#define LZMA_COMPRESS_GUID \
|
||||
{ 0xee4e5898, 0x3914, 0x4259, {0x9d, 0x6e, 0xdc, 0x7b, 0xd7, 0x94, 0x03, 0xcf} }
|
||||
#endif
|
||||
|
@ -263,28 +263,56 @@ typedef struct {
|
||||
// Scan codes for base line keys
|
||||
//
|
||||
|
||||
#define SCAN_NULL 0x0000
|
||||
#define SCAN_UP 0x0001
|
||||
#define SCAN_DOWN 0x0002
|
||||
#define SCAN_RIGHT 0x0003
|
||||
#define SCAN_LEFT 0x0004
|
||||
#define SCAN_HOME 0x0005
|
||||
#define SCAN_END 0x0006
|
||||
#define SCAN_INSERT 0x0007
|
||||
#define SCAN_DELETE 0x0008
|
||||
#define SCAN_PAGE_UP 0x0009
|
||||
#define SCAN_PAGE_DOWN 0x000A
|
||||
#define SCAN_F1 0x000B
|
||||
#define SCAN_F2 0x000C
|
||||
#define SCAN_F3 0x000D
|
||||
#define SCAN_F4 0x000E
|
||||
#define SCAN_F5 0x000F
|
||||
#define SCAN_F6 0x0010
|
||||
#define SCAN_F7 0x0011
|
||||
#define SCAN_F8 0x0012
|
||||
#define SCAN_F9 0x0013
|
||||
#define SCAN_F10 0x0014
|
||||
#define SCAN_ESC 0x0017
|
||||
#define SCAN_NULL 0x0000
|
||||
#define SCAN_UP 0x0001
|
||||
#define SCAN_DOWN 0x0002
|
||||
#define SCAN_RIGHT 0x0003
|
||||
#define SCAN_LEFT 0x0004
|
||||
#define SCAN_HOME 0x0005
|
||||
#define SCAN_END 0x0006
|
||||
#define SCAN_INSERT 0x0007
|
||||
#define SCAN_DELETE 0x0008
|
||||
#define SCAN_PAGE_UP 0x0009
|
||||
#define SCAN_PAGE_DOWN 0x000A
|
||||
#define SCAN_F1 0x000B
|
||||
#define SCAN_F2 0x000C
|
||||
#define SCAN_F3 0x000D
|
||||
#define SCAN_F4 0x000E
|
||||
#define SCAN_F5 0x000F
|
||||
#define SCAN_F6 0x0010
|
||||
#define SCAN_F7 0x0011
|
||||
#define SCAN_F8 0x0012
|
||||
#define SCAN_F9 0x0013
|
||||
#define SCAN_F10 0x0014
|
||||
#define SCAN_ESC 0x0017
|
||||
|
||||
//
|
||||
// EFI Scan code Ex
|
||||
//
|
||||
#define SCAN_F11 0x0015
|
||||
#define SCAN_F12 0x0016
|
||||
#define SCAN_F13 0x0068
|
||||
#define SCAN_F14 0x0069
|
||||
#define SCAN_F15 0x006A
|
||||
#define SCAN_F16 0x006B
|
||||
#define SCAN_F17 0x006C
|
||||
#define SCAN_F18 0x006D
|
||||
#define SCAN_F19 0x006E
|
||||
#define SCAN_F20 0x006F
|
||||
#define SCAN_F21 0x0070
|
||||
#define SCAN_F22 0x0071
|
||||
#define SCAN_F23 0x0072
|
||||
#define SCAN_F24 0x0073
|
||||
#define SCAN_MUTE 0x007F
|
||||
#define SCAN_VOLUME_UP 0x0080
|
||||
#define SCAN_VOLUME_DOWN 0x0081
|
||||
#define SCAN_BRIGHTNESS_UP 0x0100
|
||||
#define SCAN_BRIGHTNESS_DOWN 0x0101
|
||||
#define SCAN_SUSPEND 0x0102
|
||||
#define SCAN_HIBERNATE 0x0103
|
||||
#define SCAN_TOGGLE_DISPLAY 0x0104
|
||||
#define SCAN_RECOVERY 0x0105
|
||||
#define SCAN_EJECT 0x0106
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
@ -306,4 +334,194 @@ typedef struct _SIMPLE_INPUT_INTERFACE {
|
||||
EFI_EVENT WaitForKey;
|
||||
} SIMPLE_INPUT_INTERFACE;
|
||||
|
||||
#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
|
||||
{0xdd9e7534, 0x7762, 0x4698, {0x8c, 0x14, 0xf5, 0x85, \
|
||||
0x17, 0xa6, 0x25, 0xaa} }
|
||||
|
||||
INTERFACE_DECL(_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL);
|
||||
|
||||
typedef UINT8 EFI_KEY_TOGGLE_STATE;
|
||||
//
|
||||
// Any Shift or Toggle State that is valid should have
|
||||
// high order bit set.
|
||||
//
|
||||
typedef struct EFI_KEY_STATE {
|
||||
UINT32 KeyShiftState;
|
||||
EFI_KEY_TOGGLE_STATE KeyToggleState;
|
||||
} EFI_KEY_STATE;
|
||||
|
||||
typedef struct {
|
||||
EFI_INPUT_KEY Key;
|
||||
EFI_KEY_STATE KeyState;
|
||||
} EFI_KEY_DATA;
|
||||
|
||||
//
|
||||
// Shift state
|
||||
//
|
||||
#define EFI_SHIFT_STATE_VALID 0x80000000
|
||||
#define EFI_RIGHT_SHIFT_PRESSED 0x00000001
|
||||
#define EFI_LEFT_SHIFT_PRESSED 0x00000002
|
||||
#define EFI_RIGHT_CONTROL_PRESSED 0x00000004
|
||||
#define EFI_LEFT_CONTROL_PRESSED 0x00000008
|
||||
#define EFI_RIGHT_ALT_PRESSED 0x00000010
|
||||
#define EFI_LEFT_ALT_PRESSED 0x00000020
|
||||
#define EFI_RIGHT_LOGO_PRESSED 0x00000040
|
||||
#define EFI_LEFT_LOGO_PRESSED 0x00000080
|
||||
#define EFI_MENU_KEY_PRESSED 0x00000100
|
||||
#define EFI_SYS_REQ_PRESSED 0x00000200
|
||||
|
||||
//
|
||||
// Toggle state
|
||||
//
|
||||
#define EFI_TOGGLE_STATE_VALID 0x80
|
||||
#define EFI_KEY_STATE_EXPOSED 0x40
|
||||
#define EFI_SCROLL_LOCK_ACTIVE 0x01
|
||||
#define EFI_NUM_LOCK_ACTIVE 0x02
|
||||
#define EFI_CAPS_LOCK_ACTIVE 0x04
|
||||
|
||||
//
|
||||
// EFI Key Notfication Function
|
||||
//
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) (
|
||||
IN EFI_KEY_DATA *KeyData
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_RESET_EX) (
|
||||
IN struct _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.
|
||||
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||
not be reset.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_READ_KEY_EX) (
|
||||
IN struct _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.
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_SET_STATE) (
|
||||
IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_KEY_TOGGLE_STATE *KeyToggleState
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Set certain state for the input device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
||||
state for the input device.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The device state was set successfully.
|
||||
EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
||||
not have the setting adjusted.
|
||||
EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
||||
EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) (
|
||||
IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_KEY_DATA *KeyData,
|
||||
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
|
||||
OUT EFI_HANDLE *NotifyHandle
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Register a notification function for a particular keystroke for the input device.
|
||||
|
||||
Arguments:
|
||||
This - Protocol instance pointer.
|
||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||
information data for the key that was pressed.
|
||||
KeyNotificationFunction - Points to the function to be called when the key
|
||||
sequence is typed specified by KeyData.
|
||||
NotifyHandle - Points to the unique handle assigned to the registered notification.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The notification function was registered successfully.
|
||||
EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
||||
EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) (
|
||||
IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_HANDLE 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.
|
||||
EFI_NOT_FOUND - Can not find the matching entry in database.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {
|
||||
EFI_INPUT_RESET_EX Reset;
|
||||
EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx;
|
||||
EFI_EVENT WaitForKeyEx;
|
||||
EFI_SET_STATE SetState;
|
||||
EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;
|
||||
EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;
|
||||
} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
|
||||
|
||||
#endif
|
||||
|
@ -121,6 +121,19 @@ typedef struct {
|
||||
UINT8 Addr[32];
|
||||
} EFI_MAC_ADDRESS;
|
||||
|
||||
typedef struct {
|
||||
UINT32 ReceivedQueueTimeoutValue;
|
||||
UINT32 TransmitQueueTimeoutValue;
|
||||
UINT16 ProtocolTypeFilter;
|
||||
BOOLEAN EnableUnicastReceive;
|
||||
BOOLEAN EnableMulticastReceive;
|
||||
BOOLEAN EnableBroadcastReceive;
|
||||
BOOLEAN EnablePromiscuousReceive;
|
||||
BOOLEAN FlushQueuesOnReset;
|
||||
BOOLEAN EnableReceiveTimestamps;
|
||||
BOOLEAN DisableBackgroundPolling;
|
||||
} EFI_MANAGED_NETWORK_CONFIG_DATA;
|
||||
|
||||
//
|
||||
// Memory
|
||||
//
|
||||
|
69
stand/efi/include/efigpt.h
Normal file
69
stand/efi/include/efigpt.h
Normal file
@ -0,0 +1,69 @@
|
||||
/* $FreeBSD$ */
|
||||
#ifndef _EFI_GPT_H
|
||||
#define _EFI_GPT_H
|
||||
/*++
|
||||
|
||||
Copyright (c) 1998 Intel Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
EfiGpt.h
|
||||
|
||||
Abstract:
|
||||
Include file for EFI partitioning scheme
|
||||
|
||||
|
||||
|
||||
Revision History
|
||||
|
||||
--*/
|
||||
|
||||
#define PRIMARY_PART_HEADER_LBA 1
|
||||
|
||||
typedef struct {
|
||||
EFI_TABLE_HEADER Header;
|
||||
EFI_LBA MyLBA;
|
||||
EFI_LBA AlternateLBA;
|
||||
EFI_LBA FirstUsableLBA;
|
||||
EFI_LBA LastUsableLBA;
|
||||
EFI_GUID DiskGUID;
|
||||
EFI_LBA PartitionEntryLBA;
|
||||
UINT32 NumberOfPartitionEntries;
|
||||
UINT32 SizeOfPartitionEntry;
|
||||
UINT32 PartitionEntryArrayCRC32;
|
||||
} EFI_PARTITION_TABLE_HEADER;
|
||||
|
||||
#define EFI_PTAB_HEADER_ID "EFI PART"
|
||||
|
||||
typedef struct {
|
||||
EFI_GUID PartitionTypeGUID;
|
||||
EFI_GUID UniquePartitionGUID;
|
||||
EFI_LBA StartingLBA;
|
||||
EFI_LBA EndingLBA;
|
||||
UINT64 Attributes;
|
||||
CHAR16 PartitionName[36];
|
||||
} EFI_PARTITION_ENTRY;
|
||||
|
||||
//
|
||||
// EFI Partition Attributes
|
||||
//
|
||||
#define EFI_PART_USED_BY_EFI 0x0000000000000001
|
||||
#define EFI_PART_REQUIRED_TO_FUNCTION 0x0000000000000002
|
||||
#define EFI_PART_USED_BY_OS 0x0000000000000004
|
||||
#define EFI_PART_REQUIRED_BY_OS 0x0000000000000008
|
||||
#define EFI_PART_BACKUP_REQUIRED 0x0000000000000010
|
||||
#define EFI_PART_USER_DATA 0x0000000000000020
|
||||
#define EFI_PART_CRITICAL_USER_DATA 0x0000000000000040
|
||||
#define EFI_PART_REDUNDANT_PARTITION 0x0000000000000080
|
||||
|
||||
#define EFI_PART_TYPE_UNUSED_GUID \
|
||||
{ 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }
|
||||
|
||||
#define EFI_PART_TYPE_EFI_SYSTEM_PART_GUID \
|
||||
{ 0xc12a7328, 0xf81f, 0x11d2, {0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} }
|
||||
|
||||
#define EFI_PART_TYPE_LEGACY_MBR_GUID \
|
||||
{ 0x024dee41, 0x33e7, 0x11d3, {0x9d, 0x69, 0x00, 0x08, 0xc7, 0x81, 0xf3, 0x9f} }
|
||||
|
||||
#endif
|
||||
|
460
stand/efi/include/efiip.h
Normal file
460
stand/efi/include/efiip.h
Normal file
@ -0,0 +1,460 @@
|
||||
/* $FreeBSD$ */
|
||||
#ifndef _EFI_IP_H
|
||||
#define _EFI_IP_H
|
||||
|
||||
/*++
|
||||
Copyright (c) 2013 Intel Corporation
|
||||
|
||||
--*/
|
||||
|
||||
#define EFI_IP4_SERVICE_BINDING_PROTOCOL \
|
||||
{0xc51711e7,0xb4bf,0x404a,{0xbf,0xb8,0x0a,0x04, 0x8e,0xf1,0xff,0xe4}}
|
||||
|
||||
#define EFI_IP4_PROTOCOL \
|
||||
{0x41d94cd2,0x35b6,0x455a,{0x82,0x58,0xd4,0xe5,0x13,0x34,0xaa,0xdd}}
|
||||
|
||||
#define EFI_IP6_SERVICE_BINDING_PROTOCOL \
|
||||
{0xec835dd3,0xfe0f,0x617b,{0xa6,0x21,0xb3,0x50,0xc3,0xe1,0x33,0x88}}
|
||||
|
||||
#define EFI_IP6_PROTOCOL \
|
||||
{0x2c8759d5,0x5c2d,0x66ef,{0x92,0x5f,0xb6,0x6c,0x10,0x19,0x57,0xe2}}
|
||||
|
||||
INTERFACE_DECL(_EFI_IP4);
|
||||
INTERFACE_DECL(_EFI_IP6);
|
||||
|
||||
typedef struct {
|
||||
EFI_HANDLE InstanceHandle;
|
||||
EFI_IPv4_ADDRESS Ip4Address;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
} EFI_IP4_ADDRESS_PAIR;
|
||||
|
||||
typedef struct {
|
||||
EFI_HANDLE DriverHandle;
|
||||
UINT32 AddressCount;
|
||||
EFI_IP4_ADDRESS_PAIR AddressPairs[1];
|
||||
} EFI_IP4_VARIABLE_DATA;
|
||||
|
||||
typedef struct {
|
||||
UINT8 DefaultProtocol;
|
||||
BOOLEAN AcceptAnyProtocol;
|
||||
BOOLEAN AcceptIcmpErrors;
|
||||
BOOLEAN AcceptBroadcast;
|
||||
BOOLEAN AcceptPromiscuous;
|
||||
BOOLEAN UseDefaultAddress;
|
||||
EFI_IPv4_ADDRESS StationAddress;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
UINT8 TypeOfService;
|
||||
UINT8 TimeToLive;
|
||||
BOOLEAN DoNotFragment;
|
||||
BOOLEAN RawData;
|
||||
UINT32 ReceiveTimeout;
|
||||
UINT32 TransmitTimeout;
|
||||
} EFI_IP4_CONFIG_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv4_ADDRESS SubnetAddress;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
EFI_IPv4_ADDRESS GatewayAddress;
|
||||
} EFI_IP4_ROUTE_TABLE;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 Code;
|
||||
} EFI_IP4_ICMP_TYPE;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN IsStarted;
|
||||
UINT32 MaxPacketSize;
|
||||
EFI_IP4_CONFIG_DATA ConfigData;
|
||||
BOOLEAN IsConfigured;
|
||||
UINT32 GroupCount;
|
||||
EFI_IPv4_ADDRESS *GroupTable;
|
||||
UINT32 RouteCount;
|
||||
EFI_IP4_ROUTE_TABLE *RouteTable;
|
||||
UINT32 IcmpTypeCount;
|
||||
EFI_IP4_ICMP_TYPE *IcmpTypeList;
|
||||
} EFI_IP4_MODE_DATA;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_GET_MODE_DATA) (
|
||||
IN struct _EFI_IP4 *This,
|
||||
OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
|
||||
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
|
||||
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_CONFIGURE) (
|
||||
IN struct _EFI_IP4 *This,
|
||||
IN EFI_IP4_CONFIG_DATA *IpConfigData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_GROUPS) (
|
||||
IN struct _EFI_IP4 *This,
|
||||
IN BOOLEAN JoinFlag,
|
||||
IN EFI_IPv4_ADDRESS *GroupAddress OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_ROUTES) (
|
||||
IN struct _EFI_IP4 *This,
|
||||
IN BOOLEAN DeleteRoute,
|
||||
IN EFI_IPv4_ADDRESS *SubnetAddress,
|
||||
IN EFI_IPv4_ADDRESS *SubnetMask,
|
||||
IN EFI_IPv4_ADDRESS *GatewayAddress
|
||||
);
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT8 HeaderLength:4;
|
||||
UINT8 Version:4;
|
||||
UINT8 TypeOfService;
|
||||
UINT16 TotalLength;
|
||||
UINT16 Identification;
|
||||
UINT16 Fragmentation;
|
||||
UINT8 TimeToLive;
|
||||
UINT8 Protocol;
|
||||
UINT16 Checksum;
|
||||
EFI_IPv4_ADDRESS SourceAddress;
|
||||
EFI_IPv4_ADDRESS DestinationAddress;
|
||||
} EFI_IP4_HEADER;
|
||||
#pragma pack()
|
||||
|
||||
typedef struct {
|
||||
UINT32 FragmentLength;
|
||||
VOID *FragmentBuffer;
|
||||
} EFI_IP4_FRAGMENT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_TIME TimeStamp;
|
||||
EFI_EVENT RecycleSignal;
|
||||
UINT32 HeaderLength;
|
||||
EFI_IP4_HEADER *Header;
|
||||
UINT32 OptionsLength;
|
||||
VOID *Options;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_IP4_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_IP4_RECEIVE_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv4_ADDRESS SourceAddress;
|
||||
EFI_IPv4_ADDRESS GatewayAddress;
|
||||
UINT8 Protocol;
|
||||
UINT8 TypeOfService;
|
||||
UINT8 TimeToLive;
|
||||
BOOLEAN DoNotFragment;
|
||||
} EFI_IP4_OVERRIDE_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv4_ADDRESS DestinationAddress;
|
||||
EFI_IP4_OVERRIDE_DATA *OverrideData;
|
||||
UINT32 OptionsLength;
|
||||
VOID *OptionsBuffer;
|
||||
UINT32 TotalDataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_IP4_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_IP4_TRANSMIT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_EVENT Event;
|
||||
EFI_STATUS Status;
|
||||
union {
|
||||
EFI_IP4_RECEIVE_DATA *RxData;
|
||||
EFI_IP4_TRANSMIT_DATA *TxData;
|
||||
} Packet;
|
||||
} EFI_IP4_COMPLETION_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_TRANSMIT) (
|
||||
IN struct _EFI_IP4 *This,
|
||||
IN EFI_IP4_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_RECEIVE) (
|
||||
IN struct _EFI_IP4 *This,
|
||||
IN EFI_IP4_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_CANCEL)(
|
||||
IN struct _EFI_IP4 *This,
|
||||
IN EFI_IP4_COMPLETION_TOKEN *Token OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP4_POLL) (
|
||||
IN struct _EFI_IP4 *This
|
||||
);
|
||||
|
||||
typedef struct _EFI_IP4 {
|
||||
EFI_IP4_GET_MODE_DATA GetModeData;
|
||||
EFI_IP4_CONFIGURE Configure;
|
||||
EFI_IP4_GROUPS Groups;
|
||||
EFI_IP4_ROUTES Routes;
|
||||
EFI_IP4_TRANSMIT Transmit;
|
||||
EFI_IP4_RECEIVE Receive;
|
||||
EFI_IP4_CANCEL Cancel;
|
||||
EFI_IP4_POLL Poll;
|
||||
} EFI_IP4;
|
||||
|
||||
typedef struct {
|
||||
UINT8 DefaultProtocol;
|
||||
BOOLEAN AcceptAnyProtocol;
|
||||
BOOLEAN AcceptIcmpErrors;
|
||||
BOOLEAN AcceptPromiscuous;
|
||||
EFI_IPv6_ADDRESS DestinationAddress;
|
||||
EFI_IPv6_ADDRESS StationAddress;
|
||||
UINT8 TrafficClass;
|
||||
UINT8 HopLimit;
|
||||
UINT32 FlowLabel;
|
||||
UINT32 ReceiveTimeout;
|
||||
UINT32 TransmitTimeout;
|
||||
} EFI_IP6_CONFIG_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv6_ADDRESS Address;
|
||||
UINT8 PrefixLength;
|
||||
} EFI_IP6_ADDRESS_INFO;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv6_ADDRESS Gateway;
|
||||
EFI_IPv6_ADDRESS Destination;
|
||||
UINT8 PrefixLength;
|
||||
} EFI_IP6_ROUTE_TABLE;
|
||||
|
||||
typedef enum {
|
||||
EfiNeighborInComplete,
|
||||
EfiNeighborReachable,
|
||||
EfiNeighborStale,
|
||||
EfiNeighborDelay,
|
||||
EfiNeighborProbe
|
||||
} EFI_IP6_NEIGHBOR_STATE;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv6_ADDRESS Neighbor;
|
||||
EFI_MAC_ADDRESS LinkAddress;
|
||||
EFI_IP6_NEIGHBOR_STATE State;
|
||||
} EFI_IP6_NEIGHBOR_CACHE;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 Code;
|
||||
} EFI_IP6_ICMP_TYPE;
|
||||
|
||||
//***********************************************************
|
||||
// ICMPv6 type definitions for error messages
|
||||
//***********************************************************
|
||||
#define ICMP_V6_DEST_UNREACHABLE 0x1
|
||||
#define ICMP_V6_PACKET_TOO_BIG 0x2
|
||||
#define ICMP_V6_TIME_EXCEEDED 0x3
|
||||
#define ICMP_V6_PARAMETER_PROBLEM 0x4
|
||||
|
||||
//***********************************************************
|
||||
// ICMPv6 type definition for informational messages
|
||||
//***********************************************************
|
||||
#define ICMP_V6_ECHO_REQUEST 0x80
|
||||
#define ICMP_V6_ECHO_REPLY 0x81
|
||||
#define ICMP_V6_LISTENER_QUERY 0x82
|
||||
#define ICMP_V6_LISTENER_REPORT 0x83
|
||||
#define ICMP_V6_LISTENER_DONE 0x84
|
||||
#define ICMP_V6_ROUTER_SOLICIT 0x85
|
||||
#define ICMP_V6_ROUTER_ADVERTISE 0x86
|
||||
#define ICMP_V6_NEIGHBOR_SOLICIT 0x87
|
||||
#define ICMP_V6_NEIGHBOR_ADVERTISE 0x88
|
||||
#define ICMP_V6_REDIRECT 0x89
|
||||
#define ICMP_V6_LISTENER_REPORT_2 0x8F
|
||||
|
||||
//***********************************************************
|
||||
// ICMPv6 code definitions for ICMP_V6_DEST_UNREACHABLE
|
||||
//***********************************************************
|
||||
#define ICMP_V6_NO_ROUTE_TO_DEST 0x0
|
||||
#define ICMP_V6_COMM_PROHIBITED 0x1
|
||||
#define ICMP_V6_BEYOND_SCOPE 0x2
|
||||
#define ICMP_V6_ADDR_UNREACHABLE 0x3
|
||||
#define ICMP_V6_PORT_UNREACHABLE 0x4
|
||||
#define ICMP_V6_SOURCE_ADDR_FAILED 0x5
|
||||
#define ICMP_V6_ROUTE_REJECTED 0x6
|
||||
|
||||
//***********************************************************
|
||||
// ICMPv6 code definitions for ICMP_V6_TIME_EXCEEDED
|
||||
//***********************************************************
|
||||
#define ICMP_V6_TIMEOUT_HOP_LIMIT 0x0
|
||||
#define ICMP_V6_TIMEOUT_REASSEMBLE 0x1
|
||||
|
||||
//***********************************************************
|
||||
// ICMPv6 code definitions for ICMP_V6_PARAMETER_PROBLEM
|
||||
//***********************************************************
|
||||
#define ICMP_V6_ERRONEOUS_HEADER 0x0
|
||||
#define ICMP_V6_UNRECOGNIZE_NEXT_HDR 0x1
|
||||
#define ICMP_V6_UNRECOGNIZE_OPTION 0x2
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN IsStarted;
|
||||
UINT32 MaxPacketSize;
|
||||
EFI_IP6_CONFIG_DATA ConfigData;
|
||||
BOOLEAN IsConfigured;
|
||||
UINT32 AddressCount;
|
||||
EFI_IP6_ADDRESS_INFO *AddressList;
|
||||
UINT32 GroupCount;
|
||||
EFI_IPv6_ADDRESS *GroupTable;
|
||||
UINT32 RouteCount;
|
||||
EFI_IP6_ROUTE_TABLE *RouteTable;
|
||||
UINT32 NeighborCount;
|
||||
EFI_IP6_NEIGHBOR_CACHE *NeighborCache;
|
||||
UINT32 PrefixCount;
|
||||
EFI_IP6_ADDRESS_INFO *PrefixTable;
|
||||
UINT32 IcmpTypeCount;
|
||||
EFI_IP6_ICMP_TYPE *IcmpTypeList;
|
||||
} EFI_IP6_MODE_DATA;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_GET_MODE_DATA) (
|
||||
IN struct _EFI_IP6 *This,
|
||||
OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
|
||||
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
|
||||
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_CONFIGURE) (
|
||||
IN struct _EFI_IP6 *This,
|
||||
IN EFI_IP6_CONFIG_DATA *Ip6ConfigData OPTIONAL
|
||||
);
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_GROUPS) (
|
||||
IN struct _EFI_IP6 *This,
|
||||
IN BOOLEAN JoinFlag,
|
||||
IN EFI_IPv6_ADDRESS *GroupAddress OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_ROUTES) (
|
||||
IN struct _EFI_IP6 *This,
|
||||
IN BOOLEAN DeleteRoute,
|
||||
IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
|
||||
IN UINT8 PrefixLength,
|
||||
IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_NEIGHBORS) (
|
||||
IN struct _EFI_IP6 *This,
|
||||
IN BOOLEAN DeleteFlag,
|
||||
IN EFI_IPv6_ADDRESS *TargetIp6Address,
|
||||
IN EFI_MAC_ADDRESS *TargetLinkAddress OPTIONAL,
|
||||
IN UINT32 Timeout,
|
||||
IN BOOLEAN Override
|
||||
);
|
||||
|
||||
typedef struct _EFI_IP6_FRAGMENT_DATA {
|
||||
UINT32 FragmentLength;
|
||||
VOID *FragmentBuffer;
|
||||
} EFI_IP6_FRAGMENT_DATA;
|
||||
|
||||
typedef struct _EFI_IP6_OVERRIDE_DATA {
|
||||
UINT8 Protocol;
|
||||
UINT8 HopLimit;
|
||||
UINT32 FlowLabel;
|
||||
} EFI_IP6_OVERRIDE_DATA;
|
||||
|
||||
typedef struct _EFI_IP6_TRANSMIT_DATA {
|
||||
EFI_IPv6_ADDRESS DestinationAddress;
|
||||
EFI_IP6_OVERRIDE_DATA *OverrideData;
|
||||
UINT32 ExtHdrsLength;
|
||||
VOID *ExtHdrs;
|
||||
UINT8 NextHeader;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_IP6_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_IP6_TRANSMIT_DATA;
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct _EFI_IP6_HEADER {
|
||||
UINT8 TrafficClassH:4;
|
||||
UINT8 Version:4;
|
||||
UINT8 FlowLabelH:4;
|
||||
UINT8 TrafficClassL:4;
|
||||
UINT16 FlowLabelL;
|
||||
UINT16 PayloadLength;
|
||||
UINT8 NextHeader;
|
||||
UINT8 HopLimit;
|
||||
EFI_IPv6_ADDRESS SourceAddress;
|
||||
EFI_IPv6_ADDRESS DestinationAddress;
|
||||
} EFI_IP6_HEADER;
|
||||
#pragma pack()
|
||||
|
||||
typedef struct _EFI_IP6_RECEIVE_DATA {
|
||||
EFI_TIME TimeStamp;
|
||||
EFI_EVENT RecycleSignal;
|
||||
UINT32 HeaderLength;
|
||||
EFI_IP6_HEADER *Header;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_IP6_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_IP6_RECEIVE_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_EVENT Event;
|
||||
EFI_STATUS Status;
|
||||
union {
|
||||
EFI_IP6_RECEIVE_DATA *RxData;
|
||||
EFI_IP6_TRANSMIT_DATA *TxData;
|
||||
} Packet;
|
||||
} EFI_IP6_COMPLETION_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_TRANSMIT) (
|
||||
IN struct _EFI_IP6 *This,
|
||||
IN EFI_IP6_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_RECEIVE) (
|
||||
IN struct _EFI_IP6 *This,
|
||||
IN EFI_IP6_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_CANCEL)(
|
||||
IN struct _EFI_IP6 *This,
|
||||
IN EFI_IP6_COMPLETION_TOKEN *Token OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IP6_POLL) (
|
||||
IN struct _EFI_IP6 *This
|
||||
);
|
||||
|
||||
typedef struct _EFI_IP6 {
|
||||
EFI_IP6_GET_MODE_DATA GetModeData;
|
||||
EFI_IP6_CONFIGURE Configure;
|
||||
EFI_IP6_GROUPS Groups;
|
||||
EFI_IP6_ROUTES Routes;
|
||||
EFI_IP6_NEIGHBORS Neighbors;
|
||||
EFI_IP6_TRANSMIT Transmit;
|
||||
EFI_IP6_RECEIVE Receive;
|
||||
EFI_IP6_CANCEL Cancel;
|
||||
EFI_IP6_POLL Poll;
|
||||
} EFI_IP6;
|
||||
|
||||
#endif /* _EFI_IP_H */
|
@ -127,6 +127,12 @@ EFI_STATUS efi_getenv(EFI_GUID *g, const char *v, void *data, __size_t *len);
|
||||
EFI_STATUS efi_global_getenv(const char *v, void *data, __size_t *len);
|
||||
EFI_STATUS efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr);
|
||||
|
||||
/* guids and names */
|
||||
bool efi_guid_to_str(const EFI_GUID *, char **);
|
||||
bool efi_str_to_guid(const char *, EFI_GUID *);
|
||||
bool efi_name_to_guid(const char *, EFI_GUID *);
|
||||
bool efi_guid_to_name(EFI_GUID *, char **);
|
||||
|
||||
/* efipart.c */
|
||||
int efipart_inithandles(void);
|
||||
|
||||
|
@ -17,6 +17,9 @@
|
||||
#ifndef __PCI_IO_H__
|
||||
#define __PCI_IO_H__
|
||||
|
||||
#define EFI_PCI_ROOT_IO_GUID \
|
||||
{ 0x2F707EBB, 0x4A1A, 0x11d4, { 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}
|
||||
|
||||
///
|
||||
/// Global ID for the PCI I/O Protocol
|
||||
///
|
||||
|
116
stand/efi/include/efipoint.h
Normal file
116
stand/efi/include/efipoint.h
Normal file
@ -0,0 +1,116 @@
|
||||
/* $FreeBSD$ */
|
||||
/* Copyright (C) 2014 by John Cronin
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _EFI_POINT_H
|
||||
#define _EFI_POINT_H
|
||||
|
||||
#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
|
||||
{ 0x31878c87, 0xb75, 0x11d5, { 0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
|
||||
|
||||
INTERFACE_DECL(_EFI_SIMPLE_POINTER);
|
||||
|
||||
typedef struct {
|
||||
INT32 RelativeMovementX;
|
||||
INT32 RelativeMovementY;
|
||||
INT32 RelativeMovementZ;
|
||||
BOOLEAN LeftButton;
|
||||
BOOLEAN RightButton;
|
||||
} EFI_SIMPLE_POINTER_STATE;
|
||||
|
||||
typedef struct {
|
||||
UINT64 ResolutionX;
|
||||
UINT64 ResolutionY;
|
||||
UINT64 ResolutionZ;
|
||||
BOOLEAN LeftButton;
|
||||
BOOLEAN RightButton;
|
||||
} EFI_SIMPLE_POINTER_MODE;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_SIMPLE_POINTER_RESET) (
|
||||
IN struct _EFI_SIMPLE_POINTER *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_SIMPLE_POINTER_GET_STATE) (
|
||||
IN struct _EFI_SIMPLE_POINTER *This,
|
||||
IN OUT EFI_SIMPLE_POINTER_STATE *State
|
||||
);
|
||||
|
||||
typedef struct _EFI_SIMPLE_POINTER {
|
||||
EFI_SIMPLE_POINTER_RESET Reset;
|
||||
EFI_SIMPLE_POINTER_GET_STATE GetState;
|
||||
EFI_EVENT WaitForInput;
|
||||
EFI_SIMPLE_POINTER_MODE *Mode;
|
||||
} EFI_SIMPLE_POINTER_PROTOCOL;
|
||||
|
||||
#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \
|
||||
{ 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }
|
||||
|
||||
INTERFACE_DECL(_EFI_ABSOLUTE_POINTER_PROTOCOL);
|
||||
|
||||
typedef struct {
|
||||
UINT64 AbsoluteMinX;
|
||||
UINT64 AbsoluteMinY;
|
||||
UINT64 AbsoluteMinZ;
|
||||
UINT64 AbsoluteMaxX;
|
||||
UINT64 AbsoluteMaxY;
|
||||
UINT64 AbsoluteMaxZ;
|
||||
UINT32 Attributes;
|
||||
} EFI_ABSOLUTE_POINTER_MODE;
|
||||
|
||||
typedef struct {
|
||||
UINT64 CurrentX;
|
||||
UINT64 CurrentY;
|
||||
UINT64 CurrentZ;
|
||||
UINT32 ActiveButtons;
|
||||
} EFI_ABSOLUTE_POINTER_STATE;
|
||||
|
||||
#define EFI_ABSP_SupportsAltActive 0x00000001
|
||||
#define EFI_ABSP_SupportsPressureAsZ 0x00000002
|
||||
#define EFI_ABSP_TouchActive 0x00000001
|
||||
#define EFI_ABS_AltActive 0x00000002
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ABSOLUTE_POINTER_RESET) (
|
||||
IN struct _EFI_ABSOLUTE_POINTER_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE) (
|
||||
IN struct _EFI_ABSOLUTE_POINTER_PROTOCOL *This,
|
||||
IN OUT EFI_ABSOLUTE_POINTER_STATE *State
|
||||
);
|
||||
|
||||
typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL {
|
||||
EFI_ABSOLUTE_POINTER_RESET Reset;
|
||||
EFI_ABSOLUTE_POINTER_GET_STATE GetState;
|
||||
EFI_EVENT WaitForInput;
|
||||
EFI_ABSOLUTE_POINTER_MODE *Mode;
|
||||
} EFI_ABSOLUTE_POINTER_PROTOCOL;
|
||||
|
||||
#endif
|
392
stand/efi/include/efitcp.h
Normal file
392
stand/efi/include/efitcp.h
Normal file
@ -0,0 +1,392 @@
|
||||
/* $FreeBSD$ */
|
||||
#ifndef _EFI_TCP_H
|
||||
#define _EFI_TCP_H
|
||||
|
||||
/*++
|
||||
Copyright (c) 2013 Intel Corporation
|
||||
|
||||
--*/
|
||||
|
||||
#define EFI_TCP4_SERVICE_BINDING_PROTOCOL \
|
||||
{ 0x00720665, 0x67eb, 0x4a99, {0xba, 0xf7, 0xd3, 0xc3, 0x3a, 0x1c,0x7c, 0xc9}}
|
||||
|
||||
#define EFI_TCP4_PROTOCOL \
|
||||
{ 0x65530bc7, 0xa359, 0x410f, {0xb0, 0x10, 0x5a, 0xad, 0xc7, 0xec, 0x2b, 0x62}}
|
||||
|
||||
#define EFI_TCP6_SERVICE_BINDING_PROTOCOL \
|
||||
{ 0xec20eb79, 0x6c1a, 0x4664, {0x9a, 0xd, 0xd2, 0xe4, 0xcc, 0x16, 0xd6, 0x64}}
|
||||
|
||||
#define EFI_TCP6_PROTOCOL \
|
||||
{ 0x46e44855, 0xbd60, 0x4ab7, {0xab, 0xd, 0xa6, 0x79, 0xb9, 0x44, 0x7d, 0x77}}
|
||||
|
||||
INTERFACE_DECL(_EFI_TCP4);
|
||||
INTERFACE_DECL(_EFI_TCP6);
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN UseDefaultAddress;
|
||||
EFI_IPv4_ADDRESS StationAddress;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
UINT16 StationPort;
|
||||
EFI_IPv4_ADDRESS RemoteAddress;
|
||||
UINT16 RemotePort;
|
||||
BOOLEAN ActiveFlag;
|
||||
} EFI_TCP4_ACCESS_POINT;
|
||||
|
||||
typedef struct {
|
||||
UINT32 ReceiveBufferSize;
|
||||
UINT32 SendBufferSize;
|
||||
UINT32 MaxSynBackLog;
|
||||
UINT32 ConnectionTimeout;
|
||||
UINT32 DataRetries;
|
||||
UINT32 FinTimeout;
|
||||
UINT32 TimeWaitTimeout;
|
||||
UINT32 KeepAliveProbes;
|
||||
UINT32 KeepAliveTime;
|
||||
UINT32 KeepAliveInterval;
|
||||
BOOLEAN EnableNagle;
|
||||
BOOLEAN EnableTimeStamp;
|
||||
BOOLEAN EnableWindowScaling;
|
||||
BOOLEAN EnableSelectiveAck;
|
||||
BOOLEAN EnablePAthMtuDiscovery;
|
||||
} EFI_TCP4_OPTION;
|
||||
|
||||
typedef struct {
|
||||
// Receiving Filters
|
||||
// I/O parameters
|
||||
UINT8 TypeOfService;
|
||||
UINT8 TimeToLive;
|
||||
|
||||
// Access Point
|
||||
EFI_TCP4_ACCESS_POINT AccessPoint;
|
||||
|
||||
// TCP Control Options
|
||||
EFI_TCP4_OPTION *ControlOption;
|
||||
} EFI_TCP4_CONFIG_DATA;
|
||||
|
||||
typedef enum {
|
||||
Tcp4StateClosed = 0,
|
||||
Tcp4StateListen = 1,
|
||||
Tcp4StateSynSent = 2,
|
||||
Tcp4StateSynReceived = 3,
|
||||
Tcp4StateEstablished = 4,
|
||||
Tcp4StateFinWait1 = 5,
|
||||
Tcp4StateFinWait2 = 6,
|
||||
Tcp4StateClosing = 7,
|
||||
Tcp4StateTimeWait = 8,
|
||||
Tcp4StateCloseWait = 9,
|
||||
Tcp4StateLastAck = 10
|
||||
} EFI_TCP4_CONNECTION_STATE;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_GET_MODE_DATA) (
|
||||
IN struct _EFI_TCP4 *This,
|
||||
OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL,
|
||||
OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL,
|
||||
OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
|
||||
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
|
||||
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_CONFIGURE) (
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_ROUTES) (
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN BOOLEAN DeleteRoute,
|
||||
IN EFI_IPv4_ADDRESS *SubnetAddress,
|
||||
IN EFI_IPv4_ADDRESS *SubnetMask,
|
||||
IN EFI_IPv4_ADDRESS *GatewayAddress
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_EVENT Event;
|
||||
EFI_STATUS Status;
|
||||
} EFI_TCP4_COMPLETION_TOKEN;
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
|
||||
} EFI_TCP4_CONNECTION_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_CONNECT) (
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
|
||||
EFI_HANDLE NewChildHandle;
|
||||
} EFI_TCP4_LISTEN_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_ACCEPT) (
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN EFI_TCP4_LISTEN_TOKEN *ListenToken
|
||||
);
|
||||
|
||||
#define EFI_CONNECTION_FIN EFIERR(104)
|
||||
#define EFI_CONNECTION_RESET EFIERR(105)
|
||||
#define EFI_CONNECTION_REFUSED EFIERR(106)
|
||||
|
||||
typedef struct {
|
||||
UINT32 FragmentLength;
|
||||
VOID *FragmentBuffer;
|
||||
} EFI_TCP4_FRAGMENT_DATA;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN UrgentFlag;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_TCP4_RECEIVE_DATA;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN Push;
|
||||
BOOLEAN Urgent;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_TCP4_TRANSMIT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
|
||||
union {
|
||||
EFI_TCP4_RECEIVE_DATA *RxData;
|
||||
EFI_TCP4_TRANSMIT_DATA *TxData;
|
||||
} Packet;
|
||||
} EFI_TCP4_IO_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_TRANSMIT) (
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN EFI_TCP4_IO_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_RECEIVE) (
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN EFI_TCP4_IO_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
|
||||
BOOLEAN AbortOnClose;
|
||||
} EFI_TCP4_CLOSE_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_CLOSE)(
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN EFI_TCP4_CLOSE_TOKEN *CloseToken
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_CANCEL)(
|
||||
IN struct _EFI_TCP4 *This,
|
||||
IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP4_POLL) (
|
||||
IN struct _EFI_TCP4 *This
|
||||
);
|
||||
|
||||
typedef struct _EFI_TCP4 {
|
||||
EFI_TCP4_GET_MODE_DATA GetModeData;
|
||||
EFI_TCP4_CONFIGURE Configure;
|
||||
EFI_TCP4_ROUTES Routes;
|
||||
EFI_TCP4_CONNECT Connect;
|
||||
EFI_TCP4_ACCEPT Accept;
|
||||
EFI_TCP4_TRANSMIT Transmit;
|
||||
EFI_TCP4_RECEIVE Receive;
|
||||
EFI_TCP4_CLOSE Close;
|
||||
EFI_TCP4_CANCEL Cancel;
|
||||
EFI_TCP4_POLL Poll;
|
||||
} EFI_TCP4;
|
||||
|
||||
typedef enum {
|
||||
Tcp6StateClosed = 0,
|
||||
Tcp6StateListen = 1,
|
||||
Tcp6StateSynSent = 2,
|
||||
Tcp6StateSynReceived = 3,
|
||||
Tcp6StateEstablished = 4,
|
||||
Tcp6StateFinWait1 = 5,
|
||||
Tcp6StateFinWait2 = 6,
|
||||
Tcp6StateClosing = 7,
|
||||
Tcp6StateTimeWait = 8,
|
||||
Tcp6StateCloseWait = 9,
|
||||
Tcp6StateLastAck = 10
|
||||
} EFI_TCP6_CONNECTION_STATE;
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv6_ADDRESS StationAddress;
|
||||
UINT16 StationPort;
|
||||
EFI_IPv6_ADDRESS RemoteAddress;
|
||||
UINT16 RemotePort;
|
||||
BOOLEAN ActiveFlag;
|
||||
} EFI_TCP6_ACCESS_POINT;
|
||||
|
||||
typedef struct {
|
||||
UINT32 ReceiveBufferSize;
|
||||
UINT32 SendBufferSize;
|
||||
UINT32 MaxSynBackLog;
|
||||
UINT32 ConnectionTimeout;
|
||||
UINT32 DataRetries;
|
||||
UINT32 FinTimeout;
|
||||
UINT32 TimeWaitTimeout;
|
||||
UINT32 KeepAliveProbes;
|
||||
UINT32 KeepAliveTime;
|
||||
UINT32 KeepAliveInterval;
|
||||
BOOLEAN EnableNagle;
|
||||
BOOLEAN EnableTimeStamp;
|
||||
BOOLEAN EnableWindbowScaling;
|
||||
BOOLEAN EnableSelectiveAck;
|
||||
BOOLEAN EnablePathMtuDiscovery;
|
||||
} EFI_TCP6_OPTION;
|
||||
|
||||
typedef struct {
|
||||
UINT8 TrafficClass;
|
||||
UINT8 HopLimit;
|
||||
EFI_TCP6_ACCESS_POINT AccessPoint;
|
||||
EFI_TCP6_OPTION *ControlOption;
|
||||
} EFI_TCP6_CONFIG_DATA;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_GET_MODE_DATA) (
|
||||
IN struct _EFI_TCP6 *This,
|
||||
OUT EFI_TCP6_CONNECTION_STATE *Tcp6State OPTIONAL,
|
||||
OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL,
|
||||
OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
|
||||
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
|
||||
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_CONFIGURE) (
|
||||
IN struct _EFI_TCP6 *This,
|
||||
IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_EVENT Event;
|
||||
EFI_STATUS Status;
|
||||
} EFI_TCP6_COMPLETION_TOKEN;
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP6_COMPLETION_TOKEN CompletionToken;
|
||||
} EFI_TCP6_CONNECTION_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_CONNECT) (
|
||||
IN struct _EFI_TCP6 *This,
|
||||
IN EFI_TCP6_CONNECTION_TOKEN *ConnectionToken
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP6_COMPLETION_TOKEN CompletionToken;
|
||||
EFI_HANDLE NewChildHandle;
|
||||
} EFI_TCP6_LISTEN_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_ACCEPT) (
|
||||
IN struct _EFI_TCP6 *This,
|
||||
IN EFI_TCP6_LISTEN_TOKEN *ListenToken
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
UINT32 FragmentLength;
|
||||
VOID *FragmentBuffer;
|
||||
} EFI_TCP6_FRAGMENT_DATA;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN UrgentFlag;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_TCP6_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_TCP6_RECEIVE_DATA;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN Push;
|
||||
BOOLEAN Urgent;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_TCP6_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_TCP6_TRANSMIT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP6_COMPLETION_TOKEN CompletionToken;
|
||||
union {
|
||||
EFI_TCP6_RECEIVE_DATA *RxData;
|
||||
EFI_TCP6_TRANSMIT_DATA *TxData;
|
||||
} Packet;
|
||||
} EFI_TCP6_IO_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_TRANSMIT) (
|
||||
IN struct _EFI_TCP6 *This,
|
||||
IN EFI_TCP6_IO_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_RECEIVE) (
|
||||
IN struct _EFI_TCP6 *This,
|
||||
IN EFI_TCP6_IO_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_TCP6_COMPLETION_TOKEN CompletionToken;
|
||||
BOOLEAN AbortOnClose;
|
||||
} EFI_TCP6_CLOSE_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_CLOSE)(
|
||||
IN struct _EFI_TCP6 *This,
|
||||
IN EFI_TCP6_CLOSE_TOKEN *CloseToken
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_CANCEL)(
|
||||
IN struct _EFI_TCP6 *This,
|
||||
IN EFI_TCP6_COMPLETION_TOKEN *Token OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TCP6_POLL) (
|
||||
IN struct _EFI_TCP6 *This
|
||||
);
|
||||
|
||||
typedef struct _EFI_TCP6 {
|
||||
EFI_TCP6_GET_MODE_DATA GetModeData;
|
||||
EFI_TCP6_CONFIGURE Configure;
|
||||
EFI_TCP6_CONNECT Connect;
|
||||
EFI_TCP6_ACCEPT Accept;
|
||||
EFI_TCP6_TRANSMIT Transmit;
|
||||
EFI_TCP6_RECEIVE Receive;
|
||||
EFI_TCP6_CLOSE Close;
|
||||
EFI_TCP6_CANCEL Cancel;
|
||||
EFI_TCP6_POLL Poll;
|
||||
} EFI_TCP6;
|
||||
|
||||
#endif /* _EFI_TCP_H */
|
273
stand/efi/include/efiudp.h
Normal file
273
stand/efi/include/efiudp.h
Normal file
@ -0,0 +1,273 @@
|
||||
/* $FreeBSD$ */
|
||||
#ifndef _EFI_UDP_H
|
||||
#define _EFI_UDP_H
|
||||
|
||||
|
||||
/*++
|
||||
Copyright (c) 2013 Intel Corporation
|
||||
|
||||
--*/
|
||||
|
||||
#define EFI_UDP4_SERVICE_BINDING_PROTOCOL \
|
||||
{ 0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6} }
|
||||
|
||||
#define EFI_UDP4_PROTOCOL \
|
||||
{ 0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3} }
|
||||
|
||||
#define EFI_UDP6_SERVICE_BINDING_PROTOCOL \
|
||||
{ 0x66ed4721, 0x3c98, 0x4d3e, {0x81, 0xe3, 0xd0, 0x3d, 0xd3, 0x9a, 0x72, 0x54} }
|
||||
|
||||
#define EFI_UDP6_PROTOCOL \
|
||||
{ 0x4f948815, 0xb4b9, 0x43cb, {0x8a, 0x33, 0x90, 0xe0, 0x60, 0xb3,0x49, 0x55} }
|
||||
|
||||
INTERFACE_DECL(_EFI_UDP4);
|
||||
INTERFACE_DECL(_EFI_UDP6);
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN AcceptBroadcast;
|
||||
BOOLEAN AcceptPromiscuous;
|
||||
BOOLEAN AcceptAnyPort;
|
||||
BOOLEAN AllowDuplicatePort;
|
||||
UINT8 TypeOfService;
|
||||
UINT8 TimeToLive;
|
||||
BOOLEAN DoNotFragment;
|
||||
UINT32 ReceiveTimeout;
|
||||
UINT32 TransmitTimeout;
|
||||
BOOLEAN UseDefaultAddress;
|
||||
EFI_IPv4_ADDRESS StationAddress;
|
||||
EFI_IPv4_ADDRESS SubnetMask;
|
||||
UINT16 StationPort;
|
||||
EFI_IPv4_ADDRESS RemoteAddress;
|
||||
UINT16 RemotePort;
|
||||
} EFI_UDP4_CONFIG_DATA;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_GET_MODE_DATA) (
|
||||
IN struct _EFI_UDP4 *This,
|
||||
OUT EFI_UDP4_CONFIG_DATA *Udp4ConfigData OPTIONAL,
|
||||
OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
|
||||
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
|
||||
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_CONFIGURE) (
|
||||
IN struct _EFI_UDP4 *This,
|
||||
IN EFI_UDP4_CONFIG_DATA *UdpConfigData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_GROUPS) (
|
||||
IN struct _EFI_UDP4 *This,
|
||||
IN BOOLEAN JoinFlag,
|
||||
IN EFI_IPv4_ADDRESS *MulticastAddress OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_ROUTES) (
|
||||
IN struct _EFI_UDP4 *This,
|
||||
IN BOOLEAN DeleteRoute,
|
||||
IN EFI_IPv4_ADDRESS *SubnetAddress,
|
||||
IN EFI_IPv4_ADDRESS *SubnetMask,
|
||||
IN EFI_IPv4_ADDRESS *GatewayAddress
|
||||
);
|
||||
|
||||
#define EFI_NETWORK_UNREACHABLE EFIERR(100)
|
||||
#define EFI_HOST_UNREACHABLE EFIERR(101)
|
||||
#define EFI_PROTOCOL_UNREACHABLE EFIERR(102)
|
||||
#define EFI_PORT_UNREACHABLE EFIERR(103)
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv4_ADDRESS SourceAddress;
|
||||
UINT16 SourcePort;
|
||||
EFI_IPv4_ADDRESS DestinationAddress;
|
||||
UINT16 DestinationPort;
|
||||
} EFI_UDP4_SESSION_DATA;
|
||||
|
||||
typedef struct {
|
||||
UINT32 FragmentLength;
|
||||
VOID *FragmentBuffer;
|
||||
} EFI_UDP4_FRAGMENT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_TIME TimeStamp;
|
||||
EFI_EVENT RecycleSignal;
|
||||
EFI_UDP4_SESSION_DATA UdpSession;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_UDP4_RECEIVE_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_UDP4_SESSION_DATA *UdpSessionData;
|
||||
EFI_IPv4_ADDRESS *GatewayAddress;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_UDP4_TRANSMIT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_EVENT Event;
|
||||
EFI_STATUS Status;
|
||||
union {
|
||||
EFI_UDP4_RECEIVE_DATA *RxData;
|
||||
EFI_UDP4_TRANSMIT_DATA *TxData;
|
||||
} Packet;
|
||||
} EFI_UDP4_COMPLETION_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_TRANSMIT) (
|
||||
IN struct _EFI_UDP4 *This,
|
||||
IN EFI_UDP4_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_RECEIVE) (
|
||||
IN struct _EFI_UDP4 *This,
|
||||
IN EFI_UDP4_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_CANCEL)(
|
||||
IN struct _EFI_UDP4 *This,
|
||||
IN EFI_UDP4_COMPLETION_TOKEN *Token OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP4_POLL) (
|
||||
IN struct _EFI_UDP4 *This
|
||||
);
|
||||
|
||||
typedef struct _EFI_UDP4 {
|
||||
EFI_UDP4_GET_MODE_DATA GetModeData;
|
||||
EFI_UDP4_CONFIGURE Configure;
|
||||
EFI_UDP4_GROUPS Groups;
|
||||
EFI_UDP4_ROUTES Routes;
|
||||
EFI_UDP4_TRANSMIT Transmit;
|
||||
EFI_UDP4_RECEIVE Receive;
|
||||
EFI_UDP4_CANCEL Cancel;
|
||||
EFI_UDP4_POLL Poll;
|
||||
} EFI_UDP4;
|
||||
|
||||
typedef struct {
|
||||
BOOLEAN AcceptPromiscuous;
|
||||
BOOLEAN AcceptAnyPort;
|
||||
BOOLEAN AllowDuplicatePort;
|
||||
UINT8 TrafficClass;
|
||||
UINT8 HopLimit;
|
||||
UINT32 ReceiveTimeout;
|
||||
UINT32 TransmitTimeout;
|
||||
EFI_IPv6_ADDRESS StationAddress;
|
||||
UINT16 StationPort;
|
||||
EFI_IPv6_ADDRESS RemoteAddress;
|
||||
UINT16 RemotePort;
|
||||
} EFI_UDP6_CONFIG_DATA;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP6_GET_MODE_DATA) (
|
||||
IN struct _EFI_UDP6 *This,
|
||||
OUT EFI_UDP6_CONFIG_DATA *Udp6ConfigData OPTIONAL,
|
||||
OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL,
|
||||
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
|
||||
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP6_CONFIGURE) (
|
||||
IN struct _EFI_UDP6 *This,
|
||||
IN EFI_UDP6_CONFIG_DATA *UdpConfigData OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP6_GROUPS) (
|
||||
IN struct _EFI_UDP6 *This,
|
||||
IN BOOLEAN JoinFlag,
|
||||
IN EFI_IPv6_ADDRESS *MulticastAddress OPTIONAL
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
EFI_IPv6_ADDRESS SourceAddress;
|
||||
UINT16 SourcePort;
|
||||
EFI_IPv6_ADDRESS DestinationAddress;
|
||||
UINT16 DestinationPort;
|
||||
} EFI_UDP6_SESSION_DATA;
|
||||
|
||||
typedef struct {
|
||||
UINT32 FragmentLength;
|
||||
VOID *FragmentBuffer;
|
||||
} EFI_UDP6_FRAGMENT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_TIME TimeStamp;
|
||||
EFI_EVENT RecycleSignal;
|
||||
EFI_UDP6_SESSION_DATA UdpSession;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_UDP6_RECEIVE_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_UDP6_SESSION_DATA *UdpSessionData;
|
||||
UINT32 DataLength;
|
||||
UINT32 FragmentCount;
|
||||
EFI_UDP6_FRAGMENT_DATA FragmentTable[1];
|
||||
} EFI_UDP6_TRANSMIT_DATA;
|
||||
|
||||
typedef struct {
|
||||
EFI_EVENT Event;
|
||||
EFI_STATUS Status;
|
||||
union {
|
||||
EFI_UDP6_RECEIVE_DATA *RxData;
|
||||
EFI_UDP6_TRANSMIT_DATA *TxData;
|
||||
} Packet;
|
||||
} EFI_UDP6_COMPLETION_TOKEN;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP6_TRANSMIT) (
|
||||
IN struct _EFI_UDP6 *This,
|
||||
IN EFI_UDP6_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP6_RECEIVE) (
|
||||
IN struct _EFI_UDP6 *This,
|
||||
IN EFI_UDP6_COMPLETION_TOKEN *Token
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP6_CANCEL)(
|
||||
IN struct _EFI_UDP6 *This,
|
||||
IN EFI_UDP6_COMPLETION_TOKEN *Token OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UDP6_POLL) (
|
||||
IN struct _EFI_UDP6 *This
|
||||
);
|
||||
|
||||
typedef struct _EFI_UDP6 {
|
||||
EFI_UDP6_GET_MODE_DATA GetModeData;
|
||||
EFI_UDP6_CONFIGURE Configure;
|
||||
EFI_UDP6_GROUPS Groups;
|
||||
EFI_UDP6_TRANSMIT Transmit;
|
||||
EFI_UDP6_RECEIVE Receive;
|
||||
EFI_UDP6_CANCEL Cancel;
|
||||
EFI_UDP6_POLL Poll;
|
||||
} EFI_UDP6;
|
||||
|
||||
#endif /* _EFI_UDP_H */
|
@ -26,15 +26,312 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <stand.h>
|
||||
#include <string.h>
|
||||
#include <efi.h>
|
||||
#include <efichar.h>
|
||||
#include <efilib.h>
|
||||
#include <efigpt.h> /* Partition GUIDS */
|
||||
#include <Guid/MemoryTypeInformation.h>
|
||||
#include <Guid/MtcVendor.h>
|
||||
#include <Guid/ZeroGuid.h>
|
||||
#include <Protocol/EdidActive.h>
|
||||
#include <Protocol/EdidDiscovered.h>
|
||||
#include <uuid.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/param.h>
|
||||
#include "bootstrap.h"
|
||||
|
||||
/*
|
||||
* About ENABLE_UPDATES
|
||||
*
|
||||
* The UEFI variables are identified only by GUID and name, there is no
|
||||
* way to (auto)detect the type for the value, so we need to process the
|
||||
* variables case by case, as we do learn about them.
|
||||
*
|
||||
* While showing the variable name and the value is safe, we must not store
|
||||
* random values nor allow removing (random) variables.
|
||||
*
|
||||
* Since we do have stub code to set/unset the variables, I do want to keep
|
||||
* it to make the future development a bit easier, but the updates are disabled
|
||||
* by default till:
|
||||
* a) the validation and data translation to values is properly implemented
|
||||
* b) We have established which variables we do allow to be updated.
|
||||
* Therefore the set/unset code is included only for developers aid.
|
||||
*/
|
||||
|
||||
static struct efi_uuid_mapping {
|
||||
const char *efi_guid_name;
|
||||
EFI_GUID efi_guid;
|
||||
} efi_uuid_mapping[] = {
|
||||
{ .efi_guid_name = "global", .efi_guid = EFI_GLOBAL_VARIABLE },
|
||||
{ .efi_guid_name = "freebsd", .efi_guid = FREEBSD_BOOT_VAR_GUID },
|
||||
/* EFI Systab entry names. */
|
||||
{ .efi_guid_name = "MPS Table", .efi_guid = MPS_TABLE_GUID },
|
||||
{ .efi_guid_name = "ACPI Table", .efi_guid = ACPI_TABLE_GUID },
|
||||
{ .efi_guid_name = "ACPI 2.0 Table", .efi_guid = ACPI_20_TABLE_GUID },
|
||||
{ .efi_guid_name = "SMBIOS Table", .efi_guid = SMBIOS_TABLE_GUID },
|
||||
{ .efi_guid_name = "SMBIOS3 Table", .efi_guid = SMBIOS3_TABLE_GUID },
|
||||
{ .efi_guid_name = "DXE Table", .efi_guid = DXE_SERVICES_TABLE_GUID },
|
||||
{ .efi_guid_name = "HOB List Table", .efi_guid = HOB_LIST_TABLE_GUID },
|
||||
{ .efi_guid_name = EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
|
||||
.efi_guid = EFI_MEMORY_TYPE_INFORMATION_GUID },
|
||||
{ .efi_guid_name = "Debug Image Info Table",
|
||||
.efi_guid = DEBUG_IMAGE_INFO_TABLE_GUID },
|
||||
{ .efi_guid_name = "FDT Table", .efi_guid = FDT_TABLE_GUID },
|
||||
/*
|
||||
* Protocol names for debug purposes.
|
||||
* Can be removed along with lsefi command.
|
||||
*/
|
||||
{ .efi_guid_name = "device path", .efi_guid = DEVICE_PATH_PROTOCOL },
|
||||
{ .efi_guid_name = "block io", .efi_guid = BLOCK_IO_PROTOCOL },
|
||||
{ .efi_guid_name = "disk io", .efi_guid = DISK_IO_PROTOCOL },
|
||||
{ .efi_guid_name = "disk info", .efi_guid =
|
||||
EFI_DISK_INFO_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "simple fs",
|
||||
.efi_guid = SIMPLE_FILE_SYSTEM_PROTOCOL },
|
||||
{ .efi_guid_name = "load file", .efi_guid = LOAD_FILE_PROTOCOL },
|
||||
{ .efi_guid_name = "device io", .efi_guid = DEVICE_IO_PROTOCOL },
|
||||
{ .efi_guid_name = "unicode collation",
|
||||
.efi_guid = UNICODE_COLLATION_PROTOCOL },
|
||||
{ .efi_guid_name = "unicode collation2",
|
||||
.efi_guid = EFI_UNICODE_COLLATION2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "simple network",
|
||||
.efi_guid = EFI_SIMPLE_NETWORK_PROTOCOL },
|
||||
{ .efi_guid_name = "simple text output",
|
||||
.efi_guid = SIMPLE_TEXT_OUTPUT_PROTOCOL },
|
||||
{ .efi_guid_name = "simple text input",
|
||||
.efi_guid = SIMPLE_TEXT_INPUT_PROTOCOL },
|
||||
{ .efi_guid_name = "simple text ex input",
|
||||
.efi_guid = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "console control",
|
||||
.efi_guid = EFI_CONSOLE_CONTROL_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "stdin", .efi_guid = EFI_CONSOLE_IN_DEVICE_GUID },
|
||||
{ .efi_guid_name = "stdout", .efi_guid = EFI_CONSOLE_OUT_DEVICE_GUID },
|
||||
{ .efi_guid_name = "stderr",
|
||||
.efi_guid = EFI_STANDARD_ERROR_DEVICE_GUID },
|
||||
{ .efi_guid_name = "GOP",
|
||||
.efi_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "UGA draw", .efi_guid = EFI_UGA_DRAW_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "PXE base code",
|
||||
.efi_guid = EFI_PXE_BASE_CODE_PROTOCOL },
|
||||
{ .efi_guid_name = "PXE base code callback",
|
||||
.efi_guid = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL },
|
||||
{ .efi_guid_name = "serial io", .efi_guid = SERIAL_IO_PROTOCOL },
|
||||
{ .efi_guid_name = "loaded image", .efi_guid = LOADED_IMAGE_PROTOCOL },
|
||||
{ .efi_guid_name = "loaded image device path",
|
||||
.efi_guid = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "ISA io", .efi_guid = EFI_ISA_IO_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "IDE controller init",
|
||||
.efi_guid = EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "ISA ACPI", .efi_guid = EFI_ISA_ACPI_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "PCI", .efi_guid = EFI_PCI_IO_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "PCI root", .efi_guid = EFI_PCI_ROOT_IO_GUID },
|
||||
{ .efi_guid_name = "PCI enumeration",
|
||||
.efi_guid = EFI_PCI_ENUMERATION_COMPLETE_GUID },
|
||||
{ .efi_guid_name = "Driver diagnostics",
|
||||
.efi_guid = EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "Driver diagnostics2",
|
||||
.efi_guid = EFI_DRIVER_DIAGNOSTICS2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "simple pointer",
|
||||
.efi_guid = EFI_SIMPLE_POINTER_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "absolute pointer",
|
||||
.efi_guid = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "VLAN config",
|
||||
.efi_guid = EFI_VLAN_CONFIG_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "ARP service binding",
|
||||
.efi_guid = EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "ARP", .efi_guid = EFI_ARP_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "IPv4 service binding",
|
||||
.efi_guid = EFI_IP4_SERVICE_BINDING_PROTOCOL },
|
||||
{ .efi_guid_name = "IPv4", .efi_guid = EFI_IP4_PROTOCOL },
|
||||
{ .efi_guid_name = "IPv4 config",
|
||||
.efi_guid = EFI_IP4_CONFIG_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "IPv6 service binding",
|
||||
.efi_guid = EFI_IP6_SERVICE_BINDING_PROTOCOL },
|
||||
{ .efi_guid_name = "IPv6", .efi_guid = EFI_IP6_PROTOCOL },
|
||||
{ .efi_guid_name = "IPv6 config",
|
||||
.efi_guid = EFI_IP6_CONFIG_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "UDPv4", .efi_guid = EFI_UDP4_PROTOCOL },
|
||||
{ .efi_guid_name = "UDPv4 service binding",
|
||||
.efi_guid = EFI_UDP4_SERVICE_BINDING_PROTOCOL },
|
||||
{ .efi_guid_name = "UDPv6", .efi_guid = EFI_UDP6_PROTOCOL },
|
||||
{ .efi_guid_name = "UDPv6 service binding",
|
||||
.efi_guid = EFI_UDP6_SERVICE_BINDING_PROTOCOL },
|
||||
{ .efi_guid_name = "TCPv4", .efi_guid = EFI_TCP4_PROTOCOL },
|
||||
{ .efi_guid_name = "TCPv4 service binding",
|
||||
.efi_guid = EFI_TCP4_SERVICE_BINDING_PROTOCOL },
|
||||
{ .efi_guid_name = "TCPv6", .efi_guid = EFI_TCP6_PROTOCOL },
|
||||
{ .efi_guid_name = "TCPv6 service binding",
|
||||
.efi_guid = EFI_TCP6_SERVICE_BINDING_PROTOCOL },
|
||||
{ .efi_guid_name = "EFI System partition",
|
||||
.efi_guid = EFI_PART_TYPE_EFI_SYSTEM_PART_GUID },
|
||||
{ .efi_guid_name = "MBR legacy",
|
||||
.efi_guid = EFI_PART_TYPE_LEGACY_MBR_GUID },
|
||||
{ .efi_guid_name = "device tree", .efi_guid = EFI_DEVICE_TREE_GUID },
|
||||
{ .efi_guid_name = "USB io", .efi_guid = EFI_USB_IO_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "USB2 HC", .efi_guid = EFI_USB2_HC_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "component name",
|
||||
.efi_guid = EFI_COMPONENT_NAME_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "component name2",
|
||||
.efi_guid = EFI_COMPONENT_NAME2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "driver binding",
|
||||
.efi_guid = EFI_DRIVER_BINDING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "driver configuration",
|
||||
.efi_guid = EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "driver configuration2",
|
||||
.efi_guid = EFI_DRIVER_CONFIGURATION2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "decompress",
|
||||
.efi_guid = EFI_DECOMPRESS_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "ebc interpreter",
|
||||
.efi_guid = EFI_EBC_INTERPRETER_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "network interface identifier",
|
||||
.efi_guid = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL },
|
||||
{ .efi_guid_name = "network interface identifier_31",
|
||||
.efi_guid = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_31 },
|
||||
{ .efi_guid_name = "managed network service binding",
|
||||
.efi_guid = EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "managed network",
|
||||
.efi_guid = EFI_MANAGED_NETWORK_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "form browser",
|
||||
.efi_guid = EFI_FORM_BROWSER2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "HII config routing",
|
||||
.efi_guid = EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "HII database",
|
||||
.efi_guid = EFI_HII_DATABASE_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "HII string",
|
||||
.efi_guid = EFI_HII_STRING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "HII image",
|
||||
.efi_guid = EFI_HII_IMAGE_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "HII font", .efi_guid = EFI_HII_FONT_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "HII config",
|
||||
.efi_guid = EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "MTFTP4 service binding",
|
||||
.efi_guid = EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "MTFTP4", .efi_guid = EFI_MTFTP4_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "MTFTP6 service binding",
|
||||
.efi_guid = EFI_MTFTP6_SERVICE_BINDING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "MTFTP6", .efi_guid = EFI_MTFTP6_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "DHCP4 service binding",
|
||||
.efi_guid = EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "DHCP4", .efi_guid = EFI_DHCP4_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "DHCP6 service binding",
|
||||
.efi_guid = EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "DHCP6", .efi_guid = EFI_DHCP6_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "SCSI io", .efi_guid = EFI_SCSI_IO_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "SCSI pass thru",
|
||||
.efi_guid = EFI_SCSI_PASS_THRU_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "SCSI pass thru ext",
|
||||
.efi_guid = EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "Capsule arch",
|
||||
.efi_guid = EFI_CAPSULE_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "monotonic counter arch",
|
||||
.efi_guid = EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "realtime clock arch",
|
||||
.efi_guid = EFI_REALTIME_CLOCK_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "variable arch",
|
||||
.efi_guid = EFI_VARIABLE_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "variable write arch",
|
||||
.efi_guid = EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "watchdog timer arch",
|
||||
.efi_guid = EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "ACPI support",
|
||||
.efi_guid = EFI_ACPI_SUPPORT_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "BDS arch", .efi_guid = EFI_BDS_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "metronome arch",
|
||||
.efi_guid = EFI_METRONOME_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "timer arch",
|
||||
.efi_guid = EFI_TIMER_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "DPC", .efi_guid = EFI_DPC_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "print2", .efi_guid = EFI_PRINT2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "device path to text",
|
||||
.efi_guid = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "reset arch",
|
||||
.efi_guid = EFI_RESET_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "CPU arch", .efi_guid = EFI_CPU_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "CPU IO2", .efi_guid = EFI_CPU_IO2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "Legacy 8259",
|
||||
.efi_guid = EFI_LEGACY_8259_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "Security arch",
|
||||
.efi_guid = EFI_SECURITY_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "Security2 arch",
|
||||
.efi_guid = EFI_SECURITY2_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "Runtime arch",
|
||||
.efi_guid = EFI_RUNTIME_ARCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "status code runtime",
|
||||
.efi_guid = EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "data hub", .efi_guid = EFI_DATA_HUB_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "PCD", .efi_guid = PCD_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "EFI PCD", .efi_guid = EFI_PCD_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "firmware volume block",
|
||||
.efi_guid = EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "firmware volume2",
|
||||
.efi_guid = EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "firmware volume dispatch",
|
||||
.efi_guid = EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "lzma compress", .efi_guid = LZMA_COMPRESS_GUID },
|
||||
{ .efi_guid_name = "MP services",
|
||||
.efi_guid = EFI_MP_SERVICES_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = MTC_VARIABLE_NAME, .efi_guid = MTC_VENDOR_GUID },
|
||||
{ .efi_guid_name = "RTC", .efi_guid = { 0x378D7B65, 0x8DA9, 0x4773,
|
||||
{ 0xB6, 0xE4, 0xA4, 0x78, 0x26, 0xA8, 0x33, 0xE1} } },
|
||||
{ .efi_guid_name = "Active EDID",
|
||||
.efi_guid = EFI_EDID_ACTIVE_PROTOCOL_GUID },
|
||||
{ .efi_guid_name = "Discovered EDID",
|
||||
.efi_guid = EFI_EDID_DISCOVERED_PROTOCOL_GUID }
|
||||
};
|
||||
|
||||
bool
|
||||
efi_guid_to_str(const EFI_GUID *guid, char **sp)
|
||||
{
|
||||
uint32_t status;
|
||||
|
||||
uuid_to_string((const uuid_t *)guid, sp, &status);
|
||||
return (status == uuid_s_ok ? true : false);
|
||||
}
|
||||
|
||||
bool
|
||||
efi_str_to_guid(const char *s, EFI_GUID *guid)
|
||||
{
|
||||
uint32_t status;
|
||||
|
||||
uuid_from_string(s, (uuid_t *)guid, &status);
|
||||
return (status == uuid_s_ok ? true : false);
|
||||
}
|
||||
|
||||
bool
|
||||
efi_name_to_guid(const char *name, EFI_GUID *guid)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0; i < nitems(efi_uuid_mapping); i++) {
|
||||
if (strcasecmp(name, efi_uuid_mapping[i].efi_guid_name) == 0) {
|
||||
*guid = efi_uuid_mapping[i].efi_guid;
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
return (efi_str_to_guid(name, guid));
|
||||
}
|
||||
|
||||
bool
|
||||
efi_guid_to_name(EFI_GUID *guid, char **name)
|
||||
{
|
||||
uint32_t i;
|
||||
int rv;
|
||||
|
||||
for (i = 0; i < nitems(efi_uuid_mapping); i++) {
|
||||
rv = uuid_equal((uuid_t *)guid,
|
||||
(uuid_t *)&efi_uuid_mapping[i].efi_guid, NULL);
|
||||
if (rv != 0) {
|
||||
*name = strdup(efi_uuid_mapping[i].efi_guid_name);
|
||||
if (*name == NULL)
|
||||
return (false);
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
return (efi_guid_to_str(guid, name));
|
||||
}
|
||||
|
||||
void
|
||||
efi_init_environment(void)
|
||||
{
|
||||
@ -47,6 +344,63 @@ efi_init_environment(void)
|
||||
|
||||
COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show);
|
||||
|
||||
static int
|
||||
efi_print_other_value(uint8_t *data, UINTN datasz)
|
||||
{
|
||||
UINTN i;
|
||||
bool is_ascii = true;
|
||||
|
||||
printf(" = ");
|
||||
for (i = 0; i < datasz - 1; i++) {
|
||||
/*
|
||||
* Quick hack to see if this ascii-ish string is printable
|
||||
* range plus tab, cr and lf.
|
||||
*/
|
||||
if ((data[i] < 32 || data[i] > 126)
|
||||
&& data[i] != 9 && data[i] != 10 && data[i] != 13) {
|
||||
is_ascii = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (data[datasz - 1] != '\0')
|
||||
is_ascii = false;
|
||||
if (is_ascii == true) {
|
||||
printf("%s", data);
|
||||
if (pager_output("\n"))
|
||||
return (CMD_WARN);
|
||||
} else {
|
||||
if (pager_output("\n"))
|
||||
return (CMD_WARN);
|
||||
/*
|
||||
* Dump hex bytes grouped by 4.
|
||||
*/
|
||||
for (i = 0; i < datasz; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
if ((i + 1) % 4 == 0)
|
||||
printf(" ");
|
||||
if ((i + 1) % 20 == 0) {
|
||||
if (pager_output("\n"))
|
||||
return (CMD_WARN);
|
||||
}
|
||||
}
|
||||
if (pager_output("\n"))
|
||||
return (CMD_WARN);
|
||||
}
|
||||
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
/* This appears to be some sort of UEFI shell alias table. */
|
||||
static int
|
||||
efi_print_shell_str(const CHAR16 *varnamearg __unused, uint8_t *data,
|
||||
UINTN datasz __unused)
|
||||
{
|
||||
printf(" = %S", (CHAR16 *)data);
|
||||
if (pager_output("\n"))
|
||||
return (CMD_WARN);
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
const char *
|
||||
efi_memory_type(EFI_MEMORY_TYPE type)
|
||||
{
|
||||
@ -90,65 +444,295 @@ efi_memory_type(EFI_MEMORY_TYPE type)
|
||||
}
|
||||
}
|
||||
|
||||
/* Print memory type table. */
|
||||
static int
|
||||
efi_print_mem_type(const CHAR16 *varnamearg __unused, uint8_t *data,
|
||||
UINTN datasz)
|
||||
{
|
||||
int i, n;
|
||||
EFI_MEMORY_TYPE_INFORMATION *ti;
|
||||
|
||||
ti = (EFI_MEMORY_TYPE_INFORMATION *)data;
|
||||
if (pager_output(" = \n"))
|
||||
return (CMD_WARN);
|
||||
|
||||
n = datasz / sizeof (EFI_MEMORY_TYPE_INFORMATION);
|
||||
for (i = 0; i < n && ti[i].NumberOfPages != 0; i++) {
|
||||
printf("\t%23s pages: %u", efi_memory_type(ti[i].Type),
|
||||
ti[i].NumberOfPages);
|
||||
if (pager_output("\n"))
|
||||
return (CMD_WARN);
|
||||
}
|
||||
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Print FreeBSD variables.
|
||||
* We have LoaderPath and LoaderDev as CHAR16 strings.
|
||||
*/
|
||||
static int
|
||||
efi_print_freebsd(const CHAR16 *varnamearg, uint8_t *data,
|
||||
UINTN datasz __unused)
|
||||
{
|
||||
int rv = -1;
|
||||
char *var = NULL;
|
||||
|
||||
if (ucs2_to_utf8(varnamearg, &var) != 0)
|
||||
return (CMD_ERROR);
|
||||
|
||||
if (strcmp("LoaderPath", var) == 0 ||
|
||||
strcmp("LoaderDev", var) == 0) {
|
||||
printf(" = ");
|
||||
printf("%S", (CHAR16 *)data);
|
||||
|
||||
if (pager_output("\n"))
|
||||
rv = CMD_WARN;
|
||||
else
|
||||
rv = CMD_OK;
|
||||
}
|
||||
|
||||
free(var);
|
||||
return (rv);
|
||||
}
|
||||
|
||||
/* Print global variables. */
|
||||
static int
|
||||
efi_print_global(const CHAR16 *varnamearg, uint8_t *data, UINTN datasz)
|
||||
{
|
||||
int rv = -1;
|
||||
char *var = NULL;
|
||||
|
||||
if (ucs2_to_utf8(varnamearg, &var) != 0)
|
||||
return (CMD_ERROR);
|
||||
|
||||
if (strcmp("AuditMode", var) == 0) {
|
||||
printf(" = ");
|
||||
printf("0x%x", *data); /* 8-bit int */
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (strcmp("BootOptionSupport", var) == 0) {
|
||||
printf(" = ");
|
||||
printf("0x%x", *((uint32_t *)data)); /* UINT32 */
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (strcmp("BootCurrent", var) == 0 ||
|
||||
strcmp("BootNext", var) == 0 ||
|
||||
strcmp("Timeout", var) == 0) {
|
||||
printf(" = ");
|
||||
printf("%u", *((uint16_t *)data)); /* UINT16 */
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (strcmp("BootOrder", var) == 0 ||
|
||||
strcmp("DriverOrder", var) == 0) {
|
||||
UINTN i;
|
||||
UINT16 *u16 = (UINT16 *)data;
|
||||
|
||||
printf(" =");
|
||||
for (i = 0; i < datasz / sizeof (UINT16); i++)
|
||||
printf(" %u", u16[i]);
|
||||
goto done;
|
||||
}
|
||||
if (strncmp("Boot", var, 4) == 0 ||
|
||||
strncmp("Driver", var, 5) == 0 ||
|
||||
strncmp("SysPrep", var, 7) == 0 ||
|
||||
strncmp("OsRecovery", var, 10) == 0) {
|
||||
UINT16 filepathlistlen;
|
||||
CHAR16 *text;
|
||||
int desclen;
|
||||
EFI_DEVICE_PATH *dp;
|
||||
|
||||
data += sizeof(UINT32);
|
||||
filepathlistlen = *(uint16_t *)data;
|
||||
data += sizeof (UINT16);
|
||||
text = (CHAR16 *)data;
|
||||
|
||||
for (desclen = 0; text[desclen] != 0; desclen++)
|
||||
;
|
||||
if (desclen != 0) {
|
||||
/* Add terminating zero and we have CHAR16. */
|
||||
desclen = (desclen + 1) * 2;
|
||||
}
|
||||
|
||||
printf(" = ");
|
||||
printf("%S", text);
|
||||
if (filepathlistlen != 0) {
|
||||
/* Output pathname from new line. */
|
||||
if (pager_output("\n")) {
|
||||
rv = CMD_WARN;
|
||||
goto done;
|
||||
}
|
||||
dp = malloc(filepathlistlen);
|
||||
if (dp == NULL)
|
||||
goto done;
|
||||
|
||||
memcpy(dp, data + desclen, filepathlistlen);
|
||||
text = efi_devpath_name(dp);
|
||||
if (text != NULL) {
|
||||
printf("\t%S", text);
|
||||
efi_free_devpath_name(text);
|
||||
}
|
||||
free(dp);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (strcmp("ConIn", var) == 0 ||
|
||||
strcmp("ConInDev", var) == 0 ||
|
||||
strcmp("ConOut", var) == 0 ||
|
||||
strcmp("ConOutDev", var) == 0 ||
|
||||
strcmp("ErrOut", var) == 0 ||
|
||||
strcmp("ErrOutDev", var) == 0) {
|
||||
CHAR16 *text;
|
||||
|
||||
printf(" = ");
|
||||
text = efi_devpath_name((EFI_DEVICE_PATH *)data);
|
||||
if (text != NULL) {
|
||||
printf("%S", text);
|
||||
efi_free_devpath_name(text);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (strcmp("PlatformLang", var) == 0 ||
|
||||
strcmp("PlatformLangCodes", var) == 0 ||
|
||||
strcmp("LangCodes", var) == 0 ||
|
||||
strcmp("Lang", var) == 0) {
|
||||
printf(" = ");
|
||||
printf("%s", data); /* ASCII string */
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature bitmap from firmware to OS.
|
||||
* Older UEFI provides UINT32, newer UINT64.
|
||||
*/
|
||||
if (strcmp("OsIndicationsSupported", var) == 0) {
|
||||
printf(" = ");
|
||||
if (datasz == 4)
|
||||
printf("0x%x", *((uint32_t *)data));
|
||||
else
|
||||
printf("0x%jx", *((uint64_t *)data));
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Fallback for anything else. */
|
||||
rv = efi_print_other_value(data, datasz);
|
||||
done:
|
||||
if (rv == -1) {
|
||||
if (pager_output("\n"))
|
||||
rv = CMD_WARN;
|
||||
else
|
||||
rv = CMD_OK;
|
||||
}
|
||||
free(var);
|
||||
return (rv);
|
||||
}
|
||||
|
||||
static void
|
||||
efi_print_var_attr(UINT32 attr)
|
||||
{
|
||||
bool comma = false;
|
||||
|
||||
if (attr & EFI_VARIABLE_NON_VOLATILE) {
|
||||
printf("NV");
|
||||
comma = true;
|
||||
}
|
||||
if (attr & EFI_VARIABLE_BOOTSERVICE_ACCESS) {
|
||||
if (comma == true)
|
||||
printf(",");
|
||||
printf("BS");
|
||||
comma = true;
|
||||
}
|
||||
if (attr & EFI_VARIABLE_RUNTIME_ACCESS) {
|
||||
if (comma == true)
|
||||
printf(",");
|
||||
printf("RS");
|
||||
comma = true;
|
||||
}
|
||||
if (attr & EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
||||
if (comma == true)
|
||||
printf(",");
|
||||
printf("HR");
|
||||
comma = true;
|
||||
}
|
||||
if (attr & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) {
|
||||
if (comma == true)
|
||||
printf(",");
|
||||
printf("AT");
|
||||
comma = true;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag)
|
||||
{
|
||||
UINTN datasz, i;
|
||||
UINTN datasz;
|
||||
EFI_STATUS status;
|
||||
UINT32 attr;
|
||||
CHAR16 *data;
|
||||
char *str;
|
||||
uint32_t uuid_status;
|
||||
int is_ascii;
|
||||
uint8_t *data;
|
||||
int rv = CMD_OK;
|
||||
|
||||
str = NULL;
|
||||
datasz = 0;
|
||||
status = RS->GetVariable(varnamearg, matchguid, &attr,
|
||||
&datasz, NULL);
|
||||
status = RS->GetVariable(varnamearg, matchguid, &attr, &datasz, NULL);
|
||||
if (status != EFI_BUFFER_TOO_SMALL) {
|
||||
printf("Can't get the variable: error %#lx\n",
|
||||
EFI_ERROR_CODE(status));
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
data = malloc(datasz);
|
||||
status = RS->GetVariable(varnamearg, matchguid, &attr,
|
||||
&datasz, data);
|
||||
if (data == NULL) {
|
||||
printf("Out of memory\n");
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
|
||||
status = RS->GetVariable(varnamearg, matchguid, &attr, &datasz, data);
|
||||
if (status != EFI_SUCCESS) {
|
||||
printf("Can't get the variable: error %#lx\n",
|
||||
EFI_ERROR_CODE(status));
|
||||
free(data);
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
uuid_to_string((uuid_t *)matchguid, &str, &uuid_status);
|
||||
if (lflag) {
|
||||
printf("%s 0x%x %S", str, attr, varnamearg);
|
||||
} else {
|
||||
printf("%s 0x%x %S=", str, attr, varnamearg);
|
||||
is_ascii = 1;
|
||||
free(str);
|
||||
str = (char *)data;
|
||||
for (i = 0; i < datasz - 1; i++) {
|
||||
/* Quick hack to see if this ascii-ish string printable range plus tab, cr and lf */
|
||||
if ((str[i] < 32 || str[i] > 126) && str[i] != 9 && str[i] != 10 && str[i] != 13) {
|
||||
is_ascii = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (str[datasz - 1] != '\0')
|
||||
is_ascii = 0;
|
||||
if (is_ascii)
|
||||
printf("%s", str);
|
||||
else {
|
||||
for (i = 0; i < datasz / 2; i++) {
|
||||
if (isalnum(data[i]) || isspace(data[i]))
|
||||
printf("%c", data[i]);
|
||||
else
|
||||
printf("\\x%02x", data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (efi_guid_to_name(matchguid, &str) == false) {
|
||||
rv = CMD_ERROR;
|
||||
goto done;
|
||||
}
|
||||
printf("%s ", str);
|
||||
efi_print_var_attr(attr);
|
||||
printf(" %S", varnamearg);
|
||||
|
||||
if (lflag == 0) {
|
||||
if (strcmp(str, "global") == 0)
|
||||
rv = efi_print_global(varnamearg, data, datasz);
|
||||
else if (strcmp(str, "freebsd") == 0)
|
||||
rv = efi_print_freebsd(varnamearg, data, datasz);
|
||||
else if (strcmp(str,
|
||||
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME) == 0)
|
||||
rv = efi_print_mem_type(varnamearg, data, datasz);
|
||||
else if (strcmp(str,
|
||||
"47c7b227-c42a-11d2-8e57-00a0c969723b") == 0)
|
||||
rv = efi_print_shell_str(varnamearg, data, datasz);
|
||||
else if (strcmp(str, MTC_VARIABLE_NAME) == 0) {
|
||||
printf(" = ");
|
||||
printf("%u", *((uint32_t *)data)); /* UINT32 */
|
||||
rv = CMD_OK;
|
||||
if (pager_output("\n"))
|
||||
rv = CMD_WARN;
|
||||
} else
|
||||
rv = efi_print_other_value(data, datasz);
|
||||
} else if (pager_output("\n"))
|
||||
rv = CMD_WARN;
|
||||
|
||||
done:
|
||||
free(str);
|
||||
free(data);
|
||||
if (pager_output("\n"))
|
||||
return (CMD_WARN);
|
||||
return (CMD_OK);
|
||||
return (rv);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -170,15 +754,18 @@ command_efi_show(int argc, char *argv[])
|
||||
int ch, rv;
|
||||
unsigned i;
|
||||
EFI_STATUS status;
|
||||
EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} };
|
||||
EFI_GUID matchguid = { 0,0,0,{0,0,0,0,0,0,0,0} };
|
||||
uint32_t uuid_status;
|
||||
EFI_GUID varguid = ZERO_GUID;
|
||||
EFI_GUID matchguid = ZERO_GUID;
|
||||
CHAR16 *varname;
|
||||
CHAR16 *newnm;
|
||||
CHAR16 varnamearg[128];
|
||||
UINTN varalloc;
|
||||
UINTN varsz;
|
||||
|
||||
optind = 1;
|
||||
optreset = 1;
|
||||
opterr = 1;
|
||||
|
||||
while ((ch = getopt(argc, argv, "ag:lv:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
@ -186,10 +773,8 @@ command_efi_show(int argc, char *argv[])
|
||||
break;
|
||||
case 'g':
|
||||
gflag = 1;
|
||||
uuid_from_string(optarg, (uuid_t *)&matchguid,
|
||||
&uuid_status);
|
||||
if (uuid_status != uuid_s_ok) {
|
||||
printf("uid %s could not be parsed\n", optarg);
|
||||
if (efi_name_to_guid(optarg, &matchguid) == false) {
|
||||
printf("uuid %s could not be parsed\n", optarg);
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
break;
|
||||
@ -199,22 +784,22 @@ command_efi_show(int argc, char *argv[])
|
||||
case 'v':
|
||||
vflag = 1;
|
||||
if (strlen(optarg) >= nitems(varnamearg)) {
|
||||
printf("Variable %s is longer than %zd characters\n",
|
||||
optarg, nitems(varnamearg));
|
||||
printf("Variable %s is longer than %zu "
|
||||
"characters\n", optarg, nitems(varnamearg));
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
for (i = 0; i < strlen(optarg); i++)
|
||||
varnamearg[i] = optarg[i];
|
||||
varnamearg[i] = 0;
|
||||
cpy8to16(optarg, varnamearg, nitems(varnamearg));
|
||||
break;
|
||||
default:
|
||||
printf("Invalid argument %c\n", ch);
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 1) /* default is -a */
|
||||
aflag = 1;
|
||||
|
||||
if (aflag && (gflag || vflag)) {
|
||||
printf("-a isn't compatible with -v or -u\n");
|
||||
printf("-a isn't compatible with -g or -v\n");
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
|
||||
@ -223,15 +808,14 @@ command_efi_show(int argc, char *argv[])
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
|
||||
if (optind == argc)
|
||||
aflag = 1;
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
pager_open();
|
||||
if (vflag && gflag) {
|
||||
rv = efi_print_var(varnamearg, &matchguid, lflag);
|
||||
if (rv == CMD_WARN)
|
||||
rv = CMD_OK;
|
||||
pager_close();
|
||||
return (rv);
|
||||
}
|
||||
@ -239,7 +823,7 @@ command_efi_show(int argc, char *argv[])
|
||||
if (argc == 2) {
|
||||
optarg = argv[0];
|
||||
if (strlen(optarg) >= nitems(varnamearg)) {
|
||||
printf("Variable %s is longer than %zd characters\n",
|
||||
printf("Variable %s is longer than %zu characters\n",
|
||||
optarg, nitems(varnamearg));
|
||||
pager_close();
|
||||
return (CMD_ERROR);
|
||||
@ -248,20 +832,20 @@ command_efi_show(int argc, char *argv[])
|
||||
varnamearg[i] = optarg[i];
|
||||
varnamearg[i] = 0;
|
||||
optarg = argv[1];
|
||||
uuid_from_string(optarg, (uuid_t *)&matchguid,
|
||||
&uuid_status);
|
||||
if (uuid_status != uuid_s_ok) {
|
||||
printf("uid %s could not be parsed\n", optarg);
|
||||
if (efi_name_to_guid(optarg, &matchguid) == false) {
|
||||
printf("uuid %s could not be parsed\n", optarg);
|
||||
pager_close();
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
rv = efi_print_var(varnamearg, &matchguid, lflag);
|
||||
if (rv == CMD_WARN)
|
||||
rv = CMD_OK;
|
||||
pager_close();
|
||||
return (rv);
|
||||
}
|
||||
|
||||
if (argc > 0) {
|
||||
printf("Too many args %d\n", argc);
|
||||
printf("Too many args: %d\n", argc);
|
||||
pager_close();
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
@ -286,32 +870,53 @@ command_efi_show(int argc, char *argv[])
|
||||
varalloc = varsz;
|
||||
newnm = realloc(varname, varalloc);
|
||||
if (newnm == NULL) {
|
||||
printf("Can't allocate memory to get variables\n");
|
||||
free(varname);
|
||||
pager_close();
|
||||
return (CMD_ERROR);
|
||||
printf("Can't allocate memory to get "
|
||||
"variables\n");
|
||||
rv = CMD_ERROR;
|
||||
break;
|
||||
}
|
||||
varname = newnm;
|
||||
continue; /* Try again with bigger buffer */
|
||||
}
|
||||
if (status != EFI_SUCCESS)
|
||||
if (status == EFI_NOT_FOUND) {
|
||||
rv = CMD_OK;
|
||||
break;
|
||||
}
|
||||
if (status != EFI_SUCCESS) {
|
||||
rv = CMD_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (aflag) {
|
||||
if (efi_print_var(varname, &varguid, lflag) != CMD_OK)
|
||||
rv = efi_print_var(varname, &varguid, lflag);
|
||||
if (rv != CMD_OK) {
|
||||
if (rv == CMD_WARN)
|
||||
rv = CMD_OK;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (vflag) {
|
||||
if (wcscmp(varnamearg, varname) == 0) {
|
||||
if (efi_print_var(varname, &varguid, lflag) != CMD_OK)
|
||||
rv = efi_print_var(varname, &varguid, lflag);
|
||||
if (rv != CMD_OK) {
|
||||
if (rv == CMD_WARN)
|
||||
rv = CMD_OK;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (gflag) {
|
||||
if (memcmp(&varguid, &matchguid, sizeof(varguid)) == 0) {
|
||||
if (efi_print_var(varname, &varguid, lflag) != CMD_OK)
|
||||
rv = uuid_equal((uuid_t *)&varguid,
|
||||
(uuid_t *)&matchguid, NULL);
|
||||
if (rv != 0) {
|
||||
rv = efi_print_var(varname, &varguid, lflag);
|
||||
if (rv != CMD_OK) {
|
||||
if (rv == CMD_WARN)
|
||||
rv = CMD_OK;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -319,7 +924,7 @@ command_efi_show(int argc, char *argv[])
|
||||
free(varname);
|
||||
pager_close();
|
||||
|
||||
return (CMD_OK);
|
||||
return (rv);
|
||||
}
|
||||
|
||||
COMMAND_SET(efiset, "efi-set", "set EFI variables", command_efi_set);
|
||||
@ -330,8 +935,9 @@ command_efi_set(int argc, char *argv[])
|
||||
char *uuid, *var, *val;
|
||||
CHAR16 wvar[128];
|
||||
EFI_GUID guid;
|
||||
uint32_t status;
|
||||
#if defined(ENABLE_UPDATES)
|
||||
EFI_STATUS err;
|
||||
#endif
|
||||
|
||||
if (argc != 4) {
|
||||
printf("efi-set uuid var new-value\n");
|
||||
@ -340,19 +946,23 @@ command_efi_set(int argc, char *argv[])
|
||||
uuid = argv[1];
|
||||
var = argv[2];
|
||||
val = argv[3];
|
||||
uuid_from_string(uuid, (uuid_t *)&guid, &status);
|
||||
if (status != uuid_s_ok) {
|
||||
printf("Invalid uuid %s %d\n", uuid, status);
|
||||
if (efi_name_to_guid(uuid, &guid) == false) {
|
||||
printf("Invalid uuid %s\n", uuid);
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
cpy8to16(var, wvar, sizeof(wvar));
|
||||
err = RS->SetVariable(wvar, &guid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
cpy8to16(var, wvar, nitems(wvar));
|
||||
#if defined(ENABLE_UPDATES)
|
||||
err = RS->SetVariable(wvar, &guid, EFI_VARIABLE_NON_VOLATILE |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
strlen(val) + 1, val);
|
||||
if (EFI_ERROR(err)) {
|
||||
printf("Failed to set variable: error %lu\n", EFI_ERROR_CODE(err));
|
||||
printf("Failed to set variable: error %lu\n",
|
||||
EFI_ERROR_CODE(err));
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
#else
|
||||
printf("would set %s %s = %s\n", uuid, var, val);
|
||||
#endif
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
@ -364,8 +974,9 @@ command_efi_unset(int argc, char *argv[])
|
||||
char *uuid, *var;
|
||||
CHAR16 wvar[128];
|
||||
EFI_GUID guid;
|
||||
uint32_t status;
|
||||
#if defined(ENABLE_UPDATES)
|
||||
EFI_STATUS err;
|
||||
#endif
|
||||
|
||||
if (argc != 3) {
|
||||
printf("efi-unset uuid var\n");
|
||||
@ -373,16 +984,20 @@ command_efi_unset(int argc, char *argv[])
|
||||
}
|
||||
uuid = argv[1];
|
||||
var = argv[2];
|
||||
uuid_from_string(uuid, (uuid_t *)&guid, &status);
|
||||
if (status != uuid_s_ok) {
|
||||
if (efi_name_to_guid(uuid, &guid) == false) {
|
||||
printf("Invalid uuid %s\n", uuid);
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
cpy8to16(var, wvar, sizeof(wvar));
|
||||
cpy8to16(var, wvar, nitems(wvar));
|
||||
#if defined(ENABLE_UPDATES)
|
||||
err = RS->SetVariable(wvar, &guid, 0, 0, NULL);
|
||||
if (EFI_ERROR(err)) {
|
||||
printf("Failed to unset variable: error %lu\n", EFI_ERROR_CODE(err));
|
||||
printf("Failed to unset variable: error %lu\n",
|
||||
EFI_ERROR_CODE(err));
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
#else
|
||||
printf("would unset %s %s \n", uuid, var);
|
||||
#endif
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
@ -1114,73 +1114,30 @@ command_memmap(int argc __unused, char *argv[] __unused)
|
||||
COMMAND_SET(configuration, "configuration", "print configuration tables",
|
||||
command_configuration);
|
||||
|
||||
static const char *
|
||||
guid_to_string(EFI_GUID *guid)
|
||||
{
|
||||
static char buf[40];
|
||||
|
||||
sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
||||
guid->Data1, guid->Data2, guid->Data3, guid->Data4[0],
|
||||
guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4],
|
||||
guid->Data4[5], guid->Data4[6], guid->Data4[7]);
|
||||
return (buf);
|
||||
}
|
||||
|
||||
static int
|
||||
command_configuration(int argc, char *argv[])
|
||||
{
|
||||
char line[80];
|
||||
UINTN i;
|
||||
char *name;
|
||||
|
||||
snprintf(line, sizeof(line), "NumberOfTableEntries=%lu\n",
|
||||
printf("NumberOfTableEntries=%lu\n",
|
||||
(unsigned long)ST->NumberOfTableEntries);
|
||||
pager_open();
|
||||
if (pager_output(line)) {
|
||||
pager_close();
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
for (i = 0; i < ST->NumberOfTableEntries; i++) {
|
||||
EFI_GUID *guid;
|
||||
|
||||
printf(" ");
|
||||
guid = &ST->ConfigurationTable[i].VendorGuid;
|
||||
if (!memcmp(guid, &mps, sizeof(EFI_GUID)))
|
||||
printf("MPS Table");
|
||||
else if (!memcmp(guid, &acpi, sizeof(EFI_GUID)))
|
||||
printf("ACPI Table");
|
||||
else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID)))
|
||||
printf("ACPI 2.0 Table");
|
||||
else if (!memcmp(guid, &smbios, sizeof(EFI_GUID)))
|
||||
printf("SMBIOS Table %p",
|
||||
ST->ConfigurationTable[i].VendorTable);
|
||||
else if (!memcmp(guid, &smbios3, sizeof(EFI_GUID)))
|
||||
printf("SMBIOS3 Table");
|
||||
else if (!memcmp(guid, &dxe, sizeof(EFI_GUID)))
|
||||
printf("DXE Table");
|
||||
else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID)))
|
||||
printf("HOB List Table");
|
||||
else if (!memcmp(guid, &lzmadecomp, sizeof(EFI_GUID)))
|
||||
printf("LZMA Compression");
|
||||
else if (!memcmp(guid, &mpcore, sizeof(EFI_GUID)))
|
||||
printf("ARM MpCore Information Table");
|
||||
else if (!memcmp(guid, &esrt, sizeof(EFI_GUID)))
|
||||
printf("ESRT Table");
|
||||
else if (!memcmp(guid, &memtype, sizeof(EFI_GUID)))
|
||||
printf("Memory Type Information Table");
|
||||
else if (!memcmp(guid, &debugimg, sizeof(EFI_GUID)))
|
||||
printf("Debug Image Info Table");
|
||||
else if (!memcmp(guid, &fdtdtb, sizeof(EFI_GUID)))
|
||||
printf("FDT Table");
|
||||
else
|
||||
printf("Unknown Table (%s)", guid_to_string(guid));
|
||||
snprintf(line, sizeof(line), " at %p\n",
|
||||
ST->ConfigurationTable[i].VendorTable);
|
||||
if (pager_output(line))
|
||||
break;
|
||||
|
||||
if (efi_guid_to_name(guid, &name) == true) {
|
||||
printf(name);
|
||||
free(name);
|
||||
} else {
|
||||
printf("Error while translating UUID to name");
|
||||
}
|
||||
printf(" at %p\n", ST->ConfigurationTable[i].VendorTable);
|
||||
}
|
||||
|
||||
pager_close();
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
@ -1238,6 +1195,75 @@ command_mode(int argc, char *argv[])
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
COMMAND_SET(lsefi, "lsefi", "list EFI handles", command_lsefi);
|
||||
|
||||
static int
|
||||
command_lsefi(int argc __unused, char *argv[] __unused)
|
||||
{
|
||||
char *name;
|
||||
EFI_HANDLE *buffer = NULL;
|
||||
EFI_HANDLE handle;
|
||||
UINTN bufsz = 0, i, j;
|
||||
EFI_STATUS status;
|
||||
int ret;
|
||||
|
||||
status = BS->LocateHandle(AllHandles, NULL, NULL, &bufsz, buffer);
|
||||
if (status != EFI_BUFFER_TOO_SMALL) {
|
||||
snprintf(command_errbuf, sizeof (command_errbuf),
|
||||
"unexpected error: %lld", (long long)status);
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
if ((buffer = malloc(bufsz)) == NULL) {
|
||||
sprintf(command_errbuf, "out of memory");
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
|
||||
status = BS->LocateHandle(AllHandles, NULL, NULL, &bufsz, buffer);
|
||||
if (EFI_ERROR(status)) {
|
||||
free(buffer);
|
||||
snprintf(command_errbuf, sizeof (command_errbuf),
|
||||
"LocateHandle() error: %lld", (long long)status);
|
||||
return (CMD_ERROR);
|
||||
}
|
||||
|
||||
pager_open();
|
||||
for (i = 0; i < (bufsz / sizeof (EFI_HANDLE)); i++) {
|
||||
UINTN nproto = 0;
|
||||
EFI_GUID **protocols = NULL;
|
||||
|
||||
handle = buffer[i];
|
||||
printf("Handle %p", handle);
|
||||
if (pager_output("\n"))
|
||||
break;
|
||||
/* device path */
|
||||
|
||||
status = BS->ProtocolsPerHandle(handle, &protocols, &nproto);
|
||||
if (EFI_ERROR(status)) {
|
||||
snprintf(command_errbuf, sizeof (command_errbuf),
|
||||
"ProtocolsPerHandle() error: %lld",
|
||||
(long long)status);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < nproto; j++) {
|
||||
if (efi_guid_to_name(protocols[j], &name) == true) {
|
||||
printf(" %s", name);
|
||||
free(name);
|
||||
} else {
|
||||
printf("Error while translating UUID to name");
|
||||
}
|
||||
if ((ret = pager_output("\n")) != 0)
|
||||
break;
|
||||
}
|
||||
BS->FreePool(protocols);
|
||||
if (ret != 0)
|
||||
break;
|
||||
}
|
||||
pager_close();
|
||||
free(buffer);
|
||||
return (CMD_OK);
|
||||
}
|
||||
|
||||
#ifdef LOADER_FDT_SUPPORT
|
||||
extern int command_fdt_internal(int argc, char *argv[]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user