OvmfPkg[all]  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
XenBus.h File Reference

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 IN CONST
XENSTORE_TRANSACTION
Transaction
 
typedef IN CONST
XENSTORE_TRANSACTION IN CONST
CHAR8 * 
Directory
 
typedef IN CONST
XENSTORE_TRANSACTION IN CONST
CHAR8 IN CONST CHAR8 * 
Node
 
typedef IN CONST
XENSTORE_TRANSACTION IN CONST
CHAR8 IN CONST CHAR8 IN CONST
CHAR8 * 
Format
 
typedef IN CONST
XENSTORE_TRANSACTION IN CONST
CHAR8 IN CONST CHAR8 IN CONST
CHAR8 typedef 
XENSTORE_STATUS (EFIAPI *XENBUS_XS_REMOVE)(IN XENBUS_PROTOCOL *This
 
typedef XENSTORE_STATUS(EFIAPI * XENBUS_XS_TRANSACTION_START )(IN XENBUS_PROTOCOL *This, OUT XENSTORE_TRANSACTION *Transaction)
 
typedef IN CONST
XENSTORE_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 IN domid_t DomainId
 
typedef IN domid_t OUT
evtchn_port_t
Port
 
typedef IN CONST CHAR8 OUT 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
}
 

Functions

typedef XENSTORE_STATUS (EFIAPI *XENBUS_XS_PRINTF)(IN XENBUS_PROTOCOL *This
 
typedef UINT32 (EFIAPI *XENBUS_EVENT_CHANNEL_ALLOCATE)(IN XENBUS_PROTOCOL *This
 
typedef VOID (EFIAPI *XENBUS_UNREGISTER_WATCH)(IN XENBUS_PROTOCOL *This
 

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

Macro Definition Documentation

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

Typedef Documentation

typedef IN CONST XENSTORE_TRANSACTION IN BOOLEAN Abort
typedef IN CONST XENSTORE_TRANSACTION IN CONST CHAR8* Directory
typedef IN domid_t DomainId
typedef IN CONST XENSTORE_TRANSACTION IN CONST CHAR8 IN CONST CHAR8 IN CONST CHAR8* Format
typedef IN CONST CHAR8 * Node
typedef IN evtchn_port_t Port
typedef IN VOID * Token
typedef IN CONST XENSTORE_TRANSACTION * Transaction
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.
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.

Forward declaration

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.
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.
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.
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.
typedef enum xenbus_state XenBusState
typedef XENSTORE_STATUS

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.

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.

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.

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.

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.

Enumeration Type Documentation

Enumerator
XENSTORE_STATUS_SUCCESS 
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 

Function Documentation

typedef UINT32 ( EFIAPI *  XENBUS_EVENT_CHANNEL_CLOSE)

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.

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.

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.
typedef VOID ( EFIAPI *  XENBUS_UNREGISTER_WATCH)

Unregister a XenStore watch.

Parameters
ThisA pointer to the XENBUS_PROTOCOL.
TokenAn token previously returned by a successful call to RegisterWatch ().
typedef XENSTORE_STATUS ( EFIAPI *  XENBUS_WAIT_FOR_WATCH)

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.

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.

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.

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.

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.

Variable Documentation

EFI_GUID gXenBusProtocolGuid