/** @file
* Utility routines for calling the Virtual DMA Services.
*/
/*
* 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 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.
*/
#include <stdint.h>
#include "biosint.h"
#include "vds.h"
typedef struct {
} vds_ver;
int vds_is_present( void )
{
return( !!(*vds_flags & VDS_PRESENT) );
}
#pragma aux vds_lock_sg = \
"mov ax, 8105h" \
"mov dx, 0" \
"int 4Bh" \
"jc error" \
"xor al, al" \
"error:" \
"cbw" \
#pragma aux vds_unlock_sg = \
"mov ax, 8106h" \
"mov dx, 0" \
"int 4Bh" \
"jc error" \
"xor al, al" \
"error:" \
"cbw" \
/*
* Convert a real mode 16:16 segmented address to a simple 32-bit
* linear address.
*/
{
}
/*
* present or not. This routine either calls VDS to do the work or
* trivially creates the list if no remapping is needed.
*/
{
int rc;
/* NB: The num_avail field in the EDDS must be set correctly! */
if( vds_is_present() ) {
/* VDS is present, use it. */
} else {
/* No VDS, do it ourselves with one S/G entry. */
rc = VDS_SUCCESS;
}
return( rc );
}
/*
* is present or not.
*/
{
int rc;
if( vds_is_present() ) {
/* VDS is present, use it. */
} else {
/* No VDS, not much to do. */
/* We could check here if the EDDS had in fact been built by us.
* But if VDS really went away, what can we do about it anyway?
*/
rc = VDS_SUCCESS;
}
return( rc );
}