From 9ae56e03e775a3954f66bd9461641199d4083894 Mon Sep 17 00:00:00 2001 From: Nigel Croxon Date: Mon, 17 Mar 2014 10:23:39 -0400 Subject: [PATCH] Add support for the simple pointer and absolute pointer protocols Signed-off-by: John Cronin Signed-off-by: Nigel Croxon --- gnu-efi-3.0/inc/efi.h | 1 + gnu-efi-3.0/inc/efilib.h | 3 + gnu-efi-3.0/inc/efipoint.h | 115 +++++++++++++++++++++++++++++++++++++ gnu-efi-3.0/lib/data.c | 7 +++ 4 files changed, 126 insertions(+) create mode 100644 gnu-efi-3.0/inc/efipoint.h diff --git a/gnu-efi-3.0/inc/efi.h b/gnu-efi-3.0/inc/efi.h index 20d2740..5f73cb8 100644 --- a/gnu-efi-3.0/inc/efi.h +++ b/gnu-efi-3.0/inc/efi.h @@ -49,5 +49,6 @@ Revision History #include "efiip.h" #include "efiudp.h" #include "efitcp.h" +#include "efipoint.h" #endif diff --git a/gnu-efi-3.0/inc/efilib.h b/gnu-efi-3.0/inc/efilib.h index 6cd540c..5bf7d69 100644 --- a/gnu-efi-3.0/inc/efilib.h +++ b/gnu-efi-3.0/inc/efilib.h @@ -78,6 +78,9 @@ extern EFI_GUID AcpiTableGuid; extern EFI_GUID SMBIOSTableGuid; extern EFI_GUID SalSystemTableGuid; +extern EFI_GUID SimplePointerProtocol; +extern EFI_GUID AbsolutePointerProtocol; + // // EFI Variable strings // diff --git a/gnu-efi-3.0/inc/efipoint.h b/gnu-efi-3.0/inc/efipoint.h new file mode 100644 index 0000000..4dbcf18 --- /dev/null +++ b/gnu-efi-3.0/inc/efipoint.h @@ -0,0 +1,115 @@ +/* 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 diff --git a/gnu-efi-3.0/lib/data.c b/gnu-efi-3.0/lib/data.c index 2ba6d97..ba55b96 100644 --- a/gnu-efi-3.0/lib/data.c +++ b/gnu-efi-3.0/lib/data.c @@ -165,3 +165,10 @@ EFI_GUID Udp4ServiceBindingProtocol = EFI_UDP4_SERVICE_BINDING_PROTOCOL; EFI_GUID Udp4Protocol = EFI_UDP4_PROTOCOL; EFI_GUID Tcp4ServiceBindingProtocol = EFI_TCP4_SERVICE_BINDING_PROTOCOL; EFI_GUID Tcp4Protocol = EFI_TCP4_PROTOCOL; + +// +// Pointer protocol GUIDs +// +EFI_GUID SimplePointerProtocol = EFI_SIMPLE_POINTER_PROTOCOL_GUID; +EFI_GUID AbsolutePointerProtocol = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID; +