aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/cris/kernel/ptrace.c37
-rw-r--r--include/asm-cris/arch-v10/elf.h10
-rw-r--r--include/asm-cris/arch-v10/memmap.h22
-rw-r--r--include/asm-cris/arch-v10/processor.h8
-rw-r--r--include/asm-cris/elf.h45
-rw-r--r--include/asm-cris/etraxgpio.h10
6 files changed, 90 insertions, 42 deletions
diff --git a/arch/cris/kernel/ptrace.c b/arch/cris/kernel/ptrace.c
index e85a2fdd9ac..2b6363cbe98 100644
--- a/arch/cris/kernel/ptrace.c
+++ b/arch/cris/kernel/ptrace.c
@@ -8,6 +8,12 @@
8 * Authors: Bjorn Wesen 8 * Authors: Bjorn Wesen
9 * 9 *
10 * $Log: ptrace.c,v $ 10 * $Log: ptrace.c,v $
11 * Revision 1.10 2004/09/22 11:50:01 orjanf
12 * * Moved get_reg/put_reg to arch-specific files.
13 * * Added functions to access debug registers (CRISv32).
14 * * Added support for PTRACE_SINGLESTEP (CRISv32).
15 * * Added S flag to CCS_MASK (CRISv32).
16 *
11 * Revision 1.9 2003/07/04 12:56:11 tobiasa 17 * Revision 1.9 2003/07/04 12:56:11 tobiasa
12 * Moved arch-specific code to arch-specific files. 18 * Moved arch-specific code to arch-specific files.
13 * 19 *
@@ -72,37 +78,6 @@
72#include <asm/system.h> 78#include <asm/system.h>
73#include <asm/processor.h> 79#include <asm/processor.h>
74 80
75/*
76 * Get contents of register REGNO in task TASK.
77 */
78inline long get_reg(struct task_struct *task, unsigned int regno)
79{
80 /* USP is a special case, it's not in the pt_regs struct but
81 * in the tasks thread struct
82 */
83
84 if (regno == PT_USP)
85 return task->thread.usp;
86 else if (regno < PT_MAX)
87 return ((unsigned long *)user_regs(task->thread_info))[regno];
88 else
89 return 0;
90}
91
92/*
93 * Write contents of register REGNO in task TASK.
94 */
95inline int put_reg(struct task_struct *task, unsigned int regno,
96 unsigned long data)
97{
98 if (regno == PT_USP)
99 task->thread.usp = data;
100 else if (regno < PT_MAX)
101 ((unsigned long *)user_regs(task->thread_info))[regno] = data;
102 else
103 return -1;
104 return 0;
105}
106 81
107/* notification of userspace execution resumption 82/* notification of userspace execution resumption
108 * - triggered by current->work.notify_resume 83 * - triggered by current->work.notify_resume
diff --git a/include/asm-cris/arch-v10/elf.h b/include/asm-cris/arch-v10/elf.h
index 2a2201ca538..1c38ee728b1 100644
--- a/include/asm-cris/arch-v10/elf.h
+++ b/include/asm-cris/arch-v10/elf.h
@@ -1,6 +1,16 @@
1#ifndef __ASMCRIS_ARCH_ELF_H 1#ifndef __ASMCRIS_ARCH_ELF_H
2#define __ASMCRIS_ARCH_ELF_H 2#define __ASMCRIS_ARCH_ELF_H
3 3
4#define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10
5
6/*
7 * This is used to ensure we don't load something for the wrong architecture.
8 */
9#define elf_check_arch(x) \
10 ((x)->e_machine == EM_CRIS \
11 && ((((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_ANY_V0_V10 \
12 || (((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_COMMON_V10_V32))))
13
4/* 14/*
5 * ELF register definitions.. 15 * ELF register definitions..
6 */ 16 */
diff --git a/include/asm-cris/arch-v10/memmap.h b/include/asm-cris/arch-v10/memmap.h
new file mode 100644
index 00000000000..13f3b971407
--- /dev/null
+++ b/include/asm-cris/arch-v10/memmap.h
@@ -0,0 +1,22 @@
1#ifndef _ASM_ARCH_MEMMAP_H
2#define _ASM_ARCH_MEMMAP_H
3
4#define MEM_CSE0_START (0x00000000)
5#define MEM_CSE0_SIZE (0x04000000)
6#define MEM_CSE1_START (0x04000000)
7#define MEM_CSE1_SIZE (0x04000000)
8#define MEM_CSR0_START (0x08000000)
9#define MEM_CSR1_START (0x0c000000)
10#define MEM_CSP0_START (0x10000000)
11#define MEM_CSP1_START (0x14000000)
12#define MEM_CSP2_START (0x18000000)
13#define MEM_CSP3_START (0x1c000000)
14#define MEM_CSP4_START (0x20000000)
15#define MEM_CSP5_START (0x24000000)
16#define MEM_CSP6_START (0x28000000)
17#define MEM_CSP7_START (0x2c000000)
18#define MEM_DRAM_START (0x40000000)
19
20#define MEM_NON_CACHEABLE (0x80000000)
21
22#endif
diff --git a/include/asm-cris/arch-v10/processor.h b/include/asm-cris/arch-v10/processor.h
index 9355d8675a5..e23df8dc96e 100644
--- a/include/asm-cris/arch-v10/processor.h
+++ b/include/asm-cris/arch-v10/processor.h
@@ -59,4 +59,12 @@ struct thread_struct {
59 wrusp(usp); \ 59 wrusp(usp); \
60} while(0) 60} while(0)
61 61
62/* Called when handling a kernel bus fault fixup.
63 *
64 * After a fixup we do not want to return by restoring the CPU-state
65 * anymore, so switch frame-types (see ptrace.h)
66 */
67#define arch_fixup(regs) \
68 regs->frametype = CRIS_FRAME_NORMAL;
69
62#endif 70#endif
diff --git a/include/asm-cris/elf.h b/include/asm-cris/elf.h
index d37fd5c4a56..87a60bd8e66 100644
--- a/include/asm-cris/elf.h
+++ b/include/asm-cris/elf.h
@@ -8,6 +8,27 @@
8#include <asm/arch/elf.h> 8#include <asm/arch/elf.h>
9#include <asm/user.h> 9#include <asm/user.h>
10 10
11#define R_CRIS_NONE 0
12#define R_CRIS_8 1
13#define R_CRIS_16 2
14#define R_CRIS_32 3
15#define R_CRIS_8_PCREL 4
16#define R_CRIS_16_PCREL 5
17#define R_CRIS_32_PCREL 6
18#define R_CRIS_GNU_VTINHERIT 7
19#define R_CRIS_GNU_VTENTRY 8
20#define R_CRIS_COPY 9
21#define R_CRIS_GLOB_DAT 10
22#define R_CRIS_JUMP_SLOT 11
23#define R_CRIS_RELATIVE 12
24#define R_CRIS_16_GOT 13
25#define R_CRIS_32_GOT 14
26#define R_CRIS_16_GOTPLT 15
27#define R_CRIS_32_GOTPLT 16
28#define R_CRIS_32_GOTREL 17
29#define R_CRIS_32_PLT_GOTREL 18
30#define R_CRIS_32_PLT_PCREL 19
31
11typedef unsigned long elf_greg_t; 32typedef unsigned long elf_greg_t;
12 33
13/* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is 34/* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is
@@ -19,17 +40,29 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
19typedef unsigned long elf_fpregset_t; 40typedef unsigned long elf_fpregset_t;
20 41
21/* 42/*
22 * This is used to ensure we don't load something for the wrong architecture.
23 */
24#define elf_check_arch(x) ( (x)->e_machine == EM_CRIS )
25
26/*
27 * These are used to set parameters in the core dumps. 43 * These are used to set parameters in the core dumps.
28 */ 44 */
29#define ELF_CLASS ELFCLASS32 45#define ELF_CLASS ELFCLASS32
30#define ELF_DATA ELFDATA2LSB; 46#define ELF_DATA ELFDATA2LSB
31#define ELF_ARCH EM_CRIS 47#define ELF_ARCH EM_CRIS
32 48
49/* The master for these definitions is {binutils}/include/elf/cris.h: */
50/* User symbols in this file have a leading underscore. */
51#define EF_CRIS_UNDERSCORE 0x00000001
52
53/* This is a mask for different incompatible machine variants. */
54#define EF_CRIS_VARIANT_MASK 0x0000000e
55
56/* Variant 0; may contain v0..10 object. */
57#define EF_CRIS_VARIANT_ANY_V0_V10 0x00000000
58
59/* Variant 1; contains v32 object. */
60#define EF_CRIS_VARIANT_V32 0x00000002
61
62/* Variant 2; contains object compatible with v32 and v10. */
63#define EF_CRIS_VARIANT_COMMON_V10_V32 0x00000004
64/* End of excerpt from {binutils}/include/elf/cris.h. */
65
33#define USE_ELF_CORE_DUMP 66#define USE_ELF_CORE_DUMP
34 67
35#define ELF_EXEC_PAGESIZE 8192 68#define ELF_EXEC_PAGESIZE 8192
diff --git a/include/asm-cris/etraxgpio.h b/include/asm-cris/etraxgpio.h
index cf04af9635c..80ee10f70d4 100644
--- a/include/asm-cris/etraxgpio.h
+++ b/include/asm-cris/etraxgpio.h
@@ -13,7 +13,7 @@
13 are enabled. 13 are enabled.
14 * 14 *
15 * 15 *
16 * For ETRAX 200 (ARCH_V32): 16 * For ETRAX FS (ARCH_V32):
17 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction 17 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction
18 * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction 18 * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction
19 * /dev/gpioc minor 2, 18 bit GPIO, each bit can change direction 19 * /dev/gpioc minor 2, 18 bit GPIO, each bit can change direction
@@ -39,10 +39,10 @@
39#define ETRAXGPIO_IOCTYPE 43 39#define ETRAXGPIO_IOCTYPE 43
40#define GPIO_MINOR_A 0 40#define GPIO_MINOR_A 0
41#define GPIO_MINOR_B 1 41#define GPIO_MINOR_B 1
42#define GPIO_MINOR_C 2 42#define GPIO_MINOR_LEDS 2
43#define GPIO_MINOR_D 3 43#define GPIO_MINOR_C 3
44#define GPIO_MINOR_E 4 44#define GPIO_MINOR_D 4
45#define GPIO_MINOR_LEDS 5 45#define GPIO_MINOR_E 5
46#define GPIO_MINOR_LAST 5 46#define GPIO_MINOR_LAST 5
47#endif 47#endif
48 48