mirror of
https://github.com/t-crest/rtems.git
synced 2025-11-16 12:34:47 +00:00
Remove stray white spaces.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
##
|
||||
|
||||
## -------------------------------------------------------------------------
|
||||
## NOTE: This file is rather immature and has to be considered to be
|
||||
## NOTE: This file is rather immature and has to be considered to be
|
||||
## almost experimental.
|
||||
##
|
||||
## Expect frequent changes -- It deserves to be cleaned up :(
|
||||
@@ -12,7 +12,7 @@
|
||||
## The section below is based on make/compilers/gcc-target-default.cfg
|
||||
## used in former versions of RTEMS.
|
||||
|
||||
##
|
||||
##
|
||||
## Set up the flags for the toolchains:
|
||||
##
|
||||
## We are considering 3 different building schemes here:
|
||||
@@ -24,19 +24,19 @@
|
||||
## Automake conditionals in use:
|
||||
## RTEMS_USE_GCC .. if we are using GCC
|
||||
|
||||
## NOTES:
|
||||
## NOTES:
|
||||
## * The gcc-2.8 building scheme is the nominal building scheme and
|
||||
## is actively supported.
|
||||
## * The non-gcc building scheme requires manually setting up environment
|
||||
## * The non-gcc building scheme requires manually setting up environment
|
||||
## variables and is hardly tested at all
|
||||
|
||||
## CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we
|
||||
## would want the corresponding macros to be set to.
|
||||
##
|
||||
## CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set by the
|
||||
## CFLAGS_OPTIMIZE, CFLAGS_DEBUG are set by the
|
||||
## 'VARIANT=<OPTIMIZE|DEBUG>' targets to their _V values.
|
||||
|
||||
## XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
|
||||
## XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
|
||||
## are used to add flags from the shell
|
||||
## cf. make.info ("Implicit rules/variables" for details)
|
||||
|
||||
@@ -127,7 +127,7 @@ depend-gcc: $(C_FILES) $(CC_FILES) $(S_FILES)
|
||||
-e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
|
||||
mv $(DEPEND).tmp $(DEPEND)
|
||||
|
||||
# pull in dependencies if they exist
|
||||
# pull in dependencies if they exist
|
||||
ifeq (${DEPEND},$(wildcard ${DEPEND}))
|
||||
include ${DEPEND}
|
||||
@ENDIF@
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
## $Id$
|
||||
|
||||
## NOTE: This is a temporary work-around to keep
|
||||
## NOTE: This is a temporary work-around to keep
|
||||
## RTEMS's non automake standard make targets working.
|
||||
## Once automake is fully integrated these make targets
|
||||
## Once automake is fully integrated these make targets
|
||||
## and this file will probably be removed
|
||||
|
||||
preinstall-am: $(PREINSTALL_FILES)
|
||||
|
||||
@@ -13,4 +13,3 @@ define make-exe
|
||||
$(LINK_APP)
|
||||
endef
|
||||
@ENDIF@
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
## $Id$
|
||||
|
||||
## Borrowed from automake-1.4 and adapted to RTEMS
|
||||
## Borrowed from automake-1.4 and adapted to RTEMS
|
||||
|
||||
## NOTE: This is a temporary work-around to keep
|
||||
## NOTE: This is a temporary work-around to keep
|
||||
## RTEMS's non automake standard make targets working.
|
||||
## Once automake is fully integrated these make targets
|
||||
## Once automake is fully integrated these make targets
|
||||
## and this file will probably be removed
|
||||
|
||||
depend-recursive \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* This is a clone of sp04 which has been modified to use the cpu monitoring
|
||||
* library.
|
||||
*
|
||||
|
||||
@@ -24,15 +24,15 @@ rtems_task Init(
|
||||
rtems_task Task_1(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
rtems_task Task_2(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
rtems_task Task_3(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
void Task_switch(
|
||||
rtems_tcb *unused,
|
||||
rtems_tcb *heir
|
||||
@@ -60,9 +60,9 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Extension_id[ 4 ];
|
||||
TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */
|
||||
|
||||
|
||||
/* array of task run counts */
|
||||
TEST_EXTERN volatile uint32_t Run_count[ 4 ];
|
||||
TEST_EXTERN volatile uint32_t Run_count[ 4 ];
|
||||
|
||||
/*
|
||||
* Keep track of task switches
|
||||
@@ -77,5 +77,5 @@ extern struct taskSwitchLog taskSwitchLog[];
|
||||
extern int taskSwitchLogIndex;
|
||||
volatile extern int testsFinished;
|
||||
|
||||
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -26,7 +26,7 @@ struct taskSwitchLog taskSwitchLog[1000];
|
||||
int taskSwitchLogIndex;
|
||||
volatile int testsFinished;;
|
||||
|
||||
rtems_extension Task_switch(
|
||||
rtems_extension Task_switch(
|
||||
rtems_tcb *unused,
|
||||
rtems_tcb *heir
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This is a simple test whose only purpose is to start the Monitor
|
||||
* task. The Monitor task can be used to obtain information about
|
||||
* a variety of RTEMS objects.
|
||||
* a variety of RTEMS objects.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
|
||||
@@ -26,13 +26,13 @@ struct counters {
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
rtems_task Task_1_through_5(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
void Get_all_counters( void );
|
||||
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/* functions */
|
||||
|
||||
extern "C"
|
||||
{
|
||||
{
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
@@ -37,7 +37,7 @@ class Task1
|
||||
: public rtemsTask
|
||||
{
|
||||
void print_mode(rtems_mode mode, rtems_mode mask);
|
||||
|
||||
|
||||
void screen1(void);
|
||||
void screen2(void);
|
||||
void screen3(void);
|
||||
@@ -59,7 +59,7 @@ class Task2
|
||||
protected:
|
||||
virtual void body(rtems_task_argument argument);
|
||||
|
||||
public:
|
||||
public:
|
||||
Task2(const char* name,
|
||||
const rtems_task_priority initial_priority,
|
||||
const uint32_t stack_size);
|
||||
@@ -73,7 +73,7 @@ class Task3
|
||||
protected:
|
||||
virtual void body(rtems_task_argument argument);
|
||||
|
||||
public:
|
||||
public:
|
||||
Task3(const char* name,
|
||||
const rtems_task_priority initial_priority,
|
||||
const uint32_t stack_size);
|
||||
@@ -85,7 +85,7 @@ class EndTask
|
||||
protected:
|
||||
virtual void body(rtems_task_argument argument);
|
||||
|
||||
public:
|
||||
public:
|
||||
EndTask(const char* name,
|
||||
const rtems_task_priority initial_priority,
|
||||
const uint32_t stack_size);
|
||||
@@ -126,7 +126,7 @@ class Io_during_interrupt
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 100
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE (4 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE (4 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@ struct counters {
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
rtems_task Task_1_through_5(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
void Get_all_counters( void );
|
||||
|
||||
|
||||
/* configuration information */
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* RTEMS configuration/initialization
|
||||
*
|
||||
*
|
||||
* This program may be distributed and used for any purpose.
|
||||
* I ask only that you:
|
||||
* 1. Leave this author information intact.
|
||||
@@ -11,7 +11,7 @@
|
||||
* University of Saskatchewan
|
||||
* Saskatoon, Saskatchewan, CANADA
|
||||
* eric@skatter.usask.ca
|
||||
*
|
||||
*
|
||||
* Additions:
|
||||
* Charles-Antoine Gauthier
|
||||
* Software Engineering Group
|
||||
@@ -103,25 +103,25 @@ void print_c_oflag( struct termios * tp )
|
||||
|
||||
if( tp->c_oflag & OPOST )
|
||||
printf( "OPOST " );
|
||||
|
||||
|
||||
if( tp->c_oflag & OLCUC )
|
||||
printf( "OLCUC " );
|
||||
|
||||
|
||||
if( tp->c_oflag & ONLCR )
|
||||
printf( "ONLCR " );
|
||||
|
||||
|
||||
if( tp->c_oflag & OCRNL )
|
||||
printf( "OCRNL " );
|
||||
|
||||
|
||||
if( tp->c_oflag & ONOCR )
|
||||
printf( "ONOCR " );
|
||||
|
||||
|
||||
if( tp->c_oflag & ONLRET )
|
||||
printf( "ONLRET " );
|
||||
|
||||
|
||||
if( tp->c_oflag & OFILL )
|
||||
printf( "OFILL " );
|
||||
|
||||
|
||||
if( tp->c_oflag & OFDEL )
|
||||
printf( "OFDEL " );
|
||||
|
||||
@@ -129,73 +129,73 @@ void print_c_oflag( struct termios * tp )
|
||||
case NL0:
|
||||
printf( "NL0 " );
|
||||
break;
|
||||
|
||||
|
||||
case NL1:
|
||||
printf( "NL1 " );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch( tp->c_oflag & CRDLY ) {
|
||||
case CR0:
|
||||
printf( "CR0 " );
|
||||
break;
|
||||
|
||||
|
||||
case CR1:
|
||||
printf( "CR1 " );
|
||||
break;
|
||||
|
||||
|
||||
case CR2:
|
||||
printf( "CR2 " );
|
||||
break;
|
||||
|
||||
|
||||
case CR3:
|
||||
printf( "CR3 " );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch( tp->c_oflag & TABDLY ) {
|
||||
case TAB0:
|
||||
printf( "TAB0 " );
|
||||
break;
|
||||
|
||||
|
||||
case TAB1:
|
||||
printf( "TAB1 " );
|
||||
break;
|
||||
|
||||
|
||||
case TAB2:
|
||||
printf( "TAB2 " );
|
||||
break;
|
||||
|
||||
|
||||
case TAB3:
|
||||
printf( "TAB3 " );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch( tp->c_oflag & BSDLY ) {
|
||||
case BS0:
|
||||
printf( "BS0 " );
|
||||
break;
|
||||
|
||||
|
||||
case BS1:
|
||||
printf( "BS1 " );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch( tp->c_oflag & VTDLY ) {
|
||||
case VT0:
|
||||
printf( "VT0 " );
|
||||
break;
|
||||
|
||||
|
||||
case VT1:
|
||||
printf( "VT1 " );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch( tp->c_oflag & FFDLY ) {
|
||||
case FF0:
|
||||
printf( "FF0" );
|
||||
break;
|
||||
|
||||
|
||||
case FF1:
|
||||
printf( "FF1" );
|
||||
break;
|
||||
@@ -229,7 +229,7 @@ void print_c_lflag( struct termios * tp )
|
||||
"unknown", /* 2000000 */
|
||||
"unknown", /* 4000000 */
|
||||
};
|
||||
|
||||
|
||||
printf( "c_lflag = 0x%08x\n\t", tp->c_lflag );
|
||||
print_32bits( tp->c_lflag, sizeof( c_lflag_bits )/sizeof( char * ), c_lflag_bits );
|
||||
printf( "\n" );
|
||||
@@ -239,99 +239,99 @@ void print_c_lflag( struct termios * tp )
|
||||
void print_c_cflag( struct termios * tp )
|
||||
{
|
||||
unsigned int baud;
|
||||
|
||||
|
||||
printf( "c_cflag = 0x%08x\n", tp->c_cflag );
|
||||
|
||||
baud = (tp->c_cflag & CBAUD) ;
|
||||
#if defined(__sh2__)
|
||||
#if defined(__sh2__)
|
||||
if ( tp->c_cflag & CBAUDEX )
|
||||
#endif
|
||||
switch( baud ) {
|
||||
case B0:
|
||||
printf( "\tCBAUD =\tB0\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B50:
|
||||
printf( "\tCBAUD =\tB50\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B75:
|
||||
printf( "\tCBAUD =\tB75\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B110:
|
||||
printf( "\tCBAUD =\tB110\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B134:
|
||||
printf( "\tCBAUD =\tB134\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B150:
|
||||
printf( "\tCBAUD =\tB150\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B200:
|
||||
printf( "\tCBAUD =\tB200\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B300:
|
||||
printf( "\tCBAUD =\tB300\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B600:
|
||||
printf( "\tCBAUD =\tB600\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B1200:
|
||||
printf( "\tCBAUD =\tB1200\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B1800:
|
||||
printf( "\tCBAUD =\tB1800\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B2400:
|
||||
printf( "\tCBAUD =\tB2400\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B4800:
|
||||
printf( "\tCBAUD =\tB4800\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B9600:
|
||||
printf( "\tCBAUD =\tB9600\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B19200:
|
||||
printf( "\tCBAUD =\tB19200\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B38400:
|
||||
printf( "\tCBAUD =\tB38400\n" );
|
||||
break;
|
||||
#if defined(__sh2__)
|
||||
}
|
||||
else
|
||||
switch ( baud )
|
||||
}
|
||||
else
|
||||
switch ( baud )
|
||||
{
|
||||
#endif
|
||||
case B57600:
|
||||
printf( "\tCBAUD =\tB57600\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B115200:
|
||||
printf( "\tCBAUD =\tB115200\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B230400:
|
||||
printf( "\tCBAUD =\tB230400\n" );
|
||||
break;
|
||||
|
||||
|
||||
case B460800:
|
||||
printf( "\tCBAUD =\tB460800\n" );
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
printf( "\tCBAUD =\tunknown (0x%08x)\n", baud );
|
||||
break;
|
||||
@@ -341,15 +341,15 @@ void print_c_cflag( struct termios * tp )
|
||||
case CS5:
|
||||
printf( "\tCSIZE =\tCS5\n" );
|
||||
break;
|
||||
|
||||
|
||||
case CS6:
|
||||
printf( "\tCSIZE =\tCS6\n" );
|
||||
break;
|
||||
|
||||
|
||||
case CS7:
|
||||
printf( "\tCSIZE =\tCS7\n" );
|
||||
break;
|
||||
|
||||
|
||||
case CS8:
|
||||
printf( "\tCSIZE =\tCS8\n" );
|
||||
break;
|
||||
@@ -359,39 +359,39 @@ void print_c_cflag( struct termios * tp )
|
||||
printf( "\tCSTOPB set: send 2 stop bits\n" );
|
||||
else
|
||||
printf( "\tCSTOPB clear: send 1 stop bit\n" );
|
||||
|
||||
|
||||
if( tp->c_cflag & PARENB )
|
||||
printf( "\tPARENB set: parity enabled\n" );
|
||||
else
|
||||
printf( "\tPARENB clear: parity disabled\n" );
|
||||
|
||||
|
||||
if( tp->c_cflag & PARODD )
|
||||
printf( "\tPARODD set: parity odd\n" );
|
||||
else
|
||||
printf( "\tPARODD clear: parity even\n" );
|
||||
|
||||
|
||||
if( tp->c_cflag & CREAD )
|
||||
printf( "\tCREAD set: receiver enabled\n" );
|
||||
else
|
||||
printf( "\tCREAD clear: treceiver disabled\n" );
|
||||
|
||||
|
||||
if( tp->c_cflag & HUPCL )
|
||||
printf( "\tHUPCL set: enabled\n" );
|
||||
else
|
||||
printf( "\tHUPCL clear: disabled\n" );
|
||||
|
||||
|
||||
if( tp->c_cflag & CLOCAL )
|
||||
printf( "\tCLOCAL set: ignore modem lines\n" );
|
||||
else
|
||||
printf( "\tCLOCAL clear: don't ignore modem lines\n" );
|
||||
|
||||
|
||||
#if defined(CBAUDEX)
|
||||
if( tp->c_cflag & CBAUDEX )
|
||||
printf( "\tCBAUDEX set: What does this do?\n" );
|
||||
else
|
||||
printf( "\tCBAUDEX clear: What does this do?\n" );
|
||||
#endif
|
||||
|
||||
|
||||
if( tp->c_cflag & CRTSCTS )
|
||||
printf( "\tCRTSCTS: harware flow control enabled?\n" );
|
||||
else
|
||||
@@ -445,7 +445,7 @@ void print_termios( struct termios *tp )
|
||||
unsigned long get_baud_rate( void )
|
||||
{
|
||||
unsigned long baud_rate;
|
||||
|
||||
|
||||
while( TRUE ) {
|
||||
printf( "Enter the numerical value for the new baud rate.\n" );
|
||||
printf( "Choices are: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800\n" );
|
||||
@@ -485,7 +485,7 @@ unsigned long get_baud_rate( void )
|
||||
unsigned long get_parity()
|
||||
{
|
||||
int parity;
|
||||
|
||||
|
||||
while( TRUE ) {
|
||||
printf( "Enter the numerical value for the new parity\n" );
|
||||
printf( "Choices are: 0 for no parity, 1 for even parity, 2 for odd parity\n" );
|
||||
@@ -523,7 +523,7 @@ unsigned long get_stop_bits()
|
||||
switch( stop_bits ) {
|
||||
case 1:
|
||||
return 0;
|
||||
|
||||
|
||||
case 2:
|
||||
return CSTOPB;
|
||||
|
||||
@@ -548,13 +548,13 @@ unsigned long get_data_bits()
|
||||
switch( data_bits ) {
|
||||
case 5:
|
||||
return CS5;
|
||||
|
||||
|
||||
case 6:
|
||||
return CS6;
|
||||
|
||||
|
||||
case 7:
|
||||
return CS7;
|
||||
|
||||
|
||||
case 8:
|
||||
return CS8;
|
||||
|
||||
@@ -569,9 +569,9 @@ unsigned long get_data_bits()
|
||||
void change_line_settings( struct termios *tp )
|
||||
{
|
||||
unsigned long baud_rate, parity, stop_bits, data_bits, sleep_time;
|
||||
|
||||
|
||||
printf( "\nSetting line characteristics\n\n" );
|
||||
|
||||
|
||||
baud_rate = get_baud_rate();
|
||||
parity = get_parity();
|
||||
stop_bits = get_stop_bits();
|
||||
@@ -587,7 +587,7 @@ void change_line_settings( struct termios *tp )
|
||||
printf( "Setting line to new termios settings in %lu seconds.\n", sleep_time );
|
||||
|
||||
sleep( sleep_time );
|
||||
|
||||
|
||||
tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits | baud_rate;
|
||||
if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) {
|
||||
perror( "change_line_settings(): tcsetattr() failed" );
|
||||
@@ -600,17 +600,17 @@ void change_line_settings( struct termios *tp )
|
||||
void canonical_input( struct termios *tp )
|
||||
{
|
||||
char c, first_time = TRUE;
|
||||
|
||||
|
||||
printf( "\nTesting canonical input\n\n" );
|
||||
|
||||
printf( "Setting line to canonical input mode.\n" );
|
||||
tp->c_lflag = ISIG | ICANON | ECHO | ECHONL | ECHOK | ECHOE | ECHOPRT | ECHOCTL | IEXTEN;
|
||||
tp->c_lflag = ISIG | ICANON | ECHO | ECHONL | ECHOK | ECHOE | ECHOPRT | ECHOCTL | IEXTEN;
|
||||
tp->c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
|
||||
if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) {
|
||||
perror( "canonical_input(): tcsetattr() failed" );
|
||||
rtems_test_exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
while ( ( c = getchar () ) != '\n');
|
||||
printf( "Testing getchar(). Type some text followed by carriage return\n" );
|
||||
printf( "Each character you entered will be echoed back to you\n\n" );
|
||||
@@ -639,13 +639,13 @@ void do_raw_input( int vmin, int vtime )
|
||||
unsigned char cbuf[100];
|
||||
|
||||
printf( "Raw input test with VMIN=%d VTIME=%d\n", vmin, vtime );
|
||||
|
||||
|
||||
rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond );
|
||||
if ( tcgetattr( fileno ( stdin ), &old ) < 0 ) {
|
||||
perror( "do_raw_input(): tcgetattr() failed" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
new = old;
|
||||
new.c_lflag &= ~( ICANON | ECHO | ECHONL | ECHOK | ECHOE | ECHOPRT | ECHOCTL );
|
||||
new.c_cc[VMIN] = vmin;
|
||||
@@ -654,7 +654,7 @@ void do_raw_input( int vmin, int vtime )
|
||||
perror ("do_raw_input(): tcsetattr() failed" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
do {
|
||||
rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then );
|
||||
count = 0;
|
||||
@@ -672,17 +672,17 @@ void do_raw_input( int vmin, int vtime )
|
||||
msec = (now - then) * 1000 / ticksPerSecond;
|
||||
printf( "Count:%-10lu Interval:%3u.%3.3d Char:",
|
||||
count, msec / 1000, msec % 1000 );
|
||||
|
||||
|
||||
for( i = 0 ; i < nread ; i++ )
|
||||
printf (" 0x%2.2x", cbuf[i]);
|
||||
printf ("\n");
|
||||
|
||||
|
||||
} while( cbuf[0] != 'q' );
|
||||
|
||||
|
||||
out:
|
||||
if( tcsetattr( fileno( stdin ), TCSADRAIN, &old) < 0 )
|
||||
perror("do_raw_input(): tcsetattr() failed: %s\n" );
|
||||
|
||||
|
||||
printf ("*** End of Raw input VMIN=%d VTIME=%d ***\n", vmin, vtime);
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ static void raw_input( struct termios *tp )
|
||||
do_raw_input( 0, 20 );
|
||||
do_raw_input( 5, 0 );
|
||||
do_raw_input( 5, 20 );
|
||||
|
||||
|
||||
printf( "\nRaw input test done.\n" );
|
||||
}
|
||||
|
||||
@@ -722,7 +722,7 @@ Init (rtems_task_argument ignored)
|
||||
{
|
||||
char c ;
|
||||
struct termios orig_termios, test_termios;
|
||||
|
||||
|
||||
printf( "\n\n*** TEST OF TERMIOS INPUT CAPABILITIES ***\n" );
|
||||
|
||||
if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) {
|
||||
@@ -770,7 +770,7 @@ Init (rtems_task_argument ignored)
|
||||
|
||||
case '\n':
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
printf( "\n%c is not a valid choice. Try again\n\n", c );
|
||||
usage();
|
||||
|
||||
@@ -26,12 +26,12 @@ rtems_task Test_task(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 4
|
||||
|
||||
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_GLOBAL
|
||||
|
||||
@@ -26,14 +26,14 @@ rtems_task Test_task(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -29,14 +29,14 @@ rtems_timer_service_routine Delayed_send_event(
|
||||
rtems_id ignored_id,
|
||||
void *ignored_address
|
||||
);
|
||||
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||
|
||||
@@ -51,8 +51,8 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Timer_id[ 2 ]; /* array of timer ids */
|
||||
TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */
|
||||
|
||||
|
||||
TEST_EXTERN uint32_t remote_node;
|
||||
TEST_EXTERN rtems_id remote_tid;
|
||||
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -26,12 +26,12 @@ rtems_task Test_task(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ rtems_task Test_task(
|
||||
rtems_asr Process_asr( rtems_signal_set );
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||
|
||||
@@ -50,14 +50,14 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Timer_id[ 2 ]; /* array of timer ids */
|
||||
TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */
|
||||
|
||||
|
||||
TEST_EXTERN volatile rtems_boolean Stop_Test;
|
||||
|
||||
|
||||
TEST_EXTERN uint32_t remote_node;
|
||||
TEST_EXTERN rtems_id remote_tid;
|
||||
TEST_EXTERN rtems_signal_set remote_signal;
|
||||
TEST_EXTERN rtems_signal_set expected_signal;
|
||||
TEST_EXTERN volatile uint32_t signal_count;
|
||||
TEST_EXTERN volatile uint32_t signal_caught;
|
||||
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -26,12 +26,12 @@ rtems_task Test_task(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||
|
||||
@@ -46,7 +46,7 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Timer_id[ 4 ]; /* array of timer ids */
|
||||
TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */
|
||||
|
||||
|
||||
TEST_EXTERN volatile rtems_boolean Stop_Test;
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -26,12 +26,12 @@ rtems_task Test_task(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||
|
||||
@@ -46,7 +46,7 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Timer_id[ 4 ]; /* array of timer ids */
|
||||
TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */
|
||||
|
||||
|
||||
TEST_EXTERN volatile rtems_boolean Stop_Test;
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -26,12 +26,12 @@ rtems_task Test_task(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
|
||||
@@ -30,12 +30,12 @@ void Receive_messages( void );
|
||||
void Send_messages( void );
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_TIMERS 1
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
@@ -51,7 +51,7 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Queue_id[ 2 ]; /* array of message queue ids */
|
||||
TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */
|
||||
|
||||
|
||||
extern char buffer1[16];
|
||||
extern char buffer2[16];
|
||||
extern char buffer3[16];
|
||||
|
||||
@@ -20,26 +20,26 @@
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
rtems_task Test_task1(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
rtems_task Test_task2(
|
||||
rtems_task_argument argument
|
||||
);
|
||||
|
||||
|
||||
rtems_task Test_task3(
|
||||
rtems_task_argument restart
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#if ( NODE_NUMBER == 1 )
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
|
||||
@@ -22,15 +22,15 @@ rtems_task Init(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 0
|
||||
#define CONFIGURE_MP_MAXIMUM_PROXIES 0
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
#if ( NODE_NUMBER == 1 )
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
@@ -49,7 +49,7 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Queue_id[ 2 ]; /* array of message queue ids */
|
||||
TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */
|
||||
|
||||
|
||||
TEST_EXTERN rtems_id Semaphore_id[ 2 ]; /* array of semaphore ids */
|
||||
TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */
|
||||
|
||||
|
||||
@@ -24,15 +24,15 @@ rtems_task Init(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 1
|
||||
#define CONFIGURE_MP_MAXIMUM_PROXIES 0
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 1
|
||||
#if ( NODE_NUMBER == 1 )
|
||||
#define CONFIGURE_MAXIMUM_PARTITIONS 1
|
||||
|
||||
@@ -30,9 +30,9 @@ rtems_task Test_task2(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
@@ -53,7 +53,7 @@ TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
TEST_EXTERN rtems_id Queue_id[ 2 ]; /* array of message queue ids */
|
||||
TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */
|
||||
|
||||
|
||||
TEST_EXTERN rtems_id Semaphore_id[ 2 ]; /* array of semaphore ids */
|
||||
TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ void Exit_test( void )
|
||||
* Wait a bit before shutting down so we don't screw up the other node
|
||||
* when our MPCI shuts down
|
||||
*/
|
||||
|
||||
|
||||
rtems_task_wake_after(20);
|
||||
|
||||
|
||||
status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode );
|
||||
directive_failed( status, "rtems_task_mode" );
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@ rtems_task Semaphore_task(
|
||||
void Exit_test( void );
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 1
|
||||
#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1)
|
||||
|
||||
|
||||
@@ -26,14 +26,14 @@ rtems_task Application_task(
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#include <bsp.h> /* for device driver prototypes */
|
||||
|
||||
#define CONFIGURE_MP_APPLICATION
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
@@ -203,12 +203,12 @@ void fileio_list_file(void)
|
||||
flen += n;
|
||||
}
|
||||
} while (n > 0);
|
||||
|
||||
|
||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &curr_tick);
|
||||
|
||||
|
||||
printf("\n ******** End of file reached, flen = %d\n",flen);
|
||||
close(fd);
|
||||
|
||||
|
||||
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_sec);
|
||||
printf("time elapsed for read: %g seconds\n",
|
||||
((double)curr_tick-start_tick)/ticks_per_sec);
|
||||
@@ -262,11 +262,11 @@ void fileio_write_file(void)
|
||||
rtems_interval start_tick,curr_tick,ticks_per_sec;
|
||||
char *bufptr = NULL;
|
||||
boolean failed = FALSE;
|
||||
static const char write_test_string[] =
|
||||
static const char write_test_string[] =
|
||||
"The quick brown fox jumps over the lazy dog\n";
|
||||
static const char write_block_string[] =
|
||||
static const char write_block_string[] =
|
||||
"\n----- end of write buffer ------\n";
|
||||
|
||||
|
||||
printf(" =========================\n");
|
||||
printf(" WRITE FILE ... \n");
|
||||
printf(" =========================\n");
|
||||
@@ -370,7 +370,7 @@ void fileio_write_file(void)
|
||||
printf("... writing to file\n");
|
||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start_tick);
|
||||
curr_pos = 0;
|
||||
do {
|
||||
do {
|
||||
bytes_to_copy = buf_size;
|
||||
do {
|
||||
n = write(fd,
|
||||
@@ -422,7 +422,7 @@ void fileio_read_file(void)
|
||||
rtems_interval start_tick,curr_tick,ticks_per_sec;
|
||||
char *bufptr = NULL;
|
||||
boolean failed = FALSE;
|
||||
|
||||
|
||||
printf(" =========================\n");
|
||||
printf(" READ FILE ... \n");
|
||||
printf(" =========================\n");
|
||||
@@ -489,7 +489,7 @@ void fileio_read_file(void)
|
||||
printf("... reading from file\n");
|
||||
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start_tick);
|
||||
curr_pos = 0;
|
||||
do {
|
||||
do {
|
||||
n = read(fd,
|
||||
bufptr,
|
||||
buf_size);
|
||||
@@ -511,7 +511,7 @@ void fileio_read_file(void)
|
||||
printf("time elapsed for read: %g seconds\n",
|
||||
((double)curr_tick-start_tick)/ticks_per_sec);
|
||||
printf("read data rate: %g KBytes/second\n",
|
||||
(((double)curr_pos) / 1024.0 /
|
||||
(((double)curr_pos) / 1024.0 /
|
||||
(((double)curr_tick-start_tick)/ticks_per_sec)));
|
||||
}
|
||||
}
|
||||
@@ -554,30 +554,30 @@ void fileio_menu (void)
|
||||
fgets(inbuf,sizeof(inbuf),stdin);
|
||||
switch (inbuf[0]) {
|
||||
case 'l':
|
||||
fileio_list_file ();
|
||||
fileio_list_file ();
|
||||
break;
|
||||
case 'r':
|
||||
fileio_read_file ();
|
||||
fileio_read_file ();
|
||||
break;
|
||||
case 'w':
|
||||
fileio_write_file ();
|
||||
fileio_write_file ();
|
||||
break;
|
||||
case 'p':
|
||||
fileio_part_table_initialize ();
|
||||
fileio_part_table_initialize ();
|
||||
break;
|
||||
case 'f':
|
||||
fileio_fsmount ();
|
||||
fileio_fsmount ();
|
||||
break;
|
||||
#ifdef USE_SHELL
|
||||
case 's':
|
||||
fileio_start_shell ();
|
||||
fileio_start_shell ();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
printf("Selection `%c` not implemented\n",inbuf[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ rtems_driver_address_table Device_drivers[] =
|
||||
#ifdef RTEMS_BSP_HAS_IDE_DRIVER
|
||||
,IDE_CONTROLLER_DRIVER_TABLE_ENTRY
|
||||
/* important: ATA driver must be after ide drivers */
|
||||
,ATA_DRIVER_TABLE_ENTRY
|
||||
,ATA_DRIVER_TABLE_ENTRY
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ rtems_task Test_task(
|
||||
|
||||
/*
|
||||
* Keep the names and IDs in global variables so another task can use them.
|
||||
*/
|
||||
*/
|
||||
|
||||
extern rtems_id Task_id[ 4 ]; /* array of task ids */
|
||||
extern rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
@@ -40,23 +40,23 @@ rtems_task Init(
|
||||
uint32_t task;
|
||||
|
||||
/* lower the task priority to allow created tasks to execute */
|
||||
|
||||
|
||||
rtems_task_set_priority(RTEMS_SELF, 20, &old_priority);
|
||||
rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode);
|
||||
|
||||
|
||||
printf( "\n*** UNLIMITED TASK TEST ***\n" );
|
||||
|
||||
/*
|
||||
* Invalid state if the task id is 0
|
||||
*/
|
||||
|
||||
|
||||
for (task = 0; task < MAX_TASKS; task++)
|
||||
task_id[task] = 0;
|
||||
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
|
||||
|
||||
printf( "\n*** END OF UNLIMITED TASK TEST ***\n" );
|
||||
exit( 0 );
|
||||
}
|
||||
@@ -66,11 +66,11 @@ rtems_task test_task(
|
||||
)
|
||||
{
|
||||
rtems_event_set out;
|
||||
|
||||
|
||||
printf( "task %i has started.\n", my_number);
|
||||
|
||||
rtems_event_receive(1, RTEMS_WAIT | RTEMS_EVENT_ANY, 0, &out);
|
||||
|
||||
|
||||
printf( "task %i ending.\n", my_number);
|
||||
|
||||
rtems_task_delete(RTEMS_SELF);
|
||||
@@ -81,11 +81,11 @@ void destory_all_tasks(
|
||||
)
|
||||
{
|
||||
uint32_t task;
|
||||
|
||||
|
||||
/*
|
||||
* If the id is not zero, signal the task to delete.
|
||||
*/
|
||||
|
||||
|
||||
for (task = 0; task < MAX_TASKS; task++)
|
||||
if (task_id[task])
|
||||
{
|
||||
@@ -103,15 +103,15 @@ boolean status_code_bad(
|
||||
if (status_code != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
printf("failure, ");
|
||||
|
||||
|
||||
if (status_code == RTEMS_TOO_MANY)
|
||||
{
|
||||
printf("too many.\n");
|
||||
printf("too many.\n");
|
||||
return TRUE;
|
||||
}
|
||||
if (status_code == RTEMS_UNSATISFIED)
|
||||
{
|
||||
printf("unsatisfied.\n");
|
||||
printf("unsatisfied.\n");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ void test1()
|
||||
rtems_status_code result;
|
||||
uint32_t task_count = 0;
|
||||
Objects_Information *the_information;
|
||||
|
||||
|
||||
char c1 = 'a';
|
||||
char c2 = 'a';
|
||||
char c3 = '0';
|
||||
char c4 = '0';
|
||||
|
||||
|
||||
printf( "\n TEST1 : auto-extend disabled.\n" );
|
||||
|
||||
/*
|
||||
@@ -41,17 +41,17 @@ void test1()
|
||||
* saves having another test.
|
||||
*/
|
||||
|
||||
the_information =
|
||||
the_information =
|
||||
_Objects_Information_table[OBJECTS_CLASSIC_API][OBJECTS_RTEMS_TASKS];
|
||||
auto_extend = the_information->auto_extend;
|
||||
the_information->auto_extend = FALSE;
|
||||
|
||||
|
||||
while (task_count < MAX_TASKS)
|
||||
{
|
||||
rtems_name name;
|
||||
|
||||
printf(" TEST1 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
|
||||
|
||||
|
||||
name = rtems_build_name(c1, c2, c3, c4);
|
||||
|
||||
result = rtems_task_create(name,
|
||||
@@ -63,29 +63,29 @@ void test1()
|
||||
|
||||
if (status_code_bad(result))
|
||||
break;
|
||||
|
||||
|
||||
printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]);
|
||||
|
||||
|
||||
fflush(stdout);
|
||||
result = rtems_task_start(task_id[task_count],
|
||||
test_task,
|
||||
(rtems_task_argument) task_count);
|
||||
|
||||
|
||||
if (status_code_bad(result))
|
||||
break;
|
||||
|
||||
|
||||
/*
|
||||
* Update the name.
|
||||
*/
|
||||
|
||||
|
||||
NEXT_TASK_NAME(c1, c2, c3, c4);
|
||||
|
||||
|
||||
task_count++;
|
||||
}
|
||||
|
||||
if (task_count >= MAX_TASKS)
|
||||
printf( "\nMAX_TASKS too small for work-space size, please make larger !!\n\n" );
|
||||
|
||||
|
||||
if (task_count != (TASK_ALLOCATION_SIZE - 1)) {
|
||||
printf( " FAIL1 : the number of tasks does not equal the expected size -\n"
|
||||
" task created = %i, required number = %i\n",
|
||||
@@ -94,8 +94,8 @@ void test1()
|
||||
}
|
||||
|
||||
destory_all_tasks("TEST1");
|
||||
|
||||
|
||||
the_information->auto_extend = auto_extend;
|
||||
|
||||
|
||||
printf( " TEST1 : completed\n" );
|
||||
}
|
||||
|
||||
@@ -32,25 +32,25 @@ void test2()
|
||||
uint32_t block;
|
||||
uint32_t task_count = 0;
|
||||
rtems_id removed_ids[TASK_ALLOCATION_SIZE * 2];
|
||||
|
||||
|
||||
char c1 = 'a';
|
||||
char c2 = 'a';
|
||||
char c3 = '0';
|
||||
char c4 = '0';
|
||||
|
||||
|
||||
printf( "\n TEST2 : re-allocate of index numbers, and a block free'ed and one inactive\n" );
|
||||
|
||||
/*
|
||||
* Allocate enought tasks so the Inactive list is empty. Remember
|
||||
* to count the Init task, ie ... - 1.
|
||||
*/
|
||||
|
||||
|
||||
while (task_count < ((TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET))
|
||||
{
|
||||
rtems_name name;
|
||||
|
||||
printf(" TEST2 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
|
||||
|
||||
|
||||
name = rtems_build_name(c1, c2, c3, c4);
|
||||
|
||||
result = rtems_task_create(name,
|
||||
@@ -62,23 +62,23 @@ void test2()
|
||||
|
||||
if (status_code_bad(result))
|
||||
break;
|
||||
|
||||
|
||||
printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]);
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
result = rtems_task_start(task_id[task_count],
|
||||
test_task,
|
||||
(rtems_task_argument) task_count);
|
||||
|
||||
|
||||
if (status_code_bad(result))
|
||||
break;
|
||||
|
||||
|
||||
/*
|
||||
* Update the name.
|
||||
*/
|
||||
|
||||
|
||||
NEXT_TASK_NAME(c1, c2, c3, c4);
|
||||
|
||||
|
||||
task_count++;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ void test2()
|
||||
}
|
||||
|
||||
task = 0;
|
||||
|
||||
|
||||
for (block = 1; block < 4; block += 2)
|
||||
{
|
||||
for (remove_task = (block * TASK_ALLOCATION_SIZE) - TASK_INDEX_OFFSET;
|
||||
@@ -114,9 +114,9 @@ void test2()
|
||||
/*
|
||||
* Save the id's to match them against the reallocated ids
|
||||
*/
|
||||
|
||||
|
||||
removed_ids[task++] = task_id[remove_task];
|
||||
|
||||
|
||||
printf(" TEST2 : block %i remove, signal task %08x, ", block, task_id[remove_task]);
|
||||
rtems_event_send(task_id[remove_task], 1);
|
||||
task_id[remove_task] = 0;
|
||||
@@ -135,7 +135,7 @@ void test2()
|
||||
for (id_slot = 0; id_slot < MAX_TASKS; id_slot++)
|
||||
if (!task_id[id_slot])
|
||||
break;
|
||||
|
||||
|
||||
if (id_slot == MAX_TASKS)
|
||||
{
|
||||
printf( " FAIL2 : no free task id slot.\n");
|
||||
@@ -144,7 +144,7 @@ void test2()
|
||||
}
|
||||
|
||||
printf(" TEST2 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
|
||||
|
||||
|
||||
name = rtems_build_name(c1, c2, c3, c4);
|
||||
|
||||
result = rtems_task_create(name,
|
||||
@@ -153,7 +153,7 @@ void test2()
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
RTEMS_LOCAL,
|
||||
&task_id[id_slot]);
|
||||
|
||||
|
||||
if (status_code_bad(result))
|
||||
{
|
||||
printf( " FAIL2 : re-creating a task -\n"
|
||||
@@ -162,13 +162,13 @@ void test2()
|
||||
destory_all_tasks("TEST2");
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
printf("number = %3i, id = %08x, starting, ", task_count, task_id[id_slot]);
|
||||
|
||||
|
||||
result = rtems_task_start(task_id[id_slot],
|
||||
test_task,
|
||||
(rtems_task_argument) task_count);
|
||||
|
||||
|
||||
if (status_code_bad(result))
|
||||
{
|
||||
printf( " FAIL : re-starting a task -\n"
|
||||
@@ -177,17 +177,17 @@ void test2()
|
||||
destory_all_tasks("TEST2");
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Update the name.
|
||||
*/
|
||||
|
||||
|
||||
NEXT_TASK_NAME(c1, c2, c3, c4);
|
||||
|
||||
|
||||
/*
|
||||
* Search the removed ids to see if it existed, clear the removed id when found
|
||||
*/
|
||||
|
||||
|
||||
for (remove_task = 0; remove_task < (TASK_ALLOCATION_SIZE * 2); remove_task++)
|
||||
if (removed_ids[remove_task] == task_id[id_slot])
|
||||
{
|
||||
@@ -199,11 +199,11 @@ void test2()
|
||||
* If not located in the removed id table, check and make sure it is not
|
||||
* already allocated
|
||||
*/
|
||||
|
||||
|
||||
if (remove_task == (TASK_ALLOCATION_SIZE * 2))
|
||||
{
|
||||
uint32_t allocated_id;
|
||||
|
||||
|
||||
for (allocated_id = 0; allocated_id < MAX_TASKS; allocated_id++)
|
||||
if ((task_id[id_slot] == task_id[allocated_id]) && (id_slot != allocated_id))
|
||||
{
|
||||
@@ -212,7 +212,7 @@ void test2()
|
||||
task_id[id_slot]);
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
printf( " FAIL2 : could not find the task id in the removed table -\n"
|
||||
" task id = %08x\n",
|
||||
task_id[id_slot]);
|
||||
@@ -221,8 +221,8 @@ void test2()
|
||||
|
||||
task_count++;
|
||||
}
|
||||
|
||||
|
||||
destory_all_tasks("TEST2");
|
||||
|
||||
|
||||
printf( " TEST2 : completed\n" );
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ void test3()
|
||||
uint32_t remove_task;
|
||||
uint32_t block;
|
||||
uint32_t task_count = 0;
|
||||
|
||||
|
||||
char c1 = 'a';
|
||||
char c2 = 'a';
|
||||
char c3 = '0';
|
||||
char c4 = '0';
|
||||
|
||||
|
||||
printf( "\n TEST3 : free more than 3 x allocation size, but not the same block,\n"
|
||||
" then free a block\n");
|
||||
|
||||
@@ -48,17 +48,17 @@ void test3()
|
||||
printf( " FAIL3 : task allocation size must be greater than 4.\n");
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Allocate as many tasks as possible.
|
||||
*/
|
||||
|
||||
|
||||
while (task_count < MAX_TASKS)
|
||||
{
|
||||
rtems_name name;
|
||||
|
||||
printf(" TEST3 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
|
||||
|
||||
|
||||
name = rtems_build_name(c1, c2, c3, c4);
|
||||
|
||||
result = rtems_task_create(name,
|
||||
@@ -70,23 +70,23 @@ void test3()
|
||||
|
||||
if (status_code_bad(result))
|
||||
break;
|
||||
|
||||
|
||||
printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]);
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
result = rtems_task_start(task_id[task_count],
|
||||
test_task,
|
||||
(rtems_task_argument) task_count);
|
||||
|
||||
|
||||
if (status_code_bad(result))
|
||||
break;
|
||||
|
||||
|
||||
/*
|
||||
* Update the name.
|
||||
*/
|
||||
|
||||
|
||||
NEXT_TASK_NAME(c1, c2, c3, c4);
|
||||
|
||||
|
||||
task_count++;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void test3()
|
||||
* Remove a complete block, not the first, forces a scan of the blocks in the
|
||||
* allocator's free routine
|
||||
*/
|
||||
|
||||
|
||||
for (remove_task = (TASK_ALLOCATION_SIZE - TASK_INDEX_OFFSET);
|
||||
remove_task < ((TASK_ALLOCATION_SIZE * 2) - - TASK_INDEX_OFFSET);
|
||||
remove_task++)
|
||||
@@ -139,8 +139,8 @@ void test3()
|
||||
task_id[remove_task] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
destory_all_tasks("TEST3");
|
||||
|
||||
|
||||
printf( " TEST3 : completed\n" );
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Support for running the test output through a buffer
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,7 @@ extern "C" {
|
||||
#undef printf
|
||||
#define printf(...) \
|
||||
do { \
|
||||
iprintf( __VA_ARGS__); \
|
||||
iprintf( __VA_ARGS__); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
@@ -58,7 +58,7 @@ void _test_output_flush(void);
|
||||
#define printf(...) \
|
||||
do { \
|
||||
char _buffer[128]; \
|
||||
sprintf( _buffer, __VA_ARGS__); \
|
||||
sprintf( _buffer, __VA_ARGS__); \
|
||||
_test_output_append( _buffer ); \
|
||||
} while (0)
|
||||
|
||||
@@ -66,7 +66,7 @@ void _test_output_flush(void);
|
||||
#define puts(_string) \
|
||||
do { \
|
||||
char _buffer[128]; \
|
||||
sprintf( _buffer, "%s\n", _string ); \
|
||||
sprintf( _buffer, "%s\n", _string ); \
|
||||
_test_output_append( _buffer ); \
|
||||
} while (0)
|
||||
|
||||
@@ -90,7 +90,7 @@ int _test_output_buffer_index = 0;
|
||||
void _test_output_append(char *_buffer)
|
||||
{
|
||||
char *p;
|
||||
|
||||
|
||||
for ( p=_buffer ; *p ; p++ ) {
|
||||
_test_output_buffer[_test_output_buffer_index++] = *p;
|
||||
_test_output_buffer[_test_output_buffer_index] = '\0';
|
||||
@@ -101,7 +101,7 @@ void _test_output_append(char *_buffer)
|
||||
_test_output_buffer[0] = '\0';
|
||||
}
|
||||
#endif
|
||||
if ( _test_output_buffer_index >= (_TEST_OUTPUT_BUFFER_SIZE - 80) )
|
||||
if ( _test_output_buffer_index >= (_TEST_OUTPUT_BUFFER_SIZE - 80) )
|
||||
_test_output_flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ extern "C" {
|
||||
#define FOREVER 1 /* infinite loop */
|
||||
|
||||
#ifdef TEST_INIT
|
||||
#define TEST_EXTERN
|
||||
#define TEST_EXTERN
|
||||
#define CONFIGURE_INIT
|
||||
#else
|
||||
#define TEST_EXTERN extern
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
FLUSH_OUTPUT(); \
|
||||
rtems_test_exit( 1 ); \
|
||||
} \
|
||||
} while ( 0 )
|
||||
} while ( 0 )
|
||||
|
||||
/*
|
||||
* These macros properly report errors within the Classic API
|
||||
@@ -83,7 +83,7 @@ extern "C" {
|
||||
do { \
|
||||
check_dispatch_disable_level( _level ); \
|
||||
fatal_directive_check_status_only( _stat, _desired, _msg ); \
|
||||
} while ( 0 )
|
||||
} while ( 0 )
|
||||
|
||||
/*
|
||||
* These macros properly report errors from the POSIX API
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* How many times a particular operation is performed while timed.
|
||||
*/
|
||||
|
||||
#ifndef OPERATION_COUNT
|
||||
#ifndef OPERATION_COUNT
|
||||
#define OPERATION_COUNT 100
|
||||
#endif
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ void ITRON_Init( void )
|
||||
* time one invocation of del_sem
|
||||
*/
|
||||
|
||||
Timer_initialize();
|
||||
Timer_initialize();
|
||||
(void) del_sem( 1 );
|
||||
end_time = Read_timer();
|
||||
put_time(
|
||||
@@ -107,8 +107,8 @@ void ITRON_Init( void )
|
||||
/*
|
||||
* time sig_sem (no waiting tasks)
|
||||
*/
|
||||
|
||||
Timer_initialize();
|
||||
|
||||
Timer_initialize();
|
||||
for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
|
||||
(void) sig_sem( 1 );
|
||||
end_time = Read_timer();
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (4 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 3
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE)
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -118,7 +118,7 @@ rtems_task High_task(
|
||||
)
|
||||
{
|
||||
uint32_t size;
|
||||
|
||||
|
||||
Timer_initialize();
|
||||
(void) rtems_message_queue_receive(
|
||||
Queue_id,
|
||||
@@ -134,7 +134,7 @@ rtems_task Middle_tasks(
|
||||
)
|
||||
{
|
||||
uint32_t size;
|
||||
|
||||
|
||||
(void) rtems_message_queue_receive(
|
||||
Queue_id,
|
||||
(long (*)[4]) Buffer,
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -132,7 +132,7 @@ rtems_task High_task(
|
||||
)
|
||||
{
|
||||
uint32_t size;
|
||||
|
||||
|
||||
(void) rtems_message_queue_receive(
|
||||
Queue_id,
|
||||
(long (*)[4]) Buffer,
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 4
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,7 +25,7 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
|
||||
@@ -34,7 +34,7 @@ rtems_task Init(
|
||||
#define CONFIGURE_MAXIMUM_PARTITIONS 1
|
||||
#define CONFIGURE_MAXIMUM_REGIONS 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,7 +25,7 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
@@ -39,7 +39,7 @@ rtems_task Init(
|
||||
#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT
|
||||
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 4
|
||||
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (1 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_TIMERS OPERATION_COUNT
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (6 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_SEMAPHORES 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -197,15 +197,15 @@ rtems_task High_task(
|
||||
Timer_initialize();
|
||||
rtems_interrupt_disable( level );
|
||||
isr_disable_time = Read_timer();
|
||||
|
||||
|
||||
Timer_initialize();
|
||||
rtems_interrupt_flash( level );
|
||||
isr_flash_time = Read_timer();
|
||||
|
||||
|
||||
Timer_initialize();
|
||||
rtems_interrupt_enable( level );
|
||||
isr_enable_time = Read_timer();
|
||||
|
||||
|
||||
Timer_initialize();
|
||||
_Thread_Disable_dispatch();
|
||||
thread_disable_dispatch_time = Read_timer();
|
||||
@@ -445,7 +445,7 @@ void complete_test( void )
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
put_time(
|
||||
"_ISR_Enable",
|
||||
isr_enable_time,
|
||||
@@ -453,7 +453,7 @@ void complete_test( void )
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
put_time(
|
||||
"_Thread_Disable_dispatch",
|
||||
thread_disable_dispatch_time,
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 3
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* WARNING!!!!!!!!!
|
||||
* WARNING!!!!!!!!!
|
||||
*
|
||||
* THIS TEST USES INTERNAL RTEMS VARIABLES!!!
|
||||
*/
|
||||
@@ -189,7 +189,7 @@ rtems_task Task_1(
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: When this task is executing, some of the assumptions made
|
||||
* NOTE: When this task is executing, some of the assumptions made
|
||||
* regarding the placement of the currently executing task's TCB
|
||||
* on the ready chains have been violated. At least the assumption
|
||||
* that this task is at the head of the chain for its priority
|
||||
@@ -228,9 +228,9 @@ rtems_task Task_2(
|
||||
*/
|
||||
|
||||
_Thread_Dispatch_disable_level = 0;
|
||||
|
||||
|
||||
_Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].first;
|
||||
|
||||
|
||||
_Context_Switch_necessary = 1;
|
||||
|
||||
_Thread_Dispatch();
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_MAXIMUM_PORTS 1
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -25,14 +25,14 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
|
||||
#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)
|
||||
|
||||
|
||||
@@ -25,13 +25,13 @@ rtems_task Init(
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -35,7 +35,7 @@ rtems_task Init(
|
||||
rtems_status_code status;
|
||||
|
||||
/*
|
||||
* Tell the Timer Driver what we are doing
|
||||
* Tell the Timer Driver what we are doing
|
||||
*/
|
||||
|
||||
Set_find_average_overhead( 1 );
|
||||
@@ -152,12 +152,12 @@ void check_read_timer()
|
||||
end_time = Read_timer();
|
||||
if ( end_time > MAXIMUM_DISTRIBUTION ) {
|
||||
/*
|
||||
* Under UNIX a simple process swap takes longer than we
|
||||
* Under UNIX a simple process swap takes longer than we
|
||||
* consider valid for our testing purposes.
|
||||
*/
|
||||
printf( "TOO LONG (%d) at index %d!!!\n", end_time, index );
|
||||
#if defined(unix)
|
||||
index--;
|
||||
index--;
|
||||
continue;
|
||||
#else
|
||||
rtems_test_exit( 1 );
|
||||
|
||||
@@ -25,31 +25,31 @@ rtems_task Init(
|
||||
rtems_timer_service_routine Timer_handler(
|
||||
rtems_id argument
|
||||
);
|
||||
|
||||
|
||||
rtems_asr Isr_handler(
|
||||
rtems_signal_set signals
|
||||
);
|
||||
|
||||
|
||||
rtems_asr Asr_handler(
|
||||
rtems_signal_set signals
|
||||
);
|
||||
|
||||
|
||||
rtems_task task_func();
|
||||
|
||||
|
||||
void null_func();
|
||||
|
||||
|
||||
rtems_status_code Empty_directive();
|
||||
|
||||
#include <timesys.h>
|
||||
|
||||
/* configuration information */
|
||||
|
||||
|
||||
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
|
||||
|
||||
#define CONFIGURE_MAXIMUM_TASKS 2
|
||||
#define CONFIGURE_TICKS_PER_TIMESLICE 0
|
||||
|
||||
|
||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||
|
||||
#include <rtems/confdefs.h>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
static char buf[512];
|
||||
|
||||
static void
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
printf("usage: binpatch [-h] <ofile> <ifile> <reloc> <off> <byte0> "
|
||||
@@ -40,8 +40,8 @@ main(int argc, char **argv)
|
||||
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)
|
||||
{
|
||||
@@ -93,7 +93,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
patch[i] = tmp;
|
||||
}
|
||||
|
||||
|
||||
ifp = fopen(argv[2], "r");
|
||||
if(ifp == NULL)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
patched = 1;
|
||||
}
|
||||
|
||||
|
||||
fwrite(buf, 1, len, ofp);
|
||||
|
||||
cnt += len;
|
||||
@@ -145,7 +145,7 @@ main(int argc, char **argv)
|
||||
|
||||
fclose(ifp);
|
||||
fclose(ofp);
|
||||
|
||||
|
||||
if(!patched)
|
||||
{
|
||||
fprintf(stderr, "warning: offset is beyond input file length\n");
|
||||
|
||||
@@ -493,7 +493,7 @@ int main(
|
||||
}
|
||||
length = strlen(inbuff);
|
||||
inbuff[length - 1] = '\0';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ void error(int errn, ...);
|
||||
#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);
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
/*
|
||||
n .. baudrate generator source 0,1,2,3
|
||||
|
||||
|
||||
N .. BRR setting (0..255)
|
||||
|
||||
|
||||
Phi .. processor baud rate
|
||||
|
||||
|
||||
B .. bitrate
|
||||
*/
|
||||
|
||||
@@ -51,20 +51,20 @@ static unsigned int bitrate [] = {
|
||||
|
||||
static sci_tab_t test_array[4] ;
|
||||
|
||||
static void Compute(
|
||||
unsigned int n,
|
||||
unsigned int B,
|
||||
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 =
|
||||
if ( ( entry->N > 0 ) && ( entry->N < 256 ) )
|
||||
entry->err =
|
||||
( ( Phi / ( (entry->N + 1) * a ) - 1.0 ) * 100.0 );
|
||||
else
|
||||
{
|
||||
@@ -74,17 +74,17 @@ static void Compute(
|
||||
}
|
||||
}
|
||||
|
||||
static sci_tab_t *SelectN(
|
||||
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 );
|
||||
|
||||
@@ -97,7 +97,7 @@ static sci_tab_t *SelectN(
|
||||
best = &test_array[i] ;
|
||||
}
|
||||
|
||||
return best ;
|
||||
return best ;
|
||||
}
|
||||
|
||||
int shgen_gensci(
|
||||
@@ -106,7 +106,7 @@ int shgen_gensci(
|
||||
{
|
||||
unsigned int i ;
|
||||
|
||||
fprintf( file,
|
||||
fprintf( file,
|
||||
"/*\n * Bitrate table for the serial devices (sci) of the SH at %.3f MHz\n"
|
||||
" */\n\n", Phi / 1000000.0 );
|
||||
fprintf( file,
|
||||
@@ -118,13 +118,13 @@ int shgen_gensci(
|
||||
" * We experienced values less than 2%% to be stable\n"
|
||||
" */\n\n" );
|
||||
fprintf( file, "#include <termios.h>\n\n" );
|
||||
fprintf( file,
|
||||
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 );
|
||||
@@ -143,7 +143,7 @@ int shgen_gensci(
|
||||
|
||||
fprintf( file, "\n};\n\n" );
|
||||
|
||||
fprintf( file,
|
||||
fprintf( file,
|
||||
"int _sci_get_brparms( \n"
|
||||
" tcflag_t cflag,\n"
|
||||
" unsigned char *smr,\n"
|
||||
@@ -160,6 +160,6 @@ int shgen_gensci(
|
||||
" *brr = _sci_bitrates[offset].N;\n\n"
|
||||
" return 0;\n"
|
||||
"}\n" );
|
||||
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
@@ -44,12 +44,12 @@ static struct option long_options[] =
|
||||
|
||||
static void shgen_header( FILE *file )
|
||||
{
|
||||
fprintf( 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,
|
||||
fprintf( file,
|
||||
"\n/* This file is not copyrighted */\n\n" );
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
double Phi = 20000000.0 ;
|
||||
|
||||
#if HAVE_GETOPT_LONG
|
||||
#if HAVE_GETOPT_LONG
|
||||
int option_index = 0 ;
|
||||
while( ( optopt = getopt_long( argc, argv, "M:K:H:hv",
|
||||
long_options, &option_index ) ) > 0 )
|
||||
@@ -68,11 +68,11 @@ int main( int argc, char *argv[] )
|
||||
switch ( optopt )
|
||||
{
|
||||
case 'M' :
|
||||
sscanf( optarg, "%lf", &Phi );
|
||||
sscanf( optarg, "%lf", &Phi );
|
||||
Phi = Phi * 1000000.0;
|
||||
break ;
|
||||
case 'K' :
|
||||
sscanf( optarg, "%lf", &Phi );
|
||||
sscanf( optarg, "%lf", &Phi );
|
||||
Phi = Phi * 1000.0;
|
||||
break ;
|
||||
case 'H' :
|
||||
@@ -96,9 +96,9 @@ int main( int argc, char *argv[] )
|
||||
fprintf( stderr, "%s: Missing argument: driver\n", argv[0] );
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
shgen_header( stdout );
|
||||
|
||||
|
||||
if ( strcmp( argv[optind], "sci" ) == 0 )
|
||||
{
|
||||
shgen_gensci( stdout, Phi );
|
||||
@@ -108,6 +108,6 @@ int main( int argc, char *argv[] )
|
||||
fprintf( stderr, "%s: Invalid argument: driver\n", argv[0] );
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user