diff options
author | ztong <ztong@cs.unc.edu> | 2021-03-01 19:30:52 -0500 |
---|---|---|
committer | ztong <ztong@cs.unc.edu> | 2021-03-01 19:30:52 -0500 |
commit | f5160dfa9d1184f5bc90b7b8bf6f99c83e66e391 (patch) | |
tree | ddd260603a5183eb93e60ccb77d231740d39d01d | |
parent | b084d236bb49863975667bfa2faadf0154d823b6 (diff) |
-rw-r--r-- | bin/rtspin.c | 2 | ||||
-rw-r--r-- | include/litmus.h | 6 | ||||
-rw-r--r-- | src/syscalls.c | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/bin/rtspin.c b/bin/rtspin.c index 8006840..369b7c3 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c | |||
@@ -323,6 +323,8 @@ static void job(double exec_time, double program_end, int lock_od, double cs_len | |||
323 | if (check_fz) | 323 | if (check_fz) |
324 | litmus_access_forbidden_zone_check(lock_od, s2ns(cs_length), s2ns(cs_length)); | 324 | litmus_access_forbidden_zone_check(lock_od, s2ns(cs_length), s2ns(cs_length)); |
325 | loop_for(cs_length, program_end + 1); | 325 | loop_for(cs_length, program_end + 1); |
326 | if (check_fz) | ||
327 | litmus_exit_forbidden_zone(lock_od); | ||
326 | litmus_unlock(lock_od); | 328 | litmus_unlock(lock_od); |
327 | 329 | ||
328 | /* non-critical section */ | 330 | /* non-critical section */ |
diff --git a/include/litmus.h b/include/litmus.h index 4d6a9d9..3b12516 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -247,6 +247,12 @@ int litmus_lock_cs(int od, lt_t cs_len); | |||
247 | */ | 247 | */ |
248 | int litmus_access_forbidden_zone_check(int od, lt_t fz_len, lt_t panic_len); | 248 | int litmus_access_forbidden_zone_check(int od, lt_t fz_len, lt_t panic_len); |
249 | /** | 249 | /** |
250 | * exit forbidden zone | ||
251 | * @param od Object descriptor obtained by litmus_open_lock() | ||
252 | * @return 0 iff exits successfully | ||
253 | */ | ||
254 | int litmus_exit_forbidden_zone(int od); | ||
255 | /** | ||
250 | * Release lock | 256 | * Release lock |
251 | * @param od Object descriptor obtained by litmus_open_lock() | 257 | * @param od Object descriptor obtained by litmus_open_lock() |
252 | * @return 0 iff the lock was released successfully | 258 | * @return 0 iff the lock was released successfully |
diff --git a/src/syscalls.c b/src/syscalls.c index af46570..908d94b 100644 --- a/src/syscalls.c +++ b/src/syscalls.c | |||
@@ -84,6 +84,11 @@ int litmus_access_forbidden_zone_check(int od, lt_t fz_len, lt_t panic_len) | |||
84 | return litmus_syscall(LRT_access_forbidden_zone_check, (unsigned long) &args); | 84 | return litmus_syscall(LRT_access_forbidden_zone_check, (unsigned long) &args); |
85 | } | 85 | } |
86 | 86 | ||
87 | int litmus_exit_forbidden_zone(int od) | ||
88 | { | ||
89 | return litmus_syscall(LRT_exit_forbidden_zone, od); | ||
90 | } | ||
91 | |||
87 | int litmus_unlock(int od) | 92 | int litmus_unlock(int od) |
88 | { | 93 | { |
89 | return litmus_syscall(LRT_litmus_unlock, od); | 94 | return litmus_syscall(LRT_litmus_unlock, od); |