FreeBSD/sys/dev/agp/agp.c
/* Implementation of the userland ioctl api */
Implementation of the userland ioctl api
Implementation of the userland ioctl api
static int
agp_info_user(device_t dev, agp_info *info)
{
	struct agp_softc *sc = device_get_softc(dev);
	bzero(info, sizeof *info);
	info->bridge_id = pci_get_devid(dev);
	info->agp_mode = 
	    pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4);
	if (sc->as_aperture)
		info->aper_base = rman_get_start(sc->as_aperture);
	else
		info->aper_base = 0;
	info->aper_size = AGP_GET_APERTURE(dev) >> 20;
	info->pg_total = info->pg_system = sc->as_maxmem >> AGP_PAGE_SHIFT;
	info->pg_used = sc->as_allocated >> AGP_PAGE_SHIFT;
	return 0;
}
static int agp_info_user ( device_t dev , agp_info * info ) { struct agp_softc * sc = device_get_softc ( dev ) ; bzero ( info , sizeof * info ) ; info -> bridge_id = pci_get_devid ( dev ) ; info -> agp_mode = pci_read_config ( dev , agp_find_caps ( dev ) + AGP_STATUS , 4 ) ; if ( sc -> as_aperture ) info -> aper_base = rman_get_start ( sc -> as_aperture ) ; else info -> aper_base = 0 ; info -> aper_size = AGP_GET_APERTURE ( dev ) >> 20 ; info -> pg_total = info -> pg_system = sc -> as_maxmem >> AGP_PAGE_SHIFT ; info -> pg_used = sc -> as_allocated >> AGP_PAGE_SHIFT ; return 0 ; }
Implementation of the userland ioctl api
Implementation of the userland ioctl api