From a8a7723ba9d76bd97dd9ef882c772644bd241d3b Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 26 Oct 2021 11:07:39 +0200 Subject: sd-boot: Move flags helpers to macro-fundamental.h --- src/fundamental/macro-fundamental.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/fundamental/macro-fundamental.h') diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index ed527adb77..44af0bd0a0 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -306,3 +306,10 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) { (l <= SIZE_MAX - (ali - 1)), /* overflow? */ \ ((l) + (ali) - 1) & ~((ali) - 1), \ VOID_0) + +#define UPDATE_FLAG(orig, flag, b) \ + ((b) ? ((orig) | (flag)) : ((orig) & ~(flag))) +#define SET_FLAG(v, flag, b) \ + (v) = UPDATE_FLAG(v, flag, b) +#define FLAGS_SET(v, flags) \ + ((~(v) & (flags)) == 0) -- cgit v1.2.3