Merge tag 'locking-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / c6x / include / asm / processor.h
blob1456f5e11de33e7dfad2a784799bf199e2055c21
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Port on Texas Instruments TMS320C6x architecture
5 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
6 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
8 * Updated for 2.6.34: Mark Salter <msalter@redhat.com>
9 */
10 #ifndef _ASM_C6X_PROCESSOR_H
11 #define _ASM_C6X_PROCESSOR_H
13 #include <asm/ptrace.h>
14 #include <asm/page.h>
15 #include <asm/current.h>
18 * User space process size. This is mostly meaningless for NOMMU
19 * but some C6X processors may have RAM addresses up to 0xFFFFFFFF.
20 * Since calls like mmap() can return an address or an error, we
21 * have to allow room for error returns when code does something
22 * like:
24 * addr = do_mmap(...)
25 * if ((unsigned long)addr >= TASK_SIZE)
26 * ... its an error code, not an address ...
28 * Here, we allow for 4096 error codes which means we really can't
29 * use the last 4K page on systems with RAM extending all the way
30 * to the end of the 32-bit address space.
32 #define TASK_SIZE 0xFFFFF000
35 * This decides where the kernel will search for a free chunk of vm
36 * space during mmap's. We won't be using it
38 #define TASK_UNMAPPED_BASE 0
40 struct thread_struct {
41 unsigned long long b15_14;
42 unsigned long long a15_14;
43 unsigned long long b13_12;
44 unsigned long long a13_12;
45 unsigned long long b11_10;
46 unsigned long long a11_10;
47 unsigned long long ricl_icl;
48 unsigned long usp; /* user stack pointer */
49 unsigned long pc; /* kernel pc */
50 unsigned long wchan;
53 #define INIT_THREAD \
54 { \
55 .usp = 0, \
56 .wchan = 0, \
59 #define INIT_MMAP { \
60 &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, \
61 NULL, NULL }
63 #define task_pt_regs(task) \
64 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(task)) - 1)
66 #define alloc_kernel_stack() __get_free_page(GFP_KERNEL)
67 #define free_kernel_stack(page) free_page((page))
70 /* Forward declaration, a strange C thing */
71 struct task_struct;
73 extern void start_thread(struct pt_regs *regs, unsigned int pc,
74 unsigned long usp);
76 /* Free all resources held by a thread. */
77 static inline void release_thread(struct task_struct *dead_task)
82 * saved kernel SP and DP of a blocked thread.
84 #ifdef _BIG_ENDIAN
85 #define thread_saved_ksp(tsk) \
86 (*(unsigned long *)&(tsk)->thread.b15_14)
87 #define thread_saved_dp(tsk) \
88 (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
89 #else
90 #define thread_saved_ksp(tsk) \
91 (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
92 #define thread_saved_dp(tsk) \
93 (*(unsigned long *)&(tsk)->thread.b15_14)
94 #endif
96 extern unsigned long get_wchan(struct task_struct *p);
98 #define KSTK_EIP(task) (task_pt_regs(task)->pc)
99 #define KSTK_ESP(task) (task_pt_regs(task)->sp)
101 #define cpu_relax() do { } while (0)
103 extern const struct seq_operations cpuinfo_op;
105 /* Reset the board */
106 #define HARD_RESET_NOW()
108 extern unsigned int c6x_core_freq;
111 extern void (*c6x_restart)(void);
112 extern void (*c6x_halt)(void);
114 #endif /* ASM_C6X_PROCESSOR_H */