2 * Port on Texas Instruments TMS320C6x architecture
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
7 * Updated for 2.6.34: Mark Salter <msalter@redhat.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 #ifndef _ASM_C6X_PROCESSOR_H
14 #define _ASM_C6X_PROCESSOR_H
16 #include <asm/ptrace.h>
18 #include <asm/current.h>
21 * User space process size. This is mostly meaningless for NOMMU
22 * but some C6X processors may have RAM addresses up to 0xFFFFFFFF.
23 * Since calls like mmap() can return an address or an error, we
24 * have to allow room for error returns when code does something
28 * if ((unsigned long)addr >= TASK_SIZE)
29 * ... its an error code, not an address ...
31 * Here, we allow for 4096 error codes which means we really can't
32 * use the last 4K page on systems with RAM extending all the way
33 * to the end of the 32-bit address space.
35 #define TASK_SIZE 0xFFFFF000
38 * This decides where the kernel will search for a free chunk of vm
39 * space during mmap's. We won't be using it
41 #define TASK_UNMAPPED_BASE 0
43 struct thread_struct {
44 unsigned long long b15_14;
45 unsigned long long a15_14;
46 unsigned long long b13_12;
47 unsigned long long a13_12;
48 unsigned long long b11_10;
49 unsigned long long a11_10;
50 unsigned long long ricl_icl;
51 unsigned long usp; /* user stack pointer */
52 unsigned long pc; /* kernel pc */
63 &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, \
66 #define task_pt_regs(task) \
67 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(task)) - 1)
69 #define alloc_kernel_stack() __get_free_page(GFP_KERNEL)
70 #define free_kernel_stack(page) free_page((page))
73 /* Forward declaration, a strange C thing */
76 extern void start_thread(struct pt_regs *regs, unsigned int pc,
79 /* Free all resources held by a thread. */
80 static inline void release_thread(struct task_struct *dead_task)
85 * saved kernel SP and DP of a blocked thread.
88 #define thread_saved_ksp(tsk) \
89 (*(unsigned long *)&(tsk)->thread.b15_14)
90 #define thread_saved_dp(tsk) \
91 (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
93 #define thread_saved_ksp(tsk) \
94 (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
95 #define thread_saved_dp(tsk) \
96 (*(unsigned long *)&(tsk)->thread.b15_14)
99 extern unsigned long get_wchan(struct task_struct *p);
101 #define KSTK_EIP(task) (task_pt_regs(task)->pc)
102 #define KSTK_ESP(task) (task_pt_regs(task)->sp)
104 #define cpu_relax() do { } while (0)
106 extern const struct seq_operations cpuinfo_op;
108 /* Reset the board */
109 #define HARD_RESET_NOW()
111 extern unsigned int c6x_core_freq;
114 extern void (*c6x_restart)(void);
115 extern void (*c6x_halt)(void);
117 #endif /* ASM_C6X_PROCESSOR_H */