solaris.h revision 43c04700c331df89380608490a9c65582845dea8
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * VBoxGuest - Guest Additions Driver for Solaris - testcase stubs.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Copyright (C) 2012 Oracle Corporation
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * This file is part of VirtualBox Open Source Edition (OSE), as
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * available from http://www.virtualbox.org. This file is free software;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * you can redistribute it and/or modify it under the terms of the GNU
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * General Public License (GPL) as published by the Free Software
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Foundation, in version 2 as it comes in the "COPYING" file of the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * The contents of this file may alternatively be used under the terms
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk * of the Common Development and Distribution License Version 1.0
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * VirtualBox OSE distribution, in which case the provisions of the
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk * CDDL are applicable instead of those of the GPL.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * You may elect to license modified versions of this file under the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * terms and conditions of either the GPL or the CDDL or both.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* Overrides */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define dev_t unsigned
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* Constants */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** @todo fix this */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* Simple types */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct __ddi_acc_handle * ddi_acc_handle_t;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct __ddi_intr_handle *ddi_intr_handle_t;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef unsigned int uint_t;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef unsigned short ushort_t;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef unsigned char uchar_t;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* Structures */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct queue
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct msgb
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned char *b_rptr;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned char *b_wptr;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned char b_band;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned short b_flag;
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenktypedef struct datab
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned char *db_base;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned char *db_lim;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned char db_ref;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk unsigned char db_type;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#if defined(RT_ARCH_AMD64) /* Actually this should be LP64. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk int dummy; /* For simplicity, to ensure the structure size matches
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk struct copyreq. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct modctl
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenktypedef struct vuid_addr_probe {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* Prototypes */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern int vboxguestSolarisInit(void);
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenkextern int vboxguestSolarisFini(void);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern int vboxguestSolarisInfo(struct modinfo *pModInfo);
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk/* Simple API stubs */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define cmn_err(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define mod_info(...) 0
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define RTR0Term(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define RTLogRelSetDefaultInstance(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define RTLogDestroy(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define VBoxGuestCreateKernelSession(...) VINF_SUCCESS
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define VBoxGuestCreateUserSession(...) VINF_SUCCESS
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define VBoxGuestCloseSession(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define VBoxGuestDeleteDevExt(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define VBoxGuestCommonISR(...) true
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define VbglGRFree(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define qprocson(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define qprocsoff(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define flushq(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define putnext(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define pci_config_teardown(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define ddi_regs_map_free(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define ddi_remove_minor_node(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define ddi_intr_get_supported_types(...) DDI_SUCCESS
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define ddi_intr_free(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define mutex_init(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define mutex_destroy(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define mutex_enter(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define mutex_exit(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define uniqtime32(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define canput(...) true
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define putbq(...) do {} while(0)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* Externally defined helpers. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** Flags set in the struct mblk b_flag member for verification purposes.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/** miocpullup was called for this message. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern void miocack(queue_t *pWriteQueue, mblk_t *pMBlk, int cbData, int rc);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern void miocnak(queue_t *pWriteQueue, mblk_t *pMBlk, int cbData, int iErr);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern int miocpullup(mblk_t *pMBlk, size_t cbMsg);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern void mcopyin(mblk_t *pMBlk, void *pvState, size_t cbData, void *pvUser);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern void mcopyout(mblk_t *pMBlk, void *pvState, size_t cbData, void *pvUser,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkextern void qreply(queue_t *pQueue, mblk_t *pMBlk);
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* API stubs with simple logic */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkstatic inline modctl_t *mod_getctl(void **linkage)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define mod_install(linkage) (s_pvLinkage && ((linkage) == s_pvLinkage) ? 0 : EINVAL)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define OTHERQ(q) ((q)->q_flag & QREADR ? (q) + 1 : (q) - 1)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define WR(q) ((q)->q_flag & QREADR ? (q) + 1 : (q))
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#define RD(q) ((q)->q_flag & QREADR ? (q) : (q) - 1)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* Basic initialisation of a queue structure pair for testing. */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkstatic inline void doInitQueues(queue_t aQueues[2])
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkstatic inline dev_t makedevice(unsigned cMajor, unsigned cMinor)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/* API stubs with controllable logic */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#endif /* ___VBoxGuestTestCaseSolaris_h */