1#ifndef __NOUVEAU_BAR_H__ 2#define __NOUVEAU_BAR_H__ 3 4#include <core/subdev.h> 5#include <core/device.h> 6 7#include <subdev/fb.h> 8 9struct nouveau_vma; 10 11struct nouveau_bar { 12 struct nouveau_subdev base; 13 14 int (*alloc)(struct nouveau_bar *, struct nouveau_object *, 15 struct nouveau_mem *, struct nouveau_object **); 16 void __iomem *iomem; 17 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 *); 24}; 25 26static inline struct nouveau_bar * 27nouveau_bar(void *obj) 28{ 29 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BAR]; 30} 31 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)) 38 39int nouveau_bar_create_(struct nouveau_object *, struct nouveau_object *, 40 struct nouveau_oclass *, int, void **); 41void nouveau_bar_destroy(struct nouveau_bar *); 42 43void _nouveau_bar_dtor(struct nouveau_object *); 44#define _nouveau_bar_init _nouveau_subdev_init 45#define _nouveau_bar_fini _nouveau_subdev_fini 46 47extern struct nouveau_oclass nv50_bar_oclass; 48extern struct nouveau_oclass nvc0_bar_oclass; 49 50int nouveau_bar_alloc(struct nouveau_bar *, struct nouveau_object *, 51 struct nouveau_mem *, struct nouveau_object **); 52 53void nv84_bar_flush(struct nouveau_bar *); 54 55#endif 56