1 #ifndef __NVKM_FAULT_PRIV_H__
2 #define __NVKM_FAULT_PRIV_H__
3 #define nvkm_fault_buffer(p) container_of((p), struct nvkm_fault_buffer, object)
4 #define nvkm_fault(p) container_of((p), struct nvkm_fault, subdev)
5 #include <subdev/fault.h>
6 
7 #include <core/event.h>
8 #include <core/object.h>
9 
10 struct nvkm_fault_buffer {
11 	struct nvkm_object object;
12 	struct nvkm_fault *fault;
13 	int id;
14 	int entries;
15 	struct nvkm_memory *mem;
16 	struct nvkm_vma *vma;
17 };
18 
19 int nvkm_fault_new_(const struct nvkm_fault_func *, struct nvkm_device *,
20 		    int index, struct nvkm_fault **);
21 
22 struct nvkm_fault_func {
23 	int (*oneinit)(struct nvkm_fault *);
24 	void (*init)(struct nvkm_fault *);
25 	void (*fini)(struct nvkm_fault *);
26 	void (*intr)(struct nvkm_fault *);
27 	struct {
28 		int nr;
29 		u32 entry_size;
30 		u32 (*entries)(struct nvkm_fault_buffer *);
31 		void (*init)(struct nvkm_fault_buffer *);
32 		void (*fini)(struct nvkm_fault_buffer *);
33 	} buffer;
34 };
35 #endif
36