TianoCore EDK2 master
|
#include "XenBusDxe.h"
#include <IndustryStandard/Xen/memory.h>
#include <Library/XenHypercallLib.h>
#include <Library/SynchronizationLib.h>
#include "GrantTable.h"
Go to the source code of this file.
Macros | |
#define | NR_RESERVED_ENTRIES 8 |
#define | NR_GRANT_FRAMES (FixedPcdGet32 (PcdXenGrantFrames)) |
#define | NR_GRANT_ENTRIES (NR_GRANT_FRAMES * EFI_PAGE_SIZE / sizeof(grant_entry_v1_t)) |
Functions | |
STATIC VOID | XenGrantTablePutFreeEntry (grant_ref_t Ref) |
STATIC grant_ref_t | XenGrantTableGetFreeEntry (VOID) |
STATIC grant_ref_t | XenGrantTableGrantAccess (IN domid_t DomainId, IN UINTN Frame, IN BOOLEAN ReadOnly) |
STATIC EFI_STATUS | XenGrantTableEndAccess (grant_ref_t Ref) |
VOID | XenGrantTableInit (IN XENBUS_DEVICE *Dev) |
VOID | XenGrantTableDeinit (XENBUS_DEVICE *Dev) |
EFI_STATUS EFIAPI | XenBusGrantAccess (IN XENBUS_PROTOCOL *This, IN domid_t DomainId, IN UINTN Frame, IN BOOLEAN ReadOnly, OUT grant_ref_t *RefPtr) |
EFI_STATUS EFIAPI | XenBusGrantEndAccess (IN XENBUS_PROTOCOL *This, IN grant_ref_t Ref) |
Variables | |
STATIC grant_entry_v1_t * | GrantTable = NULL |
STATIC grant_ref_t | GrantList [NR_GRANT_ENTRIES] |
STATIC EFI_LOCK | mGrantListLock |
Grant Table function implementation.
Grant Table are used to grant access to certain page of the current VM to an other VM.
Author: Steven Smith (sos22.nosp@m.@cam.nosp@m..ac.u.nosp@m.k) Changes: Grzegorz Milos (gm281.nosp@m.@cam.nosp@m..ac.u.nosp@m.k) Copyright (C) 2006, Cambridge University Copyright (C) 2014, Citrix Ltd.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file GrantTable.c.
#define NR_GRANT_ENTRIES (NR_GRANT_FRAMES * EFI_PAGE_SIZE / sizeof(grant_entry_v1_t)) |
Definition at line 26 of file GrantTable.c.
#define NR_GRANT_FRAMES (FixedPcdGet32 (PcdXenGrantFrames)) |
Definition at line 25 of file GrantTable.c.
#define NR_RESERVED_ENTRIES 8 |
Definition at line 23 of file GrantTable.c.
EFI_STATUS EFIAPI XenBusGrantAccess | ( | IN XENBUS_PROTOCOL * | This, |
IN domid_t | DomainId, | ||
IN UINTN | Frame, | ||
IN BOOLEAN | ReadOnly, | ||
OUT grant_ref_t * | RefPtr | ||
) |
Grant access to the page Frame to the domain DomainId.
This | A pointer to XENBUS_PROTOCOL instance. |
DomainId | ID of the domain to grant access to. |
Frame | Frame Number of the page to grant access to. |
ReadOnly | Provide read-only or read-write access. |
RefPtr | Reference number of the grant will be written to this pointer. |
Definition at line 191 of file GrantTable.c.
EFI_STATUS EFIAPI XenBusGrantEndAccess | ( | IN XENBUS_PROTOCOL * | This, |
IN grant_ref_t | Ref | ||
) |
End access to grant Ref, previously return by XenBusGrantAccess.
This | A pointer to XENBUS_PROTOCOL instance. |
Ref | Reference numeber of a grant previously returned by XenBusGrantAccess. |
Definition at line 205 of file GrantTable.c.
VOID XenGrantTableDeinit | ( | XENBUS_DEVICE * | Dev | ) |
Definition at line 157 of file GrantTable.c.
STATIC EFI_STATUS XenGrantTableEndAccess | ( | grant_ref_t | Ref | ) |
Definition at line 99 of file GrantTable.c.
STATIC grant_ref_t XenGrantTableGetFreeEntry | ( | VOID | ) |
Definition at line 53 of file GrantTable.c.
STATIC grant_ref_t XenGrantTableGrantAccess | ( | IN domid_t | DomainId, |
IN UINTN | Frame, | ||
IN BOOLEAN | ReadOnly | ||
) |
Definition at line 73 of file GrantTable.c.
VOID XenGrantTableInit | ( | IN XENBUS_DEVICE * | Dev | ) |
Initialize the Grant Table at the address MmioAddr.
Dev | A pointer to XENBUS_DEVICE. |
MmioAddr | An address where the grant table can be mapped into the guest. |
Definition at line 123 of file GrantTable.c.
STATIC VOID XenGrantTablePutFreeEntry | ( | grant_ref_t | Ref | ) |
Definition at line 37 of file GrantTable.c.
STATIC grant_ref_t GrantList[NR_GRANT_ENTRIES] |
Definition at line 29 of file GrantTable.c.
STATIC grant_entry_v1_t* GrantTable = NULL |
Definition at line 28 of file GrantTable.c.
Definition at line 30 of file GrantTable.c.