TianoCore EDK2 master
Loading...
Searching...
No Matches
BlockFront.c File Reference
#include <Library/PrintLib.h>
#include <Library/DebugLib.h>
#include "BlockFront.h"
#include <IndustryStandard/Xen/io/protocols.h>
#include <IndustryStandard/Xen/io/xenbus.h>

Go to the source code of this file.

Functions

STATIC XENSTORE_STATUS XenBusReadUint64 (IN XENBUS_PROTOCOL *This, IN CONST CHAR8 *Node, IN BOOLEAN FromBackend, OUT UINT64 *ValuePtr)
 
STATIC VOID XenPvBlockFree (IN XEN_BLOCK_FRONT_DEVICE *Dev)
 
STATIC XENSTORE_STATUS XenPvBlkWaitForBackendState (IN XEN_BLOCK_FRONT_DEVICE *Dev, IN XenbusState ExpectedState, OUT XenbusState *LastStatePtr OPTIONAL)
 
EFI_STATUS XenPvBlockFrontInitialization (IN XENBUS_PROTOCOL *XenBusIo, IN CONST CHAR8 *NodeName, OUT XEN_BLOCK_FRONT_DEVICE **DevPtr)
 
VOID XenPvBlockFrontShutdown (IN XEN_BLOCK_FRONT_DEVICE *Dev)
 
STATIC VOID XenPvBlockWaitSlot (IN XEN_BLOCK_FRONT_DEVICE *Dev)
 
VOID XenPvBlockAsyncIo (IN OUT XEN_BLOCK_FRONT_IO *IoData, IN BOOLEAN IsWrite)
 
EFI_STATUS XenPvBlockIo (IN OUT XEN_BLOCK_FRONT_IO *IoData, IN BOOLEAN IsWrite)
 
STATIC VOID XenPvBlockPushOperation (IN XEN_BLOCK_FRONT_DEVICE *Dev, IN UINT8 Operation, IN UINT64 Id)
 
VOID XenPvBlockSync (IN XEN_BLOCK_FRONT_DEVICE *Dev)
 
VOID XenPvBlockAsyncIoPoll (IN XEN_BLOCK_FRONT_DEVICE *Dev)
 

Detailed Description

Minimal block driver for Mini-OS.

Copyright (c) 2007-2008 Samuel Thibault. Copyright (C) 2014, Citrix Ltd. Copyright (c) 2014, Intel Corporation. All rights reserved.

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

Definition in file BlockFront.c.

Function Documentation

◆ XenBusReadUint64()

STATIC XENSTORE_STATUS XenBusReadUint64 ( IN XENBUS_PROTOCOL This,
IN CONST CHAR8 *  Node,
IN BOOLEAN  FromBackend,
OUT UINT64 *  ValuePtr 
)

Helper to read an integer from XenStore.

If the number overflows according to the range defined by UINT64, then ASSERT().

Parameters
ThisA pointer to a XENBUS_PROTOCOL instance.
NodeThe XenStore node to read from.
FromBackendRead frontend or backend value.
ValuePtrWhere to put the value.
Return values
XENSTORE_STATUS_SUCCESSIf successful, will update ValuePtr.
Returns
Any other return value indicate the error, ValuePtr is not updated in this case.

Definition at line 36 of file BlockFront.c.

◆ XenPvBlkWaitForBackendState()

STATIC XENSTORE_STATUS XenPvBlkWaitForBackendState ( IN XEN_BLOCK_FRONT_DEVICE Dev,
IN XenbusState  ExpectedState,
OUT XenbusState *LastStatePtr  OPTIONAL 
)

Wait until the backend has reached the ExpectedState.

Parameters
DevA XEN_BLOCK_FRONT_DEVICE instance.
ExpectedStateThe backend state expected.
LastStatePtrAn optional pointer where to right the final state.
Returns
Return XENSTORE_STATUS_SUCCESS if the new backend state is ExpectedState or return an error otherwise.

Definition at line 102 of file BlockFront.c.

◆ XenPvBlockAsyncIo()

VOID XenPvBlockAsyncIo ( IN OUT XEN_BLOCK_FRONT_IO IoData,
IN BOOLEAN  IsWrite 
)

Definition at line 494 of file BlockFront.c.

◆ XenPvBlockAsyncIoPoll()

VOID XenPvBlockAsyncIoPoll ( IN XEN_BLOCK_FRONT_DEVICE Dev)

Definition at line 650 of file BlockFront.c.

◆ XenPvBlockFree()

STATIC VOID XenPvBlockFree ( IN XEN_BLOCK_FRONT_DEVICE Dev)

Free an instance of XEN_BLOCK_FRONT_DEVICE.

Parameters
DevThe instance to free.

Definition at line 69 of file BlockFront.c.

◆ XenPvBlockFrontInitialization()

EFI_STATUS XenPvBlockFrontInitialization ( IN XENBUS_PROTOCOL XenBusIo,
IN CONST CHAR8 *  NodeName,
OUT XEN_BLOCK_FRONT_DEVICE **  DevPtr 
)

Definition at line 151 of file BlockFront.c.

◆ XenPvBlockFrontShutdown()

VOID XenPvBlockFrontShutdown ( IN XEN_BLOCK_FRONT_DEVICE Dev)

Definition at line 381 of file BlockFront.c.

◆ XenPvBlockIo()

EFI_STATUS XenPvBlockIo ( IN OUT XEN_BLOCK_FRONT_IO IoData,
IN BOOLEAN  IsWrite 
)

Definition at line 569 of file BlockFront.c.

◆ XenPvBlockPushOperation()

STATIC VOID XenPvBlockPushOperation ( IN XEN_BLOCK_FRONT_DEVICE Dev,
IN UINT8  Operation,
IN UINT64  Id 
)

Definition at line 589 of file BlockFront.c.

◆ XenPvBlockSync()

VOID XenPvBlockSync ( IN XEN_BLOCK_FRONT_DEVICE Dev)

Definition at line 626 of file BlockFront.c.

◆ XenPvBlockWaitSlot()

STATIC VOID XenPvBlockWaitSlot ( IN XEN_BLOCK_FRONT_DEVICE Dev)

Definition at line 476 of file BlockFront.c.