2 Function declaration and internal data for XenBusDxe.
4 Copyright (C) 2014, Citrix Ltd.
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __EFI_XENBUS_DXE_H__
17 #define __EFI_XENBUS_DXE_H__
24 #include <Library/UefiBootServicesTableLib.h>
25 #include <Library/MemoryAllocationLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/BaseLib.h>
28 #include <Library/UefiLib.h>
29 #include <Library/DevicePathLib.h>
30 #include <Library/DebugLib.h>
34 // UEFI Driver Model Protocols
36 #include <Protocol/DriverBinding.h>
42 #include <Protocol/PciIo.h>
48 #include <Protocol/XenBus.h>
54 #define XENBUS_DXE_VERSION 0x00000010
60 extern EFI_DRIVER_BINDING_PROTOCOL gXenBusDxeDriverBinding
;
61 extern EFI_COMPONENT_NAME2_PROTOCOL gXenBusDxeComponentName2
;
62 extern EFI_COMPONENT_NAME_PROTOCOL gXenBusDxeComponentName
;
66 // Include files with function prototypes
68 #include "DriverBinding.h"
69 #include "ComponentName.h"
74 #include <IndustryStandard/Xen/xen.h>
76 #define PCI_VENDOR_ID_XEN 0x5853
77 #define PCI_DEVICE_ID_XEN_PLATFORM 0x0001
80 typedef struct _XENBUS_DEVICE_PATH XENBUS_DEVICE_PATH
;
81 typedef struct _XENBUS_DEVICE XENBUS_DEVICE
;
83 // Have the state of the driver.
84 #define XENBUS_DEVICE_SIGNATURE SIGNATURE_32 ('X','B','s','t')
85 struct _XENBUS_DEVICE
{
87 EFI_DRIVER_BINDING_PROTOCOL
*This
;
88 EFI_HANDLE ControllerHandle
;
89 EFI_PCI_IO_PROTOCOL
*PciIo
;
90 EFI_EVENT ExitBootEvent
;
91 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
94 shared_info_t
*SharedInfo
;
97 // There is one of this struct allocated for every child.
98 #define XENBUS_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('X', 'B', 'p', 'd')
103 XENBUS_PROTOCOL XenBusIo
;
105 XENBUS_DEVICE_PATH
*DevicePath
;
106 } XENBUS_PRIVATE_DATA
;
108 #define XENBUS_PRIVATE_DATA_FROM_THIS(a) \
109 CR (a, XENBUS_PRIVATE_DATA, XenBusIo, XENBUS_PRIVATE_DATA_SIGNATURE)
110 #define XENBUS_PRIVATE_DATA_FROM_LINK(a) \
111 CR (a, XENBUS_PRIVATE_DATA, Link, XENBUS_PRIVATE_DATA_SIGNATURE)
118 Atomically test and clear a bit.
120 @param Bit Bit index to test in *Address
121 @param Address The Address to the buffer that contain the bit to test.
123 @return Value of the Bit before it was cleared.
129 IN
volatile VOID
*Address