6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync/** @file
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync * VBox Host Guest Shared Memory Interface (HGSMI), sHost/Guest shared part.
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync */
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync/*
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2012 Oracle Corporation
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync *
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * available from http://www.virtualbox.org. This file is free software;
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * you can redistribute it and/or modify it under the terms of the GNU
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * General Public License (GPL) as published by the Free Software
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync *
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * The contents of this file may alternatively be used under the terms
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * of the Common Development and Distribution License Version 1.0
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * VirtualBox OSE distribution, in which case the provisions of the
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * CDDL are applicable instead of those of the GPL.
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync *
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * You may elect to license modified versions of this file under the
cf5f6bf2704d4fff443139e10bccc6a0a7fa4b85vboxsync * terms and conditions of either the GPL or the CDDL or both.
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync */
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync#ifndef ___VBox_HGSMI_HGSMIChSetup_h
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync#define ___VBox_HGSMI_HGSMIChSetup_h
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync#include <VBox/HGSMI/HGSMI.h>
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync/* HGSMI setup and configuration channel commands and data structures. */
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync#define HGSMI_CC_HOST_FLAGS_LOCATION 0 /* Tell the host the location of HGSMIHOSTFLAGS structure,
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync * where the host can write information about pending
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync * buffers, etc, and which can be quickly polled by
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync * the guest without a need to port IO.
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync */
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsynctypedef struct _HGSMIBUFFERLOCATION
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync{
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync HGSMIOFFSET offLocation;
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync HGSMISIZE cbLocation;
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync} HGSMIBUFFERLOCATION;
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsyncAssertCompileSize(HGSMIBUFFERLOCATION, 8);
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync/* HGSMI setup and configuration data structures. */
e29d3364973aa01964e03045550def8f0c8295fdvboxsync/* host->guest commands pending, should be accessed under FIFO lock only */
5f9315a5c1883b6dc1740ecbead6cda2041825f4vboxsync#define HGSMIHOSTFLAGS_COMMANDS_PENDING 0x1
e29d3364973aa01964e03045550def8f0c8295fdvboxsync/* IRQ is fired, should be accessed under VGAState::lock only */
5f9315a5c1883b6dc1740ecbead6cda2041825f4vboxsync#define HGSMIHOSTFLAGS_IRQ 0x2
e068057c82b010bc7cc663e8f57ac3ef1890a33cvboxsync#ifdef VBOX_WITH_WDDM
e29d3364973aa01964e03045550def8f0c8295fdvboxsync/* one or more guest commands is completed, should be accessed under FIFO lock only */
974de75a5a0c1d17919acfe706ebd403d9dcc440vboxsync# define HGSMIHOSTFLAGS_GCOMMAND_COMPLETED 0x4
e29d3364973aa01964e03045550def8f0c8295fdvboxsync/* watchdog timer interrupt flag (used for debugging), should be accessed under VGAState::lock only */
e637cb22e348f5665d5473dae55ed785aa7b6e9avboxsync# define HGSMIHOSTFLAGS_WATCHDOG 0x8
974de75a5a0c1d17919acfe706ebd403d9dcc440vboxsync#endif
e29d3364973aa01964e03045550def8f0c8295fdvboxsync/* vsync interrupt flag, should be accessed under VGAState::lock only */
e637cb22e348f5665d5473dae55ed785aa7b6e9avboxsync#define HGSMIHOSTFLAGS_VSYNC 0x10
1a57f94c99b4728b6529213cfea99938b2c75c15vboxsync/** monitor hotplug flag, should be accessed under VGAState::lock only */
1a57f94c99b4728b6529213cfea99938b2c75c15vboxsync#define HGSMIHOSTFLAGS_HOTPLUG 0x20
3357eeed76d19616f784af90f42755da2b54bc4dvboxsync/** Cursor capability state change flag, should be accessed under
3357eeed76d19616f784af90f42755da2b54bc4dvboxsync * VGAState::lock only. @see VBVACONF32. */
3357eeed76d19616f784af90f42755da2b54bc4dvboxsync#define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES 0x40
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsynctypedef struct _HGSMIHOSTFLAGS
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync{
e29d3364973aa01964e03045550def8f0c8295fdvboxsync /* host flags can be accessed and modified in multiple threads concurrently,
e29d3364973aa01964e03045550def8f0c8295fdvboxsync * e.g. CrOpenGL HGCM and GUI threads when to completing HGSMI 3D and Video Accel respectively,
e29d3364973aa01964e03045550def8f0c8295fdvboxsync * EMT thread when dealing with HGSMI command processing, etc.
e29d3364973aa01964e03045550def8f0c8295fdvboxsync * Besides settings/cleaning flags atomically, some each flag has its own special sync restrictions,
e29d3364973aa01964e03045550def8f0c8295fdvboxsync * see commants for flags definitions above */
e29d3364973aa01964e03045550def8f0c8295fdvboxsync volatile uint32_t u32HostFlags;
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync uint32_t au32Reserved[3];
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync} HGSMIHOSTFLAGS;
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsyncAssertCompileSize(HGSMIHOSTFLAGS, 16);
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync#endif
6a97c5c107ea1c9935054f25a4fb5ca59a214b72vboxsync