URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/or1k/trunk/rtems/tools
- from Rev 208 to Rev 1765
- ↔ Reverse comparison
Rev 208 → Rev 1765
/build/lock-directory.in
0,0 → 1,43
#!@KSH@ |
# |
# $Id: lock-directory.in,v 1.2 2001-09-27 12:02:53 chris Exp $ |
# |
# Make a directory write protected |
# Used to write protect the install point after a build |
# to prevent inadvertant overwriting. |
# |
|
# is a particular command available on this machine? |
# |
cmd_avail() |
{ |
set -- `type $1 2>&1` |
if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ] |
then |
return 1 |
else |
return 0 |
fi |
} |
|
lock_directory() { |
l_dir=$1/. # get any symlink out of the way using '.' |
if [ -d $l_dir ] |
then |
find $l_dir -type d -perm -0200 -print | $XARGS chmod -w |
fi |
} |
|
# Use gnu xargs if available; faster, more reliable in general |
XARGS=xargs |
cmd_avail gxargs && XARGS=gxargs |
|
for dir |
do |
lock_directory $dir |
done |
|
# Local Variables: *** |
# mode:ksh *** |
# End: *** |
|
/build/cklength.c
0,0 → 1,377
/* |
* cklength - check the length of lines in a file |
* |
* This program check to see if the files passed to it on the command line |
* contain a line which exceeds the maximum allowable length. The default |
* maximum line length is 80. |
* |
* usage: cklength [ -v ] [ arg ... ] files... |
* -l length -- maximum line length |
* -v -- verbose |
* |
* $Id: cklength.c,v 1.2 2001-09-27 12:02:53 chris Exp $ |
*/ |
|
#define GETOPTARGS "l:nNv" |
|
char *USAGE = "\ |
usage: cklength [ -v ] [ arg ... ] files... \n\ |
-l length -- maximum line length\n\ |
-n -- report line numbers for offending lines\n\ |
-N -- report line numbers and length for offending lines\n\ |
-v -- verbose\n\ |
\n\ |
Print the name of files which have at least 1 line which exceeds the\n\ |
maximum line length. The default maximum line length is 80.\n\ |
"; |
|
#include <stdio.h> |
#include <stdlib.h> |
#include <fcntl.h> |
#include <ctype.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <string.h> |
#include <memory.h> |
#include <stdarg.h> |
#include <errno.h> |
|
#include "config.h" |
|
#ifndef VMS |
#ifndef HAVE_STRERROR |
extern int sys_nerr; |
extern char *sys_errlist[]; |
|
#define strerror( _err ) \ |
((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error" |
|
#else /* HAVE_STRERROR */ |
char *strerror (); |
#endif |
#else /* VMS */ |
char *strerror (int,...); |
#endif |
|
|
#define BUFFER_SIZE 512 |
|
#define SUCCESS 0 |
#define FAILURE -1 |
#define Failed(x) (((int) (x)) == FAILURE) |
#define TRUE 1 |
#define FALSE 0 |
#define STREQ(a,b) (strcmp(a,b) == 0) |
#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0])) |
|
/* |
* Definitions for unsigned "ints"; especially for use in data structures |
* that will be shared among (potentially) different cpu's (we punt on |
* byte ordering problems tho) |
*/ |
|
typedef unsigned char u8; |
typedef unsigned short u16; |
typedef unsigned long u32; |
|
/* |
* vars controlled by command line options |
*/ |
|
int verbose = FALSE; /* be verbose */ |
int report_line_numbers = FALSE; /* report line numbers of offenders */ |
int report_line_length = FALSE; /* report line length of offenders */ |
|
int line_length = 80; /* maximum allowable line length */ |
|
extern char *optarg; /* getopt(3) control vars */ |
extern int optind, opterr; |
|
char *progname; /* for error() */ |
|
int process(char *arg); |
void error(int errn, ...); |
long getparm(char *s, long min, long max, char *msg); |
|
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */ |
#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */ |
#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */ |
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */ |
|
#define stol(p) strtol(p, (char **) NULL, 0) |
int Open(), Read(), Write(); |
|
int main( |
int argc, |
char **argv |
) |
{ |
register int c; |
int showusage = FALSE; /* usage error? */ |
int rc = 0; |
|
/* |
* figure out invocation leaf-name |
*/ |
|
if ((progname = strrchr(argv[0], '/')) == (char *) NULL) |
progname = argv[0]; |
else |
progname++; |
|
argv[0] = progname; /* for getopt err reporting */ |
|
/* |
* Check options and arguments. |
*/ |
|
opterr = 0; /* we'll report all errors */ |
while ((c = getopt(argc, argv, GETOPTARGS)) != EOF) |
switch (c) |
{ |
case 'l': /* line length */ |
line_length = atoi( optarg ); |
if ( line_length < 0 || line_length > BUFFER_SIZE ) |
error(ERR_FATAL, "(%d) is illegal line length\n",line_length); |
break; |
|
case 'n': /* toggle report_line_numbers */ |
report_line_numbers = ! report_line_numbers; |
break; |
|
case 'N': /* toggle both reports */ |
report_line_numbers = ! report_line_numbers; |
report_line_length = ! report_line_length; |
break; |
|
case 'v': /* toggle verbose */ |
verbose = ! verbose; |
break; |
|
case '?': |
showusage = TRUE; |
} |
|
if (showusage) |
{ |
(void) fprintf(stderr, "%s", USAGE); |
exit(1); |
} |
|
/* |
* traverse and process the arguments |
*/ |
|
for ( ; argv[optind]; optind++) |
if (Failed(process(argv[optind]))) |
rc = FAILURE; |
|
return rc; |
} |
|
|
/* |
* process(arg) |
*/ |
|
int |
process(char *arg) |
{ |
FILE *in; |
char *bptr; |
char buffer[ BUFFER_SIZE ]; |
int line_number; |
int length; |
int count; |
int rc = SUCCESS; /* succeed by default */ |
|
in = fopen( arg, "r" ); |
if (!in) |
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg ); |
|
count = 0; |
|
for ( line_number=1 ; ; line_number++ ) { |
bptr = fgets( buffer, BUFFER_SIZE, in ); |
if (!bptr) |
break; |
|
/* |
* Don't count the carriage return. |
*/ |
|
length = strlen( buffer ) - 1; |
|
if ( length <= line_length ) |
continue; |
|
if ( count == 0 ) { |
fprintf( stderr, "%s\n", arg ); |
if ( !report_line_numbers ) |
break; |
} |
|
if ( verbose ) |
fprintf( stderr, "TOO LONG:%d: %s\n", line_number, buffer ); |
|
if ( report_line_numbers ) { |
if ( report_line_length ) |
fprintf( stderr, "%d: %d\n" , line_number, length ); |
else |
fprintf( stderr, "%d\n" , line_number ); |
} |
|
count++; |
|
} |
|
fclose( in ); |
return rc; |
} |
|
/* |
* error(errn, arglist) |
* report an error to stderr using printf(3) conventions. |
* Any output is preceded by '<progname>: ' |
* |
* Uses ERR_FATAL bit to request exit(errn) |
* ERR_ABORT to request abort() |
* ERR_ERRNO to indicate use of errno instead of argument. |
* |
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its |
* associated error message is appended to the output. |
*/ |
|
/*VARARGS*/ |
|
void |
error(int error_flag, ...) |
{ |
va_list arglist; |
register char *format; |
int local_errno; |
|
extern int errno; |
|
(void) fflush(stdout); /* in case stdout/stderr same */ |
|
local_errno = error_flag & ~ERR_MASK; |
if (error_flag & ERR_ERRNO) /* use errno? */ |
local_errno = errno; |
|
va_start(arglist, error_flag); |
format = va_arg(arglist, char *); |
(void) fprintf(stderr, "%s: ", progname); |
(void) vfprintf(stderr, format, arglist); |
va_end(arglist); |
|
if (local_errno) |
(void) fprintf(stderr, " (%s)\n", strerror(local_errno)); |
|
(void) fflush(stderr); |
|
if (error_flag & (ERR_FATAL | ERR_ABORT)) |
{ |
if (error_flag & ERR_FATAL) |
{ |
error(0, "fatal error, exiting"); |
exit(local_errno ? local_errno : 1); |
} |
else |
{ |
error(0, "fatal error, aborting"); |
abort(); |
} |
} |
} |
|
long |
getparm(char *s, |
long min, |
long max, |
char *msg) |
{ |
long val; |
|
if ( ! strchr("0123456789-", *s)) |
{ |
error(ERR_FATAL, "'%s' is not a number", s); |
return min; |
} |
|
val = strtol(s, (char **) NULL, 0); |
if ((val < min) || (val > max)) |
{ |
if (min == max) |
error(ERR_FATAL, "%s can only be %ld", s, min); |
else |
error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max); |
} |
|
return val; |
} |
|
|
/* |
* Open() |
* Perform open(2), returning the file descriptor. Prints |
* error message if open fails. |
*/ |
|
int |
Open(char *file, |
int oflag, |
int mode) |
{ |
int O_fd; |
|
if (Failed(O_fd = open(file, oflag, mode))) |
error( |
ERR_ERRNO | ERR_FATAL, |
"open('%s', 0x%x, 0%o) failed", file, oflag, mode |
); |
|
return O_fd; |
} |
|
/* |
* Read() |
* Perform read(2); prints error message if fails. |
*/ |
|
int |
Read(int file, |
char *buffer, |
unsigned int count) |
{ |
int nbytes; |
|
if (Failed(nbytes = read(file, buffer, count))) |
error( |
ERR_ERRNO | ERR_FATAL, |
"read(%d, 0x%x, %d) failed", file, buffer, count |
); |
|
return nbytes; |
} |
|
/* |
* Write() |
* Perform write(2); prints error message if fails. |
*/ |
|
int |
Write(int file, |
char *buffer, |
unsigned int count) |
{ |
int nbytes; |
|
if (Failed(nbytes = write(file, buffer, count))) |
error( |
ERR_ERRNO | ERR_FATAL, |
"write(%d, 0x%x, %d) failed", file, buffer, count |
); |
|
return nbytes; |
} |
/build/eolstrip.c
0,0 → 1,366
/* |
* eolstrip - strip white space from end of lines |
* |
* This program strips the white space from the end of every line in the |
* specified program. |
* |
* usage: eolstrip [ -v ] [ arg ... ] files... |
* -v -- verbose |
* |
* $Id: eolstrip.c,v 1.2 2001-09-27 12:02:53 chris Exp $ |
*/ |
|
#define GETOPTARGS "vt" |
|
char *USAGE = "\ |
usage: cklength [ -v ] [ arg ... ] files... \n\ |
-v -- verbose\n\ |
-t -- test only .. DO NOT OVERWRITE FILE!!!\n\ |
\n\ |
Strip the white space from the end of every line on the list of files.\n\ |
"; |
|
#include <stdio.h> |
#include <stdlib.h> |
#include <fcntl.h> |
#include <ctype.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <string.h> |
#include <memory.h> |
#include <stdarg.h> |
#include <errno.h> |
|
#include "config.h" |
|
#ifndef VMS |
#ifndef HAVE_STRERROR |
extern int sys_nerr; |
extern char *sys_errlist[]; |
|
#define strerror( _err ) \ |
((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error" |
|
#else /* HAVE_STRERROR */ |
char *strerror (); |
#endif |
#else /* VMS */ |
char *strerror (int,...); |
#endif |
|
|
#define BUFFER_SIZE 2048 |
#define MAX_PATH 2048 |
|
#define SUCCESS 0 |
#define FAILURE -1 |
#define Failed(x) (((int) (x)) == FAILURE) |
#define TRUE 1 |
#define FALSE 0 |
#define STREQ(a,b) (strcmp(a,b) == 0) |
#define NUMELEMS(arr) (sizeof(arr) / sizeof(arr[0])) |
|
/* |
* Definitions for unsigned "ints"; especially for use in data structures |
* that will be shared among (potentially) different cpu's (we punt on |
* byte ordering problems tho) |
*/ |
|
typedef unsigned char u8; |
typedef unsigned short u16; |
typedef unsigned long u32; |
|
/* |
* vars controlled by command line options |
*/ |
|
int verbose = FALSE; /* be verbose */ |
int test_only = FALSE; /* test only */ |
|
extern char *optarg; /* getopt(3) control vars */ |
extern int optind, opterr; |
|
char *progname; /* for error() */ |
|
int process(char *arg); |
void error(int errn, ...); |
long getparm(char *s, long min, long max, char *msg); |
|
#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */ |
#define ERR_FATAL (ERR_ERRNO / 2) /* fatal error ; no return */ |
#define ERR_ABORT (ERR_ERRNO / 4) /* fatal error ; abort */ |
#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */ |
|
#define stol(p) strtol(p, (char **) NULL, 0) |
int Open(), Read(), Write(); |
|
int main( |
int argc, |
char **argv |
) |
{ |
register int c; |
int showusage = FALSE; /* usage error? */ |
int rc = 0; |
|
/* |
* figure out invocation leaf-name |
*/ |
|
if ((progname = strrchr(argv[0], '/')) == (char *) NULL) |
progname = argv[0]; |
else |
progname++; |
|
argv[0] = progname; /* for getopt err reporting */ |
|
/* |
* Check options and arguments. |
*/ |
|
opterr = 0; /* we'll report all errors */ |
while ((c = getopt(argc, argv, GETOPTARGS)) != EOF) |
switch (c) |
{ |
case 't': /* toggle test only mode */ |
test_only = ! test_only; |
break; |
|
case 'v': /* toggle verbose */ |
verbose = ! verbose; |
break; |
|
case '?': |
showusage = TRUE; |
} |
|
if (showusage) |
{ |
(void) fprintf(stderr, "%s", USAGE); |
exit(1); |
} |
|
/* |
* traverse and process the arguments |
*/ |
|
for ( ; argv[optind]; optind++) |
if (Failed(process(argv[optind]))) |
rc = FAILURE; |
|
return rc; |
} |
|
|
/* |
* process(arg) |
*/ |
|
int |
process(char *arg) |
{ |
FILE *in; |
FILE *out = (FILE *) 0; |
char outname[ MAX_PATH ]; |
char *bptr; |
char buffer[ BUFFER_SIZE ]; |
int length; |
int line_number; |
int rc = SUCCESS; /* succeed by default */ |
|
in = fopen( arg, "r" ); |
if (!in) |
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg ); |
|
if ( !test_only ) { |
sprintf( outname, "%s.eoltmp", arg ); |
|
out = fopen( outname, "w" ); |
if (!out) |
error( ERR_ERRNO | ERR_FATAL, "Unable to open file (%s)\n", arg ); |
} |
|
if ( verbose ) |
fprintf( stderr, "Processing %s\n", arg ); |
|
for ( line_number=1 ; ; line_number++ ) { |
bptr = fgets( buffer, BUFFER_SIZE, in ); |
if (!bptr) |
break; |
|
/* |
* Don't count the carriage return. |
*/ |
|
length = strlen( buffer ) - 1; |
|
if ( buffer[ length ] != '\n' ) |
error(ERR_ERRNO|ERR_FATAL, "Line %d too long in %s\n", line_number, arg); |
|
while ( isspace( (int) buffer[ length ] ) ) |
buffer[ length-- ] = '\0'; |
|
if ( test_only ) { |
fprintf( stderr, "%s\n", arg ); |
break; |
} |
|
fprintf( out, "%s\n", buffer ); |
} |
|
fclose( in ); |
if ( !test_only ) { |
fclose( out ); |
rename( outname, arg ); |
} |
return rc; |
} |
|
/* |
* error(errn, arglist) |
* report an error to stderr using printf(3) conventions. |
* Any output is preceded by '<progname>: ' |
* |
* Uses ERR_FATAL bit to request exit(errn) |
* ERR_ABORT to request abort() |
* ERR_ERRNO to indicate use of errno instead of argument. |
* |
* If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its |
* associated error message is appended to the output. |
*/ |
|
/*VARARGS*/ |
|
void |
error(int error_flag, ...) |
{ |
va_list arglist; |
register char *format; |
int local_errno; |
|
extern int errno; |
|
(void) fflush(stdout); /* in case stdout/stderr same */ |
|
local_errno = error_flag & ~ERR_MASK; |
if (error_flag & ERR_ERRNO) /* use errno? */ |
local_errno = errno; |
|
va_start(arglist, error_flag); |
format = va_arg(arglist, char *); |
(void) fprintf(stderr, "%s: ", progname); |
(void) vfprintf(stderr, format, arglist); |
va_end(arglist); |
|
if (local_errno) |
(void) fprintf(stderr, " (%s)\n", strerror(local_errno)); |
else |
(void) fprintf(stderr, "\n"); |
|
(void) fflush(stderr); |
|
if (error_flag & (ERR_FATAL | ERR_ABORT)) |
{ |
if (error_flag & ERR_FATAL) |
{ |
error(0, "fatal error, exiting"); |
exit(local_errno ? local_errno : 1); |
} |
else |
{ |
error(0, "fatal error, aborting"); |
abort(); |
} |
} |
} |
|
long |
getparm(char *s, |
long min, |
long max, |
char *msg) |
{ |
long val; |
|
if ( ! strchr("0123456789-", *s)) |
{ |
error(ERR_FATAL, "'%s' is not a number", s); |
return min; |
} |
|
val = strtol(s, (char **) NULL, 0); |
if ((val < min) || (val > max)) |
{ |
if (min == max) |
error(ERR_FATAL, "%s can only be %ld", s, min); |
else |
error(ERR_FATAL, "%s must be between %ld and %ld", msg, min, max); |
} |
|
return val; |
} |
|
|
/* |
* Open() |
* Perform open(2), returning the file descriptor. Prints |
* error message if open fails. |
*/ |
|
int |
Open(char *file, |
int oflag, |
int mode) |
{ |
int O_fd; |
|
if (Failed(O_fd = open(file, oflag, mode))) |
error( |
ERR_ERRNO | ERR_FATAL, |
"open('%s', 0x%x, 0%o) failed", file, oflag, mode |
); |
|
return O_fd; |
} |
|
/* |
* Read() |
* Perform read(2); prints error message if fails. |
*/ |
|
int |
Read(int file, |
char *buffer, |
unsigned int count) |
{ |
int nbytes; |
|
if (Failed(nbytes = read(file, buffer, count))) |
error( |
ERR_ERRNO | ERR_FATAL, |
"read(%d, 0x%x, %d) failed", file, buffer, count |
); |
|
return nbytes; |
} |
|
/* |
* Write() |
* Perform write(2); prints error message if fails. |
*/ |
|
int |
Write(int file, |
char *buffer, |
unsigned int count) |
{ |
int nbytes; |
|
if (Failed(nbytes = write(file, buffer, count))) |
error( |
ERR_ERRNO | ERR_FATAL, |
"write(%d, 0x%x, %d) failed", file, buffer, count |
); |
|
return nbytes; |
} |
/build/unlock-directory.in
0,0 → 1,41
#!@KSH@ |
# |
# $Id: unlock-directory.in,v 1.2 2001-09-27 12:02:53 chris Exp $ |
# |
# Unlock a directory processed by lock_directory |
# |
|
# is a particular command available on this machine? |
# |
cmd_avail() |
{ |
set -- `type $1 2>&1` |
if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ] |
then |
return 1 |
else |
return 0 |
fi |
} |
|
unlock_directory() { |
ul_dir=$1/. # get any symlink out of the way using '.' |
if [ -d $ul_dir ] |
then |
find $ul_dir -type d ! -perm -0222 -print | $XARGS -t chmod +w |
fi |
} |
|
# Use gnu xargs if available; faster, more reliable in general |
XARGS=xargs |
cmd_avail gxargs && XARGS=gxargs |
|
for dir |
do |
unlock_directory $dir |
done |
|
# Local Variables: *** |
# mode:ksh *** |
# End: *** |
|
/build/packhex.c
0,0 → 1,565
|
/***** P A C K H E X . C ************************************************ |
* |
* Packhex is a hex-file compaction utility. It attempts to concatenate |
* hex records to produce more size-efficient packaging. |
* |
* Limitations: Input files must be correctly formatted. This utility |
* is not robust enough to detect hex-record formatting |
* errors. |
* |
* Published: May 1993 Embedded Systems Programming magazine |
* "Creating Faster Hex Files" |
* |
* URL: ESP magazine: http://www.embedded.com |
* Source Code: ftp://ftp.mfi.com/pub/espmag/1993/pakhex.zip |
* |
* Author: Mark Gringrich |
* |
* Compiler: Microsoft C 6.0 |
* cl /F 1000 packhex.c |
* |
* |
* $Id: packhex.c,v 1.2 2001-09-27 12:02:53 chris Exp $ |
* |
**************************************************************************/ |
|
|
/* #define SMALLER_RECORDS */ |
#ifdef SMALLER_RECORDS |
#define MAX_LEN_S1_RECS 128 |
#define MAX_LEN_S2_RECS 128 |
#define MAX_LEN_S3_RECS 128 |
#else |
#define MAX_LEN_S1_RECS 252 |
#define MAX_LEN_S2_RECS 251 |
#define MAX_LEN_S3_RECS 250 |
#endif |
|
|
/*--------------------------------- includes ---------------------------------*/ |
|
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
|
#include "config.h" |
|
#ifndef VMS |
#ifndef HAVE_STRERROR |
extern int sys_nerr; |
extern char *sys_errlist[]; |
|
#define strerror( _err ) \ |
((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error" |
|
#else /* HAVE_STRERROR */ |
char *strerror (); |
#endif |
#else /* VMS */ |
char *strerror (int,...); |
#endif |
|
#if defined(__unix__) && !defined(EXIT_FAILURE) |
#define EXIT_FAILURE -1 |
#define EXIT_SUCCESS 0 |
#endif |
|
/*--------------------------------- defines ----------------------------------*/ |
|
#define YES 1 |
#define MAX_LINE_SIZE 600 |
#define EOS '\0' |
|
|
/*---------------------------------- macros ----------------------------------*/ |
|
/* Convert ASCII hexadecimal digit to value. */ |
|
#define HEX_DIGIT( C ) ( ( ( ( C ) > '9' ) ? ( C ) + 25 : ( C ) ) & 0xF ) |
|
|
/*--------------------------------- typedefs ---------------------------------*/ |
|
typedef unsigned char Boolean; |
typedef unsigned char Uchar; |
typedef unsigned int Uint; |
typedef unsigned long Ulong; |
|
typedef struct /* Functions and constant returning Hex-record vital stats. */ |
{ |
Boolean ( *is_data_record )( char * ); |
Ulong ( *get_address )( char * ); |
Uint ( *get_data_count )( char * ); |
const Uint max_data_count; |
char *( *get_data_start )( char * ); |
void ( *put_data_record )( Uint, Ulong, char * ); |
} Rec_vitals; |
|
|
/*--------------------------- function prototypes ----------------------------*/ |
|
Rec_vitals * identify_first_data_record( char *, int ); |
Ulong get_ndigit_hex( char *, int ); |
|
|
/*----------------------------- Intel Hex format -----------------------------*/ |
|
/* |
* Intel Hex data-record layout |
* |
* :aabbbbccd...dee |
* |
* : - header character |
* aa - record data byte count, a 2-digit hex value |
* bbbb - record address, a 4-digit hex value |
* cc - record type, a 2-digit hex value: |
* "00" is a data record |
* "01" is an end-of-data record |
* "02" is an extended-address record |
* "03" is a start record |
* d...d - data (always an even number of chars) |
* ee - record checksum, a 2-digit hex value |
* checksum = 2's complement |
* [ (sum of bytes: aabbbbccd...d) modulo 256 ] |
*/ |
|
|
Boolean is_intel_data_rec( char * rec_str ) |
{ |
return( ( rec_str[ 0 ] == ':' ) && ( rec_str[ 8 ] == '0' ) ); |
} |
|
Uint get_intel_rec_data_count( char * rec_str ) |
{ |
return( ( Uint ) get_ndigit_hex( rec_str + 1, 2 ) ); |
} |
|
Ulong get_intel_rec_address( char * rec_str ) |
{ |
return( get_ndigit_hex( rec_str + 3, 4 ) ); |
} |
|
char * get_intel_rec_data_start( char * rec_str ) |
{ |
return( rec_str + 9 ); |
} |
|
void put_intel_data_rec( Uint count, Ulong address, char * data_str ) |
{ |
char *ptr; |
Uint sum = count + ( address >> 8 & 0xff ) + ( address & 0xff ); |
|
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 ) |
sum += ( Uint ) get_ndigit_hex( ptr, 2 ); |
|
printf( |
":%02X%04lX00%s%02X\n", count, address, data_str, (~sum + 1) & 0xff |
); |
} |
|
|
Rec_vitals intel_hex = |
{ |
is_intel_data_rec, |
get_intel_rec_address, |
get_intel_rec_data_count, |
255, /* Maximum data bytes in a record. */ |
get_intel_rec_data_start, |
put_intel_data_rec |
}; |
|
|
/*------------------------- Motorola S1-record format ------------------------*/ |
|
/* |
* Motorola S-record data-record layout |
* |
* Sabbc...cd...dee |
* |
* S - header character |
* a - record type, a 1-digit value: |
* "0" is a header record |
* "1" is a 2-byte-address data record |
* "2" is a 3-byte-address data record |
* "3" is a 4-byte-address data record |
* "7" is a 4-byte-address end-of-data record |
* "8" is a 3-byte-address end-of-data record |
* "9" is a 2-byte-address end-of-data record |
* bb - record length in bytes, a 2-digit hex value |
* (record length doesn't count the header/type |
* chars and checksum byte) |
* c...c - record address, a 4-, 6-, or 8-digit value, |
* depending on record type |
* d...d - data (always an even number of chars) |
* ee - record checksum, a 2-digit hex value |
* checksum = 1's complement |
* [ (sum of all bytes: bbc..cd...d) modulo 256 ] |
*/ |
|
#define S1_COUNT_OFFSET 3 |
|
|
Boolean is_moto_s1_data_rec( char * rec_str ) |
{ |
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '1' ) ); |
} |
|
Uint get_moto_s1_rec_data_count( char * rec_str ) |
{ |
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S1_COUNT_OFFSET ); |
} |
|
Ulong get_moto_s1_rec_address( char * rec_str ) |
{ |
return( get_ndigit_hex( rec_str + 4, 4 ) ); |
} |
|
char * get_moto_s1_rec_data_start( char * rec_str ) |
{ |
return( rec_str + 8 ); |
} |
|
void put_moto_s1_data_rec( Uint count, Ulong address, char * data_str ) |
{ |
char *ptr; |
Uint sum = S1_COUNT_OFFSET + count + |
( address >> 8 & 0xff ) + ( address & 0xff ); |
|
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 ) |
sum += ( Uint ) get_ndigit_hex( ptr, 2 ); |
|
printf( |
"S1%02X%04lX%s%02X\n", |
count + S1_COUNT_OFFSET, address, data_str, ~sum & 0xff |
); |
} |
|
|
Rec_vitals motorola_s1_rec = |
{ |
is_moto_s1_data_rec, |
get_moto_s1_rec_address, |
get_moto_s1_rec_data_count, |
MAX_LEN_S1_RECS, /* Maximum data bytes in a record. */ |
get_moto_s1_rec_data_start, |
put_moto_s1_data_rec |
}; |
|
|
/*------------------------- Motorola S2-record format ------------------------*/ |
|
#define S2_COUNT_OFFSET 4 |
|
Boolean is_moto_s2_data_rec( char * rec_str ) |
{ |
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '2' ) ); |
} |
|
Uint get_moto_s2_rec_data_count( char * rec_str ) |
{ |
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S2_COUNT_OFFSET ); |
} |
|
Ulong get_moto_s2_rec_address( char * rec_str ) |
{ |
return( get_ndigit_hex( rec_str + 4, 6 ) ); |
} |
|
char * get_moto_s2_rec_data_start( char * rec_str ) |
{ |
return( rec_str + 10 ); |
} |
|
void put_moto_s2_data_rec( Uint count, Ulong address, char * data_str ) |
{ |
char *ptr; |
Uint sum = S2_COUNT_OFFSET + count + ( address >> 16 & 0xff ) + |
( address >> 8 & 0xff ) + |
( address & 0xff ); |
|
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 ) |
sum += ( Uint ) get_ndigit_hex( ptr, 2 ); |
|
printf( |
"S2%02X%06lX%s%02X\n", |
count + S2_COUNT_OFFSET, address, data_str, ~sum & 0xff |
); |
} |
|
|
Rec_vitals motorola_s2_rec = |
{ |
is_moto_s2_data_rec, |
get_moto_s2_rec_address, |
get_moto_s2_rec_data_count, |
MAX_LEN_S2_RECS, /* Maximum data bytes in a record. */ |
get_moto_s2_rec_data_start, |
put_moto_s2_data_rec |
}; |
|
|
/*------------------------- Motorola S3-record format ------------------------*/ |
|
#define S3_COUNT_OFFSET 5 |
|
Boolean is_moto_s3_data_rec( char * rec_str ) |
{ |
return ( ( rec_str[ 0 ] == 'S' ) && ( rec_str[ 1 ] == '3' ) ); |
} |
|
Uint get_moto_s3_rec_data_count( char * rec_str ) |
{ |
return( ( Uint ) get_ndigit_hex( rec_str + 2, 2 ) - S3_COUNT_OFFSET ); |
} |
|
Ulong get_moto_s3_rec_address( char * rec_str ) |
{ |
return( get_ndigit_hex( rec_str + 4, 8 ) ); |
} |
|
char * get_moto_s3_rec_data_start( char * rec_str ) |
{ |
return( rec_str + 12 ); |
} |
|
void put_moto_s3_data_rec( Uint count, Ulong address, char * data_str ) |
{ |
char *ptr; |
Uint sum = S3_COUNT_OFFSET + count + ( address >> 24 & 0xff ) + |
( address >> 16 & 0xff ) + |
( address >> 8 & 0xff ) + |
( address & 0xff ); |
|
for ( ptr = data_str ; *ptr != EOS ; ptr += 2 ) |
sum += ( Uint ) get_ndigit_hex( ptr, 2 ); |
|
printf( |
"S3%02X%08lX%s%02X\n", |
count + S3_COUNT_OFFSET, address, data_str, ~sum & 0xff |
); |
} |
|
|
Rec_vitals motorola_s3_rec = |
{ |
is_moto_s3_data_rec, |
get_moto_s3_rec_address, |
get_moto_s3_rec_data_count, |
MAX_LEN_S3_RECS, /* Maximum data bytes in a record. */ |
get_moto_s3_rec_data_start, |
put_moto_s3_data_rec |
}; |
|
|
/*-------------------- Put your favorite hex format here ---------------------*/ |
|
/* |
* * * * The following is a template for an additional hex format: * * * |
* |
* |
* Boolean is_X_data_rec( char * rec_str ) {} |
* |
* Uint get_X_rec_data_count( char * rec_str ) {} |
* |
* Ulong get_X_rec_address( char * rec_str ) {} |
* |
* char * get_X_rec_data_start( char * rec_str ) {} |
* |
* void put_X_data_rec( Uint count, Ulong address, char * data_str ) {} |
* |
* Rec_vitals X_rec = |
* { |
* is_X_data_rec, |
* get_X_rec_address, |
* get_X_rec_data_count, |
* MAXIMUM DATA BYTES IN A RECORD, |
* get_X_rec_data_start, |
* put_X_data_rec |
* }; |
* |
*/ |
|
/*----------------------------------------------------------------------------*/ |
|
|
/* |
* Put address of additional Rec_vitals structures |
* in this array, before the NULL entry. |
*/ |
|
Rec_vitals *formats[] = |
{ |
&intel_hex, |
&motorola_s1_rec, |
&motorola_s2_rec, |
&motorola_s3_rec, |
( Rec_vitals * ) NULL |
}; |
|
|
/**** main ***************************************************************** |
* |
* |
* Expects: Nothing (no command-line parameters). |
* |
* Returns: Exit status (EXIT_SUCCESS or EXIT_FAILURE). |
* |
* Reads hex records on the standard input and attempts to |
* splice adjacent data fields together. Results appear on |
* the standard output. |
* |
*******************************************************************************/ |
|
int main( |
int argc, |
char **argv |
) |
{ |
|
char inbuff[ MAX_LINE_SIZE ], outbuff[ MAX_LINE_SIZE ]; |
char *in_dptr, *out_dptr; |
int d_total, d_count, d_excess, n; |
int length; |
Ulong in_rec_addr, out_rec_addr = 0; |
Rec_vitals *rptr; |
|
|
/* Sift through file until first hex record is identified. */ |
|
rptr = identify_first_data_record( inbuff, MAX_LINE_SIZE ); |
if ( rptr == NULL ) |
{ |
fputs( "No hex records found.\n", stderr ); |
exit( EXIT_FAILURE ); |
} |
|
|
/* Attempt data-record splicing until end-of-file is reached. */ |
d_total = 0; |
for (;;) { |
if ( rptr->is_data_record( inbuff ) == YES ) |
{ /* Input record is a data record. */ |
d_count = rptr->get_data_count( inbuff ); |
in_rec_addr = rptr->get_address( inbuff ); |
in_dptr = rptr->get_data_start( inbuff ); |
|
if ( d_total == 0 || in_rec_addr != out_rec_addr + d_total ) |
{ /* Begin a new output record. */ |
if ( d_total != 0 ) |
rptr->put_data_record( d_total, out_rec_addr, outbuff ); |
out_dptr = outbuff; |
n = d_total = d_count; |
out_rec_addr = in_rec_addr; |
} |
else if |
( ( d_excess = d_total + d_count - rptr->max_data_count ) > 0 ) |
{ /* Output a maximum-length record, then start a new record. */ |
strncat( outbuff, in_dptr, 2 * ( d_count - d_excess ) ); |
rptr->put_data_record( |
rptr->max_data_count, out_rec_addr, outbuff |
); |
in_dptr += 2 * ( d_count - d_excess ); |
out_dptr = outbuff; |
n = d_total = d_excess; |
out_rec_addr += rptr->max_data_count; |
} |
else |
{ /* Append input record's data field with accumulated data. */ |
out_dptr = outbuff + ( 2 * d_total ); |
d_total += n = d_count; |
} |
strncpy( out_dptr, in_dptr, 2 * n ); |
out_dptr[ 2 * n ] = EOS; |
} |
else |
{ /* Not a data record; |
* flush accumulated data then echo non-data record. |
*/ |
if ( d_total != 0 ) |
{ |
rptr->put_data_record( d_total, out_rec_addr, outbuff ); |
d_total = 0; |
} |
puts( inbuff ); |
} |
|
inbuff[ MAX_LINE_SIZE - 1 ] = '\0'; |
if ( !fgets( inbuff, MAX_LINE_SIZE, stdin ) ) |
break; |
if ( inbuff[ MAX_LINE_SIZE - 1 ] ) { |
fprintf( stderr, "Input line too long" ); |
exit( 1 ); |
} |
length = strlen(inbuff); |
inbuff[length - 1] = '\0'; |
|
} |
|
|
return ( EXIT_SUCCESS ); |
|
} |
|
|
/**** identify_first_data_record ******************************************* |
* |
* Expects: Pointer to hex-record line buffer. |
* |
* Returns: Pointer to hex-record structure (NULL if no match found). |
* |
* Reads the standard input, line by line, searching for a valid |
* record header character. If a valid header is found, a pointer |
* to the hex-record's type structure is returned, otherwise NULL. |
* |
* The input-stream pointer is left pointing to the first valid hex record. |
* |
*******************************************************************************/ |
|
Rec_vitals * identify_first_data_record( char * buff_ptr, int max_length ) |
{ |
Rec_vitals ** ptr; |
int length; |
|
|
|
for ( ;; ) { |
|
buff_ptr[ max_length - 1 ] = '\0'; |
if ( !fgets( buff_ptr, max_length, stdin ) ) |
break; |
if ( buff_ptr[ max_length - 1 ] ) { |
fprintf( stderr, "Input line too long" ); |
exit( 1 ); |
} |
length = strlen(buff_ptr); |
buff_ptr[length - 1] = '\0'; |
|
for ( ptr = formats ; *ptr != ( Rec_vitals * ) NULL ; ptr++ ) |
if ( ( *ptr )->is_data_record( buff_ptr ) == YES ) |
return( *ptr ); /* Successful return. */ |
|
puts( buff_ptr ); /* Echo non-hex-record line. */ |
} |
|
return( ( Rec_vitals * ) NULL ); /* Unsuccessful return. */ |
} |
|
|
/**** get_ndigit_hex ******************************************************* |
* |
* Expects: Pointer to first ASCII hexadecimal digit, number of digits. |
* |
* Returns: Value of hexadecimal string as an unsigned long. |
* |
*******************************************************************************/ |
|
Ulong get_ndigit_hex( char * cptr, int digits ) |
{ |
Ulong value; |
|
for ( value = 0 ; --digits >= 0 ; cptr++ ) |
value = ( value * 16L ) + HEX_DIGIT( *cptr ); |
|
return( value ); |
} |
/build/configure.in
0,0 → 1,29
# |
# $Id: configure.in,v 1.2 2001-09-27 12:02:53 chris Exp $ |
# |
|
AC_PREREQ(2.13) |
AC_INIT(install-if-change.in) |
RTEMS_TOP(../..) |
AC_CONFIG_AUX_DIR(../..) |
|
AC_CANONICAL_HOST |
|
AM_INIT_AUTOMAKE(rtems-tools-build,$RTEMS_VERSION,no) |
AM_MAINTAINER_MODE |
AC_EXEEXT |
|
AC_PROG_CC |
AC_CHECK_FUNCS(strerror strtol) |
|
RTEMS_PATH_KSH |
|
AM_CONFIG_HEADER(config.h) |
|
# Explicitly list all Makefiles here |
AC_OUTPUT( |
Makefile |
install-if-change |
lock-directory |
unlock-directory |
) |
/build/search-id.sh
0,0 → 1,15
#!/bin/sh |
# |
# $Id: search-id.sh,v 1.2 2001-09-27 12:02:53 chris Exp $ |
# |
|
find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \ |
-print > /tmp/$$.0 |
find $1 -type f -a ! -name "*.scn" -a ! -name "bsp_specs" -a \ |
-exec grep -l '$Id' {} \; > /tmp/$$.1 |
|
diff /tmp/$$.0 /tmp/$$.1 > /tmp/$$.2 |
|
grep "<" /tmp/$$.2 | sed 's/< //' >&1 |
|
rm -f /tmp/$$* |
build/search-id.sh
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: build/unhex.c
===================================================================
--- build/unhex.c (nonexistent)
+++ build/unhex.c (revision 1765)
@@ -0,0 +1,738 @@
+/*
+ * unhex
+ * convert a hex file to binary equivalent. If more than one file name
+ * is given, then the output will be logically concatenated together.
+ * stdin and stdout are defaults. Verbose will enable checksum output.
+ *
+ * Supported input formats are Intel hex, Motorola S records, and TI 'B'
+ * records.
+ *
+ * Intel hex input format is
+ * Byte
+ * 1 Colon :
+ * 2..3 Record length, eg: "20"
+ * 4..7 load address nibbles
+ * 8..9 record type: "00" (data) or "02" base addr
+ * 10..x data bytes in ascii-hex
+ * x+1..x+2 cksum (2's compl of (len+addr+data))
+ * x+3 \n -- newline
+ *
+ * $Id: unhex.c,v 1.2 2001-09-27 12:02:53 chris Exp $
+ */
+
+char *USAGE = "\
+usage: unhex [-va] [ -o file ] [ file [file ... ] ]\n\
+ -v -- verbose\n\
+ -a base -- 1st byte of output corresponds to this address\n\
+ -l -- linear, just writes data out\n\
+ -o file -- output file; must not be input file\n\
+ -F k_bits -- \"holes\" in input will be filled with 0xFF's\n\
+ up to \"k_bits\" * 1024 bits\n\
+";
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "config.h"
+
+#ifndef VMS
+#ifndef HAVE_STRERROR
+extern int sys_nerr;
+extern char *sys_errlist[];
+
+#define strerror( _err ) \
+ ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
+
+#else /* HAVE_STRERROR */
+char *strerror ();
+#endif
+#else /* VMS */
+char *strerror (int,...);
+#endif
+
+
+#define OK 0
+#define FAILURE (-1)
+#define Failed(x) ((x) == FAILURE)
+#define TRUE 1
+#define FALSE 0
+typedef char bool;
+#define STREQ(a,b) (strcmp(a,b) == 0)
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned long u32;
+
+/*
+ * Pick out designated bytes
+ */
+
+#define B0(x) ((x) & 0xff)
+#define B1(x) B0((x) >> 8)
+#define B2(x) B0((x) >> 16)
+#define B3(x) B0((x) >> 24)
+
+typedef struct buffer_rec {
+ u32 dl_destaddr;
+ u32 dl_jumpaddr;
+ int dl_count;
+ u8 dl_buf[512];
+} buffer_rec;
+
+/*
+ * vars controlled by command line options
+ */
+
+bool verbose = FALSE; /* be verbose */
+bool linear = FALSE; /* just write out linear data */
+char *outfilename = "-"; /* default output is stdout */
+u32 base = 0L; /* base address */
+u32 FFfill = 0L; /* how far to fill w 0xFF's */
+
+extern char *optarg; /* getopt(3) control vars */
+extern int optind;
+
+char *progname; /* for error() */
+
+void error(int errn, ...);
+#define ERR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */
+#define ERR_FATAL (ERR_ERRNO / 2) /* error is fatal; no return */
+#define ERR_ABORT (ERR_ERRNO / 4) /* error is fatal; abort */
+#define ERR_MASK (ERR_ERRNO | ERR_FATAL | ERR_ABORT) /* all */
+
+#ifdef HAVE_STRTOUL
+#define stol(p) strtoul(p, (char **) NULL, 0)
+#else
+#define stol(p) strtol(p, (char **) NULL, 0)
+#endif
+
+int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
+int convert_Intel_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
+int convert_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
+int convert_TI_records(FILE *ifp, char *inm, FILE *ofp, char *onm);
+void write_record(buffer_rec *tb, FILE *fp);
+int getnibble(char **p);
+int getbyte(char **p);
+long getNbytes(char **p, int n);
+void badformat(char *s, char *fname, char *msg);
+
+#define get1bytes(p) ((int) getbyte(p))
+#define get2bytes(p) ((int) getNbytes(p, 2))
+#define get3bytes(p) getNbytes(p, 3)
+#define get4bytes(p) getNbytes(p, 4)
+
+char *BADADDR = "Invalid record address";
+char *BADLEN = "Invalid record length";
+char *BADBASE = "Bad base or starting address";
+char *BADFMT = "Unrecognized record type";
+char *BADDATA = "Invalid data byte";
+char *BADCSUM = "Invalid checksum";
+char *MISCSUM = "Checksum mismatch";
+char *BADTYPE = "Unrecognized record type";
+char *MISTYPE = "Incompatible record types";
+
+int main(
+ int argc,
+ char **argv
+)
+{
+ register int c;
+ bool showusage = FALSE; /* usage error? */
+ int rc = 0;
+ FILE *outfp, *infp;
+
+ /*
+ * figure out invocation leaf-name
+ */
+
+ if ((progname = strrchr(argv[0], '/')) == (char *) NULL)
+ progname = argv[0];
+ else
+ progname++;
+
+ argv[0] = progname; /* for getopt err reporting */
+
+ /*
+ * Check options and arguments.
+ */
+
+ progname = argv[0];
+ while ((c = getopt(argc, argv, "F:a:o:vl")) != EOF)
+ switch (c)
+ {
+ case 'a': /* base address */
+ base = stol(optarg);
+ break;
+
+ case 'l': /* linear output */
+ linear = TRUE;
+ break;
+
+ case 'v': /* toggle verbose */
+ verbose = ! verbose;
+ break;
+
+ case 'o': /* output file */
+ outfilename = optarg;
+ break;
+
+ case 'F': /* 0xFF fill amount (bytes) */
+ FFfill = stol(optarg) * 1024L / 8L;
+ break;
+
+ case '?':
+ showusage = TRUE;
+ }
+
+ if (showusage)
+ {
+ (void) fprintf(stderr, "%s", USAGE);
+ exit(1);
+ }
+
+ if (linear && (base != 0))
+ {
+ error(0, "-l and -a may not be specified in combination");
+ exit(1);
+ }
+
+ if (STREQ(outfilename, "-"))
+ {
+ outfp = stdout;
+ outfilename = "stdout";
+ }
+ else
+ if ((outfp = fopen(outfilename, "w")) == (FILE *) NULL)
+ {
+ error(-1, "couldn't open '%s' for output", outfilename);
+ exit(1);
+ }
+
+ /*
+ * Now process the input files (or stdin, if none specified)
+ */
+
+ if (argv[optind] == (char *) NULL) /* just stdin */
+ exit(unhex(stdin, "stdin", outfp, outfilename));
+ else
+ for (; (optarg = argv[optind]); optind++)
+ {
+ if (STREQ(optarg, "-"))
+ rc += unhex(stdin, "stdin", outfp, outfilename);
+ else
+ {
+ if ((infp = fopen(optarg, "r")) == (FILE *) NULL)
+ {
+ error(-1, "couldn't open '%s' for input", optarg);
+ exit(1);
+ }
+ rc += unhex(infp, optarg, outfp, outfilename);
+ }
+ }
+
+ return(rc);
+}
+
+u16 filesum;
+
+int
+unhex(FILE *ifp,
+ char *inm,
+ FILE *ofp,
+ char *onm)
+{
+ int c;
+
+ filesum = 0;
+
+ /*
+ * Make sure holes will be filled with 0xFF's if requested. We
+ * do this the easy way by just filling the file with FF's before
+ * getting started. To do it more optimally would be quite a bit
+ * more difficult since the user can skip around as much as he/she
+ * likes in the input hex file addressing.
+ *
+ * We'll clean this up later (after this program has run) with
+ * 'stripffs'
+ */
+
+ if (FFfill)
+ {
+ (void) fseek(ofp, 0, 0);
+ for (c = FFfill; c > 0; c--)
+ (void) fputc(0xFF, ofp);
+ }
+
+ /*
+ * Read the first char from file and determine record types
+ */
+
+ if ((c = getc(ifp)) != EOF)
+ {
+ ungetc(c, ifp);
+ switch(c)
+ {
+ case 'S':
+ convert_S_records(ifp, inm, ofp, onm);
+ break;
+
+ case ':':
+ convert_Intel_records(ifp, inm, ofp, onm);
+ break;
+
+ case '9':
+ case 'B':
+ convert_TI_records(ifp, inm, ofp, onm);
+ break;
+
+ default:
+ {
+ char tmp[2];
+ tmp[0] = c; tmp[1] = 0;
+ badformat(tmp, inm, BADFMT);
+ }
+ }
+ }
+
+ if (verbose)
+ fprintf(stderr, "'%s' checksum is 0x%04x\n", inm, filesum);
+
+ return 0;
+}
+
+int
+convert_Intel_records(
+ FILE *ifp,
+ char *inm,
+ FILE *ofp,
+ char *onm)
+{
+ char buff[512];
+ char *p;
+ u8 cksum;
+ int incksum;
+ int c;
+ int rectype; /* record type */
+ int len; /* data length of current line */
+ u32 addr;
+ u32 base_address = 0;
+ bool endrecord = FALSE;
+ buffer_rec tb;
+
+ while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
+ {
+ p = &buff[0];
+
+ if (p[strlen(p)-1] == '\n') /* get rid of newline */
+ p[strlen(p)-1] = '\0';
+
+ if (p[strlen(p)-1] == '\r') /* get rid of any CR */
+ p[strlen(p)-1] = '\0';
+
+ tb.dl_count = 0;
+
+ if (*p != ':')
+ badformat(p, inm, BADFMT);
+ p++;
+
+ if ((len = getbyte(&p)) == -1) /* record len */
+ badformat(buff, inm, BADLEN);
+
+ if ((addr = get2bytes(&p)) == -1L) /* record addr */
+ badformat(buff, inm, BADADDR);
+
+ rectype = getbyte(&p);
+
+ cksum = len + B0(addr) + B1(addr) + rectype;
+
+ switch (rectype)
+ {
+ case 0x00: /* normal data record */
+ tb.dl_destaddr = base_address + addr;
+ while (len--)
+ {
+ if ((c = getbyte(&p)) == -1)
+ badformat(buff, inm, BADDATA);
+ cksum += c;
+ filesum += c;
+ tb.dl_buf[tb.dl_count++] = c;
+ }
+ break;
+
+ case 0x01: /* execution start address */
+ base_address = addr;
+ endrecord = TRUE;
+ break;
+
+ case 0x02: /* new base */
+ if ((base_address = get2bytes(&p)) == -1L)
+ badformat(buff, inm, BADBASE);
+ cksum += B0(base_address) + B1(base_address);
+ base_address <<= 4;
+ break;
+
+ case 0x03: /* seg/off execution start address */
+ {
+ u32 seg, off;
+
+ seg = get2bytes(&p);
+ off = get2bytes(&p);
+ if ((seg == -1L) || (off == -1L))
+ badformat(buff, inm, BADADDR);
+
+ cksum += B0(seg) + B1(seg) + B0(off) + B1(off);
+
+ tb.dl_jumpaddr = (seg << 4) + off;
+ break;
+ }
+
+ default:
+ error(0, "unknown Intel-hex record type: 0x%02x", rectype);
+ badformat(buff, inm, BADTYPE);
+ }
+
+ /*
+ * Verify checksums are correct in file.
+ */
+
+ cksum = (-cksum) & 0xff;
+ if ((incksum = getbyte(&p)) == -1)
+ badformat(buff, inm, BADCSUM);
+ if (((u8) incksum) != cksum)
+ badformat(buff, inm, MISCSUM);
+
+ if (tb.dl_count)
+ write_record(&tb, ofp);
+ }
+ return 0;
+}
+
+int
+convert_S_records(
+ FILE *ifp,
+ char *inm,
+ FILE *ofp,
+ char *onm)
+{
+ char buff[512];
+ char *p;
+ u8 cksum;
+ int incksum;
+ int c;
+ int len; /* data length of current line */
+ int rectype; /* record type */
+ u32 addr;
+ bool endrecord = FALSE;
+ buffer_rec tb;
+
+ while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
+ {
+ p = &buff[0];
+
+ if (p[strlen(p)-1] == '\n') /* get rid of newline */
+ p[strlen(p)-1] = '\0';
+
+ if (p[strlen(p)-1] == '\r') /* get rid of any CR */
+ p[strlen(p)-1] = '\0';
+
+ tb.dl_count = 0;
+
+ if (*p != 'S')
+ badformat(p, inm, BADFMT);
+ p++;
+
+ if ((rectype = getnibble(&p)) == -1) /* record type */
+ badformat(buff, inm, BADTYPE);
+
+ if ((len = getbyte(&p)) == -1) /* record len */
+ badformat(buff, inm, BADLEN);
+ cksum = len;
+
+ switch (rectype)
+ {
+ case 0x00: /* comment field, ignored */
+ goto write_it;
+
+ case 0x01: /* data record, 16 bit addr */
+ if ((addr = get2bytes(&p)) == -1L)
+ badformat(buff, inm, BADADDR);
+ len -= 3;
+ goto doit;
+
+ case 0x02: /* ... 24 bit addr */
+ if ((addr = get3bytes(&p)) == -1L)
+ badformat(buff, inm, BADADDR);
+ len -= 4;
+ goto doit;
+
+ case 0x03: /* ... 32 bit addr */
+ if ((addr = get4bytes(&p)) == -1L)
+ badformat(buff, inm, BADADDR);
+ len -= 5;
+ doit:
+ cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
+
+ tb.dl_destaddr = addr;
+ while (len--)
+ {
+ if ((c = getbyte(&p)) == -1)
+ badformat(buff, inm, BADDATA);
+ cksum += c;
+ filesum += c;
+ tb.dl_buf[tb.dl_count++] = c;
+ }
+ break;
+
+ case 0x07: /* 32 bit end record */
+ if ((addr = get4bytes(&p)) == -1L)
+ badformat(buff, inm, BADADDR);
+ goto end_rec;
+
+ case 0x08: /* 24 bit end record */
+ if ((addr = get3bytes(&p)) == -1L)
+ badformat(buff, inm, BADADDR);
+ goto end_rec;
+
+ case 0x09: /* 16 bit end record */
+ if ((addr = get2bytes(&p)) == -1L)
+ badformat(buff, inm, BADADDR);
+
+end_rec:
+ cksum += B0(addr) + B1(addr) + B2(addr) + B3(addr);
+ tb.dl_jumpaddr = addr;
+ break;
+
+ default:
+ error(0, "unknown Motorola-S record type: 0x%02x", rectype);
+ badformat(buff, inm, BADTYPE);
+ break;
+ }
+
+ /*
+ * Verify checksums are correct in file.
+ */
+
+ cksum = (~cksum) & 0xff;
+ if ((incksum = getbyte(&p)) == -1)
+ badformat(buff, inm, BADCSUM);
+ if (((u8) incksum) != cksum)
+ badformat(buff, inm, MISCSUM);
+
+write_it:
+ if (tb.dl_count)
+ write_record(&tb, ofp);
+ }
+ return 0;
+}
+
+int
+convert_TI_records(
+ FILE *ifp,
+ char *inm,
+ FILE *ofp,
+ char *onm)
+{
+ char buff[512];
+ char *p;
+ int c;
+ bool endrecord = FALSE;
+ bool eol;
+ buffer_rec tb;
+
+ while ( ! endrecord && (fgets(buff, sizeof(buff), ifp)))
+ {
+ if (p[strlen(p)-1] == '\n') /* get rid of newline */
+ p[strlen(p)-1] = '\0';
+
+ if (p[strlen(p)-1] == '\r') /* get rid of any CR */
+ p[strlen(p)-1] = '\0';
+
+ tb.dl_count = 0;
+
+ p = &buff[0];
+ eol = FALSE;
+ while ( ! eol && ! endrecord)
+ {
+ switch (*p++)
+ {
+ case '9':
+ if (tb.dl_count)
+ write_record(&tb, ofp);
+ tb.dl_destaddr = get2bytes(&p);
+ break;
+
+ case 'B':
+ c = getbyte(&p);
+ filesum += c;
+ tb.dl_buf[tb.dl_count++] = c;
+ c = getbyte(&p);
+ filesum += c;
+ tb.dl_buf[tb.dl_count++] = c;
+ break;
+
+ case 'F':
+ eol = TRUE;
+ break;
+
+ case ':':
+ endrecord = TRUE;
+ break;
+
+ default:
+ badformat(p, inm, BADFMT);
+ }
+ }
+ if (tb.dl_count)
+ write_record(&tb, ofp);
+ }
+ return 0;
+}
+
+void
+write_record(buffer_rec *tb,
+ FILE *fp)
+{
+ if ( ! linear)
+ {
+ if (tb->dl_destaddr < base)
+ error(ERR_FATAL, "record at address 0x%x precedes base of 0x%x",
+ tb->dl_destaddr, base);
+ (void) fseek(fp, tb->dl_destaddr - base, 0);
+ }
+
+ (void) fwrite(tb->dl_buf, tb->dl_count, 1, fp);
+ tb->dl_destaddr += tb->dl_count;
+ tb->dl_count = 0;
+}
+
+int
+getnibble(char **p)
+{
+ register int val;
+
+ **p = toupper(**p);
+ switch (**p)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ val = **p - '0';
+ break;
+
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ val = 10 + (**p - 'A');
+ break;
+
+ default:
+ return(-1);
+ }
+ *p += 1;
+
+ return(val & 0x0f);
+}
+
+int
+getbyte(char **p)
+{
+ int n0, n1;
+
+ if ((n0 = getnibble(p)) == -1)
+ return(-1);
+ if ((n1 = getnibble(p)) == -1)
+ return(-1);
+
+ return(((n0 << 4) + n1) & 0xff);
+}
+
+long
+getNbytes(char **p,
+ int n)
+{
+ int t;
+ u32 val = 0;
+
+ while (n--)
+ {
+ if ((t = getbyte(p)) == -1)
+ return(-1L);
+ val <<= 8;
+ val += t;
+ }
+
+ return(val);
+}
+
+void
+badformat(char *s,
+ char *fname,
+ char *msg)
+{
+ if (s[strlen(s)-1] == '\n') /* get rid of newline */
+ s[strlen(s)-1] = '\0';
+ error(0, "line '%s'::\n\tfrom file '%s'; %s", s, fname, msg);
+ exit(1);
+}
+
+/*
+ * error(errn, arglist)
+ * report an error to stderr using printf(3) conventions.
+ * Any output is preceded by ': '
+ *
+ * Uses ERR_EXIT bit to request exit(errn)
+ * ERR_ABORT to request abort()
+ * ERR_ERRNO to indicate use of errno instead of argument.
+ *
+ * If resulting 'errn' is non-zero, it is assumed to be an 'errno' and its
+ * associated error message is appended to the output.
+ */
+
+/*VARARGS*/
+
+void
+error(int error_flag, ...)
+{
+ va_list arglist;
+ register char *format;
+ int local_errno;
+
+ extern int errno;
+
+ (void) fflush(stdout); /* in case stdout/stderr same */
+
+ local_errno = error_flag & ~ERR_MASK;
+ if (error_flag & ERR_ERRNO) /* use errno? */
+ local_errno = errno;
+
+ va_start(arglist, error_flag);
+ format = va_arg(arglist, char *);
+ (void) fprintf(stderr, "%s: ", progname);
+ (void) vfprintf(stderr, format, arglist);
+ va_end(arglist);
+
+ if (local_errno)
+ (void) fprintf(stderr, " (%s)\n", strerror(local_errno));
+ else
+ (void) fprintf(stderr, "\n");
+
+ (void) fflush(stderr);
+
+ if (error_flag & (ERR_FATAL | ERR_ABORT))
+ {
+ if (error_flag & ERR_FATAL)
+ {
+ error(0, "fatal error, exiting");
+ exit(local_errno ? local_errno : 1);
+ }
+ else
+ {
+ error(0, "fatal error, aborting");
+ abort();
+ }
+ }
+}
+
Index: build/Makefile.am
===================================================================
--- build/Makefile.am (nonexistent)
+++ build/Makefile.am (revision 1765)
@@ -0,0 +1,22 @@
+##
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:53 chris Exp $
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+bin_PROGRAMS = cklength eolstrip packhex unhex
+
+noinst_PROGRAMS = binpatch
+
+cklength_SOURCES = cklength.c
+eolstrip_SOURCES = eolstrip.c
+packhex_SOURCES = packhex.c
+unhex_SOURCES = unhex.c
+binpatch_SOURCES = binpatch.c
+
+bin_SCRIPTS = install-if-change lock-directory unlock-directory
+
+noinst_SCRIPTS = search-id.sh
+
+include $(top_srcdir)/../../automake/host.am
Index: build/binpatch.c
===================================================================
--- build/binpatch.c (nonexistent)
+++ build/binpatch.c (revision 1765)
@@ -0,0 +1,156 @@
+/*
+ * $Id: binpatch.c,v 1.2 2001-09-27 12:02:53 chris Exp $
+ */
+
+
+#include
+#include
+
+/*
+ * This function will patch binary file
+ */
+
+
+static char buf[512];
+
+static void
+usage(void)
+{
+ printf("usage: binpatch [-h] "
+ "[ [ []]]\n");
+ printf("this function patches binary file at specified offset with\n");
+ printf("up to 4 bytes provided on command line \n");
+ printf("-h - prints this message\n\n");
+ printf(" - output file\n");
+ printf(" - input ifile\n");
+ printf(" - relocation address of image\n");
+ printf(" - offset of patch, offset in file is at off - reloc\n");
+ printf(" - byte 0 of patch\n");
+ printf(" - byte 1 of patch\n");
+ printf(" - byte 1 of patch\n");
+ printf(" - byte 1 of patch\n");
+
+ return;
+}
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ FILE *ofp, *ifp;
+ char patch[4], *end;
+ int patchLen, tmp, i, off, cnt, patched, len, reloc;
+
+
+ /* parse command line options */
+ while ((c = getopt(argc, argv, "h")) >= 0)
+ {
+ switch (c)
+ {
+ case 'h':
+ usage();
+ return 0;
+ default:
+ usage();
+ return 1;
+ }
+ }
+
+ if(argc < 6)
+ {
+ usage();
+ return 1;
+ }
+
+ /* Let us get offset in file */
+ reloc = strtol(argv[3], &end, 0);
+ if(end == argv[3] || off < 0)
+ {
+ fprintf(stderr, "bad reloc value %s\n", argv[3]);
+ return 1;
+ }
+
+ off = strtol(argv[4], &end, 0);
+ if(end == argv[4] || off < 0 || off < reloc)
+ {
+ fprintf(stderr, "bad offset value %s\n", argv[4]);
+ return 1;
+ }
+
+ off -= reloc;
+
+ /* Let us get patch */
+ patchLen = argc - 5;
+
+ for(i=0; i 0xff)
+ {
+ fprintf(stderr, "bad byte value %s\n", argv[5+i]);
+ return 1;
+ }
+ patch[i] = tmp;
+ }
+
+ ifp = fopen(argv[2], "r");
+ if(ifp == NULL)
+ {
+ fprintf(stderr, "unable to open file %s\n", argv[2]);
+ return 1;
+ }
+
+ ofp = fopen(argv[1], "w");
+ if(ofp == NULL)
+ {
+ fprintf(stderr, "unable to open file %s\n", argv[1]);
+ return 1;
+ }
+
+ cnt = 0;
+ patched = 0;
+ for(;;)
+ {
+ len = fread(buf, 1, sizeof(buf), ifp);
+
+ if(len == 0)
+ {
+ break;
+ }
+
+ if(cnt <= off && (cnt + len) > off)
+ {
+ /* Perform patch */
+ for(i=0; i off && cnt < (off + patchLen))
+ {
+ /* Perform patch */
+ for(i=cnt-off; i&2
+ fi
+ echo "$USAGE" 1>&2
+ exit 1
+}
+
+#
+# process the options
+#
+
+verbose=""
+suffix=""
+mode=""
+
+while getopts vm:V: OPT
+do
+ case "$OPT" in
+ v)
+ verbose="yes";;
+ V)
+ eval suffix=$OPTARG;;
+ m)
+ mode="$OPTARG";;
+ *)
+ fatal
+ esac
+done
+
+shiftcount=`expr $OPTIND - 1`
+shift $shiftcount
+
+args=$*
+
+#
+# Separate source file(s) from dest directory or file
+#
+
+files=""
+dest=""
+for d in $args
+do
+ files="$files $dest"
+ dest=$d
+done
+
+if [ ! "$files" ] || [ ! "$dest" ]
+then
+ fatal "missing files or invalid destination"
+fi
+
+#
+# Process the arguments
+#
+
+targets=""
+for f in $files
+do
+ # leaf=`basename $f`
+ leaf=${f##*/} # fast basename hack for ksh, bash
+
+ target=$dest
+ if [ -d $dest ]
+ then
+ # if we were given a suffix, then add it as appropriate
+ if [ "$suffix" ]
+ then
+ case $f in
+ *.*)
+ # leaf=`echo $leaf |
+ # /bin/sed "s/\([~\.]*\)\.\(.*\)$/\1$suffix.\2/"`
+ # ksh,bash hack for above sed script
+ leaf=${leaf%%.*}$suffix.${leaf#*.}
+
+ [ "$verbose" = "yes" ] &&
+ echo "$progname: $f will be installed as $leaf"
+ ;;
+ *)
+ leaf=$leaf$suffix;;
+ esac
+ fi
+ target=$target/$leaf
+ fi
+
+ [ ! -r $f ] && fatal "can not read $f"
+
+ if cmp -s $f $target
+ then
+ [ "$verbose" = "yes" ] && echo "'$f' not newer than '$target'"
+ else
+ [ "$verbose" = "yes" ] && echo "rm -f $target"
+ rm -f $target
+ echo "cp -p $f $target"
+ cp -p $f $target || exit 1
+ targets="$targets $target" # keep list for chmod below
+ fi
+done
+
+if [ "$mode" -a "$targets" ]
+then
+ [ "$verbose" = "yes" ] && echo "chmod $mode $targets"
+ chmod $mode $targets
+fi
+
+exit 0
+
+# Local Variables: ***
+# mode:ksh ***
+# End: ***
Index: build/README
===================================================================
--- build/README (nonexistent)
+++ build/README (revision 1765)
@@ -0,0 +1,24 @@
+#
+# $Id: README,v 1.2 2001-09-27 12:02:53 chris Exp $
+#
+
+Misc. support tools for RTEMS workspaces.
+More will be added later as they are converted from Teamware
+to CVS.
+
+install-if-change
+ Smart install script that also can append suffixes as it
+ installs (suffixes used for debug and profile variants).
+ Requires bash or ksh.
+
+rcs-clean
+ deletes all files from the current directory that can be
+ re-created from RCS. Careful to not delete locked files.
+ May be used by 'gmake clobber'
+
+lock-directory
+unlock-directory
+ traverse a directory structure making it unwritable.
+ Useful to keep people from accidentally overwriting
+ "released" trees if they get confused about which
+ module they have loaded.
Index: build
===================================================================
--- build (nonexistent)
+++ build (revision 1765)
build
Property changes :
Added: svn:ignore
## -0,0 +1,19 ##
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-if-change
+install-sh
+lock-directory
+missing
+mkinstalldirs
+stamp-h.in
+unlock-directory
Index: update/rtems-polish.sh
===================================================================
--- update/rtems-polish.sh (nonexistent)
+++ update/rtems-polish.sh (revision 1765)
@@ -0,0 +1,118 @@
+#!/bin/sh
+
+# $Id: rtems-polish.sh,v 1.2 2001-09-27 12:02:54 chris Exp $
+
+#
+# Search RTEMS source tree for autoconf Makefile.ins and automake
+# Makefile.ams and run c/update-tools/acpolish rsp. c/update-tool/ampolish
+# on them.
+#
+# To be run from the toplevel directory of the source-tree
+#
+
+progname=`basename $0`
+rootdir=`dirname $0`
+
+# Get the absolute path to the perltools
+pwd=`pwd`
+cd $rootdir
+perltools=`pwd`
+cd $pwd
+
+ac_do=""
+am_do=""
+ci_do=""
+
+usage()
+{
+ echo
+ echo "usage: ./${perltools}/${progname} [-h][-ac|-am|-ci]";
+ echo
+ echo "options:"
+ echo " -h .. display this message and exit";
+ echo " -ac .. run acpolish on all autoconf Makefile.ins"
+ echo " -am .. run ampolish on all automake Makefile.ams"
+ echo " -ci .. run cipolish on all configure.in scripts"
+ echo
+ exit 1;
+}
+
+# Check for auxiliary files
+aux_files="../../VERSION ampolish acpolish cipolish"
+for i in ${aux_files}; do
+ if test ! -f ${perltools}/$i; then
+ echo "${progname}:"
+ echo " Missing $perltools/$i"
+ exit 1;
+ fi
+done
+
+while test $# -gt 0; do
+case $1 in
+-h|--he|--hel|--help)
+ usage ;;
+-ac)
+ ac_do="yes";
+ shift ;;
+-am)
+ am_do="yes";
+ shift ;;
+-ci)
+ ci_do="yes";
+ shift ;;
+-*) echo "unknown option $1" ;
+ usage ;;
+*) echo "invalid parameter $1" ;
+ usage ;;
+esac
+done
+
+if test -z "$ac_do" && test -z "$am_do" && test -z "$ci_do"; then
+ usage
+fi
+
+pwd=`pwd`;
+
+if test -n "$ac_do"; then
+ac_files=`find . -name 'Makefile.in' -print`;
+for f in $ac_files; do
+ i=`dirname $f`
+ dest="$i"
+ if test ! -f $dest/Makefile.am; then
+ echo "polishing : $dest/Makefile.in"
+ ( cd $dest;
+ mv Makefile.in Makefile.in~;
+ ${perltools}/acpolish Makefile.in
+ rm Makefile.in~
+ )
+ fi
+done
+fi
+
+if test -n "$am_do"; then
+am_files=`find . -name 'Makefile.am' -print`;
+for f in $am_files; do
+ i=`dirname $f`
+ dest="$i"
+ echo "polishing : $dest/Makefile.am"
+ ( cd $dest;
+ mv Makefile.am Makefile.am~;
+ ${perltools}/ampolish Makefile.am
+ rm Makefile.am~
+ )
+done
+fi
+
+if test -n "$ci_do"; then
+ci_files=`find . -name 'configure.in' -print`;
+for f in $ci_files; do
+ i=`dirname $f`
+ dest="$i"
+ echo "polishing : $dest/configure.in"
+ ( cd $dest;
+ mv configure.in configure.in~;
+ ${perltools}/cipolish configure.in
+ rm configure.in~
+ )
+done
+fi
update/rtems-polish.sh
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: update/310_to_320_list
===================================================================
--- update/310_to_320_list (nonexistent)
+++ update/310_to_320_list (revision 1765)
@@ -0,0 +1,545 @@
+#
+# External API name
+#
+# $Id: 310_to_320_list,v 1.2 2001-09-27 12:02:54 chris Exp $
+#
+initialize_executive rtems_initialize_executive
+initialize_executive_early rtems_initialize_executive_early
+initialize_executive_late rtems_initialize_executive_late
+shutdown_executive rtems_shutdown_executive
+task_create rtems_task_create
+task_ident rtems_task_ident
+task_start rtems_task_start
+task_restart rtems_task_restart
+task_delete rtems_task_delete
+task_suspend rtems_task_suspend
+task_resume rtems_task_resume
+task_set_priority rtems_task_set_priority
+task_mode rtems_task_mode
+task_get_note rtems_task_get_note
+task_set_note rtems_task_set_note
+task_wake_after rtems_task_wake_after
+task_wake_when rtems_task_wake_when
+interrupt_catch rtems_interrupt_catch
+clock_set rtems_clock_set
+clock_get rtems_clock_get
+clock_tick rtems_clock_tick
+extension_create rtems_extension_create
+extension_ident rtems_extension_ident
+extension_delete rtems_extension_delete
+timer_create rtems_timer_create
+timer_ident rtems_timer_ident
+timer_cancel rtems_timer_cancel
+timer_delete rtems_timer_delete
+timer_fire_after rtems_timer_fire_after
+timer_fire_when rtems_timer_fire_when
+timer_reset rtems_timer_reset
+semaphore_create rtems_semaphore_create
+semaphore_ident rtems_semaphore_ident
+semaphore_delete rtems_semaphore_delete
+semaphore_obtain rtems_semaphore_obtain
+semaphore_release rtems_semaphore_release
+message_queue_create rtems_message_queue_create
+message_queue_ident rtems_message_queue_ident
+message_queue_delete rtems_message_queue_delete
+message_queue_send rtems_message_queue_send
+message_queue_urgent rtems_message_queue_urgent
+message_queue_broadcast rtems_message_queue_broadcast
+message_queue_receive rtems_message_queue_receive
+message_queue_flush rtems_message_queue_flush
+event_send rtems_event_send
+event_receive rtems_event_receive
+signal_catch rtems_signal_catch
+signal_send rtems_signal_send
+partition_create rtems_partition_create
+partition_ident rtems_partition_ident
+partition_delete rtems_partition_delete
+partition_get_buffer rtems_partition_get_buffer
+partition_return_buffer rtems_partition_return_buffer
+region_create rtems_region_create
+region_extend rtems_region_extend
+region_ident rtems_region_ident
+region_delete rtems_region_delete
+region_get_segment rtems_region_get_segment
+region_get_segment_size rtems_region_get_segment_size
+region_return_segment rtems_region_return_segment
+port_create rtems_port_create
+port_ident rtems_port_ident
+port_delete rtems_port_delete
+port_external_to_internal rtems_port_external_to_internal
+port_internal_to_external rtems_port_internal_to_external
+io_initialize rtems_io_initialize
+io_open rtems_io_open
+io_close rtems_io_close
+io_read rtems_io_read
+io_write rtems_io_write
+io_control rtems_io_control
+fatal_error_occurred rtems_fatal_error_occurred
+rate_monotonic_create rtems_rate_monotonic_create
+rate_monotonic_ident rtems_rate_monotonic_ident
+rate_monotonic_delete rtems_rate_monotonic_delete
+rate_monotonic_cancel rtems_rate_monotonic_cancel
+rate_monotonic_period rtems_rate_monotonic_period
+multiprocessing_announce rtems_multiprocessing_announce
+#
+# Internal Names for API
+#
+_Initialize_Executive rtems_initialize_executive
+_Initialize_Executive_early rtems_initialize_executive_early
+_Initialize_Executive_late rtems_initialize_executive_late
+_Shutdown_Executive rtems_shutdown_executive
+_RTEMS_tasks_Create rtems_task_create
+_RTEMS_tasks_Name_to_id rtems_task_ident
+_RTEMS_tasks_Start rtems_task_start
+_RTEMS_tasks_Restart rtems_task_restart
+_RTEMS_tasks_Delete rtems_task_delete
+_RTEMS_tasks_Suspend rtems_task_suspend
+_RTEMS_tasks_Resume rtems_task_resume
+_RTEMS_tasks_Set_priority rtems_task_set_priority
+_RTEMS_tasks_Mode rtems_task_mode
+_RTEMS_tasks_Get_note rtems_task_get_note
+_RTEMS_tasks_Set_note rtems_task_set_note
+_RTEMS_tasks_Wake_after rtems_task_wake_after
+_RTEMS_tasks_Wake_when rtems_task_wake_when
+_Interrupt_Catch rtems_interrupt_catch
+_Clock_Set rtems_clock_set
+_Clock_Get rtems_clock_get
+_Clock_Tick rtems_clock_tick
+_Extension_Create rtems_extension_create
+_Extension_Name_to_id rtems_extension_ident
+_Extension_Delete rtems_extension_delete
+_Timer_Create rtems_timer_create
+_Timer_Name_to_id rtems_timer_ident
+_Timer_Cancel rtems_timer_cancel
+_Timer_Delete rtems_timer_delete
+_Timer_Fire_after rtems_timer_fire_after
+_Timer_Fire_when rtems_timer_fire_when
+_Timer_Reset rtems_timer_reset
+_Semaphore_Create rtems_semaphore_create
+_Semaphore_Name_to_id rtems_semaphore_ident
+_Semaphore_Delete rtems_semaphore_delete
+_Semaphore_Obtain rtems_semaphore_obtain
+_Semaphore_Release rtems_semaphore_release
+_Message_queue_Create rtems_message_queue_create
+_Message_queue_Name_to_id rtems_message_queue_ident
+_Message_queue_Delete rtems_message_queue_delete
+_Message_queue_Send rtems_message_queue_send
+_Message_queue_Urgent rtems_message_queue_urgent
+_Message_queue_Broadcast rtems_message_queue_broadcast
+_Message_queue_Receive rtems_message_queue_receive
+_Message_queue_Flush rtems_message_queue_flush
+_Event_Send rtems_event_send
+_Event_Receive rtems_event_receive
+_Signal_Catch rtems_signal_catch
+_Signal_Send rtems_signal_send
+_Partition_Create rtems_partition_create
+_Partition_Name_to_id rtems_partition_ident
+_Partition_Delete rtems_partition_delete
+_Partition_Get_buffer rtems_partition_get_buffer
+_Partition_Return_buffer rtems_partition_return_buffer
+_Region_Create rtems_region_create
+_Region_Extend rtems_region_extend
+_Region_Name_to_id rtems_region_ident
+_Region_Delete rtems_region_delete
+_Region_Get_segment rtems_region_get_segment
+_Region_Get_segment_size rtems_region_get_segment_size
+_Region_Return_segment rtems_region_return_segment
+_Dual_ported_memory_Create rtems_port_create
+_Dual_ported_memory_Name_to_id rtems_port_ident
+_Dual_ported_memory_Delete rtems_port_delete
+_Dual_ported_memory_External_to_internal rtems_port_external_to_internal
+_Dual_ported_memory_Internal_to_external rtems_port_internal_to_external
+_IO_Initialize rtems_io_initialize
+_IO_Open rtems_io_open
+_IO_Close rtems_io_close
+_IO_Read rtems_io_read
+_IO_Write rtems_io_write
+_IO_Control rtems_io_control
+_Fatal_Error_occurred rtems_fatal_error_occurred
+_Rate_monotonic_Create rtems_rate_monotonic_create
+_Rate_monotonic_Name_to_id rtems_rate_monotonic_ident
+_Rate_monotonic_Delete rtems_rate_monotonic_delete
+_Rate_monotonic_Cancel rtems_rate_monotonic_cancel
+_Rate_monotonic_Period rtems_rate_monotonic_period
+_Multiprocessing_Announce rtems_multiprocessing_announce
+#
+# Status (API names)
+#
+SUCCESSFUL RTEMS_SUCCESSFUL
+TASK_EXITTED RTEMS_TASK_EXITTED
+MP_NOT_CONFIGURED RTEMS_MP_NOT_CONFIGURED
+INVALID_NAME RTEMS_INVALID_NAME
+INVALID_ID RTEMS_INVALID_ID
+TOO_MANY RTEMS_TOO_MANY
+TIMEOUT RTEMS_TIMEOUT
+OBJECT_WAS_DELETED RTEMS_OBJECT_WAS_DELETED
+INVALID_SIZE RTEMS_INVALID_SIZE
+INVALID_ADDRESS RTEMS_INVALID_ADDRESS
+INVALID_NUMBER RTEMS_INVALID_NUMBER
+NOT_DEFINED RTEMS_NOT_DEFINED
+RESOURCE_IN_USE RTEMS_RESOURCE_IN_USE
+UNSATISFIED RTEMS_UNSATISFIED
+INCORRECT_STATE RTEMS_INCORRECT_STATE
+ALREADY_SUSPENDED RTEMS_ALREADY_SUSPENDED
+ILLEGAL_ON_SELF RTEMS_ILLEGAL_ON_SELF
+ILLEGAL_ON_REMOTE_OBJECT RTEMS_ILLEGAL_ON_REMOTE_OBJECT
+CALLED_FROM_ISR RTEMS_CALLED_FROM_ISR
+INVALID_PRIORITY RTEMS_INVALID_PRIORITY
+INVALID_CLOCK RTEMS_INVALID_CLOCK
+INVALID_NODE RTEMS_INVALID_NODE
+NOT_CONFIGURED RTEMS_NOT_CONFIGURED
+NOT_OWNER_OF_RESOURCE RTEMS_NOT_OWNER_OF_RESOURCE
+NOT_IMPLEMENTED RTEMS_NOT_IMPLEMENTED
+INTERNAL_ERROR RTEMS_INTERNAL_ERROR
+PROXY_BLOCKING RTEMS_PROXY_BLOCKING
+NO_MEMORY RTEMS_NO_MEMORY
+STATUS_CODES_FIRST RTEMS_STATUS_CODES_FIRST
+STATUS_CODES_LAST RTEMS_STATUS_CODES_LAST
+#
+# Status (Internal names)
+#
+STATUS_SUCCESSFUL RTEMS_SUCCESSFUL
+STATUS_TASK_EXITTED RTEMS_TASK_EXITTED
+STATUS_MP_NOT_CONFIGURED RTEMS_MP_NOT_CONFIGURED
+STATUS_INVALID_NAME RTEMS_INVALID_NAME
+STATUS_INVALID_ID RTEMS_INVALID_ID
+STATUS_TOO_MANY RTEMS_TOO_MANY
+STATUS_TIMEOUT RTEMS_TIMEOUT
+STATUS_OBJECT_WAS_DELETED RTEMS_OBJECT_WAS_DELETED
+STATUS_INVALID_SIZE RTEMS_INVALID_SIZE
+STATUS_INVALID_ADDRESS RTEMS_INVALID_ADDRESS
+STATUS_INVALID_NUMBER RTEMS_INVALID_NUMBER
+STATUS_NOT_DEFINED RTEMS_NOT_DEFINED
+STATUS_RESOURCE_IN_USE RTEMS_RESOURCE_IN_USE
+STATUS_UNSATISFIED RTEMS_UNSATISFIED
+STATUS_INCORRECT_STATE RTEMS_INCORRECT_STATE
+STATUS_ALREADY_SUSPENDED RTEMS_ALREADY_SUSPENDED
+STATUS_ILLEGAL_ON_SELF RTEMS_ILLEGAL_ON_SELF
+STATUS_ILLEGAL_ON_REMOTE_OBJECT RTEMS_ILLEGAL_ON_REMOTE_OBJECT
+STATUS_CALLED_FROM_ISR RTEMS_CALLED_FROM_ISR
+STATUS_INVALID_PRIORITY RTEMS_INVALID_PRIORITY
+STATUS_INVALID_CLOCK RTEMS_INVALID_CLOCK
+STATUS_INVALID_NODE RTEMS_INVALID_NODE
+STATUS_NOT_CONFIGURED RTEMS_NOT_CONFIGURED
+STATUS_NOT_OWNER_OF_RESOURCE RTEMS_NOT_OWNER_OF_RESOURCE
+STATUS_NOT_IMPLEMENTED RTEMS_NOT_IMPLEMENTED
+STATUS_INTERNAL_ERROR RTEMS_INTERNAL_ERROR
+STATUS_PROXY_BLOCKING RTEMS_PROXY_BLOCKING
+STATUS_NO_MEMORY RTEMS_NO_MEMORY
+#
+# Attributes (External)
+#
+DEFAULT_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
+NO_FLOATING_POINT RTEMS_NO_FLOATING_POINT
+FLOATING_POINT RTEMS_FLOATING_POINT
+LOCAL RTEMS_LOCAL
+GLOBAL RTEMS_GLOBAL
+FIFO RTEMS_FIFO
+PRIORITY RTEMS_PRIORITY
+NO_LIMIT RTEMS_NO_LIMIT
+LIMIT RTEMS_LIMIT
+COUNTING_SEMAPHORE RTEMS_COUNTING_SEMAPHORE
+BINARY_SEMAPHORE RTEMS_BINARY_SEMAPHORE
+NO_INHERIT_PRIORITY RTEMS_NO_INHERIT_PRIORITY
+INHERIT_PRIORITY RTEMS_INHERIT_PRIORITY
+#
+# Attributes (Internal)
+#
+ATTRIBUTES_DEFAULTS RTEMS_DEFAULT_ATTRIBUTES
+ATTRIBUTES_NO_FLOATING_POINT RTEMS_NO_FLOATING_POINT
+ATTRIBUTES_FLOATING_POINT RTEMS_FLOATING_POINT
+ATTRIBUTES_LOCAL RTEMS_LOCAL
+ATTRIBUTES_GLOBAL RTEMS_GLOBAL
+ATTRIBUTES_FIFO RTEMS_FIFO
+ATTRIBUTES_PRIORITY RTEMS_PRIORITY
+ATTRIBUTES_NO_LIMIT RTEMS_NO_LIMIT
+ATTRIBUTES_LIMIT RTEMS_LIMIT
+ATTRIBUTES_COUNTING_SEMAPHORE RTEMS_COUNTING_SEMAPHORE
+ATTRIBUTES_BINARY_SEMAPHORE RTEMS_BINARY_SEMAPHORE
+ATTRIBUTES_NO_INHERIT_PRIORITY RTEMS_NO_INHERIT_PRIORITY
+ATTRIBUTES_INHERIT_PRIORITY RTEMS_INHERIT_PRIORITY
+#
+# Options (External)
+#
+DEFAULT_OPTIONS RTEMS_DEFAULT_OPTIONS
+WAIT RTEMS_WAIT
+NO_WAIT RTEMS_NO_WAIT
+EVENT_ALL RTEMS_EVENT_ALL
+EVENT_ANY RTEMS_EVENT_ANY
+#
+# Options (Internal)
+#
+OPTIONS_DEFAULT RTEMS_DEFAULT_OPTIONS
+OPTIONS_WAIT RTEMS_WAIT
+OPTIONS_NO_WAIT RTEMS_NO_WAIT
+OPTIONS_EVENT_ALL RTEMS_EVENT_ALL
+OPTIONS_EVENT_ANY RTEMS_EVENT_ANY
+#
+# Masks (External)
+#
+ALL_MODE_MASKS RTEMS_ALL_MODE_MASKS
+PREEMPT_MASK RTEMS_PREEMPT_MASK
+TIMESLICE_MASK RTEMS_TIMESLICE_MASK
+ASR_MASK RTEMS_ASR_MASK
+INTERRUPT_MASK RTEMS_INTERRUPT_MASK
+#
+# Masks (Internal)
+#
+MODES_ALL_MASK RTEMS_ALL_MODE_MASKS
+MODES_PREEMPT_MASK RTEMS_PREEMPT_MASK
+MODES_TIMESLICE_MASK RTEMS_TIMESLICE_MASK
+MODES_ASR_MASK RTEMS_ASR_MASK
+MODES_INTERRUPT_MASK RTEMS_INTERRUPT_MASK
+#
+# Modes (Internal)
+#
+MODES_DEFAULTS RTEMS_DEFAULT_MODES
+MODES_PREEMPT RTEMS_PREEMPT
+MODES_NO_PREEMPT RTEMS_NO_PREEMPT
+MODES_NO_TIMESLICE RTEMS_NO_TIMESLICE
+MODES_TIMESLICE RTEMS_TIMESLICE
+MODES_ASR RTEMS_ASR
+MODES_NO_ASR RTEMS_NO_ASR
+_Modes_Interrupt_level RTEMS_INTERRUPT_LEVEL
+#
+# Modes (External)
+#
+DEFAULT_MODES RTEMS_DEFAULT_MODES
+PREEMPT RTEMS_PREEMPT
+NO_PREEMPT RTEMS_NO_PREEMPT
+NO_TIMESLICE RTEMS_NO_TIMESLICE
+TIMESLICE RTEMS_TIMESLICE
+ASR RTEMS_ASR
+NO_ASR RTEMS_NO_ASR
+INTERRUPT_LEVEL RTEMS_INTERRUPT_LEVEL
+#
+# Identification (External)
+#
+SEARCH_ALL_NODES RTEMS_SEARCH_ALL_NODES
+SEARCH_OTHER_NODES RTEMS_SEARCH_OTHER_NODES
+SEARCH_LOCAL_NODE RTEMS_SEARCH_LOCAL_NODE
+WHO_AM_I RTEMS_WHO_AM_I
+#
+# Identification (Internal)
+#
+OBJECTS_SEARCH_ALL_NODES RTEMS_SEARCH_ALL_NODES
+OBJECTS_SEARCH_OTHER_NODES RTEMS_SEARCH_OTHER_NODES
+OBJECTS_SEARCH_LOCAL_NODE RTEMS_SEARCH_LOCAL_NODE
+OBJECTS_WHO_AM_I RTEMS_WHO_AM_I
+#
+# Miscellaneous (External API)
+#
+CURRENT_MODE RTEMS_CURRENT_MODE
+CURRENT_PRIORITY RTEMS_CURRENT_PRIORITY
+PENDING_EVENTS RTEMS_PENDING_EVENTS
+NO_TIMEOUT RTEMS_NO_TIMEOUT
+SELF RTEMS_SELF
+PERIOD_STATUS RTEMS_PERIOD_STATUS
+YIELD_PROCESSOR RTEMS_YIELD_PROCESSOR
+MINIMUM_PRIORITY RTEMS_MINIMUM_PRIORITY
+MAXIMUM_PRIORITY RTEMS_MAXIMUM_PRIORITY
+MINIMUM_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE
+#
+# Miscellaneous (External API)
+#
+MODES_CURRENT RTEMS_CURRENT_MODE
+PRIORITY_CURRENT RTEMS_CURRENT_PRIORITY
+#
+# Events
+#
+ALL_EVENTS RTEMS_ALL_EVENTS
+EVENT_0 RTEMS_EVENT_0
+EVENT_1 RTEMS_EVENT_1
+EVENT_2 RTEMS_EVENT_2
+EVENT_3 RTEMS_EVENT_3
+EVENT_4 RTEMS_EVENT_4
+EVENT_5 RTEMS_EVENT_5
+EVENT_6 RTEMS_EVENT_6
+EVENT_7 RTEMS_EVENT_7
+EVENT_8 RTEMS_EVENT_8
+EVENT_9 RTEMS_EVENT_9
+EVENT_10 RTEMS_EVENT_10
+EVENT_11 RTEMS_EVENT_11
+EVENT_12 RTEMS_EVENT_12
+EVENT_13 RTEMS_EVENT_13
+EVENT_14 RTEMS_EVENT_14
+EVENT_15 RTEMS_EVENT_15
+EVENT_16 RTEMS_EVENT_16
+EVENT_17 RTEMS_EVENT_17
+EVENT_18 RTEMS_EVENT_18
+EVENT_19 RTEMS_EVENT_19
+EVENT_20 RTEMS_EVENT_20
+EVENT_21 RTEMS_EVENT_21
+EVENT_22 RTEMS_EVENT_22
+EVENT_23 RTEMS_EVENT_23
+EVENT_24 RTEMS_EVENT_24
+EVENT_25 RTEMS_EVENT_25
+EVENT_26 RTEMS_EVENT_26
+EVENT_27 RTEMS_EVENT_27
+EVENT_28 RTEMS_EVENT_28
+EVENT_29 RTEMS_EVENT_29
+EVENT_30 RTEMS_EVENT_30
+EVENT_31 RTEMS_EVENT_31
+#
+# Signals
+#
+SIGNAL_0 RTEMS_SIGNAL_0
+SIGNAL_1 RTEMS_SIGNAL_1
+SIGNAL_2 RTEMS_SIGNAL_2
+SIGNAL_3 RTEMS_SIGNAL_3
+SIGNAL_4 RTEMS_SIGNAL_4
+SIGNAL_5 RTEMS_SIGNAL_5
+SIGNAL_6 RTEMS_SIGNAL_6
+SIGNAL_7 RTEMS_SIGNAL_7
+SIGNAL_8 RTEMS_SIGNAL_8
+SIGNAL_9 RTEMS_SIGNAL_9
+SIGNAL_10 RTEMS_SIGNAL_10
+SIGNAL_11 RTEMS_SIGNAL_11
+SIGNAL_12 RTEMS_SIGNAL_12
+SIGNAL_13 RTEMS_SIGNAL_13
+SIGNAL_14 RTEMS_SIGNAL_14
+SIGNAL_15 RTEMS_SIGNAL_15
+SIGNAL_16 RTEMS_SIGNAL_16
+SIGNAL_17 RTEMS_SIGNAL_17
+SIGNAL_18 RTEMS_SIGNAL_18
+SIGNAL_19 RTEMS_SIGNAL_19
+SIGNAL_20 RTEMS_SIGNAL_20
+SIGNAL_21 RTEMS_SIGNAL_21
+SIGNAL_22 RTEMS_SIGNAL_22
+SIGNAL_23 RTEMS_SIGNAL_23
+SIGNAL_24 RTEMS_SIGNAL_24
+SIGNAL_25 RTEMS_SIGNAL_25
+SIGNAL_26 RTEMS_SIGNAL_26
+SIGNAL_27 RTEMS_SIGNAL_27
+SIGNAL_28 RTEMS_SIGNAL_28
+SIGNAL_29 RTEMS_SIGNAL_29
+SIGNAL_30 RTEMS_SIGNAL_30
+SIGNAL_31 RTEMS_SIGNAL_31
+#
+# Notepads
+#
+NOTEPAD_FIRST RTEMS_NOTEPAD_FIRST
+NOTEPAD_0 RTEMS_NOTEPAD_0
+NOTEPAD_1 RTEMS_NOTEPAD_1
+NOTEPAD_2 RTEMS_NOTEPAD_2
+NOTEPAD_3 RTEMS_NOTEPAD_3
+NOTEPAD_4 RTEMS_NOTEPAD_4
+NOTEPAD_5 RTEMS_NOTEPAD_5
+NOTEPAD_6 RTEMS_NOTEPAD_6
+NOTEPAD_7 RTEMS_NOTEPAD_7
+NOTEPAD_8 RTEMS_NOTEPAD_8
+NOTEPAD_9 RTEMS_NOTEPAD_9
+NOTEPAD_10 RTEMS_NOTEPAD_10
+NOTEPAD_11 RTEMS_NOTEPAD_11
+NOTEPAD_12 RTEMS_NOTEPAD_12
+NOTEPAD_13 RTEMS_NOTEPAD_13
+NOTEPAD_14 RTEMS_NOTEPAD_14
+NOTEPAD_15 RTEMS_NOTEPAD_15
+NOTEPAD_LAST RTEMS_NOTEPAD_LAST
+#
+# Multiprocessing
+#
+MIN_PKTSIZE RTEMS_MINIMUM_PACKET_SIZE
+MIN_HETERO_CONV RTEMS_MINIMUN_HETERO_CONVERSION
+#
+# Name and ID External
+#
+get_node rtems_get_node
+get_index rtems_get_index
+build_name rtems_build_name
+name_to_characters rtems_name_to_characters
+#
+# Name and ID Internal
+#
+_Objects_Get_node rtems_get_node
+_Objects_Get_index rtems_get_index
+_Objects_Build_name rtems_build_name
+_Objects_Name_to_characters rtems_name_to_characters
+#
+# clock_get
+#
+CLOCK_GET_TOD RTEMS_CLOCK_GET_TOD
+CLOCK_GET_SECONDS_SINCE_EPOCH RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH
+CLOCK_GET_TICKS_SINCE_BOOT RTEMS_CLOCK_GET_TICKS_SINCE_BOOT
+CLOCK_GET_TICKS_PER_SECOND RTEMS_CLOCK_GET_TICKS_PER_SECOND
+CLOCK_GET_TIME_VALUE RTEMS_CLOCK_GET_TIME_VALUE
+#
+# Status Code Support Routines (External) -- NO CHANGES
+#
+#
+# Status Code Support Routines (Internal)
+#
+_Status_Is_successful rtems_is_status_successful
+_Status_Is_equal rtems_are_statuses_equal
+#
+# Time Conversion Support Routines (External) -- NO CHANGES
+#
+#
+# Time Conversion Support Routines (Internal)
+#
+_TOD_Milliseconds_to_microseconds RTEMS_MILLISECONDS_TO_MICROSECONDS
+_TOD_Milliseconds_to_ticks RTEMS_MILLISECONDS_TO_MICROSECONDS
+#
+# MP packet
+#
+MP_PACKET_INTERNAL_THREADS RTEMS_MP_PACKET_INTERNAL_THREADS
+MP_PACKET_RTEMS_TASKS RTEMS_MP_PACKET_TASKS
+MP_PACKET_MESSAGE_QUEUE RTEMS_MP_PACKET_MESSAGE_QUEUE
+MP_PACKET_SEMAPHORE RTEMS_MP_PACKET_SEMAPHORE
+MP_PACKET_PARTITION RTEMS_MP_PACKET_PARTITION
+MP_PACKET_REGION RTEMS_MP_PACKET_REGION
+MP_PACKET_EVENT RTEMS_MP_PACKET_EVENT
+MP_PACKET_SIGNAL RTEMS_MP_PACKET_SIGNAL
+#
+#
+#
+IO_Major_control rtems_device_major_number
+IO_Minor_control rtems_device_minor_number
+#
+# Configuration Info
+#
+Configuration_Table rtems_configuration_table
+Configuration_Initialization_tasks_table rtems_initialization_tasks_table
+Configuration_Driver_address_table rtems_driver_address_table
+Configuration_Extension_table rtems_extensions_table
+rtems_tasks_create_extension rtems_task_create_extension
+rtems_tasks_start_extension rtems_task_start_extension
+rtems_tasks_restart_extension rtems_task_restart_extension
+rtems_tasks_delete_extension rtems_task_delete_extension
+rtems_tasks_switch_extension rtems_task_switch_extension
+rtems_tasks_begin_extension rtems_task_begin_extension
+rtems_tasks_exitted_extension rtems_task_exitted_extension
+rtems_fatal_extension rtems_fatal_extension
+Configuration_MPCI_table rtems_mpci_table
+Configuration_Multiprocessing_table rtems_multiprocessing_table
+CPU_Table rtems_cpu_table
+#
+Clock_Get_options rtems_clock_get_options
+Clock_Time_value rtems_clock_time_value
+MP_packet_Prefix rtems_packet_prefix
+MP_packet_Classes rtems_mp_packet_classes
+TOD_Control rtems_time_of_day
+ISR_Vector rtems_vector_number
+Watchdog_Interval rtems_interval
+Watchdog_Service rtems_timer_service_routine_entry
+Attributes_Control rtems_attribute
+Modes_Control rtems_mode
+Options_Control rtems_option
+Priority_Control rtems_task_priority
+PRIORITY_MINIMUM RTEMS_MINIMUM_PRIORITY
+PRIORITY_MAXIMUM RTEMS_MAXIMUM_PRIORITY
+Event_sets_Control rtems_event_set
+ASR_Signal_set_control rtems_signal_set
+Status_Codes rtems_status_code
+RTEMS_TASKS_YIELD_PROCESSOR RTEMS_YIELD_PROCESSOR
+RATE_MONOTONIC_PERIOD_STATUS RTEMS_PERIOD_STATUS
+WATCHDOG_FOREVER RTEMS_NO_TIMEOUT
+STACK_MINIMUM_SIZE RTEMS_MINIMUM_STACK_SIZE
+#
+ASR_Handler rtems_asr_entry
+Thread_Entry rtems_task_entry
+#
+disable_intr rtems_interrupt_disable
+enable_intr rtems_interrupt_enable
+flash_intr rtems_interrupt_flash
+
Index: update/configure.in
===================================================================
--- update/configure.in (nonexistent)
+++ update/configure.in (revision 1765)
@@ -0,0 +1,24 @@
+#
+# $Id: configure.in,v 1.2 2001-09-27 12:02:54 chris Exp $
+#
+
+AC_PREREQ(2.13)
+AC_INIT(rtems-polish.sh)
+RTEMS_TOP(../..)
+AC_CONFIG_AUX_DIR(../..)
+
+AC_CANONICAL_HOST
+
+AM_INIT_AUTOMAKE(rtems-tools-update,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+
+RTEMS_PATH_KSH
+RTEMS_PATH_PERL
+
+AM_CONDITIONAL(PERL,test -n "$PERL")
+
+RTEMS_TOOLPATHS
+# Explicitly list all Makefiles here
+AC_OUTPUT(
+Makefile
+)
Index: update/update.in
===================================================================
--- update/update.in (nonexistent)
+++ update/update.in (revision 1765)
@@ -0,0 +1,216 @@
+#!@KSH@ -p
+#
+# $Id: update.in,v 1.2 2001-09-27 12:02:54 chris Exp $
+#
+# Either bash or ksh will be ok for this; requires 'test -ot'
+# (-p above just says to not parse $ENV file; makes it faster for
+# those of us who set $ENV)
+#
+# Update RTEMS applications for the API changes from 3.1.0 to 3.2.0
+#
+# NOTE
+#
+# This is potentially a very dangerous program.
+
+# progname=`basename $0`
+progname=${0##*/} # fast basename hack for ksh, bash
+
+USAGE=\
+"
+usage: $progname [ -vs ] [ -b base_directory ] [-p file] [-f] [files...]
+ -v -- verbose
+ -p -- file with replacement instructions
+ -s -- skip prompt for backup verification
+ -f -- do files at end of line
+
+base_directory is the root directory of the source code to update. It
+defaults to the current directory.
+
+This program updates C, H, and .inl files.
+"
+
+fatal() {
+ if [ "$1" ]
+ then
+ echo >&2
+ echo $* >&2
+ echo >&2
+ fi
+ echo "$USAGE" 1>&2
+ exit 1
+}
+
+#
+# KLUDGE to figure out at runtime how to echo a line without a
+# newline.
+#
+count=`echo "\\c" | wc -c`
+if [ ${count} -ne 0 ] ; then
+ EARG="-n"
+ EOL=""
+else
+ EARG=""
+ EOL="\\c"
+fi
+
+#
+# Function to make sure they do a backup
+#
+
+WARNING=\
+"
+
+*******************************************************************************
+*******************************************************************************
+*******************************************************************************
+**** ****
+**** WARNING!!! WARNING!!! WARNING!!! ****
+**** ****
+**** ALL SOURCE CODE SHOULD BE BACKED UP BEFORE RUNNING THIS PROGRAM!! ****
+**** ****
+**** WARNING!!! WARNING!!! WARNING!!! ****
+**** ****
+*******************************************************************************
+*******************************************************************************
+*******************************************************************************
+
+"
+
+verify_backup()
+{
+ echo "$WARNING"
+ continue="yes"
+ while [ $continue = "yes" ]
+ do
+echo ${EARG} "Do you wish to update the source tree at this time [y|n]? " ${EOL}
+ read answer
+ case $answer in
+ [yY]*)
+ continue="no"
+ ;;
+ [nN]*)
+ echo
+ echo "Exitting at user request"
+ echo
+ exit 0
+ ;;
+ esac
+ done
+}
+
+#
+# Default tools to use...
+#
+# NOTE: The GNU versions of both of these are faster.
+#
+find_prog=find
+xargs_prog=xargs
+
+#
+# process the options
+#
+
+verbose=""
+suffix=""
+mode=""
+base_directory=.
+do_files="no"
+do_prompt="yes"
+replacement_file="${RTEMS_ROOT}/update-tools/310_to_320_list"
+
+while getopts sfp:b:v OPT
+do
+ case "$OPT" in
+ v)
+ verbose="yes";;
+ s)
+ do_prompt="no";;
+ b)
+ base_directory=${OPTARG};;
+ p)
+ replacement_file=${OPTARG};;
+ f)
+ do_files="yes";;
+ *)
+ fatal
+ esac
+done
+
+let $((shiftcount = $OPTIND - 1))
+shift $shiftcount
+
+args=$*
+
+#
+# Make sure they have done a backup
+#
+
+if [ ${do_prompt} = "yes" ]
+then
+ verify_backup
+fi
+
+#
+# Validate the base directory
+#
+
+if [ ! -d $base_directory ]
+then
+ fatal "${base_directory} does not exist"
+fi
+
+#
+# Validate the replacement file
+#
+
+if [ ! -r $replacement_file ]
+then
+ fatal "${replacement_file} does not exist or is not readable"
+fi
+
+
+#
+# Verify enough of the RTEMS environment variables are set
+#
+
+if [ ! -d "${RTEMS_ROOT}" ]
+then
+ fatal "RTEMS_ROOT environment variable is not initialized"
+fi
+
+#
+# Update the files
+#
+
+generate_list()
+{
+ if [ ${do_files} = "yes" ]
+ then
+ for i in $args
+ do
+ echo $i
+ done
+ else
+ ${find_prog} ${base_directory} \( -name "*.[ch]" -o -name "*.inl" \) -print
+ fi
+}
+
+generate_list | ${xargs_prog} |
+ while read line
+ do
+ ${RTEMS_ROOT}/update-tools/word-replace -p ${replacement_file} ${line}
+ if [ $? -ne 0 ]
+ then
+ exit 1
+ fi
+ for file in ${line}
+ do
+ mv ${file}.fixed ${file}
+ done
+ done
+
+exit 0
+
+# Local Variables: ***
+# mode:ksh ***
+# End: ***
Index: update/Makefile.am
===================================================================
--- update/Makefile.am (nonexistent)
+++ update/Makefile.am (revision 1765)
@@ -0,0 +1,36 @@
+##
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:54 chris Exp $
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+## NOTE: It doesn't make much sense to install these files
+
+CLEANFILES = update word-replace
+
+if PERL
+# All files in this directory depend on having perl.
+# Do not handle them if perl is missing.
+
+noinst_SCRIPTS = acpolish ampolish cipolish rtems-polish.sh word-replace \
+ update
+
+noinst_DATA = 310_to_320_list
+
+update: $(srcdir)/update.in $(top_builddir)/config.status
+ @cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status; \
+ chmod 755 $@
+
+word-replace: $(srcdir)/word-replace.in $(top_builddir)/config.status
+ @cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status; \
+ chmod 755 $@
+
+endif
+
+EXTRA_DIST = 310_to_320_list update.in word-replace.in acpolish ampolish \
+ cipolish rtems-polish.sh
+
+include $(top_srcdir)/../../automake/host.am
Index: update/word-replace.in
===================================================================
--- update/word-replace.in (nonexistent)
+++ update/word-replace.in (revision 1765)
@@ -0,0 +1,89 @@
+#!@PERL@
+#
+# $Id: word-replace.in,v 1.2 2001-09-27 12:02:54 chris Exp $
+#
+
+eval "exec @PERL@ -S $0 $*"
+ if $running_under_some_shell;
+
+require 'getopts.pl';
+&Getopts("p:vh"); # help, pattern file, verbose,
+
+if ($opt_h || ! $opt_p) {
+ print STDERR <)
+{
+ chop;
+ s/#.*//;
+ next if /^$/;
+ ($orig, $new, $junk, @rest) = split;
+ next if ( ! $orig || ! $new || $junk); # <2 or >2 patterns
+ die "pattern appears 2x: '$orig' in '$pattern_file'--" if defined($patterns{$orig});
+ $patterns{$orig} = $new;
+}
+close PATTERNS;
+
+# walk thru each line in each file
+foreach $file (@ARGV)
+{
+ print "$file\t";
+
+ open (INFILE, "<$file") ||
+ die "could not open input file $file: $!";
+
+ $outfile = $file . ".fixed";;
+ open (OUTFILE, ">$outfile") ||
+ die "could not open output file $outfile: $!";
+
+ while ()
+ {
+ study; # maybe make s/// faster
+ foreach $key (keys %patterns)
+ {
+ if ( s/\b$key\b/$patterns{$key}/ge )
+ {
+ print ".";
+ }
+ }
+ print OUTFILE $_;
+ }
+ print "\n";
+ close INFILE;
+ close OUTFILE;
+}
+
Index: update/cipolish
===================================================================
--- update/cipolish (nonexistent)
+++ update/cipolish (revision 1765)
@@ -0,0 +1,247 @@
+#!/usr/bin/perl
+
+#
+# Perl script to beautify and enhance RTEMS configure.in
+#
+# Reads from stdin and writes to stdout
+#
+# usage:
+# acpolish configure.in~
+# mv configure.in~ configure.in
+#
+
+# $Id: cipolish,v 1.2 2001-09-27 12:02:54 chris Exp $
+
+use strict ;
+
+my @vars = () ;
+my @buffer = () ;
+my %var_ ;
+
+# find relative up-path to VERSION
+my $rtems_cfg = &find_file(".","VERSION");
+my $rtems_root = &find_root() ;
+$rtems_root =~ tr/\//\-/ ;
+my $rtems_name = "rtems" ;
+$rtems_name .= "-" . "$rtems_root" if (length($rtems_root) > 0 ) ;
+
+while ( <> )
+{
+ push @buffer, "$_" ;
+}
+
+{
+ my @tbuf = () ;
+
+ foreach ( @buffer )
+ {
+ if ( /^#.*list.*Makefile.*$/o ) {}
+ elsif ( /^dnl[\s]+check.*target.*cc.*$/o ) {}
+ elsif ( /^[\s]*AC_CONFIG_AUX_DIR\(.*\)[\s]*$/o )
+ {
+ push @tbuf, "AC_CONFIG_AUX_DIR($rtems_cfg)\n" ;
+ }
+ elsif ( /^[\s]*RTEMS_TOP\(.*\)[\s]*$/o )
+ {
+ push @tbuf, "RTEMS_TOP($rtems_cfg)\n" ;
+ }
+ elsif ( /^[\s]*AM_INIT_AUTOMAKE\(.*\)[\s]*$/o )
+ {
+ push @tbuf, "AM_INIT_AUTOMAKE($rtems_name,\$RTEMS_VERSION,no)\n" ;
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_HAS_POSIX_API\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_HAS_ITRON_API\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_HAS_HWAPI\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_USE_MACROS\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_HAS_MULTIPROCESSING\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_HAS_RDBG\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s\t]*AC_SUBST\(RTEMS_USE_OWN_PDIR\)[\s]*$/o )
+ { # obsolete option
+ #remove the line
+ }
+ elsif ( /^[\s\t]*RTEMS_ENABLE_GMAKE_PRINT[ ]*$/o )
+ { # obsolete macro
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_HAS_NETWORKING\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_LIBC_DIR\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(PROJECT_ROOT\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*AC_SUBST\(RTEMS_GAS_CODE16\)[\s]*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*PROJECT_ROOT[\s]*=.*$/o )
+ {
+ #remove the line
+ }
+ elsif ( /^[\s]*(RTEMS_ENABLE_LIBCDIR).*$/o )
+ { #remove the line
+ &define_variable("$1","");
+ push @tbuf, "$_" ;
+ }
+ elsif ( /^[\s]*(RTEMS_PROG_CC_FOR_TARGET).*$/o )
+ {
+ &define_variable("$1","");
+ push @tbuf, "$_" ;
+ }
+ elsif ( /^[\s]*(RTEMS_PROG_CXX_FOR_TARGET).*$/o )
+ {
+ &define_variable("$1","");
+ push @tbuf, "$_" ;
+ }
+ else
+ {
+ push @tbuf, "$_" ;
+ }
+ } # foreach
+ @buffer = @tbuf ;
+}
+
+{
+ my @tbuf = () ;
+ foreach ( @buffer )
+ {
+ if ( /^[\s]*(RTEMS_ENABLE_LIBCDIR).*$/o )
+ {
+ if ( ( not variable_seen( "RTEMS_PROG_CC_FOR_TARGET" ) )
+ and ( not variable_seen( "RTEMS_PROG_CXX_FOR_TARGET" ) )
+ )
+ {
+ push @tbuf, "$_" ;
+ }
+ }
+ elsif ( /^AC_OUTPUT.*$/o )
+ {
+ push @tbuf, "# Explicitly list all Makefiles here\n" ;
+ push @tbuf, "$_" ;
+ }
+ else
+ {
+ push @tbuf, "$_" ;
+ }
+ }
+ @buffer = @tbuf ;
+}
+
+{ ## pretty print
+ my $out = join ('',@buffer) ;
+ $out =~ s/\s\#\n(\#\n)+/\n/g ;
+ $out =~ s/\n\n\#\n\n/\n/g ;
+ $out =~ s/\n\n[\n]*/\n\n/g ;
+ print $out ;
+}
+
+exit 1 ;
+
+# find a relative up-path to a file $file, starting at directory $pre
+sub find_file($$)
+{
+ my $pre = $_[0] ;
+ my $file= $_[1] ;
+
+ my $top = "." ;
+ if (not "$pre") { $pre = "." ; }
+
+ for ( my $str = "$pre" . "/" . "$top" ;
+ ( -d "$str" ) ;
+ $str = "$pre" . "/" . "$top" )
+ {
+ if ( -f "${str}/${file}" )
+ {
+ return $top ;
+ }
+ if ( "$top" eq "." )
+ {
+ $top = ".." ;
+ }
+ else
+ {
+ $top .= "/.." ;
+ }
+ } ;
+ die "Can't find file ${file}\n" ;
+}
+
+sub find_root()
+{
+ my $top_builddir = "." ;
+ my $subdir="";
+ my $pwd = `pwd`; chomp $pwd;
+ $pwd .= "/" ;
+ my $len ;
+
+ if ( -f "VERSION" ) { return $subdir ; }
+ my $i = rindex($pwd,'/');
+
+ $len = $i;
+ $pwd = substr($pwd,0,$len);
+ $i = rindex($pwd,'/');
+ $subdir = substr($pwd,$i+1,$len - 1);
+ $top_builddir = ".." ;
+
+ while( -d "$top_builddir" )
+ {
+ if ( -f "${top_builddir}/VERSION" )
+ {
+ return $subdir ;
+ }
+ $len=$i;
+ $pwd = substr($pwd,0,$len);
+ $i = rindex($pwd,'/');
+ $subdir = substr($pwd,$i+1,$len - 1) . "/$subdir";
+ $top_builddir .= "/.." ;
+ } ;
+ die "Can't find VERSION\n" ;
+}
+
+sub variable_seen($)
+{
+ my $label = "$_[0]" ;
+ my $res = defined $var_{"$label"};
+#print STDERR "SEEN: $label ->$res<\n" ;
+ return $res ;
+}
+
+sub define_variable($$)
+{
+ my ($label,@value) = @_ ;
+
+ if ( not variable_seen("$label") )
+ {
+# print STDERR "DEFINING $label\n" ;
+ push @vars, "$label" ;
+ }
+
+ foreach my $i ( @{value} )
+ {
+ push @{$var_{"$label"}}, $i ;
+ }
+}
+
update/cipolish
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: update/README
===================================================================
--- update/README (nonexistent)
+++ update/README (revision 1765)
@@ -0,0 +1,7 @@
+#
+# $Id: README,v 1.2 2001-09-27 12:02:54 chris Exp $
+#
+
+This directory contains tools which aid in upgrading from RTEMS 3.1.0
+to RTEMS 3.2.0.
+
Index: update/acpolish
===================================================================
--- update/acpolish (nonexistent)
+++ update/acpolish (revision 1765)
@@ -0,0 +1,679 @@
+#!/usr/bin/perl
+
+use strict ;
+
+sub print_macro($$);
+
+#
+# Perl script to beautify and enhance RTEMS autoconf Makefile.ins
+#
+# Reads from stdin and writes to stdout
+#
+# usage:
+# acpolish Makefile.in~
+# mv Makefile.in~ Makefile.in
+#
+# Note: This tool is not indented to be exported from the source-tree
+#
+
+if ( -f "Makefile.am" )
+{
+ # Refuse to work on Makefile.ins generated from automake;
+ # redirecting STDOUT to Makefile.in will trash the Makefile.in ;-
+
+ die "acpolish must not be run in automake directories" ;
+}
+
+my $experimental = 0 ; # enable experimental/unsafe features
+my $verbose = 0 ;
+my $build_pgms_seen = "" ;
+my $make_exe_seen = 0 ;
+my $install_seen = 0 ;
+my $top_builddir = "";
+my $subdir = "";
+my @installdirs = () ;
+
+my @pieces = () ;
+my @files = () ;
+my @variants = () ;
+my @vars = () ;
+
+# Strip off duplicate entries from a list
+sub purge($)
+{
+ my $list = $_[0] ; # Reference to list !
+ my (@tmp) = () ;
+
+ foreach my $l ( @{$list} )
+ {
+ my $i = 1 ;
+ foreach my $t (@tmp)
+ {
+ if ( $t eq $l )
+ {
+ $i = 0 ;
+ last ;
+ }
+ }
+ push @tmp,$l if ($i) ;
+ }
+
+ @{$list} = @tmp ;
+}
+
+sub find_root
+{
+ $top_builddir = "." ;
+ $subdir="";
+ my $pwd = `pwd`; chomp $pwd;
+ $pwd .= "/" ;
+ my $len ;
+
+ if ( -f "configure.in" ) { return $top_builddir ; }
+ my $i = rindex($pwd,'/');
+
+ $len = $i;
+ $pwd = substr($pwd,0,$len);
+ $i = rindex($pwd,'/');
+ $subdir = substr($pwd,$i+1,$len - 1);
+ $top_builddir = ".." ;
+
+ while( -d "$top_builddir" )
+ {
+ if ( -f "${top_builddir}/configure.in" )
+ {
+ return $top_builddir ;
+ }
+ $len=$i;
+ $pwd = substr($pwd,0,$len);
+ $i = rindex($pwd,'/');
+ $subdir = substr($pwd,$i+1,$len - 1) . "/$subdir";
+ $top_builddir .= "/.." ;
+ } ;
+ die "Can't find configure.in\n" ;
+}
+
+find_root();
+
+my @buffer = () ;
+
+sub subst_line
+{
+# substitute obsolete variables
+ if ( /^([^\s]*)[\s]+$/o )
+ { # strip trailing spaces
+ $_ = "$1\n";
+ }
+ if ( /^(.*)MKLIB(.*)$/o )
+ {
+ s/MKLIB/RANLIB/g ;
+ }
+ if ( /^(.*)\$\(INSTINCFLAGS\)(.*)$/o )
+ {
+ s/\$\(INSTINCFLAGS\)/-m 644/g ;
+ }
+ if ( /^(.*)ASM(_FILES|_PIECES|_O_FILES)(.*)$/o )
+ {
+ s/ASM_FILES/S_FILES/g ;
+ s/ASM_PIECES/S_PIECES/g ;
+ s/ASM_O_FILES/S_O_FILES/g ;
+ print STDERR "ASM: $_" if ( $verbose > 0) ;
+ }
+ if ( /^(.*)MP_PIECES(.*)$/o )
+ { # HACK: this is not always correct
+ s/MP_PIECES/MP_C_PIECES/g ;
+ print STDERR "MP_PIECES: $_" if ( $verbose > 0 );
+ }
+ if ( /^(.*)\$\(RTEMS_BSP\)(.*)$/o )
+ {
+ s/\$\(RTEMS_BSP\)/\@RTEMS_BSP\@/g ;
+ }
+ if ( /^(.*)\$\(RTEMS_ROOT\)\/mkinstalldirs(.*)$/o )
+ {
+ $_ = "$1\$\(mkinstalldirs\)$2\n" ;
+ }
+ if ( /^(.*)\$\{(.*)_FILES\}(.*)$/o )
+ {
+ $_ = "$1\$\($2_FILES\)$3\n" ;
+ }
+ if ( /^(.*)\$\{(.*)_PIECES\}(.*)$/o )
+ {
+ $_ = "$1\$\($2_PIECES\)$3\n" ;
+ }
+ if ( /^(.*)\$\(PROJECT_ROOT\)\/\@RTEMS_BSP\@\/lib\/include(.*)$/o )
+ {
+ $_ = "$1\$\(PROJECT_INCLUDE\)$2\n" ;
+ }
+ if ( /^(.*)\$\{PROJECT_RELEASE\}(.*)$/o )
+ {
+ $_ = "$1\$\(PROJECT_RELEASE\)$2\n" ;
+ }
+ if ( /^(.*\$\(INSTALL_[A-Z]+\))[\s]+-m[\s]+([54])([0-9][0-9].*)$/o )
+ {
+ my $v = $2 + 2 ;
+ $_ = "$1 -m $v$3\n" ;
+ }
+ if ( /^H_FILES[\s]*=[\s]*\$\(wildcard[\s]+\$\(srcdir\)\/\*\.h\)[\s]*$/o )
+ {
+ my $files =`ls *.h 2>/dev/null`;
+ print STDERR "WARNING: Replacing \"\(wildcard... in $_\n" ;
+ my $line = "H_FILES =";
+ my @l = split(' ',$files) ;
+ foreach(@l) { $line .= " \$\(srcdir\)/$_"; }
+ $line .= "\n" ;
+ $_ = "$line" ;
+ }
+ if ( /^(.*)RTEMS_HAS_([A-Z]+)(.*)$/o )
+ {
+ print STDERR "WARNING: Replacing RTEMS_HAS_$2 with HAS_$2\n" ;
+ $_ = "$1HAS_$2$3\n" ;
+ }
+ if ( /^[\s]*\$[({]PGM[)}]:[\s]*(.*)\$([({]SRCS[)}])(.*)$/o )
+ {
+ $_ = "\$(PGM):$1$3\n" ;
+ }
+ if ( /^.*\$\(make\-exe\).*$/o )
+ {
+ $make_exe_seen = 1 ;
+ }
+ if ( /^.*\$\(INSTALL_(DATA|SCRIPT|PROGRAM)\)(.*)$/o )
+ {
+ $install_seen = 1 ;
+ }
+}
+
+{
+# 1st PASS:
+# * Read input file
+# * concatenate multiple lines
+# * Remove obsolete variables
+
+ my @ibuf = () ;
+ my $line = "" ;
+
+ while ( )
+ {
+ &subst_line ;
+ if ( /^(#.*)$/o )
+ { # preserve comments
+ $line = "$_" ;
+ push @ibuf, $line ;
+ $line = "" ;
+ }
+ elsif ( /^.*\\$/o )
+ { # multilines
+ chop ;
+ $line .= "$_\\" ;
+ }
+ else
+ {
+ $line .= "$_" ;
+ push @ibuf, $line ;
+ $line = "" ;
+ }
+ }
+ @buffer = @ibuf;
+}
+
+{
+# 2nd PASS:
+# * remove automatically generated lines
+# * process some selected make rules
+ my $line = "" ;
+ my @tbuf = () ;
+ foreach (@buffer)
+ {
+ if ( /^[\t](.*)$/o )
+ { # make rule production
+ my $line = $1 ;
+ tr/\\/ / ;
+ my @l = split(/;/,$_);
+ foreach (@l)
+ { # try to get installation directories
+ if ( /^.*\$\(mkinstalldirs\).*\s\$\(INSTALLDIRS\)$/o )
+ {
+ }
+ elsif ( /^.*\$\(mkinstalldirs\).*\s([^\s]+)$/o )
+ {
+ push @installdirs, "$1" ;
+ }
+ elsif ( /^.*\$\(INSTALL_CHANGE\).*\s([^\s]+)(\/[^\.\s]+\.[^\s\/]+)$/o )
+ {
+# print STDERR "WARNING - DIR1: $1 <$2> " ;
+ push @installdirs, "$1" ;
+ }
+ elsif ( /^.*\$\(INSTALL_CHANGE\).*\s([^\s]+)$/o )
+ {
+# print STDERR "DIR2 $1\n" ;
+ push @installdirs, "$1" ;
+ }
+ }
+ push @tbuf, "§3$line"
+ }
+ elsif ( /^[\s]*\#.*$/o )
+ { # comment
+ push @tbuf, "$_" ;
+ }
+ elsif ( /^[\s]*([A-Z_]*)_FILES[\s]*\=[\s]*(.*)$/o )
+ { # *_FILES = ... Macros
+ if ( /^[\s]*([A-Z_]*_|)(CC|C|EQ|H|I|O|S|X)_FILES[\s]*\=[\s]*(.*)$/o )
+ {
+# print STDERR "FILES: <$1>--<$2>--<$3>\n" ;
+ my $f = "$1$2_FILES" ;
+ ${"var_$f"}="$3" ;
+ if ( ( $experimental > 0 )
+ and ( ( "$2" eq "C" ) or ( "$2" eq "CC" ) or ( "$2" eq "S" )
+ or ( "$2" eq "I" ) or ( "$2" eq "H" ) ) )
+ {
+ my $p = "$1$2_PIECES" ;
+ if ( not defined ${"var_$p"} )
+ {
+ print STDERR "ADDING $p\n" ;
+ ${"var_$p"} = "" ;
+ push @tbuf, "§4$p\n" ;
+ push @pieces, "$p" ;
+ }
+ }
+ # place a marker
+ push @tbuf, "§4$f\n" ;
+ push @files, "$f" ;
+ }
+ else
+ { # found a bug
+ print STDERR "UNKNOWN _FILES: $_\n" ;
+ my $f = "$1_FILES" ;
+ ${"var_$f"}="$2" ;
+ # place a marker
+ push @tbuf, "§4$f\n" ;
+ push @files, "$f" ;
+ }
+ }
+ elsif ( /^[\s]*([A-Z_]*)_PIECES[\s]*\=[\s]*(.*)$/o )
+ { # *_PIECES = ... Macros
+ if ( /^[\s]*([A-Z][A-Z0-9_]*_|)(CC|C|EQ|H|I|O|S|X|REL)_PIECES[\s]*\=[\s]*(.*)$/o )
+ {
+ my $p = "$1$2_PIECES" ;
+
+ if ( not defined ${"var_$p"} )
+ {
+ ${"var_$p"} = "$3" ;
+ push @tbuf, "§4$p\n" ;
+ push @pieces, "$p" ;
+ }
+ else
+ {
+ ${"var_$p"} .= " $3" ;
+ }
+ }
+ elsif ( /^[\s]*(BSP|CPU|GENERIC)_PIECES[\s]*\=[\s]*(.*)$/o )
+ { # Explicit exceptions from the *_PIECES naming conventions
+ # They should better be replaced in future
+ my $p = "$1_PIECES" ;
+ ${"var_$p"}="$2" ;
+ # place a marker
+ push @tbuf, "§4$p\n" ;
+ push @pieces, "$p" ;
+ }
+ else
+ { # found a bug
+ print STDERR "UNKNOWN _PIECES: $_\n" ;
+ my $p = "$1_PIECES" ;
+ ${"var_$p"}="$2" ;
+ # place a marker
+ push @tbuf, "§4$p\n" ;
+ push @pieces, "$p" ;
+ }
+ }
+ elsif ( /^[\s]*([A-Z_]+)_PIECES_([^\s]+)_V[\s]*\=[\s]*(.*)$/o )
+ { # *_PIECES_.._V = ... Macros
+ if ( /^[\s]*([A-Z][A-Z0-9_]*_|)(CC|C|EQ|H|I|O|S|X|REL)_PIECES_([^\s]+)_V[\s]*\=[\s]*(.*)$/o )
+ {
+ my @l = split(/_/,$3);
+ my $v = "$1$2-$#l" ;
+ if ( not defined @{"variants_$v"} ) { push @variants, "$v" ; }
+
+ my $p = "$1$2_PIECES_$3_V" ;
+ push @{"variants_${v}"}, "$p" ;
+
+ ${"var_$p"}="$4" ;
+ # place a marker
+ push @tbuf, "§4$p\n" ;
+ push @pieces, "$p" ;
+ }
+ else
+ { # found a bug
+ print STDERR "UNKNOWN _PIECES: $_\n" ;
+ my $p = "$1_PIECES" ;
+ ${"var_$p"}="$2" ;
+ # place a marker
+ push @tbuf, "§4$p\n" ;
+ push @pieces, "$p" ;
+ }
+ }
+ elsif ( /^[\s]*([^\s+=]+)[\s]*\=[\s]*(.*)$/o )
+ { # makefile variables
+ if ( ( "$1" eq "subdir" )
+ or ( "$1" eq "top_srcdir" )
+ or ( "$1" eq "top_builddir" )
+ or ( "$1" eq "RTEMS_ROOT" )
+ or ( "$1" eq "PROJECT_ROOT" )
+ or ( "$1" eq "INSTALL" )
+ or ( "$1" eq "PACKHEX" )
+ or ( "$1" eq "INSTALL_CHANGE" )
+ or ( "$1" eq "mkinstalldirs" )
+ or ( "$1" eq "ACLOCAL" )
+ or ( "$1" eq "AUTOCONF" )
+ or ( "$1" eq "ACLOCAL_M4" )
+ or ( "$1" eq "ACLOCAL_AMFLAGS" )
+ )
+ {
+ print STDERR "REMOVE: $1\n" if $verbose ;
+ }
+ elsif ( "$1" eq "srcdir" )
+ { # place marker
+ push @tbuf, "§0\n";
+ }
+ elsif ( "$1" eq "INSTALLDIRS" )
+ { # process the block
+ my $input = $2 ;
+ $input =~ s/\\\\/ /g ;
+ my @l = split(' ',$input);
+ foreach (@l)
+ {
+ if ( /[\s]*([^\s]+)[\s]*$/o )
+ {
+ push @installdirs, "$1" ;
+ }
+ }
+ }
+ else
+ {
+# print STDERR "MACRO: <$1> = <$2>\n";
+ my $p = "$1" ;
+ ${"var_$p"}="$2" ;
+ # place a marker
+ push @tbuf, "§4$p\n" ;
+ push @vars, "$p" ;
+ }
+ }
+ elsif ( /^[\s]*([^\s+=]+)[\s]*\+\=[\s]*(.*)$/o )
+ { # makefile variable addition
+# print STDERR "MACRO: <$1> += <$2>\n";
+ my $p = "$1" ;
+ if ( not defined ${"var_$p+"} )
+ {
+ # place a marker
+ push @tbuf, "§5$p\n" ;
+ push @vars, "$p+" ;
+ }
+ else
+ {
+ print STDERR "WARNING += $_" ;
+ }
+ ${"var_$p+"} .=" $2" ;
+ }
+ elsif ( /^[\s]*(\@[^\s]+\@)$/o )
+ { # autoconf variable
+ if ( "$1" eq "\@SET_MAKE\@" )
+ {
+ }
+ else
+ {
+ push @tbuf, "$1\n" ;
+ }
+ }
+ elsif ( /^[\s]*include[\s]+(.*)$/o )
+ { # include line
+ push @tbuf, "$_" ;
+ if ( /^include[\s\t]*.*(directory|leaf|lib)\.cfg.*$/o )
+ {
+ push @tbuf, "§1\n" ;
+ push @tbuf, "PACKHEX = \@PACKHEX\@\n" if ( $make_exe_seen == 1 ) ;
+ push @tbuf, "§2\n" ;
+ }
+ }
+ elsif ( /^[\s]*(ifeq|ifneq|else|endif)[\s]+(.*)$/o )
+ { # gmake conditionals
+ # Most of them are removed, but we still have some :-
+ push @tbuf, "$1 $2\n" ;
+ }
+ elsif ( /^\@.*_(TRUE|FALSE)\@.*$/o )
+ { # automake conditionals
+ # HACK: Don't know how to handle them, so let's pass them through
+ push @tbuf, "$_" ;
+ }
+ elsif ( /^[\s]*([^:]+)[\s]*(:[:]*)[\s]*(.*)$/o )
+ {
+ if ( "$2" eq "::" )
+ {
+ # Warn about "::"-rules
+ # Will be silently removed below.
+ print STDERR "WARNING: Removing \"::\" in RULE $_\n" ;
+ }
+
+ if ( ( "$1" eq "Makefile" )
+ or ( "$1" eq "\$\(INSTALLDIRS\)" )
+ or ( "$1" eq "\$\(ACLOCAL_M4\)" )
+ or ( "$1" eq "config\.status" )
+ or ( "$1" eq "\$\(srcdir\)/configure" )
+ )
+ { # delete entry
+ shift @buffer ;
+ }
+ elsif ( ( "$1" eq "all" )
+ or ( "$1" eq "preinstall" ) )
+ {
+ # Note the dependencies
+ # Not yet exploited, but could be useful for dependency
+ # tracking in future
+ if ( defined ${"var_$1"} )
+ { ${"var_$1"} .= " $3" ; }
+ else
+ { ${"var_$1"} = "$3" ; }
+ push @tbuf, "$1: $3\n" ;
+ }
+ else
+ { # make rule
+ push @tbuf, "$1: $3\n" ;
+ }
+ }
+ elsif ( /^[\s]*$/o )
+ { # empty line
+ push @tbuf, "\n" ;
+ }
+ else
+ {
+ die "PASS 2: Unhandled $_" ;
+ }
+ }
+ @buffer = @tbuf ;
+ @tbuf = @installdirs ;
+ @installdirs = () ;
+ foreach ( @tbuf )
+ {
+ if ( /^([^\s]+)(\/[^\.\s]+\.[^\s\/]+)$/o )
+ {
+ print STDERR "WARNING - stripping of file: $1 <$2> " if ( $verbose > 1 );
+ push @installdirs, "$1" ;
+ }
+ else
+ {
+ push @installdirs, "$_" ;
+ }
+ }
+ purge \@installdirs ;
+ purge \@pieces ;
+}
+
+# A fragment to debug conditionals
+#foreach( @variants )
+#{
+# my $v = $_ ;
+# print STDERR "VARIANT: $v\n";
+# foreach (@{"variants_${v}"})
+# {
+# print STDERR "* $_\n;" ;
+# }
+#}
+
+# sanity check on *_FILES macros
+# too fragile for the time being,
+# therefore disabled by default
+if ( $experimental > 1 )
+{
+ foreach( @files )
+ {
+ my $file = "$_" ;
+ my $line = ${"var_$_"} ;
+ $line =~ tr /\\/ /;
+ my @l = split(' ',$line);
+ my @o = () ;
+ foreach (@l)
+ {
+ if ( /^([^\.]+)\.([a-z]+)$/o )
+ {
+ print STDERR "$file: *.$2 in $_\n" ;
+ }
+ elsif ( /^\$\(.*\)$/o )
+ {
+ print STDERR "$file: REF: $_\n" ;
+ }
+ else
+ {
+ print STDERR "$file: UNHANDLED: $_\n" ;
+ }
+ }
+ }
+}
+
+# print STDERR "PASS 2: @buffer" ;
+
+{
+# PASS 3:
+# * output to new Makefile
+# * prettyprint newlines
+
+ my $nl_seen = 0 ;
+ foreach ( @buffer )
+ {
+ if ( /^$/o )
+ {
+ $nl_seen++ ;
+ print "\n" if ( $nl_seen < 2 );
+ }
+ elsif ( /^\§0$/o )
+ {
+ print "\@SET_MAKE\@\n" ;
+ print "srcdir = \@srcdir\@\n" ;
+ print "top_srcdir = \@top_srcdir\@\n" ;
+ print "top_builddir = $top_builddir\n" ;
+ if ( "$subdir" )
+ {
+ print "subdir = $subdir\n";
+ }
+ else
+ {
+ print "\nACLOCAL = aclocal\n" ;
+ print "AUTOCONF = autoconf\n" ;
+ print "ACLOCAL_M4 = \$(top_srcdir)/aclocal.m4\n" ;
+ print "ACLOCAL_AMFLAGS = -I \@RTEMS_TOPdir\@/aclocal\n" ;
+ }
+ print "\nRTEMS_ROOT = \@RTEMS_ROOT\@\n" ;
+ print "PROJECT_ROOT = \@PROJECT_ROOT\@\n\n" ;
+ $nl_seen = 1 ;
+ }
+ elsif ( /^\§1$/o )
+ {
+ print "\n" ;
+ print "INSTALL = \@INSTALL\@\n" if ( $install_seen > 0 );
+ print "INSTALL_CHANGE = \@INSTALL_CHANGE\@\n" ;
+ $nl_seen = 0 ;
+ }
+ elsif ( /^\§2$/o )
+ { # Handle installdirs related items
+ if ( $#installdirs >= 0 )
+ {
+ print "mkinstalldirs = \$(SHELL) \$(top_srcdir)/\@RTEMS_TOPdir\@/mkinstalldirs\n\n" ;
+ my $line = join( ' ',@installdirs );
+ &print_macro( "INSTALLDIRS =", $line );
+ print "\n\$(INSTALLDIRS):\n\t\@\$(mkinstalldirs) \$(INSTALLDIRS)\n\n" ;
+ $nl_seen = 1 ;
+ }
+ }
+ elsif ( /^\§3(.*)$/o )
+ { # pretty print a shell script fragment/make production
+ my @l = split(/\\\\/,$1);
+ if ( $#l >= 0 ) { my $i = shift @l ; print "\t$i"; }
+ foreach( @l ) { print "\\\n$_"; }
+ print "\n" ;
+ $nl_seen = 0 ;
+ }
+ elsif ( /^\§4(.*)$/o )
+ { # pretty print a make variable
+ &print_macro( "$1 =", ${"var_$1"} );
+ $nl_seen = 0 ;
+ }
+ elsif ( /^\§5(.*)$/o )
+ { # pretty print an addition to a make variable
+ &print_macro( "$1 +=", ${"var_$1+"}) ;
+ $nl_seen = 0 ;
+ }
+ else
+ {
+ $nl_seen = 0 ;
+ print "$_" ;
+ }
+ }
+}
+
+# Add rules for config.status generated files
+if ( "$build_pgms_seen" )
+{
+print "%: \$(srcdir)/%.in \$(top_builddir)/config.status\n" ;
+print " cd \$(top_builddir) \\\n" ;
+print " && CONFIG_FILES=" ;
+print "\$(subdir)/" if ( "$subdir" );
+print "\$@ CONFIG_HEADERS= \$(SHELL) ./config.status\n";
+}
+else
+{
+print "Makefile: \$(srcdir)/Makefile.in \$(top_builddir)/config.status\n" ;
+print "\tcd \$(top_builddir) \\\n" ;
+print "\t && CONFIG_FILES=" ;
+print "\$(subdir)/" if ( "$subdir" );
+print "\$@ CONFIG_HEADERS= \$(SHELL) ./config.status\n";
+}
+
+if ( ! "$subdir" )
+{
+print "\n\$(ACLOCAL_M4): \@MAINTAINER_MODE_TRUE\@ configure.in\n" ;
+print "\tcd \$(srcdir) && \$(ACLOCAL) \$(ACLOCAL_AMFLAGS)\n" ;
+print "\nconfig.status: \$(srcdir)/configure \$(CONFIG_STATUS_DEPENDENCIES)\n" ;
+print "\t\$(SHELL) ./config.status --recheck\n" ;
+print "\$(srcdir)/configure: \@MAINTAINER_MODE_TRUE\@\$(srcdir)/configure.in";
+print " \$(ACLOCAL_M4)\n" ;
+print "\tcd \$(srcdir) && \$(AUTOCONF)\n"
+}
+
+exit 0 ;
+
+sub print_macro($$)
+{
+ my ($line,$input) = @_ ;
+ $input =~ s/\\\\/ /g;
+ my @l = split(' ',$input);
+
+ foreach (@l) {
+ if ( ( length($line) + length($_) ) < 76 )
+ {
+ $line .= " $_";
+ }
+ else
+ {
+ print "$line \\\n";
+ $line = " $_" ;
+ }
+ }
+ print "$line\n" ;
+}
+
update/acpolish
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: update/ampolish
===================================================================
--- update/ampolish (nonexistent)
+++ update/ampolish (revision 1765)
@@ -0,0 +1,531 @@
+#!/usr/bin/perl
+
+package main ;
+
+use strict ;
+
+#
+# Perl script to beautify and enhance RTEMS automake Makefile.ams
+#
+# Reads from stdin and writes to stdout
+#
+# usage:
+# /ampolish Makefile.am~
+# mv Makefile.am~ Makefile.am
+#
+
+my @vars ;
+my @conditions = ( "" ) ;
+my @buffer = ();
+my %var_ ;
+
+define_variable( "\$(AUTOMAKE_OPTIONS)", ( "foreign", "1.4" ) );
+define_variable( "\$(VPATH)", ( "\@srcdir\@" ) );
+
+# find relative up-path to configure.in
+my $rtems_cfg = find_file(".","configure.in");
+
+# find relative up-path from configure.in to VERSION
+my $rtems_top = find_file("$rtems_cfg","VERSION");
+
+if ( "$rtems_top" eq "." ) { $rtems_top = "" ; }
+else { $rtems_top .= "/" ; }
+
+{
+# PASS1:
+# read input file and concatenate multiple lines into single lines.
+
+ my @ibuf = () ;
+
+ while( )
+ { # consume header
+ last if ( /^[^#].*$/ ) ;
+ push @ibuf, "$_" ;
+ }
+
+ push @ibuf, "§header\n" ;
+
+ do
+ {
+ if ( /^(#.*)$/o )
+ { # preserve comments
+ push @ibuf, "$_" ;
+ }
+ elsif ( /^(\t.*)\\[\s]*$/o )
+ { # multilines for scripts
+ my $line = "$1§" ;
+ while( )
+ {
+ if ( /^(.*)\\[\s]*$/o )
+ {
+ $line .= "$1§" ;
+ }
+ else
+ {
+ $line .= "$_" ;
+ push @ibuf, $line ;
+ last ;
+ }
+ }
+ }
+ elsif ( /^(.*)\\[\s]*$/o )
+ { # multilines
+ my $line = "$1" ;
+ while( )
+ {
+ if ( /^(.*)\\[\s]*$/o )
+ {
+ $line .= "$1" ;
+ }
+ else
+ {
+ $line .= "$_" ;
+ $line =~ s%[\s]+% %g ;
+ push @ibuf, "$line\n" ;
+ last ;
+ }
+ }
+ }
+ else
+ {
+ push @ibuf, "$_" ;
+ }
+ } while ( ) ;
+ @buffer = @ibuf ;
+}
+
+{
+# PASS2:
+# fix obsolete constructs
+ my @ibuf = () ;
+
+ foreach ( @buffer )
+ {
+# tr /\{\}/\(\)/ ;
+
+ if ( /^(TMP|PRE)INSTALL_FILES[\s]*=(.*)$/o )
+ { # force "+="
+ push @ibuf, "$1INSTALL_FILES +=$2\n" ;
+ }
+ elsif ( /^(VPATH|EXTRA_DIST)[\s]*\+=(.*)$/o )
+ { # force "="
+ push @ibuf, "$1 = $2\n" ;
+ }
+ elsif ( /^[\s]*ACLOCAL[\s]*=[\s]*\@ACLOCAL\@.*$/o )
+ { # remove the line
+ }
+ elsif ( /^[\s]*(ACLOCAL_AMFLAGS)[\s\t]*[\+]*=[\s]*(.*)[\s]*$/o )
+ { # remove the line
+ }
+ elsif ( /^[\s]*(AM_CFLAGS)[\s\t]*[\+]*=[\s]*\$\(CFLAGS_OS_V\)[\s]*$/o )
+ { # remove the line
+ }
+ elsif ( /^[\s]*debug-am:.*$/o )
+ { # remove the line
+ }
+ elsif ( /^[\s]*all(\-am):(.*)$/o )
+ { # replace the line
+ push @ibuf, "all-local:$2\n" ;
+ }
+ elsif ( /^[\s]*profile-am:.*$/o )
+ { # remove the line
+ }
+ elsif ( /^[\s]*include[\s\t]*\$\(RTEMS_ROOT\)\/make\/lib.cfg[\s]*$/o )
+ {
+ push @ibuf, "include \$(top_srcdir)/${rtems_top}automake/lib.am\n" ;
+ }
+ elsif ( /^(.*[^\s])[\s]*$/o )
+ { # remove trailing spaces
+ push @ibuf, "$1\n" ;
+ }
+ else
+ {
+ push @ibuf, "$_" ;
+ }
+ }
+ @buffer = @ibuf ;
+}
+
+# print STDERR "\n", @buffer, " \n" ;
+
+{
+ my @ibuf = () ;
+ foreach ( @buffer )
+ {
+ if ( /^#(.*)$/o )
+ {
+ push @ibuf, "#$1\n" ;
+ }
+ elsif ( /^[\s]*if[\s\t]+([a-zA-Z0-9_]+)[\s\t]*$/o )
+ {
+ push @conditions, "\@" . $1 . "_TRUE\@" ;
+ push @ibuf, "if $1\n" ;
+ }
+ elsif ( /^[\s]*else[\s\t]*$/o )
+ {
+ @conditions[$#conditions] =~ s/_TRUE\@$/_FALSE\@/;
+ push @ibuf, "else\n" ;
+ }
+ elsif ( /^[\s]*endif[\s\t]*$/o )
+ {
+ pop @conditions ;
+ push @ibuf, "endif\n" ;
+ }
+ elsif ( /^§.*$/o )
+ {
+ push @ibuf, "$_" ;
+ }
+ elsif ( /^[\s]*(VPATH)[\s\t]*([\+]*)=[\s]*(.*)[\s]*$/o )
+ {
+ my $lh = "\$($1)" ;
+ my @rh = split( /:/,"$3");
+ if ( $#conditions > 0 )
+ {
+ print STDERR "WARNING: $1 must not be set inside of conditionals!\n"
+ }
+ define_variable( "$lh", @rh );
+
+ }
+ elsif ( /^[\s]*(AUTOMAKE_OPTIONS)[\s\t]*([\+]*)=[\s]*(.*)$/o )
+ {
+ my $lh = "\$($1)" ;
+ my @rh = &split_vars("$3");
+
+ if ( $#conditions > 0 )
+ {
+ print STDERR "WARNING: $1 must not be set inside of conditionals!\n"
+ }
+
+ define_variable( "$lh", @rh );
+ }
+ elsif ( /^[\s]*([a-zA-Z0-9_]+)[\s\t]*([\+]*)=[\s]*(.*)$/o )
+ {
+ my $lh = join ('',@conditions) . "\$($1)" ;
+ my @rh = &split_vars("$3");
+ my $seen = variable_seen( "$lh" ) ;
+
+ if ( $#conditions > 0 )
+ {
+ define_variable( "\$($1)", () );
+ }
+
+ define_variable( "$lh", @rh );
+
+ if ( not $seen )
+ {
+ push @ibuf, "§$2var_$lh\n" ;
+ }
+ }
+ elsif ( /^[\s]*include[\s\t]*\$\(top_srcdir\)[\.\/]*automake\/(.*)\.am$/o )
+ {
+ if ( "$1" eq "lib" )
+ {
+ push @ibuf, "include \$(top_srcdir)/${rtems_top}automake/$1.am\n" ;
+ }
+ elsif ( "$1" eq "local" )
+ {
+ $main::seen_local = 1 ;
+ }
+ elsif ( "$1" eq "host" )
+ {
+ $main::seen_host = 1 ;
+ }
+ }
+ elsif ( /^[\s]*include[\s\t]*(.*)$/o )
+ {
+ push @ibuf, "include $1\n" ;
+ }
+ elsif ( /^\t(.*)$/o )
+ {
+ push @ibuf, "\t$1\n" ;
+ }
+ elsif ( /^(.*)\:(.*)$/o )
+ {
+ push @ibuf, "$1:$2\n" ;
+ }
+ elsif ( /^[\s]*$/o )
+ {
+ push @ibuf, "\n" ;
+ }
+ else
+ {
+ die "ERROR: Don't know how to handle <$_>" ;
+ }
+ } # for
+ @buffer = @ibuf ;
+} # while
+
+die "Conditional stack corrupted" if ( $#conditions != 0 );
+
+foreach( @vars )
+{
+ purge( \@{$var_{"$_"}} );
+}
+
+# print STDERR "\n", @buffer, " \n" ;
+
+
+{
+ my @ibuf = () ;
+ foreach( @buffer )
+ {
+ if ( /^#.*$/o )
+ {
+ push @ibuf, "$_" ;
+ }
+ elsif( /^§header$/o )
+ {
+ my $l = $var_{"\$(AUTOMAKE_OPTIONS)"} ;
+ push @ibuf, "\nAUTOMAKE_OPTIONS = @{$l}\n" ;
+ if ( "$rtems_cfg" eq "." )
+ {
+ push @ibuf, "ACLOCAL_AMFLAGS = -I \$(RTEMS_TOPdir)/aclocal\n" ;
+ }
+ if ( defined( @{$var_{"\$(VPATH)"}} ) )
+ {
+ if ( $#{$var_{"\$(VPATH)"}} > 0 )
+ {
+ my $l = join (':',@{$var_{"\$(VPATH)"}}) ;
+ push @ibuf, "\nVPATH = $l\n" ;
+ }
+ }
+ push @ibuf, "\n" ;
+ }
+ elsif ( /^§(\+|)var_(.*)\$\((.*)\)$/o )
+ {
+ print_var(\@ibuf, "$3 $1=", $var_{"$2\$($3)"}) ;
+ }
+ elsif ( /^\t.*$/o )
+ {
+ &print_script(\@ibuf, "$_");
+ }
+ elsif ( /^[\s]*if[\s]+([a-zA-Z0-9_]+)[\s\t]*$/o )
+ {
+ push @conditions, "\@$1_TRUE\@" ;
+ push @ibuf, "if $1\n" ;
+ }
+ elsif ( /^[\s]*else[\s]*$/o )
+ {
+ @conditions[$#conditions] =~ s/_TRUE\@$/_FALSE\@/;
+ push @ibuf, "else\n" ;
+ }
+ elsif ( /^[\s]*endif[\s]*$/o )
+ {
+ pop @conditions ;
+ push @ibuf, "endif\n" ;
+ }
+ else
+ {
+ print_line(\@ibuf,$_);
+ }
+ }
+
+ if ( variable_seen("\$(SUBDIRS)") )
+ {
+ push @ibuf, "include \$(top_srcdir)/${rtems_top}automake/subdirs.am\n" ;
+ }
+
+ if ( defined( $main::seen_host ) )
+ {
+ push @ibuf, "include \$(top_srcdir)/${rtems_top}automake/host.am\n" ;
+ }
+ else
+ {
+ push @ibuf, "include \$(top_srcdir)/${rtems_top}automake/local.am\n" ;
+ }
+
+ @buffer = @ibuf ;
+}
+
+#print STDERR "\n", @buffer, " \n" ;
+
+{ ## pretty print
+ my $out = join ('',@buffer) ;
+ $out =~ s/\s\#\n(\#\n)+/\n/g ;
+ $out =~ s/\n\n\#\n\n/\n/g ;
+ $out =~ s/\n\n[\n]*/\n\n/g ;
+ print $out ;
+}
+
+exit 0;
+
+# find a relative up-path to a file $file, starting at directory $pre
+sub find_file
+{
+ my $pre = $_[0] ;
+ my $file= $_[1] ;
+
+ my $top = "." ;
+ if (not "$pre") { $pre = "." ; }
+
+ for ( my $str = "$pre" . "/" . "$top" ;
+ ( -d "$str" ) ;
+ $str = "$pre" . "/" . "$top" )
+ {
+ if ( -f "${str}/${file}" )
+ {
+ return $top ;
+ }
+ if ( "$top" eq "." )
+ {
+ $top = ".." ;
+ }
+ else
+ {
+ $top .= "/.." ;
+ }
+ } ;
+ die "Can't find file ${file}\n" ;
+}
+
+sub variable_seen($)
+{
+ my $label = "$_[0]" ;
+ my $res = defined $var_{"$label"};
+#print STDERR "SEEN: $label ->$res<\n" ;
+ return $res ;
+}
+
+sub define_variable($$)
+{
+ my ($label,@value) = @_ ;
+
+ if ( not variable_seen("$label") )
+ {
+#print STDERR "DEFINING: $label\n" ;
+ push @vars, "$label" ;
+ }
+
+ foreach my $i ( @{value} )
+ {
+ push @{$var_{"$label"}}, $i ;
+ }
+}
+
+# Strip off duplicate entries from a list
+sub purge($)
+{
+ my $list = $_[0] ; # Reference to list !
+ my (@tmp) = () ;
+
+ foreach my $l ( @{$list} )
+ {
+ my $i = 1 ;
+ foreach my $t (@tmp)
+ {
+ if ( $t eq $l )
+ {
+ $i = 0 ;
+ last ;
+ }
+ }
+ push @tmp,$l if ($i) ;
+ }
+
+ @{$list} = @tmp ;
+}
+
+#
+# Break the right hand side of a variable assignment into separate chunks
+#
+sub split_vars($)
+{
+ my $line = $_[0] ;
+ my (@buf) = split(//,"$line") ;
+
+ my $begin = 0 ;
+ my @res = () ;
+
+ my $depth = 0 ;
+ my $state = 0 ;
+
+ my $len = $#buf + 1 ;
+ for ( my $i = 0 ; $i < $len ; $i++ )
+ {
+ my $c = @buf[$i] ;
+ if ( $state == 0 )
+ {
+ if ( "$c" ne " " )
+ { # token
+ $begin = $i ;
+ $state++ ;
+ }
+ if ( "$c" eq "\$" )
+ { # variable
+ $depth++ ;
+ }
+ }
+ elsif ( $state == 1 )
+ {
+ if ( ( "$c" eq "\)" ) or ( "$c" eq "\}" ) )
+ { # variable
+ $depth-- ;
+ }
+ elsif ( ("$c" eq " " ) and ( $depth == 0 ) )
+ {
+ push @res, substr($line,$begin,$i-$begin);
+ $state-- ;
+ }
+ elsif ( "$c" eq "\$" )
+ { # variable
+ $depth++ ;
+ }
+ }
+ else
+ {
+ die "split_vars: unknown mode\n" ;
+ }
+ }
+
+ if ( $state > 0 )
+ {
+ push @res, substr($line,$begin,$len-$begin);
+ $state = 0
+ }
+ return @res ;
+}
+
+sub print_var($$$)
+{
+ my ($ibuf,$line,$l) = @_ ; # $l .. reference to list
+
+ foreach (@{$l}) {
+ if ( ( length($line) + length($_) ) < 76 )
+ {
+ $line .= " $_";
+ }
+ else
+ {
+ push @{$ibuf}, "$line \\\n";
+ $line = " $_" ;
+ }
+ }
+ push @{$ibuf}, "$line\n" ;
+}
+
+sub print_line($$)
+{
+ my ($ibuf,$input) = @_ ;
+ my @l = split( / /, $input );
+ my $line = shift @l ;
+
+ foreach my $i (@l) {
+ if ( ( length($line) + length($i) ) < 76 )
+ {
+ $line .= " $i";
+ }
+ else
+ {
+ push @{$ibuf}, "$line \\\n";
+ $line = " $i" ;
+ }
+ }
+ push @{$ibuf}, "$line" ;
+}
+
+sub print_script($$)
+{
+ my ($ibuf,$input) = @_ ;
+ $input =~ s%§%\\\n%g ;
+ push @{$ibuf}, $input ;
+}
update/ampolish
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: update
===================================================================
--- update (nonexistent)
+++ update (revision 1765)
update
Property changes :
Added: svn:ignore
## -0,0 +1,15 ##
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+missing
+mkinstalldirs
+update
+word-replace
Index: cpu/unix/gensize.c
===================================================================
--- cpu/unix/gensize.c (nonexistent)
+++ cpu/unix/gensize.c (revision 1765)
@@ -0,0 +1,116 @@
+/*
+ * gensize.c
+ *
+ * This file generates the file unixsize.h
+ *
+ * NOTE: It only prints the minimal information required.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id: gensize.c,v 1.2 2001-09-27 12:02:54 chris Exp $
+ *
+ */
+
+/*
+ * This feels like a very crude way to determine if we are on a Solaris
+ * host but it does work.
+ */
+
+#if defined(__sun__) && defined(__sparc__) && \
+ defined(__unix__) && defined(__svr4__)
+#undef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 3
+#undef __STRICT_ANSI__
+#endif
+
+#include
+#include
+#include
+#include
+
+typedef struct {
+ jmp_buf regs;
+ int isr_level;
+ int pad[4]; /* just in case */
+} Context_Control;
+
+int main(
+ int argc,
+ char **argv
+)
+{
+ Context_Control *cc = 0;
+
+ /*
+ * Print the file header
+ */
+
+printf(
+ "/* unixsize.h\n"
+ " *\n"
+ " * This include file contans the size of the context control block\n"
+ " * C data structure. This structure must be defined in such a way\n"
+ " * that files NOT including the native header files can work.\n"
+ " *\n"
+ " * NOTE: THIS FILE IS AUTOMATICALLY GENERATED!!!!\n"
+ " * DO NOT EDIT THIS BY HAND!!!!\n"
+ " *\n"
+ " * COPYRIGHT (c) 1989-1999.\n"
+ " * On-Line Applications Research Corporation (OAR).\n"
+ " *\n"
+ " * The license and distribution terms for this file may be\n"
+ " * found in the file LICENSE in this distribution or at\n"
+ " * http://www.OARcorp.com/rtems/license.html.\n"
+ " */\n"
+ "\n"
+ "#ifndef __UNIXSIZE_h\n"
+ "#define __UNIXSIZE_h\n"
+ "\n"
+);
+
+#define PRINT_IT( STRING, NUMBER ) \
+ printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
+ STRING, \
+ NUMBER, \
+ NUMBER );
+
+#define PRINT_SIZE( STRING, NUMBER ) \
+ printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
+ STRING, \
+ NUMBER, \
+ NUMBER );
+
+#define PRINT_COMMENT( STRING ) \
+ printf( \
+ "\n" \
+ "/*\n" \
+ " * " STRING "\n" \
+ " */\n" \
+ "\n" \
+ );
+
+ PRINT_COMMENT("Context_Control information");
+
+ PRINT_SIZE("CPU_CONTEXT_SIZE_IN_BYTES", sizeof( Context_Control ) );
+ PRINT_SIZE("CPU_CONTEXT_REGISTERS_OFFSET_IN_BYTES", (int) &cc->regs );
+ PRINT_SIZE("CPU_CONTEXT_SIGNALS_OFFSET_IN_BYTES", (int) &cc->isr_level );
+
+ /*
+ * Print the end of file stuff
+ */
+
+ printf(
+ "\n"
+ "#endif /* __UNIXSIZE_h */\n"
+ "\n"
+ "/* end of include file */\n"
+ );
+
+ return 0;
+}
+
Index: cpu/unix/configure.in
===================================================================
--- cpu/unix/configure.in (nonexistent)
+++ cpu/unix/configure.in (revision 1765)
@@ -0,0 +1,20 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id: configure.in,v 1.2 2001-09-27 12:02:54 chris Exp $
+
+AC_INIT(gensize.c)
+RTEMS_TOP(../../..)
+AC_CONFIG_AUX_DIR(../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-tools-cpu-unix,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+AC_EXEEXT
+
+AC_PROG_CC
+
+RTEMS_TOOLPATHS
+
+# Explicitly list all Makefiles here
+AC_OUTPUT(Makefile)
Index: cpu/unix/Makefile.am
===================================================================
--- cpu/unix/Makefile.am (nonexistent)
+++ cpu/unix/Makefile.am (revision 1765)
@@ -0,0 +1,12 @@
+##
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:54 chris Exp $
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+noinst_PROGRAMS = gensize
+
+gensize_SOURCES = gensize.c
+
+include $(top_srcdir)/../../../automake/host.am
Index: cpu/unix
===================================================================
--- cpu/unix (nonexistent)
+++ cpu/unix (revision 1765)
cpu/unix
Property changes :
Added: svn:ignore
## -0,0 +1,13 ##
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+missing
+mkinstalldirs
Index: cpu/configure.in
===================================================================
--- cpu/configure.in (nonexistent)
+++ cpu/configure.in (revision 1765)
@@ -0,0 +1,25 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id: configure.in,v 1.2 2001-09-27 12:02:53 chris Exp $
+
+AC_INIT(generic)
+RTEMS_TOP(../..)
+AC_CONFIG_AUX_DIR(../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-tools-cpu,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+
+RTEMS_PATH_KSH
+
+RTEMS_TOOLPATHS
+AC_SUBST(program_prefix)
+
+AC_CONFIG_SUBDIRS(generic)
+if test -d $srcdir/$RTEMS_CPU; then
+AC_CONFIG_SUBDIRS($RTEMS_CPU)
+fi
+
+# Explicitly list all Makefiles here
+AC_OUTPUT(Makefile)
Index: cpu/hppa1.1/genoffsets.c
===================================================================
--- cpu/hppa1.1/genoffsets.c (nonexistent)
+++ cpu/hppa1.1/genoffsets.c (revision 1765)
@@ -0,0 +1,347 @@
+/*
+ * genoffsets.c
+ *
+ * This file generates the offsets.h for the HP PA-RISC port of RTEMS.
+ *
+ * NOTE: It only prints the offset for structures actually used
+ * by the assembly code.
+ *
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id: genoffsets.c,v 1.2 2001-09-27 12:02:53 chris Exp $
+ */
+
+#include
+
+#if defined(__hpux__) && defined(__hppa__)
+#include
+#endif
+
+void print_information( void );
+
+int main(
+ int argc,
+ char **argv
+)
+{
+#if defined(__hpux__) && defined(__hppa__)
+ unsigned int size = 0;
+#endif
+
+ /*
+ * Print the file header
+ */
+
+printf(
+ "/* offsets.h\n"
+ " *\n"
+ " * This include file contains the offsets of elements in the\n"
+ " * C data structures used by the assembly language code for the\n"
+ " * HP PA-RISC 1.1 port of RTEMS.\n"
+ " *\n"
+ " * NOTE: THIS FILE IS AUTOMATICALLY GENERATED!!!!\n"
+ " * DO NOT EDIT THIS BY HAND!!!!\n"
+ " *\n"
+ " * COPYRIGHT (c) 1989-1999.\n"
+ " * On-Line Applications Research Corporation (OAR).\n"
+ " *\n"
+ " * The license and distribution terms for this file may be\n"
+ " * found in the file LICENSE in this distribution or at\n"
+ " * http://www.OARcorp.com/rtems/license.html.\n"
+ " */\n"
+ "\n"
+ "#ifndef __OFFSETS_h\n"
+ "#define __OFFSETS_h\n"
+ "\n"
+);
+
+#define PRINT_IT( STRING, TYPE, FIELD ) \
+ printf( "#define\t%s\t0x%p\t\t/* %d */\n", \
+ STRING, \
+ &((TYPE)0)->FIELD, \
+ (int) &((TYPE)0)->FIELD );
+
+#define PRINT_SIZE( STRING, item ) \
+ printf( "#ifdef ASM\n#define\t%s\t%d\t\t/* 0x%x */\n#endif\n", \
+ STRING, \
+ sizeof(item), \
+ sizeof(item) );
+
+#define PRINT_COMMENT( STRING ) \
+ printf( \
+ "\n" \
+ "/*\n" \
+ " * " STRING "\n" \
+ " */\n" \
+ "\n" \
+ );
+
+#if defined(__hpux__) && defined(__hppa__)
+
+/*
+ * Offsets of elements in the Context_control structure.
+ */
+
+ PRINT_COMMENT("Context_Control information");
+
+ PRINT_IT( "FLAGS_OFFSET", Context_Control *, flags );
+ PRINT_IT( "R1_OFFSET", Context_Control *, gr1 );
+ PRINT_IT( "R2_OFFSET", Context_Control *, gr2 );
+ PRINT_IT( "R3_OFFSET", Context_Control *, gr3 );
+ PRINT_IT( "R4_OFFSET", Context_Control *, gr4 );
+ PRINT_IT( "R5_OFFSET", Context_Control *, gr5 );
+ PRINT_IT( "R6_OFFSET", Context_Control *, gr6 );
+ PRINT_IT( "R7_OFFSET", Context_Control *, gr7 );
+ PRINT_IT( "R8_OFFSET", Context_Control *, gr8 );
+ PRINT_IT( "R9_OFFSET", Context_Control *, gr9 );
+ PRINT_IT( "R10_OFFSET", Context_Control *, gr10 );
+ PRINT_IT( "R11_OFFSET", Context_Control *, gr11 );
+ PRINT_IT( "R12_OFFSET", Context_Control *, gr12 );
+ PRINT_IT( "R13_OFFSET", Context_Control *, gr13 );
+ PRINT_IT( "R14_OFFSET", Context_Control *, gr14 );
+ PRINT_IT( "R15_OFFSET", Context_Control *, gr15 );
+ PRINT_IT( "R16_OFFSET", Context_Control *, gr16 );
+ PRINT_IT( "R17_OFFSET", Context_Control *, gr17 );
+ PRINT_IT( "R18_OFFSET", Context_Control *, gr18 );
+ PRINT_IT( "R19_OFFSET", Context_Control *, gr19 );
+ PRINT_IT( "R20_OFFSET", Context_Control *, gr20 );
+ PRINT_IT( "R21_OFFSET", Context_Control *, gr21 );
+ PRINT_IT( "R22_OFFSET", Context_Control *, gr22 );
+ PRINT_IT( "R23_OFFSET", Context_Control *, gr23 );
+ PRINT_IT( "R24_OFFSET", Context_Control *, gr24 );
+ PRINT_IT( "R25_OFFSET", Context_Control *, gr25 );
+ PRINT_IT( "R26_OFFSET", Context_Control *, gr26 );
+ PRINT_IT( "R27_OFFSET", Context_Control *, gr27 );
+ PRINT_IT( "R28_OFFSET", Context_Control *, gr28 );
+ PRINT_IT( "R29_OFFSET", Context_Control *, gr29 );
+ PRINT_IT( "R30_OFFSET", Context_Control *, sp );
+ PRINT_IT( "R31_OFFSET", Context_Control *, gr31 );
+
+ /*
+ * And common aliases for the above
+ */
+
+ PRINT_COMMENT("Common aliases for above");
+
+ PRINT_IT( "RP_OFFSET", Context_Control *, gr2 );
+ PRINT_IT( "ARG3_OFFSET", Context_Control *, gr23 );
+ PRINT_IT( "ARG2_OFFSET", Context_Control *, gr24 );
+ PRINT_IT( "ARG1_OFFSET", Context_Control *, gr25 );
+ PRINT_IT( "ARG0_OFFSET", Context_Control *, gr26 );
+ PRINT_IT( "SP_OFFSET", Context_Control *, sp );
+ PRINT_IT( "DP_OFFSET", Context_Control *, gr27 );
+ PRINT_IT( "RET0_OFFSET", Context_Control *, gr28 );
+ PRINT_IT( "RET1_OFFSET", Context_Control *, gr29 );
+
+ PRINT_SIZE("CPU_CONTEXT_SIZE", Context_Control);
+
+ PRINT_COMMENT("Context_Control_fp information");
+
+ PRINT_IT( "FR0_OFFSET", Context_Control_fp *, fr0 );
+ PRINT_IT( "FR1_OFFSET", Context_Control_fp *, fr1 );
+ PRINT_IT( "FR2_OFFSET", Context_Control_fp *, fr2 );
+ PRINT_IT( "FR3_OFFSET", Context_Control_fp *, fr3 );
+ PRINT_IT( "FR4_OFFSET", Context_Control_fp *, fr4 );
+ PRINT_IT( "FR5_OFFSET", Context_Control_fp *, fr5 );
+ PRINT_IT( "FR6_OFFSET", Context_Control_fp *, fr6 );
+ PRINT_IT( "FR7_OFFSET", Context_Control_fp *, fr7 );
+ PRINT_IT( "FR8_OFFSET", Context_Control_fp *, fr8 );
+ PRINT_IT( "FR9_OFFSET", Context_Control_fp *, fr9 );
+ PRINT_IT( "FR10_OFFSET", Context_Control_fp *, fr10 );
+ PRINT_IT( "FR11_OFFSET", Context_Control_fp *, fr11 );
+ PRINT_IT( "FR12_OFFSET", Context_Control_fp *, fr12 );
+ PRINT_IT( "FR13_OFFSET", Context_Control_fp *, fr13 );
+ PRINT_IT( "FR14_OFFSET", Context_Control_fp *, fr14 );
+ PRINT_IT( "FR15_OFFSET", Context_Control_fp *, fr15 );
+ PRINT_IT( "FR16_OFFSET", Context_Control_fp *, fr16 );
+ PRINT_IT( "FR17_OFFSET", Context_Control_fp *, fr17 );
+ PRINT_IT( "FR18_OFFSET", Context_Control_fp *, fr18 );
+ PRINT_IT( "FR19_OFFSET", Context_Control_fp *, fr19 );
+ PRINT_IT( "FR20_OFFSET", Context_Control_fp *, fr20 );
+ PRINT_IT( "FR21_OFFSET", Context_Control_fp *, fr21 );
+ PRINT_IT( "FR22_OFFSET", Context_Control_fp *, fr22 );
+ PRINT_IT( "FR23_OFFSET", Context_Control_fp *, fr23 );
+ PRINT_IT( "FR24_OFFSET", Context_Control_fp *, fr24 );
+ PRINT_IT( "FR25_OFFSET", Context_Control_fp *, fr25 );
+ PRINT_IT( "FR26_OFFSET", Context_Control_fp *, fr26 );
+ PRINT_IT( "FR27_OFFSET", Context_Control_fp *, fr27 );
+ PRINT_IT( "FR28_OFFSET", Context_Control_fp *, fr28 );
+ PRINT_IT( "FR29_OFFSET", Context_Control_fp *, fr29 );
+ PRINT_IT( "FR30_OFFSET", Context_Control_fp *, fr30 );
+ PRINT_IT( "FR31_OFFSET", Context_Control_fp *, fr31 );
+
+ PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
+
+ /*
+ * And the control registers
+ */
+
+ PRINT_COMMENT("Control register portion of context");
+
+ PRINT_IT( "SAR_OFFSET", Context_Control *, sar );
+ PRINT_IT( "IPSW_OFFSET", Context_Control *, ipsw );
+ PRINT_IT( "IIR_OFFSET", Context_Control *, iir );
+ PRINT_IT( "IOR_OFFSET", Context_Control *, ior );
+ PRINT_IT( "ISR_OFFSET", Context_Control *, isr );
+ PRINT_IT( "PCOQFRONT_OFFSET", Context_Control *, pcoqfront );
+ PRINT_IT( "PCOQBACK_OFFSET", Context_Control *, pcoqback );
+ PRINT_IT( "PCSQFRONT_OFFSET", Context_Control *, pcsqfront );
+ PRINT_IT( "PCSQBACK_OFFSET", Context_Control *, pcsqback );
+ PRINT_IT( "ITIMER_OFFSET", Context_Control *, itimer );
+
+ /*
+ * Full interrupt frame (integer + float)
+ */
+ PRINT_COMMENT("Interrupt frame information");
+
+ PRINT_IT( "INTEGER_CONTEXT_OFFSET", CPU_Interrupt_frame *, Integer );
+ PRINT_IT( "FP_CONTEXT_OFFSET", CPU_Interrupt_frame *, Floating_Point );
+ size = sizeof( CPU_Interrupt_frame );
+
+ if ( size % CPU_STACK_ALIGNMENT )
+ size += CPU_STACK_ALIGNMENT - (size % CPU_STACK_ALIGNMENT);
+
+ printf( "#define\tCPU_INTERRUPT_FRAME_SIZE\t%d\t\t/* 0x%x */\n", size, size );
+
+#else
+
+ print_information();
+
+#endif
+
+#undef PRINT_IT
+#undef PRINT_SIZE
+#undef PRINT_COMMENT
+
+ /*
+ * Print the end of file stuff
+ */
+
+ printf(
+ "\n"
+ "#endif /* __OFFSETS_h */\n"
+ "\n"
+ "/* end of include file */\n"
+ );
+
+ return 0;
+}
+
+void print_information( void )
+{
+
+#define PRINT_IT( STRING, NUMBER ) \
+ printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
+ STRING, \
+ NUMBER, \
+ NUMBER );
+
+#define PRINT_SIZE( STRING, NUMBER ) \
+ printf( "#define\t%s\t0x%x\t\t/* %d */\n", \
+ STRING, \
+ NUMBER, \
+ NUMBER );
+
+#define PRINT_COMMENT( STRING ) \
+ printf( \
+ "\n" \
+ "/*\n" \
+ " * " STRING "\n" \
+ " */\n" \
+ "\n" \
+ );
+
+/*
+ * Offsets of elements in the Context_control structure.
+ */
+
+ PRINT_COMMENT("Context_Control information");
+
+ PRINT_IT( "FLAGS_OFFSET", 0x00 );
+ PRINT_IT( "R1_OFFSET", 0x04 );
+ PRINT_IT( "R2_OFFSET", 0x08 );
+ PRINT_IT( "R3_OFFSET", 0x0c );
+ PRINT_IT( "R4_OFFSET", 0x00 );
+ PRINT_IT( "R5_OFFSET", 0x14 );
+ PRINT_IT( "R6_OFFSET", 0x18 );
+ PRINT_IT( "R7_OFFSET", 0x1c );
+ PRINT_IT( "R8_OFFSET", 0x20 );
+ PRINT_IT( "R9_OFFSET", 0x24 );
+ PRINT_IT( "R10_OFFSET", 0x28 );
+ PRINT_IT( "R11_OFFSET", 0x2c );
+ PRINT_IT( "R12_OFFSET", 0x30 );
+ PRINT_IT( "R13_OFFSET", 0x34 );
+ PRINT_IT( "R14_OFFSET", 0x38 );
+ PRINT_IT( "R15_OFFSET", 0x3c );
+ PRINT_IT( "R16_OFFSET", 0x40 );
+ PRINT_IT( "R17_OFFSET", 0x44 );
+ PRINT_IT( "R18_OFFSET", 0x48 );
+ PRINT_IT( "R19_OFFSET", 0x4c );
+ PRINT_IT( "R20_OFFSET", 0x50 );
+ PRINT_IT( "R21_OFFSET", 0x54 );
+ PRINT_IT( "R22_OFFSET", 0x58 );
+ PRINT_IT( "R23_OFFSET", 0x5c );
+ PRINT_IT( "R24_OFFSET", 0x60 );
+ PRINT_IT( "R25_OFFSET", 0x64 );
+ PRINT_IT( "R26_OFFSET", 0x68 );
+ PRINT_IT( "R27_OFFSET", 0x6c );
+ PRINT_IT( "R28_OFFSET", 0x70 );
+ PRINT_IT( "R29_OFFSET", 0x74 );
+ PRINT_IT( "R30_OFFSET", 0x78 );
+ PRINT_IT( "R31_OFFSET", 0x7c );
+
+ /*
+ * And common aliases for the above
+ */
+
+ PRINT_COMMENT("Common aliases for above");
+
+ PRINT_IT( "RP_OFFSET", 0x08 );
+ PRINT_IT( "ARG3_OFFSET", 0x5c );
+ PRINT_IT( "ARG2_OFFSET", 0x60 );
+ PRINT_IT( "ARG1_OFFSET", 0x64 );
+ PRINT_IT( "ARG0_OFFSET", 0x68 );
+ PRINT_IT( "SP_OFFSET", 0x78 );
+ PRINT_IT( "DP_OFFSET", 0x6c );
+ PRINT_IT( "RET0_OFFSET", 0x74 );
+ PRINT_IT( "RET1_OFFSET", 0x74 );
+
+ PRINT_SIZE("CPU_CONTEXT_SIZE", 168 );
+
+ PRINT_COMMENT("Context_Control_fp information");
+
+ PRINT_SIZE("CPU_CONTEXT_FP_SIZE", 256);
+
+ /*
+ * And the control registers
+ */
+
+ PRINT_COMMENT("Control register portion of context");
+
+ PRINT_IT( "SAR_OFFSET", 0x80 );
+ PRINT_IT( "IPSW_OFFSET", 0x84 );
+ PRINT_IT( "IIR_OFFSET", 0x88 );
+ PRINT_IT( "IOR_OFFSET", 0x8c );
+ PRINT_IT( "ISR_OFFSET", 0x90 );
+ PRINT_IT( "PCOQFRONT_OFFSET", 0x94 );
+ PRINT_IT( "PCOQBACK_OFFSET", 0x98 );
+ PRINT_IT( "PCSQFRONT_OFFSET", 0x9c );
+ PRINT_IT( "PCSQBACK_OFFSET", 0xa0 );
+ PRINT_IT( "ITIMER_OFFSET", 0xa4 );
+
+ /*
+ * Full interrupt frame (integer + float)
+ */
+
+ PRINT_COMMENT("Interrupt frame information");
+
+ PRINT_IT( "INTEGER_CONTEXT_OFFSET", 0x00 );
+ PRINT_IT( "FP_CONTEXT_OFFSET", 0xa8 );
+ PRINT_SIZE( "CPU_INTERRUPT_FRAME_SIZE", 448 );
+
+}
Index: cpu/hppa1.1/configure.in
===================================================================
--- cpu/hppa1.1/configure.in (nonexistent)
+++ cpu/hppa1.1/configure.in (revision 1765)
@@ -0,0 +1,20 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id: configure.in,v 1.2 2001-09-27 12:02:53 chris Exp $
+
+AC_INIT(genoffsets.c)
+RTEMS_TOP(../../..)
+AC_CONFIG_AUX_DIR(../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-tools-cpu-hppa1.1,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+AC_EXEEXT
+
+AC_PROG_CC
+
+RTEMS_TOOLPATHS
+
+# Explicitly list all Makefiles here
+AC_OUTPUT(Makefile)
Index: cpu/hppa1.1/Makefile.am
===================================================================
--- cpu/hppa1.1/Makefile.am (nonexistent)
+++ cpu/hppa1.1/Makefile.am (revision 1765)
@@ -0,0 +1,18 @@
+##
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:53 chris Exp $
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+noinst_PROGRAMS = genoffsets
+
+genoffsets_SOURCES = genoffsets.c
+
+## We use files that have not been installed yet.
+
+CPU_DIR = ../../cpu/$(RTEMS_CPU)
+
+AM_CPPFLAGS = -I$(PROJECT_INCLUDE) -I$(CPU_DIR)
+
+include $(top_srcdir)/../../../automake/host.am
Index: cpu/hppa1.1
===================================================================
--- cpu/hppa1.1 (nonexistent)
+++ cpu/hppa1.1 (revision 1765)
cpu/hppa1.1
Property changes :
Added: svn:ignore
## -0,0 +1,13 ##
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+missing
+mkinstalldirs
Index: cpu/Makefile.am
===================================================================
--- cpu/Makefile.am (nonexistent)
+++ cpu/Makefile.am (revision 1765)
@@ -0,0 +1,13 @@
+##
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:53 chris Exp $
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+SUBDIRS = @subdirs@
+
+DIST_SUBDIRS = generic hppa1.1 sh unix
+
+include $(top_srcdir)/../../automake/subdirs.am
+include $(top_srcdir)/../../automake/host.am
Index: cpu/sh/configure.in
===================================================================
--- cpu/sh/configure.in (nonexistent)
+++ cpu/sh/configure.in (revision 1765)
@@ -0,0 +1,24 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id: configure.in,v 1.2 2001-09-27 12:02:54 chris Exp $
+
+AC_INIT(shgen.c)
+RTEMS_TOP(../../..)
+AC_CONFIG_AUX_DIR(../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-tools-cpu-sh,0.4)
+AM_MAINTAINER_MODE
+AC_EXEEXT
+
+AC_PROG_CC
+AC_CHECK_LIB(m,fabs)
+AC_CHECK_FUNCS(getopt_long)
+AC_CHECK_PROGS(HELP2MAN,help2man)
+AM_CONDITIONAL(HELP2MAN,test -n "$HELP2MAN" )
+
+RTEMS_TOOLPATHS
+
+# Explicitly list all Makefiles here
+AC_OUTPUT(Makefile)
Index: cpu/sh/Makefile.am
===================================================================
--- cpu/sh/Makefile.am (nonexistent)
+++ cpu/sh/Makefile.am (revision 1765)
@@ -0,0 +1,19 @@
+##
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:54 chris Exp $
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4 no-installman
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+noinst_PROGRAMS = shgen
+
+shgen_SOURCES = sci.h sci.c shgen.c
+
+if HELP2MAN
+man_MANS = shgen.1
+
+shgen.1: $(srcdir)/shgen.c
+ $(HELP2MAN) -N shgen >$@
+endif
+
+include $(top_srcdir)/../../../automake/host.am
Index: cpu/sh/sci.c
===================================================================
--- cpu/sh/sci.c (nonexistent)
+++ cpu/sh/sci.c (revision 1765)
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 1998 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
+ *
+ * See the file COPYING for copyright notice.
+ */
+
+#include
+#include
+#include
+
+#include "sci.h"
+
+/*
+ n .. baudrate generator source 0,1,2,3
+
+ N .. BRR setting (0..255)
+
+ Phi .. processor baud rate
+
+ B .. bitrate
+ */
+
+typedef struct sci_tab {
+ unsigned int B ;
+ unsigned int n ;
+ int N ;
+ double err ;
+ } sci_tab_t ;
+
+static unsigned int bitrate [] = {
+ 50,
+ 75,
+ 110,
+ 134,
+ 150,
+ 200,
+ 300,
+ 600,
+ 1200,
+ 1800,
+ 2400,
+ 4800,
+ 9600,
+ 19200,
+ 38400,
+ 57600,
+ 115200,
+ 230400,
+ 460800
+};
+
+static sci_tab_t test_array[4] ;
+
+static void Compute(
+ unsigned int n,
+ unsigned int B,
+ double Phi,
+ struct sci_tab *entry )
+{
+ int a = ( 32 << ( 2 * n ) ) * B ;
+
+ entry->n = n ;
+ entry->B = B ;
+ entry->N = rint( ( Phi / a ) - 1.0 ) ;
+
+ if ( ( entry->N > 0 ) && ( entry->N < 256 ) )
+ entry->err =
+ ( ( Phi / ( (entry->N + 1) * a ) - 1.0 ) * 100.0 );
+ else
+ {
+ entry->err = 100.0 ;
+ entry->n = 255 ;
+ entry->N = 0 ;
+ }
+}
+
+static sci_tab_t *SelectN(
+ unsigned int B,
+ double Phi )
+{
+ unsigned int i ;
+ struct sci_tab* best = NULL ;
+
+ for ( i = 0 ; i < 4 ; i++ )
+ {
+ double err ;
+
+ Compute( i, B, Phi, &test_array[i] );
+ err = fabs( test_array[i].err );
+
+ if ( best )
+ {
+ if ( err < fabs( best->err ) )
+ best = &test_array[i] ;
+ }
+ else
+ best = &test_array[i] ;
+ }
+
+ return best ;
+}
+
+int shgen_gensci(
+ FILE *file,
+ double Phi ) /* Processor frequency [Hz] */
+{
+ unsigned int i ;
+
+ fprintf( file,
+ "/*\n * Bitrate table for the serial devices (sci) of the SH at %.3f MHz\n"
+ " */\n\n", Phi / 1000000.0 );
+ fprintf( file,
+ "/*\n"
+ " * n .. SMR bits 0,1 : baud rate generator clock source\n"
+ " * N .. BRR bits 0..7: setting for baud rate generator\n"
+ " * error .. percentual error to nominal bitrate\n"
+ " * Hitachi's HW manual recommends bitrates with an error less than 1%%\n"
+ " * We experienced values less than 2%% to be stable\n"
+ " */\n\n" );
+ fprintf( file, "#include \n\n" );
+ fprintf( file,
+ "static struct sci_bitrate_t {\n"
+ " unsigned char n ;\n"
+ " unsigned char N ;\n"
+ "} _sci_bitrates[] = {\n"
+ "/* n N error */\n" );
+
+ for ( i = 0 ; i < sizeof(bitrate)/sizeof(int) ; i++ )
+ {
+ struct sci_tab* best = SelectN( bitrate[i], Phi );
+
+ if ( i > 0 )
+ fprintf( file, ",\n" );
+ fprintf( file, " { %1d, %3d } /* %+7.2f%% ; B%d ",
+ best->n,
+ best->N,
+ best->err,
+ best->B );
+ if ( best->n > 3 )
+ fprintf( file, "(unusable) " );
+ fprintf( file, "*/" );
+ }
+
+ fprintf( file, "\n};\n\n" );
+
+ fprintf( file,
+ "int _sci_get_brparms( \n"
+ " tcflag_t cflag,\n"
+ " unsigned char *smr,\n"
+ " unsigned char *brr )\n"
+ "{\n"
+ " unsigned int offset ;\n\n"
+ " offset = ( cflag & ( CBAUD & ~CBAUDEX ) )\n"
+ " + ( ( cflag & CBAUDEX ) ? B38400 : 0 );\n"
+ " if ( offset == 0 ) return -1 ;\n"
+ " offset-- ;\n\n"
+ " if ( _sci_bitrates[offset].n > 3 ) return -1;\n\n"
+ " *smr &= ~0x03;\n"
+ " *smr |= _sci_bitrates[offset].n;\n"
+ " *brr = _sci_bitrates[offset].N;\n\n"
+ " return 0;\n"
+ "}\n" );
+
+ return 0 ;
+}
Index: cpu/sh/sci.h
===================================================================
--- cpu/sh/sci.h (nonexistent)
+++ cpu/sh/sci.h (revision 1765)
@@ -0,0 +1,11 @@
+#ifndef _shgen_sci_h
+#define _shgen_sci_h
+
+#include
+
+extern int shgen_gensci(
+ FILE *file,
+ double Phi /* Processor frequency [Hz] */
+ );
+
+#endif
Index: cpu/sh/AUTHORS
===================================================================
--- cpu/sh/AUTHORS (nonexistent)
+++ cpu/sh/AUTHORS (revision 1765)
@@ -0,0 +1,3 @@
+Ralf Corsepius (corsepiu@faw.uni-ulm.de)
+ * Initial implementation
+ * generator for sci bitrate table
Index: cpu/sh/TODO
===================================================================
--- cpu/sh/TODO (nonexistent)
+++ cpu/sh/TODO (revision 1765)
@@ -0,0 +1,13 @@
+* Add support for more drivers to shgen !!!!
+
+* shgen relies on having a gnu-compatible getopt, which should be
+ available on all hosts using gcc/egcs/binutils.
+ Using other getopt-variants may produce faulty results or shgen may also
+ refuse to compile. Probably the easiest solution to this problem would be
+ to integrate libiberty into rtems.
+
+* shgen uses floating point mathematics. Therefore Makefile.in contains a
+ reference to libm. In case the host doesn't have its floating point
+ support in libm, shgen will fail to compile. If we should ever meet such
+ a host, checks for floating point libraries have to be added to rtems'
+ autoconf support.
Index: cpu/sh/shgen.c
===================================================================
--- cpu/sh/shgen.c (nonexistent)
+++ cpu/sh/shgen.c (revision 1765)
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 1998,1999,2000 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
+ *
+ * See the file COPYING for copyright notice.
+ */
+
+#include
+#include /* strcmp, strerror */
+#include
+#include
+
+#include "sci.h"
+
+static void usage( FILE* ofile, char *prog )
+{
+ fprintf( ofile, "Usage: %s [options] driver\n", prog );
+ fprintf( ofile, "\nOptions:\n" );
+ fprintf( ofile, "Processor frequency (default 20MHz):\n") ;
+ fprintf( ofile, "\t-M Phi .. processor frequency [MHz]\n" );
+ fprintf( ofile, "\t-K Phi .. processor frequency [KHz]\n" );
+ fprintf( ofile, "\t-H Phi .. processor frequency [Hz]\n" );
+ fprintf( ofile, "Driver:\n" );
+ fprintf( ofile, "\tsci .. bitrate table for sci\n" );
+
+ fprintf( ofile, "\nWritten by Ralf Corsepius \n" );
+ fprintf( ofile, "\nCopyright (c) 1998,1999,2000\tRalf Corsepius\n" );
+}
+
+#if HAVE_GETOPT_LONG
+#define NOARG 0
+#define HASARG 1
+#define OPTARG 2
+
+static struct option long_options[] =
+{
+ { "version", NOARG, NULL, 'v' },
+ { "help", NOARG, NULL, 'h' },
+ { "mega-hertz", HASARG, NULL, 'M' },
+ { "kilo-hertz", HASARG, NULL, 'K' },
+ { "hertz", HASARG, NULL, 'H' },
+ { 0, 0, 0, 0 }
+};
+#endif
+
+static void shgen_header( FILE *file )
+{
+ fprintf( file,
+ "/*\n * DO NOT EDIT - this file is automatically generated by shgen %s\n",
+ VERSION );
+ fprintf( file,
+ " * Copyright (c) 1998,1999,2000 Ralf Corsepius (corsepiu@faw.uni-ulm.de)\n */\n" );
+ fprintf( file,
+ "\n/* This file is not copyrighted */\n\n" );
+}
+
+int main( int argc, char *argv[] )
+{
+ double Phi = 20.0 ;
+
+#if HAVE_GETOPT_LONG
+ int option_index = 0 ;
+ while( ( optopt = getopt_long( argc, argv, "M:K:H:hv",
+ long_options, &option_index ) ) > 0 )
+#else
+ while ( ( optopt = getopt( argc, argv, "M:K:H:hv" ) ) > 0 )
+#endif
+ {
+ switch ( optopt )
+ {
+ case 'M' :
+ sscanf( optarg, "%lf", &Phi );
+ Phi = Phi * 1000000.0;
+ break ;
+ case 'K' :
+ sscanf( optarg, "%lf", &Phi );
+ Phi = Phi * 1000.0;
+ break ;
+ case 'H' :
+ sscanf( optarg, "%lf", &Phi );
+ break ;
+ case 'h' :
+ usage( stdout, argv[0] );
+ exit(0);
+ case 'v' :
+ fprintf( stdout, "%s version %s\n", argv[0], VERSION );
+ exit(0);
+ default :
+ usage( stderr, argv[0] );
+ exit(1);
+ break ;
+ }
+ }
+
+ if ( argc - optind != 1 )
+ {
+ fprintf( stderr, "%s: Missing argument: driver\n", argv[0] );
+ exit(1);
+ }
+
+ shgen_header( stdout );
+
+ if ( strcmp( argv[optind], "sci" ) == 0 )
+ {
+ shgen_gensci( stdout, Phi );
+ }
+ else
+ {
+ fprintf( stderr, "%s: Invalid argument: driver\n", argv[0] );
+ exit(1);
+ }
+
+ return 0 ;
+}
Index: cpu/sh/COPYING
===================================================================
--- cpu/sh/COPYING (nonexistent)
+++ cpu/sh/COPYING (revision 1765)
@@ -0,0 +1,19 @@
+
+ shgen - code generator for the Hitachi SH microcontroller family
+
+ Copyright (C) 1998-1999 Ralf Corsepius (corsepiu@faw.uni-ulm.de)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
Index: cpu/sh
===================================================================
--- cpu/sh (nonexistent)
+++ cpu/sh (revision 1765)
cpu/sh
Property changes :
Added: svn:ignore
## -0,0 +1,13 ##
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+missing
+mkinstalldirs
Index: cpu/generic/configure.in
===================================================================
--- cpu/generic/configure.in (nonexistent)
+++ cpu/generic/configure.in (revision 1765)
@@ -0,0 +1,21 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl $Id: configure.in,v 1.2 2001-09-27 12:02:53 chris Exp $
+
+AC_INIT(size_rtems.in)
+RTEMS_TOP(../../..)
+AC_CONFIG_AUX_DIR(../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE(rtems-tools-cpu-generic,$RTEMS_VERSION,no)
+AM_MAINTAINER_MODE
+
+RTEMS_PATH_KSH
+
+RTEMS_TOOLPATHS
+AC_SUBST(program_prefix)
+
+# Explicitly list all Makefiles here
+AC_OUTPUT(Makefile
+size_rtems)
Index: cpu/generic/Makefile.am
===================================================================
--- cpu/generic/Makefile.am (nonexistent)
+++ cpu/generic/Makefile.am (revision 1765)
@@ -0,0 +1,9 @@
+##
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:53 chris Exp $
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
+
+noinst_SCRIPTS = size_rtems
+include $(top_srcdir)/../../../automake/host.am
Index: cpu/generic/size_rtems.in
===================================================================
--- cpu/generic/size_rtems.in (nonexistent)
+++ cpu/generic/size_rtems.in (revision 1765)
@@ -0,0 +1,284 @@
+#!@KSH@ -p
+#
+# size_rtems
+#
+# This script gathers information related to the size of RTEMS
+# using the GNU "size" command.
+#
+# This script operates by summing up the sizes of the various
+# object files which constitute a particular configuration of
+# RTEMS. This size information is gathered for placement in the
+# brochure flyers and supplement manuals.
+#
+# NOTE: The concept of the minimum executive size is buried in this script.
+#
+# COPYRIGHT (c) 1989-1999.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.OARcorp.com/rtems/license.html.
+#
+# $Id: size_rtems.in,v 1.2 2001-09-27 12:02:53 chris Exp $
+#
+
+target=@target@
+program_prefix=@program_prefix@
+
+gnusize=${program_prefix}size
+
+# check usage
+if [ $# -ne 2 ] ; then
+ echo usage ${0}: bsp object_directory
+ exit 1
+fi
+
+bsp=$1
+board=$1
+ARCH=$2
+
+cpu=`echo $target | sed -e 's/-.*//'`
+
+case $target in
+ sparc-sun-solaris*)
+ rtems_cpu=unix
+ bsp=solaris2
+ echo Not supported on unix port.
+ exit 0
+ ;;
+ i[34567]86-pc-linux-gnu)
+ echo linux
+ rtems_cpu=unix
+ bsp=linux1
+ echo Not supported on unix port.
+ exit 0
+ ;;
+ i[34567]86-unknown-freebsd2.[12]*)
+ echo freebsd
+ rtems_cpu=unix
+ bsp=freebsd2
+ echo Not supported on unix port.
+ exit 0
+ ;;
+ *-rtems*)
+ cpu=`echo $target | sed -e 's/-.*//'`
+ rtems_cpu=$cpu
+ ;;
+ *)
+ echo unknown target $target
+ exit 1
+ ;;
+esac
+
+case $ARCH in
+ *debug*) VARIANT=debug ;;
+ *profile*) VARIANT=profile ;;
+ *) VARIANT=optimized;;
+esac
+
+echo
+echo Size Information for the Following Configuration:
+echo CPU: ${cpu}
+echo BSP: ${board}
+echo VARIANT: ${VARIANT}
+echo
+
+
+#
+# KLUDGE to figure out at runtime how to echo a line without a
+# newline.
+#
+count=`echo "\\c" | wc -c`
+if [ ${count} -ne 0 ] ; then
+ EARG="-n"
+ EOL=""
+else
+ EARG=""
+ EOL="\\c"
+fi
+
+if [ ! -d ../${board} ] ; then
+ echo "${board} does not exist ... is the current directory the build directory?"
+ exit 1
+fi
+
+#DIRLIST -- so greps for DIRLIST will find this file
+CPUOBJ=exec/score/cpu/${rtems_cpu}/wrap/${ARCH}
+COREOBJ=exec/score/src/${ARCH}
+RTEMSOBJ=exec/rtems/src/${ARCH}
+SAPIOBJ=exec/sapi/src/${ARCH}
+OPTOBJ=exec/rtems/optman/${ARCH}
+
+# XXX These have been split up
+MANLIST=" \
+${RTEMSOBJ}/clockget.o \
+${RTEMSOBJ}/clockset.o \
+${RTEMSOBJ}/clocktick.o \
+${RTEMSOBJ}/dpmem.o \
+${RTEMSOBJ}/event.o \
+${RTEMSOBJ}/intr.o \
+${RTEMSOBJ}/msg.o \
+${RTEMSOBJ}/part.o \
+${RTEMSOBJ}/ratemon.o \
+${RTEMSOBJ}/region.o \
+${RTEMSOBJ}/sem.o \
+${RTEMSOBJ}/signal.o \
+${RTEMSOBJ}/tasks.o \
+${RTEMSOBJ}/timer.o \
+${SAPIOBJ}/debug.o \
+${SAPIOBJ}/extension.o \
+${SAPIOBJ}/fatal.o \
+${SAPIOBJ}/exinit.o \
+${SAPIOBJ}/io.o \
+${SAPIOBJ}/rtemsapi.o \
+"
+
+if [ -r ${RTEMSOBJ}/mp.o ] ; then
+ MPLIST="\
+ ${RTEMSOBJ}/mp.o ${RTEMSOBJ}/eventmp.o \
+ ${COREOBJ}/mpci.o ${RTEMSOBJ}/msgmp.o ${COREOBJ}/objectmp.o \
+ ${RTEMSOBJ}/partmp.o ${RTEMSOBJ}/regionmp.o ${RTEMSOBJ}/semmp.o \
+ ${RTEMSOBJ}/signalmp.o ${RTEMSOBJ}/taskmp.o ${COREOBJ}/threadmp.o \
+ "
+
+ MPOBJLIST=${OPTOBJ}/no-mp.rel
+fi
+
+OPTMANLIST="\
+${OPTOBJ}/no-dpmem.rel \
+${OPTOBJ}/no-event.rel \
+${MPOBJLIST} \
+${OPTOBJ}/no-msg.rel \
+${OPTOBJ}/no-part.rel \
+${OPTOBJ}/no-region.rel \
+${OPTOBJ}/no-rtmon.rel \
+${OPTOBJ}/no-sem.rel \
+${OPTOBJ}/no-signal.rel \
+${OPTOBJ}/no-timer.rel \
+"
+REQMANLIST="\
+${SAPIOBJ}/exinit.o \
+${RTEMSOBJ}/tasks.o \
+${RTEMSOBJ}/intr.o \
+${SAPIOBJ}/fatal.o \
+"
+# XXX parts of these have been split up
+CORELIST=" \
+${COREOBJ}/apiext.o ${COREOBJ}/chain.o \
+${COREOBJ}/coremsg.o ${COREOBJ}/coremutex.o ${COREOBJ}/coresem.o \
+${COREOBJ}/heap.o ${COREOBJ}/interr.o \
+${COREOBJ}/isr.o \
+${COREOBJ}/object.o \
+${SAPIOBJ}/rtemsapi.o \
+${COREOBJ}/thread.o ${COREOBJ}/threadq.o ${COREOBJ}/tod.o \
+${COREOBJ}/userext.o \
+${COREOBJ}/watchdog.o ${COREOBJ}/wkspace.o \
+"
+
+CPULIST="\
+${CPUOBJ}/rtems-cpu.rel \
+"
+
+# check directories
+for i in ${EXECOBJ} ${CPUOBJ} ${OPTOBJ}
+do
+ if [ ! -d ${i} ] ; then
+ echo "${i} does not exist ... is RTEMS compiled and installed?"
+ exit 1
+ fi
+done
+
+for i in ${MANLIST} ${MPLIST} ${OPTMANLIST} ${REQMANLIST} ${CORELIST} ${CPULIST}
+do
+ if [ ! -r ${i} ] ; then
+ echo ${i} does not exist ... is RTEMS compiled and installed?
+ exit 1
+ fi
+done
+
+# "rips" a line of gsize's output and prints size, data, bss
+parse_size()
+{
+ echo $1 $2 $3
+}
+
+# prepares a list of code, data, bss sizes for a directory
+sizedir()
+{
+ ${gnusize} $* | sed -e '1,1d' |
+ while read line
+ do
+ parse_size ${line}
+ done
+}
+
+# adds the numbers passed on the command line
+addit()
+{
+ sumx=0
+ for x in $*
+ do
+ sumx=`expr $sumx + $x`
+ done
+ echo $sumx
+}
+
+# adds a column from the output of sizedir
+addsizes()
+{
+ # dc version is not portable enough -- It can be left out during
+ # installing linux and may not be available on non-UNIX hosts.
+ #cut -d' ' -f${2} ${1} | sed -e '2,$s/$/ + /' -e '$,$s/$/ p/' | dc
+
+ # This may not be as fast but it is probably more portable.
+ addit `cut -d' ' -f${2} ${1}`
+}
+
+# calculates total size of a directory and prints report line
+size_files()
+{
+ trap "rm -f /tmp/size.$$ ; exit 1" 2 3
+
+ for file in $*
+ do
+ parse_size `${gnusize} $file | sed -e '/text/d'`
+ done >/tmp/size.$$
+
+ code=`cat /tmp/size.$$ | addsizes 1`
+ data=`cat /tmp/size.$$ | addsizes 2`
+ bss=` cat /tmp/size.$$ | addsizes 3`
+ echo "${code} ${data} ${bss}"
+ rm /tmp/size.$$
+}
+
+echo
+echo " RTEMS SIZE REPORT"
+echo
+echo " CODE DATA BSS"
+echo " =================="
+echo ${EARG} "MANAGERS: " ${EOL} ; size_files $MANLIST $MPLIST
+echo ${EARG} "CORE : " ${EOL} ; size_files $CORELIST $CPULIST
+echo ${EARG} "CPU : " ${EOL} ; size_files $CPULIST
+echo ${EARG} "OVERALL : " ${EOL} ; size_files $CPULIST $CORELIST $MANLIST \
+ $MPLIST
+echo ${EARG} "MINIMUM : " ${EOL} ; size_files $CPULIST $CORELIST \
+ $OPTMANLIST $REQMANLIST
+echo
+
+for file in $MANLIST
+do
+ base=`basename ${file}`
+ echo ${EARG} ""${base} : " ${EOL} " ; size_files ${file}
+done
+
+echo ${EARG} "MP : " ${EOL} ; size_files $MPLIST
+
+echo
+for file in $OPTMANLIST
+do
+ base=`basename ${file}`
+ echo ${EARG} "${base} : " ${EOL} ; size_files ${file}
+done
+
+echo
+exit 0
Index: cpu/generic
===================================================================
--- cpu/generic (nonexistent)
+++ cpu/generic (revision 1765)
cpu/generic
Property changes :
Added: svn:ignore
## -0,0 +1,14 ##
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+missing
+mkinstalldirs
+size_rtems
Index: cpu
===================================================================
--- cpu (nonexistent)
+++ cpu (revision 1765)
cpu
Property changes :
Added: svn:ignore
## -0,0 +1,13 ##
+Makefile
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+missing
+mkinstalldirs
Index: Makefile.am
===================================================================
--- Makefile.am (nonexistent)
+++ Makefile.am (revision 1765)
@@ -0,0 +1,8 @@
+## $Id: Makefile.am,v 1.2 2001-09-27 12:02:53 chris Exp $
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = build cpu update
+
+include $(top_srcdir)/automake/subdirs.am
+include $(top_srcdir)/automake/host.am
Index: .
===================================================================
--- . (nonexistent)
+++ . (revision 1765)
.
Property changes :
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in