2 * Copyright 1999, Be Incorporated.
3 * Copyright 2007, Haiku.
4 * Distributed under the terms of the MIT License.
8 * Eric Petit <eric.petit@lapsus.org>
9 * Michael Pfeiffer <laplace@users.sourceforge.net>
12 #ifndef DRIVERINTERFACE_H
13 #define DRIVERINTERFACE_H
15 #include <GraphicsDefs.h>
16 #include <Accelerant.h>
21 #include "vm_device_version.h"
24 #define MAX_SAMPLE_DEVICE_NAME_LENGTH 32
28 /*--------------------------------------------------------------------*/
35 #define INIT_BEN(x) x.sem = create_sem(0, "VMware "#x); x.ben = 0;
36 #define ACQUIRE_BEN(x) if((atomic_add(&(x.ben), 1)) >= 1) acquire_sem(x.sem);
37 #define RELEASE_BEN(x) if((atomic_add(&(x.ben), -1)) > 1) release_sem(x.sem);
38 #define DELETE_BEN(x) delete_sem(x.sem);
41 /*--------------------------------------------------------------------*/
44 #define ROUND_TO_PAGE_SIZE(x) (((x)+(B_PAGE_SIZE)-1)&~((B_PAGE_SIZE)-1))
47 BppForSpace(int space
)
65 /*--------------------------------------------------------------------*/
66 /* Request codes for ioctl() */
69 VMWARE_GET_PRIVATE_DATA
= B_DEVICE_OP_CODES_END
+ 1,
76 VMWARE_GET_DEVICE_NAME
,
81 /*--------------------------------------------------------------------*/
82 /* Structure shared between the kernel driver and the accelerant */
85 /* Device info and capabilities */
97 uint32 fifoCapabilities
;
100 /* For registers access */
110 /* This changes when we switch to another mode */
114 /* Current display mode */
117 Benaphore engineLock
;