agpgart_impl.h revision b5d3ab78446c645a1150b57b7a58b535229ee742
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_AGPGART_IMPL_H
#define _SYS_AGPGART_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#define AGPGART_MAX_INSTANCES 1
#define AGP_MAXKEYS 256
#define AGPGART_DEVNODE "agpgart"
/*
* The values of type agp_arc_type_t are used as indexes into arc_name
* in agp_kstat.c.
* So if agp_arc_type_t's values are changed in the future, the content
* of arc_name must be changed accordingly.
*/
enum agp_arc_type {
ARC_IGD810 = 0,
ARC_IGD830 = 1,
ARC_INTELAGP = 2,
ARC_AMD64AGP = 3,
ARC_UNKNOWN = 5
};
typedef enum agp_arc_type agp_arc_type_t;
/* linked list structure of multiple agp gart devices access handles */
typedef struct amd64_gart_dev_list {
struct amd64_gart_dev_list *next;
typedef struct amd64_garts_dev {
int gart_device_num;
/*
* AGP target and master device register their config space access
* interface here.
* In AMD64, gart_device_num is the number of hostbridge (device(1100, 1022))
* refer to <<Bios and Kernel Developer's Guide for AMD athlon64 and operton>>
*/
typedef struct agp_registered_dev {
/*
* If the OS have direct mapping support for mapping physical page frames
* directly to user address, we use this struct for memory
* allocation.
*/
typedef struct agp_pmem_handle {
/*
* This struct is used for DDI-compliant memory allocations.
*/
typedef struct agp_kmem_handle {
typedef struct keytable_ent {
int kte_type; /* agp memory type */
int kte_key; /* memory key */
int kte_bound; /* bound to gart table */
void *kte_memhdl; /* agp_kmem or agp_pmem handle */
int kte_refcnt; /* reference count */
typedef struct key_list {
int key_idx;
} key_list_t;
/*
* for kstat
*/
typedef struct agp_kern_info {
#ifdef _MULTI_DATAMODEL
typedef struct _agp_info32 {
} agp_info32_t;
#endif /* _MULTI_DATAMODEL */
typedef struct agpgart_softstate {
int asoft_opened; /* 0 not opened, non-0 opened */
int asoft_acquired; /* 0 released, 1 acquired */
int asoft_agpen; /* 0 disbaled, 1 enabled */
/* resource handles */
/* gart table info */
/* all registered agp device in here */
typedef struct agpgart_ctx {
#define KMEMP(p) ((agp_kmem_handle_t *)p)
#define PMEMP(p) ((agp_pmem_handle_t *)p)
int agp_init_kstats(agpgart_softstate_t *);
void agp_fini_kstats(agpgart_softstate_t *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_AGPGART_IMPL_H */