aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/include/asm/uaccess.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-01-11 15:42:45 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-01-11 15:42:45 -0800
commitc1eb8f6cff3442b0b7eff5b801c9745ea9abcb14 (patch)
treeb825aebc64cf6fa58b6edbfefdc5a0c670b61b82 /arch/parisc/include/asm/uaccess.h
parentMerge tag 'x86_build_for_v5.17_rc1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
parentparisc: Default to 16 CPUs on 32-bit kernel (diff)
downloadlinux-dev-c1eb8f6cff3442b0b7eff5b801c9745ea9abcb14.tar.xz
linux-dev-c1eb8f6cff3442b0b7eff5b801c9745ea9abcb14.zip
Merge tag 'for-5.17/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture updates from Helge Deller: - Fix lpa and lpa_user defines (John David Anglin) - Fix symbol lookup of init functions with an __is_kernel() fix (Helge Deller) - Fix wrong pdc_toc_pim_11 and pdc_toc_pim_20 definitions (Helge Deller) - Add lws_atomic_xchg and lws_atomic_store syscalls (John David Anglin) - Rewrite light-weight syscall and futex code (John David Anglin) - Enable TOC (transfer of contents) feature unconditionally (Helge Deller) - Improve fault handler messages (John David Anglin) - Improve build process (Masahiro Yamada) - Reduce kernel code footprint of user access functions (Helge Deller) - Fix build error due to outX() macros (Bart Van Assche) - Ue default_groups in kobj_type in pdc_stable (Greg Kroah-Hartman) - Default to 16 CPUs on 32-bit kernel (Helge Deller) * tag 'for-5.17/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Default to 16 CPUs on 32-bit kernel sections: Fix __is_kernel() to include init ranges parisc: Re-use toc_stack as hpmc_stack parisc: Enable TOC (transfer of contents) feature unconditionally parisc: io: Improve the outb(), outw() and outl() macros parisc: pdc_stable: use default_groups in kobj_type parisc: Add kgdb io_module to read chars via PDC parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 definitions parisc: Add lws_atomic_xchg and lws_atomic_store syscalls parisc: Rewrite light-weight syscall and futex code parisc: Enhance page fault termination message parisc: Don't call faulthandler_disabled() in do_page_fault() parisc: Switch user access functions to signal errors in r29 instead of r8 parisc: Avoid calling faulthandler_disabled() twice parisc: Fix lpa and lpa_user defines parisc: Define depi_safe macro parisc: decompressor: do not copy source files while building
Diffstat (limited to 'arch/parisc/include/asm/uaccess.h')
-rw-r--r--arch/parisc/include/asm/uaccess.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 192ad9e11b25..ebf8a845b017 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -53,15 +53,18 @@ struct exception_table_entry {
/*
* ASM_EXCEPTIONTABLE_ENTRY_EFAULT() creates a special exception table entry
* (with lowest bit set) for which the fault handler in fixup_exception() will
- * load -EFAULT into %r8 for a read or write fault, and zeroes the target
+ * load -EFAULT into %r29 for a read or write fault, and zeroes the target
* register in case of a read fault in get_user().
*/
+#define ASM_EXCEPTIONTABLE_REG 29
+#define ASM_EXCEPTIONTABLE_VAR(__variable) \
+ register long __variable __asm__ ("r29") = 0
#define ASM_EXCEPTIONTABLE_ENTRY_EFAULT( fault_addr, except_addr )\
ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr + 1)
#define __get_user_internal(sr, val, ptr) \
({ \
- register long __gu_err __asm__ ("r8") = 0; \
+ ASM_EXCEPTIONTABLE_VAR(__gu_err); \
\
switch (sizeof(*(ptr))) { \
case 1: __get_user_asm(sr, val, "ldb", ptr); break; \
@@ -131,7 +134,7 @@ struct exception_table_entry {
#define __put_user_internal(sr, x, ptr) \
({ \
- register long __pu_err __asm__ ("r8") = 0; \
+ ASM_EXCEPTIONTABLE_VAR(__pu_err); \
__typeof__(*(ptr)) __x = (__typeof__(*(ptr)))(x); \
\
switch (sizeof(*(ptr))) { \
@@ -168,7 +171,8 @@ struct exception_table_entry {
* gcc knows about, so there are no aliasing issues. These macros must
* also be aware that fixups are executed in the context of the fault,
* and any registers used there must be listed as clobbers.
- * r8 is already listed as err.
+ * The register holding the possible EFAULT error (ASM_EXCEPTIONTABLE_REG)
+ * is already listed as input and output register.
*/
#define __put_user_asm(sr, stx, x, ptr) \