xtensa-cvscommit Mailing List for xtensa (Page 6)
Brought to you by:
zankel
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(18) |
Oct
(30) |
Nov
(18) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(24) |
Feb
(38) |
Mar
(28) |
Apr
(27) |
May
(17) |
Jun
(6) |
Jul
(12) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2004 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/arch/xtensa/kernel
Modified Files:
Makefile handlers.S process.c ptrace.c reset.c setup.c
signal.c traps.c
Added Files:
cptable.S
Log Message:
Implement TIE support in elf_fpregset_t for core dumps and ptrace.
The elf_fpregset_t contains coprocessor and non-coprocessor custom
state, as well as a table describing its layout for use by GDB.
Also add experimental traceback code on panic's (untested, but doesn't
break anything).
--- NEW FILE: cptable.S ---
/*
* arch/xtensa/kernel/cptable.S
*
* Xtensa processor configuration-specific table of coprocessor and
* other custom register layout information.
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2003 Tensilica Inc.
* Authors: Marc Gauthier <ma...@te...> <ma...@al...>
*/
/*
* This module contains a table that describes the layout of the various
* custom registers and states associated with each coprocessor, as well
* as those not associated with any coprocessor ("extra state").
* This table is included with core dumps and is available via the ptrace
* interface, allowing the layout of such register/state information to
* be modified in the kernel without affecting the debugger. Each
* register or state is identified using a 32-bit "libdb target number"
* assigned when the Xtensa processor is generated.
*/
#define _ASMLANGUAGE 1
#define _LANGUAGE_ASSEMBLY 1
#include <xtensa/config/core.h>
#include <linux/config.h>
/*
* The Xtensa compile-time HAL (core.h) XCHAL_*_SA_CONTENTS_LIBDB macros
* describe the contents of coprocessor & extra save areas in terms of
* undefined CONTENTS_LIBDB_{SREG,UREG,REGF} macros. We define these
* latter macros here; they expand into a table of the format we want.
* The general format is:
*
* CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
* CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
* CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize,
* regname_base, regfile_name, rsv2, rsv3)
*
* For this table, we only care about the <libdbnum>, <offset> and <size> fields.
*/
/* Map all XCHAL CONTENTS macros to the reg_entry asm macro defined below: */
#define CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3) \
reg_entry libdbnum, offset, size ;
#define CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3) \
reg_entry libdbnum, offset, size ;
#define CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, \
regname_base, regfile_name, rsv2, rsv3) \
reg_entry libdbnum, offset, size ;
/* A single table entry: */
.macro reg_entry libdbnum, offset, size
.ifne (__last_offset-(__last_group_offset+\offset))
.word (0xFC000000+__last_offset-(__last_group_offset+\offset)) /* padding entry */
.endif
.word \libdbnum /* actual entry */
.set __last_offset, __last_group_offset+\offset+\size
.endm /* reg_entry */
/* Table entry that marks the beginning of a group (coprocessor or "extra"): */
.macro reg_group cpnum, num_entries, alignment
.set __last_group_offset, (__last_offset + \alignment - 1) & -\alignment
.ifne \num_entries
.word 0xFD000000+(\cpnum<<16)+\num_entries
.endif
.endm /* reg_group */
/*
*
*/
.section .rodata, "a"
.globl _xtensa_reginfo_tables
.globl _xtensa_reginfo_table_size
.align 4
_xtensa_reginfo_table_size:
.word _xtensa_reginfo_table_end - _xtensa_reginfo_tables
_xtensa_reginfo_tables:
.set __last_offset, 0
reg_group 0xFF, XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM, XCHAL_EXTRA_SA_ALIGN
XCHAL_EXTRA_SA_CONTENTS_LIBDB
reg_group 0, XCHAL_CP0_SA_CONTENTS_LIBDB_NUM, XCHAL_CP0_SA_ALIGN
XCHAL_CP0_SA_CONTENTS_LIBDB
reg_group 1, XCHAL_CP1_SA_CONTENTS_LIBDB_NUM, XCHAL_CP1_SA_ALIGN
XCHAL_CP1_SA_CONTENTS_LIBDB
reg_group 2, XCHAL_CP2_SA_CONTENTS_LIBDB_NUM, XCHAL_CP2_SA_ALIGN
XCHAL_CP2_SA_CONTENTS_LIBDB
reg_group 3, XCHAL_CP3_SA_CONTENTS_LIBDB_NUM, XCHAL_CP3_SA_ALIGN
XCHAL_CP3_SA_CONTENTS_LIBDB
reg_group 4, XCHAL_CP4_SA_CONTENTS_LIBDB_NUM, XCHAL_CP4_SA_ALIGN
XCHAL_CP4_SA_CONTENTS_LIBDB
reg_group 5, XCHAL_CP5_SA_CONTENTS_LIBDB_NUM, XCHAL_CP5_SA_ALIGN
XCHAL_CP5_SA_CONTENTS_LIBDB
reg_group 6, XCHAL_CP6_SA_CONTENTS_LIBDB_NUM, XCHAL_CP6_SA_ALIGN
XCHAL_CP6_SA_CONTENTS_LIBDB
reg_group 7, XCHAL_CP7_SA_CONTENTS_LIBDB_NUM, XCHAL_CP7_SA_ALIGN
XCHAL_CP7_SA_CONTENTS_LIBDB
.word 0xFC000000 /* invalid register number, marks end of table */
_xtensa_reginfo_table_end:
Index: Makefile
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Makefile 19 Oct 2002 04:39:53 -0000 1.3
--- Makefile 7 Feb 2003 02:03:35 -0000 1.4
***************
*** 15,19 ****
obj-y := entry.o handlers.o ioport.o ipc.o irq.o process.o ptrace.o \
reset.o semaphore.o setup.o signal.o sys.o syscall.o sysxtensa.o \
! traps.o vec_wexc.o vectors.o vm86.o xtensa_switch.o xtirq.o
# obj-$(CONFIG_BOOTSTRAP) += bootstrap.o
--- 15,20 ----
obj-y := entry.o handlers.o ioport.o ipc.o irq.o process.o ptrace.o \
reset.o semaphore.o setup.o signal.o sys.o syscall.o sysxtensa.o \
! traps.o vec_wexc.o vectors.o vm86.o xtensa_switch.o xtirq.o \
! cptable.o
# obj-$(CONFIG_BOOTSTRAP) += bootstrap.o
Index: handlers.S
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** handlers.S 30 Jan 2003 23:55:26 -0000 1.10
--- handlers.S 7 Feb 2003 02:03:35 -0000 1.11
***************
*** 957,961 ****
_GET_CURRENT a2
! addi a2, a2, THREAD_EXTRA // a2 <-- addr of save location
xchal_extra_store_funcbody
--- 957,961 ----
_GET_CURRENT a2
! addi a2, a2, THREAD_CPEXTRA // a2 <-- addr of save location
xchal_extra_store_funcbody
***************
*** 1354,1358 ****
_GET_CURRENT a2
! addi a2, a2, THREAD_EXTRA // a2 <-- addr of save location
xchal_extra_load_funcbody
--- 1354,1358 ----
_GET_CURRENT a2
! addi a2, a2, THREAD_CPEXTRA // a2 <-- addr of save location
xchal_extra_load_funcbody
***************
*** 1934,1938 ****
! #if XCHAL_UNALIGNED_LOAD_EXCEPTION
/* First-level exit handler for unaligned exceptions.
--- 1934,1938 ----
! #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
/* First-level exit handler for unaligned exceptions.
***************
*** 2631,2635 ****
j unaligned_return
! #endif /* XCHAL_UNALIGNED_LOAD_EXCEPTION */
--- 2631,2635 ----
j unaligned_return
! #endif /* XCHAL_UNALIGNED_{LOAD,STORE}_EXCEPTION */
***************
*** 2884,2904 ****
! /* Only if coprocessors exist to we include handlers for Coprocessor
! * Disabled Exceptions. */
#if (XCHAL_CP_NUM)
- .data
- .align 4
-
- /* coproc_owners is an array of words, one per coprocessor. A zero
- * value indicates no user task owns the coprocessor. A nonzero value
- * indicates the opposite and is also the pointer to the top of the
- * task_struct (or TCB) for the owning task. */
-
- .global coproc_owners
- coproc_owners:
- .space 4*XCHAL_CP_MAX, 0
-
/* Allocate some scratch area in which to save original values of
* registers. Also define some offsets for robustness and
--- 2884,2892 ----
! /* Only if coprocessors exist do we include handlers for Coprocessor
! * Disabled Exceptions, for lazy coprocessor context switching. */
#if (XCHAL_CP_NUM)
/* Allocate some scratch area in which to save original values of
* registers. Also define some offsets for robustness and
***************
*** 2922,2925 ****
--- 2910,2915 ----
#define CP_SAVE_TOTAL (15*4)
+ .data
+ .align 4
cp_save_area:
.space CP_SAVE_TOTAL, 0
***************
*** 3097,3098 ****
--- 3087,3089 ----
#endif /* XCHAL_CP_NUM, or if at least one coproc exists */
+
Index: process.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/process.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** process.c 31 Jan 2003 04:37:19 -0000 1.7
--- process.c 7 Feb 2003 02:03:35 -0000 1.8
***************
*** 53,62 ****
}
! struct task_struct *last_task_used_math = NULL;
asmlinkage void ret_from_fork(void);
#if XCHAL_CP_NUM
- extern struct task_struct *coproc_owners[];
void release_all_cp (struct task_struct *tsk)
{
--- 53,66 ----
}
!
! /* Tasks that own contents of (last used) each coprocessor.
! * Entries are NULL (0) for unowned or non-existent coprocessors:
! */
! struct task_struct *coproc_owners[XCHAL_CP_MAX];
! struct task_struct *last_task_used_math = NULL; /* not used */
asmlinkage void ret_from_fork(void);
#if XCHAL_CP_NUM
void release_all_cp (struct task_struct *tsk)
{
***************
*** 110,145 ****
childregs->aregs[0] = 0; /* mark base of call stack */
} else {
childregs->aregs[1] = usp;
p->thread.current_ds = USER_DS;
! /* Zero through eight coprocessors may exist. Be sure
! * memory for saving state is setup properly. Note
! * that we assume kernel threads do not use
* coprocessors. */
! #if (XCHAL_CP_MASK & 1)
! p->thread.cpregs_ptr[0] = (unsigned) &p->thread.cp0_regs;
! #endif
! #if (XCHAL_CP_MASK & 2)
! p->thread.cpregs_ptr[1] = (unsigned) &p->thread.cp1_regs;
! #endif
! #if (XCHAL_CP_MASK & 4)
! p->thread.cpregs_ptr[2] = (unsigned) &p->thread.cp2_regs;
! #endif
! #if (XCHAL_CP_MASK & 8)
! p->thread.cpregs_ptr[3] = (unsigned) &p->thread.cp3_regs;
! #endif
! #if (XCHAL_CP_MASK & 16)
! p->thread.cpregs_ptr[4] = (unsigned) &p->thread.cp4_regs;
! #endif
! #if (XCHAL_CP_MASK & 32)
! p->thread.cpregs_ptr[5] = (unsigned) &p->thread.cp5_regs;
! #endif
! #if (XCHAL_CP_MASK & 64)
! p->thread.cpregs_ptr[6] = (unsigned) &p->thread.cp6_regs;
! #endif
! #if (XCHAL_CP_MASK & 128)
! p->thread.cpregs_ptr[7] = (unsigned) &p->thread.cp7_regs;
! #endif
}
--- 114,135 ----
childregs->aregs[0] = 0; /* mark base of call stack */
} else {
+ unsigned char *saptr; /* save area pointer */
+ int i;
+
childregs->aregs[1] = usp;
p->thread.current_ds = USER_DS;
! /* Up to eight coprocessors may exist. Be sure
! * memory for saving state is setup properly.
! * Note that we assume kernel threads do not use
* coprocessors. */
! saptr = p->thread.cpextra + XCHAL_EXTRA_SA_SIZE;
! for( i = 0; i < XCHAL_CP_MAX; i++ ) {
! saptr = (unsigned char*)( ((unsigned)saptr + Xthal_cpregs_align[i] - 1)
! & -Xthal_cpregs_align[i] );
! p->thread.cpregs_ptr[i] = saptr;
! saptr += Xthal_cpregs_size[i];
! }
}
***************
*** 150,234 ****
}
- /* Fill in the CP structure for a core dump. This includes any FPU
- * coprocessor. Here, we dump all coprocessors. */
- int dump_fpu(struct pt_regs *regs, struct user_cp *r)
- {
- #if XCHAL_HAVE_CP
- int retval = 0;
- struct task_struct *tsk = current;
-
- #if (XCHAL_CP_MASK & 1) && XCHAL_CP0_SA_SIZE
- memcpy(r, tsk->thread.cp0_regs, XCHAL_CP0_SA_SIZE);
- r += XCHAL_CP0_SA_SIZE;
- retval = 1;
- #endif
-
- #if (XCHAL_CP_MASK & 2) && XCHAL_CP1_SA_SIZE
- memcpy(r, tsk->thread.cp1_regs, XCHAL_CP1_SA_SIZE);
- r += XCHAL_CP1_SA_SIZE;
- retval = 1;
- #endif
-
- #if (XCHAL_CP_MASK & 4) && XCHAL_CP2_SA_SIZE
- memcpy(r, tsk->thread.cp2_regs, XCHAL_CP2_SA_SIZE);
- r += XCHAL_CP2_SA_SIZE;
- retval = 1;
- #endif
-
- #if (XCHAL_CP_MASK & 8) && XCHAL_CP3_SA_SIZE
- memcpy(r, tsk->thread.cp3_regs, XCHAL_CP3_SA_SIZE);
- r += XCHAL_CP3_SA_SIZE;
- retval = 1;
- #endif
-
- #if (XCHAL_CP_MASK & 16) && XCHAL_CP4_SA_SIZE
- memcpy(r, tsk->thread.cp4_regs, XCHAL_CP4_SA_SIZE);
- r += XCHAL_CP4_SA_SIZE;
- retval = 1;
- #endif
-
- #if (XCHAL_CP_MASK & 32) && XCHAL_CP5_SA_SIZE
- memcpy(r, tsk->thread.cp5_regs, XCHAL_CP5_SA_SIZE);
- r += XCHAL_CP5_SA_SIZE;
- retval = 1;
- #endif
-
- #if (XCHAL_CP_MASK & 64) && XCHAL_CP6_SA_SIZE
- memcpy(r, tsk->thread.cp6_regs, XCHAL_CP6_SA_SIZE);
- r += XCHAL_CP6_SA_SIZE;
- retval = 1;
- #endif
-
- #if (XCHAL_CP_MASK & 128) && XCHAL_CP7_SA_SIZE
- memcpy(r, tsk->thread.cp7_regs, XCHAL_CP7_SA_SIZE);
- r += XCHAL_CP7_SA_SIZE;
- retval = 1;
- #endif
-
- return retval;
-
- #endif /* if XCHAL_HAVE_CP */
-
- return 0; /* no coprocessors on this processor */
- }
-
-
- /* Fill in the user structure for a core dump.. */
- void dump_thread(struct pt_regs * regs, struct user * dump)
- {
- dump->magic = CMAGIC;
- dump->start_code = current->mm->start_code;
- dump->start_data = current->mm->start_data;
- dump->start_stack = regs->aregs[1] & ~(PAGE_SIZE - 1);
- dump->u_tsize = (current->mm->end_code - dump->start_code) >> PAGE_SHIFT;
- dump->u_dsize = (current->mm->brk + (PAGE_SIZE-1) - dump->start_data) >> PAGE_SHIFT;
- dump->u_ssize = (current->mm->start_stack - dump->start_stack +
- PAGE_SIZE - 1) >> PAGE_SHIFT;
- /* XTFIXME?: Debug registers will come here. */
-
- dump->regs = *regs;
-
- dump->u_fpvalid = dump_fpu(regs, &dump->cps);
- }
/*
--- 140,143 ----
***************
*** 432,433 ****
--- 341,456 ----
}
}
+
+ /* do_save_fpregs() gathers information from 'struct pt_regs' and
+ * 'current->thread' to fill in the elf_fpregset_t structure.
+ *
+ * Core files and ptrace use elf_fpregset_t. */
+
+ void do_save_fpregs (elf_fpregset_t *fpregs, struct pt_regs *regs, struct task_struct *tsk)
+ {
+ extern unsigned char _xtensa_reginfo_tables[];
+ extern unsigned _xtensa_reginfo_table_size;
+ int i;
+
+ /*
+ * Before dumping coprocessor state from memory,
+ * ensure any live coprocessor contents for this
+ * task are first saved to memory:
+ */
+ for (i = 0; i < XCHAL_CP_MAX; i++) {
+ if (tsk == coproc_owners[i]) {
+ xthal_save_cpregs( tsk->thread.cpregs_ptr[i], i );
+ coproc_owners[i] = 0;
+ xthal_invalidate_cp( i );
+ }
+ }
+
+ /* Now dump coprocessor & extra state: */
+ memcpy((unsigned char*)fpregs,
+ _xtensa_reginfo_tables, _xtensa_reginfo_table_size);
+ memcpy((unsigned char*)fpregs + _xtensa_reginfo_table_size,
+ tsk->thread.cpextra, TOTAL_CPEXTRA_SIZE);
+ }
+
+ /* The inverse of do_save_fpregs().
+ * Copies coprocessor and extra state from fpregs into regs and tsk->thread.
+ * Returns 0 on success, non-zero if layout doesn't match. */
+
+ int do_restore_fpregs (elf_fpregset_t *fpregs, struct pt_regs *regs, struct task_struct *tsk)
+ {
+ extern unsigned char _xtensa_reginfo_tables[];
+ extern unsigned _xtensa_reginfo_table_size;
+ int i;
+
+ /* Make sure save area layouts match.
+ * XTFIXME: in the future we could allow restoring from
+ * a different layout of the same registers, by comparing
+ * fpregs' table with _xtensa_reginfo_tables and matching
+ * entries and copying registers one at a time.
+ * Not too sure yet whether that's very useful.
+ */
+ if( memcmp((unsigned char*)fpregs,
+ _xtensa_reginfo_tables, _xtensa_reginfo_table_size) ) {
+ return -1;
+ }
+
+ /*
+ * Before restoring coprocessor state from memory,
+ * ensure any live coprocessor contents for this
+ * task are first invalidated.
+ */
+ for (i = 0; i < XCHAL_CP_MAX; i++) {
+ if (tsk == coproc_owners[i]) {
+ /*xthal_save_cpregs( tsk->thread.cpregs_ptr[i], i );*/
+ coproc_owners[i] = 0;
+ xthal_invalidate_cp( i );
+ }
+ }
+
+ /* Now restore coprocessor & extra state: */
+ memcpy(tsk->thread.cpextra,
+ (unsigned char*)fpregs + _xtensa_reginfo_table_size,
+ TOTAL_CPEXTRA_SIZE);
+ return 0;
+ }
+
+ /*
+ * Fill in the CP structure for a core dump.
+ * This includes any FPU coprocessor.
+ * Here, we dump all coprocessors, and other ("extra") custom state.
+ *
+ * This function is called by elf_core_dump() in fs/binfmt_elf.c
+ * (in which case 'regs' comes from calls to do_coredump, see signals.c).
+ */
+ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r)
+ {
+ #if TOTAL_CPEXTRA_SIZE > 16 /* see asm/cpextra.h for this magic number 16 */
+ do_save_fpregs (r, regs, current); /* XTFIXME: will regs always be for current? */
+
+ /* For now, bit 16 means some extra state may be present: */
+ return 0x10000 | XCHAL_CP_MASK; /* XTFIXME!! need to track to return more accurate mask */
+ #else
+ return 0; /* no coprocessors active on this processor */
+ #endif
+ }
+
+
+ #if 0 /* not used -- only for a.out formats... */
+ /* Fill in the user structure for a core dump.. */
+ void dump_thread(struct pt_regs * regs, struct user * dump)
+ {
+ dump->magic = CMAGIC;
+ dump->start_code = current->mm->start_code;
+ dump->start_data = current->mm->start_data;
+ dump->start_stack = regs->aregs[1] & ~(PAGE_SIZE - 1);
+ dump->u_tsize = (current->mm->end_code - dump->start_code) >> PAGE_SHIFT;
+ dump->u_dsize = (current->mm->brk + (PAGE_SIZE-1) - dump->start_data) >> PAGE_SHIFT;
+ dump->u_ssize = (current->mm->start_stack - dump->start_stack +
+ PAGE_SIZE - 1) >> PAGE_SHIFT;
+ /* XTFIXME?: Debug registers will come here. */
+
+ dump->regs = *regs;
+
+ dump->u_cpevalid = dump_fpu(regs, &dump->cpregs);
+ }
+ #endif /*0*/
Index: ptrace.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/ptrace.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ptrace.c 29 Jan 2003 06:18:00 -0000 1.7
--- ptrace.c 7 Feb 2003 02:03:35 -0000 1.8
***************
*** 10,15 ****
* Kevin D. Kissell, ke...@mi... and Carsten Langgaard, car...@mi...
* Copyright (C) 1999 MIPS Technologies, Inc.
! * Scott Foehner <sfo...@ya...> and Joe Taylor <jo...@te...>
! * Copyright (C) 2002 Tensilica, Inc.
*/
#include <linux/config.h>
--- 10,17 ----
* Kevin D. Kissell, ke...@mi... and Carsten Langgaard, car...@mi...
* Copyright (C) 1999 MIPS Technologies, Inc.
! * Scott Foehner <sfo...@ya...>,
! * Joe Taylor <jo...@te...>, and
! * Marc Gauthier <ma...@te...> <ma...@al...>
! * Copyright (C) 2002 - 2003 Tensilica, Inc.
*/
#include <linux/config.h>
***************
*** 33,36 ****
--- 35,40 ----
extern void do_copy_regs (elf_gregset_t *, struct pt_regs *, struct task_struct *);
extern void do_restore_regs (elf_gregset_t *, struct pt_regs *, struct task_struct *);
+ extern void do_save_fpregs (elf_fpregset_t *, struct pt_regs *, struct task_struct *);
+ extern int do_restore_fpregs (elf_fpregset_t *, struct pt_regs *, struct task_struct *);
***************
*** 76,80 ****
struct task_struct *child;
int res;
! extern void save_fp(struct task_struct *);
lock_kernel();
--- 80,84 ----
struct task_struct *child;
int res;
! /*extern void save_fp(struct task_struct *);*/
lock_kernel();
***************
*** 390,396 ****
--- 394,435 ----
case PTRACE_GETFPREGS:
+ {
+ /* 'data' points to user memory in which to write.
+ * For convenience, we use the handy
+ * elf_fpregset_t format. */
+
+ elf_fpregset_t fpregs;
+ struct pt_regs *regs = __KSTK_TOS(child);
+
+ do_save_fpregs (&fpregs, regs, child);
+
+ /* Now, copy to user space nice and easy... */
+ res = 0;
+ if (copy_to_user((void *)data, &fpregs, sizeof(elf_fpregset_t)))
+ res = -EFAULT;
break;
+ }
case PTRACE_SETFPREGS:
+ {
+ /* 'data' points to user memory that contains the new
+ * values in the elf_fpregset_t format. */
+
+ elf_fpregset_t fpregs;
+ struct pt_regs *regs = __KSTK_TOS(child);
+
+ if (copy_from_user(&fpregs, (void *)data, sizeof(elf_fpregset_t))) {
+ res = -EFAULT;
+ break;
+ }
+
+ if (do_restore_fpregs (&fpregs, regs, child))
+ res = -EIO;
+ break;
+ }
+
+ case PTRACE_GETFPREGSIZE:
+ /* 'data' points to 'unsigned long' set to the size of elf_fpregset_t */
+ res = put_user(sizeof(elf_fpregset_t), (unsigned long *) data);
break;
Index: reset.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/reset.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** reset.c 18 Oct 2002 21:57:27 -0000 1.2
--- reset.c 7 Feb 2003 02:03:35 -0000 1.3
***************
*** 3,6 ****
--- 3,8 ----
*
* Reset the machine.
+ *
+ * Copyright (C) 2003 Tensilica Inc.
*/
#include <linux/kernel.h>
Index: setup.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/setup.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** setup.c 29 Jan 2003 06:18:00 -0000 1.4
--- setup.c 7 Feb 2003 02:03:35 -0000 1.5
***************
*** 5,9 ****
*
* Copyright (C) 1995 Linus Torvalds
! * Copyright (C) 2001 - 2002 Tensilica Inc.
* Author(s): Chris Zankel <za...@te...> <ch...@za...>
* Joe Taylor <jo...@te..., jo...@ya...>
--- 5,9 ----
*
* Copyright (C) 1995 Linus Torvalds
! * Copyright (C) 2001 - 2003 Tensilica Inc.
* Author(s): Chris Zankel <za...@te...> <ch...@za...>
* Joe Taylor <jo...@te..., jo...@ya...>
***************
*** 18,21 ****
--- 18,23 ----
#include <linux/tty.h>
#include <linux/bootmem.h>
+ #include <linux/kernel.h>
+ #include <linux/notifier.h>
#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
#include <linux/console.h>
***************
*** 236,239 ****
--- 238,277 ----
*/
+ #define DEBUG_PANIC_TRACEBACK
+ #ifdef DEBUG_PANIC_TRACEBACK
+ /* Panic handler -- display task traceback */
+ static int xtensa_panic_event(struct notifier_block *this,
+ unsigned long event, void *ptr)
+ {
+ #define MAX_TRACEBACK 100
+ register unsigned current_retpc asm ("a0"); /* return address */
+ register unsigned *current_sp asm ("a1"); /* current stack pointer */
+ unsigned retpc, next_retpc, *sp;
+ int i;
+
+ printk( "Call traceback:\n" );
+ xthal_window_spill(); /* save any live caller windows to stack */
+ sp = current_sp; /* start with current stack frame */
+ retpc = current_retpc; /* and current return address */
+ for( i = 0; i < MAX_TRACEBACK; i++ ) {
+ next_retpc = sp[-4]; /* a0 of caller */
+ sp = (unsigned*) sp[-3]; /* a1 of caller -- go to next caller */
+ if( retpc == 0 || sp == 0 ) { /* end of call stack? */
+ printk( " (end of traceback)\n" );
+ break;
+ }
+ printk( " SP=%08X PC=%08X\n", (unsigned) sp, retpc );
+ retpc = next_retpc;
+ }
+ return NOTIFY_DONE;
+ }
+
+ static struct notifier_block xtensa_panic_block = {
+ xtensa_panic_event,
+ NULL,
+ 0
+ };
+ #endif /* DEBUG_PANIC_TRACEBACK */
+
extern char _end;
***************
*** 300,303 ****
--- 338,346 ----
conswitchp = &dummy_con;
# endif
+ #endif
+
+ #ifdef DEBUG_PANIC_TRACEBACK
+ /* Register panic handler, for debugging purposes only: */
+ notifier_chain_register(&panic_notifier_list, &xtensa_panic_block);
#endif
}
Index: signal.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/signal.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** signal.c 8 Nov 2002 01:10:18 -0000 1.2
--- signal.c 7 Feb 2003 02:03:35 -0000 1.3
***************
*** 250,254 ****
}
#if (XCHAL_EXTRA_SA_SIZE > 0)
! err |= __copy_from_user(thread->extra,sc->sc_extra,XCHAL_EXTRA_SA_SIZE);
#endif /* (XCHAL_EXTRA_SA_SIZE > 0) */
--- 250,254 ----
}
#if (XCHAL_EXTRA_SA_SIZE > 0)
! err |= __copy_from_user(thread->cpextra,sc->sc_extra,XCHAL_EXTRA_SA_SIZE);
#endif /* (XCHAL_EXTRA_SA_SIZE > 0) */
***************
*** 304,308 ****
}
#if (XCHAL_EXTRA_SA_SIZE > 0)
! err |= __copy_to_user(sc->sc_extra, thread->extra, XCHAL_EXTRA_SA_SIZE);
#endif /* (XCHAL_EXTRA_SA_SIZE > 0) */
--- 304,308 ----
}
#if (XCHAL_EXTRA_SA_SIZE > 0)
! err |= __copy_to_user(sc->sc_extra, thread->cpextra, XCHAL_EXTRA_SA_SIZE);
#endif /* (XCHAL_EXTRA_SA_SIZE > 0) */
Index: traps.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** traps.c 29 Jan 2003 06:18:00 -0000 1.6
--- traps.c 7 Feb 2003 02:03:35 -0000 1.7
***************
*** 257,261 ****
! #if XCHAL_UNALIGNED_LOAD_EXCEPTION
static void
handle_unaligned_user (struct pt_regs *regs)
--- 257,261 ----
! #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
static void
handle_unaligned_user (struct pt_regs *regs)
***************
*** 415,421 ****
}
! #if XCHAL_UNALIGNED_LOAD_EXCEPTION
! set_except_vector(EXC_CODE_KERNEL + XCHAL_EXCCAUSE_LOAD_STORE_ALIGNMENT, handle_unaligned_kernel);
! set_c_except_handler (XCHAL_EXCCAUSE_LOAD_STORE_ALIGNMENT, handle_unaligned_user);
#endif
--- 415,421 ----
}
! #if XCHAL_UNALIGNED_LOAD_EXCEPTION || XCHAL_UNALIGNED_STORE_EXCEPTION
! /*set_except_vector(EXC_CODE_KERNEL + XCHAL_EXCCAUSE_UNALIGNED, handle_unaligned_kernel);*/ /*XTFIXME - turned off for debugging*/
! set_c_except_handler (XCHAL_EXCCAUSE_UNALIGNED, handle_unaligned_user);
#endif
***************
*** 528,535 ****
"a6: %08x a14: %08x\n"
"a7: %08x a15: %08x\n",
! regs->aregs[0], regs->aregs[1], regs->aregs[2], regs->aregs[3],
! regs->aregs[4], regs->aregs[5], regs->aregs[6], regs->aregs[7],
! regs->aregs[8], regs->aregs[9], regs->aregs[10],regs->aregs[11],
! regs->aregs[12],regs->aregs[13],regs->aregs[14],regs->aregs[15] );
/*
--- 528,539 ----
"a6: %08x a14: %08x\n"
"a7: %08x a15: %08x\n",
! regs->aregs[0], regs->aregs[8],
! regs->aregs[1], regs->aregs[9],
! regs->aregs[2], regs->aregs[10],
! regs->aregs[3], regs->aregs[11],
! regs->aregs[4], regs->aregs[12],
! regs->aregs[5], regs->aregs[13],
! regs->aregs[6], regs->aregs[14],
! regs->aregs[7], regs->aregs[15] );
/*
|
|
From: <ma...@us...> - 2003-02-07 02:03:38
|
Update of /cvsroot/xtensa/linux/arch/xtensa/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/arch/xtensa/tools
Modified Files:
offset.c
Log Message:
Implement TIE support in elf_fpregset_t for core dumps and ptrace.
The elf_fpregset_t contains coprocessor and non-coprocessor custom
state, as well as a table describing its layout for use by GDB.
Also add experimental traceback code on panic's (untested, but doesn't
break anything).
Index: offset.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/tools/offset.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** offset.c 22 Oct 2002 17:59:47 -0000 1.2
--- offset.c 7 Feb 2003 02:03:35 -0000 1.3
***************
*** 97,102 ****
offset("#define THREAD_AREG1 ", struct task_struct, thread.areg1);
offset("#define THREAD_CURRENT_DS ", struct task_struct, thread.current_ds);
- offset("#define THREAD_EXTRA ", struct task_struct, thread.extra);
offset("#define THREAD_CPREGS_PTR ", struct task_struct, thread.cpregs_ptr);
linefeed;
}
--- 97,102 ----
offset("#define THREAD_AREG1 ", struct task_struct, thread.areg1);
offset("#define THREAD_CURRENT_DS ", struct task_struct, thread.current_ds);
offset("#define THREAD_CPREGS_PTR ", struct task_struct, thread.cpregs_ptr);
+ offset("#define THREAD_CPEXTRA ", struct task_struct, thread.cpextra);
linefeed;
}
|
|
From: <ma...@us...> - 2003-02-07 02:03:37
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/include/asm-xtensa
Modified Files:
elf.h processor.h ptrace.h sigcontext.h user.h
Added Files:
cpextra.h
Log Message:
Implement TIE support in elf_fpregset_t for core dumps and ptrace.
The elf_fpregset_t contains coprocessor and non-coprocessor custom
state, as well as a table describing its layout for use by GDB.
Also add experimental traceback code on panic's (untested, but doesn't
break anything).
--- NEW FILE: cpextra.h ---
#ifndef _ASM_CPEXTRA_H
#define _ASM_CPEXTRA_H
/*
* include/asm-xtensa/cpextra.h
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2003 Tensilica Inc.
*/
#include <xtensa/config/core.h>
/*
* Maximum size in bytes of a contiguous collection of all
* custom state save areas (extra and coprocessor state for
* a given Xtensa processor configuration).
* Allows for all save areas to be minimally aligned
* for the CHAL save/restore sequences.
*/
#define TOTAL_CPEXTRA_SIZE \
( XCHAL_EXTRA_SA_SIZE + XCHAL_EXTRA_SA_ALIGN \
+ XCHAL_CP0_SA_SIZE + XCHAL_CP0_SA_ALIGN \
+ XCHAL_CP1_SA_SIZE + XCHAL_CP1_SA_ALIGN \
+ XCHAL_CP2_SA_SIZE + XCHAL_CP2_SA_ALIGN \
+ XCHAL_CP3_SA_SIZE + XCHAL_CP3_SA_ALIGN \
+ XCHAL_CP4_SA_SIZE + XCHAL_CP4_SA_ALIGN \
+ XCHAL_CP5_SA_SIZE + XCHAL_CP5_SA_ALIGN \
+ XCHAL_CP6_SA_SIZE + XCHAL_CP6_SA_ALIGN \
+ XCHAL_CP7_SA_SIZE + XCHAL_CP7_SA_ALIGN \
+ 16 /* for possible end-alignment padding */ \
)
#endif /* _ASM_CPEXTRA_H */
Index: elf.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/elf.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** elf.h 31 Jan 2003 04:37:19 -0000 1.4
--- elf.h 7 Feb 2003 02:03:34 -0000 1.5
***************
*** 11,17 ****
* for more details.
*
! * Copyright (C) 2001 Tensilica Inc.
! * Authors: Kevin Chea
! * Marc Gauthier
* Joe Taylor <jo...@te..., jo...@ya...>
*/
--- 11,18 ----
* for more details.
*
! * Copyright (C) 2001 - 2003 Tensilica Inc.
! * Authors: Christian Zankel <za...@te...> <ch...@za...>
! * Kevin Chea
! * Marc Gauthier <ma...@te...> <ma...@al...>
* Joe Taylor <jo...@te..., jo...@ya...>
*/
***************
*** 19,22 ****
--- 20,24 ----
#include <asm/ptrace.h>
#include <asm/page.h>
+ #include <asm/cpextra.h>
#include <xtensa/config/core.h>
***************
*** 62,79 ****
! /* TOTAL_CP_SIZE is a byte count. Round up ELF_NFPREG to the next
! * 16-byte boundary. Coprocessors are usually defined in TIE, and TIE
! * load/stores can require 16-byte alignment. However, we do not need
! * to ensure 16-byte alignment for each coprocessor's space here
! * because we do not directly load/store coprocessor state to these
! * data structures (see 'struct task_struct' definition in processor.h
! * for that). We use memcpy() to copy information over to here. */
- #define TOTAL_CP_SIZE (XCHAL_CP0_SA_SIZE + XCHAL_CP1_SA_SIZE + \
- XCHAL_CP2_SA_SIZE + XCHAL_CP3_SA_SIZE + \
- XCHAL_CP4_SA_SIZE + XCHAL_CP5_SA_SIZE + \
- XCHAL_CP6_SA_SIZE + XCHAL_CP7_SA_SIZE)
! #define ELF_NFPREG (((TOTAL_CP_SIZE + 15) & ~15) / sizeof(elf_fpreg_t))
typedef double elf_fpreg_t;
--- 64,127 ----
! /*
! * Compute the size of the coprocessor & extra state layout (register info) table
! * (see arch/xtensa/kernel/cptable.S).
! * (Actually this is the maximum size of the table, as opposed to the actual size
! * which is available from the _xtensa_reginfo_table_size global variable.)
! */
! #ifndef XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM
! # define XTENSA_CPE_LTABLE_SIZE 0 /* interim until all core.h's are updated */
! #else
! # define XTENSA_CPE_SEGMENT(num) (num ? (1+num) : 0) /* number of entries for a CP or extra */
! # define XTENSA_CPE_LTABLE_ENTRIES \
! ( XTENSA_CPE_SEGMENT(XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP0_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP1_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP2_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP3_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP4_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP5_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP6_SA_CONTENTS_LIBDB_NUM) \
! + XTENSA_CPE_SEGMENT(XCHAL_CP7_SA_CONTENTS_LIBDB_NUM) \
! + 1 /* final entry */ \
! )
! # define XTENSA_CPE_LTABLE_SIZE (XTENSA_CPE_LTABLE_ENTRIES * 8) /* in bytes */
! #endif /* defined(XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM) */
! /*
! * Instantiations of the elf_fpregset_t type contain, in most
! * architectures, the floating point (FPU) register set.
! * For Xtensa, this type is extended to contain all custom state,
! * ie. coprocessor and "extra" (non-coprocessor) state (including,
! * for example, TIE-defined states and register files; as well
! * as other optional processor state).
! * This includes FPU state if a floating-point coprocessor happens
! * to have been configured within the Xtensa processor.
! *
! * TOTAL_FPREGS_SIZE is the required size (without rounding)
! * of elf_fpregset_t. It provides space for the following:
! *
! * a) 32-bit mask of active coprocessors for this task (similar
! * to CPENABLE in single-threaded Xtensa processor systems)
! *
! * b) table describing the layout of custom states (ie. of
! * individual registers, etc) within the save areas
! *
! * c) save areas for each coprocessor and for non-coprocessor
! * ("extra") state
! *
! * Note that save areas may require up to 16-byte alignment when
! * accessed by save/restore sequences. We do not need to ensure
! * such alignment in an elf_fpregset_t structure because custom
! * state is not directly loaded/stored into it; rather, save area
! * contents are copied to elf_fpregset_t from the active save areas
! * (see 'struct task_struct' definition in processor.h for that)
! * using memcpy(). But we do allow space for such alignment,
! * to allow optimizations of layout and copying.
! */
!
! #define TOTAL_FPREGS_SIZE (4 + XTENSA_CPE_LTABLE_SIZE + TOTAL_CPEXTRA_SIZE)
! #define ELF_NFPREG ((TOTAL_FPREGS_SIZE + sizeof(elf_fpreg_t) - 1) / sizeof(elf_fpreg_t))
typedef double elf_fpreg_t;
Index: processor.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/processor.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** processor.h 2 Dec 2002 22:15:03 -0000 1.3
--- processor.h 7 Feb 2003 02:03:34 -0000 1.4
***************
*** 9,15 ****
* for more details.
*
! * Copyright (C) 2001 Tensilica Inc.
* Authors: Joe Taylor <jo...@te..., jo...@ya...>
! * Marc Gauthier
* Kevin Chea
*/
--- 9,15 ----
* for more details.
*
! * Copyright (C) 2001 - 2003 Tensilica Inc.
* Authors: Joe Taylor <jo...@te..., jo...@ya...>
! * Marc Gauthier <ma...@te...> <ma...@al...>
* Kevin Chea
*/
***************
*** 17,23 ****
/*
! * User space process size: 1 GB. Trampolining, which glibc uses for
! * nested functions, requires all code to be in the same gigabyte of
! * memory.
*/
#define TASK_SIZE 0x40000000
--- 17,27 ----
/*
! * User space process size: 1 GB.
! * Windowed call ABI requires caller and callee to
! * be located within the same 1 GB region.
! * The C compiler places trampoline code on the stack
! * for sources that take the address of a nested C function
! * (a feature used by glibc), so the 1 GB requirement
! * applies to the stack as well.
*/
#define TASK_SIZE 0x40000000
***************
*** 30,33 ****
--- 34,38 ----
#include <asm/ptrace.h>
#include <asm/kstack.h>
+ #include <asm/cpextra.h>
#include <xtensa/config/core.h>
#include <linux/threads.h>
***************
*** 64,67 ****
--- 69,73 ----
#define current_text_addr() ({ void *pc; __asm__("movi %0, 1f\n1:":"=r" (pc)); pc; })
+ #if 0 /* unused */
/*
* CPU type and hardware bug flags. Kept separately for each CPU.
***************
*** 72,75 ****
--- 78,82 ----
CPU_XTENSA_NONE
};
+ #endif /*0*/
struct xtensa_cpuinfo {
***************
*** 90,97 ****
struct thread_struct {
-
- /* -16, because we always save the user's active window to the
- kernel's exception stack frame. */
- unsigned long regfile[XCHAL_NUM_AREGS - 16];
unsigned long areg0; /* kernel's a0 (return PC + window size) for context switching */
--- 97,100 ----
***************
*** 105,113 ****
unsigned long error_code;
! /* Allocate storage for extra state and coprocessor state. */
! unsigned char extra[(XCHAL_EXTRA_SA_SIZE+15)&0xfffffff0]
! __attribute__ ((aligned(EXTRA_ALIGN)));
! unsigned cpregs_ptr[XCHAL_CP_MAX];
#if (XCHAL_CP_MASK & 1)
#define __CP0SZ ((XCHAL_CP0_SA_SIZE + sizeof(unsigned) -1) / sizeof(unsigned))
--- 108,138 ----
unsigned long error_code;
! /* -16, because we always save the user's active window to the
! kernel's exception stack frame. */
! unsigned long regfile[XCHAL_NUM_AREGS - 16];
+ /*
+ #define XTOFS(last_start,last_size,align) ((last_start+last_size+align-1) & -align)
+ #define XTENSA_CPE_EXTRA_START 0
+ #define XTENSA_CPE_CP0_START XTOFS(XTENSA_CPE_EXTRA_START, XCHAL_EXTRA_SA_SIZE, XCHAL_CP0_SA_ALIGN)
+ #define XTENSA_CPE_CP1_START XTOFS(XTENSA_CPE_CP0_START, XCHAL_CP0_SA_SIZE, XCHAL_CP1_SA_ALIGN)
+ #define XTENSA_CPE_CP2_START XTOFS(XTENSA_CPE_CP1_START, XCHAL_CP1_SA_SIZE, XCHAL_CP2_SA_ALIGN)
+ #define XTENSA_CPE_CP3_START XTOFS(XTENSA_CPE_CP2_START, XCHAL_CP2_SA_SIZE, XCHAL_CP3_SA_ALIGN)
+ #define XTENSA_CPE_CP4_START XTOFS(XTENSA_CPE_CP3_START, XCHAL_CP3_SA_SIZE, XCHAL_CP4_SA_ALIGN)
+ #define XTENSA_CPE_CP5_START XTOFS(XTENSA_CPE_CP4_START, XCHAL_CP4_SA_SIZE, XCHAL_CP5_SA_ALIGN)
+ #define XTENSA_CPE_CP6_START XTOFS(XTENSA_CPE_CP5_START, XCHAL_CP5_SA_SIZE, XCHAL_CP6_SA_ALIGN)
+ #define XTENSA_CPE_CP7_START XTOFS(XTENSA_CPE_CP6_START, XCHAL_CP6_SA_SIZE, XCHAL_CP7_SA_ALIGN)
+ #define XTENSA_CPE_SIZE XTOFS(XTENSA_CPE_CP7_START, XCHAL_CP7_SA_SIZE, 16)
+ */
+
+ unsigned char* cpregs_ptr[XCHAL_CP_MAX];
+ /* Allocate storage for extra state and coprocessor state
+ * (probably only needs XCHAL_EXTRA_SA_ALIGN alignment, but bigger alignment is safe). */
+ unsigned char cpextra[TOTAL_CPEXTRA_SIZE]
+ __attribute__ ((aligned(XCHAL_CPEXTRA_SA_ALIGN)));
+ /*unsigned char extra[(XCHAL_EXTRA_SA_SIZE+15)&0xfffffff0]
+ __attribute__ ((aligned(EXTRA_ALIGN)));*/
+
+ #if 0
#if (XCHAL_CP_MASK & 1)
#define __CP0SZ ((XCHAL_CP0_SA_SIZE + sizeof(unsigned) -1) / sizeof(unsigned))
***************
*** 142,146 ****
unsigned cp7_regs[__CP7SZ] __attribute__ ((aligned(16)));
#endif
!
};
--- 167,172 ----
unsigned cp7_regs[__CP7SZ] __attribute__ ((aligned(16)));
#endif
! #endif /*0*/
!
};
Index: ptrace.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/ptrace.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ptrace.h 30 Jan 2003 23:55:27 -0000 1.7
--- ptrace.h 7 Feb 2003 02:03:34 -0000 1.8
***************
*** 11,15 ****
* Copyright (C) 2001 Tensilica Inc.
* Authors: Joe Taylor <jo...@te..., jo...@ya...>
! * Marc Gauthier
* Kevin Chea
*/
--- 11,15 ----
* Copyright (C) 2001 Tensilica Inc.
* Authors: Joe Taylor <jo...@te..., jo...@ya...>
! * Marc Gauthier <ma...@te...> <ma...@al...>
* Kevin Chea
*/
***************
*** 111,114 ****
--- 111,115 ----
#define PTRACE_GETFPREGS 14
#define PTRACE_SETFPREGS 15
+ #define PTRACE_GETFPREGSIZE 18
#ifndef __ASSEMBLY__
Index: sigcontext.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/sigcontext.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sigcontext.h 28 Aug 2002 16:11:31 -0000 1.1.1.1
--- sigcontext.h 7 Feb 2003 02:03:34 -0000 1.2
***************
*** 10,14 ****
*
* Copyright (C) 2001 Tensilica Inc.
! * Authors: Kevin Chea, Chris Songer, Marc Gauthier
*/
--- 10,15 ----
*
* Copyright (C) 2001 Tensilica Inc.
! * Authors: Kevin Chea, Chris Songer,
! * Marc Gauthier <ma...@te...> <ma...@al...>
*/
Index: user.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/user.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** user.h 28 Aug 2002 16:11:31 -0000 1.1.1.1
--- user.h 7 Feb 2003 02:03:34 -0000 1.2
***************
*** 13,17 ****
* Derived from SH.
*
! * Copyright (C) 2001 Tensilica Inc.
*/
--- 13,17 ----
* Derived from SH.
*
! * Copyright (C) 2001 - 2003 Tensilica Inc.
*/
***************
*** 21,24 ****
--- 21,25 ----
#include <asm/elf.h>
+ #if 0 /* not used for Xtensa? */
/*
* Core file format: The core file is written in such a way that gdb
***************
*** 44,56 ****
*/
- struct user_cp {
- elf_fpregset_t regs;
- };
-
- /* Note that u_fpvalid is true for any coprocessor being used, not just an fpu. */
struct user {
struct pt_regs regs; /* entire machine state */
! struct user_cp cps; /* co-processor registers */
! int u_fpvalid; /* True if co-processor(s) being used */
size_t u_tsize; /* text size (pages) */
size_t u_dsize; /* data size (pages) */
--- 45,52 ----
*/
struct user {
struct pt_regs regs; /* entire machine state */
! elf_fpregset_t cpregs; /* coprocessor & extra registers */
! unsigned u_cpevalid; /* non-zero if any coprocessor(s) or extra state used */
size_t u_tsize; /* text size (pages) */
size_t u_dsize; /* data size (pages) */
***************
*** 70,73 ****
--- 66,72 ----
#define HOST_DATA_START_ADDR (u.start_data)
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+ #endif /*0*/
+
#endif /* __ASM_XTENSA_USER_H */
|
|
From: <ma...@us...> - 2003-02-07 02:03:37
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_le
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/include/asm-xtensa/xtensa/config-linux_le
Modified Files:
core.h
Log Message:
Implement TIE support in elf_fpregset_t for core dumps and ptrace.
The elf_fpregset_t contains coprocessor and non-coprocessor custom
state, as well as a table describing its layout for use by GDB.
Also add experimental traceback code on panic's (untested, but doesn't
break anything).
Index: core.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_le/core.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** core.h 28 Nov 2002 00:40:50 -0000 1.2
--- core.h 7 Feb 2003 02:03:34 -0000 1.3
***************
*** 11,15 ****
/*
! * Customer ID=40; Build=10966; Copyright (c) 2002 by Tensilica Inc. ALL RIGHTS RESERVED.
* These coded instructions, statements, and computer programs are the
* copyrighted works and confidential proprietary information of Tensilica Inc.
--- 11,15 ----
/*
! * Copyright (c) 2002 by Tensilica Inc. ALL RIGHTS RESERVED.
* These coded instructions, statements, and computer programs are the
* copyrighted works and confidential proprietary information of Tensilica Inc.
***************
*** 67,77 ****
----------------------------------------------------------------------*/
- /* XTFIXME: I disabled XCHAL_UNALIGNED_LOAD_EXCEPTION by adding an
- _XTFIXME suffix until I update all linux_be/linux_le configs to have
- unaligned exceptions. Do enable in software, simply remove the
- suffix. */
-
/* These apply to a selected set of core load and store instructions only (see ISA): */
! #define XCHAL_UNALIGNED_LOAD_EXCEPTION_XTFIXME 1 /* 1 if unaligned loads cause an exception, 0 otherwise */
#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* 1 if unaligned stores cause an exception, 0 otherwise */
--- 67,72 ----
----------------------------------------------------------------------*/
/* These apply to a selected set of core load and store instructions only (see ISA): */
! #define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* 1 if unaligned loads cause an exception, 0 otherwise */
#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* 1 if unaligned stores cause an exception, 0 otherwise */
***************
*** 82,90 ****
#define XCHAL_HAVE_INTERRUPTS 1 /* 1 if interrupt option configured, 0 otherwise */
! #define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS 1 /* 1 if high-level interrupt option configured, 0 otherwise */
#define XCHAL_HAVE_NMI 0 /* 1 if NMI option configured, 0 otherwise */
#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
#define XCHAL_NUM_EXTINTERRUPTS 10 /* number of external interrupts */
#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels (not including level zero!) */
/* Masks of interrupts at each interrupt level: */
--- 77,94 ----
#define XCHAL_HAVE_INTERRUPTS 1 /* 1 if interrupt option configured, 0 otherwise */
! #define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* 1 if high-priority interrupt option configured, 0 otherwise */
! #define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS XCHAL_HAVE_HIGHPRI_INTERRUPTS
#define XCHAL_HAVE_NMI 0 /* 1 if NMI option configured, 0 otherwise */
#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
+ #define XCHAL_NUM_INTERRUPTS_LOG2 5 /* number of bits to hold an interrupt number: roundup(log2(number of interrupts)) */
#define XCHAL_NUM_EXTINTERRUPTS 10 /* number of external interrupts */
#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels (not including level zero!) */
+ #define XCHAL_NUM_LOWPRI_LEVELS 1 /* number of low-priority interrupt levels (always 1) */
+ #define XCHAL_FIRST_HIGHPRI_LEVEL (XCHAL_NUM_LOWPRI_LEVELS+1) /* level of first high-priority interrupt (always 2) */
+ #define XCHAL_EXCM_LEVEL 1 /* level of interrupts masked by PS.EXCM (XEA2 only; always 1 in T10xx);
+ for XEA1, where there is no PS.EXCM, this is always 1;
+ interrupts at levels FIRST_HIGHPRI <= n <= EXCM_LEVEL, if any,
+ are termed "medium priority" interrupts (post T10xx only) */
+ /* Note: 1 <= LOWPRI_LEVELS <= EXCM_LEVEL < DEBUGLEVEL <= NUM_INTLEVELS < NMILEVEL <= 15 */
/* Masks of interrupts at each interrupt level: */
***************
*** 140,143 ****
--- 144,149 ----
#define XCHAL_INTLEVEL14_ANDBELOW_MASK 0x0001FFFF
#define XCHAL_INTLEVEL15_ANDBELOW_MASK 0x0001FFFF
+ #define XCHAL_LOWPRI_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all low-priority interrupts */
+ #define XCHAL_EXCM_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all interrupts masked by PS.EXCM (or CEXCM) */
/* As an array of entries (eg. for C constant arrays): */
#define XCHAL_INTLEVEL_ANDBELOW_MASKS 0x00000000 XCHAL_SEP \
***************
*** 158,161 ****
--- 164,172 ----
0x0001FFFF
+ /* Interrupt numbers for each interrupt level at which only one interrupt was configured: */
+ /*#define XCHAL_INTLEVEL1_NUM ...more than one interrupt at this level...*/
+ /*#define XCHAL_INTLEVEL2_NUM ...more than one interrupt at this level...*/
+ /*#define XCHAL_INTLEVEL3_NUM ...more than one interrupt at this level...*/
+
/* Level of each interrupt: */
#define XCHAL_INT0_LEVEL 1
***************
*** 332,336 ****
! /* External interrupt vectors/levels: */
/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
--- 343,354 ----
! /*
! * External interrupt vectors/levels.
! * These macros describe how Xtensa processor interrupt numbers
! * (as numbered internally, eg. in INTERRUPT and INTENABLE registers)
! * map to external BInterrupt<n> pins, for those interrupts
! * configured as external (level-triggered, edge-triggered, or NMI).
! * See the Xtensa processor databook for more details.
! */
/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
***************
*** 395,399 ****
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNERL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
--- 413,417 ----
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
***************
*** 427,431 ****
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_LOAD_STORE_ALIGNMENT 9 /* Load or Store to Unaligned Address (LoadStoreAlignment) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
--- 445,449 ----
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store (Unaligned) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
***************
*** 592,595 ****
--- 610,655 ----
+ /*
+ * Contents of save areas in terms of libdb register numbers.
+ * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file;
+ * it is up to the user of this header file to define these macros
+ * usefully before each expansion of the CONTENTS_LIBDB macros.
+ * (Fields rsv[123] are reserved for future additions; they are currently
+ * set to zero but may be set to some useful values in the future.)
+ *
+ * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3)
+ */
+
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */
+
+
+
/*----------------------------------------------------------------------
INTERNAL I/D RAM/ROMs and XLMI
***************
*** 816,831 ****
(CoreID) set in the Xtensa Processor Generator */
! #define XCHAL_BUILD_UNIQUE_ID 0x00002AD6 /* software build-unique ID (22-bit) */
/* These definitions describe the hardware targeted by this software: */
#define XCHAL_HW_CONFIGID0 0xC10FD3FE /* config ID reg 0 value (upper 32 of 64 bits) */
! #define XCHAL_HW_CONFIGID1 0x00402AD6 /* config ID reg 1 value (lower 32 of 64 bits) */
#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
! #define XCHAL_HW_RELEASE_MINOR 0 /* minor release of targeted hardware */
! #define XCHAL_HW_RELEASE_NAME "T1050.0" /* full release name of targeted hardware */
#define XTHAL_HW_REL_T1050 1
! #define XTHAL_HW_REL_T1050_0 1
#define XCHAL_HW_CONFIGID_RELIABLE 1
--- 876,891 ----
(CoreID) set in the Xtensa Processor Generator */
! #define XCHAL_BUILD_UNIQUE_ID 0x000066FD /* software build-unique ID (22-bit) */
/* These definitions describe the hardware targeted by this software: */
#define XCHAL_HW_CONFIGID0 0xC10FD3FE /* config ID reg 0 value (upper 32 of 64 bits) */
! #define XCHAL_HW_CONFIGID1 0x008066FD /* config ID reg 1 value (lower 32 of 64 bits) */
#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
! #define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */
! #define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */
#define XTHAL_HW_REL_T1050 1
! #define XTHAL_HW_REL_T1050_1 1
#define XCHAL_HW_CONFIGID_RELIABLE 1
***************
*** 977,980 ****
--- 1037,1079 ----
/* Belongs in xtensa/hal.h: */
#define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */
+
+
+ /*
+ * Because information as to exactly which hardware release is targeted
+ * by a given software build is not always available, compile-time HAL
+ * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE):
+ */
+ #ifndef XCHAL_HW_RELEASE_MAJOR
+ # define XCHAL_HW_CONFIGID_RELIABLE 0
+ #endif
+ #if XCHAL_HW_CONFIGID_RELIABLE
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_RELEASE_MAJOR == (major)) ? 1 : 0)
+ #else
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \
+ : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \
+ : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \
+ ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0)
+ #endif
+
+ /*
+ * Specific errata:
+ */
+
+ /*
+ * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1;
+ * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled):
+ */
+ #define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \
+ (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \
+ || XCHAL_HW_RELEASE_AT(1050,0)))
+
|
|
From: <ma...@us...> - 2003-02-07 02:03:37
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_test
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/include/asm-xtensa/xtensa/config-linux_test
Modified Files:
core.h
Log Message:
Implement TIE support in elf_fpregset_t for core dumps and ptrace.
The elf_fpregset_t contains coprocessor and non-coprocessor custom
state, as well as a table describing its layout for use by GDB.
Also add experimental traceback code on panic's (untested, but doesn't
break anything).
Index: core.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_test/core.h,v
retrieving revision 1.3
retrieving revision 1.5
diff -C2 -d -r1.3 -r1.5
*** core.h 17 Jan 2003 18:17:48 -0000 1.3
--- core.h 7 Feb 2003 02:03:35 -0000 1.5
***************
*** 11,15 ****
/*
! * Customer ID=40; Build=25579; Copyright (c) 2002 by Tensilica Inc. ALL RIGHTS RESERVED.
* These coded instructions, statements, and computer programs are the
* copyrighted works and confidential proprietary information of Tensilica Inc.
--- 11,15 ----
/*
! * Copyright (c) 2002 by Tensilica Inc. ALL RIGHTS RESERVED.
* These coded instructions, statements, and computer programs are the
* copyrighted works and confidential proprietary information of Tensilica Inc.
***************
*** 420,424 ****
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNERL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
--- 420,424 ----
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
***************
*** 460,464 ****
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_LOAD_STORE_ALIGNMENT 9 /* Load or Store to Unaligned Address (LoadStoreAlignment) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
--- 460,464 ----
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store (Unaligned) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
***************
*** 1008,1011 ****
--- 1008,1135 ----
+ /*
+ * Contents of save areas in terms of libdb register numbers.
+ * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file;
+ * it is up to the user of this header file to define these macros
+ * usefully before each expansion of the CONTENTS_LIBDB macros.
+ * (Fields rsv[123] are reserved for future additions; they are currently
+ * set to zero but may be set to some useful values in the future.)
+ *
+ * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3)
+ */
+
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 7
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_SREG(0x08000010, 0, 4, 4, 0, "ACCLO", 16, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000011, 4, 4, 4, 0, "ACCHI", 17, 0x000000FF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000020, 8, 4, 4, 0, "MR0", 32, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000021, 12, 4, 4, 0, "MR1", 33, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000022, 16, 4, 4, 0, "MR2", 34, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000023, 20, 4, 4, 0, "MR3", 35, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000004, 24, 4, 4, 0, "BR", 4, 0x0000FFFF, 0,0) \
+ /* end */
+
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 18
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C0000E8, 0, 4, 4, 0, "FCR", 232, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_UREG(0x0C0000E9, 4, 4, 4, 0, "FSR", 233, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030000, 8, 4, 4, 0, "f0", 0, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030001, 12, 4, 4, 0, "f1", 1, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030002, 16, 4, 4, 0, "f2", 2, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030003, 20, 4, 4, 0, "f3", 3, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030004, 24, 4, 4, 0, "f4", 4, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030005, 28, 4, 4, 0, "f5", 5, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030006, 32, 4, 4, 0, "f6", 6, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030007, 36, 4, 4, 0, "f7", 7, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030008, 40, 4, 4, 0, "f8", 8, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030009, 44, 4, 4, 0, "f9", 9, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000A, 48, 4, 4, 0, "f10", 10, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000B, 52, 4, 4, 0, "f11", 11, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000C, 56, 4, 4, 0, "f12", 12, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000D, 60, 4, 4, 0, "f13", 13, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000E, 64, 4, 4, 0, "f14", 14, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000F, 68, 4, 4, 0, "f15", 15, 16, 4, "f", "FR", 0,0) \
+ /* end */
+
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 17
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C000001, 0, 4, 4, 0, "UR1", 1, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050000, 4, 4, 4, 0, "i320", 0, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050001, 8, 4, 4, 0, "i321", 1, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050002, 12, 4, 4, 0, "i322", 2, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050003, 16, 4, 4, 0, "i323", 3, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050004, 20, 4, 4, 0, "i324", 4, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050005, 24, 4, 4, 0, "i325", 5, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050006, 28, 4, 4, 0, "i326", 6, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050007, 32, 4, 4, 0, "i327", 7, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050008, 36, 4, 4, 0, "i328", 8, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050009, 40, 4, 4, 0, "i329", 9, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000A, 44, 4, 4, 0, "i3210", 10, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000B, 48, 4, 4, 0, "i3211", 11, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000C, 52, 4, 4, 0, "i3212", 12, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000D, 56, 4, 4, 0, "i3213", 13, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000E, 60, 4, 4, 0, "i3214", 14, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000F, 64, 4, 4, 0, "i3215", 15, 16, 4, "i32", "i32", 0,0) \
+ /* end */
+
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 18
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C000002, 0, 4, 4, 0, "S64HI", 2, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_UREG(0x0C000003, 4, 4, 4, 0, "S64LO", 3, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040000, 8, 8, 8, 0, "i640", 0, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040001, 16, 8, 8, 0, "i641", 1, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040002, 24, 8, 8, 0, "i642", 2, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040003, 32, 8, 8, 0, "i643", 3, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040004, 40, 8, 8, 0, "i644", 4, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040005, 48, 8, 8, 0, "i645", 5, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040006, 56, 8, 8, 0, "i646", 6, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040007, 64, 8, 8, 0, "i647", 7, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040008, 72, 8, 8, 0, "i648", 8, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040009, 80, 8, 8, 0, "i649", 9, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000A, 88, 8, 8, 0, "i6410", 10, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000B, 96, 8, 8, 0, "i6411", 11, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000C, 104, 8, 8, 0, "i6412", 12, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000D, 112, 8, 8, 0, "i6413", 13, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000E, 120, 8, 8, 0, "i6414", 14, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000F, 128, 8, 8, 0, "i6415", 15, 16, 8, "i64", "i64", 0,0) \
+ /* end */
+
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 17
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C000000, 0, 4, 4, 0, "UR0", 0, 0x0000FFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060000, 4, 2, 2, 0, "i160", 0, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060001, 6, 2, 2, 0, "i161", 1, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060002, 8, 2, 2, 0, "i162", 2, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060003, 10, 2, 2, 0, "i163", 3, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060004, 12, 2, 2, 0, "i164", 4, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060005, 14, 2, 2, 0, "i165", 5, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060006, 16, 2, 2, 0, "i166", 6, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060007, 18, 2, 2, 0, "i167", 7, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060008, 20, 2, 2, 0, "i168", 8, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060009, 22, 2, 2, 0, "i169", 9, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000A, 24, 2, 2, 0, "i1610", 10, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000B, 26, 2, 2, 0, "i1611", 11, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000C, 28, 2, 2, 0, "i1612", 12, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000D, 30, 2, 2, 0, "i1613", 13, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000E, 32, 2, 2, 0, "i1614", 14, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000F, 34, 2, 2, 0, "i1615", 15, 16, 2, "i16", "i16", 0,0) \
+ /* end */
+
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */
+
+
+
/*----------------------------------------------------------------------
INTERNAL I/D RAM/ROMs and XLMI
***************
*** 1393,1396 ****
--- 1517,1559 ----
/* Belongs in xtensa/hal.h: */
#define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */
+
+
+ /*
+ * Because information as to exactly which hardware release is targeted
+ * by a given software build is not always available, compile-time HAL
+ * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE):
+ */
+ #ifndef XCHAL_HW_RELEASE_MAJOR
+ # define XCHAL_HW_CONFIGID_RELIABLE 0
+ #endif
+ #if XCHAL_HW_CONFIGID_RELIABLE
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_RELEASE_MAJOR == (major)) ? 1 : 0)
+ #else
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \
+ : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \
+ : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \
+ ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0)
+ #endif
+
+ /*
+ * Specific errata:
+ */
+
+ /*
+ * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1;
+ * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled):
+ */
+ #define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \
+ (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \
+ || XCHAL_HW_RELEASE_AT(1050,0)))
+
|
|
From: <ma...@us...> - 2003-02-07 02:03:37
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_be
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/include/asm-xtensa/xtensa/config-linux_be
Modified Files:
core.h
Log Message:
Implement TIE support in elf_fpregset_t for core dumps and ptrace.
The elf_fpregset_t contains coprocessor and non-coprocessor custom
state, as well as a table describing its layout for use by GDB.
Also add experimental traceback code on panic's (untested, but doesn't
break anything).
Index: core.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_be/core.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** core.h 28 Nov 2002 00:40:49 -0000 1.2
--- core.h 7 Feb 2003 02:03:34 -0000 1.3
***************
*** 1,5 ****
- #ifndef XTENSA_CONFIG_CORE_H
- #define XTENSA_CONFIG_CORE_H
-
/*
* THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
--- 1,2 ----
***************
*** 21,27 ****
* for more details.
*
! * Copyright (C) 2002 Tensilica Inc.
*/
#include <xtensa/hal.h>
--- 18,26 ----
* for more details.
*
! * Copyright (C) 1999 - 2003 Tensilica Inc.
*/
+ #ifndef XTENSA_CONFIG_CORE_H
+ #define XTENSA_CONFIG_CORE_H
#include <xtensa/hal.h>
***************
*** 69,79 ****
----------------------------------------------------------------------*/
- /* XTFIXME: I disabled XCHAL_UNALIGNED_LOAD_EXCEPTION by adding an
- _XTFIXME suffix until I update all linux_be/linux_le configs to have
- unaligned exceptions. Do enable in software, simply remove the
- suffix. */
-
/* These apply to a selected set of core load and store instructions only (see ISA): */
! #define XCHAL_UNALIGNED_LOAD_EXCEPTION_XTFIXME 1 /* 1 if unaligned loads cause an exception, 0 otherwise */
#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* 1 if unaligned stores cause an exception, 0 otherwise */
--- 68,73 ----
----------------------------------------------------------------------*/
/* These apply to a selected set of core load and store instructions only (see ISA): */
! #define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* 1 if unaligned loads cause an exception, 0 otherwise */
#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* 1 if unaligned stores cause an exception, 0 otherwise */
***************
*** 84,92 ****
#define XCHAL_HAVE_INTERRUPTS 1 /* 1 if interrupt option configured, 0 otherwise */
! #define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS 1 /* 1 if high-level interrupt option configured, 0 otherwise */
#define XCHAL_HAVE_NMI 0 /* 1 if NMI option configured, 0 otherwise */
#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
#define XCHAL_NUM_EXTINTERRUPTS 10 /* number of external interrupts */
#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels (not including level zero!) */
/* Masks of interrupts at each interrupt level: */
--- 78,95 ----
#define XCHAL_HAVE_INTERRUPTS 1 /* 1 if interrupt option configured, 0 otherwise */
! #define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* 1 if high-priority interrupt option configured, 0 otherwise */
! #define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS XCHAL_HAVE_HIGHPRI_INTERRUPTS
#define XCHAL_HAVE_NMI 0 /* 1 if NMI option configured, 0 otherwise */
#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
+ #define XCHAL_NUM_INTERRUPTS_LOG2 5 /* number of bits to hold an interrupt number: roundup(log2(number of interrupts)) */
#define XCHAL_NUM_EXTINTERRUPTS 10 /* number of external interrupts */
#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels (not including level zero!) */
+ #define XCHAL_NUM_LOWPRI_LEVELS 1 /* number of low-priority interrupt levels (always 1) */
+ #define XCHAL_FIRST_HIGHPRI_LEVEL (XCHAL_NUM_LOWPRI_LEVELS+1) /* level of first high-priority interrupt (always 2) */
+ #define XCHAL_EXCM_LEVEL 1 /* level of interrupts masked by PS.EXCM (XEA2 only; always 1 in T10xx);
+ for XEA1, where there is no PS.EXCM, this is always 1;
+ interrupts at levels FIRST_HIGHPRI <= n <= EXCM_LEVEL, if any,
+ are termed "medium priority" interrupts (post T10xx only) */
+ /* Note: 1 <= LOWPRI_LEVELS <= EXCM_LEVEL < DEBUGLEVEL <= NUM_INTLEVELS < NMILEVEL <= 15 */
/* Masks of interrupts at each interrupt level: */
***************
*** 142,145 ****
--- 145,150 ----
#define XCHAL_INTLEVEL14_ANDBELOW_MASK 0x0001FFFF
#define XCHAL_INTLEVEL15_ANDBELOW_MASK 0x0001FFFF
+ #define XCHAL_LOWPRI_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all low-priority interrupts */
+ #define XCHAL_EXCM_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all interrupts masked by PS.EXCM (or CEXCM) */
/* As an array of entries (eg. for C constant arrays): */
#define XCHAL_INTLEVEL_ANDBELOW_MASKS 0x00000000 XCHAL_SEP \
***************
*** 160,163 ****
--- 165,173 ----
0x0001FFFF
+ /* Interrupt numbers for each interrupt level at which only one interrupt was configured: */
+ /*#define XCHAL_INTLEVEL1_NUM ...more than one interrupt at this level...*/
+ /*#define XCHAL_INTLEVEL2_NUM ...more than one interrupt at this level...*/
+ /*#define XCHAL_INTLEVEL3_NUM ...more than one interrupt at this level...*/
+
/* Level of each interrupt: */
#define XCHAL_INT0_LEVEL 1
***************
*** 334,338 ****
! /* External interrupt vectors/levels: */
/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
--- 344,355 ----
! /*
! * External interrupt vectors/levels.
! * These macros describe how Xtensa processor interrupt numbers
! * (as numbered internally, eg. in INTERRUPT and INTENABLE registers)
! * map to external BInterrupt<n> pins, for those interrupts
! * configured as external (level-triggered, edge-triggered, or NMI).
! * See the Xtensa processor databook for more details.
! */
/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
***************
*** 397,401 ****
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNERL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
--- 414,418 ----
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
***************
*** 429,433 ****
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_LOAD_STORE_ALIGNMENT 9 /* Load or Store to Unaligned Address (LoadStoreAlignment) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
--- 446,450 ----
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store (Unaligned) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
***************
*** 594,597 ****
--- 611,656 ----
+ /*
+ * Contents of save areas in terms of libdb register numbers.
+ * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file;
+ * it is up to the user of this header file to define these macros
+ * usefully before each expansion of the CONTENTS_LIBDB macros.
+ * (Fields rsv[123] are reserved for future additions; they are currently
+ * set to zero but may be set to some useful values in the future.)
+ *
+ * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3)
+ */
+
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */
+
+
+
/*----------------------------------------------------------------------
INTERNAL I/D RAM/ROMs and XLMI
***************
*** 818,833 ****
(CoreID) set in the Xtensa Processor Generator */
! #define XCHAL_BUILD_UNIQUE_ID 0x00002AD3 /* software build-unique ID (22-bit) */
/* These definitions describe the hardware targeted by this software: */
#define XCHAL_HW_CONFIGID0 0xC10FD3FF /* config ID reg 0 value (upper 32 of 64 bits) */
! #define XCHAL_HW_CONFIGID1 0x00402AD3 /* config ID reg 1 value (lower 32 of 64 bits) */
#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
! #define XCHAL_HW_RELEASE_MINOR 0 /* minor release of targeted hardware */
! #define XCHAL_HW_RELEASE_NAME "T1050.0" /* full release name of targeted hardware */
#define XTHAL_HW_REL_T1050 1
! #define XTHAL_HW_REL_T1050_0 1
#define XCHAL_HW_CONFIGID_RELIABLE 1
--- 877,892 ----
(CoreID) set in the Xtensa Processor Generator */
! #define XCHAL_BUILD_UNIQUE_ID 0x00006700 /* software build-unique ID (22-bit) */
/* These definitions describe the hardware targeted by this software: */
#define XCHAL_HW_CONFIGID0 0xC10FD3FF /* config ID reg 0 value (upper 32 of 64 bits) */
! #define XCHAL_HW_CONFIGID1 0x00806700 /* config ID reg 1 value (lower 32 of 64 bits) */
#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
! #define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */
! #define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */
#define XTHAL_HW_REL_T1050 1
! #define XTHAL_HW_REL_T1050_1 1
#define XCHAL_HW_CONFIGID_RELIABLE 1
***************
*** 979,982 ****
--- 1038,1080 ----
/* Belongs in xtensa/hal.h: */
#define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */
+
+
+ /*
+ * Because information as to exactly which hardware release is targeted
+ * by a given software build is not always available, compile-time HAL
+ * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE):
+ */
+ #ifndef XCHAL_HW_RELEASE_MAJOR
+ # define XCHAL_HW_CONFIGID_RELIABLE 0
+ #endif
+ #if XCHAL_HW_CONFIGID_RELIABLE
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_RELEASE_MAJOR == (major)) ? 1 : 0)
+ #else
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \
+ : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \
+ : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \
+ ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0)
+ #endif
+
+ /*
+ * Specific errata:
+ */
+
+ /*
+ * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1;
+ * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled):
+ */
+ #define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \
+ (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \
+ || XCHAL_HW_RELEASE_AT(1050,0)))
+
|
|
From: <ma...@us...> - 2003-02-07 02:03:37
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_test
In directory sc8-pr-cvs1:/tmp/cvs-serv27017/include/asm-xtensa/xtensa/config
Modified Files:
core.h
Log Message:
Implement TIE support in elf_fpregset_t for core dumps and ptrace.
The elf_fpregset_t contains coprocessor and non-coprocessor custom
state, as well as a table describing its layout for use by GDB.
Also add experimental traceback code on panic's (untested, but doesn't
break anything).
Index: core.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/xtensa/config-linux_test/core.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** core.h 17 Jan 2003 18:17:48 -0000 1.3
--- core.h 7 Feb 2003 02:03:34 -0000 1.4
***************
*** 11,15 ****
/*
! * Customer ID=40; Build=25579; Copyright (c) 2002 by Tensilica Inc. ALL RIGHTS RESERVED.
* These coded instructions, statements, and computer programs are the
* copyrighted works and confidential proprietary information of Tensilica Inc.
--- 11,15 ----
/*
! * Copyright (c) 2002 by Tensilica Inc. ALL RIGHTS RESERVED.
* These coded instructions, statements, and computer programs are the
* copyrighted works and confidential proprietary information of Tensilica Inc.
***************
*** 420,424 ****
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNERL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
--- 420,424 ----
#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
! #define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
***************
*** 460,464 ****
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_LOAD_STORE_ALIGNMENT 9 /* Load or Store to Unaligned Address (LoadStoreAlignment) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
--- 460,464 ----
#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
! #define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store (Unaligned) */
#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
***************
*** 1008,1011 ****
--- 1008,1135 ----
+ /*
+ * Contents of save areas in terms of libdb register numbers.
+ * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file;
+ * it is up to the user of this header file to define these macros
+ * usefully before each expansion of the CONTENTS_LIBDB macros.
+ * (Fields rsv[123] are reserved for future additions; they are currently
+ * set to zero but may be set to some useful values in the future.)
+ *
+ * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
+ * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3)
+ */
+
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 7
+ #define XCHAL_EXTRA_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_SREG(0x08000010, 0, 4, 4, 0, "ACCLO", 16, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000011, 4, 4, 4, 0, "ACCHI", 17, 0x000000FF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000020, 8, 4, 4, 0, "MR0", 32, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000021, 12, 4, 4, 0, "MR1", 33, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000022, 16, 4, 4, 0, "MR2", 34, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000023, 20, 4, 4, 0, "MR3", 35, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_SREG(0x08000004, 24, 4, 4, 0, "BR", 4, 0x0000FFFF, 0,0) \
+ /* end */
+
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 18
+ #define XCHAL_CP0_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C0000E8, 0, 4, 4, 0, "FCR", 232, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_UREG(0x0C0000E9, 4, 4, 4, 0, "FSR", 233, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030000, 8, 4, 4, 0, "f0", 0, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030001, 12, 4, 4, 0, "f1", 1, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030002, 16, 4, 4, 0, "f2", 2, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030003, 20, 4, 4, 0, "f3", 3, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030004, 24, 4, 4, 0, "f4", 4, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030005, 28, 4, 4, 0, "f5", 5, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030006, 32, 4, 4, 0, "f6", 6, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030007, 36, 4, 4, 0, "f7", 7, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030008, 40, 4, 4, 0, "f8", 8, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10030009, 44, 4, 4, 0, "f9", 9, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000A, 48, 4, 4, 0, "f10", 10, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000B, 52, 4, 4, 0, "f11", 11, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000C, 56, 4, 4, 0, "f12", 12, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000D, 60, 4, 4, 0, "f13", 13, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000E, 64, 4, 4, 0, "f14", 14, 16, 4, "f", "FR", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1003000F, 68, 4, 4, 0, "f15", 15, 16, 4, "f", "FR", 0,0) \
+ /* end */
+
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 17
+ #define XCHAL_CP2_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C000001, 0, 4, 4, 0, "UR1", 1, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050000, 4, 4, 4, 0, "i320", 0, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050001, 8, 4, 4, 0, "i321", 1, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050002, 12, 4, 4, 0, "i322", 2, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050003, 16, 4, 4, 0, "i323", 3, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050004, 20, 4, 4, 0, "i324", 4, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050005, 24, 4, 4, 0, "i325", 5, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050006, 28, 4, 4, 0, "i326", 6, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050007, 32, 4, 4, 0, "i327", 7, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050008, 36, 4, 4, 0, "i328", 8, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10050009, 40, 4, 4, 0, "i329", 9, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000A, 44, 4, 4, 0, "i3210", 10, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000B, 48, 4, 4, 0, "i3211", 11, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000C, 52, 4, 4, 0, "i3212", 12, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000D, 56, 4, 4, 0, "i3213", 13, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000E, 60, 4, 4, 0, "i3214", 14, 16, 4, "i32", "i32", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1005000F, 64, 4, 4, 0, "i3215", 15, 16, 4, "i32", "i32", 0,0) \
+ /* end */
+
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */
+
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 18
+ #define XCHAL_CP5_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C000002, 0, 4, 4, 0, "S64HI", 2, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_UREG(0x0C000003, 4, 4, 4, 0, "S64LO", 3, 0xFFFFFFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040000, 8, 8, 8, 0, "i640", 0, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040001, 16, 8, 8, 0, "i641", 1, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040002, 24, 8, 8, 0, "i642", 2, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040003, 32, 8, 8, 0, "i643", 3, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040004, 40, 8, 8, 0, "i644", 4, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040005, 48, 8, 8, 0, "i645", 5, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040006, 56, 8, 8, 0, "i646", 6, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040007, 64, 8, 8, 0, "i647", 7, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040008, 72, 8, 8, 0, "i648", 8, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10040009, 80, 8, 8, 0, "i649", 9, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000A, 88, 8, 8, 0, "i6410", 10, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000B, 96, 8, 8, 0, "i6411", 11, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000C, 104, 8, 8, 0, "i6412", 12, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000D, 112, 8, 8, 0, "i6413", 13, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000E, 120, 8, 8, 0, "i6414", 14, 16, 8, "i64", "i64", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1004000F, 128, 8, 8, 0, "i6415", 15, 16, 8, "i64", "i64", 0,0) \
+ /* end */
+
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 17
+ #define XCHAL_CP6_SA_CONTENTS_LIBDB \
+ CONTENTS_LIBDB_UREG(0x0C000000, 0, 4, 4, 0, "UR0", 0, 0x0000FFFF, 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060000, 4, 2, 2, 0, "i160", 0, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060001, 6, 2, 2, 0, "i161", 1, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060002, 8, 2, 2, 0, "i162", 2, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060003, 10, 2, 2, 0, "i163", 3, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060004, 12, 2, 2, 0, "i164", 4, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060005, 14, 2, 2, 0, "i165", 5, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060006, 16, 2, 2, 0, "i166", 6, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060007, 18, 2, 2, 0, "i167", 7, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060008, 20, 2, 2, 0, "i168", 8, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x10060009, 22, 2, 2, 0, "i169", 9, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000A, 24, 2, 2, 0, "i1610", 10, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000B, 26, 2, 2, 0, "i1611", 11, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000C, 28, 2, 2, 0, "i1612", 12, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000D, 30, 2, 2, 0, "i1613", 13, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000E, 32, 2, 2, 0, "i1614", 14, 16, 2, "i16", "i16", 0,0) \
+ CONTENTS_LIBDB_REGF(0x1006000F, 34, 2, 2, 0, "i1615", 15, 16, 2, "i16", "i16", 0,0) \
+ /* end */
+
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0
+ #define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */
+
+
+
/*----------------------------------------------------------------------
INTERNAL I/D RAM/ROMs and XLMI
***************
*** 1393,1396 ****
--- 1517,1559 ----
/* Belongs in xtensa/hal.h: */
#define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */
+
+
+ /*
+ * Because information as to exactly which hardware release is targeted
+ * by a given software build is not always available, compile-time HAL
+ * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE):
+ */
+ #ifndef XCHAL_HW_RELEASE_MAJOR
+ # define XCHAL_HW_CONFIGID_RELIABLE 0
+ #endif
+ #if XCHAL_HW_CONFIGID_RELIABLE
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_RELEASE_MAJOR == (major)) ? 1 : 0)
+ #else
+ # define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \
+ : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \
+ : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \
+ : XTHAL_MAYBE )
+ # define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \
+ ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE)
+ # define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0)
+ #endif
+
+ /*
+ * Specific errata:
+ */
+
+ /*
+ * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1;
+ * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled):
+ */
+ #define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \
+ (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \
+ || XCHAL_HW_RELEASE_AT(1050,0)))
+
|
|
From: <ma...@us...> - 2003-02-07 01:49:11
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm
In directory sc8-pr-cvs1:/tmp/cvs-serv18839
Modified Files:
cache.c
Log Message:
Fix flush_cache_page when called for vma's other than current one.
Also proactively attempt to fix flush_icache_range in a similar manner.
Index: cache.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/cache.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** cache.c 29 Jan 2003 02:27:59 -0000 1.3
--- cache.c 7 Feb 2003 01:49:06 -0000 1.4
***************
*** 93,105 ****
}
void flush_cache_page(struct vm_area_struct *vma, unsigned long addr)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long flags;
if (!mm || mm->context == NO_CONTEXT)
return;
- addr &= PAGE_MASK;
#ifdef DEBUG_CACHE
printk("cpage[%d,%08lx]", (long)mm->context, addr);
--- 93,120 ----
}
+ /*
+ * Writeback and invalidate all cache entries
+ * (on Xtensa this includes both I and D, both
+ * physically cached and virtually indexed)
+ * for a page located at virtual address 'addr'
+ * of virtual address space described by 'vma'
+ * (which is NOT necessarily the same as the
+ * current task's virtual address space).
+ */
void flush_cache_page(struct vm_area_struct *vma, unsigned long addr)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long flags;
+ pgd_t *pgdp;
+ pmd_t *pmdp;
+ pte_t *ptep;
+ /*
+ * If owns no valid ASID yet, cannot possibly have gotten
+ * this page into the cache.
+ */
if (!mm || mm->context == NO_CONTEXT)
return;
#ifdef DEBUG_CACHE
printk("cpage[%d,%08lx]", (long)mm->context, addr);
***************
*** 107,112 ****
save_and_cli(flags);
! xthal_dcache_region_writeback_inv((void *)addr, PAGE_SIZE);
! xthal_icache_region_invalidate((void *)addr, PAGE_SIZE);
restore_flags(flags);
}
--- 122,168 ----
save_and_cli(flags);
! addr &= PAGE_MASK;
! pgdp = pgd_offset(mm, addr);
! pmdp = pmd_offset(pgdp, addr);
! ptep = pte_offset(pmdp, addr);
!
! /*
! * If the page isn't marked valid, the page cannot possibly be
! * in the cache.
! */
! if (!(pte_val(*ptep) & _PAGE_VALID))
! goto out;
!
! /*
! * Doing flushes for another task (or ASID) than the current one is
! * a bit tricky, because Xtensa processor cache operation ("hit")
! * instructions take virtual addresses, not physical addresses.
! * XTFIXME: For now, we just flush (writeback and invalidate)
! * the entire caches. This can be optimized in a number of ways:
! * - if cache aliasing was supported, we could use indexed
! * cache operations on only the relevant subset of the caches
! * - in general, we could use an otherwise available 4 kB
! * wired way to map some reserved 4 kB kernel-mappable virtual
! * page to this page's physical address (available from *ptep)
! * and run the xthal region routines on this temporarily
! * mapped virtual page. Eg:
! * special_kmap_vaddr = (some constant, properly computed)
! * setup wired way from special_kmap_vaddr to *ptep's paddr
! * addr = special_kmap_vaddr
! * ...execute xthal_*cache_region_*() functions below...
! */
! #if 0 /* XTFIXME - not sure this test actually works on Xtensa arch right now... */
! if (mm->context != current->active_mm->context) {
! #endif
! xthal_dcache_all_writeback_inv();
! xthal_icache_all_invalidate();
! #if 0 /* XTFIXME - continuation of above #if */
! } else {
! /* Flushing in the current task's address space: */
! xthal_dcache_region_writeback_inv((void *)addr, PAGE_SIZE);
! xthal_icache_region_invalidate((void *)addr, PAGE_SIZE);
! }
! #endif
! out:
restore_flags(flags);
}
***************
*** 137,141 ****
#endif
! flush_icache_range(start, start + PAGE_SIZE);
}
--- 193,201 ----
#endif
! if (mm->context != current->active_mm->context) {
! flush_cache_all();
! } else {
! flush_icache_range(start, start + PAGE_SIZE);
! }
}
|
|
From: <ma...@us...> - 2003-02-06 01:25:41
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa In directory sc8-pr-cvs1:/tmp/cvs-serv17851 Modified Files: addrspace.h Log Message: Add casts to addrspace.h PHYSADDR() to avoid warnings building SONIC driver. Index: addrspace.h =================================================================== RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/addrspace.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** addrspace.h 28 Aug 2002 16:11:31 -0000 1.1.1.1 --- addrspace.h 6 Feb 2003 01:25:38 -0000 1.2 *************** *** 11,17 **** * for more details. * ! * Copyright (C) 2001 Tensilica Inc. * Authors: Joe Taylor <jo...@te..., jo...@ya...> ! * Marc Gauthier * Chris Zankel <za...@te..., ch...@za...> */ --- 11,17 ---- * for more details. * ! * Copyright (C) 2001 - 2003 Tensilica Inc. * Authors: Joe Taylor <jo...@te..., jo...@ya...> ! * Marc Gauthier <ma...@te..., ma...@al...> * Chris Zankel <za...@te..., ch...@za...> */ *************** *** 92,153 **** #define PHYSADDR(a) \ ! (((a) >= XCHAL_KSEG_BYPASS_VADDR \ ! && (a) < XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (a) - XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_PADDR : \ ! ((a) >= XCHAL_KSEG_CACHED_VADDR \ ! && a < XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (a) - XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_PADDR : (a)) #define BYPASS_ADDR(a) \ ! (((a) >= XCHAL_KSEG_BYPASS_PADDR \ ! && (a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_VADDR : \ ! ((a) >= XCHAL_KSEG_CACHED_PADDR \ ! && (a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_BYPASS_VADDR : \ ! ((a) >= XCHAL_KSEG_CACHED_VADDR \ ! && (a) < XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (a) - XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_BYPASS_VADDR : (a)) #define CACHED_ADDR(a) \ ! (((a) >= XCHAL_KSEG_BYPASS_PADDR \ ! && (a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_CACHED_VADDR : \ ! ((a) >= XCHAL_KSEG_CACHED_PADDR \ ! && (a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_VADDR : \ ! ((a) >= XCHAL_KSEG_BYPASS_VADDR \ ! && (a) < XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (a) - XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_CACHED_VADDR : (a)) #define PHYSADDR_IO(a) \ ! (((a) >= XCHAL_KIO_BYPASS_VADDR \ ! && (a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_PADDR : \ ! ((a) >= XCHAL_KIO_CACHED_VADDR \ ! && a < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_PADDR : (a)) #define BYPASS_ADDR_IO(a) \ ! (((a) >= XCHAL_KIO_BYPASS_PADDR \ ! && (a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_VADDR : \ ! ((a) >= XCHAL_KIO_CACHED_PADDR \ ! && (a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_BYPASS_VADDR : \ ! ((a) >= XCHAL_KIO_CACHED_VADDR \ ! && (a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_BYPASS_VADDR : (a)) #define CACHED_ADDR_IO(a) \ ! (((a) >= XCHAL_KIO_BYPASS_PADDR \ ! && (a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_CACHED_VADDR : \ ! ((a) >= XCHAL_KIO_CACHED_PADDR \ ! && (a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_VADDR : \ ! ((a) >= XCHAL_KIO_BYPASS_VADDR \ ! && (a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_CACHED_VADDR : (a)) #if 0 --- 92,153 ---- #define PHYSADDR(a) \ ! (((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \ ! && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_PADDR : \ ! ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \ ! && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_PADDR : (unsigned)(a)) #define BYPASS_ADDR(a) \ ! (((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \ ! && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_VADDR : \ ! ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \ ! && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_BYPASS_VADDR : \ ! ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \ ! && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_BYPASS_VADDR : (unsigned)(a)) #define CACHED_ADDR(a) \ ! (((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \ ! && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_CACHED_VADDR : \ ! ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \ ! && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_VADDR : \ ! ((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \ ! && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_CACHED_VADDR : (unsigned)(a)) #define PHYSADDR_IO(a) \ ! (((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \ ! && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_PADDR : \ ! ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \ ! && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_PADDR : (unsigned)(a)) #define BYPASS_ADDR_IO(a) \ ! (((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \ ! && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_VADDR : \ ! ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \ ! && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_BYPASS_VADDR : \ ! ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \ ! && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_BYPASS_VADDR : (unsigned)(a)) #define CACHED_ADDR_IO(a) \ ! (((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \ ! && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_CACHED_VADDR : \ ! ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \ ! && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_VADDR : \ ! ((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \ ! && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \ ! (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_CACHED_VADDR : (unsigned)(a)) #if 0 |
|
From: <ma...@us...> - 2003-02-06 01:23:57
|
Update of /cvsroot/xtensa/linux/drivers/net
In directory sc8-pr-cvs1:/tmp/cvs-serv16891
Modified Files:
sonic.c sonic.h xtsonic.c
Log Message:
Fix rx buffer size bug with generic SONIC Ethernet driver
(not large enough to accept max sized frames on DP83934C parts).
Also cleanup XT2000 specific SONIC driver wrapper.
Index: sonic.c
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/sonic.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sonic.c 28 Aug 2002 16:10:45 -0000 1.1.1.1
--- sonic.c 6 Feb 2003 01:23:48 -0000 1.2
***************
*** 502,506 ****
SONIC_WRITE(SONIC_RWP, rra_end);
SONIC_WRITE(SONIC_URRA, lp->rra_laddr >> 16);
! SONIC_WRITE(SONIC_EOBC, (SONIC_RBSIZE - 2) >> 1);
lp->cur_rra =
--- 502,506 ----
SONIC_WRITE(SONIC_RWP, rra_end);
SONIC_WRITE(SONIC_URRA, lp->rra_laddr >> 16);
! SONIC_WRITE(SONIC_EOBC, (SONIC_RBSIZE - SONIC_MODESIZE) >> 1);
lp->cur_rra =
Index: sonic.h
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/sonic.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sonic.h 5 Nov 2002 19:38:58 -0000 1.3
--- sonic.h 6 Feb 2003 01:23:49 -0000 1.4
***************
*** 426,430 ****
* MSch: use more buffer space for the slow m68k Macs!
*/
! #ifdef CONFIG_MACSONIC
#define SONIC_NUM_RRS 32 /* number of receive resources */
#define SONIC_NUM_RDS SONIC_NUM_RRS /* number of receive descriptors */
--- 426,430 ----
* MSch: use more buffer space for the slow m68k Macs!
*/
! #if defined(CONFIG_MACSONIC) || defined(CONFIG_XTENSA_PLATFORM_XT2000_SONIC)
#define SONIC_NUM_RRS 32 /* number of receive resources */
#define SONIC_NUM_RDS SONIC_NUM_RRS /* number of receive descriptors */
***************
*** 435,439 ****
#define SONIC_NUM_TDS 16 /* number of transmit descriptors */
#endif
! #define SONIC_RBSIZE 1520 /* size of one resource buffer */
#define SONIC_RDS_MASK (SONIC_NUM_RDS-1)
--- 435,449 ----
#define SONIC_NUM_TDS 16 /* number of transmit descriptors */
#endif
! /*
! * The SONIC DP83934C datasheets recommend setting EOBC 2 or 4 bytes less
! * than the buffer size (for 16-bit and 32-bit modes respectively)
! * when buffering a single packet per RBA, as this driver does.
! * And they indicate EOBC must be set to 1518 or 1520 for 16-bit
! * and 32-bit modes respectively. To test which case, construct
! * a small structure whose size (2 or 4 bytes) depends on the mode:
! */
! struct _sonic_size_test { u16 dummy; SREGS_PAD(pad); };
! #define SONIC_MODESIZE sizeof(struct _sonic_size_test) /* 2 or 4 */
! #define SONIC_RBSIZE ((SONIC_MODESIZE > 2) ? 1524 : 1518) /* size of one resource buffer */
#define SONIC_RDS_MASK (SONIC_NUM_RDS-1)
Index: xtsonic.c
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/xtsonic.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** xtsonic.c 29 Oct 2002 01:20:32 -0000 1.2
--- xtsonic.c 6 Feb 2003 01:23:49 -0000 1.3
***************
*** 2,6 ****
* xtsonic.c
*
! * (C) 2001 by Kevin Chea (kc...@te...)
* (C) 1996,1998 by Thomas Bogendoerfer (tsb...@al...)
*
--- 2,9 ----
* xtsonic.c
*
! * (C) 2001 - 2003 Tensilica Inc.
! * by Kevin Chea <kc...@ya...> (2001)
! * by Marc Gauthier (ma...@te..., ma...@al...) (2003)
! *
* (C) 1996,1998 by Thomas Bogendoerfer (tsb...@al...)
*
***************
*** 10,14 ****
* (C) 1995 by Andreas Busse (an...@wa...)
*
! * A driver for the onboard Sonic ethernet controller on the XT-2000.
*/
--- 13,17 ----
* (C) 1995 by Andreas Busse (an...@wa...)
*
! * A driver for the onboard Sonic ethernet controller on the XT2000.
*/
***************
*** 106,109 ****
--- 109,113 ----
unsigned int silicon_revision;
struct sonic_local *lp;
+ unsigned char *priv;
dma_addr_t dma;
int i;
***************
*** 133,137 ****
/* Allocate a new 'dev' if needed. */
if (dev == NULL)
! dev = init_etherdev(0, sizeof(struct sonic_local));
if (sonic_debug && version_printed++ == 0)
--- 137,141 ----
/* Allocate a new 'dev' if needed. */
if (dev == NULL)
! dev = init_etherdev(0, 0);
if (sonic_debug && version_printed++ == 0)
***************
*** 158,162 ****
if (xtboard_nvram_valid()) {
! xtboard_get_ether_addr(&dev->dev_addr);
} else {
/* XTFIXME [kcc] Bogus ethernet address */
--- 162,166 ----
if (xtboard_nvram_valid()) {
! xtboard_get_ether_addr(dev->dev_addr);
} else {
/* XTFIXME [kcc] Bogus ethernet address */
***************
*** 167,170 ****
--- 171,175 ----
dev->dev_addr[4]=0x4;
dev->dev_addr[5]=0x5;
+ printk("Bogus ");
}
***************
*** 179,230 ****
/* Initialize the device structure. */
! if (dev->priv == NULL) {
! /*
! * the memory must be located in the same 64kb segment
! */
! i = 0;
! do {
! lp = pci_alloc_consistent(NULL,sizeof(struct sonic_local),&dma);
! if ((unsigned long) lp >> 16
! != ((unsigned long)lp + sizeof(*lp) ) >> 16) {
! pci_free_consistent(NULL, sizeof(struct sonic_local),
! lp, dma);
! lp = NULL;
! }
! } while (lp == NULL && i++ < 20);
! if (lp == NULL) {
! printk ("%s: couldn't allocate memory for descriptors\n",
! dev->name);
! return -ENOMEM;
! }
!
! memset(lp, 0, sizeof(struct sonic_local));
!
! /* get the virtual dma address */
! lp->cda_laddr = dma;
! lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
! lp->rra_laddr = lp->tda_laddr + sizeof (lp->tda);
! lp->rda_laddr = lp->rra_laddr + sizeof (lp->rra);
!
! /* allocate receive buffer area */
! /* FIXME, maybe we should use skbs */
! lp->rba = (char *)kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL);
! if (lp->rba == NULL) {
! printk ("%s: couldn't allocate receive buffers\n",dev->name);
! return -ENOMEM;
! }
! lp->rba_laddr = virt_to_phys(lp->rba);
! flush_cache_all();
! dev->priv = (struct sonic_local *)lp;
}
- lp = (struct sonic_local *)dev->priv;
dev->open = sonic_open;
dev->stop = sonic_close;
! dev->hard_start_xmit = sonic_send_packet;
! dev->get_stats = sonic_get_stats;
dev->set_multicast_list = &sonic_multicast_list;
--- 184,243 ----
/* Initialize the device structure. */
! if (dev->priv != NULL)
! printk("%s: preallocated priv field ignored\n", dev->name);
! /*
! * Allocate local private descriptor areas in uncached space.
! * The entire structure must be located within the same 64kb segment.
! * A simple way to ensure this is to allocate twice the
! * size of the structure -- given that the structure is
! * much less than 64 kB, at least one of the halves of
! * the allocated area will be contained entirely in 64 kB.
! * We also allocate extra space for a pointer to allow freeing
! * this structure later on (in xtsonic_cleanup_module()).
! */
! priv = pci_alloc_consistent(NULL, sizeof(struct sonic_local)*2
! + sizeof(unsigned char*), &dma);
! priv += sizeof(unsigned char*); /* skip pointer */
! dma += sizeof(unsigned char*); /* ditto */
! lp = (struct sonic_local*) \
! ( ((unsigned)priv + sizeof(struct sonic_local) - 1) & 0xFFFF0000 );
! if( (unsigned char*)lp < priv )
! /* Returned address is okay, fits in 64 kB: */
! lp = (struct sonic_local*)priv;
! else
! /* Aligned returned address to 64 kB, adjust 'dma' similarly: */
! dma = (dma_addr_t)( (unsigned)dma + ((unsigned char*)lp - priv) );
! *((unsigned char**)lp - 1) = priv - sizeof(unsigned char*);
! /* For debugging: */
! printk("%s: SONIC priv area at 0x%X, dev at 0x%X\n",
! dev->name, (unsigned) lp, (unsigned) dev);
! memset(lp, 0, sizeof(struct sonic_local));
!
! /* get the virtual dma address */
! lp->cda_laddr = dma;
! lp->tda_laddr = lp->cda_laddr + sizeof (lp->cda);
! lp->rra_laddr = lp->tda_laddr + sizeof (lp->tda);
! lp->rda_laddr = lp->rra_laddr + sizeof (lp->rra);
!
! /* allocate receive buffer area */
! /* FIXME, maybe we should use skbs */
! lp->rba = (char *)kmalloc(SONIC_NUM_RRS * SONIC_RBSIZE, GFP_KERNEL);
! if (lp->rba == NULL) {
! printk ("%s: couldn't allocate receive buffers\n",dev->name);
! return -ENOMEM;
}
+ lp->rba_laddr = virt_to_phys(lp->rba);
+
+ flush_cache_all();
+
+ dev->priv = lp;
dev->open = sonic_open;
dev->stop = sonic_close;
! dev->hard_start_xmit = sonic_send_packet;
! dev->get_stats = sonic_get_stats;
dev->set_multicast_list = &sonic_multicast_list;
***************
*** 261,265 ****
if (dev_xtsonic.priv != NULL) {
unregister_netdev(&dev_xtsonic);
! kfree(dev_xtsonic.priv);
dev_xtsonic.priv = NULL;
}
--- 274,278 ----
if (dev_xtsonic.priv != NULL) {
unregister_netdev(&dev_xtsonic);
! kfree(*((unsigned char**)dev_xtsonic.priv-1));
dev_xtsonic.priv = NULL;
}
|
|
From: <za...@us...> - 2003-01-31 04:37:22
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv24901a/linux/include/asm-xtensa
Modified Files:
elf.h
Log Message:
Added syscall_nr to xtensa_gregset_t (and, thus, elf_gregset_t).
Added access to syscall_nr via ptrace (PTRACE_GETREGS/PTRACE_SETREGS).
Fixed arch/xtensa/Makefile:
When LIBGCC is defined, the host compiler is used instead of the
cross compiler.
Index: elf.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/elf.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** elf.h 27 Jan 2003 18:24:42 -0000 1.3
--- elf.h 31 Jan 2003 04:37:19 -0000 1.4
***************
*** 53,56 ****
--- 53,57 ----
elf_greg_t lcount;
elf_greg_t sar;
+ elf_greg_t syscall_nr;
elf_greg_t ar[XCHAL_NUM_AREGS];
|
|
From: <za...@us...> - 2003-01-31 04:37:22
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv24901a/linux/arch/xtensa/kernel
Modified Files:
process.c
Log Message:
Added syscall_nr to xtensa_gregset_t (and, thus, elf_gregset_t).
Added access to syscall_nr via ptrace (PTRACE_GETREGS/PTRACE_SETREGS).
Fixed arch/xtensa/Makefile:
When LIBGCC is defined, the host compiler is used instead of the
cross compiler.
Index: process.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/process.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** process.c 29 Jan 2003 06:17:59 -0000 1.6
--- process.c 31 Jan 2003 04:37:19 -0000 1.7
***************
*** 360,363 ****
--- 360,364 ----
elfregs->lcount = regs->lcount;
elfregs->sar = regs->sar;
+ elfregs->syscall_nr = regs->syscall_nr;
/* Clear everything. We don't have values for all of them, so
***************
*** 373,385 ****
/* Copy regs from non-live registers.
regs->wmask indicates the number of window panes saved. */
! wb_offset = regs->wb;
! for (i = 0; i < regs->wmask; i++) {
/* using wb_offset as window-pane number */
if (--wb_offset < 0)
wb_offset = XCHAL_NUM_AREGS / 4;
! elfregs->ar[wb_offset*4 + 0] = tsk->thread.regfile[i + 0];
! elfregs->ar[wb_offset*4 + 1] = tsk->thread.regfile[i + 1];
! elfregs->ar[wb_offset*4 + 2] = tsk->thread.regfile[i + 2];
! elfregs->ar[wb_offset*4 + 3] = tsk->thread.regfile[i + 3];
}
}
--- 374,386 ----
/* Copy regs from non-live registers.
regs->wmask indicates the number of window panes saved. */
!
! for (i = 0; i < regs->wmask * 4; i+=4) {
/* using wb_offset as window-pane number */
if (--wb_offset < 0)
wb_offset = XCHAL_NUM_AREGS / 4;
! elfregs->ar[wb_offset + 0] = tsk->thread.regfile[i*4 + 0];
! elfregs->ar[wb_offset + 1] = tsk->thread.regfile[i*4 + 1];
! elfregs->ar[wb_offset + 2] = tsk->thread.regfile[i*4 + 2];
! elfregs->ar[wb_offset + 3] = tsk->thread.regfile[i*4 + 3];
}
}
***************
*** 397,410 ****
int i, wb_offset; /* wb_offset must be signed */
! regs->pc = elfregs->pc;
! regs->ps = elfregs->ps;
! regs->exccause = elfregs->exccause;
! regs->excvaddr = elfregs->excvaddr;
! regs->wb = elfregs->wb;
! regs->ws = elfregs->ws;
! regs->lbeg = elfregs->lbeg;
! regs->lend = elfregs->lend;
! regs->lcount = elfregs->lcount;
! regs->sar = elfregs->sar;
/* Clear everything. We don't have values for all of them, so
--- 398,412 ----
int i, wb_offset; /* wb_offset must be signed */
! regs->pc = elfregs->pc;
! regs->ps = elfregs->ps;
! regs->exccause = elfregs->exccause;
! regs->excvaddr = elfregs->excvaddr;
! regs->wb = elfregs->wb;
! regs->ws = elfregs->ws;
! regs->lbeg = elfregs->lbeg;
! regs->lend = elfregs->lend;
! regs->lcount = elfregs->lcount;
! regs->sar = elfregs->sar;
! regs->syscall_nr = elfregs->syscall_nr;
/* Clear everything. We don't have values for all of them, so
***************
*** 420,432 ****
/* Copy regs from non-live registers.
regs->wmask indicates the number of window panes saved. */
! wb_offset = elfregs->wb;
! for (i = 0; i < regs->wmask; i++) {
/* using wb_offset as window-pane number */
if (--wb_offset < 0)
wb_offset = XCHAL_NUM_AREGS / 4;
! tsk->thread.regfile[i + 0] = elfregs->ar[wb_offset*4 + 0];
! tsk->thread.regfile[i + 1] = elfregs->ar[wb_offset*4 + 1];
! tsk->thread.regfile[i + 2] = elfregs->ar[wb_offset*4 + 2];
! tsk->thread.regfile[i + 3] = elfregs->ar[wb_offset*4 + 3];
}
}
--- 422,433 ----
/* Copy regs from non-live registers.
regs->wmask indicates the number of window panes saved. */
! for (i = 0; i < regs->wmask * 4; i+=4) {
/* using wb_offset as window-pane number */
if (--wb_offset < 0)
wb_offset = XCHAL_NUM_AREGS / 4;
! tsk->thread.regfile[i*4 + 0] = elfregs->ar[wb_offset + 0];
! tsk->thread.regfile[i*4 + 1] = elfregs->ar[wb_offset + 1];
! tsk->thread.regfile[i*4 + 2] = elfregs->ar[wb_offset + 2];
! tsk->thread.regfile[i*4 + 3] = elfregs->ar[wb_offset + 3];
}
}
|
|
From: <za...@us...> - 2003-01-31 04:37:22
|
Update of /cvsroot/xtensa/linux/arch/xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv24901a/linux/arch/xtensa
Modified Files:
Makefile
Log Message:
Added syscall_nr to xtensa_gregset_t (and, thus, elf_gregset_t).
Added access to syscall_nr via ptrace (PTRACE_GETREGS/PTRACE_SETREGS).
Fixed arch/xtensa/Makefile:
When LIBGCC is defined, the host compiler is used instead of the
cross compiler.
Index: Makefile
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Makefile 30 Jan 2003 23:46:32 -0000 1.8
--- Makefile 31 Jan 2003 04:37:18 -0000 1.9
***************
*** 26,31 ****
AFLAGS += -g -I$(HPATH)/asm-xtensa
- LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
- LIBS += $(LIBGCC)
ifeq ($(CONFIG_XTENSA_PLATFORM_ISS),y)
--- 26,29 ----
***************
*** 80,83 ****
--- 78,83 ----
endif
+ LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
+ LIBS += $(LIBGCC)
# Use the compile-time HAL to identify endianness.
|
|
From: <joe...@us...> - 2003-01-30 23:55:32
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv30731/arch/xtensa/kernel
Modified Files:
vectors.S handlers.S sys.S
Log Message:
Fixed a bug that hangs the kernel. We were improperly handling double exceptions that occurred during the handling of a window underflow exception.
Index: vectors.S
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/vectors.S,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** vectors.S 29 Jan 2003 06:18:00 -0000 1.4
--- vectors.S 30 Jan 2003 23:55:26 -0000 1.5
***************
*** 131,135 ****
_bltu a0, a2, 1f
addi a2, a2, XSHAL_WINDOW_VECTORS_SIZE
! _bltu a0, a2, find_handler
/* Occasionally, the kernel expects a double exception to
--- 131,135 ----
_bltu a0, a2, 1f
addi a2, a2, XSHAL_WINDOW_VECTORS_SIZE
! _bltu a0, a2, .Ldouble_in_wvec
/* Occasionally, the kernel expects a double exception to
***************
*** 147,151 ****
* fixup routine. If the variable TABLE_FIXUP is zero, the
* kernel is in trouble. If the variable is nonzero, this
! * handler jumps to the instruction that the variable
* addresses.
*
--- 147,151 ----
* fixup routine. If the variable TABLE_FIXUP is zero, the
* kernel is in trouble. If the variable is nonzero, this
! * handler jumps to the instruction that the TABLE_FIXUP
* addresses.
*
***************
*** 165,208 ****
*/
! 1: l32i a2, a1, TABLE_FIXUP
! beqz a2, CriticalExc
! jx a2
! /* The double exception did occur within a window exception
! * handler. All entry conditions below say "All other
! * registers contain their original values." These values
! * usually are not user values, but kernel values, since
! * the double exception will return to the kernel handler,
! * not the user code.
*
* find_handler has some entry conditions, but these are met
! * by the Double Exception Vector code, not the routines that
! * register find_handler with TABLE_FIXUP. They are:
*
* a0 is undefined
* a1 = &exception_handlers[0]
* EXCSAVE_1 contains original a1
! * a2 is undefined
* [ EXCSAVE_1 + TABLE_SAVEA2 ] contains original a2
* All other registers contain their original values.
*
* We setup the following conditions for the registered
! * handler:
*
* a0 is undefined
* DEPC contains original a0
* DEPC saved in [ EXCSAVE_1 + TABLE_SAVEA0 ]
* All other registers contain their original values.
*/
.global find_handler
find_handler:
rsr a0, EXCCAUSE
- l32i a2, a1, TABLE_SAVEA2 // restore a2 (in slot)
addx4 a0, a0, a1
l32i a0, a0, TABLE_OFS + EXC_CODE_DOUBLE*4 // load handler addr
xsr a1, EXCSAVE_1 // restore a1
jx a0 // jump to handler
-
--- 165,218 ----
*/
! 1: l32i a0, a1, TABLE_FIXUP
! beqz a0, CriticalExc
! movi a2, ( 0 << EXCTYPE_DOUBLE_WIND_SHIFT )
! jx a0
!
! /* Control branches to .Ldouble_in_wvec when the double
! * exception occurred within a window exception. This entry
! * point sets a2 to indicate this condition for handle_double,
! * then falls through to find_handler. Exceptions that occur
! * outside a window exception will fall into the TABLE_FIXUP
! * code, which always clears a2 for the handler.
! *
! * The entry conditions below say "All other registers contain
! * their original values." These values usually are not user
! * values, but kernel values, since the double exception will
! * return to some kernel handler, not the user code.
*
* find_handler has some entry conditions, but these are met
! * by the Double Exception Vector code above, not the routines
! * that register handlers with TABLE_FIXUP. They are:
*
* a0 is undefined
* a1 = &exception_handlers[0]
* EXCSAVE_1 contains original a1
! * a2 sets the EXCTYPE_DOUBLE_WIND_SHIFT bit if in window vector, 0 otherwise.
* [ EXCSAVE_1 + TABLE_SAVEA2 ] contains original a2
* All other registers contain their original values.
*
* We setup the following conditions for the registered
! * handler (probably handle_double):
*
* a0 is undefined
+ * a2 sets the EXCTYPE_DOUBLE_WIND_SHIFT bit if in window vector, 0 otherwise.
* DEPC contains original a0
* DEPC saved in [ EXCSAVE_1 + TABLE_SAVEA0 ]
+ * [ EXCSAVE_1 + TABLE_SAVEA2 ] contains original a2
* All other registers contain their original values.
*/
.global find_handler
+
+ .Ldouble_in_wvec:
+ movi a2, ( 1 << EXCTYPE_DOUBLE_WIND_SHIFT )
find_handler:
rsr a0, EXCCAUSE
addx4 a0, a0, a1
l32i a0, a0, TABLE_OFS + EXC_CODE_DOUBLE*4 // load handler addr
xsr a1, EXCSAVE_1 // restore a1
jx a0 // jump to handler
Index: handlers.S
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** handlers.S 29 Jan 2003 06:17:59 -0000 1.9
--- handlers.S 30 Jan 2003 23:55:26 -0000 1.10
***************
*** 128,133 ****
--- 128,135 ----
*
* a0 is undefined (okay, it contains handle_double)
+ * a2 sets the EXCTYPE_DOUBLE_WIND_SHIFT bit if in window vector, 0 otherwise.
* DEPC contains original a0
* DEPC saved in [ EXCSAVE_1 + TABLE_SAVEA0 ]
+ * [ EXCSAVE_1 + TABLE_SAVEA2 ] contains original a2
* All other register contain their original values.
*/
***************
*** 145,149 ****
bbci.l a0, PS_PROGSTACK_SHIFT, doubleram_kernel // stacked (kernel) mode?
! /* Program (user) mode, so switch stack pointers. Get pointer
* to kernel stack, pre-decremented by 16+PT_SIZE */
--- 147,151 ----
bbci.l a0, PS_PROGSTACK_SHIFT, doubleram_kernel // stacked (kernel) mode?
! /* User mode, so switch stack pointers. Get pointer
* to kernel stack, pre-decremented by 16+PT_SIZE */
***************
*** 166,180 ****
mov a1, a0 // set sp to system stack
/* Now unshuffle the way state was saved in the vector, and save
! * state that is specific to exceptions in window handlers.
! */
xsr a1, EXCSAVE_1 // a1 <-- ptr to handler table, save a1
! /* slot */
l32i a0, a1, TABLE_SAVEA0 // get saved DEPC
xsr a1, EXCSAVE_1 // restore a1, save table ptr
/* slot */
s32i a0, a1, PT_DEPC // store DEPC in exc stack frame
#if 0
/* XTFIXME: For now, don't restart anything. Just get it to
--- 168,253 ----
mov a1, a0 // set sp to system stack
+ /* Branch if the double exception happened during a window
+ * exception handler. */
+
+ bnez a2, double_convert
+
+ double_noconversion:
+ /* Compute the exception type. PS (in a0) indicates user vs
+ * kernel. MISC_REG_0 indicates whether the double exception
+ * occurred in the window vector. */
+
+ movi a0, EXCTYPE_DOUBLE_KERNEL
+ bbci.l a0, PS_PROGSTACK_SHIFT, 1f // branch if kernel mode
+ movi a0, EXCTYPE_DOUBLE_USER
+ 1: or a2, a2, a0 // add in window vector bit
+ // (may be zero)
+
/* Now unshuffle the way state was saved in the vector, and save
! * state that is specific to exceptions in window handlers. */
xsr a1, EXCSAVE_1 // a1 <-- ptr to handler table, save a1
! wsr a2, MISC_REG_0 // save off exctype
l32i a0, a1, TABLE_SAVEA0 // get saved DEPC
+ l32i a2, a1, TABLE_SAVEA2 // get original a2
xsr a1, EXCSAVE_1 // restore a1, save table ptr
/* slot */
s32i a0, a1, PT_DEPC // store DEPC in exc stack frame
+ /* Load up the exctype and jump to common exception handling. */
+
+ rsr a0, MISC_REG_0
+ j _excCommonException
+
+
+ double_convert:
+ /* We need DEPC to distinguish between overflows and
+ * underflows. It is currently saved in TABLE_SAVEA0.
+ * Did the double exception occur in a window overflow or
+ * underflow? We restart underflows, but not overflows. */
+
+ xsr a1, EXCSAVE_1 // a1 <-- exception_handlers
+ l32i a0, a1, TABLE_SAVEA0 // load DEPC
+ xsr a1, EXCSAVE_1 // a1 <-- kernel stack pointer
+ bbci.l a0, 6, double_noconversion // branch if window overflow
+
+ /* Restart window underflow exception.
+ * Just set WINDOWBASE to PS.OWB. This is feasible for underflows
+ * because registers are available to do this. */
+
+ wsr a1, DEPC // save kernel stack ptr across window change
+ // (out of scope a0 is clobbered)
+ rsr a0, PS // get PS
+ l32i a1, a1, PT_AREG1 // restore a1 of this window
+ // (not needed but might help debugging)
+ extui a0, a0, XCHAL_PS_OWB_SHIFT, XCHAL_PS_OWB_BITS
+ wsr a0, WINDOWBASE // WB <-- PS.OWB
+ rsync
+ xsr a0, DEPC // save a0 in DEPC, restore kernel stack ptr
+ /* slot */
+ s32i a1, a0, PT_AREG1 // save a1 of active window
+ mov a1, a0 // set kernel stack ptr
+
+ /* We ignore the out-of-scope value of a2 still in TABLE_SAVEA2. */
+
+ /* Use PS to mark proper exception type. Note that since we
+ * are restarting the window underflow, we want to change the
+ * exception type from double to user or kernel. This change
+ * will trigger the use of "rfe" instead of "rfde" when
+ * exception processing is complete.
+ */
+
+ rsr a0, PS // get PS
+ /* slot */
+ bbci.l a0, PS_PROGSTACK_SHIFT, 1f // stacked (kernel) mode?
+
+ movi a0, EXCTYPE_USER // mark exception as "double-window-user"
+ j _excCommonException // jump to common exception handling
+
+ 1: movi a0, EXCTYPE_KERNEL // mark exception as "double-window-kernel"
+ j _excCommonException // jump to common exception handling
+
+
+
#if 0
/* XTFIXME: For now, don't restart anything. Just get it to
***************
*** 237,256 ****
- #ifndef RESTART_OVERFLOW
- restart_overflow:
- #endif
-
- /* Use PS to mark proper exception type: */
- rsr a0, PS // get PS
- /* slot */
- bbci.l a0, PS_PROGSTACK_SHIFT, 1f // stacked (kernel) mode?
-
- movi a0, EXCTYPE_DOUBLE_WIND_USER // mark exception as "double-window-user"
- j _excCommonException // jump to common exception handling
-
- 1: movi a0, EXCTYPE_DOUBLE_WIND_KERNEL // mark exception as "double-window-kernel"
- j _excCommonException // jump to common exception handling
-
-
#ifdef RESTART_OVERFLOW
restart_overflow:
--- 310,313 ----
***************
*** 582,588 ****
* interrupts which we don't currently do], for user
* exceptions we might have more leeway but we leave it as is
! * for now.) */
!
! /* Here, a0 still contains exception type. Type values are
* such that bit EXCTYPE_QUICKSPILL_SHIFT of each value is
* clear if all live register windows must be spilled for that
--- 639,645 ----
* interrupts which we don't currently do], for user
* exceptions we might have more leeway but we leave it as is
! * for now.)
! *
! * Here, a0 still contains exception type. Type values are
* such that bit EXCTYPE_QUICKSPILL_SHIFT of each value is
* clear if all live register windows must be spilled for that
***************
*** 610,617 ****
* PS.EXCM = 1
* a0 thru a3 saved already
! * a4 thru a15 valid
! * a0,a2,a3 undefined
* a1 = current PS pointing to exception frame
! * WINDOWSTART[WINDOWBASE] = 1 ???
* LCOUNT = 0
*
--- 667,675 ----
* PS.EXCM = 1
* a0 thru a3 saved already
! * a0,a2 undefined
* a1 = current PS pointing to exception frame
! * a3 has WINDOWSTART
! * a4 thru a15 valid
! * WINDOWSTART[WINDOWBASE] = 1
* LCOUNT = 0
*
***************
*** 807,810 ****
--- 865,869 ----
// a3 = 0 .. WSBITS-4 (number of panes to save, other than current window's 4)
ut_save:
+
s32i a3, a1, PT_WMASK // save this number, rather than recompute it on restore
***************
*** 818,822 ****
#if 1
j simple_save_end
-
simple_save:
rotw -1 // a2,a3 become a6,a7
--- 877,880 ----
***************
*** 1552,1563 ****
excdone:
! /* Return from user/kernel exception, or double exception?
! * Branch if double exception occurred (uncommon case).
*/
! #if (EXCTYPE_DOUBLE_WIND_USER > EXCTYPE_DOUBLE_WIND_KERNEL)
! #error Bad assumption by next instruction.
! #endif
! bgeui a0, EXCTYPE_DOUBLE_WIND_USER, 4f
l32i a0, a1, PT_AREG0 // restore a0
--- 1610,1620 ----
excdone:
! /* Return from the exception. Two cases:
! *
! * 1. Return from double exception
! * 2. Return from user or kernel exception (common case)
*/
! bbsi.l a0, EXCTYPE_DOUBLE_SHIFT, 4f
l32i a0, a1, PT_AREG0 // restore a0
***************
*** 1565,1582 ****
rfe
-
- /* Control comes here only when returning from double
- * exceptions that happened in a window-overflow handler.
- * (Double exceptions occuring in window-underflow handlers
- * are converted to EXCTYPE_{USER,KERNEL} exceptions.)
- * Restarting window overflows is not yet implemented, so we
- * must "return from double exception" (rfde) into the
- * window-overflow handler.
- */
-
4: l32i a0, a1, PT_AREG0 // restore a0
l32i a1, a1, PT_AREG1 // restore a1
rfde
-
--- 1622,1628 ----
Index: sys.S
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/sys.S,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sys.S 28 Aug 2002 16:10:14 -0000 1.1.1.1
--- sys.S 30 Jan 2003 23:55:27 -0000 1.2
***************
*** 814,818 ****
s32i a0, a1, PT_DEPC // store DEPC in ESF
! movi a0, EXCTYPE_DOUBLE_WIND_KERNEL
j _excCommonException
--- 814,818 ----
s32i a0, a1, PT_DEPC // store DEPC in ESF
! movi a0, EXCTYPE_DOUBLE_KERNEL
j _excCommonException
|
|
From: <joe...@us...> - 2003-01-30 23:55:32
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa In directory sc8-pr-cvs1:/tmp/cvs-serv30731/include/asm-xtensa Modified Files: ptrace.h Log Message: Fixed a bug that hangs the kernel. We were improperly handling double exceptions that occurred during the handling of a window underflow exception. Index: ptrace.h =================================================================== RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/ptrace.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ptrace.h 28 Jan 2003 23:52:23 -0000 1.6 --- ptrace.h 30 Jan 2003 23:55:27 -0000 1.7 *************** *** 30,34 **** /* 3 x 64-entries x 4-byte tables follow from TABLE_OFS. */ ! /* Exception causes/codes?: */ #define EXC_CODE_USER 0x000 #define EXC_CODE_KERNEL 0x040 --- 30,34 ---- /* 3 x 64-entries x 4-byte tables follow from TABLE_OFS. */ ! /* Offsets within exception_handlers[] */ #define EXC_CODE_USER 0x000 #define EXC_CODE_KERNEL 0x040 *************** *** 36,49 **** #define EXC_CODE_UNHANDLED 0x100 ! /* Exception types: */ /*unhandled quickspill*/ ! #define EXCTYPE_USER 0 /* 0 0 */ ! #define EXCTYPE_USER_UNHANDLED 1 /* 1 0 */ ! #define EXCTYPE_KERNEL 2 /* 0 1 */ ! #define EXCTYPE_KERNEL_UNHANDLED 3 /* 1 1 */ ! #define EXCTYPE_DOUBLE_WIND_USER 4 /* 0 0 */ ! #define EXCTYPE_DOUBLE_WIND_KERNEL 8 /* 0 0 */ /* Bits: */ #define EXCTYPE_UNHANDLED_SHIFT 0 #define EXCTYPE_QUICKSPILL_SHIFT 1 --- 36,77 ---- #define EXC_CODE_UNHANDLED 0x100 ! /* Exception types: */ ! ! /* Double exceptions in window vectors need different treatment of ! WINDOWBASE that double exceptions that occur outside of window ! vectors. ! ! PS distinguishes between user and kernel, so we don't need to here. ! However, we do so to simplify the determination of whether we need ! to spill everything (user, quickspill=0) or not (kernel, ! quickspill=1). ! ! XTFIXME: For safety, we don't distinguish between double exceptions ! that occurred from user mode (i.e., PS.UM = 1, PS.EXCM = 1; e.g., ! window exceptions) and from kernel mode (i.e., PS.UM = 0, PS.EXCM = ! 1). Since we don't switch stacks on kernel mode, I think it will ! be safe to do a quick spill on the *_DOUBLE_KERNEL and ! *_DOUBLE_WIND_KERNEL cases. Try it. :) You just need to set the ! quickspill bits below... ! ! unhandled exception -------+ ! user or kernel exception -----+ | ! double exception ---+ | | ! double exception in window vector -+ | | | ! | | | | ! V V V V */ ! #define EXCTYPE_USER 0 /* 0 0 0 0 */ ! #define EXCTYPE_USER_UNHANDLED 1 /* 0 0 0 1 */ ! #define EXCTYPE_KERNEL 2 /* 0 0 1 0 */ ! #define EXCTYPE_KERNEL_UNHANDLED 3 /* 0 0 1 1 */ ! #define EXCTYPE_DOUBLE_USER 4 /* 0 1 0 0 */ ! #define EXCTYPE_DOUBLE_KERNEL 4 /* 0 1 0 0 */ ! #define EXCTYPE_DOUBLE_WIND_USER 12 /* 1 1 0 0 */ ! #define EXCTYPE_DOUBLE_WIND_KERNEL 12 /* 1 1 0 0 */ /* Bits: */ #define EXCTYPE_UNHANDLED_SHIFT 0 #define EXCTYPE_QUICKSPILL_SHIFT 1 + #define EXCTYPE_DOUBLE_SHIFT 2 + #define EXCTYPE_DOUBLE_WIND_SHIFT 3 *************** *** 100,105 **** unsigned vpri; unsigned wmask; ! unsigned wb; /* WINDOWBASE */ ! unsigned ws; /* WINDOWSTART */ unsigned reserved0; /*??? cpenable ???*/ unsigned reserved1; --- 128,133 ---- unsigned vpri; unsigned wmask; ! unsigned wb; ! unsigned ws; unsigned reserved0; /*??? cpenable ???*/ unsigned reserved1; |
|
From: <ma...@us...> - 2003-01-30 23:46:36
|
Update of /cvsroot/xtensa/linux/arch/xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv27842
Modified Files:
Makefile
Log Message:
Make Xtensa arch Makefile default to correct tools rather than linux_be.
Index: Makefile
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/Makefile,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Makefile 20 Jan 2003 23:22:08 -0000 1.7
--- Makefile 30 Jan 2003 23:46:32 -0000 1.8
***************
*** 4,8 ****
# for more details.
#
! # Copyright (C) 2001 Tensilica Inc.
#
# This file is included by the global makefile so that you can add your own
--- 4,8 ----
# for more details.
#
! # Copyright (C) 2001 - 2003 Tensilica Inc.
#
# This file is included by the global makefile so that you can add your own
***************
*** 12,26 ****
#
- # test for cross compiling
- COMPILE_ARCH = $(shell uname -m)
-
- ifneq ($(COMPILE_ARCH), $(ARCH))
- ifndef CROSS_COMPILE
- CROSS_COMPILE = xtensa_linux_be-
- endif
- # xcc prefix
- # CROSS_COMPILE = xt-
- endif
-
#
# Choosing incompatible machines durings configuration will result in
--- 12,15 ----
***************
*** 69,72 ****
--- 58,72 ----
endif
+ # test for cross compiling
+ COMPILE_ARCH = $(shell uname -m)
+
+ ifneq ($(COMPILE_ARCH), $(ARCH))
+ ifndef CROSS_COMPILE
+ CROSS_COMPILE = xtensa_$(XTENSA_CONFIG)-
+ endif
+ # xcc prefix
+ # CROSS_COMPILE = xt-
+ endif
+
export CFLAGS
***************
*** 81,85 ****
! # Use the compile-time HAL to identify endianess.
PCONF := include/asm-$(ARCH)/xtensa/config-$(XTENSA_CONFIG)
CORE_H := $(PCONF)/core.h
--- 81,85 ----
! # Use the compile-time HAL to identify endianness.
PCONF := include/asm-$(ARCH)/xtensa/config-$(XTENSA_CONFIG)
CORE_H := $(PCONF)/core.h
***************
*** 96,100 ****
export XTENSA_BIG_ENDIAN
! # Use the compiler to identify endianess and verify XTENSA_{BIG,LITTLE}_ENDIAN
ifndef IGNORE_ENDIANESS
CC_ENDIAN_STRING := $(shell echo 'main(){}' | $(CC) -E -dM -xc - | grep __XTENSA_EB__)
--- 96,100 ----
export XTENSA_BIG_ENDIAN
! # Use the compiler to identify endianness and verify XTENSA_{BIG,LITTLE}_ENDIAN
ifndef IGNORE_ENDIANESS
CC_ENDIAN_STRING := $(shell echo 'main(){}' | $(CC) -E -dM -xc - | grep __XTENSA_EB__)
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv25774 Modified Files: gdb-stub.c handlers.S head.S process.c ptrace.c setup.c syscall.c traps.c vectors.S Log Message: Trivial copyright header changes, to practice CVS commands... Index: gdb-stub.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/gdb-stub.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gdb-stub.c 23 Sep 2002 19:20:20 -0000 1.5 --- gdb-stub.c 29 Jan 2003 06:17:59 -0000 1.6 *************** *** 8,13 **** * for more details. * ! * Copyright (C) 2001 Tensilica Inc. ! * Authors: Scott Foehner <sfo...@te...> */ --- 8,13 ---- * for more details. * ! * Copyright (C) 2001 - 2002 Tensilica Inc. ! * Authors: Scott Foehner <sfo...@ya...> */ Index: handlers.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** handlers.S 28 Nov 2002 00:40:49 -0000 1.8 --- handlers.S 29 Jan 2003 06:17:59 -0000 1.9 *************** *** 12,20 **** * for more details. * ! * Copyright (C) 2001 Tensilica Inc. * ! * Authors: Marc Gauthier * Joe Taylor <jo...@te..., jo...@ya...> ! * Scott Foehner <sfo...@te...> (debug handler) */ --- 12,20 ---- * for more details. * ! * Copyright (C) 2001 - 2002 Tensilica Inc. * ! * Authors: Marc Gauthier <ma...@te...> <ma...@al...> * Joe Taylor <jo...@te..., jo...@ya...> ! * Scott Foehner <sfo...@ya...> (debug handler) */ Index: head.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/head.S,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** head.S 31 Dec 2002 23:35:24 -0000 1.3 --- head.S 29 Jan 2003 06:17:59 -0000 1.4 *************** *** 8,13 **** * for more details. * ! * Copyright (C) 2001 Tensilica Inc. ! * Authors: Marc Gauthier * Chris Zankel <za...@te...> <ch...@za...> * Kevin Chea --- 8,13 ---- * for more details. * ! * Copyright (C) 2001 - 2002 Tensilica Inc. ! * Authors: Marc Gauthier <ma...@te...> <ma...@al...> * Chris Zankel <za...@te...> <ch...@za...> * Kevin Chea Index: process.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/process.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** process.c 27 Jan 2003 18:24:41 -0000 1.5 --- process.c 29 Jan 2003 06:17:59 -0000 1.6 *************** *** 10,17 **** * Derived from MIPS. * ! * Copyright (C) 2001 Tensilica Inc. * Authors: Kevin Chea * Joe Taylor <jo...@te..., jo...@ya...> ! * Marc Gauthier */ --- 10,17 ---- * Derived from MIPS. * ! * Copyright (C) 2001 - 2003 Tensilica Inc. * Authors: Kevin Chea * Joe Taylor <jo...@te..., jo...@ya...> ! * Marc Gauthier <ma...@te..., ma...@al...> */ Index: ptrace.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/ptrace.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ptrace.c 28 Jan 2003 23:52:23 -0000 1.6 --- ptrace.c 29 Jan 2003 06:18:00 -0000 1.7 *************** *** 10,14 **** * Kevin D. Kissell, ke...@mi... and Carsten Langgaard, car...@mi... * Copyright (C) 1999 MIPS Technologies, Inc. ! * Scott Foehner, sfo...@te... and Joe Taylor, jo...@te... * Copyright (C) 2002 Tensilica, Inc. */ --- 10,14 ---- * Kevin D. Kissell, ke...@mi... and Carsten Langgaard, car...@mi... * Copyright (C) 1999 MIPS Technologies, Inc. ! * Scott Foehner <sfo...@ya...> and Joe Taylor <jo...@te...> * Copyright (C) 2002 Tensilica, Inc. */ Index: setup.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/setup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** setup.c 2 Dec 2002 21:05:09 -0000 1.3 --- setup.c 29 Jan 2003 06:18:00 -0000 1.4 *************** *** 5,13 **** * * Copyright (C) 1995 Linus Torvalds ! * Copyright (C) 2001 Tensilica Inc. * Author(s): Chris Zankel <za...@te...> <ch...@za...> * Joe Taylor <jo...@te..., jo...@ya...> * Kevin Chea ! * Marc Gauthier */ --- 5,13 ---- * * Copyright (C) 1995 Linus Torvalds ! * Copyright (C) 2001 - 2002 Tensilica Inc. * Author(s): Chris Zankel <za...@te...> <ch...@za...> * Joe Taylor <jo...@te..., jo...@ya...> * Kevin Chea ! * Marc Gauthier <ma...@te...> <ma...@al...> */ Index: syscall.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/syscall.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** syscall.c 28 Aug 2002 16:10:14 -0000 1.1.1.1 --- syscall.c 29 Jan 2003 06:18:00 -0000 1.2 *************** *** 8,15 **** * Copyright (C) 1995 - 2000 by Ralf Baechle * Copyright (C) 2000 Silicon Graphics, Inc. ! * Copyright (C) 2001 Tensilica Inc. * Authors: Joe Taylor <jo...@te..., jo...@ya...> * Kevin Chea ! * Marc Gauthier * * TODO: Implement the compatibility syscalls. --- 8,15 ---- * Copyright (C) 1995 - 2000 by Ralf Baechle * Copyright (C) 2000 Silicon Graphics, Inc. ! * Copyright (C) 2001 - 2002 Tensilica Inc. * Authors: Joe Taylor <jo...@te..., jo...@ya...> * Kevin Chea ! * Marc Gauthier <ma...@te...> <ma...@al...> * * TODO: Implement the compatibility syscalls. Index: traps.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** traps.c 28 Nov 2002 00:40:49 -0000 1.5 --- traps.c 29 Jan 2003 06:18:00 -0000 1.6 *************** *** 10,15 **** * Complete output from die() by Ulf Carlsson, 1998 * Copyright (C) 1999 Silicon Graphics, Inc. ! * Copyright (C) 2001 Tensilica Inc., by Joe Taylor, Kevin Chea, Marc Gauthier, ! * Scott Foehner */ --- 10,15 ---- * Complete output from die() by Ulf Carlsson, 1998 * Copyright (C) 1999 Silicon Graphics, Inc. ! * Copyright (C) 2001 - 2002 Tensilica Inc., by Joe Taylor, Kevin Chea, ! * Marc Gauthier, Scott Foehner */ Index: vectors.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/vectors.S,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vectors.S 27 Nov 2002 21:42:11 -0000 1.3 --- vectors.S 29 Jan 2003 06:18:00 -0000 1.4 *************** *** 11,16 **** * for more details. * ! * Copyright (C) 2001 Tensilica, Inc. ! * Authors: Marc Gauthier * Joe Taylor <jo...@te..., jo...@ya...> */ --- 11,16 ---- * for more details. * ! * Copyright (C) 2001 - 2002 Tensilica, Inc. ! * Authors: Marc Gauthier <ma...@te...> <ma...@al...> * Joe Taylor <jo...@te..., jo...@ya...> */ |
|
From: <jgr...@us...> - 2003-01-29 02:28:02
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm In directory sc8-pr-cvs1:/tmp/cvs-serv25968/arch/xtensa/mm Modified Files: cache.c Log Message: Need to include <asm/mmu_context.h> for NO_CONTEXT. Index: cache.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/cache.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cache.c 20 Jan 2003 22:44:16 -0000 1.2 --- cache.c 29 Jan 2003 02:27:59 -0000 1.3 *************** *** 32,35 **** --- 32,36 ---- #include <linux/sched.h> #include <linux/mm.h> + #include <asm/mmu_context.h> #include <asm/pgtable.h> #include <asm/system.h> |
|
From: <jgr...@us...> - 2003-01-28 23:52:27
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv3249/include/asm-xtensa
Modified Files:
ptrace.h
Log Message:
Restore old ptrace interface; strace application still needs it.
Index: ptrace.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/ptrace.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ptrace.h 25 Jan 2003 03:12:45 -0000 1.5
--- ptrace.h 28 Jan 2003 23:52:23 -0000 1.6
***************
*** 48,55 ****
! #if 0
/* XTFIXME: Old junk, removed in favor of the PTRACE_GETREGS method.
Delete after some time. [JET, 24 Jan 2003] */
/* Registers used by ptrace */
--- 48,56 ----
! #if 1
/* XTFIXME: Old junk, removed in favor of the PTRACE_GETREGS method.
Delete after some time. [JET, 24 Jan 2003] */
+ /* Still needed for strace. [jgreen, 28 Jan 2003] */
/* Registers used by ptrace */
***************
*** 75,79 ****
XCHAL_NUM_AREGS + ar_regno - wb*4)
! #endif /* if 0 */
/* Other PTRACE_* values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
--- 76,80 ----
XCHAL_NUM_AREGS + ar_regno - wb*4)
! #endif /* if 1 */
/* Other PTRACE_* values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
|
|
From: <jgr...@us...> - 2003-01-28 23:52:27
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv3249/arch/xtensa/kernel
Modified Files:
ptrace.c
Log Message:
Restore old ptrace interface; strace application still needs it.
Index: ptrace.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/ptrace.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ptrace.c 25 Jan 2003 03:12:45 -0000 1.5
--- ptrace.c 28 Jan 2003 23:52:23 -0000 1.6
***************
*** 35,42 ****
! #if 0
/* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
* after some time. [JET, 24 Jan 2003] */
/* Given a valid wb and ws, find the first valid "pane" */
--- 35,43 ----
! #if 1
/* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
* after some time. [JET, 24 Jan 2003] */
+ /* Still needed for strace. [jgreen, 28 Jan 2003] */
/* Given a valid wb and ws, find the first valid "pane" */
***************
*** 59,63 ****
}
! #endif /* if 0 */
/*
--- 60,64 ----
}
! #endif /* if 1 */
/*
***************
*** 135,146 ****
}
! #if 0
/* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
* after some time. [JET, 24 Jan 2003] */
/* Read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
struct pt_regs *regs;
unsigned long tmp;
--- 136,149 ----
}
! #if 1
/* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
* after some time. [JET, 24 Jan 2003] */
+ /* Still needed for strace. [jgreen, 28 Jan 2003] */
/* Read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
struct pt_regs *regs;
+ int ar_reg, a_reg, first_pane;
unsigned long tmp;
***************
*** 231,235 ****
}
! #endif /* if 0 */
case PTRACE_POKETEXT: /* write the word at location addr. */
--- 234,238 ----
}
! #endif /* if 1 */
case PTRACE_POKETEXT: /* write the word at location addr. */
***************
*** 244,254 ****
! #if 0
/* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
* after some time. [JET, 24 Jan 2003] */
case PTRACE_POKEUSR: {
struct pt_regs *regs;
unsigned long tmp;
res = 0;
--- 247,259 ----
! #if 1
/* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
* after some time. [JET, 24 Jan 2003] */
+ /* Still needed for strace. [jgreen, 28 Jan 2003] */
case PTRACE_POKEUSR: {
struct pt_regs *regs;
+ int ar_reg, a_reg, first_pane;
unsigned long tmp;
res = 0;
***************
*** 300,304 ****
}
! #endif /* if 0 */
case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
--- 305,309 ----
}
! #endif /* if 1 */
case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
|
|
From: <joe...@us...> - 2003-01-27 18:24:47
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv31452/include/asm-xtensa
Modified Files:
elf.h
Log Message:
Structural changes which are more compatible with gdb sources.
Index: elf.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/elf.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** elf.h 25 Jan 2003 03:12:45 -0000 1.2
--- elf.h 27 Jan 2003 18:24:42 -0000 1.3
***************
*** 29,33 ****
/*
* elf_gregset_t contains the application-level state in the following order:
! * Processor info: cpu_version, linux_version
* Processor state: pc, ps, exccause, excvaddr, wb, ws,
* lbeg, lend, lcount, sar
--- 29,33 ----
/*
* elf_gregset_t contains the application-level state in the following order:
! * Processor info: config_version, cpuxy
* Processor state: pc, ps, exccause, excvaddr, wb, ws,
* lbeg, lend, lcount, sar
***************
*** 35,41 ****
*/
! typedef unsigned int elf_greg_t;
! typedef struct elf_gregset_tag {
elf_greg_t xchal_config_id0;
--- 35,41 ----
*/
! typedef unsigned long elf_greg_t;
! typedef struct {
elf_greg_t xchal_config_id0;
***************
*** 55,61 ****
elf_greg_t ar[XCHAL_NUM_AREGS];
! } elf_gregset_t;
! #define ELF_NGREG (sizeof(elf_gregset_t) / sizeof(elf_greg_t))
--- 55,62 ----
elf_greg_t ar[XCHAL_NUM_AREGS];
! } xtensa_gregset_t;
! #define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t))
! typedef elf_greg_t elf_gregset_t[ELF_NGREG];
***************
*** 79,83 ****
#define ELF_CORE_COPY_REGS(_eregs, _pregs) xtensa_elf_core_copy_regs (&_eregs, _pregs);
! extern void xtensa_elf_core_copy_regs (elf_gregset_t *, struct pt_regs *);
--- 80,84 ----
#define ELF_CORE_COPY_REGS(_eregs, _pregs) xtensa_elf_core_copy_regs (&_eregs, _pregs);
! extern void xtensa_elf_core_copy_regs (xtensa_gregset_t *, struct pt_regs *);
|
|
From: <joe...@us...> - 2003-01-27 18:24:47
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv31452/arch/xtensa/kernel
Modified Files:
process.c
Log Message:
Structural changes which are more compatible with gdb sources.
Index: process.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/process.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** process.c 25 Jan 2003 03:12:45 -0000 1.4
--- process.c 27 Jan 2003 18:24:41 -0000 1.5
***************
*** 329,341 ****
/* do_copy_regs() gathers information from 'struct pt_regs' and
! * 'current->thread.aregs[]' to fill in the elf_gregset_t structure.
*
! * elf_gregset_t and 'struct pt_regs' are vastly different formats of
! * processor registers. Besides different ordering, elf_gregset_t
! * contains non-live register information that 'struct pt_regs' does
! * not. Exception handling (primarily) uses 'struct pt_regs'. Core
! * files and ptrace use elf_gregset_t. */
! void do_copy_regs (elf_gregset_t *elfregs, struct pt_regs *regs, struct task_struct *tsk)
{
int i, wb_offset; /* wb_offset must be signed */
--- 329,342 ----
/* do_copy_regs() gathers information from 'struct pt_regs' and
! * 'current->thread.aregs[]' to fill in the xtensa_gregset_t
! * structure.
*
! * xtensa_gregset_t and 'struct pt_regs' are vastly different formats
! * of processor registers. Besides different ordering,
! * xtensa_gregset_t contains non-live register information that
! * 'struct pt_regs' does not. Exception handling (primarily) uses
! * 'struct pt_regs'. Core files and ptrace use xtensa_gregset_t. */
! void do_copy_regs (xtensa_gregset_t *elfregs, struct pt_regs *regs, struct task_struct *tsk)
{
int i, wb_offset; /* wb_offset must be signed */
***************
*** 384,388 ****
}
! void xtensa_elf_core_copy_regs (elf_gregset_t *elfregs, struct pt_regs *regs)
{
do_copy_regs (elfregs, regs, current);
--- 385,389 ----
}
! void xtensa_elf_core_copy_regs (xtensa_gregset_t *elfregs, struct pt_regs *regs)
{
do_copy_regs (elfregs, regs, current);
***************
*** 392,396 ****
/* The inverse of do_copy_regs(). No error or sanity checking. */
! void do_restore_regs (elf_gregset_t *elfregs, struct pt_regs *regs, struct task_struct *tsk)
{
int i, wb_offset; /* wb_offset must be signed */
--- 393,397 ----
/* The inverse of do_copy_regs(). No error or sanity checking. */
! void do_restore_regs (xtensa_gregset_t *elfregs, struct pt_regs *regs, struct task_struct *tsk)
{
int i, wb_offset; /* wb_offset must be signed */
|
|
From: <joe...@us...> - 2003-01-25 03:12:49
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv9373/include/asm-xtensa
Modified Files:
elf.h ptrace.h
Log Message:
Kernel changes to support core dumps and a more efficient ptrace interface. TIE information is still missing.
Index: elf.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/elf.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** elf.h 28 Aug 2002 16:11:31 -0000 1.1.1.1
--- elf.h 25 Jan 2003 03:12:45 -0000 1.2
***************
*** 18,22 ****
#include <asm/ptrace.h>
- #include <asm/user.h>
#include <asm/page.h>
#include <xtensa/config/core.h>
--- 18,21 ----
***************
*** 26,32 ****
#define EM_XTENSA_OLD 0xABC7
! /* ELF register definitions */
- #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
/* TOTAL_CP_SIZE is a byte count. Round up ELF_NFPREG to the next
--- 25,62 ----
#define EM_XTENSA_OLD 0xABC7
! /* ELF register definitions. This is needed for core dump support. */
!
! /*
! * elf_gregset_t contains the application-level state in the following order:
! * Processor info: cpu_version, linux_version
! * Processor state: pc, ps, exccause, excvaddr, wb, ws,
! * lbeg, lend, lcount, sar
! * GP regs: ar0 - arXX
! */
!
! typedef unsigned int elf_greg_t;
!
! typedef struct elf_gregset_tag {
!
! elf_greg_t xchal_config_id0;
! elf_greg_t xchal_config_id1;
! elf_greg_t cpux;
! elf_greg_t cpuy;
! elf_greg_t pc;
! elf_greg_t ps;
! elf_greg_t exccause;
! elf_greg_t excvaddr;
! elf_greg_t wb;
! elf_greg_t ws;
! elf_greg_t lbeg;
! elf_greg_t lend;
! elf_greg_t lcount;
! elf_greg_t sar;
! elf_greg_t ar[XCHAL_NUM_AREGS];
!
! } elf_gregset_t;
!
! #define ELF_NGREG (sizeof(elf_gregset_t) / sizeof(elf_greg_t))
/* TOTAL_CP_SIZE is a byte count. Round up ELF_NFPREG to the next
***************
*** 45,53 ****
#define ELF_NFPREG (((TOTAL_CP_SIZE + 15) & ~15) / sizeof(elf_fpreg_t))
- typedef unsigned long elf_greg_t;
- typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
typedef double elf_fpreg_t;
! typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG] __attribute__ ((aligned(16)));
/*
--- 75,84 ----
#define ELF_NFPREG (((TOTAL_CP_SIZE + 15) & ~15) / sizeof(elf_fpreg_t))
typedef double elf_fpreg_t;
! typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
!
! #define ELF_CORE_COPY_REGS(_eregs, _pregs) xtensa_elf_core_copy_regs (&_eregs, _pregs);
! extern void xtensa_elf_core_copy_regs (elf_gregset_t *, struct pt_regs *);
!
/*
***************
*** 80,87 ****
#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
-
- #define ELF_CORE_COPY_REGS(_dest,_regs) \
- memcpy((char *) &_dest, (char *) _regs, \
- sizeof(struct pt_regs));
/* This yields a mask that user programs can use to figure out what
--- 111,114 ----
Index: ptrace.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/ptrace.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ptrace.h 23 Sep 2002 19:17:50 -0000 1.4
--- ptrace.h 25 Jan 2003 03:12:45 -0000 1.5
***************
*** 17,42 ****
#include <xtensa/config/core.h>
- /* Registers used by ptrace */
- #define REG_A_BASE 0xfc000000
- #define REG_AR_BASE 0x04000000
- #define REG_PC 0x14000000
- #define REG_PS 0x080000e6
- #define REG_WB 0x08000048
- #define REG_WS 0x08000049
- #define REG_LBEG 0x08000000
- #define REG_LEND 0x08000001
- #define REG_LCOUNT 0x08000002
- #define REG_SAR 0x08000003
- #define REG_DEPC 0x080000c0
- #define REG_EXCCAUSE 0x080000e8
- #define REG_EXCVADDR 0x080000ee
- #define SYSCALL_NR 0x1
-
- /* Note: can return illegal A reg numbers, i.e. > 15 */
- #define AR_REGNO_TO_A_REGNO(ar_regno, wb) \
- ((int)(ar_regno - wb*4) >= 0 ? \
- ar_regno - wb*4 : \
- XCHAL_NUM_AREGS + ar_regno - wb*4)
-
/* Offsets from EXCSAVE_1 value: */
--- 17,20 ----
***************
*** 69,72 ****
--- 47,85 ----
#define EXCTYPE_QUICKSPILL_SHIFT 1
+
+ #if 0
+
+ /* XTFIXME: Old junk, removed in favor of the PTRACE_GETREGS method.
+ Delete after some time. [JET, 24 Jan 2003] */
+
+ /* Registers used by ptrace */
+ #define REG_A_BASE 0xfc000000
+ #define REG_AR_BASE 0x04000000
+ #define REG_PC 0x14000000
+ #define REG_PS 0x080000e6
+ #define REG_WB 0x08000048
+ #define REG_WS 0x08000049
+ #define REG_LBEG 0x08000000
+ #define REG_LEND 0x08000001
+ #define REG_LCOUNT 0x08000002
+ #define REG_SAR 0x08000003
+ #define REG_DEPC 0x080000c0
+ #define REG_EXCCAUSE 0x080000e8
+ #define REG_EXCVADDR 0x080000ee
+ #define SYSCALL_NR 0x1
+
+ /* Note: can return illegal A reg numbers, i.e. > 15 */
+ #define AR_REGNO_TO_A_REGNO(ar_regno, wb) \
+ ((int)(ar_regno - wb*4) >= 0 ? \
+ ar_regno - wb*4 : \
+ XCHAL_NUM_AREGS + ar_regno - wb*4)
+
+ #endif /* if 0 */
+
+ /* Other PTRACE_* values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
+ #define PTRACE_GETREGS 12
+ #define PTRACE_SETREGS 13
+ #define PTRACE_GETFPREGS 14
+ #define PTRACE_SETFPREGS 15
#ifndef __ASSEMBLY__
|
|
From: <joe...@us...> - 2003-01-25 03:12:48
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv9373/arch/xtensa/kernel
Modified Files:
process.c ptrace.c
Log Message:
Kernel changes to support core dumps and a more efficient ptrace interface. TIE information is still missing.
Index: process.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/process.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** process.c 18 Oct 2002 21:57:26 -0000 1.3
--- process.c 25 Jan 2003 03:12:45 -0000 1.4
***************
*** 326,327 ****
--- 326,431 ----
return regs->aregs[0];
}
+
+
+ /* do_copy_regs() gathers information from 'struct pt_regs' and
+ * 'current->thread.aregs[]' to fill in the elf_gregset_t structure.
+ *
+ * elf_gregset_t and 'struct pt_regs' are vastly different formats of
+ * processor registers. Besides different ordering, elf_gregset_t
+ * contains non-live register information that 'struct pt_regs' does
+ * not. Exception handling (primarily) uses 'struct pt_regs'. Core
+ * files and ptrace use elf_gregset_t. */
+
+ void do_copy_regs (elf_gregset_t *elfregs, struct pt_regs *regs, struct task_struct *tsk)
+ {
+ int i, wb_offset; /* wb_offset must be signed */
+
+ elfregs->xchal_config_id0 = XCHAL_HW_CONFIGID0;
+ elfregs->xchal_config_id1 = XCHAL_HW_CONFIGID1;
+
+ __asm__ __volatile__ ("rsr %0, 176\n" : "=a" (i));
+ elfregs->cpux = i;
+ __asm__ __volatile__ ("rsr %0, 208\n" : "=a" (i));
+ elfregs->cpuy = i;
+
+ elfregs->pc = regs->pc;
+ elfregs->ps = regs->ps;
+ elfregs->exccause = regs->exccause;
+ elfregs->excvaddr = regs->excvaddr;
+ elfregs->wb = regs->wb;
+ elfregs->ws = regs->ws;
+ elfregs->lbeg = regs->lbeg;
+ elfregs->lend = regs->lend;
+ elfregs->lcount = regs->lcount;
+ elfregs->sar = regs->sar;
+
+ /* Clear everything. We don't have values for all of them, so
+ some remain zero. */
+ memset (elfregs->ar, 0, sizeof(elfregs->ar));
+
+ /* Copy regs from live window frame. */
+ wb_offset = regs->wb * 4;
+ for (i = 0; i < 16; i++)
+ /* using wb_offset as register number */
+ elfregs->ar[(wb_offset + i) % XCHAL_NUM_AREGS] = regs->aregs[i];
+
+ /* Copy regs from non-live registers.
+ regs->wmask indicates the number of window panes saved. */
+ wb_offset = regs->wb;
+ for (i = 0; i < regs->wmask; i++) {
+ /* using wb_offset as window-pane number */
+ if (--wb_offset < 0)
+ wb_offset = XCHAL_NUM_AREGS / 4;
+ elfregs->ar[wb_offset*4 + 0] = tsk->thread.regfile[i + 0];
+ elfregs->ar[wb_offset*4 + 1] = tsk->thread.regfile[i + 1];
+ elfregs->ar[wb_offset*4 + 2] = tsk->thread.regfile[i + 2];
+ elfregs->ar[wb_offset*4 + 3] = tsk->thread.regfile[i + 3];
+ }
+ }
+
+ void xtensa_elf_core_copy_regs (elf_gregset_t *elfregs, struct pt_regs *regs)
+ {
+ do_copy_regs (elfregs, regs, current);
+ }
+
+
+ /* The inverse of do_copy_regs(). No error or sanity checking. */
+
+ void do_restore_regs (elf_gregset_t *elfregs, struct pt_regs *regs, struct task_struct *tsk)
+ {
+ int i, wb_offset; /* wb_offset must be signed */
+
+ regs->pc = elfregs->pc;
+ regs->ps = elfregs->ps;
+ regs->exccause = elfregs->exccause;
+ regs->excvaddr = elfregs->excvaddr;
+ regs->wb = elfregs->wb;
+ regs->ws = elfregs->ws;
+ regs->lbeg = elfregs->lbeg;
+ regs->lend = elfregs->lend;
+ regs->lcount = elfregs->lcount;
+ regs->sar = elfregs->sar;
+
+ /* Clear everything. We don't have values for all of them, so
+ some remain zero. */
+ memset (tsk->thread.regfile, 0, sizeof(tsk->thread.regfile));
+
+ /* Copy regs from live window frame. */
+ wb_offset = elfregs->wb * 4;
+ for (i = 0; i < 16; i++)
+ /* using wb_offset as register number */
+ regs->aregs[i] = elfregs->ar[(wb_offset + i) % XCHAL_NUM_AREGS];
+
+ /* Copy regs from non-live registers.
+ regs->wmask indicates the number of window panes saved. */
+ wb_offset = elfregs->wb;
+ for (i = 0; i < regs->wmask; i++) {
+ /* using wb_offset as window-pane number */
+ if (--wb_offset < 0)
+ wb_offset = XCHAL_NUM_AREGS / 4;
+ tsk->thread.regfile[i + 0] = elfregs->ar[wb_offset*4 + 0];
+ tsk->thread.regfile[i + 1] = elfregs->ar[wb_offset*4 + 1];
+ tsk->thread.regfile[i + 2] = elfregs->ar[wb_offset*4 + 2];
+ tsk->thread.regfile[i + 3] = elfregs->ar[wb_offset*4 + 3];
+ }
+ }
Index: ptrace.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/ptrace.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ptrace.c 4 Oct 2002 06:30:55 -0000 1.4
--- ptrace.c 25 Jan 2003 03:12:45 -0000 1.5
***************
*** 10,14 ****
* Kevin D. Kissell, ke...@mi... and Carsten Langgaard, car...@mi...
* Copyright (C) 1999 MIPS Technologies, Inc.
! * Scott Foehner, sfo...@te...
* Copyright (C) 2002 Tensilica, Inc.
*/
--- 10,14 ----
* Kevin D. Kissell, ke...@mi... and Carsten Langgaard, car...@mi...
* Copyright (C) 1999 MIPS Technologies, Inc.
! * Scott Foehner, sfo...@te... and Joe Taylor, jo...@te...
* Copyright (C) 2002 Tensilica, Inc.
*/
***************
*** 27,33 ****
--- 27,43 ----
#include <asm/system.h>
#include <asm/uaccess.h>
+ #include <asm/elf.h>
#define PT_SINGLESTEP 0x10000
+ extern void do_copy_regs (elf_gregset_t *, struct pt_regs *, struct task_struct *);
+ extern void do_restore_regs (elf_gregset_t *, struct pt_regs *, struct task_struct *);
+
+
+ #if 0
+
+ /* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
+ * after some time. [JET, 24 Jan 2003] */
+
/* Given a valid wb and ws, find the first valid "pane" */
/* Pane is given as the distance from pane 0, which is wb */
***************
*** 48,52 ****
return count+1;
}
!
/*
--- 58,63 ----
return count+1;
}
!
! #endif /* if 0 */
/*
***************
*** 63,67 ****
{
struct task_struct *child;
! int res, ar_reg, a_reg, first_pane;
extern void save_fp(struct task_struct *);
--- 74,78 ----
{
struct task_struct *child;
! int res;
extern void save_fp(struct task_struct *);
***************
*** 123,126 ****
--- 134,143 ----
goto out;
}
+
+ #if 0
+
+ /* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
+ * after some time. [JET, 24 Jan 2003] */
+
/* Read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
***************
*** 128,133 ****
unsigned long tmp;
! regs = (struct pt_regs *)
! (((unsigned long) child) + __KSTK_TOS_OFFSET);
tmp = 0; /* Default return value. */
--- 145,149 ----
unsigned long tmp;
! regs = __KSTK_TOS(child);
tmp = 0; /* Default return value. */
***************
*** 214,217 ****
--- 230,236 ----
goto out;
}
+
+ #endif /* if 0 */
+
case PTRACE_POKETEXT: /* write the word at location addr. */
case PTRACE_POKEDATA:
***************
*** 222,231 ****
res = -EIO;
goto out;
case PTRACE_POKEUSR: {
struct pt_regs *regs;
unsigned long tmp;
res = 0;
! regs = (struct pt_regs *)
! (((unsigned long) child) + __KSTK_TOS_OFFSET);
switch (addr) {
--- 241,257 ----
res = -EIO;
goto out;
+
+
+
+ #if 0
+
+ /* XTFIXME: Removed in favor of the PTRACE_GETUSER interface. Delete
+ * after some time. [JET, 24 Jan 2003] */
+
case PTRACE_POKEUSR: {
struct pt_regs *regs;
unsigned long tmp;
res = 0;
! regs = __KSTK_TOS(child);
switch (addr) {
***************
*** 274,287 ****
}
! case PTRACE_SINGLESTEP:
! res = -EIO;
! if ((unsigned long) data > _NSIG)
! break;
! child->ptrace &= ~PT_TRACESYS;
! child->ptrace |= PT_SINGLESTEP;
! child->exit_code = data;
! wake_up_process(child);
! res = 0;
! break;
case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
--- 300,304 ----
}
! #endif /* if 0 */
case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
***************
*** 314,329 ****
break;
! case PTRACE_DETACH: /* detach a process that was attached. */
! res = ptrace_detach(child, data);
break;
! #if 0
! case PTRACE_SETOPTIONS:
! if (data & PTRACE_O_TRACESYSGOOD)
! child->ptrace |= PT_TRACESYSGOOD;
! else
! child->ptrace &= ~PT_TRACESYSGOOD;
res = 0;
break;
! #endif
default:
res = -EIO;
--- 331,397 ----
break;
! case PTRACE_SINGLESTEP:
! res = -EIO;
! if ((unsigned long) data > _NSIG)
! break;
! child->ptrace &= ~PT_TRACESYS;
! child->ptrace |= PT_SINGLESTEP;
! child->exit_code = data;
! wake_up_process(child);
! res = 0;
break;
!
! case PTRACE_GETREGS:
! {
! /* 'data' points to user memory in which to write.
! * Mainly due to the non-live register values, we
! * reformat the register values into something more
! * standard. For convenience, we use the handy
! * elf_gregset_t format. */
!
! elf_gregset_t format;
! struct pt_regs *regs = __KSTK_TOS(child);
!
! do_copy_regs (&format, regs, child);
!
! /* Now, copy to user space nice and easy... */
res = 0;
+ if (copy_to_user((void *)data, &format, sizeof(elf_gregset_t)))
+ res = -EFAULT;
break;
! }
!
! case PTRACE_SETREGS:
! {
! /* 'data' points to user memory that contains the new
! * values in the elf_gregset_t format. */
!
! elf_gregset_t format;
! struct pt_regs *regs = __KSTK_TOS(child);
!
! if (copy_from_user(&format, (void *)data, sizeof(elf_gregset_t))) {
! res = -EFAULT;
! break;
! }
!
! /* XTFIXME: Perhaps we want some sanity checks on
! * these user-space values? See ARM version. Are
! * debuggers a security concern? */
!
! do_restore_regs (&format, regs, child);
!
! break;
! }
!
! case PTRACE_GETFPREGS:
! break;
!
! case PTRACE_SETFPREGS:
! break;
!
! case PTRACE_DETACH: /* detach a process that was attached. */
! res = ptrace_detach(child, data);
! break;
!
default:
res = -EIO;
|
|
From: <joe...@us...> - 2003-01-20 23:22:14
|
Update of /cvsroot/xtensa/linux/arch/xtensa In directory sc8-pr-cvs1:/tmp/cvs-serv811/arch/xtensa Modified Files: Makefile Log Message: We can remove this build hack because the new tools can better identify frame pointers. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 21 Nov 2002 20:57:54 -0000 1.6 --- Makefile 20 Jan 2003 23:22:08 -0000 1.7 *************** *** 133,152 **** include/asm-xtensa/xtensa/config - # XTFIXME: Xtensa frame pointers can theoretically be in any register, - # and STABS debugging format doesn't allow representation of this. - # DWARF format does. Early on (prior to March 2000), the hack - # solution in the tools was to insert local ".FRAME" symbols for the - # debugger to read later and do its thing. Now our tools use DWARF - # format, but the pesky .FRAME symbols still clutter the symbol table. - # If we don't filter then out of System.map, then things like 'ps -eo - # wchan' often return one of these meaningless .FRAME symbols instead - # of what we really want. The tools will eventually drop STABS or - # stop emitting .FRAME if the debug format is DWARF, but for now, we - # have a Makefile hack to undo the debugging hack. [JET: 6 Sep 2002] - - REMOVE_DEBUG_SYMBOLS_HACK := (cat System.map | grep -v '\.FRAME' > System.map.tmp; mv -f System.map.tmp System.map) - Image zImage Image.initrd zImage.initrd: $(CONFIGURE) vmlinux - $(REMOVE_DEBUG_SYMBOLS_HACK) $(MAKEBOOT) $@ --- 133,137 ---- |