VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/HGSMI/SHGSMIHost.cpp@ 44824

Last change on this file since 44824 was 28800, checked in by vboxsync, 15 years ago

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1/*
2 * Copyright (C) 2010 Oracle Corporation
3 *
4 * This file is part of VirtualBox Open Source Edition (OSE), as
5 * available from http://www.virtualbox.org. This file is free software;
6 * you can redistribute it and/or modify it under the terms of the GNU
7 * General Public License (GPL) as published by the Free Software
8 * Foundation, in version 2 as it comes in the "COPYING" file of the
9 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11 */
12#include "SHGSMIHost.h"
13#include <VBox/VBoxVideo.h>
14
15/*
16 * VBOXSHGSMI made on top HGSMI and allows receiving notifications
17 * about G->H command completion
18 */
19static bool vboxSHGSMICommandCanCompleteSynch (PVBOXSHGSMIHEADER pHdr)
20{
21 return !(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_FORCE);
22}
23
24static int vboxSHGSMICommandCompleteAsynch (PHGSMIINSTANCE pIns, PVBOXSHGSMIHEADER pHdr)
25{
26 bool bDoIrq = !!(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ)
27 || !!(pHdr->fFlags & VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ_FORCE);
28 return HGSMICompleteGuestCommand(pIns, pHdr, bDoIrq);
29}
30
31void VBoxSHGSMICommandMarkAsynchCompletion (void *pvData)
32{
33 PVBOXSHGSMIHEADER pHdr = VBoxSHGSMIBufferHeader (pvData);
34 Assert(!(pHdr->fFlags & VBOXSHGSMI_FLAG_HG_ASYNCH));
35 pHdr->fFlags |= VBOXSHGSMI_FLAG_HG_ASYNCH;
36}
37
38int VBoxSHGSMICommandComplete (PHGSMIINSTANCE pIns, void *pvData)
39{
40 PVBOXSHGSMIHEADER pHdr = VBoxSHGSMIBufferHeader (pvData);
41 if (!(pHdr->fFlags & VBOXSHGSMI_FLAG_HG_ASYNCH) /* <- check if synchronous completion */
42 && vboxSHGSMICommandCanCompleteSynch(pHdr)) /* <- check if can complete synchronously */
43 return VINF_SUCCESS;
44 pHdr->fFlags |= VBOXSHGSMI_FLAG_HG_ASYNCH;
45 return vboxSHGSMICommandCompleteAsynch(pIns, pHdr);
46}
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