From c4128b99e1206d03d15c5d2e1b6af164bf261c40 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Sat, 29 Jan 2011 14:53:21 -0500 Subject: switch to generic locking system calls The new generic lock layer in LITMUS^RT does away with per-protocol system calls. Change accordingly. --- include/litmus.h | 10 +++------- src/syscalls.c | 18 ++++-------------- tests/fdso.c | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 31 deletions(-) diff --git a/include/litmus.h b/include/litmus.h index 3b762db..52435d8 100644 --- a/include/litmus.h +++ b/include/litmus.h @@ -60,13 +60,9 @@ static inline int od_open(int fd, obj_type_t type, int obj_id) return od_openx(fd, type, obj_id, 0); } -/* FMLP binary semaphore support */ -int fmlp_down(int od); -int fmlp_up(int od); - -/* SRP binary semaphore support */ -int srp_down(int od); -int srp_up(int od); +/* real-time locking protocol support */ +int litmus_lock(int od); +int litmus_unlock(int od); /* job control*/ int get_job_no(unsigned int* job_no); diff --git a/src/syscalls.c b/src/syscalls.c index c738ac4..d800141 100644 --- a/src/syscalls.c +++ b/src/syscalls.c @@ -44,24 +44,14 @@ int od_close(int od) return syscall(__NR_od_close, od); } -int fmlp_down(int od) +int litmus_lock(int od) { - return syscall(__NR_fmlp_down, od); + return syscall(__NR_litmus_lock, od); } -int fmlp_up(int od) +int litmus_unlock(int od) { - return syscall(__NR_fmlp_up, od); -} - -int srp_down(int od) -{ - return syscall(__NR_srp_down, od); -} - -int srp_up(int od) -{ - return syscall(__NR_srp_up, od); + return syscall(__NR_litmus_unlock, od); } int get_job_no(unsigned int *job_no) diff --git a/tests/fdso.c b/tests/fdso.c index d60e9ef..1e2ab29 100644 --- a/tests/fdso.c +++ b/tests/fdso.c @@ -31,16 +31,16 @@ TESTCASE(fmlp_not_active, C_EDF | PFAIR | LINUX, TESTCASE(invalid_od, ALL, "reject invalid object descriptors") { - SYSCALL_FAILS( EINVAL, fmlp_down(3) ); + SYSCALL_FAILS( EINVAL, litmus_lock(3) ); - SYSCALL_FAILS( EINVAL, fmlp_up(3) ); + SYSCALL_FAILS( EINVAL, litmus_unlock(3) ); SYSCALL_FAILS( EINVAL, od_close(3) ); - SYSCALL_FAILS( EINVAL, fmlp_down(-1) ); + SYSCALL_FAILS( EINVAL, litmus_lock(-1) ); - SYSCALL_FAILS( EINVAL, fmlp_up(-1) ); + SYSCALL_FAILS( EINVAL, litmus_unlock(-1) ); SYSCALL_FAILS( EINVAL, od_close(-1) ); } @@ -61,9 +61,9 @@ TESTCASE(not_inherit_od, GSN_EDF | PSN_EDF, SYSCALL( od = open_fmlp_sem(fd, 0) ); - SYSCALL( fmlp_down(od) ); + SYSCALL( litmus_lock(od) ); - SYSCALL( fmlp_up(od) ); + SYSCALL( litmus_unlock(od) ); pid = fork(); @@ -71,12 +71,12 @@ TESTCASE(not_inherit_od, GSN_EDF | PSN_EDF, if (pid == 0) { /* child */ - SYSCALL_FAILS(EINVAL, fmlp_down(od) ); - SYSCALL_FAILS(EINVAL, fmlp_up(od) ); + SYSCALL_FAILS(EINVAL, litmus_lock(od) ); + SYSCALL_FAILS(EINVAL, litmus_unlock(od) ); exit(0); } else { - SYSCALL( fmlp_down(od) ); - SYSCALL( fmlp_up(od) ); + SYSCALL( litmus_lock(od) ); + SYSCALL( litmus_unlock(od) ); SYSCALL( waitpid(pid, &status, 0) ); ASSERT(WEXITSTATUS(status) == 0); } -- cgit v1.2.2