1 #ifndef __NOUVEAU_BAR_H__
2 #define __NOUVEAU_BAR_H__
4 #include <core/subdev.h>
5 #include <core/device.h>
12 struct nouveau_subdev base;
14 int (*alloc)(struct nouveau_bar *, struct nouveau_object *,
15 struct nouveau_mem *, struct nouveau_object **);
18 int (*kmap)(struct nouveau_bar *, struct nouveau_mem *,
19 u32 flags, struct nouveau_vma *);
20 int (*umap)(struct nouveau_bar *, struct nouveau_mem *,
21 u32 flags, struct nouveau_vma *);
22 void (*unmap)(struct nouveau_bar *, struct nouveau_vma *);
23 void (*flush)(struct nouveau_bar *);
26 static inline struct nouveau_bar *
27 nouveau_bar(void *obj)
29 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BAR];
32 #define nouveau_bar_create(p,e,o,d) \
33 nouveau_bar_create_((p), (e), (o), sizeof(**d), (void **)d)
34 #define nouveau_bar_init(p) \
35 nouveau_subdev_init(&(p)->base)
36 #define nouveau_bar_fini(p,s) \
37 nouveau_subdev_fini(&(p)->base, (s))
39 int nouveau_bar_create_(struct nouveau_object *, struct nouveau_object *,
40 struct nouveau_oclass *, int, void **);
41 void nouveau_bar_destroy(struct nouveau_bar *);
43 void _nouveau_bar_dtor(struct nouveau_object *);
44 #define _nouveau_bar_init _nouveau_subdev_init
45 #define _nouveau_bar_fini _nouveau_subdev_fini
47 extern struct nouveau_oclass nv50_bar_oclass;
48 extern struct nouveau_oclass nvc0_bar_oclass;
50 int nouveau_bar_alloc(struct nouveau_bar *, struct nouveau_object *,
51 struct nouveau_mem *, struct nouveau_object **);
53 void nv84_bar_flush(struct nouveau_bar *);