TianoCore EDK2 master
Loading...
Searching...
No Matches
XenBus.h File Reference
#include <IndustryStandard/Xen/grant_table.h>
#include <IndustryStandard/Xen/event_channel.h>

Go to the source code of this file.

Data Structures

struct  XENSTORE_TRANSACTION
 
struct  _XENBUS_PROTOCOL
 

Macros

#define XENBUS_PROTOCOL_GUID    {0x3d3ca290, 0xb9a5, 0x11e3, {0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}}
 
#define XST_NIL   ((XENSTORE_TRANSACTION *) NULL)
 

Typedefs

typedef struct _XENBUS_PROTOCOL XENBUS_PROTOCOL
 
typedef enum xenbus_state XenBusState
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_READ) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node, OUT VOID **Result)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_BACKEND_READ) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node, OUT VOID **Result)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_PRINTF) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Directory, IN CONST CHAR8 *Node, IN CONST CHAR8 *Format,...)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_REMOVE) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_TRANSACTION_START) (IN XENBUS_PROTOCOL *This, OUT XENSTORE_TRANSACTION *Transaction)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_TRANSACTION_END) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN BOOLEAN Abort)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_SET_STATE) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN XenBusState State)
 
typedef EFI_STATUS(EFIAPI * XENBUS_GRANT_ACCESS) (IN XENBUS_PROTOCOL *This, IN domid_t DomainId, IN UINTN Frame, IN BOOLEAN ReadOnly, OUT grant_ref_t *refp)
 
typedef EFI_STATUS(EFIAPI * XENBUS_GRANT_END_ACCESS) (IN XENBUS_PROTOCOL *This, IN grant_ref_t Ref)
 
typedef UINT32(EFIAPI * XENBUS_EVENT_CHANNEL_ALLOCATE) (IN XENBUS_PROTOCOL *This, IN domid_t DomainId, OUT evtchn_port_t *Port)
 
typedef UINT32(EFIAPI * XENBUS_EVENT_CHANNEL_NOTIFY) (IN XENBUS_PROTOCOL *This, IN evtchn_port_t Port)
 
typedef UINT32(EFIAPI * XENBUS_EVENT_CHANNEL_CLOSE) (IN XENBUS_PROTOCOL *This, IN evtchn_port_t Port)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_REGISTER_WATCH) (IN XENBUS_PROTOCOL *This, IN CONST CHAR8 *Node, OUT VOID **Token)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_REGISTER_WATCH_BACKEND) (IN XENBUS_PROTOCOL *This, IN CONST CHAR8 *Node, OUT VOID **Token)
 
typedef VOID(EFIAPI * XENBUS_UNREGISTER_WATCH) (IN XENBUS_PROTOCOL *This, IN VOID *Token)
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_WAIT_FOR_WATCH) (IN XENBUS_PROTOCOL *This, IN VOID *Token)
 

Enumerations

enum  XENSTORE_STATUS {
  XENSTORE_STATUS_SUCCESS = 0 , XENSTORE_STATUS_FAIL , XENSTORE_STATUS_EINVAL , XENSTORE_STATUS_EACCES ,
  XENSTORE_STATUS_EEXIST , XENSTORE_STATUS_EISDIR , XENSTORE_STATUS_ENOENT , XENSTORE_STATUS_ENOMEM ,
  XENSTORE_STATUS_ENOSPC , XENSTORE_STATUS_EIO , XENSTORE_STATUS_ENOTEMPTY , XENSTORE_STATUS_ENOSYS ,
  XENSTORE_STATUS_EROFS , XENSTORE_STATUS_EBUSY , XENSTORE_STATUS_EAGAIN , XENSTORE_STATUS_EISCONN ,
  XENSTORE_STATUS_E2BIG
}
 

Variables

EFI_GUID gXenBusProtocolGuid
 

Detailed Description

XenBus protocol to be used between the XenBus bus driver and Xen PV devices.

DISCLAIMER: the XENBUS_PROTOCOL introduced here is a work in progress, and should not be used outside of the EDK II tree.

This protocol provide the necessary for a Xen PV driver frontend to communicate with the bus driver, and perform several task to initialize/shutdown a PV device and perform IO with a PV backend.

