VirtualBox

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

Last change on this file since 4997 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 *
3 * vboxadd -- VirtualBox Guest Additions for Linux
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOXMOD_H
19#define VBOXMOD_H
20
21#include <VBox/VBoxGuest.h>
22#include <VBox/VBoxGuestLib.h>
23#include <iprt/asm.h>
24
25typedef struct VBoxDevice VBoxDevice;
26struct VBoxDevice
27{
28 /** the device name */
29 char name[128];
30 /** file node minor code */
31 unsigned minor;
32 /** IRQ number */
33 unsigned irq;
34 /** first IO port */
35 unsigned short io_port;
36 /** physical address of device memory */
37 uint32_t vmmdevmem;
38 /** size of adapter memory */
39 size_t vmmdevmem_size;
40
41 /** kernel space mapping of the adapter memory */
42 VMMDevMemory *pVMMDevMemory;
43 /** current pending events mask */
44 uint32_t u32Events;
45 /** request structure to acknowledge events in ISR */
46 VMMDevEvents *irqAckRequest;
47 /** start of the hypervisor window */
48 void *hypervisorStart;
49 /** size of the hypervisor window in bytes */
50 uint32_t hypervisorSize;
51 /** event synchronization */
52 wait_queue_head_t eventq;
53};
54
55extern int vboxadd_verbosity;
56
57#define wlog(...) printk (KERN_WARNING "vboxadd: " __VA_ARGS__)
58#define ilog(...) printk (KERN_INFO "vboxadd: " __VA_ARGS__)
59#define dlog(...) printk (KERN_DEBUG "vboxadd: " __VA_ARGS__)
60#define elog(...) printk (KERN_ERR "vboxadd: " __VA_ARGS__)
61
62#define vlog(n, ...) \
63if (n >= vboxadd_verbosity) printk (KERN_DEBUG "vboxadd: " __VA_ARGS__)
64
65#define compiler_assert(val) \
66do { \
67switch(0) { \
68case 0: \
69case (val): \
70default: \
71break; \
72} \
73} while(0);
74
75extern int vboxadd_cmc_init (void);
76extern void vboxadd_cmc_fini (void);
77DECLVBGL (int) vboxadd_cmc_call (void *opaque, uint32_t func, void *data);
78
79/**
80 * This IOCTL wrapper allows the guest to make an HGCM call from user space. The
81 * OS-independant part of the Guest Additions already contain code for making an
82 * HGCM call from the guest, but this code assumes that the call is made from the
83 * kernel's address space. So before calling it, we have to copy all parameters
84 * to the HGCM call from user space to kernel space and reconstruct the structures
85 * passed to the call (which include pointers to other memory) inside the kernel's
86 * address space.
87 *
88 * @returns 0 on success or Linux error code on failure
89 * @param arg User space pointer to the call data structure
90 */
91extern int vbox_ioctl_hgcm_call(unsigned long arg, VBoxDevice *vboxDev);
92
93#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