diff options
-rw-r--r-- | include/litmus.h | 12 | ||||
-rw-r--r-- | src/syscalls.c | 10 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/litmus.h b/include/litmus.h index 52435d8..035d1c3 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -49,7 +49,8 @@ int sporadic_task_ns( | |||
49 | /* file descriptor attached shared objects support */ | 49 | /* file descriptor attached shared objects support */ |
50 | typedef enum { | 50 | typedef enum { |
51 | FMLP_SEM = 0, | 51 | FMLP_SEM = 0, |
52 | SRP_SEM = 1, | 52 | KFMLP_SEM = 1, |
53 | SRP_SEM = 2, | ||
53 | } obj_type_t; | 54 | } obj_type_t; |
54 | 55 | ||
55 | int od_openx(int fd, obj_type_t type, int obj_id, void* config); | 56 | int od_openx(int fd, obj_type_t type, int obj_id, void* config); |
@@ -64,6 +65,10 @@ static inline int od_open(int fd, obj_type_t type, int obj_id) | |||
64 | int litmus_lock(int od); | 65 | int litmus_lock(int od); |
65 | int litmus_unlock(int od); | 66 | int litmus_unlock(int od); |
66 | 67 | ||
68 | /* nvidia graphics cards */ | ||
69 | int register_nv_device(int nv_device_id); | ||
70 | int unregister_nv_device(int nv_device_id); | ||
71 | |||
67 | /* job control*/ | 72 | /* job control*/ |
68 | int get_job_no(unsigned int* job_no); | 73 | int get_job_no(unsigned int* job_no); |
69 | int wait_for_job_release(unsigned int job_no); | 74 | int wait_for_job_release(unsigned int job_no); |
@@ -120,6 +125,11 @@ static inline int open_fmlp_sem(int fd, int name) | |||
120 | return od_open(fd, FMLP_SEM, name); | 125 | return od_open(fd, FMLP_SEM, name); |
121 | } | 126 | } |
122 | 127 | ||
128 | static inline int open_kfmlp_sem(int fd, int name, void* arg) | ||
129 | { | ||
130 | return od_openx(fd, KFMLP_SEM, name, arg); | ||
131 | } | ||
132 | |||
123 | static inline int open_srp_sem(int fd, int name) | 133 | static inline int open_srp_sem(int fd, int name) |
124 | { | 134 | { |
125 | return od_open(fd, SRP_SEM, name); | 135 | return od_open(fd, SRP_SEM, name); |
diff --git a/src/syscalls.c b/src/syscalls.c index d800141..b0fee23 100644 --- a/src/syscalls.c +++ b/src/syscalls.c | |||
@@ -88,3 +88,13 @@ int null_call(cycles_t *timestamp) | |||
88 | { | 88 | { |
89 | return syscall(__NR_null_call, timestamp); | 89 | return syscall(__NR_null_call, timestamp); |
90 | } | 90 | } |
91 | |||
92 | int register_nv_device(int nv_device_id) | ||
93 | { | ||
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); | ||
100 | } | ||