diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-01-18 11:28:17 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-01-18 11:28:17 -0500 |
commit | 7e960ea104cbd6669b5bece1f32788fb3a1f896f (patch) | |
tree | 3398b0fe6becb0112b7c9fbcdcda276f046b77b3 | |
parent | e5a31060fe1f289ef5e12181368003851a62adf0 (diff) |
Support NV 304.x and 310.x drivers.
-rw-r--r-- | include/litmus/nvidia_info.h | 2 | ||||
-rw-r--r-- | litmus/Kconfig | 8 | ||||
-rw-r--r-- | litmus/gpu_affinity.c | 2 | ||||
-rw-r--r-- | litmus/nvidia_info.c | 87 |
4 files changed, 18 insertions, 81 deletions
diff --git a/include/litmus/nvidia_info.h b/include/litmus/nvidia_info.h index 8c2a5524512e..0ebe9c10c6a2 100644 --- a/include/litmus/nvidia_info.h +++ b/include/litmus/nvidia_info.h | |||
@@ -19,8 +19,6 @@ void shutdown_nvidia_info(void); | |||
19 | 19 | ||
20 | int is_nvidia_func(void* func_addr); | 20 | int is_nvidia_func(void* func_addr); |
21 | 21 | ||
22 | void dump_nvidia_info(const struct tasklet_struct *t); | ||
23 | |||
24 | // Returns the Nvidia device # associated with provided tasklet and work_struct. | 22 | // Returns the Nvidia device # associated with provided tasklet and work_struct. |
25 | u32 get_tasklet_nv_device_num(const struct tasklet_struct *t); | 23 | u32 get_tasklet_nv_device_num(const struct tasklet_struct *t); |
26 | u32 get_work_nv_device_num(const struct work_struct *t); | 24 | u32 get_work_nv_device_num(const struct work_struct *t); |
diff --git a/litmus/Kconfig b/litmus/Kconfig index fa470b27ace4..bf802b760e1f 100644 --- a/litmus/Kconfig +++ b/litmus/Kconfig | |||
@@ -471,11 +471,17 @@ choice | |||
471 | help | 471 | help |
472 | Select the version of CUDA/driver to support. | 472 | Select the version of CUDA/driver to support. |
473 | 473 | ||
474 | config CUDA_5_X | ||
475 | bool "CUDA 5.0+" | ||
476 | depends on LITMUS_NVIDIA && REALTIME_AUX_TASKS | ||
477 | help | ||
478 | Support CUDA 5.0 (dev. driver version: x86_64-310.x) | ||
479 | |||
474 | config CUDA_5_0 | 480 | config CUDA_5_0 |
475 | bool "CUDA 5.0" | 481 | bool "CUDA 5.0" |
476 | depends on LITMUS_NVIDIA && REALTIME_AUX_TASKS | 482 | depends on LITMUS_NVIDIA && REALTIME_AUX_TASKS |
477 | help | 483 | help |
478 | Support CUDA 5.0 RCx (dev. driver version: x86_64-304.33) | 484 | Support CUDA 5.0 (dev. driver version: x86_64-304.54) |
479 | 485 | ||
480 | config CUDA_4_0 | 486 | config CUDA_4_0 |
481 | bool "CUDA 4.0" | 487 | bool "CUDA 4.0" |
diff --git a/litmus/gpu_affinity.c b/litmus/gpu_affinity.c index 7d73105b4181..cf94d8449e3b 100644 --- a/litmus/gpu_affinity.c +++ b/litmus/gpu_affinity.c | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #define MIN(a, b) ((a < b) ? a : b) | 20 | #define MIN(a, b) ((a < b) ? a : b) |
21 | 21 | ||
22 | #if 0 | ||
22 | static fp_t update_estimate(feedback_est_t* fb, fp_t a, fp_t b, lt_t observed) | 23 | static fp_t update_estimate(feedback_est_t* fb, fp_t a, fp_t b, lt_t observed) |
23 | { | 24 | { |
24 | fp_t relative_err; | 25 | fp_t relative_err; |
@@ -35,6 +36,7 @@ static fp_t update_estimate(feedback_est_t* fb, fp_t a, fp_t b, lt_t observed) | |||
35 | 36 | ||
36 | return relative_err; | 37 | return relative_err; |
37 | } | 38 | } |
39 | #endif | ||
38 | 40 | ||
39 | lt_t varience(lt_t nums[], const lt_t avg, const uint16_t count) | 41 | lt_t varience(lt_t nums[], const lt_t avg, const uint16_t count) |
40 | { | 42 | { |
diff --git a/litmus/nvidia_info.c b/litmus/nvidia_info.c index be0c09b19c6d..73c933a87623 100644 --- a/litmus/nvidia_info.c +++ b/litmus/nvidia_info.c | |||
@@ -35,7 +35,7 @@ typedef union | |||
35 | typedef struct | 35 | typedef struct |
36 | { | 36 | { |
37 | NvU64 address; | 37 | NvU64 address; |
38 | #ifdef CONFIG_CUDA_5_0 | 38 | #if defined(CONFIG_CUDA_5_0) || defined(CONFIG_CUDA_5_X) |
39 | NvU64 strapped_size; | 39 | NvU64 strapped_size; |
40 | #endif | 40 | #endif |
41 | NvU64 size; | 41 | NvU64 size; |
@@ -68,13 +68,13 @@ typedef struct | |||
68 | litmus_nv_aperture_t *regs; | 68 | litmus_nv_aperture_t *regs; |
69 | litmus_nv_aperture_t *fb, ud; | 69 | litmus_nv_aperture_t *fb, ud; |
70 | 70 | ||
71 | #ifndef CONFIG_CUDA_5_0 | 71 | #ifndef CONFIG_CUDA_5_X |
72 | litmus_nv_aperture_t agp; | 72 | litmus_nv_aperture_t agp; |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | NvU32 interrupt_line; | 75 | NvU32 interrupt_line; |
76 | 76 | ||
77 | #ifndef CONFIG_CUDA_5_0 | 77 | #ifndef CONFIG_CUDA_5_X |
78 | NvU32 agp_config; | 78 | NvU32 agp_config; |
79 | NvU32 agp_status; | 79 | NvU32 agp_status; |
80 | #endif | 80 | #endif |
@@ -105,7 +105,7 @@ typedef struct litmus_nv_linux_state_s { | |||
105 | 105 | ||
106 | struct pci_dev *dev; | 106 | struct pci_dev *dev; |
107 | 107 | ||
108 | #ifndef CONFIG_CUDA_5_0 | 108 | #ifndef CONFIG_CUDA_5_X |
109 | void *agp_bridge; | 109 | void *agp_bridge; |
110 | #endif | 110 | #endif |
111 | 111 | ||
@@ -116,7 +116,7 @@ typedef struct litmus_nv_linux_state_s { | |||
116 | void *pci_cfgchk_sp; | 116 | void *pci_cfgchk_sp; |
117 | void *isr_bh_sp; | 117 | void *isr_bh_sp; |
118 | 118 | ||
119 | #if defined(CONFIG_CUDA_4_0) || defined(CONFIG_CUDA_5_0) | 119 | #ifndef CONFIG_CUDA_3_2 |
120 | char registry_keys[512]; | 120 | char registry_keys[512]; |
121 | #endif | 121 | #endif |
122 | 122 | ||
@@ -137,7 +137,10 @@ typedef struct litmus_nv_linux_state_s { | |||
137 | struct litmus_nv_linux_state_s *next; | 137 | struct litmus_nv_linux_state_s *next; |
138 | } litmus_nv_linux_state_t; | 138 | } litmus_nv_linux_state_t; |
139 | 139 | ||
140 | void dump_nvidia_info(const struct tasklet_struct *t) | 140 | |
141 | |||
142 | static void __attribute__((unused)) | ||
143 | dump_nvidia_info(const struct tasklet_struct *t) | ||
141 | { | 144 | { |
142 | litmus_nv_state_t* nvstate = NULL; | 145 | litmus_nv_state_t* nvstate = NULL; |
143 | litmus_nv_linux_state_t* linuxstate = NULL; | 146 | litmus_nv_linux_state_t* linuxstate = NULL; |
@@ -219,84 +222,12 @@ void dump_nvidia_info(const struct tasklet_struct *t) | |||
219 | { | 222 | { |
220 | TRACE("INVALID LINUXNVSTATE?????\n"); | 223 | TRACE("INVALID LINUXNVSTATE?????\n"); |
221 | } | 224 | } |
222 | |||
223 | #if 0 | ||
224 | if(pci) | ||
225 | { | ||
226 | TRACE("PCI DEV Info:\n" | ||
227 | "pci device ptr: %p\n" | ||
228 | "\tdevfn = %d\n" | ||
229 | "\tvendor = %d\n" | ||
230 | "\tdevice = %d\n" | ||
231 | "\tsubsystem_vendor = %d\n" | ||
232 | "\tsubsystem_device = %d\n" | ||
233 | "\tslot # = %d\n", | ||
234 | pci, | ||
235 | pci->devfn, | ||
236 | pci->vendor, | ||
237 | pci->device, | ||
238 | pci->subsystem_vendor, | ||
239 | pci->subsystem_device, | ||
240 | pci->slot->number); | ||
241 | } | ||
242 | else | ||
243 | { | ||
244 | TRACE("INVALID PCIDEV PTR?????\n"); | ||
245 | } | ||
246 | #endif | ||
247 | } | 225 | } |
248 | 226 | ||
249 | 227 | ||
250 | 228 | ||
251 | static struct module* nvidia_mod = NULL; | 229 | static struct module* nvidia_mod = NULL; |
252 | 230 | ||
253 | |||
254 | |||
255 | |||
256 | #if 0 | ||
257 | static int nvidia_ready_module_notify(struct notifier_block *self, | ||
258 | unsigned long val, void *data) | ||
259 | { | ||
260 | mutex_lock(&module_mutex); | ||
261 | nvidia_mod = find_module("nvidia"); | ||
262 | mutex_unlock(&module_mutex); | ||
263 | |||
264 | if(nvidia_mod != NULL) | ||
265 | { | ||
266 | TRACE("%s : Found NVIDIA module. Core Code: %p to %p\n", __FUNCTION__, | ||
267 | (void*)(nvidia_mod->module_core), | ||
268 | (void*)(nvidia_mod->module_core) + nvidia_mod->core_size); | ||
269 | init_nv_device_reg(); | ||
270 | return(0); | ||
271 | } | ||
272 | else | ||
273 | { | ||
274 | TRACE("%s : Could not find NVIDIA module! Loaded?\n", __FUNCTION__); | ||
275 | } | ||
276 | } | ||
277 | |||
278 | static int nvidia_going_module_notify(struct notifier_block *self, | ||
279 | unsigned long val, void *data) | ||
280 | { | ||
281 | nvidia_mod = NULL; | ||
282 | mb(); | ||
283 | |||
284 | return 0; | ||
285 | } | ||
286 | |||
287 | static struct notifier_block nvidia_ready = { | ||
288 | .notifier_call = nvidia_ready_module_notify, | ||
289 | .priority = 1, | ||
290 | }; | ||
291 | |||
292 | static struct notifier_block nvidia_going = { | ||
293 | .notifier_call = nvidia_going_module_notify, | ||
294 | .priority = 1, | ||
295 | }; | ||
296 | #endif | ||
297 | |||
298 | |||
299 | |||
300 | static int init_nv_device_reg(void); | 231 | static int init_nv_device_reg(void); |
301 | static int shutdown_nv_device_reg(void); | 232 | static int shutdown_nv_device_reg(void); |
302 | 233 | ||