VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/module/vboxmod.h@ 10202

Last change on this file since 10202 was 8155, checked in by vboxsync, 17 years ago

The Big Sun Rebranding Header Change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/** @file
2 *
3 * vboxadd -- VirtualBox Guest Additions for Linux
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef VBOXMOD_H
23#define VBOXMOD_H
24
25#include <VBox/VBoxGuest.h>
26#include <VBox/VBoxGuestLib.h>
27#include <iprt/asm.h>
28
29typedef struct VBoxDevice VBoxDevice;
30struct VBoxDevice
31{
32 /** the device name */
33 char name[128];
34 /** file node minor code */
35 unsigned minor;
36 /** IRQ number */
37 unsigned irq;
38 /** first IO port */
39 unsigned short io_port;
40 /** physical address of device memory */
41 uint32_t vmmdevmem;
42 /** size of adapter memory */
43 size_t vmmdevmem_size;
44
45 /** kernel space mapping of the adapter memory */
46 VMMDevMemory *pVMMDevMemory;
47 /** current pending events mask */
48 uint32_t u32Events;
49 /** request structure to acknowledge events in ISR */
50 VMMDevEvents *irqAckRequest;
51 /** start of the hypervisor window */
52 void *hypervisorStart;
53 /** size of the hypervisor window in bytes */
54 uint32_t hypervisorSize;
55 /** event synchronization */
56 wait_queue_head_t eventq;
57 /** number of times the guest has interrupted the event loop -
58 implemented as a counter to prevent one waiter swallowing the
59 event. */
60 uint32_t u32GuestInterruptions;
61};
62
63extern int vboxadd_verbosity;
64
65#define wlog(...) printk (KERN_WARNING "vboxadd: " __VA_ARGS__)
66#define ilog(...) printk (KERN_INFO "vboxadd: " __VA_ARGS__)
67#define dlog(...) printk (KERN_DEBUG "vboxadd: " __VA_ARGS__)
68#define elog(...) printk (KERN_ERR "vboxadd: " __VA_ARGS__)
69
70#define vlog(n, ...) \
71if (n >= vboxadd_verbosity) printk (KERN_DEBUG "vboxadd: " __VA_ARGS__)
72
73extern int vboxadd_cmc_init (void);
74extern void vboxadd_cmc_fini (void);
75DECLVBGL (int) vboxadd_cmc_call (void *opaque, uint32_t func, void *data);
76
77/**
78 * This IOCTL wrapper allows the guest to make an HGCM call from user space. The
79 * OS-independant part of the Guest Additions already contain code for making an
80 * HGCM call from the guest, but this code assumes that the call is made from the
81 * kernel's address space. So before calling it, we have to copy all parameters
82 * to the HGCM call from user space to kernel space and reconstruct the structures
83 * passed to the call (which include pointers to other memory) inside the kernel's
84 * address space.
85 *
86 * @returns 0 on success or Linux error code on failure
87 * @param arg User space pointer to the call data structure
88 */
89extern int vbox_ioctl_hgcm_call(unsigned long arg, VBoxDevice *vboxDev);
90
91#endif /* !VBOXMOD_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