xtensa-cvscommit Mailing List for xtensa (Page 2)
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: <joe...@us...> - 2003-05-22 21:03:47
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv23256/arch/xtensa/kernel
Modified Files:
ptrace.c
Log Message:
Return success when ptrace is really successful. Fixes the gdbserver warning messages.
Index: ptrace.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/ptrace.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ptrace.c 14 Feb 2003 18:48:10 -0000 1.9
--- ptrace.c 22 May 2003 21:03:44 -0000 1.10
***************
*** 392,395 ****
--- 392,396 ----
do_restore_regs (&format, regs, child);
+ res = 0;
break;
}
***************
*** 421,424 ****
--- 422,426 ----
struct pt_regs *regs = __KSTK_TOS(child);
+ res = 0;
if (copy_from_user(&fpregs, (void *)data, sizeof(elf_fpregset_t))) {
res = -EFAULT;
|
|
From: <joe...@us...> - 2003-05-09 20:28:42
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv21097/include/asm-xtensa
Modified Files:
hardirq.h
Log Message:
Don't call the scheduler when handling double exceptions.
Index: hardirq.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/hardirq.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** hardirq.h 26 Mar 2003 00:29:38 -0000 1.3
--- hardirq.h 9 May 2003 20:28:39 -0000 1.4
***************
*** 19,22 ****
--- 19,23 ----
/* entry.S is sensitive to the offsets of these fields */
+ /* XTFIXME: Why not include defines in offset.h for entry.S usage? */
typedef struct {
unsigned int __softirq_pending;
|
|
From: <joe...@us...> - 2003-05-09 20:28:42
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv21097/arch/xtensa/kernel Modified Files: handlers.S vectors.S Log Message: Don't call the scheduler when handling double exceptions. Index: handlers.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** handlers.S 23 Apr 2003 23:15:21 -0000 1.18 --- handlers.S 9 May 2003 20:28:39 -0000 1.19 *************** *** 71,74 **** --- 71,75 ---- #include <xtensa/config/specreg.h> #include <xtensa/config/core.h> + #include <xtensa/xt2000.h> #include <asm/ptrace.h> #include <asm/kstack.h> *************** *** 172,177 **** 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 --- 173,177 ---- double_noconversion: /* Compute the exception type. PS (in a0) indicates user vs ! * kernel. */ movi a0, EXCTYPE_DOUBLE_KERNEL *************** *** 1265,1272 **** // the break, then the default exception handler is invoked. // ! l32i a6, a1, PT_EXCTYPE // exception type movi a4, c_exception_handlers /* XTFIXME: _bbsi instruction below */ ! // _bbsi.l a6, EXCTYPE_UNHANDLED_SHIFT, _excDefault // invoke default handler instead? addx4 a4, a7, a4 // index by cause into C exception handler table l32i a4, a4, 0 // load the exception handler --- 1265,1272 ---- // the break, then the default exception handler is invoked. // ! l32i a2, a1, PT_EXCTYPE // exception type movi a4, c_exception_handlers /* XTFIXME: _bbsi instruction below */ ! // _bbsi.l a2, EXCTYPE_UNHANDLED_SHIFT, _excDefault // invoke default handler instead? addx4 a4, a7, a4 // index by cause into C exception handler table l32i a4, a4, 0 // load the exception handler *************** *** 1287,1290 **** --- 1287,1291 ---- l32i a3, a1, PT_PS bbci.l a3, PS_UM_SHIFT, _excExitKernel + bbsi.l a2, EXCTYPE_DOUBLE_SHIFT, _excExitKernel // Check for softirq *************** *** 1838,1844 **** * and S32E instructions, because this move must be done with * the user's PS.RING privilege levels, not with ring 0 ! * (kernel's) privileges current active with PS.EXCM set. Note ! * that we also register a fixup routine with the double ! * exception vector in case a double exception occurs. */ --- 1839,1845 ---- * and S32E instructions, because this move must be done with * the user's PS.RING privilege levels, not with ring 0 ! * (kernel's) privileges currently active with PS.EXCM ! * set. Note that we also register a fixup routine with the ! * double exception vector in case a double exception occurs. */ *************** *** 1890,1897 **** _j 1f .align 8 ! s32i a4, a0, RSAVE_A4 // modify saved a4 _j 1f .align 8 ! s32i a5, a0, RSAVE_A5 // modify saved a5 _j 1f .align 8 --- 1891,1898 ---- _j 1f .align 8 ! s32i a2, a0, RSAVE_A4 // modify saved a4 _j 1f .align 8 ! s32i a2, a0, RSAVE_A5 // modify saved a5 _j 1f .align 8 *************** *** 3164,3165 **** --- 3165,3287 ---- #endif /* XCHAL_CP_NUM, or if at least one coproc exists */ + + + /* Entry point to panic handler of double exception vector. Control + * comes here when we are toasted. We just save off information, + * display something on the LED (if on XT2000), and loop forever. + * + * Entry conditions are: + * + * a0 is undefined + * a1 points to dispatch table + * a2 is undefined + * original a0 is in DEPC + * original a1 is in EXCSAVE_1 + * original a2 is in [ EXCSAVE_1 + TABLE_SAVEA2 ] + * DEPC saved in [ EXCSAVE_1 + TABLE_SAVEA0 ] + * All other register contain their original values. + */ + + + #define CRITICAL_SAVE_A0 0 + #define CRITICAL_SAVE_A1 4 + #define CRITICAL_SAVE_A2 8 + #define CRITICAL_SAVE_A3 12 + #define CRITICAL_SAVE_A4 16 + #define CRITICAL_SAVE_A5 20 + #define CRITICAL_SAVE_A6 24 + #define CRITICAL_SAVE_A7 28 + #define CRITICAL_SAVE_A8 32 + #define CRITICAL_SAVE_A9 36 + #define CRITICAL_SAVE_A10 40 + #define CRITICAL_SAVE_A11 44 + #define CRITICAL_SAVE_A12 48 + #define CRITICAL_SAVE_A13 52 + #define CRITICAL_SAVE_A14 56 + #define CRITICAL_SAVE_A15 60 + #define CRITICAL_SAVE_DEPC 64 + + #define CRITICAL_SAVE_TOTAL (17*4) + + .data + .align 4 + critical_save_area: + .space CRITICAL_SAVE_TOTAL, 0 + + .text + .align 4 + .global handle_critical + handle_critical: + + l32i a2, a1, TABLE_SAVEA2 + movi a0, critical_save_area + + s32i a2, a0, CRITICAL_SAVE_A2 + s32i a3, a0, CRITICAL_SAVE_A3 + s32i a4, a0, CRITICAL_SAVE_A4 + s32i a5, a0, CRITICAL_SAVE_A5 + s32i a6, a0, CRITICAL_SAVE_A6 + s32i a7, a0, CRITICAL_SAVE_A7 + s32i a8, a0, CRITICAL_SAVE_A8 + s32i a9, a0, CRITICAL_SAVE_A9 + s32i a10, a0, CRITICAL_SAVE_A10 + s32i a11, a0, CRITICAL_SAVE_A11 + s32i a12, a0, CRITICAL_SAVE_A12 + s32i a13, a0, CRITICAL_SAVE_A13 + s32i a14, a0, CRITICAL_SAVE_A14 + s32i a15, a0, CRITICAL_SAVE_A15 + + l32i a2, a1, TABLE_SAVEA0 + xsr a1, EXCSAVE_1 + s32i a2, a0, CRITICAL_SAVE_DEPC + s32i a1, a0, CRITICAL_SAVE_A1 + + mov a3, a0 + xsr a2, DEPC /* we're also restoring DEPC here */ + s32i a2, a3, CRITICAL_SAVE_A0 + + /* I suppose we could save other things, but other processor + * state is also accessible via OCD for now. Maybe in the + * future for some fancy print routine... */ + + j 2f + .align 4 + 1: .word 'C' + .word 'R' + .word 'I' + .word 'T' + .word 'I' + .word 'C' + .word 'A' + .word 'L' + .word 0 + 2: movi a2, 1b + j display_panic + + .align 4 + .global display_panic + display_panic: + + #ifdef XT2000_SYSRST_VADDR + + bnez a2, 3f + j 2f + .align 4 + 1: .word 'P' + .word 'A' + .word 'N' + .word 'I' + .word 'C' + .word 0 + 2: + movi a2, 1b /* address of string */ + 3: movi a3, XTBOARD_LED_VADDR+0xE0 /* address of LED display */ + l32i a4, a2, 0 + 4: addi a2, a2, 4 + s32i a4, a3, 0 + l32i a4, a2, 0 + addi a3, a3, 4 + bnez a4, 4b + #endif /* XT2000_SYSRST_VADDR */ + + 9: j 9b /* loop forever */ Index: vectors.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/vectors.S,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** vectors.S 28 Apr 2003 23:21:10 -0000 1.8 --- vectors.S 9 May 2003 20:28:39 -0000 1.9 *************** *** 40,44 **** #include <xtensa/config/core.h> #include <xtensa/config/system.h> - #include <xtensa/xt2000.h> #include <asm/ptrace.h> --- 40,43 ---- *************** *** 165,169 **** 1: l32i a0, a1, TABLE_FIXUP ! beqz a0, CriticalExc movi a2, ( 0 << EXCTYPE_DOUBLE_WIND_SHIFT ) jx a0 --- 164,168 ---- 1: l32i a0, a1, TABLE_FIXUP ! _beqz a0, CriticalExc movi a2, ( 0 << EXCTYPE_DOUBLE_WIND_SHIFT ) jx a0 *************** *** 216,297 **** - /* XTFIXME: recover_or_crit and slowdeg are dead code now, but useful - * as an alternate LED msg example. We still use CriticalExc as a - * sort of panic indicator. */ - - recover_or_crit: - j 2f - .align 4 - 1: .word 'R' - .word 'E' - .word 'C' - .word 'O' - .word 'V' - .word 'E' - .word 'R' - .word 0 - 2: movi a2, 1b - j display_panic - slowdeh: - j 2f - .align 4 - 1: .word 'S' - .word 'L' - .word 'O' - .word 'W' - .word 'D' - .word 'E' - .word 'H' - .word 0 - 2: movi a2, 1b - j display_panic CriticalExc: ! j 2f ! .align 4 ! 1: .word 'C' ! .word 'R' ! .word 'I' ! .word 'T' ! .word 'I' ! .word 'C' ! .word 'A' ! .word 'L' ! .word 0 ! 2: movi a2, 1b ! j display_panic ! ! ! /* Expensive ASCII characters!! We can improve the efficiency of ! * display_panic if it becomes more widely used. */ ! ! .align 4 ! .global display_panic ! display_panic: ! ! #ifdef XT2000_SYSRST_VADDR - bnez a2, 3f - j 2f - .align 4 - 1: .word 'P' - .word 'A' - .word 'N' - .word 'I' - .word 'C' - .word 0 - 2: - movi a2, 1b /* address of string */ - 3: movi a3, XTBOARD_LED_VADDR+0xE0 /* address of LED display */ - l32i a4, a2, 0 - 4: addi a2, a2, 4 - s32i a4, a3, 0 - l32i a4, a2, 0 - addi a3, a3, 4 - bnez a4, 4b - #endif /* XT2000_SYSRST_VADDR */ - 9: j 9b /* loop forever */ - - #if 0 --- 215,223 ---- CriticalExc: ! movi a0, handle_critical ! jx a0 #if 0 |
|
From: <za...@us...> - 2003-05-09 19:50:34
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/include
In directory sc8-pr-cvs1:/tmp/cvs-serv4845
Added Files:
zlib.h
Log Message:
Added missing zlib.h.
--- NEW FILE: zlib.h ---
/*
* BK Id: SCCS/s.zlib.h 1.8 05/18/01 15:17:23 cort
*/
/*
* This file is derived from zlib.h and zconf.h from the zlib-0.95
* distribution by Jean-loup Gailly and Mark Adler, with some additions
* by Paul Mackerras to aid in implementing Deflate compression and
* decompression for PPP packets.
*/
/*
* ==FILEVERSION 960122==
*
* This marker is used by the Linux installation script to determine
* whether an up-to-date version of this file is already installed.
*/
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 0.95, Aug 16th, 1995.
Copyright (C) 1995 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
gz...@pr... ma...@al...
*/
#ifndef _ZLIB_H
#define _ZLIB_H
/* #include "zconf.h" */ /* included directly here */
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* From: zconf.h,v 1.12 1995/05/03 17:27:12 jloup Exp */
/*
The library does not install any signal handler. It is recommended to
add at least a handler for SIGSEGV when decompressing; the library checks
the consistency of the input data whenever possible but may go nuts
for some forms of corrupted input.
*/
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
* Compile with -DUNALIGNED_OK if it is OK to access shorts or ints
* at addresses which are not a multiple of their size.
* Under DOS, -DFAR=far or -DFAR=__far may be needed.
*/
#ifndef STDC
# if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
# define STDC
# endif
#endif
#ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
# include <unix.h>
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
#ifndef FAR
# define FAR
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2 */
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
1 << (windowBits+2) + 1 << (memLevel+9)
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
typedef unsigned char Byte; /* 8 bits */
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
typedef Byte FAR Bytef;
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
/* end of original zconf.h */
#define ZLIB_VERSION "0.95P"
/*
The 'zlib' compression library provides in-memory compression and
decompression functions, including integrity checks of the uncompressed
data. This version of the library supports only one compression method
(deflation) but other algorithms may be added later and will have the same
stream interface.
For compression the application must provide the output buffer and
may optionally provide the input buffer for optimization. For decompression,
the application must provide the input buffer and may optionally provide
the output buffer for optimization.
Compression can be done in a single step if the buffers are large
enough (for example if an input file is mmap'ed), or can be done by
repeated calls of the compression function. In the latter case, the
application must provide more input and/or consume the output
(providing more output space) before each call.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void (*free_func) OF((voidpf opaque, voidpf address, uInt nbytes));
struct internal_state;
typedef struct z_stream_s {
Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */
Bytef *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
free_func zfree; /* used to free the internal state */
voidp opaque; /* private data object passed to zalloc and zfree */
Byte data_type; /* best guess about the data type: ascii or binary */
} z_stream;
/*
The application must update next_in and avail_in when avail_in has
dropped to zero. It must update next_out and avail_out when avail_out
has dropped to zero. The application must initialize zalloc, zfree and
opaque before calling the init function. All other fields are set by the
compression library and must not be updated by the application.
The opaque value provided by the application will be passed as the first
parameter for calls of zalloc and zfree. This can be useful for custom
memory management. The compression library attaches no meaning to the
opaque value.
zalloc must return Z_NULL if there is not enough memory for the object.
On 16-bit systems, the functions zalloc and zfree must be able to allocate
exactly 65536 bytes, but will not be required to allocate more than this
if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
pointers returned by zalloc for objects of exactly 65536 bytes *must*
have their offset normalized to zero. The default allocation function
provided by this library ensures this (see zutil.c). To reduce memory
requirements and avoid any allocation of 64K objects, at the expense of
compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
The fields total_in and total_out can be used for statistics or
progress reports. After compression, total_in holds the total size of
the uncompressed data and may be saved for use in the decompressor
(particularly if the decompressor wants to decompress everything in
a single step).
*/
/* constants */
#define Z_NO_FLUSH 0
#define Z_PARTIAL_FLUSH 1
#define Z_FULL_FLUSH 2
#define Z_SYNC_FLUSH 3 /* experimental: partial_flush + byte align */
#define Z_FINISH 4
#define Z_PACKET_FLUSH 5
/* See deflate() below for the usage of these constants */
#define Z_OK 0
#define Z_STREAM_END 1
#define Z_ERRNO (-1)
#define Z_STREAM_ERROR (-2)
#define Z_DATA_ERROR (-3)
#define Z_MEM_ERROR (-4)
#define Z_BUF_ERROR (-5)
/* error codes for the compression/decompression functions */
#define Z_BEST_SPEED 1
#define Z_BEST_COMPRESSION 9
#define Z_DEFAULT_COMPRESSION (-1)
/* compression levels */
#define Z_FILTERED 1
#define Z_HUFFMAN_ONLY 2
#define Z_DEFAULT_STRATEGY 0
#define Z_BINARY 0
#define Z_ASCII 1
#define Z_UNKNOWN 2
/* Used to set the data_type field */
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
extern char *zlib_version;
/* The application can compare zlib_version and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is
not compatible with the zlib.h header file used by the application.
*/
/* basic functions */
extern int inflateInit OF((z_stream *strm));
/*
Initializes the internal stream state for decompression. The fields
zalloc and zfree must be initialized before by the caller. If zalloc and
zfree are set to Z_NULL, inflateInit updates them to use default allocation
functions.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory. msg is set to null if there is no error message.
inflateInit does not perform any decompression: this will be done by
inflate().
*/
extern int inflate OF((z_stream *strm, int flush));
/*
Performs one or both of the following actions:
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in is updated and processing
will resume at this point for the next call of inflate().
- Provide more output starting at next_out and update next_out and avail_out
accordingly. inflate() always provides as much output as possible
(until there is no more input data or no more space in the output buffer).
Before the call of inflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming
more output, and updating the next_* and avail_* values accordingly.
The application can consume the uncompressed output when it wants, for
example when the output buffer is full (avail_out == 0), or after each
call of inflate().
If the parameter flush is set to Z_PARTIAL_FLUSH or Z_PACKET_FLUSH,
inflate flushes as much output as possible to the output buffer. The
flushing behavior of inflate is not specified for values of the flush
parameter other than Z_PARTIAL_FLUSH, Z_PACKET_FLUSH or Z_FINISH, but the
current implementation actually flushes as much output as possible
anyway. For Z_PACKET_FLUSH, inflate checks that once all the input data
has been consumed, it is expecting to see the length field of a stored
block; if not, it returns Z_DATA_ERROR.
inflate() should normally be called until it returns Z_STREAM_END or an
error. However if all decompression is to be performed in a single step
(a single call of inflate), the parameter flush should be set to
Z_FINISH. In this case all pending input is processed and all pending
output is flushed; avail_out must be large enough to hold all the
uncompressed data. (The size of the uncompressed data may have been saved
by the compressor for this purpose.) The next operation on this stream must
be inflateEnd to deallocate the decompression state. The use of Z_FINISH
is never required, but can be used to inform inflate that a faster routine
may be used for the single inflate() call.
inflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if the end of the
compressed data has been reached and all uncompressed output has been
produced, Z_DATA_ERROR if the input data was corrupted, Z_STREAM_ERROR if
the stream structure was inconsistent (for example if next_in or next_out
was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no
progress is possible or if there was not enough room in the output buffer
when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then
call inflateSync to look for a good compression block. */
extern int inflateEnd OF((z_stream *strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
pending output.
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
*/
/* advanced functions */
extern int inflateInit2 OF((z_stream *strm,
int windowBits));
/*
This is another version of inflateInit with more compression options. The
fields next_out, zalloc and zfree must be initialized before by the caller.
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
this version of the library (the value 16 will be allowed soon). The
default value is 15 if inflateInit is used instead. If a compressed stream
with a larger window size is given as input, inflate() will return with
the error code Z_DATA_ERROR instead of trying to allocate a larger window.
If next_out is not null, the library will use this buffer for the history
buffer; the buffer must either be large enough to hold the entire output
data, or have at least 1<<windowBits bytes. If next_out is null, the
library will allocate its own buffer (and leave next_out null). next_in
need not be provided here but must be provided by the application for the
next call of inflate().
If the history buffer is provided by the application, next_out must
never be changed by the application since the decompressor maintains
history information inside this buffer from call to call; the application
can only reset next_out to the beginning of the history buffer when
avail_out is zero and all output has been consumed.
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was
not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as
windowBits < 8). msg is set to null if there is no error message.
inflateInit2 does not perform any decompression: this will be done by
inflate().
*/
extern int inflateSync OF((z_stream *strm));
/*
Skips invalid compressed data until the special marker (see deflate()
above) can be found, or until all available input is skipped. No output
is provided.
inflateSync returns Z_OK if the special marker has been found, Z_BUF_ERROR
if no more input was provided, Z_DATA_ERROR if no marker has been found,
or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
case, the application may save the current current value of total_in which
indicates where valid compressed data was found. In the error case, the
application may repeatedly call inflateSync, providing more input each time,
until success or end of the input data.
*/
extern int inflateReset OF((z_stream *strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state.
The stream will keep attributes that may have been set by inflateInit2.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
*/
extern int inflateIncomp OF((z_stream *strm));
/*
This function adds the data at next_in (avail_in bytes) to the output
history without performing any output. There must be no pending output,
and the decompressor must be expecting to see the start of a block.
Calling this function is equivalent to decompressing a stored block
containing the data at next_in (except that the data is not output).
*/
/* checksum functions */
/*
This function is not related to compression but is exported
anyway because it might be useful in applications using the
compression library.
*/
extern uLong adler32 OF((uLong adler, Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
return the updated checksum. If buf is NULL, this function returns
the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
much faster. Usage example:
uLong adler = adler32(0L, Z_NULL, 0);
while (read_buffer(buffer, length) != EOF) {
adler = adler32(adler, buffer, length);
}
if (adler != original_adler) error();
*/
#ifndef _Z_UTIL_H
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
#endif /* _ZLIB_H */
|
|
From: <za...@us...> - 2003-05-07 18:55:24
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/images In directory sc8-pr-cvs1:/tmp/cvs-serv23057/images Modified Files: Makefile Log Message: Added missing files in common (from last commit). Added targets Image and Image.initrd for RedBoot back in again. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/images/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 2 May 2003 22:53:02 -0000 1.3 --- Makefile 7 May 2003 18:55:20 -0000 1.4 *************** *** 3,34 **** # - - vmlinux: $(TOPDIR)/vmlinux - $(OBJCOPY) -S -O binary \ - -R .ResetVector.text \ - -R .WindowVectors.literal \ - -R .DebugInterruptVector.* \ - -R .UserExceptionVector.literal \ - -R .DoubleExceptionVector.literal \ - -R .xt.insn \ - -R .comment \ - --strip-all \ - $(TOPDIR)/vmlinux $@ - - vmlinux.gz: $(TOPDIR)/vmlinux - $(OBJCOPY) -S -O binary \ - -R .ResetVector.text \ - -R .WindowVectors.literal \ - -R .DebugInterruptVector* \ - -R .UserExceptionVector.literal \ - -R .KernelExceptionVector.literal \ - -R .DoubleExceptionVector.literal \ - -R .debug* \ - -R .xt.insn \ - -R .comment \ - --strip-all \ - $(TOPDIR)/vmlinux vmlinux - gzip -vf9 vmlinux - clean: rm -f Image* zImage* vmlinux* --- 3,6 ---- |
|
From: <za...@us...> - 2003-05-07 18:55:23
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/common
In directory sc8-pr-cvs1:/tmp/cvs-serv23057/common
Added Files:
Makefile memcpy.S misc.c
Log Message:
Added missing files in common (from last commit).
Added targets Image and Image.initrd for RedBoot back in again.
--- NEW FILE: Makefile ---
AFLAGS += -I$(HPATH)/asm-xtensa
.S.o:
$(CC) $(AFLAGS) -c -o $*.o $<
--- NEW FILE: memcpy.S ---
/*
* arch/xtensa/lib/memcpy.S
*
* ANSI C standard library function memcpy
*
* 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) 2002 Tensilica Inc.
*/
#define _ASMLANGUAGE
#include <xtensa/config/core.h>
.text
.align 4
.global bcopy
.type bcopy,@function
bcopy:
movi a14, xthal_bcopy // a14 safe to use regardless of whether caller
// used call4 or call8 (can't have used call12)
jx a14 // let the Core HAL do the work
.text
.align 4
.global memcpy
.type memcpy,@function
memcpy:
.global memmove
.type memmove,@function
memmove:
movi a14, xthal_memcpy // a14 safe to use regardless of whether caller
// used call4 or call8 (can't have used call12)
jx a14 // let the Core HAL do the work
--- NEW FILE: misc.c ---
#include "zlib.h"
/* bits taken from ppc */
extern void *avail_ram, *end_avail;
void exit (void)
{
for (;;);
}
void *zalloc(void *x, unsigned items, unsigned size)
{
void *p = avail_ram;
size *= items;
size = (size + 7) & -8;
avail_ram += size;
if (avail_ram > end_avail) {
//puts("oops... out of memory\n");
//pause();
exit ();
}
return p;
}
void zfree(void *x, void *addr, unsigned nb)
{
}
#define HEAD_CRC 2
#define EXTRA_FIELD 4
#define ORIG_NAME 8
#define COMMENT 0x10
#define RESERVED 0xe0
#define DEFLATED 8
void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
{
z_stream s;
int r, i, flags;
/* skip header */
i = 10;
flags = src[3];
if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
//puts("bad gzipped data\n");
exit();
}
if ((flags & EXTRA_FIELD) != 0)
i = 12 + src[10] + (src[11] << 8);
if ((flags & ORIG_NAME) != 0)
while (src[i++] != 0)
;
if ((flags & COMMENT) != 0)
while (src[i++] != 0)
;
if ((flags & HEAD_CRC) != 0)
i += 2;
if (i >= *lenp) {
//puts("gunzip: ran out of data in header\n");
exit();
}
s.zalloc = zalloc;
s.zfree = zfree;
r = inflateInit2(&s, -MAX_WBITS);
if (r != Z_OK) {
//puts("inflateInit2 returned "); puthex(r); puts("\n");
exit();
}
s.next_in = src + i;
s.avail_in = *lenp - i;
s.next_out = dst;
s.avail_out = dstlen;
r = inflate(&s, Z_FINISH);
if (r != Z_OK && r != Z_STREAM_END) {
//puts("inflate returned "); puthex(r); puts("\n");
exit();
}
*lenp = s.next_out - (unsigned char *) dst;
inflateEnd(&s);
}
|
|
From: <za...@us...> - 2003-05-07 18:55:23
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot In directory sc8-pr-cvs1:/tmp/cvs-serv23057/boot-redboot Modified Files: Makefile bootstrap.S Log Message: Added missing files in common (from last commit). Added targets Image and Image.initrd for RedBoot back in again. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 2 May 2003 22:53:02 -0000 1.2 --- Makefile 7 May 2003 18:55:20 -0000 1.3 *************** *** 5,21 **** # ! obj-y += ../common/misc.o ../common/memcpy.o ../../lib/hal/libhal.a LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) ! zImage: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a $(obj-y) bootstrap.o $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ --set-section-flags image=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(obj-y) ../lib/zlib.a -L/xtensa-elf/lib $(LIBGCC) $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf ! zImage.initrd: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a $(obj-y) bootstrap.o $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ --add-section image=../images/vmlinux.gz \ --- 5,51 ---- # ! ZOBJ := ../common/misc.o ../common/memcpy.o ../../lib/hal/libhal.a LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) ! Image: bootstrap.o $(TOPDIR)/vmlinux ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.tmp $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=vmlinux.tmp \ --set-section-flags image=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) --defsym gunzip=0 -Tboot.ld -o $@.elf $@.tmp $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf vmlinux.tmp ! Image.initrd: bootstrap.o $(TOPDIR)/vmlinux ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.tmp ! $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=vmlinux.tmp \ ! --set-section-flags image=contents,alloc,load,load,data \ ! --add-section .initrd=../images/ramdisk \ ! --set-section-flags .initrd=contents,alloc,load,load,data \ ! bootstrap.o $@.tmp ! $(LD) --defsym gunzip=0 -Tboot.ld -o $@.elf $@.tmp ! $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf vmlinux.tmp ! ! zImage: bootstrap.o $(TOPDIR)/vmlinux ../lib/zlib.a $(ZOBJ) ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.tmp ! gzip -vf9 vmlinux.tmp ! $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=vmlinux.tmp.gz \ ! --set-section-flags image=contents,alloc,load,load,data \ ! bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(ZOBJ) ../lib/zlib.a -L/xtensa-elf/lib $(LIBGCC) ! $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf vmlinux.tmp.gz ! ! zImage.initrd: bootstrap.o $(TOPDIR)/vmlinux ../lib/zlib.a $(ZOBJ) ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.tmp ! gzip -vf9 vmlinux.tmp $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ --add-section image=../images/vmlinux.gz \ *************** *** 24,30 **** --set-section-flags .initrd=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(obj-y) ../lib/zlib.a -L/xtensa-elf/lib $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf USE_STANDARD_AS_RULE=y --- 54,60 ---- --set-section-flags .initrd=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(ZOBJ) ../lib/zlib.a -L/xtensa-elf/lib $(LIBGCC) $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf vmlinux.tmp.gz USE_STANDARD_AS_RULE=y Index: bootstrap.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/bootstrap.S,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bootstrap.S 2 May 2003 22:53:02 -0000 1.4 --- bootstrap.S 7 May 2003 18:55:20 -0000 1.5 *************** *** 27,32 **** /* Make sure we have enough space for the 'uncompressor' */ ! #define STACK_SIZE 163840 ! #define HEAP_SIZE 524288 # a2: Parameter list --- 27,32 ---- /* Make sure we have enough space for the 'uncompressor' */ ! #define STACK_SIZE 32768 ! #define HEAP_SIZE (131072*4) # a2: Parameter list *************** *** 79,83 **** addi a4, a0, __start - __start_a0 ! mov.n a0, a4 movi a4, __start movi a5, __reloc_end --- 79,83 ---- addi a4, a0, __start - __start_a0 ! mov a0, a4 movi a4, __start movi a5, __reloc_end *************** *** 167,173 **** movi a10, _image_end movi a7, 0x1000000 ! sub a10, a10, a6 movi a9, complen ! s32i a10, a9, 0 movi a0, 0 --- 167,173 ---- movi a10, _image_end movi a7, 0x1000000 ! sub a11, a10, a6 movi a9, complen ! s32i a11, a9, 0 movi a0, 0 *************** *** 179,186 **** .extern gunzip ! call4 gunzip /* jump to the kernel */ ! #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 --- 179,211 ---- .extern gunzip ! movi a4, gunzip ! beqz a4, 1f ! ! callx4 a4 ! j 2f ! ! ! # a6 destination start ! # a7 maximum size of destination ! # a8 source start ! # a9 ptr to length ! # a10 destination end ! ! 1: ! l32i a9, a8, 0 ! l32i a11, a8, 4 ! s32i a9, a6, 0 ! s32i a11, a6, 4 ! l32i a9, a8, 8 ! l32i a11, a8, 12 ! s32i a9, a6, 8 ! s32i a11, a6, 12 ! addi a6, a6, 16 ! addi a8, a8, 16 ! blt a6, a10, 1b ! /* jump to the kernel */ ! 2: #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 |
|
From: <za...@us...> - 2003-05-07 18:55:23
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot In directory sc8-pr-cvs1:/tmp/cvs-serv23057 Modified Files: Makefile Log Message: Added missing files in common (from last commit). Added targets Image and Image.initrd for RedBoot back in again. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 2 May 2003 22:53:02 -0000 1.3 --- Makefile 7 May 2003 18:55:20 -0000 1.4 *************** *** 31,44 **** $(MAKE) -C lib ! images/vmlinux.gz: ! $(MAKE) -C images vmlinux.gz ! ! zImage zImage.initrd: lib/zlib.a images/vmlinux.gz ! ! ifneq ($(subdir-y),) ! for d in $(subdir-y); do $(MAKE) -C $$d $@; done ! endif - Image Image.initrd: $(TOPDIR)/vmlinux ifneq ($(subdir-y),) for d in $(subdir-y); do $(MAKE) -C $$d $@; done --- 31,36 ---- $(MAKE) -C lib ! zImage zImage.initrd Image Image.initrd: ifneq ($(subdir-y),) for d in $(subdir-y); do $(MAKE) -C $$d $@; done |
|
From: <za...@us...> - 2003-05-07 04:53:47
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/common In directory sc8-pr-cvs1:/tmp/cvs-serv22994/common Log Message: Directory /cvsroot/xtensa/linux/arch/xtensa/boot/common added to the repository |
|
From: <za...@us...> - 2003-05-07 02:49:20
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/include In directory sc8-pr-cvs1:/tmp/cvs-serv22789/include Log Message: Directory /cvsroot/xtensa/linux/arch/xtensa/boot/include added to the repository |
|
From: <za...@us...> - 2003-05-03 00:22:23
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv23831
Added Files:
Makefile zlib.c
Log Message:
Added two files that were missing in my last submission.
--- NEW FILE: Makefile ---
#
# Makefile for some libs needed by zImage.
#
L_TARGET := zlib.a
obj-y := zlib.o
zlib.a: zlib.o
include $(TOPDIR)/Rules.make
--- NEW FILE: zlib.c ---
/*
* BK Id: SCCS/s.zlib.c 1.8 05/18/01 15:17:24 cort
*/
/*
* This file is derived from various .h and .c files from the zlib-0.95
* distribution by Jean-loup Gailly and Mark Adler, with some additions
* by Paul Mackerras to aid in implementing Deflate compression and
* decompression for PPP packets. See zlib.h for conditions of
* distribution and use.
*
* Changes that have been made include:
* - changed functions not used outside this file to "local"
* - added minCompression parameter to deflateInit2
* - added Z_PACKET_FLUSH (see zlib.h for details)
* - added inflateIncomp
*
*/
/*+++++*/
[...2111 lines suppressed...]
unsigned long s2 = (adler >> 16) & 0xffff;
int k;
if (buf == Z_NULL) return 1L;
while (len > 0) {
k = len < NMAX ? len : NMAX;
len -= k;
while (k >= 16) {
DO16(buf);
k -= 16;
}
if (k != 0) do {
DO1(buf);
} while (--k);
s1 %= BASE;
s2 %= BASE;
}
return (s2 << 16) | s1;
}
|
|
From: <za...@us...> - 2003-05-02 22:53:07
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/images In directory sc8-pr-cvs1:/tmp/cvs-serv3499/images Modified Files: Makefile Log Message: Added support for compressed kernels. Removed targets 'Image' and 'Image.initrd' for RedBoot. Use 'make zImage' and 'make zImage.initrd', instead. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/images/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 28 Apr 2003 23:21:10 -0000 1.2 --- Makefile 2 May 2003 22:53:02 -0000 1.3 *************** *** 3,16 **** # - include $(TOPDIR)/Rules.make ! vmlinux.bin: $(TOPDIR)/vmlinux $(OBJCOPY) -S -O binary \ -R .ResetVector.text \ -R .WindowVectors.literal \ ! -R .DebugInterruptVector.literal \ ! -R .DebugInterruptVector.text \ -R .UserExceptionVector.literal \ - -R .KernelExceptionVector.literal \ -R .DoubleExceptionVector.literal \ -R .xt.insn \ --- 3,13 ---- # ! vmlinux: $(TOPDIR)/vmlinux $(OBJCOPY) -S -O binary \ -R .ResetVector.text \ -R .WindowVectors.literal \ ! -R .DebugInterruptVector.* \ -R .UserExceptionVector.literal \ -R .DoubleExceptionVector.literal \ -R .xt.insn \ *************** *** 19,35 **** $(TOPDIR)/vmlinux $@ ! vmlinux.bin.gz: $(TOPDIR)/vmlinux $(OBJCOPY) -S -O binary \ -R .ResetVector.text \ -R .WindowVectors.literal \ -R .DebugInterruptVector* \ -R .debug* \ -R .xt.insn \ -R .comment \ ! -R .stab* \ $(TOPDIR)/vmlinux vmlinux ! gzip -vf9 vmlinux.bin clean: rm -f Image* zImage* vmlinux* --- 16,37 ---- $(TOPDIR)/vmlinux $@ ! vmlinux.gz: $(TOPDIR)/vmlinux $(OBJCOPY) -S -O binary \ -R .ResetVector.text \ -R .WindowVectors.literal \ -R .DebugInterruptVector* \ + -R .UserExceptionVector.literal \ + -R .KernelExceptionVector.literal \ + -R .DoubleExceptionVector.literal \ -R .debug* \ -R .xt.insn \ -R .comment \ ! --strip-all \ $(TOPDIR)/vmlinux vmlinux ! gzip -vf9 vmlinux clean: rm -f Image* zImage* vmlinux* + + include $(TOPDIR)/Rules.make |
|
From: <za...@us...> - 2003-05-02 22:53:07
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot In directory sc8-pr-cvs1:/tmp/cvs-serv3499/boot-redboot Modified Files: Makefile boot.ld bootstrap.S Log Message: Added support for compressed kernels. Removed targets 'Image' and 'Image.initrd' for RedBoot. Use 'make zImage' and 'make zImage.initrd', instead. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 28 Aug 2002 16:10:13 -0000 1.1.1.1 --- Makefile 2 May 2003 22:53:02 -0000 1.2 *************** *** 5,55 **** # ! OBJECTS := bootstrap.o ! ! bootstrap.o: bootstrap.S ! Image: $(OBJECTS) $(TOPDIR)/vmlinux ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.bin $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section=image=vmlinux.bin \ --set-section-flags image=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f vmlinux.bin $@.tmp $@.elf ! Image.initrd: $(OBJECTS) $(TOPDIR)/vmlinux ! $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ ! $(TOPDIR)/vmlinux vmlinux.bin $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=vmlinux.bin \ --set-section-flags image=contents,alloc,load,load,data \ --add-section .initrd=../images/ramdisk \ --set-section-flags .initrd=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f vmlinux.bin $@.elf $@.tmp $@.elf ! ! zImage: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a ! $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ ! --set-section-flags image=contents,alloc,load,load,data \ ! head.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib ! $(OBJCOPY) -S -O binary $@.elf images/$@.redboot ! rm -f $@.tmp ! ! zImage.initrd: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a ! $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ ! --set-section-flags image=contents,alloc,load,load,data \ ! --add-section .initrd=../images/ramdisk \ ! --set-section-flags .initrd=contents,alloc,load,load,data \ ! head.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp -L/xtensa-elf/lib ! $(OBJCOPY) -S -O binary $@.elf images/$@.redboot ! rm -f $@.tmp USE_STANDARD_AS_RULE=y --- 5,30 ---- # ! obj-y += ../common/misc.o ../common/memcpy.o ../../lib/hal/libhal.a ! LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) ! zImage: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a $(obj-y) bootstrap.o $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ --set-section-flags image=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(obj-y) ../lib/zlib.a -L/xtensa-elf/lib $(LIBGCC) $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf ! zImage.initrd: $(OBJECTS) ../images/vmlinux.gz ../lib/zlib.a $(obj-y) bootstrap.o $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ ! --add-section image=../images/vmlinux.gz \ --set-section-flags image=contents,alloc,load,load,data \ --add-section .initrd=../images/ramdisk \ --set-section-flags .initrd=contents,alloc,load,load,data \ bootstrap.o $@.tmp ! $(LD) -Tboot.ld -o $@.elf $@.tmp $(obj-y) ../lib/zlib.a -L/xtensa-elf/lib $(OBJCOPY) -S -O binary $@.elf ../images/$@.redboot ! rm -f $@.tmp $@.elf USE_STANDARD_AS_RULE=y Index: boot.ld =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/boot.ld,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** boot.ld 28 Aug 2002 16:10:13 -0000 1.1.1.1 --- boot.ld 2 May 2003 22:53:02 -0000 1.2 *************** *** 9,13 **** __reloc_start = . ; _text_start = . ; ! *(.text.literal .text) _text_end = . ; } --- 9,13 ---- __reloc_start = . ; _text_start = . ; ! *(.literal .text.literal .text) _text_end = . ; } Index: bootstrap.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-redboot/bootstrap.S,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bootstrap.S 11 Mar 2003 19:09:40 -0000 1.3 --- bootstrap.S 2 May 2003 22:53:02 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- #include <xtensa/config/core.h> #include <xtensa/cacheasm.h> + /* * RB-Data: RedBoot data/bss *************** *** 24,29 **** */ ! #define STACK_SIZE 16384 ! #define HEAP_SIZE 65536 # a2: Parameter list --- 25,32 ---- */ ! /* Make sure we have enough space for the 'uncompressor' */ ! ! #define STACK_SIZE 163840 ! #define HEAP_SIZE 524288 # a2: Parameter list *************** *** 33,37 **** .globl __start ! /* this is the first byte of the loader! */ __start: entry sp, 32 # we do not intend to return --- 36,40 ---- .globl __start ! /* this must be the first byte of the loader! */ __start: entry sp, 32 # we do not intend to return *************** *** 64,68 **** rsync ! /* copy the loader to its address */ /* Note: The assembler cannot relax "addi a0, a0, ..." to an --- 67,77 ---- rsync ! /* copy the loader to its address ! * Note: The loader itself is a very small piece, so we assume we ! * don't partially overlap. We also assume (even more important) ! * that the kernel image is out of the way. Usually, when the ! * load address of this image is not at an arbitrary address, ! * but aligned to some 10K's we shouldn't overlap. ! */ /* Note: The assembler cannot relax "addi a0, a0, ..." to an *************** *** 95,104 **** ! /* 28feb2003 jn -- ! * I changed this to use the nice macros provided, it's ! * a bit of overkill because you don't really need to flush ! * the entire cache, just the regions to where we just copied ! * the code. ! */ #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 --- 104,109 ---- ! /* We have to flush and invalidate the caches here before we jump. */ ! #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 *************** *** 112,115 **** --- 117,123 ---- _reloc: + /* RedBoot is now at the end of the memory, so we don't have + * to copy the parameter list. Keep the code around; in case + * we need it again. */ #if 0 # a0: load address *************** *** 129,132 **** --- 137,141 ---- blt a2, a3, 2b #endif + /* clear BSS section */ movi a6, __bss_start *************** *** 137,144 **** addi a6, a6, 4 blt a6, a7, 3b ! movi a1, _stack + STACK_SIZE ! /* Uncompress/Relocate the kernel */ # a0: load address --- 146,155 ---- addi a6, a6, 4 blt a6, a7, 3b ! ! movi a5, -16 movi a1, _stack + STACK_SIZE + and a1, a1, a5 ! /* Uncompress the kernel */ # a0: load address *************** *** 148,186 **** movi a3, __image_load sub a4, a3, a4 ! add a6, a0, a4 # a1 Stack ! # a6(a2) Load address of image ! ## call4 start ! /* for now, copy the kernel */ ! movi a4, _image_end ! movi a3, _image_start ! 4: ! l32i a9, a6, 0 ! l32i a10, a6, 4 ! s32i a9, a3, 0 ! s32i a10, a3, 4 ! l32i a9, a6, 8 ! l32i a10, a6, 12 ! s32i a9, a3, 8 ! s32i a10, a3, 12 ! addi a3, a3, 16 ! addi a6, a6, 16 ! blt a3, a4, 4b ! /* jump to the kernel */ ! /* 28feb2003 -- jn ! * we just copied the kernel, it might be wise ! * at this point to flush the caches, no? ! */ dcache_writeback_all a5, a6 icache_invalidate_all a5, a6 - - /* movi a2, _param_start */ movi a5, __start movi a3, boot_initrd_start --- 159,191 ---- movi a3, __image_load sub a4, a3, a4 ! add a8, a0, a4 # a1 Stack ! # a8(a4) Load address of the image ! movi a6, _image_start ! movi a10, _image_end ! movi a7, 0x1000000 ! sub a10, a10, a6 ! movi a9, complen ! s32i a10, a9, 0 ! movi a0, 0 ! # a6 destination ! # a7 maximum size of destination ! # a8 source ! # a9 ptr to length + .extern gunzip + call4 gunzip + + /* jump to the kernel */ ! #if XCHAL_DCACHE_IS_WRITEBACK dcache_writeback_all a5, a6 + #endif icache_invalidate_all a5, a6 movi a5, __start movi a3, boot_initrd_start *************** *** 198,203 **** --- 203,220 ---- jx a0 + .align 16 + .data + .globl avail_ram + avail_ram: + .long _heap + .globl end_avail + end_avail: + .long _heap + HEAP_SIZE + .comm _stack, STACK_SIZE .comm _heap, HEAP_SIZE + + .globl end_avail + .comm complen, 4 .end literal_prefix |
|
From: <za...@us...> - 2003-05-02 22:53:06
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot In directory sc8-pr-cvs1:/tmp/cvs-serv3499 Modified Files: Makefile Log Message: Added support for compressed kernels. Removed targets 'Image' and 'Image.initrd' for RedBoot. Use 'make zImage' and 'make zImage.initrd', instead. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 23 Oct 2002 20:53:18 -0000 1.2 --- Makefile 2 May 2003 22:53:02 -0000 1.3 *************** *** 9,15 **** GZIP = gzip ! GZIP_FLAGS = -v9f ! CFLAGS += -fno-builtin ifeq "$(XTENSA_LITTLE_ENDIAN)" "y" --- 9,15 ---- GZIP = gzip ! GZIP_FLAGS = -v9fc ! CFLAGS += -fno-builtin -I$(TOPDIR)/arch/$(ARCH)/boot/include ifeq "$(XTENSA_LITTLE_ENDIAN)" "y" *************** *** 26,38 **** subdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf ! subdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf lib/zlib.a: $(MAKE) -C lib ! images/vmlinux.gz: $(TOPDIR)/vmlinux ! $(GZIP) $(GZIP_FLAGS) $? zImage zImage.initrd: lib/zlib.a images/vmlinux.gz ifneq ($(subdir-y),) for d in $(subdir-y); do $(MAKE) -C $$d $@; done --- 26,39 ---- subdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf ! subdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf lib/zlib.a: $(MAKE) -C lib ! images/vmlinux.gz: ! $(MAKE) -C images vmlinux.gz zImage zImage.initrd: lib/zlib.a images/vmlinux.gz + ifneq ($(subdir-y),) for d in $(subdir-y); do $(MAKE) -C $$d $@; done |
|
From: <za...@us...> - 2003-05-02 22:53:06
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/boot-elf In directory sc8-pr-cvs1:/tmp/cvs-serv3499/boot-elf Modified Files: Makefile Log Message: Added support for compressed kernels. Removed targets 'Image' and 'Image.initrd' for RedBoot. Use 'make zImage' and 'make zImage.initrd', instead. Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/boot-elf/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 28 Aug 2002 16:10:13 -0000 1.1.1.1 --- Makefile 2 May 2003 22:53:02 -0000 1.2 *************** *** 51,52 **** --- 51,58 ---- clean: + + zImage: + + zImage.initrd: + + |
|
From: <za...@us...> - 2003-05-02 22:45:52
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/lib In directory sc8-pr-cvs1:/tmp/cvs-serv31855/lib Log Message: Directory /cvsroot/xtensa/linux/arch/xtensa/boot/lib added to the repository |
|
From: <joe...@us...> - 2003-05-02 17:16:41
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv28143/arch/xtensa/kernel Modified Files: signal.c Log Message: Offer a sigcontext as the second argument to signal handlers. Index: signal.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/signal.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** signal.c 29 Apr 2003 18:30:33 -0000 1.8 --- signal.c 2 May 2003 17:16:37 -0000 1.9 *************** *** 614,618 **** */ set_thread_state(regs, frame, frame->retcode, ! ka->sa.sa_handler, signal, NULL, NULL); /* Set access mode to USER_DS. Nomenclature is outdated, but --- 614,618 ---- */ set_thread_state(regs, frame, frame->retcode, ! ka->sa.sa_handler, signal, &frame->sc, NULL); /* Set access mode to USER_DS. Nomenclature is outdated, but |
|
From: <joe...@us...> - 2003-04-29 18:30:38
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv27015/arch/xtensa/kernel Modified Files: signal.c Log Message: Clear all CP and EXTRA state before transfering control to a signal handler. Index: signal.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/signal.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** signal.c 23 Apr 2003 23:19:55 -0000 1.7 --- signal.c 29 Apr 2003 18:30:33 -0000 1.8 *************** *** 303,309 **** xthal_validate_cp(i); xthal_save_cpregs(tsk->thread.cpregs_ptr[i], i); xthal_invalidate_cp(i); ! /* I think this is unnecessary; we're not switching owners. */ ! /* coproc_owners[i] = 0; */ } } --- 303,313 ---- xthal_validate_cp(i); xthal_save_cpregs(tsk->thread.cpregs_ptr[i], i); + + /* Invalidate and "disown" the cp to allow + * callers the chance to reset cp state in the + * task_struct. */ + xthal_invalidate_cp(i); ! coproc_owners[i] = 0; } } *************** *** 323,338 **** /* XTFIXME: If a task has never used a coprocessor, there is ! no need to save and restore anything. Tracking this ! information would allow us to optimize this section. ! Perhaps we can use current->used_math or (current->flags & ! PF_USEDFPU) or define a new field in the thread ! structure. */ struct task_struct *tsk = current; flush_my_cpstate(tsk); /* Note that we just copy everything: 'extra' and 'cp' state together. */ ! if (__copy_to_user(buf, tsk->thread.cpextra, TOTAL_CPEXTRA_SIZE)) ! return -1; ! return 1; #endif } --- 327,358 ---- /* XTFIXME: If a task has never used a coprocessor, there is ! * no need to save and restore anything. Tracking this ! * information would allow us to optimize this section. ! * Perhaps we can use current->used_math or (current->flags & ! * PF_USEDFPU) or define a new field in the thread ! * structure. */ ! ! /* We flush any live, task-owned cp state to the task_struct, ! * then copy it all to the sigframe. Then we clear all ! * cp/extra state in the task_struct, effectively ! * clearing/resetting all cp/extra state for the signal ! * handler (cp-exception handling will load these new values ! * into the cp/extra registers.) This step is important for ! * things like a floating-point cp, where the OS must reset ! * the FCR to the default rounding mode. */ + int err = 0; struct task_struct *tsk = current; + flush_my_cpstate(tsk); /* Note that we just copy everything: 'extra' and 'cp' state together. */ ! err |= __copy_to_user(buf, tsk->thread.cpextra, TOTAL_CPEXTRA_SIZE); ! memset(tsk->thread.cpextra, 0, TOTAL_CPEXTRA_SIZE); ! ! #if (TOTAL_CPEXTRA_SIZE == 0) ! #error Sanity check on memset above, cpextra_size should not be zero. ! #endif ! ! return err ? -1 : 1; #endif } |
|
From: <joe...@us...> - 2003-04-28 23:21:14
|
Update of /cvsroot/xtensa/linux/arch/xtensa/boot/images In directory sc8-pr-cvs1:/tmp/cvs-serv13342/arch/xtensa/boot/images Modified Files: Makefile Log Message: The debug vector is no longer level 3, and the source code is now based on processor-config parameters. This commit doesn't affect much since the debug vector is mapped into ROM (i.e., RedBoot). Index: Makefile =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/boot/images/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 28 Aug 2002 16:10:13 -0000 1.1.1.1 --- Makefile 28 Apr 2003 23:21:10 -0000 1.2 *************** *** 9,14 **** -R .ResetVector.text \ -R .WindowVectors.literal \ ! -R .Level3InterruptVector.literal \ ! -R .Level3InterruptVector.text \ -R .UserExceptionVector.literal \ -R .KernelExceptionVector.literal \ --- 9,14 ---- -R .ResetVector.text \ -R .WindowVectors.literal \ ! -R .DebugInterruptVector.literal \ ! -R .DebugInterruptVector.text \ -R .UserExceptionVector.literal \ -R .KernelExceptionVector.literal \ *************** *** 23,27 **** -R .ResetVector.text \ -R .WindowVectors.literal \ ! -R .Level3InterruptVector* \ -R .debug* \ -R .xt.insn \ --- 23,27 ---- -R .ResetVector.text \ -R .WindowVectors.literal \ ! -R .DebugInterruptVector* \ -R .debug* \ -R .xt.insn \ |
|
From: <joe...@us...> - 2003-04-28 23:21:14
|
Update of /cvsroot/xtensa/linux/arch/xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv13342/arch/xtensa
Modified Files:
vmlinux.lds.S
Log Message:
The debug vector is no longer level 3, and the source code is now based on processor-config parameters. This commit doesn't affect much since the debug vector is mapped into ROM (i.e., RedBoot).
Index: vmlinux.lds.S
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/vmlinux.lds.S,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** vmlinux.lds.S 28 Aug 2002 16:10:13 -0000 1.1.1.1
--- vmlinux.lds.S 28 Apr 2003 23:21:09 -0000 1.2
***************
*** 158,176 ****
SIZEOF(.initcall.init),
.initcall.init)
! SECTION_VECTOR (_Level3InterruptVector_literal,
! .Level3InterruptVector.literal,
! XCHAL_INTLEVEL_VECTOR_VADDR(3) - 4,
SIZEOF(.WindowVectors.text),
.WindowVectors.text)
! SECTION_VECTOR (_Level3InterruptVector_text,
! .Level3InterruptVector.text,
! XCHAL_INTLEVEL_VECTOR_VADDR(3),
4,
! .Level3InterruptVector.literal)
SECTION_VECTOR (_KernelExceptionVector_literal,
.KernelExceptionVector.literal,
XCHAL_KERNELEXC_VECTOR_VADDR - 4,
! SIZEOF(.Level3InterruptVector.text),
! .Level3InterruptVector.text)
SECTION_VECTOR (_KernelExceptionVector_text,
.KernelExceptionVector.text,
--- 158,176 ----
SIZEOF(.initcall.init),
.initcall.init)
! SECTION_VECTOR (_DebugInterruptVector_literal,
! .DebugInterruptVector.literal,
! XCHAL_INTLEVEL_VECTOR_VADDR(XCHAL_DEBUGLEVEL) - 4,
SIZEOF(.WindowVectors.text),
.WindowVectors.text)
! SECTION_VECTOR (_DebugInterruptVector_text,
! .DebugInterruptVector.text,
! XCHAL_INTLEVEL_VECTOR_VADDR(XCHAL_DEBUGLEVEL),
4,
! .DebugInterruptVector.literal)
SECTION_VECTOR (_KernelExceptionVector_literal,
.KernelExceptionVector.literal,
XCHAL_KERNELEXC_VECTOR_VADDR - 4,
! SIZEOF(.DebugInterruptVector.text),
! .DebugInterruptVector.text)
SECTION_VECTOR (_KernelExceptionVector_text,
.KernelExceptionVector.text,
|
|
From: <joe...@us...> - 2003-04-28 23:21:13
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv13342/arch/xtensa/kernel Modified Files: setup.c vectors.S Log Message: The debug vector is no longer level 3, and the source code is now based on processor-config parameters. This commit doesn't affect much since the debug vector is mapped into ROM (i.e., RedBoot). Index: setup.c =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/setup.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** setup.c 3 Apr 2003 18:48:05 -0000 1.11 --- setup.c 28 Apr 2003 23:21:09 -0000 1.12 *************** *** 284,289 **** extern char _WindowVectors_text_start; extern char _WindowVectors_text_end; ! extern char _Level3InterruptVector_literal_start; ! extern char _Level3InterruptVector_text_end; extern char _KernelExceptionVector_literal_start; extern char _KernelExceptionVector_text_end; --- 284,289 ---- extern char _WindowVectors_text_start; extern char _WindowVectors_text_end; ! extern char _DebugInterruptVector_literal_start; ! extern char _DebugInterruptVector_text_end; extern char _KernelExceptionVector_literal_start; extern char _KernelExceptionVector_text_end; *************** *** 322,327 **** __pa(&_WindowVectors_text_end), 0); ! mem_reserve(__pa(&_Level3InterruptVector_literal_start), ! __pa(&_Level3InterruptVector_text_end), 0); mem_reserve(__pa(&_KernelExceptionVector_literal_start), --- 322,327 ---- __pa(&_WindowVectors_text_end), 0); ! mem_reserve(__pa(&_DebugInterruptVector_literal_start), ! __pa(&_DebugInterruptVector_text_end), 0); mem_reserve(__pa(&_KernelExceptionVector_literal_start), Index: vectors.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/vectors.S,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** vectors.S 13 Feb 2003 00:17:21 -0000 1.7 --- vectors.S 28 Apr 2003 23:21:10 -0000 1.8 *************** *** 663,679 **** ! .begin literal_prefix .Level3InterruptVector ! .section .Level3InterruptVector.text, "ax" ! .global _Level3InterruptVector ! .func _Level3InterruptVector .align 4 ! _Level3InterruptVector: ! wsr a3, EXCSAVE_3 movi a3, xthal_debugexc_defhndlr_nw jx a3 ! .endfunc // _Level3InterruptVector .end literal_prefix --- 663,679 ---- ! .begin literal_prefix .DebugInterruptVector ! .section .DebugInterruptVector.text, "ax" ! .global _DebugInterruptVector ! .func _DebugInterruptVector .align 4 ! _DebugInterruptVector: ! wsr a3, EXCSAVE + XCHAL_DEBUGLEVEL movi a3, xthal_debugexc_defhndlr_nw jx a3 ! .endfunc // _DebugInterruptVector .end literal_prefix |
|
From: <joe...@us...> - 2003-04-25 16:48:23
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv959/include/asm-xtensa
Modified Files:
sigcontext.h
Log Message:
Add alignment directive to cpstate. It probably doesn't affect linux_be/le/test, but will definitely affect other processor configurations.
Index: sigcontext.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/sigcontext.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sigcontext.h 23 Apr 2003 23:19:56 -0000 1.3
--- sigcontext.h 25 Apr 2003 16:48:16 -0000 1.4
***************
*** 20,24 ****
struct _cpstate {
unsigned char _cpstate[TOTAL_CPEXTRA_SIZE];
! };
struct sigcontext {
--- 20,25 ----
struct _cpstate {
unsigned char _cpstate[TOTAL_CPEXTRA_SIZE];
! } __attribute__ ((aligned (XCHAL_CPEXTRA_SA_ALIGN)));
!
struct sigcontext {
|
|
From: <joe...@us...> - 2003-04-23 23:20:00
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv31547/arch/xtensa/kernel
Modified Files:
signal.c
Log Message:
Save and restore coprocessor state as needed when handling signals.
Index: signal.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/signal.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** signal.c 23 Apr 2003 00:36:27 -0000 1.6
--- signal.c 23 Apr 2003 23:19:55 -0000 1.7
***************
*** 34,37 ****
--- 34,39 ----
asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
+ extern struct task_struct *coproc_owners[];
+
int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from)
{
***************
*** 171,178 ****
{
struct sigcontext sc;
unsigned long extramask[_NSIG_WORDS-1];
unsigned char retcode[6];
- unsigned int window[4]; /* Window of 4 registers for initial context */
unsigned int reserved[4]; /* Reserved area for chaining */
};
--- 173,181 ----
{
struct sigcontext sc;
+ struct _cpstate cpstate;
unsigned long extramask[_NSIG_WORDS-1];
unsigned char retcode[6];
unsigned int reserved[4]; /* Reserved area for chaining */
+ unsigned int window[4]; /* Window of 4 registers for initial context */
};
***************
*** 181,189 ****
struct siginfo info;
struct ucontext uc;
unsigned char retcode[6];
- unsigned int window[4]; /* Window of 4 registers for initial context */
unsigned int reserved[4]; /* Reserved area for chaining */
};
static int
restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
--- 184,219 ----
struct siginfo info;
struct ucontext uc;
+ struct _cpstate cpstate;
unsigned char retcode[6];
unsigned int reserved[4]; /* Reserved area for chaining */
+ unsigned int window[4]; /* Window of 4 registers for initial context */
};
+ 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
+ restore_cpextra (struct _cpstate *buf)
+ {
+ /* The signal handler may have used coprocessors in which
+ * case they are still enabled. We disable them to force a
+ * reloading of the original task's CP state by the lazy
+ * context-switching mechanisms of CP exception handling.
+ * Also, we essentially discard any coprocessor state that the
+ * signal handler created. */
+
+ struct task_struct *tsk = current;
+ discard_my_cpstate(tsk);
+ return __copy_from_user(tsk->thread.cpextra, buf, TOTAL_CPEXTRA_SIZE);
+ }
+
static int
restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
***************
*** 192,195 ****
--- 222,226 ----
unsigned int err = 0;
unsigned long ps;
+ struct _cpstate *buf;
int i;
***************
*** 249,278 ****
err |= __get_user(thread->regfile[i], &sc->sc_regfile[i]);
}
- #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) */
-
- /* XTFIXME: cp[0-7]_regs? Yes, we should copy over these array
- * contents, probably using the __copy_{to,from}_user() macros
- * in uaccess.h. For now, it doesn't affect development since
- * LinuxBE/LinuxLE do not have coprocessors. We should
- * implement this section when we're ready to test it.
- * Testing will be complex (Joe, keep your signaling test
- * cases around.)
- */
! /* thread->info is unused for now */
regs->syscall_nr = -1; /* disable syscall checks */
return err;
}
static int
! setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
! unsigned long mask)
{
struct thread_struct *thread;
! int err = 0;
! int i;
#define COPY(x) err |= __put_user(regs->x, &sc->sc_##x)
--- 280,347 ----
err |= __get_user(thread->regfile[i], &sc->sc_regfile[i]);
}
! err |= __get_user(buf, &sc->sc_cpstate);
! if (buf) {
! if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
! goto badframe;
! err |= restore_cpextra(buf);
! }
regs->syscall_nr = -1; /* disable syscall checks */
return err;
+
+ badframe:
+ return 1;
}
+ static inline void
+ flush_my_cpstate(struct task_struct *tsk)
+ {
+ int i;
+ for (i = 0; i < XCHAL_CP_NUM; i++) {
+ if (tsk == coproc_owners[i]) {
+ xthal_validate_cp(i);
+ xthal_save_cpregs(tsk->thread.cpregs_ptr[i], i);
+ xthal_invalidate_cp(i);
+ /* I think this is unnecessary; we're not switching owners. */
+ /* coproc_owners[i] = 0; */
+ }
+ }
+ }
+
+ /* Return codes:
+ 0: nothing saved
+ 1: stuff to save, successful
+ -1: stuff to save, error happened
+ */
static int
! save_cpextra (struct _cpstate *buf)
! {
! #if (XCHAL_EXTRA_SA_SIZE == 0) && (XCHAL_CP_NUM == 0)
! return 0;
! #else
!
! /* XTFIXME: If a task has never used a coprocessor, there is
! no need to save and restore anything. Tracking this
! information would allow us to optimize this section.
! Perhaps we can use current->used_math or (current->flags &
! PF_USEDFPU) or define a new field in the thread
! structure. */
!
! struct task_struct *tsk = current;
! flush_my_cpstate(tsk);
! /* Note that we just copy everything: 'extra' and 'cp' state together. */
! if (__copy_to_user(buf, tsk->thread.cpextra, TOTAL_CPEXTRA_SIZE))
! return -1;
! return 1;
! #endif
! }
!
! static int
! setup_sigcontext(struct sigcontext *sc, struct _cpstate *cpstate,
! struct pt_regs *regs, unsigned long mask)
{
struct thread_struct *thread;
! int i, tmp, err = 0;
#define COPY(x) err |= __put_user(regs->x, &sc->sc_##x)
***************
*** 303,320 ****
err |= __put_user(thread->regfile[i], &sc->sc_regfile[i]);
}
- #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) */
-
- /* XTFIXME: cp[0-7]_regs? Yes, we should copy over these array
- * contents, probably using the __copy_{to,from}_user() macros
- * in uaccess.h. For now, it doesn't affect development since
- * LinuxBE/LinuxLE do not have coprocessors. We should
- * implement this section when we're ready to test it.
- * Testing will be complex (Joe, keep your signaling test
- * cases around.)
- */
! /* thread->info is unused for now */
/* non-iBCS2 extensions.. */
--- 372,381 ----
err |= __put_user(thread->regfile[i], &sc->sc_regfile[i]);
}
! tmp = save_cpextra(cpstate);
! if (tmp < 0)
! err = 1;
! else
! err |= __put_user(tmp ? cpstate : NULL, &sc->sc_cpstate);
/* non-iBCS2 extensions.. */
***************
*** 516,520 ****
: sig;
! err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
if (_NSIG_WORDS > 1) {
--- 577,581 ----
: sig;
! err |= setup_sigcontext(&frame->sc, &frame->cpstate, regs, set->sig[0]);
if (_NSIG_WORDS > 1) {
***************
*** 581,585 ****
&frame->uc.uc_stack.ss_flags);
err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
! err |= setup_sigcontext(&frame->uc.uc_mcontext,
regs, set->sig[0]);
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
--- 642,646 ----
&frame->uc.uc_stack.ss_flags);
err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
! err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->cpstate,
regs, set->sig[0]);
err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
|
|
From: <joe...@us...> - 2003-04-23 23:20:00
|
Update of /cvsroot/xtensa/linux/include/asm-xtensa
In directory sc8-pr-cvs1:/tmp/cvs-serv31547/include/asm-xtensa
Modified Files:
sigcontext.h
Log Message:
Save and restore coprocessor state as needed when handling signals.
Index: sigcontext.h
===================================================================
RCS file: /cvsroot/xtensa/linux/include/asm-xtensa/sigcontext.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sigcontext.h 7 Feb 2003 02:03:34 -0000 1.2
--- sigcontext.h 23 Apr 2003 23:19:56 -0000 1.3
***************
*** 15,18 ****
--- 15,24 ----
#include <xtensa/config/core.h>
+ #include <asm/cpextra.h>
+
+
+ struct _cpstate {
+ unsigned char _cpstate[TOTAL_CPEXTRA_SIZE];
+ };
struct sigcontext {
***************
*** 31,37 ****
unsigned long sc_sar;
unsigned long sc_regfile[XCHAL_NUM_AREGS - 16];
! #if (XCHAL_EXTRA_SA_SIZE > 0)
! unsigned char sc_extra[(XCHAL_EXTRA_SA_SIZE+15)&(~15)];
! #endif /* (XCHAL_EXTRA_SA_SIZE > 0) */
};
--- 37,41 ----
unsigned long sc_sar;
unsigned long sc_regfile[XCHAL_NUM_AREGS - 16];
! struct _cpstate *sc_cpstate;
};
|
|
From: <joe...@us...> - 2003-04-23 23:15:27
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv30214/arch/xtensa/kernel Modified Files: handlers.S Log Message: Remove redundant #if conditional. Index: handlers.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** handlers.S 1 Apr 2003 22:30:29 -0000 1.17 --- handlers.S 23 Apr 2003 23:15:21 -0000 1.18 *************** *** 3076,3080 **** * accessible. */ - #if XCHAL_HAVE_CP rsr a3, CPENABLE movi a4, 1 --- 3076,3079 ---- *************** *** 3084,3088 **** wsr a3, CPENABLE rsync - #endif /* Now compare the current task with the owner of the --- 3083,3086 ---- |