aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/asm-offsets.c
diff options
context:
space:
mode:
authorBryan Wu <bryan.wu@analog.com>2007-05-06 17:50:22 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:58 -0400
commit1394f03221790a988afc3e4b3cb79f2e477246a9 (patch)
tree2c1963c9a4f2d84a5e021307fde240c5d567cf70 /arch/blackfin/kernel/asm-offsets.c
parent73243284463a761e04d69d22c7516b2be7de096c (diff)
blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561 (Dual Core) devices, with a variety of development platforms including those avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP, BF561-EZKIT), and Bluetechnix! Tinyboards. The Blackfin architecture was jointly developed by Intel and Analog Devices Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in December of 2000. Since then ADI has put this core into its Blackfin processor family of devices. The Blackfin core has the advantages of a clean, orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC (Multiply/Accumulate), state-of-the-art signal processing engine and single-instruction, multiple-data (SIMD) multimedia capabilities into a single instruction-set architecture. The Blackfin architecture, including the instruction set, is described by the ADSP-BF53x/BF56x Blackfin Processor Programming Reference http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf The Blackfin processor is already supported by major releases of gcc, and there are binary and source rpms/tarballs for many architectures at: http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete documentation, including "getting started" guides available at: http://docs.blackfin.uclinux.org/ which provides links to the sources and patches you will need in order to set up a cross-compiling environment for bfin-linux-uclibc This patch, as well as the other patches (toolchain, distribution, uClibc) are actively supported by Analog Devices Inc, at: http://blackfin.uclinux.org/ We have tested this on LTP, and our test plan (including pass/fails) can be found at: http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel [m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files] Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Aubrey Li <aubrey.li@analog.com> Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/blackfin/kernel/asm-offsets.c')
-rw-r--r--arch/blackfin/kernel/asm-offsets.c136
1 files changed, 136 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c
new file mode 100644
index 000000000000..41d9a9f89700
--- /dev/null
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -0,0 +1,136 @@
1/*
2 * File: arch/blackfin/kernel/asm-offsets.c
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: generate definitions needed by assembly language modules.
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/stddef.h>
31#include <linux/sched.h>
32#include <linux/kernel_stat.h>
33#include <linux/ptrace.h>
34#include <linux/hardirq.h>
35#include <asm/irq.h>
36#include <asm/thread_info.h>
37
38#define DEFINE(sym, val) \
39 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
40
41int main(void)
42{
43 /* offsets into the task struct */
44 DEFINE(TASK_STATE, offsetof(struct task_struct, state));
45 DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
46 DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
47 DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
48 DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
49 DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info));
50 DEFINE(TASK_MM, offsetof(struct task_struct, mm));
51 DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
52 DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, pending));
53
54 /* offsets into the irq_cpustat_t struct */
55 DEFINE(CPUSTAT_SOFTIRQ_PENDING,
56 offsetof(irq_cpustat_t, __softirq_pending));
57
58 /* offsets into the thread struct */
59 DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
60 DEFINE(THREAD_USP, offsetof(struct thread_struct, usp));
61 DEFINE(THREAD_SR, offsetof(struct thread_struct, seqstat));
62 DEFINE(PT_SR, offsetof(struct thread_struct, seqstat));
63 DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0));
64 DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
65 DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
66
67 /* offsets into the pt_regs */
68 DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
69 DEFINE(PT_ORIG_PC, offsetof(struct pt_regs, orig_pc));
70 DEFINE(PT_R0, offsetof(struct pt_regs, r0));
71 DEFINE(PT_R1, offsetof(struct pt_regs, r1));
72 DEFINE(PT_R2, offsetof(struct pt_regs, r2));
73 DEFINE(PT_R3, offsetof(struct pt_regs, r3));
74 DEFINE(PT_R4, offsetof(struct pt_regs, r4));
75 DEFINE(PT_R5, offsetof(struct pt_regs, r5));
76 DEFINE(PT_R6, offsetof(struct pt_regs, r6));
77 DEFINE(PT_R7, offsetof(struct pt_regs, r7));
78
79 DEFINE(PT_P0, offsetof(struct pt_regs, p0));
80 DEFINE(PT_P1, offsetof(struct pt_regs, p1));
81 DEFINE(PT_P2, offsetof(struct pt_regs, p2));
82 DEFINE(PT_P3, offsetof(struct pt_regs, p3));
83 DEFINE(PT_P4, offsetof(struct pt_regs, p4));
84 DEFINE(PT_P5, offsetof(struct pt_regs, p5));
85
86 DEFINE(PT_FP, offsetof(struct pt_regs, fp));
87 DEFINE(PT_USP, offsetof(struct pt_regs, usp));
88 DEFINE(PT_I0, offsetof(struct pt_regs, i0));
89 DEFINE(PT_I1, offsetof(struct pt_regs, i1));
90 DEFINE(PT_I2, offsetof(struct pt_regs, i2));
91 DEFINE(PT_I3, offsetof(struct pt_regs, i3));
92 DEFINE(PT_M0, offsetof(struct pt_regs, m0));
93 DEFINE(PT_M1, offsetof(struct pt_regs, m1));
94 DEFINE(PT_M2, offsetof(struct pt_regs, m2));
95 DEFINE(PT_M3, offsetof(struct pt_regs, m3));
96 DEFINE(PT_L0, offsetof(struct pt_regs, l0));
97 DEFINE(PT_L1, offsetof(struct pt_regs, l1));
98 DEFINE(PT_L2, offsetof(struct pt_regs, l2));
99 DEFINE(PT_L3, offsetof(struct pt_regs, l3));
100 DEFINE(PT_B0, offsetof(struct pt_regs, b0));
101 DEFINE(PT_B1, offsetof(struct pt_regs, b1));
102 DEFINE(PT_B2, offsetof(struct pt_regs, b2));
103 DEFINE(PT_B3, offsetof(struct pt_regs, b3));
104 DEFINE(PT_A0X, offsetof(struct pt_regs, a0x));
105 DEFINE(PT_A0W, offsetof(struct pt_regs, a0w));
106 DEFINE(PT_A1X, offsetof(struct pt_regs, a1x));
107 DEFINE(PT_A1W, offsetof(struct pt_regs, a1w));
108 DEFINE(PT_LC0, offsetof(struct pt_regs, lc0));
109 DEFINE(PT_LC1, offsetof(struct pt_regs, lc1));
110 DEFINE(PT_LT0, offsetof(struct pt_regs, lt0));
111 DEFINE(PT_LT1, offsetof(struct pt_regs, lt1));
112 DEFINE(PT_LB0, offsetof(struct pt_regs, lb0));
113 DEFINE(PT_LB1, offsetof(struct pt_regs, lb1));
114 DEFINE(PT_ASTAT, offsetof(struct pt_regs, astat));
115 DEFINE(PT_RESERVED, offsetof(struct pt_regs, reserved));
116 DEFINE(PT_RETS, offsetof(struct pt_regs, rets));
117 DEFINE(PT_PC, offsetof(struct pt_regs, pc));
118 DEFINE(PT_RETX, offsetof(struct pt_regs, retx));
119 DEFINE(PT_RETN, offsetof(struct pt_regs, retn));
120 DEFINE(PT_RETE, offsetof(struct pt_regs, rete));
121 DEFINE(PT_SEQSTAT, offsetof(struct pt_regs, seqstat));
122 DEFINE(PT_SYSCFG, offsetof(struct pt_regs, syscfg));
123 DEFINE(PT_IPEND, offsetof(struct pt_regs, ipend));
124 DEFINE(SIZEOF_PTREGS, sizeof(struct pt_regs));
125 DEFINE(PT_TEXT_ADDR, sizeof(struct pt_regs)); /* Needed by gdb */
126 DEFINE(PT_TEXT_END_ADDR, 4 + sizeof(struct pt_regs));/* Needed by gdb */
127 DEFINE(PT_DATA_ADDR, 8 + sizeof(struct pt_regs)); /* Needed by gdb */
128 DEFINE(PT_FDPIC_EXEC, 12 + sizeof(struct pt_regs)); /* Needed by gdb */
129 DEFINE(PT_FDPIC_INTERP, 16 + sizeof(struct pt_regs));/* Needed by gdb */
130
131 /* signal defines */
132 DEFINE(SIGSEGV, SIGSEGV);
133 DEFINE(SIGTRAP, SIGTRAP);
134
135 return 0;
136}