diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-09-27 14:08:08 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-02-19 15:51:25 -0500 |
commit | 8edeea97158cfe9fbb15aea57bb77fcc346cfc9a (patch) | |
tree | c4cd544c24c8b5e4d37ef3b04744e0d7cfe8a636 | |
parent | 7975afcc7d68efc64a4258d2c593079774fec08f (diff) |
Add additional time unit conversion macros.
Adds macros for converting smaller time units into
bigger ones (ex. ns to s).
-rw-r--r-- | include/litmus.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/litmus.h b/include/litmus.h index 8f5b5a4..b9e6465 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -40,6 +40,13 @@ int sporadic_clustered(lt_t e_ns, lt_t p_ns, int cluster); | |||
40 | #define ms2us(ms) ((ms)*1000LL) | 40 | #define ms2us(ms) ((ms)*1000LL) |
41 | #define us2ns(us) ((us)*1000LL) | 41 | #define us2ns(us) ((us)*1000LL) |
42 | 42 | ||
43 | #define ns2s(ns) ((ns)/1000000000LL) | ||
44 | #define ns2ms(ns) ((ns)/1000000LL) | ||
45 | #define ns2us(ns) ((ns)/1000LL) | ||
46 | #define us2ms(us) ((us)/1000LL) | ||
47 | #define us2s(us) ((us)/1000000LL) | ||
48 | #define ms2s(ms) ((ms)/1000LL) | ||
49 | |||
43 | /* file descriptor attached shared objects support */ | 50 | /* file descriptor attached shared objects support */ |
44 | typedef enum { | 51 | typedef enum { |
45 | FMLP_SEM = 0, | 52 | FMLP_SEM = 0, |
@@ -47,7 +54,7 @@ typedef enum { | |||
47 | MPCP_SEM = 2, | 54 | MPCP_SEM = 2, |
48 | MPCP_VS_SEM = 3, | 55 | MPCP_VS_SEM = 3, |
49 | DPCP_SEM = 4, | 56 | DPCP_SEM = 4, |
50 | PCP_SEM = 5, | 57 | PCP_SEM = 5, |
51 | } obj_type_t; | 58 | } obj_type_t; |
52 | 59 | ||
53 | int lock_protocol_for_name(const char* name); | 60 | int lock_protocol_for_name(const char* name); |