xtensa-cvscommit Mailing List for xtensa
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
|
|
From: Mitul S. <mit...@ta...> - 2006-05-04 12:07:56
|
Hi all, I am compiling Linux kernel using CMD Shell ( configured when along with installed tools in Xplorer). I using the command as follows: xt-make ARCH=xtensa vmlinux This is giving me error "Makefile:995: ***multiple targets patterns. Stop." Is there any way to overcome this or some other method to compile the linux kernel using the shell. Please help me in this regard. Regards, Mitul The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s)and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender or adm...@ta... |
|
From: Alice H. <ahe...@us...> - 2004-06-02 23:57:39
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23925/arch/xtensa/boot/boot-redboot Modified Files: bootstrap.S Log Message: Save the load address of the boot image before clearing a0 so the ramdisk image loads properly. Index: bootstrap.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/bootstrap.S,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bootstrap.S 7 May 2003 18:55:20 -0000 1.5 --- bootstrap.S 2 Jun 2004 23:57:29 -0000 1.6 *************** *** 171,174 **** --- 171,175 ---- s32i a11, a9, 0 + mov a3, a0 movi a0, 0 *************** *** 213,223 **** icache_invalidate_all a5, a6 ! movi a5, __start ! movi a3, boot_initrd_start ! movi a4, boot_initrd_end ! sub a3, a3, a5 ! sub a4, a4, a5 ! add a3, a0, a3 ! add a4, a0, a4 # a2 Boot parameter list --- 214,224 ---- icache_invalidate_all a5, a6 ! movi a5, __start ! movi a4, boot_initrd_end ! movi a6, boot_initrd_start ! sub a4, a4, a5 ! sub a6, a6, a5 ! add a4, a3, a4 ! add a3, a3, a6 # a2 Boot parameter list |
|
From: Joe T. <joe...@us...> - 2004-05-21 19:03:21
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24932 Modified Files: vectors.S handlers.S Log Message: Handle debug exceptions properly: 1. vectors.S: Change the debug-vector register usage to match RedBoot's. 2. handlers.S: Check PS.EXCM *before* clobbering DEPC. Index: handlers.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** handlers.S 12 Apr 2004 22:07:18 -0000 1.20 --- handlers.S 21 May 2004 19:03:12 -0000 1.21 *************** *** 2842,2847 **** rsr a0, EPS + XCHAL_DEBUGLEVEL // Check exception vs. user vs. kernel mode - wsr a2, DEPC // preserve a2 so we can use it bbsi.l a0, PS_EXCM_SHIFT, 3f // jump if in exception mode bbsi.l a0, PS_UM_SHIFT, 1f // jump if in user mode --- 2842,2847 ---- rsr a0, EPS + XCHAL_DEBUGLEVEL // Check exception vs. user vs. kernel mode bbsi.l a0, PS_EXCM_SHIFT, 3f // jump if in exception mode + wsr a2, DEPC // preserve a2 so we can use it bbsi.l a0, PS_UM_SHIFT, 1f // jump if in user mode Index: vectors.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/vectors.S,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** vectors.S 9 May 2003 20:28:39 -0000 1.9 --- vectors.S 21 May 2004 19:03:12 -0000 1.10 *************** *** 597,603 **** _DebugInterruptVector: ! wsr a3, EXCSAVE + XCHAL_DEBUGLEVEL ! movi a3, xthal_debugexc_defhndlr_nw ! jx a3 .endfunc // _DebugInterruptVector --- 597,602 ---- _DebugInterruptVector: ! xsr a0, EXCSAVE + XCHAL_DEBUGLEVEL ! jx a0 .endfunc // _DebugInterruptVector |
|
From: Joe T. <joe...@us...> - 2004-05-17 22:09:05
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14068 Modified Files: msgbuf.h Log Message: Provide big-endian version of 64-bit fields in msq struct. Index: msgbuf.h =================================================================== RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/msgbuf.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** msgbuf.h 15 Feb 2003 02:02:40 -0000 1.2 --- msgbuf.h 17 May 2004 22:08:54 -0000 1.3 *************** *** 20,23 **** --- 20,31 ---- struct msqid64_ds { struct ipc64_perm msg_perm; + #if XCHAL_HAVE_BE + unsigned long __unused1; + __kernel_time_t msg_stime; /* last msgsnd time */ + unsigned long __unused2; + __kernel_time_t msg_rtime; /* last msgrcv time */ + unsigned long __unused3; + __kernel_time_t msg_ctime; /* last change time */ + #elif XCHAL_HAVE_LE __kernel_time_t msg_stime; /* last msgsnd time */ unsigned long __unused1; *************** *** 26,29 **** --- 34,40 ---- __kernel_time_t msg_ctime; /* last change time */ unsigned long __unused3; + #else + # error endian order not defined + #endif unsigned long msg_cbytes; /* current number of bytes on queue */ unsigned long msg_qnum; /* number of messages in queue */ |
|
From: <joe...@us...> - 2004-01-07 23:09:19
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv14851/arch/xtensa/kernel
Modified Files:
traps.c
Log Message:
Instead of panic()'ing, kill user processes that cause unhandled exceptions (e.g., privilege instructions).
Index: traps.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** traps.c 7 Jul 2003 22:41:25 -0000 1.16
--- traps.c 7 Jan 2004 23:09:15 -0000 1.17
***************
*** 101,124 ****
{ XCHAL_EXCCAUSE_SPECULATION, "Speculation" },
{ XCHAL_EXCCAUSE_PRIVILEGED, "Privileged Instruction" },
! { XCHAL_EXCCAUSE_ITLB_MISS, "ITlb Miss Exception" },
! { XCHAL_EXCCAUSE_ITLB_MULTIHIT, "ITlb Mutltihit Exception" },
! { XCHAL_EXCCAUSE_ITLB_PRIVILEGE, "ITlb Privilege Exception" },
! { XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION, "ITlb Size Restriction Exception" },
! { XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE, "Fetch Cache Attribute Exception" },
! { XCHAL_EXCCAUSE_DTLB_MISS, "DTlb Miss Exception" },
! { XCHAL_EXCCAUSE_DTLB_MULTIHIT, "DTlb Multihit Exception" },
! { XCHAL_EXCCAUSE_DTLB_PRIVILEGE, "DTlb Privilege Exception" },
! { XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION, "DTlb Size Restriction Exception" },
! { XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE, "Load Cache Attribute Exception" },
! { XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE, "Store Cache Attribute Exception" },
! { 32+0, "Coprocessor 0 Disabled Exception" },
! { 32+1, "Coprocessor 1 Disabled Exception" },
! { 32+2, "Coprocessor 2 Disabled Exception" },
! { 32+3, "Coprocessor 3 Disabled Exception" },
! { 32+4, "Coprocessor 4 Disabled Exception" },
! { 32+5, "Coprocessor 5 Disabled Exception" },
! { 32+6, "Coprocessor 6 Disabled Exception" },
! { 32+7, "Coprocessor 7 Disabled Exception" },
! { XCHAL_EXCCAUSE_FLOATING_POINT, "Floating Point Exception" }
};
--- 101,124 ----
{ XCHAL_EXCCAUSE_SPECULATION, "Speculation" },
{ XCHAL_EXCCAUSE_PRIVILEGED, "Privileged Instruction" },
! { XCHAL_EXCCAUSE_ITLB_MISS, "ITlb Miss" },
! { XCHAL_EXCCAUSE_ITLB_MULTIHIT, "ITlb Mutltihit" },
! { XCHAL_EXCCAUSE_ITLB_PRIVILEGE, "ITlb Privilege" },
! { XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION, "ITlb Size Restriction" },
! { XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE, "Fetch Cache Attribute" },
! { XCHAL_EXCCAUSE_DTLB_MISS, "DTlb Miss" },
! { XCHAL_EXCCAUSE_DTLB_MULTIHIT, "DTlb Multihit" },
! { XCHAL_EXCCAUSE_DTLB_PRIVILEGE, "DTlb Privilege" },
! { XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION, "DTlb Size Restriction" },
! { XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE, "Load Cache Attribute" },
! { XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE, "Store Cache Attribute" },
! { 32+0, "Coprocessor 0 Disabled" },
! { 32+1, "Coprocessor 1 Disabled" },
! { 32+2, "Coprocessor 2 Disabled" },
! { 32+3, "Coprocessor 3 Disabled" },
! { 32+4, "Coprocessor 4 Disabled" },
! { 32+5, "Coprocessor 5 Disabled" },
! { 32+6, "Coprocessor 6 Disabled" },
! { 32+7, "Coprocessor 7 Disabled" },
! { XCHAL_EXCCAUSE_FLOATING_POINT, "Floating Point" }
};
***************
*** 127,136 ****
void do_unhandled(struct pt_regs *regs)
{
- /*
- * Game over - no way to handle this if it ever occurs.
- * Most probably caused by a new unknown cpu type or
- * after another deadly hard/software error.
- */
-
int i;
char *str = missing_translation;
--- 127,130 ----
***************
*** 142,157 ****
}
! panic("Caught unhandled exception - should not happen.\n"
! "\tEXCCAUSE is %d, %s", regs->exccause, str);
! }
!
! void do_reserved(struct pt_regs *regs)
! {
! /*
! * Game over - no way to handle this if it ever occurs.
! * Most probably caused by a new unknown cpu type or
! * after another deadly hard/software error.
! */
! panic("Caught reserved exception - should not happen.");
}
--- 136,150 ----
}
! if (user_mode(regs)) {
! /* If in user mode, kill it. */
! printk("Caught unhandled exception (%s, exccause=%d)"
! " in '%s' (pid=%d, pc=%#010x)\n",
! str, regs->exccause, current->comm, current->pid, regs->pc);
! force_sig(SIGKILL, current);
! } else {
! /* If in kernel mode, we're in trouble. */
! panic("Caught unhandled exception (%s, exccause=%d, pc=%#010x)\n",
! str, regs->exccause, regs->pc);
! }
}
|
|
From: <joe...@us...> - 2003-08-14 17:53:07
|
Update of /cvsroot/xtensa/linux/drivers/net
In directory sc8-pr-cvs1:/tmp/cvs-serv5156/drivers/net
Modified Files:
xtsonic.c
Log Message:
The XT2000 platform requires the SBUS (synchronous bus) flag in the DCR.
The Sonic chip works only accidentally at lower clock speeds.
Index: xtsonic.c
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/xtsonic.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** xtsonic.c 13 Feb 2003 18:19:23 -0000 1.5
--- xtsonic.c 14 Aug 2003 17:52:11 -0000 1.6
***************
*** 154,158 ****
*/
SONIC_WRITE(SONIC_CMD,SONIC_CR_RST);
! SONIC_WRITE(SONIC_DCR,SONIC_DCR_WC0|SONIC_DCR_DW|SONIC_DCR_LBR);
SONIC_WRITE(SONIC_CEP,0);
SONIC_WRITE(SONIC_IMR,0);
--- 154,158 ----
*/
SONIC_WRITE(SONIC_CMD,SONIC_CR_RST);
! SONIC_WRITE(SONIC_DCR,SONIC_DCR_WC0|SONIC_DCR_DW|SONIC_DCR_LBR|SONIC_DCR_SBUS);
SONIC_WRITE(SONIC_CEP,0);
SONIC_WRITE(SONIC_IMR,0);
|
|
From: <joe...@us...> - 2003-08-07 21:20:58
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm In directory sc8-pr-cvs1:/tmp/cvs-serv8290/arch/xtensa/mm Modified Files: fault.c Log Message: Also require kernel mode before jumping to handle a vmalloc fault. Index: fault.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/fault.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** fault.c 30 Jul 2003 21:26:46 -0000 1.8 --- fault.c 7 Aug 2003 21:20:56 -0000 1.9 *************** *** 140,145 **** * We fault-in kernel-space virtual memory on-demand. The * 'reference' page table is init_mm.pgd. */ ! if ((address >= TASK_SIZE) && (regs->pc >= TASK_SIZE)) goto vmalloc_fault; --- 140,148 ---- * We fault-in kernel-space virtual memory on-demand. The * 'reference' page table is init_mm.pgd. + * + * XTFIXME: I think "regs->pc >= TASK_SIZE" is unnecesary due to the + * !user_mode(regs) condition, but we're too close to a release candidate. */ ! if (address >= TASK_SIZE && regs->pc >= TASK_SIZE && !user_mode(regs)) goto vmalloc_fault; |
|
From: <joe...@us...> - 2003-07-30 21:26:49
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm
In directory sc8-pr-cvs1:/tmp/cvs-serv2296/arch/xtensa/mm
Modified Files:
fault.c
Log Message:
Patch a missed store-exception condition that should be passed on as a good area.
Index: fault.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/fault.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** fault.c 1 Apr 2003 22:28:34 -0000 1.7
--- fault.c 30 Jul 2003 21:26:46 -0000 1.8
***************
*** 250,257 ****
else xt_staletlb();
-
- /* XTFIXME: Use 3 for now, but is it correct? The
- kernel uses 'write' value passed in
- handle_mm_fault() as a boolean variable only. */
write = 3;
break;
--- 250,253 ----
***************
*** 290,307 ****
info.si_code = SEGV_ACCERR;
! /* XTFIXME: Should the following if-statement handle the
! write==3 case? I couldn't think of one off-hand, and
! perhaps the load case encompases that condition. [jet, 13
! mar 2001] */
!
! if (write == 1) { /* store */
if (!(vma->vm_flags & VM_WRITE))
goto bad_area;
! } else if(write == 2) { /* i-fetch */
if (!(vma->vm_flags & VM_EXEC))
goto bad_area;
! } else { /* load */
! if (!(vma->vm_flags & VM_READ))
goto bad_area;
}
--- 286,307 ----
info.si_code = SEGV_ACCERR;
! switch (write) {
! case 0: /* load */
! if (!(vma->vm_flags & VM_READ))
! goto bad_area;
! break;
! case 1: /* store */
if (!(vma->vm_flags & VM_WRITE))
goto bad_area;
! break;
! case 2: /* i-fetch */
if (!(vma->vm_flags & VM_EXEC))
goto bad_area;
! break;
! case 3: /* load or store */
! default:
! if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
goto bad_area;
+ break;
}
|
|
From: <joe...@us...> - 2003-07-25 00:22:32
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv3298/include/asm-xtensa
Modified Files:
ipcbuf.h pgtable.h timex.h uaccess.h user.h
Log Message:
ipcbuf.h: Change ipcbuf structure to match glibc's.
pgtable.h: Ensure PTEs are set to user pages.
timex.h: Remove unneeded CLOCK_TICK_RATE for ISS platform.
uaccess.h: Define assembler-version task size.
user.h: Replace contents with something obvious that indicates it's entirely unused.
Index: ipcbuf.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/ipcbuf.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ipcbuf.h 15 Feb 2003 02:02:40 -0000 1.2
--- ipcbuf.h 25 Jul 2003 00:22:29 -0000 1.3
***************
*** 9,15 ****
* between kernel and user space.
*
! * Pad space is left for:
! * - 32-bit mode_t and seq
! * - 2 miscellaneous 32-bit values
*
* This file is subject to the terms and conditions of the GNU General
--- 9,13 ----
* between kernel and user space.
*
! * Pad space is left for 2 miscellaneous 32-bit values.
*
* This file is subject to the terms and conditions of the GNU General
***************
*** 27,35 ****
__kernel_gid32_t cgid;
__kernel_mode_t mode;
! unsigned short __pad1;
! unsigned short seq;
! unsigned short __pad2;
! unsigned long __unused1;
! unsigned long __unused2;
};
--- 25,31 ----
__kernel_gid32_t cgid;
__kernel_mode_t mode;
! unsigned long int seq;
! unsigned long int __unused1;
! unsigned long int __unused2;
};
Index: pgtable.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/pgtable.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** pgtable.h 1 Apr 2003 22:26:53 -0000 1.11
--- pgtable.h 25 Jul 2003 00:22:29 -0000 1.12
***************
*** 699,704 ****
#define SWP_OFFSET(x) ((x).val >> 13)
#define SWP_ENTRY(type,offset) ((swp_entry_t) { ((type) << 7) | ((offset) << 13) })
! #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
! #define swp_entry_to_pte(x) ((pte_t) { (x).val })
--- 699,704 ----
#define SWP_OFFSET(x) ((x).val >> 13)
#define SWP_ENTRY(type,offset) ((swp_entry_t) { ((type) << 7) | ((offset) << 13) })
! #define pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) & ~_PAGE_RING_MASK })
! #define swp_entry_to_pte(x) __pte( (x).val | _PAGE_USER )
Index: timex.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/timex.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** timex.h 8 Jan 2003 23:30:31 -0000 1.2
--- timex.h 25 Jul 2003 00:22:29 -0000 1.3
***************
*** 27,41 ****
#define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT)
- /* Striving for a 60 Hz system clock, assume 1 MHz during iss and 10
- MHz on the simulation hardware (XT2000?) */
-
- #ifdef XTENSA_ISS
- #define CLOCK_TICK_RATE 1000000
- #else
extern unsigned clock_tick_rate;
#define CLOCK_TICK_RATE clock_tick_rate
- #endif
! #define LINUX_TIMER_INTERVAL ( CLOCK_TICK_RATE/HZ )
typedef unsigned long long cycles_t;
--- 27,34 ----
#define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT)
extern unsigned clock_tick_rate;
#define CLOCK_TICK_RATE clock_tick_rate
! #define LINUX_TIMER_INTERVAL ( CLOCK_TICK_RATE / HZ )
typedef unsigned long long cycles_t;
Index: uaccess.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/uaccess.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** uaccess.h 7 Jul 2003 22:41:59 -0000 1.4
--- uaccess.h 25 Jul 2003 00:22:29 -0000 1.5
***************
*** 112,116 ****
*/
.macro user_ok aa, as, at, error
! movi \at, (TASK_SIZE+1)
bgeu \as, \at, \error
sub \at, \at, \as
--- 112,116 ----
*/
.macro user_ok aa, as, at, error
! movi \at, (TASK_SIZE_ASM+1)
bgeu \as, \at, \error
sub \at, \at, \as
Index: user.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/user.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** user.h 7 Feb 2003 02:03:34 -0000 1.2
--- user.h 25 Jul 2003 00:22:29 -0000 1.3
***************
*** 5,72 ****
* include/asm-xtensa/user.h
*
- * Xtensa Processor version.
- *
* 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.
*
- * Derived from SH.
- *
* Copyright (C) 2001 - 2003 Tensilica Inc.
*/
- #include <linux/types.h>
- #include <asm/ptrace.h>
- #include <asm/page.h>
- #include <asm/elf.h>
! #if 0 /* not used for Xtensa? */
! /*
! * Core file format: The core file is written in such a way that gdb
! * can understand it and provide useful information to the user (under
! * linux we use the `trad-core' bfd). The file contents are as follows:
! *
! * upage: 1 page consisting of a user struct that tells gdb
! * what is present in the file. Directly after this is a
! * copy of the task_struct, which is currently not used by gdb,
! * but it may come in handy at some point. All of the registers
! * are stored as part of the upage. The upage should always be
! * only one page long.
! * data: The data segment follows next. We use current->end_text to
! * current->brk to pick up all of the user variables, plus any memory
! * that may have been sbrk'ed. No attempt is made to determine if a
! * page is demand-zero or if a page is totally unused, we just cover
! * the entire range. All of the addresses are rounded in such a way
! * that an integral number of pages is written.
! * stack: We need the stack information in order to get a meaningful
! * backtrace. We need to write the data from usp to
! * current->start_stack, so we round each of these in order to be able
! * to write an integer number of pages.
! */
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) */
! size_t u_ssize; /* stack size (pages) */
! unsigned long start_code; /* text starting address */
! unsigned long start_data; /* data starting address */
! unsigned long start_stack; /* stack starting address */
! long int signal; /* signal causing core dump */
! struct regs * u_ar0; /* help gdb find registers */
! unsigned long magic; /* identifies a core file */
! char u_comm[32]; /* user command name */
};
-
- #define NBPG PAGE_SIZE
- #define UPAGES 1
- #define HOST_TEXT_START_ADDR (u.start_code)
- #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 */
--- 5,24 ----
* include/asm-xtensa/user.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) 2001 - 2003 Tensilica Inc.
*/
! /* 'struct user' is only for a.out file formats. Xtensa doesn't
! * support the a.out format. We provide a dummy definition to resolve
! * compiler warnings in a generic kernel file. */
struct user {
! int __dont_use_this_struct;
! int __aout_not_supported_on_xtensa;
};
#endif /* __ASM_XTENSA_USER_H */
|
|
From: <joe...@us...> - 2003-07-25 00:19:42
|
Update of /cvsroot/xtensa/linux/arch/xtensa/platform-iss
In directory sc8-pr-cvs1:/tmp/cvs-serv3104/arch/xtensa/platform-iss
Modified Files:
console.c
Log Message:
Fix multiple-defined symbols which causes build to fail.
Index: console.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/platform-iss/console.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** console.c 13 Feb 2003 18:19:22 -0000 1.2
--- console.c 25 Jul 2003 00:19:37 -0000 1.3
***************
*** 400,404 ****
}
! int rs_read_proc(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
--- 400,404 ----
}
! static int rs_read_proc(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
|
|
From: <joe...@us...> - 2003-07-25 00:17:20
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm
In directory sc8-pr-cvs1:/tmp/cvs-serv2854/arch/xtensa/mm
Modified Files:
cache.c
Log Message:
Cache aliasing comments and conditionals only.
Index: cache.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/cache.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** cache.c 1 Apr 2003 22:28:33 -0000 1.9
--- cache.c 25 Jul 2003 00:17:17 -0000 1.10
***************
*** 274,277 ****
--- 274,286 ----
static struct semaphore dealias_page_sem;
+ /*
+ * Normally, clear_user_page() is a macro in page.h
+ * that maps to clear_page() that maps to clear_page_asm()
+ * in loadmmu.c -- this simply zeroes all bytes in the
+ * page pointed to by 'to'.
+ *
+ * This version is used when there is page aliasing... (!?!?).
+ */
+ #if XTENSA_CACHE_ALIAS
void clear_user_page(void *to, unsigned long address)
{
***************
*** 309,313 ****
new_to = new_to + (address & XT_CACHE_ALIAS_BITS);
vpnval = new_to + WIRED_WAY_FOR_COPY_USER_PAGE;
! pteval = mk_pte( topage, PAGE_KERNEL);
down(&dealias_page_sem);
write_dtlb_entry(pteval, vpnval);
--- 318,322 ----
new_to = new_to + (address & XT_CACHE_ALIAS_BITS);
vpnval = new_to + WIRED_WAY_FOR_COPY_USER_PAGE;
! pteval = mk_pte( topage, PAGE_KERNEL); /*FIXME: make this PAGE_USER!?!?*/
down(&dealias_page_sem);
write_dtlb_entry(pteval, vpnval);
***************
*** 327,330 ****
--- 336,340 ----
}
}
+ #endif /* XTENSA_CACHE_ALIAS */
***************
*** 367,371 ****
new_to = new_to + (address & XT_CACHE_ALIAS_BITS);
vpnval = new_to + WIRED_WAY_FOR_COPY_USER_PAGE;
! pteval = mk_pte( topage, PAGE_KERNEL);
down(&dealias_page_sem);
write_dtlb_entry(pteval, vpnval);
--- 377,381 ----
new_to = new_to + (address & XT_CACHE_ALIAS_BITS);
vpnval = new_to + WIRED_WAY_FOR_COPY_USER_PAGE;
! pteval = mk_pte( topage, PAGE_KERNEL); /*FIXME: make this PAGE_USER!?!?*/
down(&dealias_page_sem);
write_dtlb_entry(pteval, vpnval);
|
|
From: <joe...@us...> - 2003-07-25 00:16:30
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv2521/arch/xtensa/kernel
Modified Files:
setup.c syscall.c syscalls.h
Log Message:
If ISS platform, return control to ISS on kernel panic to conserve host resources.
Provide arg wrappers for pread/pwrite system calls to match the Xtensa ABI.
Correct an arg count, and point to new pread/pwrite system calls.
Index: setup.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/setup.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** setup.c 12 Jun 2003 23:43:53 -0000 1.13
--- setup.c 25 Jul 2003 00:16:28 -0000 1.14
***************
*** 270,273 ****
--- 270,279 ----
retpc = next_retpc;
}
+ #ifdef CONFIG_XTENSA_PLATFORM_ISS
+ /* Since ISS will now just hang and consume host resources,
+ return control to gdb. */
+ asm volatile ("movi a2, -1\n\t"
+ "simcall\n");
+ #endif
return NOTIFY_DONE;
}
Index: syscall.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/syscall.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** syscall.c 29 Jan 2003 06:18:00 -0000 1.2
--- syscall.c 25 Jul 2003 00:16:28 -0000 1.3
***************
*** 143,146 ****
--- 143,164 ----
+ /* Patch up argument passing. Normal system-call dispatch cannot
+ * follow ABI requirements related to passing 64-bit arguments to
+ * functions. 64-bit arguments must begin on odd-numbered
+ * register. 0 arg is a dummy, unused arg. */
+
+ asmlinkage ssize_t sys_pread_args(unsigned int fd, char * buf, size_t count,
+ unsigned int pos_hi, unsigned int pos_lo)
+ {
+ return sys_pread(fd, buf, count, 0, pos_hi, pos_lo);
+ }
+
+ asmlinkage ssize_t sys_pwrite_args(unsigned int fd, char * buf, size_t count,
+ unsigned int pos_hi, unsigned int pos_lo)
+ {
+ return sys_pwrite(fd, buf, count, 0, pos_hi, pos_lo);
+ }
+
+
/*
* Compacrapability ...
Index: syscalls.h
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/syscalls.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** syscalls.h 15 Apr 2003 17:55:04 -0000 1.4
--- syscalls.h 25 Jul 2003 00:16:28 -0000 1.5
***************
*** 176,180 ****
SYS(sys_ni_syscall, 0) /* 150 */
SYS(sys_getsid, 1)
! SYS(sys_fdatasync, 0)
SYS(sys_sysctl, 1)
SYS(sys_mlock, 2)
--- 176,180 ----
SYS(sys_ni_syscall, 0) /* 150 */
SYS(sys_getsid, 1)
! SYS(sys_fdatasync, 1)
SYS(sys_sysctl, 1)
SYS(sys_mlock, 2)
***************
*** 224,229 ****
SYS(sys_rt_sigqueueinfo, 3)
SYS(sys_rt_sigsuspend, 0)
! SYS(sys_pread, 6) /* 200 */
! SYS(sys_pwrite, 6)
SYS(sys_chown, 3)
SYS(sys_getcwd, 2)
--- 224,229 ----
SYS(sys_rt_sigqueueinfo, 3)
SYS(sys_rt_sigsuspend, 0)
! SYS(sys_pread_args, 5) /* 200 */
! SYS(sys_pwrite_args, 5)
SYS(sys_chown, 3)
SYS(sys_getcwd, 2)
|
|
From: <joe...@us...> - 2003-07-25 00:13:54
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa In directory sc8-pr-cvs1:/tmp/cvs-serv2139/include/asm-xtensa Modified Files: processor.h elf.h Log Message: Resolve compiler warnings. Remove dead code. Provide assembler version of task size macro. Change the default personality. Index: processor.h =================================================================== RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/processor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** processor.h 20 Mar 2003 20:42:37 -0000 1.6 --- processor.h 25 Jul 2003 00:13:51 -0000 1.7 *************** *** 25,29 **** * applies to the stack as well. */ ! #define TASK_SIZE 0x40000000 --- 25,31 ---- * applies to the stack as well. */ ! #define TASK_SIZE (0x40000000UL) ! /* The assembler doesn't like the UL suffix on constants. */ ! #define TASK_SIZE_ASM (0x40000000) *************** *** 63,71 **** #define JUST_KRETADDR(x) (((x) & WI_MASK) | 0xc0000000) ! #if (TASK_SIZE > 0x40000000) #error Bad window-increment replacement in JUST_RETADDR above #endif ! #if (XCHAL_KSEG_CACHED_VADDR < 0xc0000000) #error Bad window-increment replacement in JUST_KRETADDR above #endif --- 65,73 ---- #define JUST_KRETADDR(x) (((x) & WI_MASK) | 0xc0000000) ! #if (TASK_SIZE > 0x40000000UL) #error Bad window-increment replacement in JUST_RETADDR above #endif ! #if (XCHAL_KSEG_CACHED_VADDR < 0xc0000000UL) #error Bad window-increment replacement in JUST_KRETADDR above #endif Index: elf.h =================================================================== RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/elf.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** elf.h 13 Feb 2003 22:24:22 -0000 1.6 --- elf.h 25 Jul 2003 00:13:51 -0000 1.7 *************** *** 129,133 **** #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 *); --- 129,133 ---- #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 *); *************** *** 198,202 **** #ifdef __KERNEL__ ! #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT) #endif --- 198,202 ---- #ifdef __KERNEL__ ! #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) #endif |
|
From: <joe...@us...> - 2003-07-25 00:13:54
|
Update of /cvsroot/xtensa/linux/arch/xtensa/platform-xt2000
In directory sc8-pr-cvs1:/tmp/cvs-serv2139/arch/xtensa/platform-xt2000
Modified Files:
pci.c pci_v320usc.c time.c
Log Message:
Resolve compiler warnings.
Remove dead code.
Provide assembler version of task size macro.
Change the default personality.
Index: pci.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/platform-xt2000/pci.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** pci.c 28 Aug 2002 16:10:14 -0000 1.1.1.1
--- pci.c 25 Jul 2003 00:13:51 -0000 1.2
***************
*** 16,20 ****
#include <linux/init.h>
#include <linux/pci.h>
! #include <linux/malloc.h>
#include <asm/byteorder.h>
--- 16,20 ----
#include <linux/init.h>
#include <linux/pci.h>
! #include <linux/slab.h>
#include <asm/byteorder.h>
***************
*** 54,58 ****
}
! static int v320usc_startup_irq(unsigned int irq)
{
v320usc_enable_irq(irq);
--- 54,58 ----
}
! static unsigned int v320usc_startup_irq(unsigned int irq)
{
v320usc_enable_irq(irq);
Index: pci_v320usc.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/platform-xt2000/pci_v320usc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** pci_v320usc.c 28 Aug 2002 16:10:14 -0000 1.1.1.1
--- pci_v320usc.c 25 Jul 2003 00:13:51 -0000 1.2
***************
*** 19,23 ****
#include <linux/pci.h>
#include <linux/ptrace.h>
! #include <linux/malloc.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
--- 19,23 ----
#include <linux/pci.h>
#include <linux/ptrace.h>
! #include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
Index: time.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/platform-xt2000/time.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** time.c 13 Feb 2003 18:19:23 -0000 1.2
--- time.c 25 Jul 2003 00:13:51 -0000 1.3
***************
*** 60,69 ****
}
! static int bit_xt2000_getsda()
{
return ((V3USC_SYS_IN() >> SYSTEM_B_SDA_IN_SHIFT) & 1);
}
! static void i2c_start()
{
bit_xt2000_setsda(1);
--- 60,69 ----
}
! static int bit_xt2000_getsda(void)
{
return ((V3USC_SYS_IN() >> SYSTEM_B_SDA_IN_SHIFT) & 1);
}
! static void i2c_start(void)
{
bit_xt2000_setsda(1);
***************
*** 73,77 ****
}
! static void i2c_stop()
{
bit_xt2000_setscl(0);
--- 73,77 ----
}
! static void i2c_stop(void)
{
bit_xt2000_setscl(0);
***************
*** 96,100 ****
}
! static unsigned char i2c_recv_byte()
{
int i;
--- 96,100 ----
}
! static unsigned char i2c_recv_byte(void)
{
int i;
***************
*** 116,120 ****
}
! static unsigned do_getrtctime()
{
int i;
--- 116,120 ----
}
! static unsigned do_getrtctime(void)
{
int i;
|
|
From: <joe...@us...> - 2003-07-25 00:13:53
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm In directory sc8-pr-cvs1:/tmp/cvs-serv2139/arch/xtensa/mm Modified Files: extable.c Log Message: Resolve compiler warnings. Remove dead code. Provide assembler version of task size macro. Change the default personality. Index: extable.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/extable.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** extable.c 12 Jun 2003 23:43:53 -0000 1.2 --- extable.c 25 Jul 2003 00:13:50 -0000 1.3 *************** *** 7,12 **** #include <asm/uaccess.h> ! extern const struct exception_table_entry __start___ex_table[]; ! extern const struct exception_table_entry __stop___ex_table[]; /* --- 7,12 ---- #include <asm/uaccess.h> ! extern struct exception_table_entry __start___ex_table[]; ! extern struct exception_table_entry __stop___ex_table[]; /* |
|
From: <joe...@us...> - 2003-07-25 00:13:53
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv2139/arch/xtensa/kernel
Modified Files:
process.c
Log Message:
Resolve compiler warnings.
Remove dead code.
Provide assembler version of task size macro.
Change the default personality.
Index: process.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/process.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** process.c 10 Jun 2003 20:20:08 -0000 1.13
--- process.c 25 Jul 2003 00:13:50 -0000 1.14
***************
*** 297,303 ****
}
! void xtensa_elf_core_copy_regs (xtensa_gregset_t *elfregs, struct pt_regs *regs)
{
! do_copy_regs (elfregs, regs, current);
}
--- 297,303 ----
}
! void xtensa_elf_core_copy_regs (elf_gregset_t *elfregs, struct pt_regs *regs)
{
! do_copy_regs ((xtensa_gregset_t *)elfregs, regs, current);
}
***************
*** 455,477 ****
return dump_task_fpu (regs, current, r);
}
-
-
- #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*/
--- 455,456 ----
|
|
From: <joe...@us...> - 2003-07-25 00:13:53
|
Update of /cvsroot/xtensa/linux/arch/xtensa/platform-iss
In directory sc8-pr-cvs1:/tmp/cvs-serv2139/arch/xtensa/platform-iss
Modified Files:
time.c
Log Message:
Resolve compiler warnings.
Remove dead code.
Provide assembler version of task size macro.
Change the default personality.
Index: time.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/platform-iss/time.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** time.c 28 Aug 2002 16:10:14 -0000 1.1.1.1
--- time.c 25 Jul 2003 00:13:50 -0000 1.2
***************
*** 20,24 ****
{
/* We cannot init the time on the iss, so NULL. */
! xthal_set_ccompare(LINUX_TIMER_INT, xthal_get_ccount() + LINUX_TIMER_INTERVAL);
setup_irq(LINUX_TIMER_INT, &irq0);
}
--- 20,24 ----
{
/* We cannot init the time on the iss, so NULL. */
! xthal_set_ccompare(LINUX_TIMER, xthal_get_ccount() + LINUX_TIMER_INTERVAL);
setup_irq(LINUX_TIMER_INT, &irq0);
}
|
|
From: <joe...@us...> - 2003-07-07 22:42:02
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv22563/include/asm-xtensa
Modified Files:
uaccess.h
Log Message:
Check for user unaligned addresses before trying to access user space.
Index: uaccess.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/uaccess.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** uaccess.h 12 Jun 2003 23:43:54 -0000 1.3
--- uaccess.h 7 Jul 2003 22:41:59 -0000 1.4
***************
*** 255,277 ****
retval = 0; \
switch (size) { \
! case 1: __put_user_asm(x,ptr,retval,"s8i"); break; \
! case 2: __put_user_asm(x,ptr,retval,"s16i"); break; \
! case 4: __put_user_asm(x,ptr,retval,"s32i"); break; \
! case 8: { \
__typeof__(*ptr) __v64 = x; \
retval = __copy_to_user(ptr,&__v64,8); \
break; \
! } \
! default: __put_user_bad(); \
} \
} while (0)
/*
* We don't tell gcc that we are accessing memory, but this is OK
* because we do not write to any memory gcc knows about, so there
* are no aliasing issues.
*/
! #define __put_user_asm(x, addr, err, insn) \
__asm__ __volatile__( \
"1: "insn" %1, %2, 0 \n" \
"2: \n" \
--- 255,315 ----
retval = 0; \
switch (size) { \
! case 1: __put_user_asm(x,ptr,retval,1,"s8i"); break; \
! case 2: __put_user_asm(x,ptr,retval,2,"s16i"); break; \
! case 4: __put_user_asm(x,ptr,retval,4,"s32i"); break; \
! case 8: { \
__typeof__(*ptr) __v64 = x; \
retval = __copy_to_user(ptr,&__v64,8); \
break; \
! } \
! default: __put_user_bad(); \
} \
} while (0)
+
+ /* Consider a case of a user single load/store would cause both an
+ * unaligned exception and an MMU-related exception (unaligned
+ * exceptions happen first):
+ *
+ * User code passes a bad variable ptr to a system call.
+ * Kernel tries to access the variable.
+ * Unaligned exception occurs.
+ * Unaligned exception handler tries to make aligned accesses.
+ * Double exception occurs for MMU-related cause (e.g., page not mapped).
+ * do_page_fault() thinks the fault address belongs to the kernel, not the user, and panics.
+ *
+ * The kernel currently prohibits user unaligned accesses. We use the
+ * __check_align_* macros to check for unaligned addresses before
+ * accessing user space so we don't crash the kernel. Both
+ * __put_user_asm and __get_user_asm use these alignment macros, so
+ * macro-specific labels such as 0f, 1f, %0, %2, and %3 must stay in
+ * sync.
+ */
+
+ #define __check_align_1 ""
+
+ #define __check_align_2 \
+ " _bbci.l %2, 0, 1f \n" \
+ " movi %0, %3 \n" \
+ " _j 2f \n"
+
+ #define __check_align_4 \
+ " _bbsi.l %2, 0, 0f \n" \
+ " _bbci.l %2, 1, 1f \n" \
+ "0: movi %0, %3 \n" \
+ " _j 2f \n"
+
+
/*
* We don't tell gcc that we are accessing memory, but this is OK
* because we do not write to any memory gcc knows about, so there
* are no aliasing issues.
+ *
+ * WARNING: If you modify this macro at all, verify that the
+ * __check_align_* macros still work.
*/
! #define __put_user_asm(x, addr, err, align, insn) \
__asm__ __volatile__( \
+ __check_align_##align \
"1: "insn" %1, %2, 0 \n" \
"2: \n" \
***************
*** 291,295 ****
:"r" ((int)(x)), "r" (addr), "i" (-EFAULT), "0" (err))
-
#define __get_user_nocheck(x,ptr,size) \
({ \
--- 329,332 ----
***************
*** 312,329 ****
extern long __get_user_bad(void);
! #define __get_user_size(x,ptr,size,retval) \
! do { \
! retval = 0; \
! switch (size) { \
! case 1: __get_user_asm(x,ptr,retval,"l8ui"); break; \
! case 2: __get_user_asm(x,ptr,retval,"l16ui"); break; \
! case 4: __get_user_asm(x,ptr,retval,"l32i"); break; \
! case 8: retval = __copy_from_user(&x,ptr,8); break; \
! default: (x) = __get_user_bad(); \
! } \
} while (0)
! #define __get_user_asm(x, addr, err, insn) \
__asm__ __volatile__( \
"1: "insn" %1, %2, 0 \n" \
"2: \n" \
--- 349,372 ----
extern long __get_user_bad(void);
! #define __get_user_size(x,ptr,size,retval) \
! do { \
! retval = 0; \
! switch (size) { \
! case 1: __get_user_asm(x,ptr,retval,1,"l8ui"); break; \
! case 2: __get_user_asm(x,ptr,retval,2,"l16ui"); break; \
! case 4: __get_user_asm(x,ptr,retval,4,"l32i"); break; \
! case 8: retval = __copy_from_user(&x,ptr,8); break; \
! default: (x) = __get_user_bad(); \
! } \
} while (0)
!
! /*
! * WARNING: If you modify this macro at all, verify that the
! * __check_align_* macros still work.
! */
! #define __get_user_asm(x, addr, err, align, insn) \
__asm__ __volatile__( \
+ __check_align_##align \
"1: "insn" %1, %2, 0 \n" \
"2: \n" \
|
|
From: <joe...@us...> - 2003-07-07 22:41:28
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv22485/arch/xtensa/kernel
Modified Files:
traps.c
Log Message:
Change user unaligned accesses from SIGSEGV to SIGBUS for more relevant signal code.
Index: traps.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** traps.c 12 Jun 2003 23:44:23 -0000 1.15
--- traps.c 7 Jul 2003 22:41:25 -0000 1.16
***************
*** 289,295 ****
tsk->thread.error_code = -3; /* unaligned access, load or store */
#if 1
! printk("handle_unaligned_user(): sending SIGSEGV to %s (pid=%d)"
! " for illegal access\n"
! "(load or store) to %08x (pc == %08x, ra == %08x)\n",
tsk->comm,
tsk->pid,
--- 289,294 ----
tsk->thread.error_code = -3; /* unaligned access, load or store */
#if 1
! printk("handle_unaligned_user(): sending SIGBUS to %s (pid=%d)\n"
! "for unaligned access to %08x (pc == %08x, ra == %08x)\n",
tsk->comm,
tsk->pid,
***************
*** 298,304 ****
(regs->aregs[0] & 0x3FFFFFFF) | (regs->pc & 0xC0000000) );
#endif
! info.si_signo = SIGSEGV;
info.si_errno = 0;
! info.si_code = SEGV_ACCERR;
info.si_addr = (void *) regs->excvaddr;
force_sig_info(SIGSEGV, &info, tsk);
--- 297,303 ----
(regs->aregs[0] & 0x3FFFFFFF) | (regs->pc & 0xC0000000) );
#endif
! info.si_signo = SIGBUS;
info.si_errno = 0;
! info.si_code = BUS_ADRALN;
info.si_addr = (void *) regs->excvaddr;
force_sig_info(SIGSEGV, &info, tsk);
|
|
From: <joe...@us...> - 2003-06-12 23:44:26
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv11282/arch/xtensa/kernel
Modified Files:
traps.c
Log Message:
Improve error formatting.
Index: traps.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** traps.c 10 Jun 2003 20:18:49 -0000 1.14
--- traps.c 12 Jun 2003 23:44:23 -0000 1.15
***************
*** 587,591 ****
i = 0;
! printk("Stack (at %08x):", (int) stack);
while ((unsigned long) stack & (PAGE_SIZE - 1)) {
unsigned long stackdata;
--- 587,591 ----
i = 0;
! printk("Stack (at %08x):\n ", (int) stack);
while ((unsigned long) stack & (PAGE_SIZE - 1)) {
unsigned long stackdata;
***************
*** 608,665 ****
}
- /*
- * This constant is for searching for possible module text segments.
- * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
- */
- #define MODULE_RANGE (8*1024*1024)
-
void show_trace(unsigned int *sp)
{
! int i;
! unsigned int *stack;
! unsigned long kernel_start, kernel_end;
! unsigned long module_start, module_end;
! extern char _stext, _etext;
!
! stack = sp;
! i = 0;
!
! kernel_start = (unsigned long) &_stext;
! kernel_end = (unsigned long) &_etext;
! module_start = VMALLOC_START;
! module_end = module_start + MODULE_RANGE;
!
! /* XTFIXME: Cool idea, but the code is wrong for the Xtensa
! architecture. If we encounter this, we can fix it. */
!
! printk("\nCall Trace (this data is wrong):");
!
! while ((unsigned long) stack & (PAGE_SIZE -1)) {
! unsigned long addr;
!
! if (__get_user(addr, stack++)) {
! printk(" (Bad stack address)\n");
! break;
! }
!
! /*
! * If the address is either in the text segment of the
! * kernel, or in the region which contains vmalloc'ed
! * memory, it *may* be the address of a calling
! * routine; if so, print it so that someone tracing
! * down the cause of the crash will be able to figure
! * out the call path that was taken.
! */
!
! if ((addr >= kernel_start && addr < kernel_end) ||
! (addr >= module_start && addr < module_end)) {
! printk(" [<%08lx>]", addr);
! if (++i > 40) {
! printk(" ...");
! break;
! }
! }
! }
}
--- 608,624 ----
}
void show_trace(unsigned int *sp)
{
! /* XTFIXME: This is supposed to be a generic show backtrace
! function, but there are many complications on Xtensa that
! we just haven't implemented yet. The main one is spilling
! live window registers before backtracing the stack. How to
! do it for a user task whose registers haven't been spilled?
! Possible example in
! <glibc/sysdeps/unix/sysv/linux/xtensa/segfault.c>. Another
! issue is the window-size bits of the return addresses.
! */
! printk("\nCall backtrace: (NOT YET IMPLEMENTED)");
}
|
|
From: <joe...@us...> - 2003-06-12 23:43:58
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa In directory sc8-pr-cvs1:/tmp/cvs-serv10730/include/asm-xtensa Modified Files: uaccess.h Log Message: We need to sort the exception table, else a task error crashes the kernel. Index: uaccess.h =================================================================== RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/uaccess.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** uaccess.h 12 Sep 2002 18:17:00 -0000 1.2 --- uaccess.h 12 Jun 2003 23:43:54 -0000 1.3 *************** *** 458,461 **** --- 458,462 ---- /* Returns 0 if exception not found and fixup.unit otherwise. */ extern unsigned long search_exception_table(unsigned long addr); + extern void sort_exception_table(void); /* Returns the new pc */ |
|
From: <joe...@us...> - 2003-06-12 23:43:56
|
Update of /cvsroot/xtensa/linux/arch/xtensa/mm
In directory sc8-pr-cvs1:/tmp/cvs-serv10730/arch/xtensa/mm
Modified Files:
extable.c
Log Message:
We need to sort the exception table, else a task error crashes the kernel.
Index: extable.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/mm/extable.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** extable.c 28 Aug 2002 16:10:14 -0000 1.1.1.1
--- extable.c 12 Jun 2003 23:43:53 -0000 1.2
***************
*** 10,13 ****
--- 10,46 ----
extern const struct exception_table_entry __stop___ex_table[];
+ /*
+ * The exception table needs to be sorted because we use the macros
+ * which put things into the exception table in a variety of segments.
+ */
+ static inline void
+ sort_ex_table(struct exception_table_entry *start,
+ struct exception_table_entry *finish)
+ {
+ struct exception_table_entry el, *p, *q;
+
+ /* insertion sort */
+ for (p = start + 1; p < finish; ++p) {
+ /* start .. p-1 is sorted */
+ if (p[0].insn < p[-1].insn) {
+ /* move element p down to its right place */
+ el = *p;
+ q = p;
+ do {
+ /* el comes before q[-1], move q[-1] up one */
+ q[0] = q[-1];
+ --q;
+ } while (q > start && el.insn < q[-1].insn);
+ *q = el;
+ }
+ }
+ }
+
+ void
+ sort_exception_table(void)
+ {
+ sort_ex_table(__start___ex_table, __stop___ex_table);
+ }
+
static inline unsigned long
search_one_table(const struct exception_table_entry *first,
|
|
From: <joe...@us...> - 2003-06-12 23:43:56
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv10730/arch/xtensa/kernel Modified Files: setup.c Log Message: We need to sort the exception table, else a task error crashes the kernel. Index: setup.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/setup.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** setup.c 28 Apr 2003 23:21:09 -0000 1.12 --- setup.c 12 Jun 2003 23:43:53 -0000 1.13 *************** *** 41,44 **** --- 41,45 ---- #include <asm/machvec.h> #include <asm/page.h> + #include <asm/uaccess.h> #include <asm/platform/hardware.h> *************** *** 339,342 **** --- 340,345 ---- paging_init(); + + sort_exception_table(); #ifdef CONFIG_VT |
|
From: <joe...@us...> - 2003-06-10 20:20:21
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv25089/arch/xtensa/kernel
Modified Files:
process.c signal.c
Log Message:
Cleanup #if statements. Turn coprocessor-state-management code into critical section. Remove buggy and redundant discard_my_cpstate().
Index: process.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/process.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** process.c 16 Apr 2003 00:44:22 -0000 1.12
--- process.c 10 Jun 2003 20:20:08 -0000 1.13
***************
*** 62,69 ****
asmlinkage void ret_from_fork(void);
- #if XCHAL_CP_NUM
void release_all_cp (struct task_struct *tsk)
{
int i;
for (i = 0; i < XCHAL_CP_MAX; i++) {
if (tsk == coproc_owners[i]) {
--- 62,71 ----
asmlinkage void ret_from_fork(void);
void release_all_cp (struct task_struct *tsk)
{
+ #if XCHAL_CP_NUM
int i;
+ unsigned long flags;
+ save_and_cli(flags);
for (i = 0; i < XCHAL_CP_MAX; i++) {
if (tsk == coproc_owners[i]) {
***************
*** 72,77 ****
}
}
}
- #endif /* XCHAL_HAVE_CP */
/*
--- 74,80 ----
}
}
+ restore_flags(flags);
+ #endif
}
/*
***************
*** 80,86 ****
void exit_thread(void)
{
- #if XCHAL_CP_NUM
release_all_cp(current);
- #endif
}
--- 83,87 ----
***************
*** 89,95 ****
/* Now, this task is no longer a kernel thread. */
current->thread.current_ds = USER_DS;
- #if XCHAL_CP_NUM
release_all_cp(current);
- #endif
}
--- 90,94 ----
***************
*** 358,361 ****
--- 357,361 ----
extern unsigned _xtensa_reginfo_table_size;
int i;
+ unsigned long flags;
/*
***************
*** 364,367 ****
--- 364,368 ----
* task are first saved to memory:
*/
+ save_and_cli(flags);
for (i = 0; i < XCHAL_CP_MAX; i++) {
if (tsk == coproc_owners[i]) {
***************
*** 372,375 ****
--- 373,377 ----
}
}
+ restore_flags(flags);
/* Now dump coprocessor & extra state: */
***************
*** 389,392 ****
--- 391,395 ----
extern unsigned _xtensa_reginfo_table_size;
int i;
+ unsigned long flags;
/* Make sure save area layouts match.
***************
*** 407,410 ****
--- 410,414 ----
* task are first invalidated.
*/
+ save_and_cli(flags);
for (i = 0; i < XCHAL_CP_MAX; i++) {
if (tsk == coproc_owners[i]) {
***************
*** 415,418 ****
--- 419,423 ----
}
}
+ restore_flags(flags);
/* Now restore coprocessor & extra state: */
Index: signal.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/signal.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** signal.c 2 May 2003 17:16:37 -0000 1.9
--- signal.c 10 Jun 2003 20:20:09 -0000 1.10
***************
*** 190,203 ****
};
! static inline void
! discard_my_cpstate(struct task_struct *tsk)
! {
! int i;
! for (i = 0; i < XCHAL_CP_NUM; i++)
! if (tsk == coproc_owners[i]) {
! xthal_invalidate_cp(i);
! coproc_owners[i] = 0;
! }
! }
static inline int
--- 190,194 ----
};
! extern void release_all_cp (struct task_struct *);
static inline int
***************
*** 212,216 ****
struct task_struct *tsk = current;
! discard_my_cpstate(tsk);
return __copy_from_user(tsk->thread.cpextra, buf, TOTAL_CPEXTRA_SIZE);
}
--- 203,207 ----
struct task_struct *tsk = current;
! release_all_cp(tsk);
return __copy_from_user(tsk->thread.cpextra, buf, TOTAL_CPEXTRA_SIZE);
}
***************
*** 299,302 ****
--- 290,296 ----
{
int i;
+ unsigned long flags;
+ save_and_cli(flags);
+
for (i = 0; i < XCHAL_CP_NUM; i++) {
if (tsk == coproc_owners[i]) {
***************
*** 312,315 ****
--- 306,310 ----
}
}
+ restore_flags(flags);
}
|
|
From: <joe...@us...> - 2003-06-10 20:18:55
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv24725/arch/xtensa/kernel
Modified Files:
traps.c
Log Message:
Remove redundant call to xthal_get_intenable().
Index: traps.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** traps.c 3 Apr 2003 04:07:43 -0000 1.13
--- traps.c 10 Jun 2003 20:18:49 -0000 1.14
***************
*** 241,245 ****
int i;
- intread = xthal_get_intread();
for (i=0; i<XCHAL_NUM_INTERRUPTS; i++)
{
--- 241,244 ----
|