diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-08 14:41:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-08 14:41:08 -0400 |
commit | ce45327ca044415a5832dacfb76cdcfb747e3240 (patch) | |
tree | 4117c57fae7de8e0af6edbd35c0f2ad3d90e5367 /arch/csky/include | |
parent | e7a1414f9dc3498c4c35b9ca266d539e8bccab53 (diff) | |
parent | a691f3334d58b833e41d56de1b9820e687edcd78 (diff) |
Merge tag 'csky-for-linus-5.2-rc1' of git://github.com/c-sky/csky-linux
Pull arch/csky updates from Guo Ren:
- Fixup vdsp&fpu issues in kernel
- Add dynamic function tracer
- Use in_syscall & forget_syscall instead of r11_sig
- Reconstruct signal processing
- Support dynamic start physical address
- Fixup wrong update_mmu_cache implementation
- Support vmlinux bootup with MMU off
- Use va_pa_offset instead of phys_offset
- Fixup syscall_trace return processing flow
- Add perf callchain support
- Add perf_arch_fetch_caller_regs support
- Add page fault perf event support
- Add support for perf registers sampling
* tag 'csky-for-linus-5.2-rc1' of git://github.com/c-sky/csky-linux:
csky/syscall_trace: Fixup return processing flow
csky: Fixup compile warning
csky: Add support for perf registers sampling
csky: add page fault perf event support
csky: Use va_pa_offset instead of phys_offset
csky: Support vmlinux bootup with MMU off
csky: Add perf_arch_fetch_caller_regs support
csky: Fixup wrong update_mmu_cache implementation
csky: Support dynamic start physical address
csky: Reconstruct signal processing
csky: Use in_syscall & forget_syscall instead of r11_sig
csky: Add non-uapi asm/ptrace.h namespace
csky: mm/fault.c: Remove duplicate header
csky: remove redundant generic-y
csky: Update syscall_trace_enter/exit implementation
csky: Add perf callchain support
csky/ftrace: Add dynamic function tracer (include graph tracer)
csky: Fixup vdsp&fpu issues in kernel
Diffstat (limited to 'arch/csky/include')
-rw-r--r-- | arch/csky/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/csky/include/asm/ftrace.h | 18 | ||||
-rw-r--r-- | arch/csky/include/asm/mmu_context.h | 17 | ||||
-rw-r--r-- | arch/csky/include/asm/page.h | 39 | ||||
-rw-r--r-- | arch/csky/include/asm/perf_event.h | 8 | ||||
-rw-r--r-- | arch/csky/include/asm/ptrace.h | 41 | ||||
-rw-r--r-- | arch/csky/include/asm/syscall.h | 9 | ||||
-rw-r--r-- | arch/csky/include/asm/thread_info.h | 27 | ||||
-rw-r--r-- | arch/csky/include/asm/unistd.h | 2 | ||||
-rw-r--r-- | arch/csky/include/uapi/asm/perf_regs.h | 51 | ||||
-rw-r--r-- | arch/csky/include/uapi/asm/ptrace.h | 15 |
11 files changed, 158 insertions, 70 deletions
diff --git a/arch/csky/include/asm/Kbuild b/arch/csky/include/asm/Kbuild index 95f4e550db8a..a9b63efef416 100644 --- a/arch/csky/include/asm/Kbuild +++ b/arch/csky/include/asm/Kbuild | |||
@@ -12,7 +12,6 @@ generic-y += dma-mapping.h | |||
12 | generic-y += emergency-restart.h | 12 | generic-y += emergency-restart.h |
13 | generic-y += exec.h | 13 | generic-y += exec.h |
14 | generic-y += fb.h | 14 | generic-y += fb.h |
15 | generic-y += ftrace.h | ||
16 | generic-y += futex.h | 15 | generic-y += futex.h |
17 | generic-y += gpio.h | 16 | generic-y += gpio.h |
18 | generic-y += hardirq.h | 17 | generic-y += hardirq.h |
diff --git a/arch/csky/include/asm/ftrace.h b/arch/csky/include/asm/ftrace.h index 7547c45312a8..ba35d93ecda2 100644 --- a/arch/csky/include/asm/ftrace.h +++ b/arch/csky/include/asm/ftrace.h | |||
@@ -4,10 +4,26 @@ | |||
4 | #ifndef __ASM_CSKY_FTRACE_H | 4 | #ifndef __ASM_CSKY_FTRACE_H |
5 | #define __ASM_CSKY_FTRACE_H | 5 | #define __ASM_CSKY_FTRACE_H |
6 | 6 | ||
7 | #define MCOUNT_INSN_SIZE 4 | 7 | #define MCOUNT_INSN_SIZE 14 |
8 | 8 | ||
9 | #define HAVE_FUNCTION_GRAPH_FP_TEST | 9 | #define HAVE_FUNCTION_GRAPH_FP_TEST |
10 | 10 | ||
11 | #define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR | 11 | #define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR |
12 | 12 | ||
13 | #define MCOUNT_ADDR ((unsigned long)_mcount) | ||
14 | |||
15 | #ifndef __ASSEMBLY__ | ||
16 | |||
17 | extern void _mcount(unsigned long); | ||
18 | |||
19 | extern void ftrace_graph_call(void); | ||
20 | |||
21 | static inline unsigned long ftrace_call_adjust(unsigned long addr) | ||
22 | { | ||
23 | return addr; | ||
24 | } | ||
25 | |||
26 | struct dyn_arch_ftrace { | ||
27 | }; | ||
28 | #endif /* !__ASSEMBLY__ */ | ||
13 | #endif /* __ASM_CSKY_FTRACE_H */ | 29 | #endif /* __ASM_CSKY_FTRACE_H */ |
diff --git a/arch/csky/include/asm/mmu_context.h b/arch/csky/include/asm/mmu_context.h index b2905c0485a7..734db3a122e1 100644 --- a/arch/csky/include/asm/mmu_context.h +++ b/arch/csky/include/asm/mmu_context.h | |||
@@ -14,23 +14,10 @@ | |||
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <abi/ckmmu.h> | 15 | #include <abi/ckmmu.h> |
16 | 16 | ||
17 | static inline void tlbmiss_handler_setup_pgd(unsigned long pgd, bool kernel) | ||
18 | { | ||
19 | pgd -= PAGE_OFFSET; | ||
20 | pgd += PHYS_OFFSET; | ||
21 | pgd |= 1; | ||
22 | setup_pgd(pgd, kernel); | ||
23 | } | ||
24 | |||
25 | #define TLBMISS_HANDLER_SETUP_PGD(pgd) \ | 17 | #define TLBMISS_HANDLER_SETUP_PGD(pgd) \ |
26 | tlbmiss_handler_setup_pgd((unsigned long)pgd, 0) | 18 | setup_pgd(__pa(pgd), false) |
27 | #define TLBMISS_HANDLER_SETUP_PGD_KERNEL(pgd) \ | 19 | #define TLBMISS_HANDLER_SETUP_PGD_KERNEL(pgd) \ |
28 | tlbmiss_handler_setup_pgd((unsigned long)pgd, 1) | 20 | setup_pgd(__pa(pgd), true) |
29 | |||
30 | static inline unsigned long tlb_get_pgd(void) | ||
31 | { | ||
32 | return ((get_pgd() - PHYS_OFFSET) & ~1) + PAGE_OFFSET; | ||
33 | } | ||
34 | 21 | ||
35 | #define cpu_context(cpu, mm) ((mm)->context.asid[cpu]) | 22 | #define cpu_context(cpu, mm) ((mm)->context.asid[cpu]) |
36 | #define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & ASID_MASK) | 23 | #define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & ASID_MASK) |
diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h index 73cf2bd66a13..9738eacefdc7 100644 --- a/arch/csky/include/asm/page.h +++ b/arch/csky/include/asm/page.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/const.h> | 8 | #include <linux/const.h> |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * PAGE_SHIFT determines the page size | 11 | * PAGE_SHIFT determines the page size: 4KB |
12 | */ | 12 | */ |
13 | #define PAGE_SHIFT 12 | 13 | #define PAGE_SHIFT 12 |
14 | #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) | 14 | #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) |
@@ -17,12 +17,18 @@ | |||
17 | #define THREAD_MASK (~(THREAD_SIZE - 1)) | 17 | #define THREAD_MASK (~(THREAD_SIZE - 1)) |
18 | #define THREAD_SHIFT (PAGE_SHIFT + 1) | 18 | #define THREAD_SHIFT (PAGE_SHIFT + 1) |
19 | 19 | ||
20 | |||
20 | /* | 21 | /* |
21 | * NOTE: virtual isn't really correct, actually it should be the offset into the | 22 | * For C-SKY "User-space:Kernel-space" is "2GB:2GB" fixed by hardware and there |
22 | * memory node, but we have no highmem, so that works for now. | 23 | * are two segment registers (MSA0 + MSA1) to mapping 512MB + 512MB physical |
23 | * TODO: implement (fast) pfn<->pgdat_idx conversion functions, this makes lots | 24 | * address region. We use them mapping kernel 1GB direct-map address area and |
24 | * of the shifts unnecessary. | 25 | * for more than 1GB of memory we use highmem. |
25 | */ | 26 | */ |
27 | #define PAGE_OFFSET 0x80000000 | ||
28 | #define SSEG_SIZE 0x20000000 | ||
29 | #define LOWMEM_LIMIT (SSEG_SIZE * 2) | ||
30 | |||
31 | #define PHYS_OFFSET_OFFSET (CONFIG_RAM_BASE & (SSEG_SIZE - 1)) | ||
26 | 32 | ||
27 | #ifndef __ASSEMBLY__ | 33 | #ifndef __ASSEMBLY__ |
28 | 34 | ||
@@ -50,9 +56,6 @@ struct page; | |||
50 | 56 | ||
51 | struct vm_area_struct; | 57 | struct vm_area_struct; |
52 | 58 | ||
53 | /* | ||
54 | * These are used to make use of C type-checking.. | ||
55 | */ | ||
56 | typedef struct { unsigned long pte_low; } pte_t; | 59 | typedef struct { unsigned long pte_low; } pte_t; |
57 | #define pte_val(x) ((x).pte_low) | 60 | #define pte_val(x) ((x).pte_low) |
58 | 61 | ||
@@ -69,18 +72,13 @@ typedef struct page *pgtable_t; | |||
69 | #define __pgd(x) ((pgd_t) { (x) }) | 72 | #define __pgd(x) ((pgd_t) { (x) }) |
70 | #define __pgprot(x) ((pgprot_t) { (x) }) | 73 | #define __pgprot(x) ((pgprot_t) { (x) }) |
71 | 74 | ||
72 | #endif /* !__ASSEMBLY__ */ | 75 | extern unsigned long va_pa_offset; |
73 | 76 | ||
74 | #define PHYS_OFFSET (CONFIG_RAM_BASE & ~(LOWMEM_LIMIT - 1)) | 77 | #define ARCH_PFN_OFFSET PFN_DOWN(va_pa_offset + PHYS_OFFSET_OFFSET) |
75 | #define PHYS_OFFSET_OFFSET (CONFIG_RAM_BASE & (LOWMEM_LIMIT - 1)) | ||
76 | #define ARCH_PFN_OFFSET PFN_DOWN(CONFIG_RAM_BASE) | ||
77 | 78 | ||
78 | #define PAGE_OFFSET 0x80000000 | 79 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + va_pa_offset) |
79 | #define LOWMEM_LIMIT 0x40000000 | 80 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - va_pa_offset)) |
80 | 81 | ||
81 | #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) | ||
82 | #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - \ | ||
83 | PHYS_OFFSET)) | ||
84 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) | 82 | #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) |
85 | 83 | ||
86 | #define MAP_NR(x) PFN_DOWN((unsigned long)(x) - PAGE_OFFSET - \ | 84 | #define MAP_NR(x) PFN_DOWN((unsigned long)(x) - PAGE_OFFSET - \ |
@@ -90,15 +88,10 @@ typedef struct page *pgtable_t; | |||
90 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ | 88 | #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ |
91 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) | 89 | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
92 | 90 | ||
93 | /* | ||
94 | * main RAM and kernel working space are coincident at 0x80000000, but to make | ||
95 | * life more interesting, there's also an uncached virtual shadow at 0xb0000000 | ||
96 | * - these mappings are fixed in the MMU | ||
97 | */ | ||
98 | |||
99 | #define pfn_to_kaddr(x) __va(PFN_PHYS(x)) | 91 | #define pfn_to_kaddr(x) __va(PFN_PHYS(x)) |
100 | 92 | ||
101 | #include <asm-generic/memory_model.h> | 93 | #include <asm-generic/memory_model.h> |
102 | #include <asm-generic/getorder.h> | 94 | #include <asm-generic/getorder.h> |
103 | 95 | ||
96 | #endif /* !__ASSEMBLY__ */ | ||
104 | #endif /* __ASM_CSKY_PAGE_H */ | 97 | #endif /* __ASM_CSKY_PAGE_H */ |
diff --git a/arch/csky/include/asm/perf_event.h b/arch/csky/include/asm/perf_event.h index ea8193122294..572093e11001 100644 --- a/arch/csky/include/asm/perf_event.h +++ b/arch/csky/include/asm/perf_event.h | |||
@@ -4,4 +4,12 @@ | |||
4 | #ifndef __ASM_CSKY_PERF_EVENT_H | 4 | #ifndef __ASM_CSKY_PERF_EVENT_H |
5 | #define __ASM_CSKY_PERF_EVENT_H | 5 | #define __ASM_CSKY_PERF_EVENT_H |
6 | 6 | ||
7 | #include <abi/regdef.h> | ||
8 | |||
9 | #define perf_arch_fetch_caller_regs(regs, __ip) { \ | ||
10 | (regs)->pc = (__ip); \ | ||
11 | regs_fp(regs) = (unsigned long) __builtin_frame_address(0); \ | ||
12 | asm volatile("mov %0, sp\n":"=r"((regs)->usp)); \ | ||
13 | } | ||
14 | |||
7 | #endif /* __ASM_PERF_EVENT_ELF_H */ | 15 | #endif /* __ASM_PERF_EVENT_ELF_H */ |
diff --git a/arch/csky/include/asm/ptrace.h b/arch/csky/include/asm/ptrace.h new file mode 100644 index 000000000000..d0aba7b32417 --- /dev/null +++ b/arch/csky/include/asm/ptrace.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | ||
3 | |||
4 | #ifndef __ASM_CSKY_PTRACE_H | ||
5 | #define __ASM_CSKY_PTRACE_H | ||
6 | |||
7 | #include <uapi/asm/ptrace.h> | ||
8 | #include <asm/traps.h> | ||
9 | #include <linux/types.h> | ||
10 | |||
11 | #ifndef __ASSEMBLY__ | ||
12 | |||
13 | #define PS_S 0x80000000 /* Supervisor Mode */ | ||
14 | |||
15 | #define arch_has_single_step() (1) | ||
16 | #define current_pt_regs() \ | ||
17 | ({ (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1; }) | ||
18 | |||
19 | #define user_stack_pointer(regs) ((regs)->usp) | ||
20 | |||
21 | #define user_mode(regs) (!((regs)->sr & PS_S)) | ||
22 | #define instruction_pointer(regs) ((regs)->pc) | ||
23 | #define profile_pc(regs) instruction_pointer(regs) | ||
24 | |||
25 | static inline bool in_syscall(struct pt_regs const *regs) | ||
26 | { | ||
27 | return ((regs->sr >> 16) & 0xff) == VEC_TRAP0; | ||
28 | } | ||
29 | |||
30 | static inline void forget_syscall(struct pt_regs *regs) | ||
31 | { | ||
32 | regs->sr &= ~(0xff << 16); | ||
33 | } | ||
34 | |||
35 | static inline unsigned long regs_return_value(struct pt_regs *regs) | ||
36 | { | ||
37 | return regs->a0; | ||
38 | } | ||
39 | |||
40 | #endif /* __ASSEMBLY__ */ | ||
41 | #endif /* __ASM_CSKY_PTRACE_H */ | ||
diff --git a/arch/csky/include/asm/syscall.h b/arch/csky/include/asm/syscall.h index bc0d8717d28b..f624fa3bbc22 100644 --- a/arch/csky/include/asm/syscall.h +++ b/arch/csky/include/asm/syscall.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <abi/regdef.h> | 8 | #include <abi/regdef.h> |
9 | #include <uapi/linux/audit.h> | 9 | #include <uapi/linux/audit.h> |
10 | 10 | ||
11 | extern void *sys_call_table[]; | ||
12 | |||
11 | static inline int | 13 | static inline int |
12 | syscall_get_nr(struct task_struct *task, struct pt_regs *regs) | 14 | syscall_get_nr(struct task_struct *task, struct pt_regs *regs) |
13 | { | 15 | { |
@@ -15,6 +17,13 @@ syscall_get_nr(struct task_struct *task, struct pt_regs *regs) | |||
15 | } | 17 | } |
16 | 18 | ||
17 | static inline void | 19 | static inline void |
20 | syscall_set_nr(struct task_struct *task, struct pt_regs *regs, | ||
21 | int sysno) | ||
22 | { | ||
23 | regs_syscallid(regs) = sysno; | ||
24 | } | ||
25 | |||
26 | static inline void | ||
18 | syscall_rollback(struct task_struct *task, struct pt_regs *regs) | 27 | syscall_rollback(struct task_struct *task, struct pt_regs *regs) |
19 | { | 28 | { |
20 | regs->a0 = regs->orig_a0; | 29 | regs->a0 = regs->orig_a0; |
diff --git a/arch/csky/include/asm/thread_info.h b/arch/csky/include/asm/thread_info.h index 0e9d035d712b..0b546a55a8bf 100644 --- a/arch/csky/include/asm/thread_info.h +++ b/arch/csky/include/asm/thread_info.h | |||
@@ -51,29 +51,26 @@ static inline struct thread_info *current_thread_info(void) | |||
51 | 51 | ||
52 | #endif /* !__ASSEMBLY__ */ | 52 | #endif /* !__ASSEMBLY__ */ |
53 | 53 | ||
54 | /* entry.S relies on these definitions! | ||
55 | * bits 0-5 are tested at every exception exit | ||
56 | */ | ||
57 | #define TIF_SIGPENDING 0 /* signal pending */ | 54 | #define TIF_SIGPENDING 0 /* signal pending */ |
58 | #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ | 55 | #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ |
59 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ | 56 | #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ |
60 | #define TIF_SYSCALL_TRACE 5 /* syscall trace active */ | 57 | #define TIF_SYSCALL_TRACE 3 /* syscall trace active */ |
61 | #define TIF_DELAYED_TRACE 14 /* single step a syscall */ | 58 | #define TIF_SYSCALL_TRACEPOINT 4 /* syscall tracepoint instrumentation */ |
59 | #define TIF_SYSCALL_AUDIT 5 /* syscall auditing */ | ||
62 | #define TIF_POLLING_NRFLAG 16 /* poll_idle() is TIF_NEED_RESCHED */ | 60 | #define TIF_POLLING_NRFLAG 16 /* poll_idle() is TIF_NEED_RESCHED */ |
63 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ | 61 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
64 | #define TIF_FREEZE 19 /* thread is freezing for suspend */ | ||
65 | #define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */ | 62 | #define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */ |
66 | #define TIF_SECCOMP 21 /* secure computing */ | 63 | #define TIF_SECCOMP 21 /* secure computing */ |
67 | 64 | ||
68 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 65 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
69 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 66 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
70 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 67 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
71 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 68 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
72 | #define _TIF_DELAYED_TRACE (1 << TIF_DELAYED_TRACE) | 69 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) |
73 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 70 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
71 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | ||
74 | #define _TIF_MEMDIE (1 << TIF_MEMDIE) | 72 | #define _TIF_MEMDIE (1 << TIF_MEMDIE) |
75 | #define _TIF_FREEZE (1 << TIF_FREEZE) | 73 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) |
76 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | 74 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
77 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) | ||
78 | 75 | ||
79 | #endif /* _ASM_CSKY_THREAD_INFO_H */ | 76 | #endif /* _ASM_CSKY_THREAD_INFO_H */ |
diff --git a/arch/csky/include/asm/unistd.h b/arch/csky/include/asm/unistd.h index 284487477a61..da7a18295615 100644 --- a/arch/csky/include/asm/unistd.h +++ b/arch/csky/include/asm/unistd.h | |||
@@ -2,3 +2,5 @@ | |||
2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | 2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. |
3 | 3 | ||
4 | #include <uapi/asm/unistd.h> | 4 | #include <uapi/asm/unistd.h> |
5 | |||
6 | #define NR_syscalls (__NR_syscalls) | ||
diff --git a/arch/csky/include/uapi/asm/perf_regs.h b/arch/csky/include/uapi/asm/perf_regs.h new file mode 100644 index 000000000000..ee323d818592 --- /dev/null +++ b/arch/csky/include/uapi/asm/perf_regs.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | // Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd. | ||
3 | |||
4 | #ifndef _ASM_CSKY_PERF_REGS_H | ||
5 | #define _ASM_CSKY_PERF_REGS_H | ||
6 | |||
7 | /* Index of struct pt_regs */ | ||
8 | enum perf_event_csky_regs { | ||
9 | PERF_REG_CSKY_TLS, | ||
10 | PERF_REG_CSKY_LR, | ||
11 | PERF_REG_CSKY_PC, | ||
12 | PERF_REG_CSKY_SR, | ||
13 | PERF_REG_CSKY_SP, | ||
14 | PERF_REG_CSKY_ORIG_A0, | ||
15 | PERF_REG_CSKY_A0, | ||
16 | PERF_REG_CSKY_A1, | ||
17 | PERF_REG_CSKY_A2, | ||
18 | PERF_REG_CSKY_A3, | ||
19 | PERF_REG_CSKY_REGS0, | ||
20 | PERF_REG_CSKY_REGS1, | ||
21 | PERF_REG_CSKY_REGS2, | ||
22 | PERF_REG_CSKY_REGS3, | ||
23 | PERF_REG_CSKY_REGS4, | ||
24 | PERF_REG_CSKY_REGS5, | ||
25 | PERF_REG_CSKY_REGS6, | ||
26 | PERF_REG_CSKY_REGS7, | ||
27 | PERF_REG_CSKY_REGS8, | ||
28 | PERF_REG_CSKY_REGS9, | ||
29 | #if defined(__CSKYABIV2__) | ||
30 | PERF_REG_CSKY_EXREGS0, | ||
31 | PERF_REG_CSKY_EXREGS1, | ||
32 | PERF_REG_CSKY_EXREGS2, | ||
33 | PERF_REG_CSKY_EXREGS3, | ||
34 | PERF_REG_CSKY_EXREGS4, | ||
35 | PERF_REG_CSKY_EXREGS5, | ||
36 | PERF_REG_CSKY_EXREGS6, | ||
37 | PERF_REG_CSKY_EXREGS7, | ||
38 | PERF_REG_CSKY_EXREGS8, | ||
39 | PERF_REG_CSKY_EXREGS9, | ||
40 | PERF_REG_CSKY_EXREGS10, | ||
41 | PERF_REG_CSKY_EXREGS11, | ||
42 | PERF_REG_CSKY_EXREGS12, | ||
43 | PERF_REG_CSKY_EXREGS13, | ||
44 | PERF_REG_CSKY_EXREGS14, | ||
45 | PERF_REG_CSKY_HI, | ||
46 | PERF_REG_CSKY_LO, | ||
47 | PERF_REG_CSKY_DCSR, | ||
48 | #endif | ||
49 | PERF_REG_CSKY_MAX, | ||
50 | }; | ||
51 | #endif /* _ASM_CSKY_PERF_REGS_H */ | ||
diff --git a/arch/csky/include/uapi/asm/ptrace.h b/arch/csky/include/uapi/asm/ptrace.h index a4eaa8ddf0b1..4e248d5b86ef 100644 --- a/arch/csky/include/uapi/asm/ptrace.h +++ b/arch/csky/include/uapi/asm/ptrace.h | |||
@@ -48,20 +48,5 @@ struct user_fp { | |||
48 | unsigned long reserved; | 48 | unsigned long reserved; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #ifdef __KERNEL__ | ||
52 | |||
53 | #define PS_S 0x80000000 /* Supervisor Mode */ | ||
54 | |||
55 | #define arch_has_single_step() (1) | ||
56 | #define current_pt_regs() \ | ||
57 | ({ (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1; }) | ||
58 | |||
59 | #define user_stack_pointer(regs) ((regs)->usp) | ||
60 | |||
61 | #define user_mode(regs) (!((regs)->sr & PS_S)) | ||
62 | #define instruction_pointer(regs) ((regs)->pc) | ||
63 | #define profile_pc(regs) instruction_pointer(regs) | ||
64 | |||
65 | #endif /* __KERNEL__ */ | ||
66 | #endif /* __ASSEMBLY__ */ | 51 | #endif /* __ASSEMBLY__ */ |
67 | #endif /* _CSKY_PTRACE_H */ | 52 | #endif /* _CSKY_PTRACE_H */ |