SUPLib-os2.cpp revision fbce7e4e7123ca200586ee9257a12d663e928841
/** @file
*
* VBox host drivers - Ring-0 support drivers - OS/2 host:
* OS/2 implementations for support library
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 as published by the Free Software Foundation,
* in version 2 as it comes 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define INCL_BASE
#define INCL_ERRORS
#include <os2.h>
#include "SUPLibInternal.h"
#include "SUPDRVIOC.h"
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** OS/2 Device name. */
#define DEVICE_NAME "/dev/vboxdrv$"
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** Handle to the open device. */
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
/**
* Initialize the OS specific part of the library.
* On Linux this involves:
* - loading the module.
* - open driver.
*
* @returns 0 on success.
* @returns current -1 on failure but this must be changed to proper error codes.
* @param cbReserve Ignored on OS/2.
*/
{
/*
* Check if already initialized.
*/
return 0;
/*
* Try open the device.
*/
&hDevice,
&ulAction,
0,
NULL);
if (rc)
return RTErrConvertFromOS2(rc);
return VINF_SUCCESS;
}
int suplibOsTerm(void)
{
/*
* Check if we're initited at all.
*/
{
}
return 0;
}
int suplibOsInstall(void)
{
/** @remark OS/2: Not supported */
return VERR_NOT_SUPPORTED;
}
int suplibOsUninstall(void)
{
/** @remark OS/2: Not supported */
return VERR_NOT_SUPPORTED;
}
{
return VINF_SUCCESS;
return RTErrConvertFromOS2(rc);
}
#ifdef VBOX_WITHOUT_IDT_PATCHING
{
else
return rc;
}
#endif
{
int rc = DosAllocMem(ppvPages, cPages << PAGE_SHIFT, PAG_READ | PAG_WRITE | PAG_EXECUTE | PAG_COMMIT | OBJ_ANY);
if (rc == ERROR_INVALID_PARAMETER)
rc = DosAllocMem(ppvPages, cPages << PAGE_SHIFT, PAG_READ | PAG_WRITE | PAG_EXECUTE | PAG_COMMIT | OBJ_ANY);
if (!rc)
rc = VINF_SUCCESS;
else
return rc;
}
{
if (pvPages)
{
}
return VINF_SUCCESS;
}