arch/parisc/include/asm/uaccess.h
Source file repositories/reference/linux-study-clean/arch/parisc/include/asm/uaccess.h
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/include/asm/uaccess.h- Extension
.h- Size
- 5376 bytes
- Lines
- 203
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
Dependency Surface
asm/page.hasm/cache.hasm/extable.hlinux/bug.hlinux/string.hasm/pgtable.hasm-generic/access_ok.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#ifndef __PARISC_UACCESS_H
#define __PARISC_UACCESS_H
/*
* User space memory access functions
*/
#include <asm/page.h>
#include <asm/cache.h>
#include <asm/extable.h>
#include <linux/bug.h>
#include <linux/string.h>
#define TASK_SIZE_MAX DEFAULT_TASK_SIZE
#include <asm/pgtable.h>
#include <asm-generic/access_ok.h>
#define put_user __put_user
#define get_user __get_user
#if !defined(CONFIG_64BIT)
#define LDD_USER(sr, val, ptr) __get_user_asm64(sr, val, ptr)
#define STD_USER(sr, x, ptr) __put_user_asm64(sr, x, ptr)
#else
#define LDD_USER(sr, val, ptr) __get_user_asm(sr, val, "ldd", ptr)
#define STD_USER(sr, x, ptr) __put_user_asm(sr, "std", x, ptr)
#endif
#define __get_user_internal(sr, val, ptr) \
({ \
ASM_EXCEPTIONTABLE_VAR(__gu_err); \
\
switch (sizeof(*(ptr))) { \
case 1: __get_user_asm(sr, val, "ldb", ptr); break; \
case 2: __get_user_asm(sr, val, "ldh", ptr); break; \
case 4: __get_user_asm(sr, val, "ldw", ptr); break; \
case 8: LDD_USER(sr, val, ptr); break; \
default: BUILD_BUG(); \
} \
\
__gu_err; \
})
#define __probe_user_internal(sr, error, ptr) \
({ \
__asm__("\tproberi (%%sr%1,%2),%3,%0\n" \
"\tcmpiclr,= 1,%0,%0\n" \
"\tldi %4,%0\n" \
: "=r"(error) \
: "i"(sr), "r"(ptr), "i"(PRIV_USER), \
"i"(-EFAULT)); \
})
#define __get_user(val, ptr) \
({ \
register long __gu_err; \
\
__gu_err = __get_user_internal(SR_USER, val, ptr); \
if (likely(!__gu_err)) \
__probe_user_internal(SR_USER, __gu_err, ptr); \
__gu_err; \
})
#define __get_user_asm(sr, val, ldx, ptr) \
{ \
register long __gu_val; \
\
__asm__("1: " ldx " 0(%%sr%2,%3),%0\n" \
"9:\n" \
ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%1") \
: "=r"(__gu_val), "+r"(__gu_err) \
: "i"(sr), "r"(ptr)); \
\
(val) = (__force __typeof__(*(ptr))) __gu_val; \
}
#define __get_kernel_nofault(dst, src, type, err_label) \
{ \
type __z; \
long __err; \
__err = __get_user_internal(SR_KERNEL, __z, (type *)(src)); \
if (unlikely(__err)) \
goto err_label; \
else \
*(type *)(dst) = __z; \
}
#if !defined(CONFIG_64BIT)
Annotation
- Immediate include surface: `asm/page.h`, `asm/cache.h`, `asm/extable.h`, `linux/bug.h`, `linux/string.h`, `asm/pgtable.h`, `asm-generic/access_ok.h`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.