2 Function declaration and internal data for XenBusDxe.
4 Copyright (C) 2014, Citrix Ltd.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EFI_XENBUS_DXE_H__
11 #define __EFI_XENBUS_DXE_H__
18 #include <Library/UefiBootServicesTableLib.h>
19 #include <Library/MemoryAllocationLib.h>
20 #include <Library/BaseMemoryLib.h>
21 #include <Library/BaseLib.h>
22 #include <Library/UefiLib.h>
23 #include <Library/DevicePathLib.h>
24 #include <Library/DebugLib.h>
28 // UEFI Driver Model Protocols
30 #include <Protocol/DriverBinding.h>
36 #include <Protocol/XenIo.h>
42 #include <Protocol/XenBus.h>
48 #define XENBUS_DXE_VERSION 0x00000010
54 extern EFI_DRIVER_BINDING_PROTOCOL gXenBusDxeDriverBinding
;
55 extern EFI_COMPONENT_NAME2_PROTOCOL gXenBusDxeComponentName2
;
56 extern EFI_COMPONENT_NAME_PROTOCOL gXenBusDxeComponentName
;
60 // Include files with function prototypes
62 #include "DriverBinding.h"
63 #include "ComponentName.h"
68 #include <IndustryStandard/Xen/xen.h>
70 typedef struct _XENBUS_DEVICE_PATH XENBUS_DEVICE_PATH
;
71 typedef struct _XENBUS_DEVICE XENBUS_DEVICE
;
73 // Have the state of the driver.
74 #define XENBUS_DEVICE_SIGNATURE SIGNATURE_32 ('X','B','s','t')
75 struct _XENBUS_DEVICE
{
77 EFI_DRIVER_BINDING_PROTOCOL
*This
;
78 EFI_HANDLE ControllerHandle
;
79 XENIO_PROTOCOL
*XenIo
;
80 EFI_EVENT ExitBootEvent
;
81 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
84 shared_info_t
*SharedInfo
;
87 // There is one of this struct allocated for every child.
88 #define XENBUS_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('X', 'B', 'p', 'd')
93 XENBUS_PROTOCOL XenBusIo
;
95 XENBUS_DEVICE_PATH
*DevicePath
;
96 } XENBUS_PRIVATE_DATA
;
98 #define XENBUS_PRIVATE_DATA_FROM_THIS(a) \
99 CR (a, XENBUS_PRIVATE_DATA, XenBusIo, XENBUS_PRIVATE_DATA_SIGNATURE)
100 #define XENBUS_PRIVATE_DATA_FROM_LINK(a) \
101 CR (a, XENBUS_PRIVATE_DATA, Link, XENBUS_PRIVATE_DATA_SIGNATURE)
108 Atomically test and clear a bit.
110 @param Bit Bit index to test in *Address
111 @param Address The Address to the buffer that contain the bit to test.
113 @return Value of the Bit before it was cleared.