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
1
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
b240add
Documentation
arch
alpha
arm
arm64
boot
configs
include
asm
Kbuild
arm_generic.h
asm-offsets.h
assembler.h
atomic.h
barrier.h
bitops.h
cache.h
cacheflush.h
cachetype.h
cmpxchg.h
compat.h
compiler.h
cputable.h
cputype.h
debug-monitors.h
device.h
dma-mapping.h
elf.h
exception.h
exec.h
fb.h
fpsimd.h
futex.h
hardirq.h
hw_breakpoint.h
hwcap.h
io.h
irq.h
irqflags.h
linkage.h
memblock.h
memory.h
mmu.h
mmu_context.h
module.h
page.h
perf_event.h
pgalloc.h
pgtable-2level-hwdef.h
pgtable-2level-types.h
pgtable-3level-hwdef.h
pgtable-3level-types.h
pgtable-hwdef.h
pgtable.h
pmu.h
proc-fns.h
processor.h
prom.h
ptrace.h
shmparam.h
sigcontext.h
signal32.h
smp.h
sparsemem.h
spinlock.h
spinlock_types.h
stacktrace.h
stat.h
syscall.h
syscalls.h
system_misc.h
thread_info.h
timex.h
tlb.h
tlbflush.h
traps.h
uaccess.h
ucontext.h
unistd.h
unistd32.h
vdso.h
vdso_datapage.h
uapi
kernel
lib
mm
Kconfig
Kconfig.debug
Makefile
avr32
blackfin
c6x
cris
frv
h8300
hexagon
ia64
m32r
m68k
microblaze
mips
mn10300
openrisc
parisc
powerpc
s390
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arm64
/
include
/
asm
/
processor.h
Copy path
Blame
Blame
Latest commit
History
History
167 lines (139 loc) · 4.07 KB
Breadcrumbs
linux
/
arch
/
arm64
/
include
/
asm
/
processor.h
Top
File metadata and controls
Code
Blame
167 lines (139 loc) · 4.07 KB
Raw
/* * Based on arch/arm/include/asm/processor.h * * Copyright (C) 1995-1999 Russell King * Copyright (C) 2012 ARM Ltd. * * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __ASM_PROCESSOR_H #define __ASM_PROCESSOR_H /* * Default implementation of macro that returns current * instruction pointer ("program counter"). */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) #ifdef __KERNEL__ #include <linux/string.h> #include <asm/fpsimd.h> #include <asm/hw_breakpoint.h> #include <asm/ptrace.h> #include <asm/types.h> #ifdef __KERNEL__ #define STACK_TOP_MAX TASK_SIZE_64 #ifdef CONFIG_COMPAT #define AARCH32_VECTORS_BASE 0xffff0000 #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ AARCH32_VECTORS_BASE : STACK_TOP_MAX) #else #define STACK_TOP STACK_TOP_MAX #endif /* CONFIG_COMPAT */ #define ARCH_LOW_ADDRESS_LIMIT PHYS_MASK #endif /* __KERNEL__ */ struct debug_info { /* Have we suspended stepping by a debugger? */ int suspended_step; /* Allow breakpoints and watchpoints to be disabled for this thread. */ int bps_disabled; int wps_disabled; /* Hardware breakpoints pinned to this task. */ struct perf_event *hbp_break[ARM_MAX_BRP]; struct perf_event *hbp_watch[ARM_MAX_WRP]; }; struct cpu_context { unsigned long x19; unsigned long x20; unsigned long x21; unsigned long x22; unsigned long x23; unsigned long x24; unsigned long x25; unsigned long x26; unsigned long x27; unsigned long x28; unsigned long fp; unsigned long sp; unsigned long pc; }; struct thread_struct { struct cpu_context cpu_context; /* cpu context */ unsigned long tp_value; struct fpsimd_state fpsimd_state; unsigned long fault_address; /* fault info */ struct debug_info debug; /* debugging */ }; #define INIT_THREAD { } static inline void start_thread_common(struct pt_regs *regs, unsigned long pc) { memset(regs, 0, sizeof(*regs)); regs->syscallno = ~0UL; regs->pc = pc; } static inline void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) { start_thread_common(regs, pc); regs->pstate = PSR_MODE_EL0t; regs->sp = sp; } #ifdef CONFIG_COMPAT static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp) { start_thread_common(regs, pc); regs->pstate = COMPAT_PSR_MODE_USR; if (pc & 1) regs->pstate |= COMPAT_PSR_T_BIT; regs->compat_sp = sp; } #endif /* Forward declaration, a strange C thing */ struct task_struct; /* Free all resources held by a thread. */ extern void release_thread(struct task_struct *); /* Prepare to copy thread state - unlazy all lazy status */ #define prepare_to_copy(tsk) do { } while (0) unsigned long get_wchan(struct task_struct *p); #define cpu_relax() barrier() /* Thread switching */ extern struct task_struct *cpu_switch_to(struct task_struct *prev, struct task_struct *next); /* * Create a new kernel thread */ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); #define task_pt_regs(p) \ ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) #define KSTK_EIP(tsk) task_pt_regs(tsk)->pc #define KSTK_ESP(tsk) task_pt_regs(tsk)->sp /* * Prefetching support */ #define ARCH_HAS_PREFETCH static inline void prefetch(const void *ptr) { asm volatile("prfm pldl1keep, %a0\n" : : "p" (ptr)); } #define ARCH_HAS_PREFETCHW static inline void prefetchw(const void *ptr) { asm volatile("prfm pstl1keep, %a0\n" : : "p" (ptr)); } #define ARCH_HAS_SPINLOCK_PREFETCH static inline void spin_lock_prefetch(const void *x) { prefetchw(x); } #define HAVE_ARCH_PICK_MMAP_LAYOUT #endif #endif /* __ASM_PROCESSOR_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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
You can’t perform that action at this time.