Copyright (C) 2014, Citrix Ltd.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file XenBus.h.

Macro Definition Documentation

◆ XENBUS_PROTOCOL_GUID

#define XENBUS_PROTOCOL_GUID    {0x3d3ca290, 0xb9a5, 0x11e3, {0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}}

Definition at line 20 of file XenBus.h.

◆ XST_NIL

#define XST_NIL   ((XENSTORE_TRANSACTION *) NULL)

Definition at line 34 of file XenBus.h.

Typedef Documentation

◆ XENBUS_EVENT_CHANNEL_ALLOCATE

typedef UINT32(EFIAPI * XENBUS_EVENT_CHANNEL_ALLOCATE) (IN XENBUS_PROTOCOL *This, IN domid_t DomainId, OUT evtchn_port_t *Port)

Allocate a port that can be bind from domain DomainId.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
DomainIdThe domain ID that can bind the newly allocated port.
PortA pointer to a evtchn_port_t that will contain the newly allocated port.
Return values
UINT32The return value from the hypercall, 0 if success.

Definition at line 255 of file XenBus.h.

◆ XENBUS_EVENT_CHANNEL_CLOSE

typedef UINT32(EFIAPI * XENBUS_EVENT_CHANNEL_CLOSE) (IN XENBUS_PROTOCOL *This, IN evtchn_port_t Port)

Close a local event channel Port.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
PortThe event channel to close.
Return values
UINT32The return value from the hypercall, 0 if success.

Definition at line 286 of file XenBus.h.

◆ XENBUS_EVENT_CHANNEL_NOTIFY

typedef UINT32(EFIAPI * XENBUS_EVENT_CHANNEL_NOTIFY) (IN XENBUS_PROTOCOL *This, IN evtchn_port_t Port)

Send an event to the remote end of the channel whose local endpoint is Port.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
PortLocal port to the event from.
Return values
UINT32The return value from the hypercall, 0 if success.

Definition at line 271 of file XenBus.h.

◆ XENBUS_GRANT_ACCESS

typedef EFI_STATUS(EFIAPI * XENBUS_GRANT_ACCESS) (IN XENBUS_PROTOCOL *This, IN domid_t DomainId, IN UINTN Frame, IN BOOLEAN ReadOnly, OUT grant_ref_t *refp)

Grant access to the page Frame to the domain DomainId.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
DomainIdID of the domain to grant access to.
FrameFrame Number of the page to grant access to.
ReadOnlyProvide read-only or read-write access.
RefPtrReference number of the grant will be written to this pointer.

Definition at line 221 of file XenBus.h.

◆ XENBUS_GRANT_END_ACCESS

typedef EFI_STATUS(EFIAPI * XENBUS_GRANT_END_ACCESS) (IN XENBUS_PROTOCOL *This, IN grant_ref_t Ref)

End access to grant Ref, previously return by XenBusGrantAccess.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
RefReference numeber of a grant previously returned by XenBusGrantAccess.

Definition at line 238 of file XenBus.h.

◆ XENBUS_PROTOCOL

Forward declaration

Definition at line 26 of file XenBus.h.

◆ XENBUS_REGISTER_WATCH

typedef XENSTORE_STATUS(EFIAPI * XENBUS_REGISTER_WATCH) (IN XENBUS_PROTOCOL *This, IN CONST CHAR8 *Node, OUT VOID **Token)

Register a XenStore watch.

XenStore watches allow a client to wait for changes to an object in the XenStore.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
NodeThe basename of the path to watch.
TokenA token.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of write failure. EEXIST errors from the XenStore are suppressed, allowing multiple, physically different, xenbus_watch objects, to watch the same path in the XenStore.

Definition at line 308 of file XenBus.h.

◆ XENBUS_REGISTER_WATCH_BACKEND

typedef XENSTORE_STATUS(EFIAPI * XENBUS_REGISTER_WATCH_BACKEND) (IN XENBUS_PROTOCOL *This, IN CONST CHAR8 *Node, OUT VOID **Token)

Register a XenStore watch on a backend's node.

