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
2044513
Documentation
LICENSES
arch
alpha
arc
arm
arm64
c6x
csky
abiv1
abiv2
boot
configs
include
kernel
probes
Makefile
asm-offsets.c
atomic.S
cpu-probe.c
entry.S
ftrace.c
head.S
irq.c
module.c
perf_callchain.c
perf_event.c
perf_regs.c
power.c
process.c
ptrace.c
setup.c
signal.c
smp.c
stacktrace.c
syscall.c
syscall_table.c
time.c
traps.c
vdso.c
vmlinux.lds.S
lib
mm
Kconfig
Kconfig.debug
Kconfig.platforms
Makefile
h8300
hexagon
ia64
m68k
microblaze
mips
nds32
nios2
openrisc
parisc
powerpc
riscv
s390
sh
sparc
um
x86
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
arch
/
csky
/
kernel
/
process.c
Copy path
Blame
Blame
Latest commit
History
History
107 lines (87 loc) · 2.35 KB
Breadcrumbs
linux
/
arch
/
csky
/
kernel
/
process.c
Top
File metadata and controls
Code
Blame
107 lines (87 loc) · 2.35 KB
Raw
// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. #include <linux/module.h> #include <linux/version.h> #include <linux/sched.h> #include <linux/sched/task_stack.h> #include <linux/sched/debug.h> #include <linux/delay.h> #include <linux/kallsyms.h> #include <linux/uaccess.h> #include <linux/ptrace.h> #include <asm/elf.h> #include <abi/reg_ops.h> struct cpuinfo_csky cpu_data[NR_CPUS]; #ifdef CONFIG_STACKPROTECTOR #include <linux/stackprotector.h> unsigned long __stack_chk_guard __read_mostly; EXPORT_SYMBOL(__stack_chk_guard); #endif asmlinkage void ret_from_fork(void); asmlinkage void ret_from_kernel_thread(void); /* * Some archs flush debug and FPU info here */ void flush_thread(void){} int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long kthread_arg, struct task_struct *p, unsigned long tls) { struct switch_stack *childstack; struct pt_regs *childregs = task_pt_regs(p); #ifdef CONFIG_CPU_HAS_FPU save_to_user_fp(&p->thread.user_fp); #endif childstack = ((struct switch_stack *) childregs) - 1; memset(childstack, 0, sizeof(struct switch_stack)); /* setup thread.sp for switch_to !!! */ p->thread.sp = (unsigned long)childstack; if (unlikely(p->flags & PF_KTHREAD)) { memset(childregs, 0, sizeof(struct pt_regs)); childstack->r15 = (unsigned long) ret_from_kernel_thread; childstack->r10 = kthread_arg; childstack->r9 = usp; childregs->sr = mfcr("psr"); } else { *childregs = *(current_pt_regs()); if (usp) childregs->usp = usp; if (clone_flags & CLONE_SETTLS) task_thread_info(p)->tp_value = childregs->tls = tls; childregs->a0 = 0; childstack->r15 = (unsigned long) ret_from_fork; } return 0; } /* Fill in the fpu structure for a core dump. */ int dump_fpu(struct pt_regs *regs, struct user_fp *fpu) { memcpy(fpu, ¤t->thread.user_fp, sizeof(*fpu)); return 1; } EXPORT_SYMBOL(dump_fpu); int dump_task_regs(struct task_struct *tsk, elf_gregset_t *pr_regs) { struct pt_regs *regs = task_pt_regs(tsk); /* NOTE: usp is error value. */ ELF_CORE_COPY_REGS((*pr_regs), regs) return 1; } #ifndef CONFIG_CPU_PM_NONE void arch_cpu_idle(void) { #ifdef CONFIG_CPU_PM_WAIT asm volatile("wait\n"); #endif #ifdef CONFIG_CPU_PM_DOZE asm volatile("doze\n"); #endif #ifdef CONFIG_CPU_PM_STOP asm volatile("stop\n"); #endif local_irq_enable(); } #endif
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
You can’t perform that action at this time.