Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
instmem.h
Go to the documentation of this file.
1 #ifndef __NOUVEAU_INSTMEM_H__
2 #define __NOUVEAU_INSTMEM_H__
3 
4 #include <core/subdev.h>
5 #include <core/device.h>
6 #include <core/mm.h>
7 
10  struct list_head head;
14 };
15 
16 static inline struct nouveau_instobj *
17 nv_memobj(void *obj)
18 {
19 #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
21  nv_assert("BAD CAST -> NvMemObj, %08x", nv_hclass(obj));
22 #endif
23  return obj;
24 }
25 
26 #define nouveau_instobj_create(p,e,o,d) \
27  nouveau_instobj_create_((p), (e), (o), sizeof(**d), (void **)d)
28 #define nouveau_instobj_init(p) \
29  nouveau_object_init(&(p)->base)
30 #define nouveau_instobj_fini(p,s) \
31  nouveau_object_fini(&(p)->base, (s))
32 
34  struct nouveau_oclass *, int, void **);
36 
38 #define _nouveau_instobj_init nouveau_object_init
39 #define _nouveau_instobj_fini nouveau_object_fini
40 
43  struct list_head list;
44 
46  int (*alloc)(struct nouveau_instmem *, struct nouveau_object *,
47  u32 size, u32 align, struct nouveau_object **);
48 };
49 
50 static inline struct nouveau_instmem *
51 nouveau_instmem(void *obj)
52 {
53  return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_INSTMEM];
54 }
55 
56 #define nouveau_instmem_create(p,e,o,d) \
57  nouveau_instmem_create_((p), (e), (o), sizeof(**d), (void **)d)
58 #define nouveau_instmem_destroy(p) \
59  nouveau_subdev_destroy(&(p)->base)
61  struct nouveau_oclass *, int, void **);
63 int nouveau_instmem_fini(struct nouveau_instmem *, bool);
64 
65 #define _nouveau_instmem_dtor _nouveau_subdev_dtor
67 int _nouveau_instmem_fini(struct nouveau_object *, bool);
68 
72 
73 #endif