/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
int amd64_debug_var = 0;
typedef struct amd64_gart_softstate {
static void *amd64_gart_glob_soft_handle;
static uint64_t
{
/* amd64 aperture base support 40 bits and 32M aligned */
return (aper_base);
}
static size_t
{
/* aper size = 2^value x 32 */
switch (value) {
case 0x0:
size = 32;
break;
case 0x1:
size = 64;
break;
case 0x2:
size = 128;
break;
case 0x3:
size = 256;
break;
case 0x4:
size = 512;
break;
case 0x5:
size = 1024;
break;
case 0x6:
size = 2048;
break;
default: /* reserved */
size = 0;
};
return (size);
}
static void
{
}
static void
{
#ifdef lint
#endif /* lint */
if (enable) {
aper_ctl |= AMD64_GARTEN;
} else
aper_ctl &= (~AMD64_GARTEN);
}
/*ARGSUSED*/
static int
{
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
rval = DDI_SUCCESS;
} else {
}
break;
case DDI_INFO_DEVT2INSTANCE:
rval = DDI_SUCCESS;
break;
default:
break;
}
return (rval);
}
static int
{
int instance;
int status;
switch (cmd) {
default:
return (DDI_FAILURE);
case DDI_RESUME:
/* Nothing special is needed for resume. */
return (DDI_SUCCESS);
case DDI_ATTACH:
break;
}
return (DDI_FAILURE);
if (status != DDI_SUCCESS) {
return (DDI_FAILURE);
}
if (status != DDI_SUCCESS) {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*ARGSUSED*/
static int
{
int instance;
switch (cmd) {
default:
return (DDI_FAILURE);
case DDI_SUSPEND:
/* Nothing special is needed for suspend */
return (DDI_SUCCESS);
case DDI_DETACH:
break;
}
return (DDI_SUCCESS);
}
/*ARGSUSED*/
static int
{
int instance;
static char kernel_only[] =
"amd64_gart_ioctl: is a kernel only ioctl";
return (ENXIO);
}
return (ENXIO);
switch (cmd) {
case AMD64_GET_INFO:
{
sizeof (amdgart_info_t), mode)) {
return (EFAULT);
}
break;
}
case AMD64_SET_GART_ADDR:
{
return (EFAULT);
}
break;
}
case AMD64_FLUSH_GTLB:
{
break;
}
case AMD64_CONFIGURE:
{
/* reserved */
break;
}
case AMD64_UNCONFIG:
{
amd64_enable_gart(sc, 0);
break;
}
default:
return (ENXIO);
}
return (0);
}
/*ARGSUSED*/
static int
{
int instance;
return (ENXIO);
return (ENXIO);
return (0);
}
/*ARGSUSED*/
static int
{
int instance;
return (ENXIO);
return (0);
}
amd64_gart_open, /* cb_open() */
amd64_gart_close, /* cb_close() */
nodev, /* cb_strategy() */
nodev, /* cb_print */
nodev, /* cb_dump */
nodev, /* cb_read() */
nodev, /* cb_write() */
amd64_gart_ioctl, /* cb_ioctl */
nodev, /* cb_devmap */
nodev, /* cb_mmap */
nodev, /* cb_segmap */
nochpoll, /* cb_chpoll */
ddi_prop_op, /* cb_prop_op */
0, /* cb_stream */
CB_REV, /* cb_ops version? */
nodev, /* cb_aread() */
nodev, /* cb_awrite() */
};
/* device operations */
DEVO_REV, /* devo_rev */
0, /* devo_refcnt */
amd64_gart_getinfo, /* devo_getinfo */
nulldev, /* devo_identify */
nulldev, /* devo_probe */
amd64_gart_attach, /* devo_attach */
amd64_gart_detach, /* devo_detach */
nodev, /* devo_reset */
&amd64_gart_cb_ops, /* devo_cb_ops */
0, /* devo_bus_ops */
0, /* devo_power */
ddi_quiesce_not_needed, /* devo_quiesce */
};
"AGP AMD gart driver",
};
MODREV_1, /* MODREV_1 is indicated by manual */
&modldrv,
};
int
_init(void)
{
sizeof (amd64_gart_softstate_t),
if (ret)
return (ret);
return (ret);
}
return (DDI_SUCCESS);
}
int
{
}
int
_fini(void)
{
int ret;
}
return (ret);
}