VirtualBox

source: vbox/trunk/src/VBox/Devices/VirtIO/Virtio_1_0.h@ 81634

Last change on this file since 81634 was 81634, checked in by vboxsync, 5 years ago

DevVirtioScsi,Virtio_1_0: A quick and superficial review of DevVirtioScsi. bugref:9218 bugref:9440

DevVirtioScsi.cpp:

  • Changed a bunch of 'virtioScsi' prefixes to 'virtioScsiR3' to prepare for ring-0 enabling of the code.
  • VIRTIO_IN_DIRECTION -> VIRTIO_IS_IN_DIRECTION because predicates should have a verb in them. Ditto for VIRTIO_OUT_DIRECTION.
  • Avoid the 'u' prefix when possible, e.g. s/uOffset/offConfig/, s/uIntraOffset/offIntra/, s/uSenseLen/cbSenseLen/, s/uAsyncTypesMask/fAsyncTypesMask/, ++.
  • The macros MATCH_SCSI_CONFIG, LOG_ACCESSOR, SCSI_CONFIG_ACCESSOR and SCSI_CONFIG_ACCESSOR_READONLY are local to virtioScsiCfgAccessed() and should be defined inside given the amount of non-parameters they access.
  • The unnecessary/compulsory initialization of variables, like 'rc' in virtioScsiDevCapRead and virtioScsiDevCapWrite, drives me nuts. It looks like there is code missing that would require 'rc' to be initialized.
  • Better if the 'pv' parameter to virtioScsiCfgAccessed is 'void *' rather than 'const void *'. Saves a lot of confusing casting inside the function.
  • virtioScsiDevCapRead/FNVIRTIODEVCAPREAD should not take a 'const' 'pv' parameter, that's just wrong.
  • Marking VIRTIOSCSI::szInstance and szQueueNames as 'const' doesn't buy us anything other than some confusing casts in the constructor. (szQueueNames should actually be aszQueueNames as it's an array of strings.)
  • SUBSCRIBABLE_EVENTS is missing vital parentheses, messing up the test in VIRTIOSCSI_T_AN_SUBSCRIBE (harmless, as logging only). See also MATCH_SCSI_CONFIG (also harmless). Parentheses around expression like that should be an automatic habit.
  • SUBSCRIBABLE_EVENTS is using '&' instead of '|', making the value zero.
  • The VIRTIOSCSIREQ::pbSense allocation must be zeroed (use the 'Z' allocator variant) to make sure the guest never see any old heap data. (The whole sense buffer is returned in virtioScsiR3IoReqFinish, rather than just the valid length.)
  • In case of VIRTIOSCSIREQ::pbSense allocation failure, pReq and pVirtqReq must be freed too.
  • Inconsistent parameter indention (when parameter list spills onto a new line). My preference is aligning to opening parenthesis. (E.g. 2nd RTStrPrintf in virtioScsiConstruct().)
  • Inconsistent identation of multiline macros (VIRTIOSCSI_HOST_SCSI_FEATURES_ALL vs VIRTIO_[IS_]IN_DIRECTION).
  • A couple of missing/incorrect indentations.
  • No need to split lines for VIRTIOCALLBACKS (just get used to about 130 columns wide sources).
  • Some unnecessary casts (RTStrPrintf((char *)pThis->szInstance,...), SCSI_CONFIG_ACCESSOR*, (size_t)pReq->cbSense[Alloc], ++).
  • Some unnecessary parentheses (SCSI_CONFIG_ACCESSOR*, ++).
  • VIRTIOSCSI_T_EVENTS_MISSED should use UINT32_C to be on the safe side.
  • There are three uses of LogIs2Enabled() that seem to need RT_NOREF, and the latter including several unnecessary variables. Put the whole block inside #ifdef LOG_ENABLED and dropping the expansive RT_NOREF.
  • Five 'sizeof(aReqSegs) / sizeof(RTSGSEG)' that would more easily be written 'RT_ELEMENTS(aReqSegs)'.
  • There shall be a space between 'switch' and the parenthesis.
  • VIRTIOSCSI_EVENT_T::uVirtioLun is a byte array and should be called 'abVirtioLun'. Ditto REQ_CMD_HDR_T::uVirtioLun, VIRTIOSCSI_CTRL_TMF_T::uScsiLun, VIRTIOSCSI_CTRL_AN_T::uScsiLun.
  • VIRTIOSCSIREQ::uSenseLen is easily confused with the 'cbSense' member, best to change the latter to 'cbSenseAlloc' (done) and then the former to 'cbSense' (not done).
  • REQ_CMD_HDR should be typedef 'REQ_CMD_HDR_T', as you're not consequentially using 'struct ...'). Ditto REQ_CMD_PI
  • pragma pack(1) is not needed on REQ_CMD_PI_T and REQ_RESP_HDR_T, so keep them out of it. Recomment using AssertCompileSize on structures like this.
  • struct, union and enum tags are either omitted or the same as the typedef name.
  • A few same-line doxygen comments missing the '<' markers and a couple the 2nd '*'.
  • Try keep the same-line doxygen comments aligned at a tab (4+) and avoid having them slide sideways in the next strcture or define block.
  • The WORKER structure is a bit too generic, renamed it VIRTIOSCSIWORKER. Arrays are plural, so s/aWorker/aWorkers/ too.
  • When casting an integer to a pointer you must go thru uintptr_t or intptr_t, not uint64_t like in the PDMDevHlpThreadCreate call, as type size matters some compilers.
  • Try avoid having Log statement gobble up unnecessary virtual space (a few lines as possible), as they are just noise making it hard to get an idea what's going on.
  • Always scope switch cases with variables in them (e.g virtioScsiSendEvent).
  • ++

