VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmnvram.h@ 78415

Last change on this file since 78415 was 76585, checked in by vboxsync, 6 years ago

*: scm --fix-header-guard-endif

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1/** @file
2 * PDM - Pluggable Device Manager, EFI NVRAM storage back-end.
3 */
4
5/*
6 * Copyright (C) 2012-2019 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_vmm_pdmnvram_h
27#define VBOX_INCLUDED_vmm_pdmnvram_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/types.h>
33
34
35RT_C_DECLS_BEGIN
36
37/** @defgroup grp_pdm_ifs_nvram NVRAM Interface
38 * @ingroup grp_pdm_interfaces
39 * @{
40 */
41
42/** Pointer to NVRAM interface provided by the driver. */
43typedef struct PDMINVRAMCONNECTOR *PPDMINVRAMCONNECTOR;
44
45/**
46 * Non-volatile RAM storage interface provided by the driver (up).
47 *
48 * @note The variable indexes used here 0-based, sequential and without gaps.
49 */
50typedef struct PDMINVRAMCONNECTOR
51{
52 /**
53 * Query a variable by variable index.
54 *
55 * @returns VBox status code.
56 * @retval VERR_NOT_FOUND if the variable was not found. This indicates that
57 * there are not variables with a higher index.
58 *
59 * @param pInterface Pointer to this interface structure.
60 * @param idxVariable The variable index. By starting @a idxVariable at 0
61 * and increasing it with each call, this can be used
62 * to enumerate all available variables.
63 * @param pVendorUuid The vendor UUID of the variable.
64 * @param pszName The variable name buffer.
65 * @param pcchName On input this hold the name buffer size (including
66 * the space for the terminator char). On successful
67 * return it holds the strlen() value for @a pszName.
68 * @param pfAttributes Where to return the value attributes.
69 * @param pbValue The value buffer.
70 * @param pcbValue On input the size of the value buffer, on output the
71 * actual number of bytes returned.
72 */
73 DECLR3CALLBACKMEMBER(int, pfnVarQueryByIndex,(PPDMINVRAMCONNECTOR pInterface, uint32_t idxVariable,
74 PRTUUID pVendorUuid, char *pszName, uint32_t *pcchName,
75 uint32_t *pfAttributes, uint8_t *pbValue, uint32_t *pcbValue));
76
77 /**
78 * Begins variable store sequence.
79 *
80 * @returns VBox status code.
81 * @param pInterface Pointer to this interface structure.
82 * @param cVariables The number of variables.
83 */
84 DECLR3CALLBACKMEMBER(int, pfnVarStoreSeqBegin,(PPDMINVRAMCONNECTOR pInterface, uint32_t cVariables));
85
86 /**
87 * Puts the next variable in the store sequence.
88 *
89 * @returns VBox status code.
90 * @param pInterface Pointer to this interface structure.
91 * @param idxVariable The variable index. This will start at 0 and advance
92 * up to @a cVariables - 1.
93 * @param pVendorUuid The vendor UUID of the variable.
94 * @param pszName The variable name buffer.
95 * @param cchName On input this hold the name buffer size (including
96 * the space for the terminator char). On successful
97 * return it holds the strlen() value for @a pszName.
98 * @param fAttributes The value attributes.
99 * @param pbValue The value buffer.
100 * @param cbValue On input the size of the value buffer, on output the
101 * actual number of bytes returned.
102 */
103 DECLR3CALLBACKMEMBER(int, pfnVarStoreSeqPut,(PPDMINVRAMCONNECTOR pInterface, int idxVariable,
104 PCRTUUID pVendorUuid, const char *pszName, size_t cchName,
105 uint32_t fAttributes, uint8_t const *pbValue, size_t cbValue));
106
107 /**
108 * Ends a variable store sequence.
109 *
110 * @returns VBox status code, @a rc on success.
111 * @param pInterface Pointer to this interface structure.
112 * @param rc The VBox status code for the whole store operation.
113 */
114 DECLR3CALLBACKMEMBER(int, pfnVarStoreSeqEnd,(PPDMINVRAMCONNECTOR pInterface, int rc));
115
116} PDMINVRAMCONNECTOR;
117/** PDMINVRAMCONNECTOR interface ID. */
118#define PDMINVRAMCONNECTOR_IID "057bc5c9-8022-43a8-9a41-0b106f97a89f"
119
120/** @} */
121
122RT_C_DECLS_END
123
124#endif /* !VBOX_INCLUDED_vmm_pdmnvram_h */
125
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette