aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rust/helpers.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2023-05-01 15:20:08 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2023-05-01 15:20:08 -0700
commit9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e (patch)
treed57f3a63479a07b4e0cece029886e76e04feb984 /rust/helpers.c
parentInput: cyttsp5 - fix sensing configuration data structure (diff)
parentRevert "Input: xpad - fix support for some third-party controllers" (diff)
downloadwireguard-linux-9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e.tar.xz
wireguard-linux-9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e.zip
Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
Diffstat (limited to 'rust/helpers.c')
-rw-r--r--rust/helpers.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/rust/helpers.c b/rust/helpers.c
index b4f15eee2ffd..09a4d93f9d62 100644
--- a/rust/helpers.c
+++ b/rust/helpers.c
@@ -20,6 +20,7 @@
#include <linux/bug.h>
#include <linux/build_bug.h>
+#include <linux/refcount.h>
__noreturn void rust_helper_BUG(void)
{
@@ -27,6 +28,24 @@ __noreturn void rust_helper_BUG(void)
}
EXPORT_SYMBOL_GPL(rust_helper_BUG);
+refcount_t rust_helper_REFCOUNT_INIT(int n)
+{
+ return (refcount_t)REFCOUNT_INIT(n);
+}
+EXPORT_SYMBOL_GPL(rust_helper_REFCOUNT_INIT);
+
+void rust_helper_refcount_inc(refcount_t *r)
+{
+ refcount_inc(r);
+}
+EXPORT_SYMBOL_GPL(rust_helper_refcount_inc);
+
+bool rust_helper_refcount_dec_and_test(refcount_t *r)
+{
+ return refcount_dec_and_test(r);
+}
+EXPORT_SYMBOL_GPL(rust_helper_refcount_dec_and_test);
+
/*
* We use `bindgen`'s `--size_t-is-usize` option to bind the C `size_t` type
* as the Rust `usize` type, so we can use it in contexts where Rust