提交 cb09f540 编写于 作者: M Mikael Starvik 提交者: Linus Torvalds

[PATCH] CRIS update: arch split

Changes necessary to make the sub-arch split complete.
Signed-off-by: NMikael Starvik <starvik@axis.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e1637f43
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
* Authors: Bjorn Wesen * Authors: Bjorn Wesen
* *
* $Log: ptrace.c,v $ * $Log: ptrace.c,v $
* Revision 1.10 2004/09/22 11:50:01 orjanf
* * Moved get_reg/put_reg to arch-specific files.
* * Added functions to access debug registers (CRISv32).
* * Added support for PTRACE_SINGLESTEP (CRISv32).
* * Added S flag to CCS_MASK (CRISv32).
*
* Revision 1.9 2003/07/04 12:56:11 tobiasa * Revision 1.9 2003/07/04 12:56:11 tobiasa
* Moved arch-specific code to arch-specific files. * Moved arch-specific code to arch-specific files.
* *
...@@ -72,37 +78,6 @@ ...@@ -72,37 +78,6 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/processor.h> #include <asm/processor.h>
/*
* Get contents of register REGNO in task TASK.
*/
inline long get_reg(struct task_struct *task, unsigned int regno)
{
/* USP is a special case, it's not in the pt_regs struct but
* in the tasks thread struct
*/
if (regno == PT_USP)
return task->thread.usp;
else if (regno < PT_MAX)
return ((unsigned long *)user_regs(task->thread_info))[regno];
else
return 0;
}
/*
* Write contents of register REGNO in task TASK.
*/
inline int put_reg(struct task_struct *task, unsigned int regno,
unsigned long data)
{
if (regno == PT_USP)
task->thread.usp = data;
else if (regno < PT_MAX)
((unsigned long *)user_regs(task->thread_info))[regno] = data;
else
return -1;
return 0;
}
/* notification of userspace execution resumption /* notification of userspace execution resumption
* - triggered by current->work.notify_resume * - triggered by current->work.notify_resume
......
#ifndef __ASMCRIS_ARCH_ELF_H #ifndef __ASMCRIS_ARCH_ELF_H
#define __ASMCRIS_ARCH_ELF_H #define __ASMCRIS_ARCH_ELF_H
#define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#define elf_check_arch(x) \
((x)->e_machine == EM_CRIS \
&& ((((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_ANY_V0_V10 \
|| (((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_COMMON_V10_V32))))
/* /*
* ELF register definitions.. * ELF register definitions..
*/ */
......
#ifndef _ASM_ARCH_MEMMAP_H
#define _ASM_ARCH_MEMMAP_H
#define MEM_CSE0_START (0x00000000)
#define MEM_CSE0_SIZE (0x04000000)
#define MEM_CSE1_START (0x04000000)
#define MEM_CSE1_SIZE (0x04000000)
#define MEM_CSR0_START (0x08000000)
#define MEM_CSR1_START (0x0c000000)
#define MEM_CSP0_START (0x10000000)
#define MEM_CSP1_START (0x14000000)
#define MEM_CSP2_START (0x18000000)
#define MEM_CSP3_START (0x1c000000)
#define MEM_CSP4_START (0x20000000)
#define MEM_CSP5_START (0x24000000)
#define MEM_CSP6_START (0x28000000)
#define MEM_CSP7_START (0x2c000000)
#define MEM_DRAM_START (0x40000000)
#define MEM_NON_CACHEABLE (0x80000000)
#endif
...@@ -59,4 +59,12 @@ struct thread_struct { ...@@ -59,4 +59,12 @@ struct thread_struct {
wrusp(usp); \ wrusp(usp); \
} while(0) } while(0)
/* Called when handling a kernel bus fault fixup.
*
* After a fixup we do not want to return by restoring the CPU-state
* anymore, so switch frame-types (see ptrace.h)
*/
#define arch_fixup(regs) \
regs->frametype = CRIS_FRAME_NORMAL;
#endif #endif
...@@ -8,6 +8,27 @@ ...@@ -8,6 +8,27 @@
#include <asm/arch/elf.h> #include <asm/arch/elf.h>
#include <asm/user.h> #include <asm/user.h>
#define R_CRIS_NONE 0
#define R_CRIS_8 1
#define R_CRIS_16 2
#define R_CRIS_32 3
#define R_CRIS_8_PCREL 4
#define R_CRIS_16_PCREL 5
#define R_CRIS_32_PCREL 6
#define R_CRIS_GNU_VTINHERIT 7
#define R_CRIS_GNU_VTENTRY 8
#define R_CRIS_COPY 9
#define R_CRIS_GLOB_DAT 10
#define R_CRIS_JUMP_SLOT 11
#define R_CRIS_RELATIVE 12
#define R_CRIS_16_GOT 13
#define R_CRIS_32_GOT 14
#define R_CRIS_16_GOTPLT 15
#define R_CRIS_32_GOTPLT 16
#define R_CRIS_32_GOTREL 17
#define R_CRIS_32_PLT_GOTREL 18
#define R_CRIS_32_PLT_PCREL 19
typedef unsigned long elf_greg_t; typedef unsigned long elf_greg_t;
/* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is /* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is
...@@ -18,18 +39,30 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; ...@@ -18,18 +39,30 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
/* A placeholder; CRIS does not have any fp regs. */ /* A placeholder; CRIS does not have any fp regs. */
typedef unsigned long elf_fpregset_t; typedef unsigned long elf_fpregset_t;
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#define elf_check_arch(x) ( (x)->e_machine == EM_CRIS )
/* /*
* These are used to set parameters in the core dumps. * These are used to set parameters in the core dumps.
*/ */
#define ELF_CLASS ELFCLASS32 #define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2LSB; #define ELF_DATA ELFDATA2LSB
#define ELF_ARCH EM_CRIS #define ELF_ARCH EM_CRIS
/* The master for these definitions is {binutils}/include/elf/cris.h: */
/* User symbols in this file have a leading underscore. */
#define EF_CRIS_UNDERSCORE 0x00000001
/* This is a mask for different incompatible machine variants. */
#define EF_CRIS_VARIANT_MASK 0x0000000e
/* Variant 0; may contain v0..10 object. */
#define EF_CRIS_VARIANT_ANY_V0_V10 0x00000000
/* Variant 1; contains v32 object. */
#define EF_CRIS_VARIANT_V32 0x00000002
/* Variant 2; contains object compatible with v32 and v10. */
#define EF_CRIS_VARIANT_COMMON_V10_V32 0x00000004
/* End of excerpt from {binutils}/include/elf/cris.h. */
#define USE_ELF_CORE_DUMP #define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE 8192 #define ELF_EXEC_PAGESIZE 8192
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
are enabled. are enabled.
* *
* *
* For ETRAX 200 (ARCH_V32): * For ETRAX FS (ARCH_V32):
* /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction
* /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction
* /dev/gpioc minor 2, 18 bit GPIO, each bit can change direction * /dev/gpioc minor 2, 18 bit GPIO, each bit can change direction
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
#define ETRAXGPIO_IOCTYPE 43 #define ETRAXGPIO_IOCTYPE 43
#define GPIO_MINOR_A 0 #define GPIO_MINOR_A 0
#define GPIO_MINOR_B 1 #define GPIO_MINOR_B 1
#define GPIO_MINOR_C 2 #define GPIO_MINOR_LEDS 2
#define GPIO_MINOR_D 3 #define GPIO_MINOR_C 3
#define GPIO_MINOR_E 4 #define GPIO_MINOR_D 4
#define GPIO_MINOR_LEDS 5 #define GPIO_MINOR_E 5
#define GPIO_MINOR_LAST 5 #define GPIO_MINOR_LAST 5
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册