1 #ifndef __NOUVEAU_OBJECT_H__
2 #define __NOUVEAU_OBJECT_H__
7 #define NV_PARENT_CLASS 0x80000000
8 #define NV_NAMEDB_CLASS 0x40000000
9 #define NV_CLIENT_CLASS 0x20000000
10 #define NV_SUBDEV_CLASS 0x10000000
11 #define NV_ENGINE_CLASS 0x08000000
12 #define NV_MEMOBJ_CLASS 0x04000000
13 #define NV_GPUOBJ_CLASS 0x02000000
14 #define NV_ENGCTX_CLASS 0x01000000
15 #define NV_OBJECT_CLASS 0x0000ffff
23 #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
24 #define NOUVEAU_OBJECT_MAGIC 0x75ef0bad
33 #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
37 nv_assert(
"BAD CAST -> NvObject, invalid magic");
43 #define nouveau_object_create(p,e,c,s,d) \
44 nouveau_object_create_((p), (e), (c), (s), sizeof(**d), (void **)d)
59 #define nv_oclass(o) nv_object(o)->oclass
60 #define nv_hclass(o) nv_oclass(o)->handle
61 #define nv_iclass(o,i) (nv_hclass(o) & (i))
62 #define nv_mclass(o) nv_iclass(o, NV_OBJECT_CLASS)
67 while (parent && !
nv_iclass(parent, oclass))
116 while (method && method->
call) {
117 if (method->
method == mthd)
118 return method->
call(obj, mthd, &data,
sizeof(data));
128 u8 data = nv_ofuncs(obj)->rd08(obj, addr);
129 nv_spam(obj,
"nv_ro08 0x%08x 0x%02x\n", addr, data);
134 nv_ro16(
void *obj,
u32 addr)
136 u16 data = nv_ofuncs(obj)->rd16(obj, addr);
137 nv_spam(obj,
"nv_ro16 0x%08x 0x%04x\n", addr, data);
142 nv_ro32(
void *obj,
u32 addr)
144 u32 data = nv_ofuncs(obj)->rd32(obj, addr);
145 nv_spam(obj,
"nv_ro32 0x%08x 0x%08x\n", addr, data);
150 nv_wo08(
void *obj,
u32 addr,
u8 data)
152 nv_spam(obj,
"nv_wo08 0x%08x 0x%02x\n", addr, data);
153 nv_ofuncs(obj)->wr08(obj, addr, data);
157 nv_wo16(
void *obj,
u32 addr,
u16 data)
159 nv_spam(obj,
"nv_wo16 0x%08x 0x%04x\n", addr, data);
160 nv_ofuncs(obj)->wr16(obj, addr, data);
164 nv_wo32(
void *obj,
u32 addr,
u32 data)
166 nv_spam(obj,
"nv_wo32 0x%08x 0x%08x\n", addr, data);
167 nv_ofuncs(obj)->wr32(obj, addr, data);
174 nv_wo32(obj, addr, (temp & ~mask) | data);
179 nv_memcmp(
void *obj,
u32 addr,
const char *
str,
u32 len)
181 unsigned char c1, c2;
184 c1 = nv_ro08(obj, addr++);