XenStore watches allow a client to wait for changes to an object in the XenStore.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
NodeThe basename of the path to watch.
TokenA token.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of write failure. EEXIST errors from the XenStore are suppressed, allowing multiple, physically different, xenbus_watch objects, to watch the same path in the XenStore.

Definition at line 331 of file XenBus.h.

◆ XENBUS_SET_STATE

typedef XENSTORE_STATUS(EFIAPI * XENBUS_SET_STATE) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN XenBusState State)

Set a new state for the frontend of the PV driver.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
TransactionThe transaction to end/commit.
StateThe new state to apply.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 204 of file XenBus.h.

◆ XENBUS_UNREGISTER_WATCH

typedef VOID(EFIAPI * XENBUS_UNREGISTER_WATCH) (IN XENBUS_PROTOCOL *This, IN VOID *Token)

Unregister a XenStore watch.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
TokenAn token previously returned by a successful call to RegisterWatch ().

Definition at line 346 of file XenBus.h.

◆ XENBUS_WAIT_FOR_WATCH

typedef XENSTORE_STATUS(EFIAPI * XENBUS_WAIT_FOR_WATCH) (IN XENBUS_PROTOCOL *This, IN VOID *Token)

Block until the node watch by Token change.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
TokenAn token previously returned by a successful call to RegisterWatch or RegisterWatchBackend.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 363 of file XenBus.h.

◆ XENBUS_XS_BACKEND_READ

typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_BACKEND_READ) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node, OUT VOID **Result)

Get the contents of the node Node of the PV device's backend. Returns the contents in *Result which should be freed after use.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
TransactionThe XenStore transaction covering this request.
NodeThe basename of the file to read.
ResultThe returned contents from this file.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.
Note
The results buffer is malloced and should be free'd by the caller.

Definition at line 103 of file XenBus.h.

◆ XENBUS_XS_PRINTF

typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_PRINTF) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Directory, IN CONST CHAR8 *Node, IN CONST CHAR8 *Format,...)

Print formatted write to a XenStore node.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
TransactionThe XenStore transaction covering this request.
DirectoryThe dirname of the path to read.
NodeThe basename of the path to read.
FormatAsciiSPrint format string followed by a variable number of arguments.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of write failure.

Definition at line 125 of file XenBus.h.

◆ XENBUS_XS_READ

typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_READ) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node, OUT VOID **Result)

Function prototypes Get the contents of the node Node of the PV device. Returns the contents in Result which should be freed after use.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
TransactionThe XenStore transaction covering this request.
NodeThe basename of the file to read.
ResultThe returned contents from this file.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.
Note
The results buffer is malloced and should be free'd by the caller.

Definition at line 79 of file XenBus.h.

◆ XENBUS_XS_REMOVE

typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_REMOVE) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN CONST CHAR8 *Node)

Remove a node or directory (directories must be empty) of the PV driver's subdirectory.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
TransactionThe XenStore transaction covering this request.
NodeThe basename of the node to remove.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 147 of file XenBus.h.

◆ XENBUS_XS_TRANSACTION_END

typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_TRANSACTION_END) (IN XENBUS_PROTOCOL *This, IN CONST XENSTORE_TRANSACTION *Transaction, IN BOOLEAN Abort)

End a transaction.

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
TransactionThe transaction to end/commit.
AbortIf TRUE, the transaction is discarded instead of committed.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 186 of file XenBus.h.

◆ XENBUS_XS_TRANSACTION_START

typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_TRANSACTION_START) (IN XENBUS_PROTOCOL *This, OUT XENSTORE_TRANSACTION *Transaction)

Start a transaction.

Changes by others will not be seen during the lifetime of this transaction, and changes will not be visible to others until it is committed (XsTransactionEnd).

Parameters
ThisA pointer to XENBUS_PROTOCOL instance.
TransactionThe returned transaction.
Returns
On success, XENSTORE_STATUS_SUCCESS. Otherwise an errno value indicating the type of failure.

Definition at line 168 of file XenBus.h.

◆ XenBusState

typedef enum xenbus_state XenBusState

Definition at line 28 of file XenBus.h.

Enumeration Type Documentation

◆ XENSTORE_STATUS

enum XENSTORE_STATUS

Definition at line 36 of file XenBus.h.