arch/microblaze/include/asm/uaccess.h
Source file repositories/reference/linux-study-clean/arch/microblaze/include/asm/uaccess.h
File Facts
- System
- Linux kernel
- Corpus path
arch/microblaze/include/asm/uaccess.h- Extension
.h- Size
- 7093 bytes
- Lines
- 269
- Domain
- Architecture Layer
- Bucket
- arch/microblaze
- 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
linux/kernel.hasm/mmu.hasm/page.hlinux/pgtable.hasm/extable.hlinux/string.hasm-generic/access_ok.h
Detected Declarations
function __clear_userfunction clear_userfunction raw_copy_from_userfunction raw_copy_to_user
Annotated Snippet
switch (size) { \
case 1: \
__put_user_asm("sb", __pu_addr, __pu_val, \
__pu_err); \
break; \
case 2: \
__put_user_asm("sh", __pu_addr, __pu_val, \
__pu_err); \
break; \
case 4: \
__put_user_asm("sw", __pu_addr, __pu_val, \
__pu_err); \
break; \
case 8: \
__put_user_asm_8(__pu_addr, __pu_val, __pu_err);\
break; \
default: \
__pu_err = __user_bad(); \
break; \
} \
} else { \
__pu_err = -EFAULT; \
} \
__pu_err; \
})
#define __put_user(x, ptr) \
({ \
__typeof__(*(ptr)) volatile __gu_val = (x); \
long __gu_err = 0; \
switch (sizeof(__gu_val)) { \
case 1: \
__put_user_asm("sb", (ptr), __gu_val, __gu_err); \
break; \
case 2: \
__put_user_asm("sh", (ptr), __gu_val, __gu_err); \
break; \
case 4: \
__put_user_asm("sw", (ptr), __gu_val, __gu_err); \
break; \
case 8: \
__put_user_asm_8((ptr), __gu_val, __gu_err); \
break; \
default: \
/*__gu_err = -EINVAL;*/ __gu_err = __user_bad(); \
} \
__gu_err; \
})
static inline unsigned long
raw_copy_from_user(void *to, const void __user *from, unsigned long n)
{
return __copy_tofrom_user((__force void __user *)to, from, n);
}
static inline unsigned long
raw_copy_to_user(void __user *to, const void *from, unsigned long n)
{
return __copy_tofrom_user(to, (__force const void __user *)from, n);
}
#define INLINE_COPY_USER
/*
* Copy a null terminated string from userspace.
*/
__must_check long strncpy_from_user(char *dst, const char __user *src,
long count);
/*
* Return the size of a string (including the ending 0)
*
* Return 0 on exception, a value greater than N if too long
*/
__must_check long strnlen_user(const char __user *sstr, long len);
#endif /* _ASM_MICROBLAZE_UACCESS_H */
Annotation
- Immediate include surface: `linux/kernel.h`, `asm/mmu.h`, `asm/page.h`, `linux/pgtable.h`, `asm/extable.h`, `linux/string.h`, `asm-generic/access_ok.h`.
- Detected declarations: `function __clear_user`, `function clear_user`, `function raw_copy_from_user`, `function raw_copy_to_user`.
- Atlas domain: Architecture Layer / arch/microblaze.
- 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.