From: Andrei Tatar Date: Mon, 2 Oct 2023 19:02:41 +0000 (+0200) Subject: include/: Add static initializer for refcounts X-Git-Tag: RELEASE-0.16.0~195 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=788cc579547bcf005f96f04e58d8a12130d70747;p=unikraft%2Funikraft.git include/: Add static initializer for refcounts Checkpatch-Ignore: SPACING Signed-off-by: Andrei Tatar Reviewed-by: Simon Kuenzer Approved-by: Simon Kuenzer GitHub-Closes: #1126 --- diff --git a/include/uk/refcount.h b/include/uk/refcount.h index 24a8f41c1..60ea4b7c8 100644 --- a/include/uk/refcount.h +++ b/include/uk/refcount.h @@ -56,6 +56,8 @@ extern "C" { } while (0) #endif /* CONFIG_LIBUKDEBUG */ +#define UK_REFCOUNT_INITIALIZER(val) ((__atomic){ .counter = (val) }) + /** * Initialize the atomic reference. *