diff options
author | Tanya Amert <tamert@cs.unc.edu> | 2020-09-23 15:58:32 -0400 |
---|---|---|
committer | Tanya Amert <tamert@cs.unc.edu> | 2020-09-23 15:58:32 -0400 |
commit | ea6838de3c4c0b2abd7ba8f058ba77a924a38a6f (patch) | |
tree | 63f475d0b1efd1ca3ad0cd23ed8a05aecb012b9f | |
parent | a430c7b5cacae4219a185decb863f6fb9e5cbcb9 (diff) |
Ported global OMLP from BBB's dissertation work forward.
-rw-r--r-- | include/litmus.h | 12 | ||||
-rw-r--r-- | src/litmus.c | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/litmus.h b/include/litmus.h index 335ecac..a50f996 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -178,6 +178,7 @@ typedef enum { | |||
178 | DPCP_SEM = 4, /**< Distributed Priority Ceiling Protocol */ | 178 | DPCP_SEM = 4, /**< Distributed Priority Ceiling Protocol */ |
179 | PCP_SEM = 5, /**< Priority Ceiling Protocol */ | 179 | PCP_SEM = 5, /**< Priority Ceiling Protocol */ |
180 | DFLP_SEM = 6, /**< Distributed FIFO Locking Protocol */ | 180 | DFLP_SEM = 6, /**< Distributed FIFO Locking Protocol */ |
181 | OMLP_SEM = 7, /**< Global O(m) Locking Protocol */ | ||
181 | } obj_type_t; | 182 | } obj_type_t; |
182 | 183 | ||
183 | /** | 184 | /** |
@@ -454,6 +455,17 @@ static inline int open_dflp_sem(int fd, int name, int cpu) | |||
454 | } | 455 | } |
455 | 456 | ||
456 | /** | 457 | /** |
458 | * Allocate a semaphore following the global OMLP protocol | ||
459 | * @param fd File descriptor to associate lock with | ||
460 | * @param name Name of the lock, user-chosen integer | ||
461 | * @return Object descriptor for given lock | ||
462 | */ | ||
463 | static inline int open_omlp_sem(int fd, int name) | ||
464 | { | ||
465 | return od_open(fd, OMLP_SEM, name); | ||
466 | } | ||
467 | |||
468 | /** | ||
457 | * Get budget information from the scheduler (in nanoseconds). | 469 | * Get budget information from the scheduler (in nanoseconds). |
458 | * @param expended pointer to time value in wich the total | 470 | * @param expended pointer to time value in wich the total |
459 | * amount of already used-up budget will be stored. | 471 | * amount of already used-up budget will be stored. |
diff --git a/src/litmus.c b/src/litmus.c index eb33c41..4d9e986 100644 --- a/src/litmus.c +++ b/src/litmus.c | |||
@@ -27,6 +27,7 @@ static struct { | |||
27 | LP(DPCP), | 27 | LP(DPCP), |
28 | LP(PCP), | 28 | LP(PCP), |
29 | LP(DFLP), | 29 | LP(DFLP), |
30 | LP(OMLP), | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | #define NUM_PROTOS (sizeof(protocol)/sizeof(protocol[0])) | 33 | #define NUM_PROTOS (sizeof(protocol)/sizeof(protocol[0])) |