ddi_i86.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ddi_impldefs.h>
/*
* DDI DMA Engine functions for x86.
* These functions are more naturally generic, but do not apply to SPARC.
*/
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
int
{
}
/*
* implementation specific access handle and routines:
*/
static uintptr_t impl_acc_hdl_id = 0;
/*
* access handle allocator
*/
{
/*
* recast to ddi_acc_hdl_t instead of
* casting to ddi_acc_impl_t and then return the ah_platform_private
*
* this optimization based on the ddi_acc_hdl_t is the
* first member of the ddi_acc_impl_t.
*/
return ((ddi_acc_hdl_t *)hdl);
}
{
int sleepflag;
/*
* Allocate and initialize the data access handle.
*/
if (!hp) {
(waitfp != (int (*)())KM_NOSLEEP))
return (NULL);
}
return ((ddi_acc_handle_t)hp);
}
void
{
if (hp) {
if (impl_acc_hdl_id)
}
}
void
{
/* Error handling not supported */
}
void
{
if (!handlep)
return;
/* temporary set these 64 functions to no-ops */
/*
* check for BIG endian access
*/
} else {
}
/*
* check for BIG endian access
*/
} else {
}
}
}
/*
* The followings are low-level routines for data access.
*
* All of these routines should be implemented in assembly. Those
* that have been rewritten be found in ~ml/ddi_i86_asm.s
*/
/*ARGSUSED*/
{
return (ddi_swap16(*addr));
}
/*ARGSUSED*/
{
}
/*ARGSUSED*/
{
return (ddi_swap32(*addr));
}
/*ARGSUSED*/
{
}
/*ARGSUSED*/
{
return (ddi_swap64(*addr));
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
{
uint8_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*h++ = *d++;
else
*h++ = *d;
}
/*ARGSUSED*/
void
{
uint16_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*h++ = *d++;
else
*h++ = *d;
}
/*ARGSUSED*/
void
{
uint16_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*h++ = ddi_swap16(*d++);
else
*h++ = ddi_swap16(*d);
}
/*ARGSUSED*/
void
{
uint16_t *h;
h = host_addr;
if (flags == DDI_DEV_AUTOINCR)
else
}
/*ARGSUSED*/
void
{
uint32_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*h++ = *d++;
else
*h++ = *d;
}
/*ARGSUSED*/
void
{
uint32_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*h++ = ddi_swap32(*d++);
else
*h++ = ddi_swap32(*d);
}
/*ARGSUSED*/
void
{
uint32_t *h;
h = host_addr;
if (flags == DDI_DEV_AUTOINCR)
else
}
/*ARGSUSED*/
void
{
uint64_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*h++ = *d++;
else
*h++ = *d;
}
/*ARGSUSED*/
void
{
uint64_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*h++ = ddi_swap64(*d++);
else
*h++ = ddi_swap64(*d);
}
/*ARGSUSED*/
void
{
uint8_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*d++ = *h++;
else
*d = *h++;
}
/*ARGSUSED*/
void
{
uint16_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*d++ = *h++;
else
*d = *h++;
}
/*ARGSUSED*/
void
{
uint16_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*d++ = ddi_swap16(*h++);
else
*d = ddi_swap16(*h++);
}
/*ARGSUSED*/
void
{
uint16_t *h;
h = host_addr;
if (flags == DDI_DEV_AUTOINCR)
else
}
/*ARGSUSED*/
void
{
uint32_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*d++ = *h++;
else
*d = *h++;
}
/*ARGSUSED*/
void
{
uint32_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*d++ = ddi_swap32(*h++);
else
*d = ddi_swap32(*h++);
}
/*ARGSUSED*/
void
{
uint32_t *h;
h = host_addr;
if (flags == DDI_DEV_AUTOINCR)
else
}
/*ARGSUSED*/
void
{
uint64_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*d++ = *h++;
else
*d = *h++;
}
/*ARGSUSED*/
void
{
uint64_t *h, *d;
h = host_addr;
d = dev_addr;
if (flags == DDI_DEV_AUTOINCR)
*d++ = ddi_swap64(*h++);
else
*d = ddi_swap64(*h++);
}
/*ARGSUSED*/
{
panic("ddi_get64 from i/o space");
/*NOTREACHED*/
return (0);
}
/*ARGSUSED*/
void
{
panic("ddi_put64 to i/o space");
/*NOTREACHED*/
}
#ifdef _LP64
void
#else /* _ILP32 */
void
#endif
{
}
#ifdef _LP64
void
#else /* _ILP32 */
void
#endif
{
}
#ifdef _LP64
void
#else /* _ILP32 */
void
#endif
{
}
/*ARGSUSED*/
void
{
}
#ifdef _LP64
void
#else /* _ILP32 */
void
#endif
{
}
#ifdef _LP64
void
#else /* _ILP32 */
void
#endif
{
}
#ifdef _LP64
void
#else /* _ILP32 */
void
#endif
{
}
/*ARGSUSED*/
void
{
}
/*
* These next two functions could be translated into assembler someday
*/
int
{
}
int
{
/* Default version, just returns flag value */
}
/*ARGSUSED*/
void
{
/* Default version, does nothing for now */
}
void
{
}
}
void
{
}
}