]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[efi] Add definitions of GUIDs observed when booting wdsmgfw.efi
authorMichael Brown <mcb30@ipxe.org>
Sun, 30 Aug 2015 17:42:03 +0000 (18:42 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 1 Sep 2015 00:34:58 +0000 (01:34 +0100)
Add definitions of protocols observed to be used by wdsmgfw.efi, and
add a handle name type for ConIn, ConOut, and StdErr.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/efi/Protocol/AbsolutePointer.h [new file with mode: 0644]
src/include/ipxe/efi/Protocol/SimplePointer.h [new file with mode: 0644]
src/include/ipxe/efi/efi.h
src/interface/efi/efi_debug.c
src/interface/efi/efi_guid.c

diff --git a/src/include/ipxe/efi/Protocol/AbsolutePointer.h b/src/include/ipxe/efi/Protocol/AbsolutePointer.h
new file mode 100644 (file)
index 0000000..b20ca05
--- /dev/null
@@ -0,0 +1,207 @@
+/** @file
+  The file provides services that allow information about an
+  absolute pointer device to be retrieved.
+
+  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 __ABSOLUTE_POINTER_H__
+#define __ABSOLUTE_POINTER_H__
+
+FILE_LICENCE ( BSD3 );
+
+
+#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \
+  { 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }
+
+
+typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL;
+
+
+//*******************************************************
+// EFI_ABSOLUTE_POINTER_MODE
+//*******************************************************
+
+
+/**
+  The following data values in the EFI_ABSOLUTE_POINTER_MODE
+  interface are read-only and are changed by using the appropriate
+  interface functions.
+**/
+typedef struct {
+  UINT64 AbsoluteMinX; ///< The Absolute Minimum of the device on the x-axis
+  UINT64 AbsoluteMinY; ///< The Absolute Minimum of the device on the y axis.
+  UINT64 AbsoluteMinZ; ///< The Absolute Minimum of the device on the z-axis
+  UINT64 AbsoluteMaxX; ///< The Absolute Maximum of the device on the x-axis. If 0, and the
+                       ///< AbsoluteMinX is 0, then the pointer device does not support a xaxis
+  UINT64 AbsoluteMaxY; ///< The Absolute Maximum of the device on the y -axis. If 0, and the
+                       ///< AbsoluteMinX is 0, then the pointer device does not support a yaxis.
+  UINT64 AbsoluteMaxZ; ///< The Absolute Maximum of the device on the z-axis. If 0 , and the
+                       ///< AbsoluteMinX is 0, then the pointer device does not support a zaxis
+  UINT32 Attributes;   ///< The following bits are set as needed (or'd together) to indicate the
+                       ///< capabilities of the device supported. The remaining bits are undefined
+                       ///< and should be 0
+} EFI_ABSOLUTE_POINTER_MODE;
+
+///
+/// If set, indicates this device supports an alternate button input.
+///
+#define EFI_ABSP_SupportsAltActive    0x00000001
+
+///
+/// If set, indicates this device returns pressure data in parameter CurrentZ.
+///
+#define EFI_ABSP_SupportsPressureAsZ  0x00000002
+
+
+/**
+  This function resets the pointer device hardware. As part of
+  initialization process, the firmware/device will make a quick
+  but reasonable attempt to verify that the device is
+  functioning. If the ExtendedVerification flag is TRUE the
+  firmware may take an extended amount of time to verify the
+  device is operating on reset. Otherwise the reset operation is
+  to occur as quickly as possible. The hardware verification
+  process is not defined by this specification and is left up to
+  the platform firmware or driver to implement.
+
+  @param This                 A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL
+                              instance.
+
+  @param ExtendedVerification Indicates that the driver may
+                              perform a more exhaustive
+                              verification operation of the
+                              device during reset.
+
+  @retval EFI_SUCCESS       The device was reset.
+
+  @retval EFI_DEVICE_ERROR  The device is not functioning
+                            correctly and could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ABSOLUTE_POINTER_RESET)(
+  IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
+  IN BOOLEAN                       ExtendedVerification
+);
+
+///
+/// This bit is set if the touch sensor is active.
+///
+#define EFI_ABSP_TouchActive  0x00000001
+
+///
+/// This bit is set if the alt sensor, such as pen-side button, is active
+///
+#define EFI_ABS_AltActive     0x00000002
+
+
+/**
+  Definition of EFI_ABSOLUTE_POINTER_STATE.
+**/
+typedef struct {
+  ///
+  /// The unsigned position of the activation on the x axis. If the AboluteMinX
+  /// and the AboluteMaxX fields of the EFI_ABSOLUTE_POINTER_MODE structure are
+  /// both 0, then this pointer device does not support an x-axis, and this field
+  /// must be ignored.
+  ///
+  UINT64 CurrentX;
+
+  ///
+  /// The unsigned position of the activation on the y axis. If the AboluteMinY
+  /// and the AboluteMaxY fields of the EFI_ABSOLUTE_POINTER_MODE structure are
+  /// both 0, then this pointer device does not support an y-axis, and this field
+  /// must be ignored.
+  ///
+  UINT64 CurrentY;
+
+  ///
+  /// The unsigned position of the activation on the z axis, or the pressure
+  /// measurement. If the AboluteMinZ and the AboluteMaxZ fields of the
+  /// EFI_ABSOLUTE_POINTER_MODE structure are both 0, then this pointer device
+  /// does not support an z-axis, and this field must be ignored.
+  ///
+  UINT64 CurrentZ;
+
+  ///
+  /// Bits are set to 1 in this structure item to indicate that device buttons are
+  /// active.
+  ///
+  UINT32 ActiveButtons;
+} EFI_ABSOLUTE_POINTER_STATE;
+
+/**
+  The GetState() function retrieves the current state of a pointer
+  device. This includes information on the active state associated
+  with the pointer device and the current position of the axes
+  associated with the pointer device. If the state of the pointer
+  device has not changed since the last call to GetState(), then
+  EFI_NOT_READY is returned. If the state of the pointer device
+  has changed since the last call to GetState(), then the state
+  information is placed in State, and EFI_SUCCESS is returned. If
+  a device error occurs while attempting to retrieve the state
+  information, then EFI_DEVICE_ERROR is returned.
+
+
+  @param This   A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL
+                instance.
+
+  @param State  A pointer to the state information on the
+                pointer device.
+
+  @retval EFI_SUCCESS       The state of the pointer device was
+                            returned in State.
+
+  @retval EFI_NOT_READY     The state of the pointer device has not
+                            changed since the last call to GetState().
+
+  @retval EFI_DEVICE_ERROR  A device error occurred while
+                            attempting to retrieve the pointer
+                            device's current state.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE)(
+  IN      EFI_ABSOLUTE_POINTER_PROTOCOL  *This,
+  IN OUT  EFI_ABSOLUTE_POINTER_STATE     *State
+);
+
+
+///
+/// The EFI_ABSOLUTE_POINTER_PROTOCOL provides a set of services
+/// for a pointer device that can be used as an input device from an
+/// application written to this specification. The services include
+/// the ability to: reset the pointer device, retrieve the state of
+/// the pointer device, and retrieve the capabilities of the pointer
+/// device. The service also provides certain data items describing the device.
+///
+struct _EFI_ABSOLUTE_POINTER_PROTOCOL {
+  EFI_ABSOLUTE_POINTER_RESET      Reset;
+  EFI_ABSOLUTE_POINTER_GET_STATE  GetState;
+  ///
+  /// Event to use with WaitForEvent() to wait for input from the pointer device.
+  ///
+  EFI_EVENT                       WaitForInput;
+  ///
+  /// Pointer to EFI_ABSOLUTE_POINTER_MODE data.
+  ///
+  EFI_ABSOLUTE_POINTER_MODE       *Mode;
+};
+
+
+extern EFI_GUID gEfiAbsolutePointerProtocolGuid;
+
+
+#endif
+
diff --git a/src/include/ipxe/efi/Protocol/SimplePointer.h b/src/include/ipxe/efi/Protocol/SimplePointer.h
new file mode 100644 (file)
index 0000000..3b1e305
--- /dev/null
@@ -0,0 +1,145 @@
+/** @file
+  Simple Pointer protocol from the UEFI 2.0 specification.
+
+  Abstraction of a very simple pointer device like a mouse or trackball.
+
+  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 __SIMPLE_POINTER_H__
+#define __SIMPLE_POINTER_H__
+
+FILE_LICENCE ( BSD3 );
+
+#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
+  { \
+    0x31878c87, 0xb75, 0x11d5, {0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
+  }
+
+typedef struct _EFI_SIMPLE_POINTER_PROTOCOL  EFI_SIMPLE_POINTER_PROTOCOL;
+
+//
+// Data structures
+//
+typedef struct {
+  ///
+  /// The signed distance in counts that the pointer device has been moved along the x-axis.
+  ///
+  INT32   RelativeMovementX;
+  ///
+  /// The signed distance in counts that the pointer device has been moved along the y-axis.
+  ///
+  INT32   RelativeMovementY;
+  ///
+  /// The signed distance in counts that the pointer device has been moved along the z-axis.
+  ///
+  INT32   RelativeMovementZ;
+  ///
+  /// If TRUE, then the left button of the pointer device is being
+  /// pressed. If FALSE, then the left button of the pointer device is not being pressed.
+  ///
+  BOOLEAN LeftButton;
+  ///
+  /// If TRUE, then the right button of the pointer device is being
+  /// pressed. If FALSE, then the right button of the pointer device is not being pressed.
+  ///
+  BOOLEAN RightButton;
+} EFI_SIMPLE_POINTER_STATE;
+
+typedef struct {
+  ///
+  /// The resolution of the pointer device on the x-axis in counts/mm.
+  /// If 0, then the pointer device does not support an x-axis.
+  ///
+  UINT64  ResolutionX;
+  ///
+  /// The resolution of the pointer device on the y-axis in counts/mm.
+  /// If 0, then the pointer device does not support an x-axis.
+  ///
+  UINT64  ResolutionY;
+  ///
+  /// The resolution of the pointer device on the z-axis in counts/mm.
+  /// If 0, then the pointer device does not support an x-axis.
+  ///
+  UINT64  ResolutionZ;
+  ///
+  /// TRUE if a left button is present on the pointer device. Otherwise FALSE.
+  ///
+  BOOLEAN LeftButton;
+  ///
+  /// TRUE if a right button is present on the pointer device. Otherwise FALSE.
+  ///
+  BOOLEAN RightButton;
+} EFI_SIMPLE_POINTER_MODE;
+
+/**
+  Resets the pointer device hardware.
+
+  @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
+                                instance.
+  @param  ExtendedVerification  Indicates that the driver may perform a more exhaustive
+                                verification operation of the device during reset.
+
+  @retval EFI_SUCCESS           The device was reset.
+  @retval EFI_DEVICE_ERROR      The device is not functioning correctly and could not be reset.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_POINTER_RESET)(
+  IN EFI_SIMPLE_POINTER_PROTOCOL            *This,
+  IN BOOLEAN                                ExtendedVerification
+  );
+
+/**
+  Retrieves the current state of a pointer device.
+
+  @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
+                                instance.
+  @param  State                 A pointer to the state information on the pointer device.
+
+  @retval EFI_SUCCESS           The state of the pointer device was returned in State.
+  @retval EFI_NOT_READY         The state of the pointer device has not changed since the last call to
+                                GetState().
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to retrieve the pointer device's
+                                current state.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIMPLE_POINTER_GET_STATE)(
+  IN EFI_SIMPLE_POINTER_PROTOCOL          *This,
+  IN OUT EFI_SIMPLE_POINTER_STATE         *State
+  );
+
+///
+/// The EFI_SIMPLE_POINTER_PROTOCOL provides a set of services for a pointer
+/// device that can use used as an input device from an application written
+/// to this specification. The services include the ability to reset the
+/// pointer device, retrieve get the state of the pointer device, and
+/// retrieve the capabilities of the pointer device.
+///
+struct _EFI_SIMPLE_POINTER_PROTOCOL {
+  EFI_SIMPLE_POINTER_RESET      Reset;
+  EFI_SIMPLE_POINTER_GET_STATE  GetState;
+  ///
+  /// Event to use with WaitForEvent() to wait for input from the pointer device.
+  ///
+  EFI_EVENT                     WaitForInput;
+  ///
+  /// Pointer to EFI_SIMPLE_POINTER_MODE data.
+  ///
+  EFI_SIMPLE_POINTER_MODE       *Mode;
+};
+
+extern EFI_GUID gEfiSimplePointerProtocolGuid;
+
+#endif
index ced88286f18d213962c7d5483d328d3196382c41..c289eebed54b720ad397c9b2cdad9725326505ad 100644 (file)
@@ -153,6 +153,7 @@ struct efi_config_table {
  */
 #define EEFI( efirc ) EPLATFORM ( EINFO_EPLATFORM, efirc )
 
+extern EFI_GUID efi_absolute_pointer_protocol_guid;
 extern EFI_GUID efi_arp_protocol_guid;
 extern EFI_GUID efi_arp_service_binding_protocol_guid;
 extern EFI_GUID efi_block_io_protocol_guid;
@@ -186,9 +187,14 @@ extern EFI_GUID efi_pxe_base_code_protocol_guid;
 extern EFI_GUID efi_serial_io_protocol_guid;
 extern EFI_GUID efi_simple_file_system_protocol_guid;
 extern EFI_GUID efi_simple_network_protocol_guid;
+extern EFI_GUID efi_simple_pointer_protocol_guid;
+extern EFI_GUID efi_simple_text_input_protocol_guid;
+extern EFI_GUID efi_simple_text_input_ex_protocol_guid;
+extern EFI_GUID efi_simple_text_output_protocol_guid;
 extern EFI_GUID efi_tcg_protocol_guid;
 extern EFI_GUID efi_tcp4_protocol_guid;
 extern EFI_GUID efi_tcp4_service_binding_protocol_guid;
+extern EFI_GUID efi_tree_protocol_guid;
 extern EFI_GUID efi_udp4_protocol_guid;
 extern EFI_GUID efi_udp4_service_binding_protocol_guid;
 extern EFI_GUID efi_uga_draw_protocol_guid;
index bcf45cffee737ae9179299c2f541cf275ddbaf61..97f37c6d164ef2c3bf4861354261181c5b794ca0 100644 (file)
@@ -69,6 +69,8 @@ struct efi_well_known_guid {
 
 /** Well-known GUIDs */
 static struct efi_well_known_guid efi_well_known_guids[] = {
+       { &efi_absolute_pointer_protocol_guid,
+         "AbsolutePointer" },
        { &efi_arp_protocol_guid,
          "Arp" },
        { &efi_arp_service_binding_protocol_guid,
@@ -137,12 +139,22 @@ static struct efi_well_known_guid efi_well_known_guids[] = {
          "SimpleFileSystem" },
        { &efi_simple_network_protocol_guid,
          "SimpleNetwork" },
+       { &efi_simple_pointer_protocol_guid,
+         "SimplePointer" },
+       { &efi_simple_text_input_protocol_guid,
+         "SimpleTextInput" },
+       { &efi_simple_text_input_ex_protocol_guid,
+         "SimpleTextInputEx" },
+       { &efi_simple_text_output_protocol_guid,
+         "SimpleTextOutput" },
        { &efi_tcg_protocol_guid,
          "Tcg" },
        { &efi_tcp4_protocol_guid,
          "Tcp4" },
        { &efi_tcp4_service_binding_protocol_guid,
          "Tcp4Sb" },
+       { &efi_tree_protocol_guid,
+         "TrEE" },
        { &efi_udp4_protocol_guid,
          "Udp4" },
        { &efi_udp4_service_binding_protocol_guid,
@@ -595,6 +607,42 @@ efi_loaded_image_filepath_name ( EFI_LOADED_IMAGE_PROTOCOL *loaded ) {
        return efi_devpath_text ( loaded->FilePath );
 }
 
+/**
+ * Get console input handle name
+ *
+ * @v input            Simple text input protocol
+ * @ret name           Console input handle name, or NULL
+ */
+static const char *
+efi_conin_name ( EFI_SIMPLE_TEXT_INPUT_PROTOCOL *input ) {
+
+       /* Check for match against ConIn */
+       if ( input == efi_systab->ConIn )
+               return "ConIn";
+
+       return NULL;
+}
+
+/**
+ * Get console output handle name
+ *
+ * @v output           Simple text output protocol
+ * @ret name           Console output handle name, or NULL
+ */
+static const char *
+efi_conout_name ( EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *output ) {
+
+       /* Check for match against ConOut */
+       if ( output == efi_systab->ConOut )
+               return "ConOut";
+
+       /* Check for match against StdErr (if different from ConOut) */
+       if ( output == efi_systab->StdErr )
+               return "StdErr";
+
+       return NULL;
+}
+
 /** An EFI handle name type */
 struct efi_handle_name_type {
        /** Protocol */
@@ -643,6 +691,12 @@ static struct efi_handle_name_type efi_handle_name_types[] = {
        /* Handle's loaded image file path (for image handles) */
        EFI_HANDLE_NAME_TYPE ( &efi_loaded_image_protocol_guid,
                               efi_loaded_image_filepath_name ),
+       /* Our standard input file handle */
+       EFI_HANDLE_NAME_TYPE ( &efi_simple_text_input_protocol_guid,
+                              efi_conin_name ),
+       /* Our standard output and standard error file handles */
+       EFI_HANDLE_NAME_TYPE ( &efi_simple_text_output_protocol_guid,
+                              efi_conout_name ),
 };
 
 /**
index 1025621e796777199053e15c25d378023b9890ec..0a8412257c9747ce9d62819382e7a0a512de968c 100644 (file)
@@ -24,6 +24,7 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #include <ipxe/efi/efi.h>
+#include <ipxe/efi/Protocol/AbsolutePointer.h>
 #include <ipxe/efi/Protocol/Arp.h>
 #include <ipxe/efi/Protocol/BlockIo.h>
 #include <ipxe/efi/Protocol/BusSpecificDriverOverride.h>
@@ -51,6 +52,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <ipxe/efi/Protocol/SerialIo.h>
 #include <ipxe/efi/Protocol/SimpleFileSystem.h>
 #include <ipxe/efi/Protocol/SimpleNetwork.h>
+#include <ipxe/efi/Protocol/SimplePointer.h>
+#include <ipxe/efi/Protocol/SimpleTextIn.h>
+#include <ipxe/efi/Protocol/SimpleTextInEx.h>
+#include <ipxe/efi/Protocol/SimpleTextOut.h>
 #include <ipxe/efi/Protocol/TcgService.h>
 #include <ipxe/efi/Protocol/Tcp4.h>
 #include <ipxe/efi/Protocol/Udp4.h>
@@ -64,6 +69,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  *
  */
 
+/* TrEE protocol GUID definition in EDK2 headers is broken (missing braces) */
+#define EFI_TREE_PROTOCOL_GUID                                         \
+       { 0x607f766c, 0x7455, 0x42be,                                   \
+         { 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f } }
+
+/** Absolute pointer protocol GUID */
+EFI_GUID efi_absolute_pointer_protocol_guid
+       = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID;
+
 /** ARP protocol GUID */
 EFI_GUID efi_arp_protocol_guid
        = EFI_ARP_PROTOCOL_GUID;
@@ -196,6 +210,22 @@ EFI_GUID efi_simple_file_system_protocol_guid
 EFI_GUID efi_simple_network_protocol_guid
        = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
 
+/** Simple pointer protocol GUID */
+EFI_GUID efi_simple_pointer_protocol_guid
+       = EFI_SIMPLE_POINTER_PROTOCOL_GUID;
+
+/** Simple text input protocol GUID */
+EFI_GUID efi_simple_text_input_protocol_guid
+       = EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID;
+
+/** Simple text input extension protocol GUID */
+EFI_GUID efi_simple_text_input_ex_protocol_guid
+       = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID;
+
+/** Simple text output protocol GUID */
+EFI_GUID efi_simple_text_output_protocol_guid
+       = EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID;
+
 /** TCG protocol GUID */
 EFI_GUID efi_tcg_protocol_guid
        = EFI_TCG_PROTOCOL_GUID;
@@ -208,6 +238,10 @@ EFI_GUID efi_tcp4_protocol_guid
 EFI_GUID efi_tcp4_service_binding_protocol_guid
        = EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID;
 
+/** TrEE protocol GUID */
+EFI_GUID efi_tree_protocol_guid
+       = EFI_TREE_PROTOCOL_GUID;
+
 /** UDPv4 protocol GUID */
 EFI_GUID efi_udp4_protocol_guid
        = EFI_UDP4_PROTOCOL_GUID;