diff options
Diffstat (limited to 'include/litmus/nvidia_info.h')
-rw-r--r-- | include/litmus/nvidia_info.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/litmus/nvidia_info.h b/include/litmus/nvidia_info.h new file mode 100644 index 000000000000..8c2a5524512e --- /dev/null +++ b/include/litmus/nvidia_info.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef __LITMUS_NVIDIA_H | ||
2 | #define __LITMUS_NVIDIA_H | ||
3 | |||
4 | #include <linux/interrupt.h> | ||
5 | |||
6 | |||
7 | #include <litmus/litmus_softirq.h> | ||
8 | |||
9 | #define NV_DEVICE_NUM CONFIG_NV_DEVICE_NUM | ||
10 | |||
11 | /* TODO: Make this a function that checks the PCIe bus or maybe proc settings */ | ||
12 | #define num_online_gpus() (NV_DEVICE_NUM) | ||
13 | |||
14 | |||
15 | /* Functions used for decoding NVIDIA blobs. */ | ||
16 | |||
17 | int init_nvidia_info(void); | ||
18 | void shutdown_nvidia_info(void); | ||
19 | |||
20 | int is_nvidia_func(void* func_addr); | ||
21 | |||
22 | void dump_nvidia_info(const struct tasklet_struct *t); | ||
23 | |||
24 | // Returns the Nvidia device # associated with provided tasklet and work_struct. | ||
25 | u32 get_tasklet_nv_device_num(const struct tasklet_struct *t); | ||
26 | u32 get_work_nv_device_num(const struct work_struct *t); | ||
27 | |||
28 | /* Functions for figuring out the priority of GPU-using tasks */ | ||
29 | |||
30 | struct task_struct* get_nv_max_device_owner(u32 target_device_id); | ||
31 | |||
32 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
33 | struct task_struct* get_nv_klmirqd_thread(u32 target_device_id); | ||
34 | #endif | ||
35 | |||
36 | /* call when the GPU-holding task, t, blocks */ | ||
37 | long enable_gpu_owner(struct task_struct *t); | ||
38 | |||
39 | /* call when the GPU-holding task, t, resumes */ | ||
40 | long disable_gpu_owner(struct task_struct *t); | ||
41 | |||
42 | /* call when the GPU-holding task, t, increases its priority */ | ||
43 | int gpu_owner_increase_priority(struct task_struct *t); | ||
44 | |||
45 | /* call when the GPU-holding task, t, decreases its priority */ | ||
46 | int gpu_owner_decrease_priority(struct task_struct *t); | ||
47 | |||
48 | |||
49 | int reg_nv_device(int reg_device_id, int reg_action, struct task_struct *t); | ||
50 | |||
51 | #endif | ||