Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
3fb5007
Documentation
arch
alpha
arc
arm
arm64
avr32
blackfin
c6x
boot
configs
include
asm
Kbuild
asm-offsets.h
bitops.h
bug.h
cache.h
cacheflush.h
checksum.h
clock.h
cmpxchg.h
delay.h
dma-mapping.h
dscr.h
elf.h
flat.h
ftrace.h
hardirq.h
irq.h
irqflags.h
linkage.h
megamod-pic.h
module.h
page.h
pgtable.h
processor.h
procinfo.h
ptrace.h
sections.h
setup.h
soc.h
special_insns.h
string.h
switch_to.h
syscall.h
syscalls.h
thread_info.h
timer64.h
timex.h
tlb.h
traps.h
uaccess.h
unaligned.h
uapi
kernel
lib
mm
platforms
Kconfig
Makefile
cris
frv
h8300
hexagon
ia64
m32r
m68k
metag
microblaze
mips
mn10300
nios2
openrisc
parisc
powerpc
s390
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
arch
/
c6x
/
include
/
asm
/
uaccess.h
Copy path
Blame
Blame
Latest commit
History
History
104 lines (93 loc) · 2.21 KB
Breadcrumbs
linux
/
arch
/
c6x
/
include
/
asm
/
uaccess.h
Top
File metadata and controls
Code
Blame
104 lines (93 loc) · 2.21 KB
Raw
/* * Copyright (C) 2011 Texas Instruments Incorporated * Author: Mark Salter <msalter@redhat.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _ASM_C6X_UACCESS_H #define _ASM_C6X_UACCESS_H #include <linux/types.h> #include <linux/compiler.h> #include <linux/string.h> #ifdef CONFIG_ACCESS_CHECK #define __access_ok _access_ok #endif /* * __copy_from_user/copy_to_user are based on ones in asm-generic/uaccess.h * * C6X supports unaligned 32 and 64 bit loads and stores. */ static inline __must_check long __copy_from_user(void *to, const void __user *from, unsigned long n) { u32 tmp32; u64 tmp64; if (__builtin_constant_p(n)) { switch (n) { case 1: *(u8 *)to = *(u8 __force *)from; return 0; case 4: asm volatile ("ldnw .d1t1 *%2,%0\n" "nop 4\n" "stnw .d1t1 %0,*%1\n" : "=&a"(tmp32) : "A"(to), "a"(from) : "memory"); return 0; case 8: asm volatile ("ldndw .d1t1 *%2,%0\n" "nop 4\n" "stndw .d1t1 %0,*%1\n" : "=&a"(tmp64) : "a"(to), "a"(from) : "memory"); return 0; default: break; } } memcpy(to, (const void __force *)from, n); return 0; } static inline __must_check long __copy_to_user(void __user *to, const void *from, unsigned long n) { u32 tmp32; u64 tmp64; if (__builtin_constant_p(n)) { switch (n) { case 1: *(u8 __force *)to = *(u8 *)from; return 0; case 4: asm volatile ("ldnw .d1t1 *%2,%0\n" "nop 4\n" "stnw .d1t1 %0,*%1\n" : "=&a"(tmp32) : "a"(to), "a"(from) : "memory"); return 0; case 8: asm volatile ("ldndw .d1t1 *%2,%0\n" "nop 4\n" "stndw .d1t1 %0,*%1\n" : "=&a"(tmp64) : "a"(to), "a"(from) : "memory"); return 0; default: break; } } memcpy((void __force *)to, from, n); return 0; } extern int _access_ok(unsigned long addr, unsigned long size); #ifdef CONFIG_ACCESS_CHECK #define __access_ok _access_ok #endif #include <asm-generic/uaccess.h> #endif /* _ASM_C6X_UACCESS_H */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
You can’t perform that action at this time.