VBoxVideoGuest.h revision cf25f919d659bf00f73e1551230cd6165961061d
cf25f919d659bf00f73e1551230cd6165961061dvboxsync/** @file
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * VBox Host Guest Shared Memory Interface (HGSMI).
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * OS-independent guest structures.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync/*
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Copyright (C) 2006-2008 Oracle Corporation
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * available from http://www.virtualbox.org. This file is free software;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * General Public License (GPL) as published by the Free Software
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * The contents of this file may alternatively be used under the terms
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * of the Common Development and Distribution License Version 1.0
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * VirtualBox OSE distribution, in which case the provisions of the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * CDDL are applicable instead of those of the GPL.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync *
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * You may elect to license modified versions of this file under the
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * terms and conditions of either the GPL or the CDDL or both.
cf25f919d659bf00f73e1551230cd6165961061dvboxsync */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#ifndef __HGSMI_GUEST_h__
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#define __HGSMI_GUEST_h__
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#include <VBox/HGSMI/HGSMI.h>
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#include <VBox/HGSMI/HGSMIChSetup.h>
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync/**
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Structure grouping the context needed for submitting commands to the host
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * via HGSMI
cf25f919d659bf00f73e1551230cd6165961061dvboxsync */
cf25f919d659bf00f73e1551230cd6165961061dvboxsynctypedef struct _HGSMIGUESTCOMMANDCONTEXT
cf25f919d659bf00f73e1551230cd6165961061dvboxsync{
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /** Information about the memory heap located in VRAM from which data
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * structures to be sent to the host are allocated. */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync HGSMIHEAP heapCtx;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /** The I/O port used for submitting commands to the host by writing their
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * offsets into the heap. */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync RTIOPORT port;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync} HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync/**
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * Structure grouping the context needed for receiving commands from the host
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * via HGSMI
cf25f919d659bf00f73e1551230cd6165961061dvboxsync */
cf25f919d659bf00f73e1551230cd6165961061dvboxsynctypedef struct _HGSMIHOSTCOMMANDCONTEXT
cf25f919d659bf00f73e1551230cd6165961061dvboxsync{
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /** Information about the memory area located in VRAM in which the host
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * places data structures to be read by the guest. */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync HGSMIAREA areaCtx;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /** Convenience structure used for matching host commands to handlers. */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /** @todo handlers are registered individually in code rather than just
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * passing a static structure in order to gain extra flexibility. There is
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * currently no expected usage case for this though. Is the additional
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * complexity really justified? */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync HGSMICHANNELINFO channels;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /** Flag to indicate that one thread is currently processing the command
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * queue. */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync volatile bool fHostCmdProcessing;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /* Pointer to the VRAM location where the HGSMI host flags are kept. */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync volatile HGSMIHOSTFLAGS *pfHostFlags;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync /** The I/O port used for receiving commands from the host as offsets into
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * the memory area and sending back confirmations (command completion,
cf25f919d659bf00f73e1551230cd6165961061dvboxsync * IRQ acknowlegement). */
cf25f919d659bf00f73e1551230cd6165961061dvboxsync RTIOPORT port;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync} HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync
cf25f919d659bf00f73e1551230cd6165961061dvboxsync#endif /* __HGSMI_GUEST_h__*/