| 1 | #ifndef __NOUVEAU_BAR_H__ |
| 2 | #define __NOUVEAU_BAR_H__ |
| 3 | |
| 4 | #include <core/subdev.h> |
| 5 | #include <core/device.h> |
| 6 | |
| 7 | struct nouveau_mem; |
| 8 | struct nouveau_vma; |
| 9 | |
| 10 | struct nouveau_bar { |
| 11 | struct nouveau_subdev base; |
| 12 | |
| 13 | int (*alloc)(struct nouveau_bar *, struct nouveau_object *, |
| 14 | struct nouveau_mem *, struct nouveau_object **); |
| 15 | #ifdef __NetBSD__ |
| 16 | bus_space_tag_t iomemt; |
| 17 | bus_space_handle_t iomemh; |
| 18 | bus_size_t iomemsz; |
| 19 | #else |
| 20 | void __iomem *iomem; |
| 21 | #endif |
| 22 | |
| 23 | int (*kmap)(struct nouveau_bar *, struct nouveau_mem *, |
| 24 | u32 flags, struct nouveau_vma *); |
| 25 | int (*umap)(struct nouveau_bar *, struct nouveau_mem *, |
| 26 | u32 flags, struct nouveau_vma *); |
| 27 | void (*unmap)(struct nouveau_bar *, struct nouveau_vma *); |
| 28 | void (*flush)(struct nouveau_bar *); |
| 29 | }; |
| 30 | |
| 31 | static inline struct nouveau_bar * |
| 32 | nouveau_bar(void *obj) |
| 33 | { |
| 34 | return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BAR]; |
| 35 | } |
| 36 | |
| 37 | extern struct nouveau_oclass nv50_bar_oclass; |
| 38 | extern struct nouveau_oclass nvc0_bar_oclass; |
| 39 | |
| 40 | #endif |
| 41 | |