Virtio_1_0*: A few preliminary changes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.3 KB
Line 
1/* $Id: Virtio_1_0.h 81634 2019-11-04 01:58:52Z vboxsync $ */
2/** @file
3 * Virtio_1_0.h - Virtio Declarations
4 */
5
6/*
7 * Copyright (C) 2009-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOX_INCLUDED_SRC_VirtIO_Virtio_1_0_h
19#define VBOX_INCLUDED_SRC_VirtIO_Virtio_1_0_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <iprt/ctype.h>
25#include <iprt/sg.h>
26
27typedef void * VIRTIOHANDLE; /**< Opaque handle to the VirtIO framework */
28
29
30/**
31 * Important sizing and bounds params for this impl. of VirtIO 1.0 PCI device
32 */
33 /**
34 * TEMPORARY NOTE: Some of these values are experimental during development and will likely change.
35 */
36#define VIRTIO_MAX_QUEUE_NAME_SIZE 32 /**< Maximum length of a queue name */
37#define VIRTQ_MAX_SIZE 1024 /**< Max size (# desc elements) of a virtq */
38#define VIRTQ_MAX_CNT 24 /**< Max queues we allow guest to create */
39#define VIRTIO_NOTIFY_OFFSET_MULTIPLIER 2 /**< VirtIO Notify Cap. MMIO config param */
40#define VIRTIO_REGION_PCI_CAP 2 /**< BAR for VirtIO Cap. MMIO (impl specific) */
41#define VIRTIO_REGION_MSIX_CAP 0 /**< Bar for MSI-X handling */
42
43#define VIRTIO_HEX_DUMP(logLevel, pv, cb, base, title) \
44 do { \
45 if (LogIsItEnabled(logLevel, LOG_GROUP)) \
46 virtioHexDump((pv), (cb), (base), (title)); \
47 } while (0)
48
49
50/**
51 * The following structure holds the pre-processed context of descriptor chain pulled from a virtio queue
52 * to conduct a transaction between the client of this virtio implementation and the guest VM's virtio driver.
53 * It contains the head index of the descriptor chain, the output data from the client that has been
54 * converted to a contiguous virtual memory and a physical memory scatter-gather buffer for use by by
55 * the virtio framework to complete the transaction in the final phase of round-trip processing.
56 *
57 * The client should not modify the contents of this buffer. The primary field of interest to the
58 * client is pVirtSrc, which contains the VirtIO "OUT" (to device) buffer from the guest.
59 *
60 * Typical use is, When the client (worker thread) detects available data on the queue, it pulls the
61 * next one of these descriptor chain structs off the queue using virtioQueueGet(), processes the
62 * virtual memory buffer pVirtSrc, produces result data to pass back to the guest driver and calls
63 * virtioQueuePut() to return the result data to the client.
64 */
65typedef struct VIRTIO_DESC_CHAIN
66{
67 uint32_t uHeadIdx; /**< Head idx of associated desc chain */
68 uint32_t cbPhysSend; /**< Total size of src buffer */
69 PRTSGBUF pSgPhysSend; /**< Phys S/G/ buf for data from guest */
70 uint32_t cbPhysReturn; /**< Total size of dst buffer */
71 PRTSGBUF pSgPhysReturn; /**< Phys S/G buf to store result for guest */
72} VIRTIO_DESC_CHAIN_T, *PVIRTIO_DESC_CHAIN_T, **PPVIRTIO_DESC_CHAIN_T;
73
74/**
75 * The following structure is used to pass the PCI parameters from the consumer
76 * to this generic VirtIO framework. This framework provides the Vendor ID as Virtio.
77 */
78typedef struct VIRTIOPCIPARAMS
79{
80 uint16_t uDeviceId; /**< PCI Cfg Device ID */
81 uint16_t uClassBase; /**< PCI Cfg Base Class */
82 uint16_t uClassSub; /**< PCI Cfg Subclass */
83 uint16_t uClassProg; /**< PCI Cfg Programming Interface Class */
84 uint16_t uSubsystemId; /**< PCI Cfg Card Manufacturer Vendor ID */
85 uint16_t uSubsystemVendorId; /**< PCI Cfg Chipset Manufacturer Vendor ID */
86 uint16_t uRevisionId; /**< PCI Cfg Revision ID */
87 uint16_t uInterruptLine; /**< PCI Cfg Interrupt line */
88 uint16_t uInterruptPin; /**< PCI Cfg Interrupt pin */
89} VIRTIOPCIPARAMS, *PVIRTIOPCIPARAMS;
90
91/**
92 * Implementation-specific client callback to notify client of significant device status
93 * changes.
94 *
95 * @param hVirtio Handle to VirtIO framework
96 * @param fDriverOk True if guest driver is okay (thus queues, etc... are valid)
97 * @param pClient Pointer to opaque client data (state)
98 */
99typedef DECLCALLBACK(void) FNVIRTIOSTATUSCHANGED(VIRTIOHANDLE hVirtio, void *pClient, uint32_t fDriverOk);
100typedef FNVIRTIOSTATUSCHANGED *PFNVIRTIOSTATUSCHANGED;
101
102/**
103 * When guest-to-host queue notifications are enabled, the guest driver notifies the host
104 * that the avail queue has buffers, and this callback informs the client.
105 *
106 * @param hVirtio Handle to the VirtIO framework
107 * @param qIdx Index of the notified queue
108 * @param pClient Pointer to opaque client data (state)
109 */
110typedef DECLCALLBACK(void) FNVIRTIOQUEUENOTIFIED(VIRTIOHANDLE hVirtio, void *pClient, uint16_t qIdx);
111typedef FNVIRTIOQUEUENOTIFIED *PFNVIRTIOQUEUENOTIFIED;
112
113 /**
114 * Implementation-specific client callback to access VirtIO Device-specific capabilities
115 * (other VirtIO capabilities and features are handled in VirtIO implementation)
116 *
117 * @param pDevIns The device instance.
118 * @param offset Offset within device specific capabilities struct
119 * @param pvBuf Buffer in which to save read data
120 * @param cbWrite Number of bytes to write
121 */
122typedef DECLCALLBACK(int) FNVIRTIODEVCAPWRITE(PPDMDEVINS pDevIns, uint32_t uOffset, const void *pvBuf, uint32_t cbWrite);
123typedef FNVIRTIODEVCAPWRITE *PFNVIRTIODEVCAPWRITE;
124
125/**
126 * Implementation-specific client ballback to access VirtIO Device-specific capabilities
127 * (other VirtIO capabilities and features are handled in VirtIO implementation)
128 *
129 * @param pDevIns The device instance.
130 * @param offset Offset within device specific capabilities struct
131 * @param pvBuf Buffer in which to save read data
132 * @param cbRead Number of bytes to read
133 */
134typedef DECLCALLBACK(int) FNVIRTIODEVCAPREAD(PPDMDEVINS pDevIns, uint32_t uOffset, void *pvBuf, uint32_t cbRead);
135typedef FNVIRTIODEVCAPREAD *PFNVIRTIODEVCAPREAD;
136
137
138/** @name VirtIO port I/O callbacks.
139 * @{ */
140typedef struct VIRTIOCALLBACKS
141{
142 DECLCALLBACKMEMBER(void, pfnVirtioStatusChanged)(VIRTIOHANDLE hVirtio, void *pClient, uint32_t fDriverOk);
143 DECLCALLBACKMEMBER(void, pfnVirtioQueueNotified)(VIRTIOHANDLE hVirtio, void *pClient, uint16_t qIdx);
144 DECLCALLBACKMEMBER(int, pfnVirtioDevCapRead)(PPDMDEVINS pDevIns, uint32_t uOffset, void *pvBuf, uint32_t cbRead);
145 DECLCALLBACKMEMBER(int, pfnVirtioDevCapWrite)(PPDMDEVINS pDevIns, uint32_t uOffset, const void *pvBuf, uint32_t cbWrite);
146 DECLCALLBACKMEMBER(int, pfnSSMDevLiveExec)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass);
147 DECLCALLBACKMEMBER(int, pfnSSMDevSaveExec)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
148 DECLCALLBACKMEMBER(int, pfnSSMDevLoadExec)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
149 DECLCALLBACKMEMBER(int, pfnSSMDevLoadDone)(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
150} VIRTIOCALLBACKS, *PVIRTIOCALLBACKS;
151/** @} */
152
153/** API for VirtIO client */
154
155/**
156 * Allocate client context for client to work with VirtIO-provided with queue
157 *
158 * @param hVirtio - Handle to VirtIO framework
159 * @param qIdx - Queue number
160 * @param pcszName - Name to give queue
161 *
162 * @returns status VINF_SUCCESS - Success
163 * VERR_INVALID_STATE - VirtIO not in ready state
164 * VERR_NO_MEMORY - Out of memory
165 *
166 * @returns status. If false, the call failed and the client should call virtioResetAll()
167 */
168int virtioQueueAttach(VIRTIOHANDLE hVirtio, uint16_t qIdx, const char *pcszName);
169
170/**
171 * Detaches from queue and release resources
172 *
173 * @param hVirtio - Handle for VirtIO framework
174 * @param qIdx - Queue number
175 *
176 */
177int virtioQueueDetach(VIRTIOHANDLE hVirtio, uint16_t qIdx);
178
179/**
180 * Removes descriptor chain from avail ring of indicated queue and converts the descriptor
181 * chain into its OUT (to device) and IN to guest components. Additionally it converts
182 * the OUT desc chain data to a contiguous virtual memory buffer for easy consumption
183 * by the caller. The caller must return the descriptor chain pointer via virtioQueuePut()
184 * and then call virtioQueueSync() at some point to return the data to the guest and
185 * complete the transaction.
186 *
187 * @param hVirtio - Handle for VirtIO framework
188 * @param qIdx - Queue number
189 * @param fRemove - flags whether to remove desc chain from queue (false = peek)
190 * @param ppDescChain - Address to store pointer to descriptor chain that contains the
191 * pre-processed transaction information pulled from the virtq.
192 *
193 * @returns status VINF_SUCCESS - Success
194 * VERR_INVALID_STATE - VirtIO not in ready state
195 */
196int virtioQueueGet(VIRTIOHANDLE hVirtio, uint16_t qIdx, PPVIRTIO_DESC_CHAIN_T ppDescChain, bool fRemove);
197
198
199/**
200 * Returns data to the guest to complete a transaction initiated by virtQueueGet().
201 * The caller passes in a pointer to a scatter-gather buffer of virtual memory segments
202 * and a pointer to the descriptor chain context originally derived from the pulled
203 * queue entry, and this function will write the virtual memory s/g buffer into the
204 * guest's physical memory free the descriptor chain. The caller handles the freeing
205 * (as needed) of the virtual memory buffer.
206 *
207 * NOTE: This does a write-ahead to the used ring of the guest's queue.
208 * The data written won't be seen by the guest until the next call to virtioQueueSync()
209 *
210 *
211 * @param hVirtio - Handle for VirtIO framework
212 * @param qIdx - Queue number
213 *
214 * @param pSgVirtReturn - Points toscatter-gather buffer of virtual memory segments
215 the caller is returning to the guest.
216 *
217 * @param pDescChain - This contains the context of the scatter-gather buffer
218 * originally pulled from the queue.
219 *
220 * @parame fFence - If true, put up copy fence (memory barrier) after
221 * copying to guest phys. mem.
222 *
223 * @returns VINF_SUCCESS - Success
224 * VERR_INVALID_STATE - VirtIO not in ready state
225 * VERR_NOT_AVAILABLE - Queue is empty
226 */
227
228 int virtioQueuePut(VIRTIOHANDLE hVirtio, uint16_t qIdx, PRTSGBUF pSgVirtReturn,
229 PVIRTIO_DESC_CHAIN_T pDescChain, bool fFence);
230
231
232/**
233 * Updates the indicated virtq's "used ring" descriptor index to match the
234 * current write-head index, thus exposing the data added to the used ring by all
235 * virtioQueuePut() calls since the last sync. This should be called after one or
236 * more virtQueuePut() calls to inform the guest driver there is data in the queue.
237 * Explicit notifications (e.g. interrupt or MSI-X) will be sent to the guest,
238 * depending on VirtIO features negotiated and conditions, otherwise the guest
239 * will detect the update by polling. (see VirtIO 1.0
240 * specification, Section 2.4 "Virtqueues").
241 *
242 * @param hVirtio - Handle for VirtIO framework
243 * @param qIdx - Queue number
244 *
245 * @returns VINF_SUCCESS - Success
246 * VERR_INVALID_STATE - VirtIO not in ready state
247 */
248int virtioQueueSync(VIRTIOHANDLE hVirtio, uint16_t qIdx);
249
250/**
251 * Check if the associated queue is empty
252 *
253 * @param hVirtio - Handle for VirtIO framework
254 * @param qIdx - Queue number
255 *
256 * @returns true - Queue is empty or unavailable.
257 * false - Queue is available and has entries
258 */
259bool virtioQueueIsEmpty (VIRTIOHANDLE hVirtio, uint16_t qIdx);
260
261/**
262 * Return queue enable state
263 *
264 * @param hVirtio - Handle for VirtIO framework
265 * @param qIdx - Queue number
266 * @param fEnabled - Flag indicating whether to enable queue or not
267 */
268bool virtioIsQueueEnabled(VIRTIOHANDLE hVirtio, uint16_t qIdx);
269
270/**
271 * Enable or disable queue
272 *
273 * @param hVirtio - Handle for VirtIO framework
274 * @param qIdx - Queue number
275 * @param fEnabled - Flag indicating whether to enable queue or not
276 */
277void virtioQueueEnable(VIRTIOHANDLE hVirtio, uint16_t qIdx, bool fEnabled);
278
279/**
280 * Request orderly teardown of VirtIO on host and guest
281 * @param hVirtio - Handle for VirtIO framework
282 *
283 */
284void virtioResetAll(VIRTIOHANDLE hVirtio);
285
286/**
287 * This sends notification ('kicks') guest driver to check queues for any new
288 * elements in the used queue to process. It should be called after resuming
289 * in case anything was added to the queues during suspend/quiescing and a
290 * notification was missed, to prevent the guest from stalling after suspend.
291 */
292void virtioPropagateResumeNotification(VIRTIOHANDLE hVirtio);
293
294/**
295 * Get name of queue, by qIdx, assigned at virtioQueueAttach()
296 *
297 * @param hVirtio - Handle for VirtIO framework
298 * @param qIdx - Queue number
299 *
300 * @returns Success: Returns pointer to queue name
301 * Failure: Returns "<null>" (never returns NULL pointer).
302 */
303const char *virtioQueueGetName(VIRTIOHANDLE hVirtio, uint16_t qIdx);
304
305/**
306 * Get the features VirtIO is running withnow.
307 *
308 * @returns Features the guest driver has accepted, finalizing the operational features
309 *
310 */
311uint64_t virtioGetNegotiatedFeatures(VIRTIOHANDLE hVirtio);
312
313/**
314 * Constructor sets up the PCI device controller and VirtIO state
315 *
316 * @param pDevIns Device instance data
317 * @param pClientContext Opaque client context (such as state struct)
318 * @param pVirtio Device State
319 * @param pPciParams Values to populate industry standard PCI Configuration Space data structure
320 * @param pcszInstance Device instance name
321 * @param uDevSpecificFeatures VirtIO device-specific features offered by client
322 * @param devCapReadCallback Client handler to call upon guest read to device specific capabilities.
323 * @param devCapWriteCallback Client handler to call upon guest write to device specific capabilities.
324 * @param devStatusChangedCallback Client handler to call for major device status changes
325 * @param queueNotifiedCallback Client handler for guest-to-host notifications that avail queue has ring data
326 * @param ssmLiveExecCallback Client handler for SSM live exec
327 * @param ssmSaveExecCallback Client handler for SSM save exec
328 * @param ssmLoadExecCallback Client handler for SSM load exec
329 * @param ssmLoadDoneCallback Client handler for SSM load done
330 * @param cbDevSpecificCfg Size of virtio_pci_device_cap device-specific configuration struct
331 * @param pDevSpecificCfg Address of client's VirtIO dev-specific configuration struct
332 */
333int virtioConstruct(PPDMDEVINS pDevIns,
334 void *pClientContext,
335 VIRTIOHANDLE *phVirtio,
336 PVIRTIOPCIPARAMS pPciParams,
337 const char *pcszInstance,
338 uint64_t uDevSpecificFeatures,
339 PFNVIRTIODEVCAPREAD devCapReadCallback,
340 PFNVIRTIODEVCAPWRITE devCapWriteCallback,
341 PFNVIRTIOSTATUSCHANGED devStatusChangedCallback,
342 PFNVIRTIOQUEUENOTIFIED queueNotifiedCallback,
343 PFNSSMDEVLIVEEXEC ssmLiveExecCallback,
344 PFNSSMDEVSAVEEXEC ssmSaveExecCallback,
345 PFNSSMDEVLOADEXEC ssmLoadExecCallback,
346 PFNSSMDEVLOADDONE ssmLoadDoneCallback,
347 uint16_t cbDevSpecificCfg,
348 void *pDevSpecificCfg);
349
350/**
351 * Log memory-mapped I/O input or output value.
352 *
353 * This is designed to be invoked by macros that can make contextual assumptions
354 * (e.g. implicitly derive MACRO parameters from the invoking function). It is exposed
355 * for the VirtIO client doing the device-specific implementation in order to log in a
356 * similar fashion accesses to the device-specific MMIO configuration structure. Macros
357 * that leverage this function are in Virtio_1_0_impl.h and can be used as an example
358 * of how to use this effectively for the device-specific code.
359 *
360 * @param pszFunc - To avoid displaying this function's name via __FUNCTION__ or LogFunc()
361 * @param pszMember - Name of struct member
362 * @param pv - pointer to value
363 * @param cb - size of value
364 * @param uOffset - offset into member where value starts
365 * @param fWrite - True if write I/O
366 * @param fHasIndex - True if the member is indexed
367 * @param idx - The index if fHasIndex
368 */
369void virtioLogMappedIoValue(const char *pszFunc, const char *pszMember, uint32_t uMemberSize,
370 const void *pv, uint32_t cb, uint32_t uOffset,
371 int fWrite, int fHasIndex, uint32_t idx);
372/**
373 * Does a formatted hex dump using Log(()), recommend using VIRTIO_HEX_DUMP() macro to
374 * control enabling of logging efficiently.
375 *
376 * @param pv - pointer to buffer to dump contents of
377 * @param cb - count of characters to dump from buffer
378 * @param uBase - base address of per-row address prefixing of hex output
379 * @param pszTitle - Optional title. If present displays title that lists
380 * provided text with value of cb to indicate size next to it.
381 */
382void virtioHexDump(uint8_t *pv, uint32_t cb, uint32_t uBase, const char *pszTitle);
383
384#endif /* !VBOX_INCLUDED_SRC_VirtIO_Virtio_1_0_h */
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