diff options
author | Patrick Mooney <pmooney@pfmooney.com> | 2020-11-01 17:02:56 +0000 |
---|---|---|
committer | Patrick Mooney <pmooney@oxide.computer> | 2020-12-01 03:48:02 +0000 |
commit | 2699b94cd4d1e9baf6bfcbe579328b398a9736e6 (patch) | |
tree | 44007aa55b584ad0342a4b148c500b11e9cc9dd8 /usr/src/compat/bhyve | |
parent | 4d2aba2f17eed4643aa996841698226ff2673205 (diff) | |
download | illumos-joyent-2699b94cd4d1e9baf6bfcbe579328b398a9736e6.tar.gz |
13050 bhyve kernel should be cstyle clean
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/compat/bhyve')
-rw-r--r-- | usr/src/compat/bhyve/sys/time.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/usr/src/compat/bhyve/sys/time.h b/usr/src/compat/bhyve/sys/time.h index 4e0fbfc02c..48bdcc304e 100644 --- a/usr/src/compat/bhyve/sys/time.h +++ b/usr/src/compat/bhyve/sys/time.h @@ -11,6 +11,7 @@ /* * Copyright 2013 Pluribus Networks Inc. + * Copyright 2020 Oxide Computer Company */ #ifndef _COMPAT_FREEBSD_SYS_TIME_H_ @@ -50,6 +51,17 @@ binuptime(struct bintime *bt) ((a)->frac cmp (b)->frac) : \ ((a)->sec cmp (b)->sec)) +/* + * The bintime_cmp() macro is problematic for a couple reasons: + * 1. Bearing a lowercase name suggests it is a function rather than a macro. + * 2. Placing the comparison operator as the last argument runs afoul of our + * cstyle rules, unlike cases such as VERIFY3*(). + * + * To remedy these issues in illumos bhyve, we provide a slightly modified + * version which addresses both problems. + */ +#define BINTIME_CMP(a, cmp, b) bintime_cmp((a), (b), cmp) + #define SBT_1S ((sbintime_t)1 << 32) #define SBT_1M (SBT_1S * 60) #define SBT_1MS (SBT_1S / 1000) |