1#ifndef __NOUVEAU_BAR_H__
2#define __NOUVEAU_BAR_H__
3
4#include <core/subdev.h>
5#include <core/device.h>
6
7struct nouveau_mem;
8struct nouveau_vma;
9
10struct 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
31static inline struct nouveau_bar *
32nouveau_bar(void *obj)
33{
34 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BAR];
35}
36
37extern struct nouveau_oclass nv50_bar_oclass;
38extern struct nouveau_oclass nvc0_bar_oclass;
39
40#endif
41