diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2011-03-31 12:13:01 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2011-03-31 12:40:49 -0400 |
commit | df57458e4d8d86eee647a11f00ef7b2913a7f4a5 (patch) | |
tree | 04d28ecbc954dfd962f7ec033660aba874d54561 | |
parent | 26094304c72ab8d2488412df990dd966c60c5a02 (diff) |
Simplify Nvidia registration.wip-kernsthreads-nv
Cleaned up the interface to register nvidia devices. Removed reliance
on use of pid since we always assumed pid was the calling thread
(AKA 'current').
-rw-r--r-- | include/litmus.h | 12 | ||||
-rw-r--r-- | src/syscalls.c | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/include/litmus.h b/include/litmus.h index d45cbd0..035d1c3 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -66,7 +66,8 @@ int litmus_lock(int od); | |||
66 | int litmus_unlock(int od); | 66 | int litmus_unlock(int od); |
67 | 67 | ||
68 | /* nvidia graphics cards */ | 68 | /* nvidia graphics cards */ |
69 | int register_nv_device(pid_t pid, int nv_device_id); | 69 | int register_nv_device(int nv_device_id); |
70 | int unregister_nv_device(int nv_device_id); | ||
70 | 71 | ||
71 | /* job control*/ | 72 | /* job control*/ |
72 | int get_job_no(unsigned int* job_no); | 73 | int get_job_no(unsigned int* job_no); |
@@ -124,16 +125,17 @@ static inline int open_fmlp_sem(int fd, int name) | |||
124 | return od_open(fd, FMLP_SEM, name); | 125 | return od_open(fd, FMLP_SEM, name); |
125 | } | 126 | } |
126 | 127 | ||
127 | static inline int open_srp_sem(int fd, int name) | 128 | static inline int open_kfmlp_sem(int fd, int name, void* arg) |
128 | { | 129 | { |
129 | return od_open(fd, SRP_SEM, name); | 130 | return od_openx(fd, KFMLP_SEM, name, arg); |
130 | } | 131 | } |
131 | 132 | ||
132 | static inline int open_kfmlp_sem(int fd, int name, void* arg) | 133 | static inline int open_srp_sem(int fd, int name) |
133 | { | 134 | { |
134 | return od_openx(fd, KFMLP_SEM, name, arg); | 135 | return od_open(fd, SRP_SEM, name); |
135 | } | 136 | } |
136 | 137 | ||
138 | |||
137 | /* syscall overhead measuring */ | 139 | /* syscall overhead measuring */ |
138 | int null_call(cycles_t *timestamp); | 140 | int null_call(cycles_t *timestamp); |
139 | 141 | ||
diff --git a/src/syscalls.c b/src/syscalls.c index b6f6c5c..b0fee23 100644 --- a/src/syscalls.c +++ b/src/syscalls.c | |||
@@ -89,7 +89,12 @@ int null_call(cycles_t *timestamp) | |||
89 | return syscall(__NR_null_call, timestamp); | 89 | return syscall(__NR_null_call, timestamp); |
90 | } | 90 | } |
91 | 91 | ||
92 | int register_nv_device(pid_t pid, int nv_device_id) | 92 | int register_nv_device(int nv_device_id) |
93 | { | 93 | { |
94 | return syscall(__NR_register_nv_device, pid, nv_device_id); | 94 | return syscall(__NR_register_nv_device, nv_device_id, 1); |
95 | } | ||
96 | |||
97 | int unregister_nv_device(int nv_device_id) | ||
98 | { | ||
99 | return syscall(__NR_register_nv_device, nv_device_id, 0); | ||
95 | } | 100 | } |