solaris.h revision da58a248778a6ea63239d14154b6764bb5bb7f2c
/* $Id$ */
/** @file
* VBoxGuest - Guest Additions Driver for Solaris - testcase stubs.
*/
/*
* Copyright (C) 2011 Oracle Corporation
*
* 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 (GPL) as published by the Free Software
* Foundation, in version 2 as it ddi_info_cmd_tcomes 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.
*/
#ifndef ___VBoxGuestTestCaseSolaris_h
#define ___VBoxGuestTestCaseSolaris_h
#ifdef RT_OS_WINDOWS
# include <WinSock2.h> /* struct timeval */
#endif
#include <errno.h>
#include <time.h> /* struct timeval */
/* Overrides */
#define dev_t unsigned
/* Constants */
#define DDI_FAILURE (-1)
#define DDI_SUCCESS (0)
#define MODMAXNAMELEN 32
#define MODMAXLINKINFOLEN 32
#define MODMAXLINK 10
#define MOD_NOAUTOUNLOAD 0x1
#define M_BREAK 0x08
#define M_PASSFP 0x09
#define M_EVENT 0x0a
#define M_SIG 0x0b
#define M_DELAY 0x0c
#define M_CTL 0x0d
#define M_IOCTL 0x0e
#define M_SETOPTS 0x10
#define M_RSE 0x11
#define M_IOCACK 0x81
#define M_IOCNAK 0x82
#define M_PCPROTO 0x83
#define M_PCSIG 0x84
#define M_READ 0x85
#define M_FLUSH 0x86
#define M_STOP 0x87
#define M_START 0x88
#define M_HANGUP 0x89
#define M_ERROR 0x8a
#define M_COPYIN 0x8b
#define M_COPYOUT 0x8c
#define M_IOCDATA 0x8d
#define M_PCRSE 0x8e
#define M_STOPI 0x8f
#define M_STARTI 0x90
#define M_PCEVENT 0x91
#define M_UNHANGUP 0x92
#define M_CMD 0x93
#define FLUSHALL 1
#define FLUSHDATA 0
#define TRANSPARENT (unsigned int)(-1)
#define FLUSHR 0x01
#define FLUSHW 0x02
#define VUID_NATIVE 0
#define VUID_FIRM_EVENT 1
#define VUID_WHEEL_MAX_COUNT 256
#define DDI_DEVICE_ATTR_V0 0x0001
#define DDI_DEVICE_ATTR_V1 0x0002
#define DDI_NEVERSWAP_ACC 0x00
#define DDI_STRUCTURE_LE_ACC 0x01
#define DDI_STRUCTURE_BE_ACC 0x02
#define DDI_STRICTORDER_ACC 0x00
#define DDI_UNORDERED_OK_ACC 0x01
#define DDI_MERGING_OK_ACC 0x02
#define DDI_LOADCACHING_OK_ACC 0x03
#define DDI_STORECACHING_OK_ACC 0x04
/** @todo fix this */
#define DDI_DEFAULT_ACC DDI_STRICTORDER_ACC
#define DDI_INTR_CLAIMED 1
#define DDI_INTR_UNCLAIMED 0
#define DDI_INTR_TYPE_FIXED 0x1
#define DDI_INTR_TYPE_MSI 0x2
#define DDI_INTR_TYPE_MSIX 0x4
#define LOC_FIRST_DELTA 32640
#define LOC_X_DELTA 32640
#define LOC_Y_DELTA 32641
#define LOC_LAST_DELTA 32641
#define LOC_FIRST_ABSOLUTE 32642
#define LOC_X_ABSOLUTE 32642
#define LOC_Y_ABSOLUTE 32643
#define LOC_LAST_ABSOLUTE 32643
#define FE_PAIR_NONE 0
#define FE_PAIR_SET 1
#define FE_PAIR_DELTA 2
#define FE_PAIR_ABSOLUTE 3
typedef enum
{
typedef enum
{
DDI_ATTACH = 0,
DDI_RESUME = 1,
DDI_PM_RESUME = 2
typedef enum
{
DDI_DETACH = 0,
DDI_SUSPEND = 1,
DDI_PM_SUSPEND = 2,
/* Simple types */
typedef struct dev_info *dev_info_t;
typedef struct __ddi_acc_handle * ddi_acc_handle_t;
typedef struct __ddi_intr_handle *ddi_intr_handle_t;
typedef unsigned int uint_t;
typedef unsigned short ushort_t;
typedef unsigned char uchar_t;
/* Structures */
struct modspecific_info {
char msi_linkinfo[MODMAXLINKINFOLEN];
int msi_p0;
};
struct modinfo {
int mi_info;
int mi_state;
int mi_id;
int mi_nextid;
char *mi_base; /* Was caddr_t */
int mi_rev;
int mi_loadcnt;
char mi_name[MODMAXNAMELEN];
};
typedef struct queue
{
void *q_ptr;
} queue_t;
typedef struct msgb
{
unsigned char *b_rptr;
unsigned char *b_wptr;
unsigned char b_band;
unsigned short b_flag;
} mblk_t;
typedef struct datab
{
unsigned char *db_base;
unsigned char *db_lim;
unsigned char db_ref;
unsigned char db_type;
} dblk_t;
struct iocblk
{
int ioc_cmd;
int ioc_rval;
int ioc_error;
};
struct copyresp
{
int cp_cmd;
char *cp_rval; /* Was caddr_t */
};
typedef struct modctl
{
/* ... */
char mod_loadflags;
/* ... */
} modctl_t;
typedef struct {
int jitter_thresh;
int speed_law;
int speed_limit;
} Ms_parms;
typedef struct {
int height;
int width;
typedef struct vuid_addr_probe {
short base;
union
{
short next;
short current;
} data;
typedef struct ddi_device_acc_attr
{
typedef struct firm_event
{
int value;
} Firm_event;
/* Prototypes */
#define _init vboxguestSolarisInit
extern int vboxguestSolarisInit(void);
#define _fini vboxguestSolarisFini
extern int vboxguestSolarisFini(void);
#define _info vboxguestSolarisInfo
/* Simple API stubs */
#define cmn_err(...) do {} while(0)
#define mod_remove(...) 0
#define mod_info(...) 0
#define RTR0Init(...) VINF_SUCCESS
#define RTR0Term(...) do {} while(0)
#define RTLogCreate(...) VINF_SUCCESS
#define RTLogRelSetDefaultInstance(...) do {} while(0)
#define RTLogDestroy(...) do {} while(0)
#define VBoxGuestCreateKernelSession(...) VINF_SUCCESS
#define VBoxGuestCreateUserSession(...) VINF_SUCCESS
#define VBoxGuestCloseSession(...) do {} while(0)
#define VBoxGuestInitDevExt(...) VINF_SUCCESS
#define VBoxGuestDeleteDevExt(...) do {} while(0)
#define VBoxGuestCommonIOCtl(...) VINF_SUCCESS
#define VBoxGuestCommonISR(...) true
#define VbglGRAlloc(...) VINF_SUCCESS
#define VbglGRPerform(...) VINF_SUCCESS
#define VbglGRFree(...) do {} while(0)
#define qprocson(...) do {} while(0)
#define qprocsoff(...) do {} while(0)
#define flushq(...) do {} while(0)
#define qreply(...) do {} while(0)
#define mcopyin(...) do {} while(0)
#define mcopyout(...) do {} while(0)
#define freemsg(...) do {} while(0)
#define putnext(...) do {} while(0)
#define ddi_get_instance(...) 0
#define pci_config_setup(...) DDI_SUCCESS
#define pci_config_teardown(...) do {} while(0)
#define ddi_regs_map_setup(...) DDI_SUCCESS
#define ddi_regs_map_free(...) do {} while(0)
#define ddi_dev_regsize(...) DDI_SUCCESS
#define ddi_create_minor_node(...) DDI_SUCCESS
#define ddi_remove_minor_node(...) do {} while(0)
#define ddi_intr_get_supported_types(...) DDI_SUCCESS
#define ddi_intr_get_nintrs(...) DDI_SUCCESS
#define ddi_intr_get_navail(...) DDI_SUCCESS
#define ddi_intr_alloc(...) DDI_SUCCESS
#define ddi_intr_free(...) do {} while(0)
#define ddi_intr_get_pri(...) DDI_SUCCESS
#define ddi_intr_enable(...) DDI_SUCCESS
#define ddi_intr_disable(...) DDI_SUCCESS
#define ddi_intr_add_handler(...) DDI_SUCCESS
#define ddi_intr_remove_handler(...) DDI_SUCCESS
#define mutex_init(...) do {} while(0)
#define mutex_destroy(...) do {} while(0)
#define mutex_enter(...) do {} while(0)
#define mutex_exit(...) do {} while(0)
#define uniqtime32(...) do {} while(0)
#define canput(...) true
#define putbq(...) do {} while(0)
/* Externally defined helpers. */
/* API stubs with simple logic */
static void **s_pvLinkage;
{
}
#define QREADR 0x00000010
/* Basic initialisation of a queue structure pair for testing. */
{
}
{
}
{
return device / 4096;
}
/* API stubs with controllable logic */
#endif /* ___VBoxGuestTestCaseSolaris_h */