vboxmod.h revision c97989161fbe75bc14cea477a5443bbf474dd3ad
/** @file
*
* vboxadd -- VirtualBox Guest Additions for Linux
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef VBOXMOD_H
#define VBOXMOD_H
#include <VBox/VBoxGuest.h>
#include <VBox/VBoxGuestLib.h>
typedef struct VBoxDevice VBoxDevice;
struct VBoxDevice
{
/** the device name */
char name[128];
/** file node minor code */
unsigned minor;
/** IRQ number */
unsigned irq;
/** first IO port */
unsigned short io_port;
/** physical address of device memory */
/** size of adapter memory */
/** kernel space mapping of the adapter memory */
/** current pending events mask */
/** request structure to acknowledge events in ISR */
/** start of the hypervisor window */
void *hypervisorStart;
/** size of the hypervisor window in bytes */
/** event synchronization */
};
extern int vboxadd_verbosity;
#define vlog(n, ...) \
#define compiler_assert(val) \
do { \
switch(0) { \
case 0: \
case (val): \
default: \
break; \
} \
} while(0);
extern int vboxadd_cmc_init (void);
extern void vboxadd_cmc_fini (void);
/**
* This IOCTL wrapper allows the guest to make an HGCM call from user space. The
* OS-independant part of the Guest Additions already contain code for making an
* HGCM call from the guest, but this code assumes that the call is made from the
* kernel's address space. So before calling it, we have to copy all parameters
* to the HGCM call from user space to kernel space and reconstruct the structures
* passed to the call (which include pointers to other memory) inside the kernel's
* address space.
*
* @returns 0 on success or Linux error code on failure
* @param arg User space pointer to the call data structure
*/
#endif /* !VBOXMOD_H */