summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
commit08b74a000942a380fe028845f92cd3a0dee827d5 (patch)
treeaa78b4e12607c3e1fcce8d5cc42df4330792f118 /debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch
parentAdding upstream version 4.19.249. (diff)
downloadlinux-08b74a000942a380fe028845f92cd3a0dee827d5.tar.xz
linux-08b74a000942a380fe028845f92cd3a0dee827d5.zip
Adding debian version 4.19.249-2.debian/4.19.249-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch')
-rw-r--r--debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch b/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch
new file mode 100644
index 000000000..d3d7ffdeb
--- /dev/null
+++ b/debian/patches-rt/0062-locallock-provide-get-put-_locked_ptr-variants.patch
@@ -0,0 +1,49 @@
+From 5b024e1bb773440c6f4c48fdb21090bfadab8a7a Mon Sep 17 00:00:00 2001
+From: Julia Cartwright <julia@ni.com>
+Date: Mon, 7 May 2018 08:58:56 -0500
+Subject: [PATCH 062/347] locallock: provide {get,put}_locked_ptr() variants
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.246-rt110.tar.xz
+
+Provide a set of locallocked accessors for pointers to per-CPU data;
+this is useful for dynamically-allocated per-CPU regions, for example.
+
+These are symmetric with the {get,put}_cpu_ptr() per-CPU accessor
+variants.
+
+Signed-off-by: Julia Cartwright <julia@ni.com>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ include/linux/locallock.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/include/linux/locallock.h b/include/linux/locallock.h
+index d658c2552601..921eab83cd34 100644
+--- a/include/linux/locallock.h
++++ b/include/linux/locallock.h
+@@ -222,6 +222,14 @@ static inline int __local_unlock_irqrestore(struct local_irq_lock *lv,
+
+ #define put_locked_var(lvar, var) local_unlock(lvar);
+
++#define get_locked_ptr(lvar, var) \
++ ({ \
++ local_lock(lvar); \
++ this_cpu_ptr(var); \
++ })
++
++#define put_locked_ptr(lvar, var) local_unlock(lvar);
++
+ #define local_lock_cpu(lvar) \
+ ({ \
+ local_lock(lvar); \
+@@ -262,6 +270,8 @@ static inline void local_irq_lock_init(int lvar) { }
+
+ #define get_locked_var(lvar, var) get_cpu_var(var)
+ #define put_locked_var(lvar, var) put_cpu_var(var)
++#define get_locked_ptr(lvar, var) get_cpu_ptr(var)
++#define put_locked_ptr(lvar, var) put_cpu_ptr(var)
+
+ #define local_lock_cpu(lvar) get_cpu()
+ #define local_unlock_cpu(lvar) put_cpu()
+--
+2.36.1
+