Remove stray white spaces.

This commit is contained in:
Ralf Corsepius
2004-04-20 07:09:31 +00:00
parent d3fdf89f66
commit 8f71a36f71
80 changed files with 390 additions and 391 deletions

View File

@@ -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. ## almost experimental.
## ##
## Expect frequent changes -- It deserves to be cleaned up :( ## 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 ## The section below is based on make/compilers/gcc-target-default.cfg
## used in former versions of RTEMS. ## used in former versions of RTEMS.
## ##
## Set up the flags for the toolchains: ## Set up the flags for the toolchains:
## ##
## We are considering 3 different building schemes here: ## We are considering 3 different building schemes here:
@@ -24,19 +24,19 @@
## Automake conditionals in use: ## Automake conditionals in use:
## RTEMS_USE_GCC .. if we are using GCC ## RTEMS_USE_GCC .. if we are using GCC
## NOTES: ## NOTES:
## * The gcc-2.8 building scheme is the nominal building scheme and ## * The gcc-2.8 building scheme is the nominal building scheme and
## is actively supported. ## 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 ## variables and is hardly tested at all
## CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we ## CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V are the values we
## would want the corresponding macros to be set to. ## 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. ## 'VARIANT=<OPTIMIZE|DEBUG>' targets to their _V values.
## XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS ## XCPPFLAGS, XCFLAGS, XCXXFLAGS, XASFLAGS
## are used to add flags from the shell ## are used to add flags from the shell
## cf. make.info ("Implicit rules/variables" for details) ## 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 -e 's?$(ARCH)/?$$(ARCH)/?' >$(DEPEND).tmp
mv $(DEPEND).tmp $(DEPEND) mv $(DEPEND).tmp $(DEPEND)
# pull in dependencies if they exist # pull in dependencies if they exist
ifeq (${DEPEND},$(wildcard ${DEPEND})) ifeq (${DEPEND},$(wildcard ${DEPEND}))
include ${DEPEND} include ${DEPEND}
@ENDIF@ @ENDIF@

View File

@@ -1,8 +1,8 @@
## $Id$ ## $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. ## 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 ## and this file will probably be removed
preinstall-am: $(PREINSTALL_FILES) preinstall-am: $(PREINSTALL_FILES)

View File

@@ -13,4 +13,3 @@ define make-exe
$(LINK_APP) $(LINK_APP)
endef endef
@ENDIF@ @ENDIF@

View File

@@ -1,10 +1,10 @@
## $Id$ ## $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. ## 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 ## and this file will probably be removed
depend-recursive \ depend-recursive \

View File

@@ -1,4 +1,4 @@
/* /*
* This is a clone of sp04 which has been modified to use the cpu monitoring * This is a clone of sp04 which has been modified to use the cpu monitoring
* library. * library.
* *

View File

@@ -24,15 +24,15 @@ rtems_task Init(
rtems_task Task_1( rtems_task Task_1(
rtems_task_argument argument rtems_task_argument argument
); );
rtems_task Task_2( rtems_task Task_2(
rtems_task_argument argument rtems_task_argument argument
); );
rtems_task Task_3( rtems_task Task_3(
rtems_task_argument argument rtems_task_argument argument
); );
void Task_switch( void Task_switch(
rtems_tcb *unused, rtems_tcb *unused,
rtems_tcb *heir 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_id Extension_id[ 4 ];
TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */ TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */
/* array of task run counts */ /* 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 * Keep track of task switches
@@ -77,5 +77,5 @@ extern struct taskSwitchLog taskSwitchLog[];
extern int taskSwitchLogIndex; extern int taskSwitchLogIndex;
volatile extern int testsFinished; volatile extern int testsFinished;
/* end of include file */ /* end of include file */

View File

@@ -26,7 +26,7 @@ struct taskSwitchLog taskSwitchLog[1000];
int taskSwitchLogIndex; int taskSwitchLogIndex;
volatile int testsFinished;; volatile int testsFinished;;
rtems_extension Task_switch( rtems_extension Task_switch(
rtems_tcb *unused, rtems_tcb *unused,
rtems_tcb *heir rtems_tcb *heir
) )

View File

@@ -1,7 +1,7 @@
/* /*
* This is a simple test whose only purpose is to start the Monitor * This is a simple test whose only purpose is to start the Monitor
* task. The Monitor task can be used to obtain information about * 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. * COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).

View File

@@ -26,13 +26,13 @@ struct counters {
rtems_task Init( rtems_task Init(
rtems_task_argument argument rtems_task_argument argument
); );
rtems_task Task_1_through_5( rtems_task Task_1_through_5(
rtems_task_argument argument rtems_task_argument argument
); );
void Get_all_counters( void ); void Get_all_counters( void );
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER

View File

@@ -22,7 +22,7 @@
/* functions */ /* functions */
extern "C" extern "C"
{ {
rtems_task Init( rtems_task Init(
rtems_task_argument argument rtems_task_argument argument
); );
@@ -37,7 +37,7 @@ class Task1
: public rtemsTask : public rtemsTask
{ {
void print_mode(rtems_mode mode, rtems_mode mask); void print_mode(rtems_mode mode, rtems_mode mask);
void screen1(void); void screen1(void);
void screen2(void); void screen2(void);
void screen3(void); void screen3(void);
@@ -59,7 +59,7 @@ class Task2
protected: protected:
virtual void body(rtems_task_argument argument); virtual void body(rtems_task_argument argument);
public: public:
Task2(const char* name, Task2(const char* name,
const rtems_task_priority initial_priority, const rtems_task_priority initial_priority,
const uint32_t stack_size); const uint32_t stack_size);
@@ -73,7 +73,7 @@ class Task3
protected: protected:
virtual void body(rtems_task_argument argument); virtual void body(rtems_task_argument argument);
public: public:
Task3(const char* name, Task3(const char* name,
const rtems_task_priority initial_priority, const rtems_task_priority initial_priority,
const uint32_t stack_size); const uint32_t stack_size);
@@ -85,7 +85,7 @@ class EndTask
protected: protected:
virtual void body(rtems_task_argument argument); virtual void body(rtems_task_argument argument);
public: public:
EndTask(const char* name, EndTask(const char* name,
const rtems_task_priority initial_priority, const rtems_task_priority initial_priority,
const uint32_t stack_size); const uint32_t stack_size);
@@ -126,7 +126,7 @@ class Io_during_interrupt
#define CONFIGURE_TICKS_PER_TIMESLICE 100 #define CONFIGURE_TICKS_PER_TIMESLICE 100
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #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) #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)

View File

@@ -26,13 +26,13 @@ struct counters {
rtems_task Init( rtems_task Init(
rtems_task_argument argument rtems_task_argument argument
); );
rtems_task Task_1_through_5( rtems_task Task_1_through_5(
rtems_task_argument argument rtems_task_argument argument
); );
void Get_all_counters( void ); void Get_all_counters( void );
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER

View File

@@ -1,6 +1,6 @@
/* /*
* RTEMS configuration/initialization * RTEMS configuration/initialization
* *
* This program may be distributed and used for any purpose. * This program may be distributed and used for any purpose.
* I ask only that you: * I ask only that you:
* 1. Leave this author information intact. * 1. Leave this author information intact.
@@ -11,7 +11,7 @@
* University of Saskatchewan * University of Saskatchewan
* Saskatoon, Saskatchewan, CANADA * Saskatoon, Saskatchewan, CANADA
* eric@skatter.usask.ca * eric@skatter.usask.ca
* *
* Additions: * Additions:
* Charles-Antoine Gauthier * Charles-Antoine Gauthier
* Software Engineering Group * Software Engineering Group
@@ -103,25 +103,25 @@ void print_c_oflag( struct termios * tp )
if( tp->c_oflag & OPOST ) if( tp->c_oflag & OPOST )
printf( "OPOST " ); printf( "OPOST " );
if( tp->c_oflag & OLCUC ) if( tp->c_oflag & OLCUC )
printf( "OLCUC " ); printf( "OLCUC " );
if( tp->c_oflag & ONLCR ) if( tp->c_oflag & ONLCR )
printf( "ONLCR " ); printf( "ONLCR " );
if( tp->c_oflag & OCRNL ) if( tp->c_oflag & OCRNL )
printf( "OCRNL " ); printf( "OCRNL " );
if( tp->c_oflag & ONOCR ) if( tp->c_oflag & ONOCR )
printf( "ONOCR " ); printf( "ONOCR " );
if( tp->c_oflag & ONLRET ) if( tp->c_oflag & ONLRET )
printf( "ONLRET " ); printf( "ONLRET " );
if( tp->c_oflag & OFILL ) if( tp->c_oflag & OFILL )
printf( "OFILL " ); printf( "OFILL " );
if( tp->c_oflag & OFDEL ) if( tp->c_oflag & OFDEL )
printf( "OFDEL " ); printf( "OFDEL " );
@@ -129,73 +129,73 @@ void print_c_oflag( struct termios * tp )
case NL0: case NL0:
printf( "NL0 " ); printf( "NL0 " );
break; break;
case NL1: case NL1:
printf( "NL1 " ); printf( "NL1 " );
break; break;
} }
switch( tp->c_oflag & CRDLY ) { switch( tp->c_oflag & CRDLY ) {
case CR0: case CR0:
printf( "CR0 " ); printf( "CR0 " );
break; break;
case CR1: case CR1:
printf( "CR1 " ); printf( "CR1 " );
break; break;
case CR2: case CR2:
printf( "CR2 " ); printf( "CR2 " );
break; break;
case CR3: case CR3:
printf( "CR3 " ); printf( "CR3 " );
break; break;
} }
switch( tp->c_oflag & TABDLY ) { switch( tp->c_oflag & TABDLY ) {
case TAB0: case TAB0:
printf( "TAB0 " ); printf( "TAB0 " );
break; break;
case TAB1: case TAB1:
printf( "TAB1 " ); printf( "TAB1 " );
break; break;
case TAB2: case TAB2:
printf( "TAB2 " ); printf( "TAB2 " );
break; break;
case TAB3: case TAB3:
printf( "TAB3 " ); printf( "TAB3 " );
break; break;
} }
switch( tp->c_oflag & BSDLY ) { switch( tp->c_oflag & BSDLY ) {
case BS0: case BS0:
printf( "BS0 " ); printf( "BS0 " );
break; break;
case BS1: case BS1:
printf( "BS1 " ); printf( "BS1 " );
break; break;
} }
switch( tp->c_oflag & VTDLY ) { switch( tp->c_oflag & VTDLY ) {
case VT0: case VT0:
printf( "VT0 " ); printf( "VT0 " );
break; break;
case VT1: case VT1:
printf( "VT1 " ); printf( "VT1 " );
break; break;
} }
switch( tp->c_oflag & FFDLY ) { switch( tp->c_oflag & FFDLY ) {
case FF0: case FF0:
printf( "FF0" ); printf( "FF0" );
break; break;
case FF1: case FF1:
printf( "FF1" ); printf( "FF1" );
break; break;
@@ -229,7 +229,7 @@ void print_c_lflag( struct termios * tp )
"unknown", /* 2000000 */ "unknown", /* 2000000 */
"unknown", /* 4000000 */ "unknown", /* 4000000 */
}; };
printf( "c_lflag = 0x%08x\n\t", tp->c_lflag ); printf( "c_lflag = 0x%08x\n\t", tp->c_lflag );
print_32bits( tp->c_lflag, sizeof( c_lflag_bits )/sizeof( char * ), c_lflag_bits ); print_32bits( tp->c_lflag, sizeof( c_lflag_bits )/sizeof( char * ), c_lflag_bits );
printf( "\n" ); printf( "\n" );
@@ -239,99 +239,99 @@ void print_c_lflag( struct termios * tp )
void print_c_cflag( struct termios * tp ) void print_c_cflag( struct termios * tp )
{ {
unsigned int baud; unsigned int baud;
printf( "c_cflag = 0x%08x\n", tp->c_cflag ); printf( "c_cflag = 0x%08x\n", tp->c_cflag );
baud = (tp->c_cflag & CBAUD) ; baud = (tp->c_cflag & CBAUD) ;
#if defined(__sh2__) #if defined(__sh2__)
if ( tp->c_cflag & CBAUDEX ) if ( tp->c_cflag & CBAUDEX )
#endif #endif
switch( baud ) { switch( baud ) {
case B0: case B0:
printf( "\tCBAUD =\tB0\n" ); printf( "\tCBAUD =\tB0\n" );
break; break;
case B50: case B50:
printf( "\tCBAUD =\tB50\n" ); printf( "\tCBAUD =\tB50\n" );
break; break;
case B75: case B75:
printf( "\tCBAUD =\tB75\n" ); printf( "\tCBAUD =\tB75\n" );
break; break;
case B110: case B110:
printf( "\tCBAUD =\tB110\n" ); printf( "\tCBAUD =\tB110\n" );
break; break;
case B134: case B134:
printf( "\tCBAUD =\tB134\n" ); printf( "\tCBAUD =\tB134\n" );
break; break;
case B150: case B150:
printf( "\tCBAUD =\tB150\n" ); printf( "\tCBAUD =\tB150\n" );
break; break;
case B200: case B200:
printf( "\tCBAUD =\tB200\n" ); printf( "\tCBAUD =\tB200\n" );
break; break;
case B300: case B300:
printf( "\tCBAUD =\tB300\n" ); printf( "\tCBAUD =\tB300\n" );
break; break;
case B600: case B600:
printf( "\tCBAUD =\tB600\n" ); printf( "\tCBAUD =\tB600\n" );
break; break;
case B1200: case B1200:
printf( "\tCBAUD =\tB1200\n" ); printf( "\tCBAUD =\tB1200\n" );
break; break;
case B1800: case B1800:
printf( "\tCBAUD =\tB1800\n" ); printf( "\tCBAUD =\tB1800\n" );
break; break;
case B2400: case B2400:
printf( "\tCBAUD =\tB2400\n" ); printf( "\tCBAUD =\tB2400\n" );
break; break;
case B4800: case B4800:
printf( "\tCBAUD =\tB4800\n" ); printf( "\tCBAUD =\tB4800\n" );
break; break;
case B9600: case B9600:
printf( "\tCBAUD =\tB9600\n" ); printf( "\tCBAUD =\tB9600\n" );
break; break;
case B19200: case B19200:
printf( "\tCBAUD =\tB19200\n" ); printf( "\tCBAUD =\tB19200\n" );
break; break;
case B38400: case B38400:
printf( "\tCBAUD =\tB38400\n" ); printf( "\tCBAUD =\tB38400\n" );
break; break;
#if defined(__sh2__) #if defined(__sh2__)
} }
else else
switch ( baud ) switch ( baud )
{ {
#endif #endif
case B57600: case B57600:
printf( "\tCBAUD =\tB57600\n" ); printf( "\tCBAUD =\tB57600\n" );
break; break;
case B115200: case B115200:
printf( "\tCBAUD =\tB115200\n" ); printf( "\tCBAUD =\tB115200\n" );
break; break;
case B230400: case B230400:
printf( "\tCBAUD =\tB230400\n" ); printf( "\tCBAUD =\tB230400\n" );
break; break;
case B460800: case B460800:
printf( "\tCBAUD =\tB460800\n" ); printf( "\tCBAUD =\tB460800\n" );
break; break;
default: default:
printf( "\tCBAUD =\tunknown (0x%08x)\n", baud ); printf( "\tCBAUD =\tunknown (0x%08x)\n", baud );
break; break;
@@ -341,15 +341,15 @@ void print_c_cflag( struct termios * tp )
case CS5: case CS5:
printf( "\tCSIZE =\tCS5\n" ); printf( "\tCSIZE =\tCS5\n" );
break; break;
case CS6: case CS6:
printf( "\tCSIZE =\tCS6\n" ); printf( "\tCSIZE =\tCS6\n" );
break; break;
case CS7: case CS7:
printf( "\tCSIZE =\tCS7\n" ); printf( "\tCSIZE =\tCS7\n" );
break; break;
case CS8: case CS8:
printf( "\tCSIZE =\tCS8\n" ); printf( "\tCSIZE =\tCS8\n" );
break; break;
@@ -359,39 +359,39 @@ void print_c_cflag( struct termios * tp )
printf( "\tCSTOPB set: send 2 stop bits\n" ); printf( "\tCSTOPB set: send 2 stop bits\n" );
else else
printf( "\tCSTOPB clear: send 1 stop bit\n" ); printf( "\tCSTOPB clear: send 1 stop bit\n" );
if( tp->c_cflag & PARENB ) if( tp->c_cflag & PARENB )
printf( "\tPARENB set: parity enabled\n" ); printf( "\tPARENB set: parity enabled\n" );
else else
printf( "\tPARENB clear: parity disabled\n" ); printf( "\tPARENB clear: parity disabled\n" );
if( tp->c_cflag & PARODD ) if( tp->c_cflag & PARODD )
printf( "\tPARODD set: parity odd\n" ); printf( "\tPARODD set: parity odd\n" );
else else
printf( "\tPARODD clear: parity even\n" ); printf( "\tPARODD clear: parity even\n" );
if( tp->c_cflag & CREAD ) if( tp->c_cflag & CREAD )
printf( "\tCREAD set: receiver enabled\n" ); printf( "\tCREAD set: receiver enabled\n" );
else else
printf( "\tCREAD clear: treceiver disabled\n" ); printf( "\tCREAD clear: treceiver disabled\n" );
if( tp->c_cflag & HUPCL ) if( tp->c_cflag & HUPCL )
printf( "\tHUPCL set: enabled\n" ); printf( "\tHUPCL set: enabled\n" );
else else
printf( "\tHUPCL clear: disabled\n" ); printf( "\tHUPCL clear: disabled\n" );
if( tp->c_cflag & CLOCAL ) if( tp->c_cflag & CLOCAL )
printf( "\tCLOCAL set: ignore modem lines\n" ); printf( "\tCLOCAL set: ignore modem lines\n" );
else else
printf( "\tCLOCAL clear: don't ignore modem lines\n" ); printf( "\tCLOCAL clear: don't ignore modem lines\n" );
#if defined(CBAUDEX) #if defined(CBAUDEX)
if( tp->c_cflag & CBAUDEX ) if( tp->c_cflag & CBAUDEX )
printf( "\tCBAUDEX set: What does this do?\n" ); printf( "\tCBAUDEX set: What does this do?\n" );
else else
printf( "\tCBAUDEX clear: What does this do?\n" ); printf( "\tCBAUDEX clear: What does this do?\n" );
#endif #endif
if( tp->c_cflag & CRTSCTS ) if( tp->c_cflag & CRTSCTS )
printf( "\tCRTSCTS: harware flow control enabled?\n" ); printf( "\tCRTSCTS: harware flow control enabled?\n" );
else else
@@ -445,7 +445,7 @@ void print_termios( struct termios *tp )
unsigned long get_baud_rate( void ) unsigned long get_baud_rate( void )
{ {
unsigned long baud_rate; unsigned long baud_rate;
while( TRUE ) { while( TRUE ) {
printf( "Enter the numerical value for the new baud rate.\n" ); 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" ); 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() unsigned long get_parity()
{ {
int parity; int parity;
while( TRUE ) { while( TRUE ) {
printf( "Enter the numerical value for the new parity\n" ); 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" ); 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 ) { switch( stop_bits ) {
case 1: case 1:
return 0; return 0;
case 2: case 2:
return CSTOPB; return CSTOPB;
@@ -548,13 +548,13 @@ unsigned long get_data_bits()
switch( data_bits ) { switch( data_bits ) {
case 5: case 5:
return CS5; return CS5;
case 6: case 6:
return CS6; return CS6;
case 7: case 7:
return CS7; return CS7;
case 8: case 8:
return CS8; return CS8;
@@ -569,9 +569,9 @@ unsigned long get_data_bits()
void change_line_settings( struct termios *tp ) void change_line_settings( struct termios *tp )
{ {
unsigned long baud_rate, parity, stop_bits, data_bits, sleep_time; unsigned long baud_rate, parity, stop_bits, data_bits, sleep_time;
printf( "\nSetting line characteristics\n\n" ); printf( "\nSetting line characteristics\n\n" );
baud_rate = get_baud_rate(); baud_rate = get_baud_rate();
parity = get_parity(); parity = get_parity();
stop_bits = get_stop_bits(); 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 ); printf( "Setting line to new termios settings in %lu seconds.\n", sleep_time );
sleep( sleep_time ); sleep( sleep_time );
tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits | baud_rate; tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits | baud_rate;
if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) { if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) {
perror( "change_line_settings(): tcsetattr() failed" ); perror( "change_line_settings(): tcsetattr() failed" );
@@ -600,17 +600,17 @@ void change_line_settings( struct termios *tp )
void canonical_input( struct termios *tp ) void canonical_input( struct termios *tp )
{ {
char c, first_time = TRUE; char c, first_time = TRUE;
printf( "\nTesting canonical input\n\n" ); printf( "\nTesting canonical input\n\n" );
printf( "Setting line to canonical input mode.\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; tp->c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) { if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) {
perror( "canonical_input(): tcsetattr() failed" ); perror( "canonical_input(): tcsetattr() failed" );
rtems_test_exit( 1 ); rtems_test_exit( 1 );
} }
while ( ( c = getchar () ) != '\n'); while ( ( c = getchar () ) != '\n');
printf( "Testing getchar(). Type some text followed by carriage return\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" ); 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]; unsigned char cbuf[100];
printf( "Raw input test with VMIN=%d VTIME=%d\n", vmin, vtime ); printf( "Raw input test with VMIN=%d VTIME=%d\n", vmin, vtime );
rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond ); rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond );
if ( tcgetattr( fileno ( stdin ), &old ) < 0 ) { if ( tcgetattr( fileno ( stdin ), &old ) < 0 ) {
perror( "do_raw_input(): tcgetattr() failed" ); perror( "do_raw_input(): tcgetattr() failed" );
return; return;
} }
new = old; new = old;
new.c_lflag &= ~( ICANON | ECHO | ECHONL | ECHOK | ECHOE | ECHOPRT | ECHOCTL ); new.c_lflag &= ~( ICANON | ECHO | ECHONL | ECHOK | ECHOE | ECHOPRT | ECHOCTL );
new.c_cc[VMIN] = vmin; new.c_cc[VMIN] = vmin;
@@ -654,7 +654,7 @@ void do_raw_input( int vmin, int vtime )
perror ("do_raw_input(): tcsetattr() failed" ); perror ("do_raw_input(): tcsetattr() failed" );
return; return;
} }
do { do {
rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then ); rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then );
count = 0; count = 0;
@@ -672,17 +672,17 @@ void do_raw_input( int vmin, int vtime )
msec = (now - then) * 1000 / ticksPerSecond; msec = (now - then) * 1000 / ticksPerSecond;
printf( "Count:%-10lu Interval:%3u.%3.3d Char:", printf( "Count:%-10lu Interval:%3u.%3.3d Char:",
count, msec / 1000, msec % 1000 ); count, msec / 1000, msec % 1000 );
for( i = 0 ; i < nread ; i++ ) for( i = 0 ; i < nread ; i++ )
printf (" 0x%2.2x", cbuf[i]); printf (" 0x%2.2x", cbuf[i]);
printf ("\n"); printf ("\n");
} while( cbuf[0] != 'q' ); } while( cbuf[0] != 'q' );
out: out:
if( tcsetattr( fileno( stdin ), TCSADRAIN, &old) < 0 ) if( tcsetattr( fileno( stdin ), TCSADRAIN, &old) < 0 )
perror("do_raw_input(): tcsetattr() failed: %s\n" ); perror("do_raw_input(): tcsetattr() failed: %s\n" );
printf ("*** End of Raw input VMIN=%d VTIME=%d ***\n", vmin, vtime); 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( 0, 20 );
do_raw_input( 5, 0 ); do_raw_input( 5, 0 );
do_raw_input( 5, 20 ); do_raw_input( 5, 20 );
printf( "\nRaw input test done.\n" ); printf( "\nRaw input test done.\n" );
} }
@@ -722,7 +722,7 @@ Init (rtems_task_argument ignored)
{ {
char c ; char c ;
struct termios orig_termios, test_termios; struct termios orig_termios, test_termios;
printf( "\n\n*** TEST OF TERMIOS INPUT CAPABILITIES ***\n" ); printf( "\n\n*** TEST OF TERMIOS INPUT CAPABILITIES ***\n" );
if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) { if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) {
@@ -770,7 +770,7 @@ Init (rtems_task_argument ignored)
case '\n': case '\n':
break; break;
default: default:
printf( "\n%c is not a valid choice. Try again\n\n", c ); printf( "\n%c is not a valid choice. Try again\n\n", c );
usage(); usage();

View File

@@ -26,12 +26,12 @@ rtems_task Test_task(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 4 #define CONFIGURE_MAXIMUM_TASKS 4
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_GLOBAL #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_GLOBAL

View File

@@ -26,14 +26,14 @@ rtems_task Test_task(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -29,14 +29,14 @@ rtems_timer_service_routine Delayed_send_event(
rtems_id ignored_id, rtems_id ignored_id,
void *ignored_address void *ignored_address
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1 #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_id Timer_id[ 2 ]; /* array of timer ids */
TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */ TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */
TEST_EXTERN uint32_t remote_node; TEST_EXTERN uint32_t remote_node;
TEST_EXTERN rtems_id remote_tid; TEST_EXTERN rtems_id remote_tid;
/* end of include file */ /* end of include file */

View File

@@ -26,12 +26,12 @@ rtems_task Test_task(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1 #define CONFIGURE_MAXIMUM_TIMERS 1

View File

@@ -28,12 +28,12 @@ rtems_task Test_task(
rtems_asr Process_asr( rtems_signal_set ); rtems_asr Process_asr( rtems_signal_set );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1 #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_id Timer_id[ 2 ]; /* array of timer ids */
TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */ TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */
TEST_EXTERN volatile rtems_boolean Stop_Test; TEST_EXTERN volatile rtems_boolean Stop_Test;
TEST_EXTERN uint32_t remote_node; TEST_EXTERN uint32_t remote_node;
TEST_EXTERN rtems_id remote_tid; TEST_EXTERN rtems_id remote_tid;
TEST_EXTERN rtems_signal_set remote_signal; TEST_EXTERN rtems_signal_set remote_signal;
TEST_EXTERN rtems_signal_set expected_signal; TEST_EXTERN rtems_signal_set expected_signal;
TEST_EXTERN volatile uint32_t signal_count; TEST_EXTERN volatile uint32_t signal_count;
TEST_EXTERN volatile uint32_t signal_caught; TEST_EXTERN volatile uint32_t signal_caught;
/* end of include file */ /* end of include file */

View File

@@ -26,12 +26,12 @@ rtems_task Test_task(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1 #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_id Timer_id[ 4 ]; /* array of timer ids */
TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */ TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */
TEST_EXTERN volatile rtems_boolean Stop_Test; TEST_EXTERN volatile rtems_boolean Stop_Test;
/* end of include file */ /* end of include file */

View File

@@ -26,12 +26,12 @@ rtems_task Test_task(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1 #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_id Timer_id[ 4 ]; /* array of timer ids */
TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */ TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */
TEST_EXTERN volatile rtems_boolean Stop_Test; TEST_EXTERN volatile rtems_boolean Stop_Test;
/* end of include file */ /* end of include file */

View File

@@ -26,12 +26,12 @@ rtems_task Test_task(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1 #define CONFIGURE_MAXIMUM_TIMERS 1
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1

View File

@@ -30,12 +30,12 @@ void Receive_messages( void );
void Send_messages( void ); void Send_messages( void );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_TIMERS 1 #define CONFIGURE_MAXIMUM_TIMERS 1
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 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_id Queue_id[ 2 ]; /* array of message queue ids */
TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */ TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */
extern char buffer1[16]; extern char buffer1[16];
extern char buffer2[16]; extern char buffer2[16];
extern char buffer3[16]; extern char buffer3[16];

View File

@@ -20,26 +20,26 @@
rtems_task Init( rtems_task Init(
rtems_task_argument argument rtems_task_argument argument
); );
rtems_task Test_task1( rtems_task Test_task1(
rtems_task_argument argument rtems_task_argument argument
); );
rtems_task Test_task2( rtems_task Test_task2(
rtems_task_argument argument rtems_task_argument argument
); );
rtems_task Test_task3( rtems_task Test_task3(
rtems_task_argument restart rtems_task_argument restart
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#if ( NODE_NUMBER == 1 ) #if ( NODE_NUMBER == 1 )
#define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_MAXIMUM_TASKS 1
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1

View File

@@ -22,15 +22,15 @@ rtems_task Init(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 0 #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 0
#define CONFIGURE_MP_MAXIMUM_PROXIES 0 #define CONFIGURE_MP_MAXIMUM_PROXIES 0
#define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_MAXIMUM_TASKS 1
#if ( NODE_NUMBER == 1 ) #if ( NODE_NUMBER == 1 )
#define CONFIGURE_MAXIMUM_SEMAPHORES 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_id Queue_id[ 2 ]; /* array of message queue ids */
TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */ 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_id Semaphore_id[ 2 ]; /* array of semaphore ids */
TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */ TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */

View File

@@ -24,15 +24,15 @@ rtems_task Init(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 1 #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 1
#define CONFIGURE_MP_MAXIMUM_PROXIES 0 #define CONFIGURE_MP_MAXIMUM_PROXIES 0
#define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_MAXIMUM_TASKS 1
#if ( NODE_NUMBER == 1 ) #if ( NODE_NUMBER == 1 )
#define CONFIGURE_MAXIMUM_PARTITIONS 1 #define CONFIGURE_MAXIMUM_PARTITIONS 1

View File

@@ -30,9 +30,9 @@ rtems_task Test_task2(
); );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_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_id Queue_id[ 2 ]; /* array of message queue ids */
TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */ 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_id Semaphore_id[ 2 ]; /* array of semaphore ids */
TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */ TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */

View File

@@ -27,9 +27,9 @@ void Exit_test( void )
* Wait a bit before shutting down so we don't screw up the other node * Wait a bit before shutting down so we don't screw up the other node
* when our MPCI shuts down * when our MPCI shuts down
*/ */
rtems_task_wake_after(20); rtems_task_wake_after(20);
status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode ); status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode );
directive_failed( status, "rtems_task_mode" ); directive_failed( status, "rtems_task_mode" );

View File

@@ -49,12 +49,12 @@ rtems_task Semaphore_task(
void Exit_test( void ); void Exit_test( void );
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_TICKS_PER_TIMESLICE 1 #define CONFIGURE_TICKS_PER_TIMESLICE 1
#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1) #define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1)

View File

@@ -26,14 +26,14 @@ rtems_task Application_task(
); );
/* configuration information */ /* configuration information */
#include <bsp.h> /* for device driver prototypes */ #include <bsp.h> /* for device driver prototypes */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE

View File

@@ -203,12 +203,12 @@ void fileio_list_file(void)
flen += n; flen += n;
} }
} while (n > 0); } while (n > 0);
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &curr_tick); rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &curr_tick);
printf("\n ******** End of file reached, flen = %d\n",flen); printf("\n ******** End of file reached, flen = %d\n",flen);
close(fd); close(fd);
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_sec); rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_sec);
printf("time elapsed for read: %g seconds\n", printf("time elapsed for read: %g seconds\n",
((double)curr_tick-start_tick)/ticks_per_sec); ((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; rtems_interval start_tick,curr_tick,ticks_per_sec;
char *bufptr = NULL; char *bufptr = NULL;
boolean failed = FALSE; 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"; "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"; "\n----- end of write buffer ------\n";
printf(" =========================\n"); printf(" =========================\n");
printf(" WRITE FILE ... \n"); printf(" WRITE FILE ... \n");
printf(" =========================\n"); printf(" =========================\n");
@@ -370,7 +370,7 @@ void fileio_write_file(void)
printf("... writing to file\n"); printf("... writing to file\n");
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start_tick); rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start_tick);
curr_pos = 0; curr_pos = 0;
do { do {
bytes_to_copy = buf_size; bytes_to_copy = buf_size;
do { do {
n = write(fd, n = write(fd,
@@ -422,7 +422,7 @@ void fileio_read_file(void)
rtems_interval start_tick,curr_tick,ticks_per_sec; rtems_interval start_tick,curr_tick,ticks_per_sec;
char *bufptr = NULL; char *bufptr = NULL;
boolean failed = FALSE; boolean failed = FALSE;
printf(" =========================\n"); printf(" =========================\n");
printf(" READ FILE ... \n"); printf(" READ FILE ... \n");
printf(" =========================\n"); printf(" =========================\n");
@@ -489,7 +489,7 @@ void fileio_read_file(void)
printf("... reading from file\n"); printf("... reading from file\n");
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start_tick); rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start_tick);
curr_pos = 0; curr_pos = 0;
do { do {
n = read(fd, n = read(fd,
bufptr, bufptr,
buf_size); buf_size);
@@ -511,7 +511,7 @@ void fileio_read_file(void)
printf("time elapsed for read: %g seconds\n", printf("time elapsed for read: %g seconds\n",
((double)curr_tick-start_tick)/ticks_per_sec); ((double)curr_tick-start_tick)/ticks_per_sec);
printf("read data rate: %g KBytes/second\n", 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))); (((double)curr_tick-start_tick)/ticks_per_sec)));
} }
} }
@@ -554,30 +554,30 @@ void fileio_menu (void)
fgets(inbuf,sizeof(inbuf),stdin); fgets(inbuf,sizeof(inbuf),stdin);
switch (inbuf[0]) { switch (inbuf[0]) {
case 'l': case 'l':
fileio_list_file (); fileio_list_file ();
break; break;
case 'r': case 'r':
fileio_read_file (); fileio_read_file ();
break; break;
case 'w': case 'w':
fileio_write_file (); fileio_write_file ();
break; break;
case 'p': case 'p':
fileio_part_table_initialize (); fileio_part_table_initialize ();
break; break;
case 'f': case 'f':
fileio_fsmount (); fileio_fsmount ();
break; break;
#ifdef USE_SHELL #ifdef USE_SHELL
case 's': case 's':
fileio_start_shell (); fileio_start_shell ();
break; break;
#endif #endif
default: default:
printf("Selection `%c` not implemented\n",inbuf[0]); printf("Selection `%c` not implemented\n",inbuf[0]);
break; break;
} }
} }
exit (0); exit (0);
} }

View File

@@ -44,7 +44,7 @@ rtems_driver_address_table Device_drivers[] =
#ifdef RTEMS_BSP_HAS_IDE_DRIVER #ifdef RTEMS_BSP_HAS_IDE_DRIVER
,IDE_CONTROLLER_DRIVER_TABLE_ENTRY ,IDE_CONTROLLER_DRIVER_TABLE_ENTRY
/* important: ATA driver must be after ide drivers */ /* important: ATA driver must be after ide drivers */
,ATA_DRIVER_TABLE_ENTRY ,ATA_DRIVER_TABLE_ENTRY
#endif #endif
}; };

View File

@@ -29,7 +29,7 @@ rtems_task Test_task(
/* /*
* Keep the names and IDs in global variables so another task can use them. * 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_id Task_id[ 4 ]; /* array of task ids */
extern rtems_name Task_name[ 4 ]; /* array of task names */ extern rtems_name Task_name[ 4 ]; /* array of task names */

View File

@@ -40,23 +40,23 @@ rtems_task Init(
uint32_t task; uint32_t task;
/* lower the task priority to allow created tasks to execute */ /* lower the task priority to allow created tasks to execute */
rtems_task_set_priority(RTEMS_SELF, 20, &old_priority); rtems_task_set_priority(RTEMS_SELF, 20, &old_priority);
rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode); rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode);
printf( "\n*** UNLIMITED TASK TEST ***\n" ); printf( "\n*** UNLIMITED TASK TEST ***\n" );
/* /*
* Invalid state if the task id is 0 * Invalid state if the task id is 0
*/ */
for (task = 0; task < MAX_TASKS; task++) for (task = 0; task < MAX_TASKS; task++)
task_id[task] = 0; task_id[task] = 0;
test1(); test1();
test2(); test2();
test3(); test3();
printf( "\n*** END OF UNLIMITED TASK TEST ***\n" ); printf( "\n*** END OF UNLIMITED TASK TEST ***\n" );
exit( 0 ); exit( 0 );
} }
@@ -66,11 +66,11 @@ rtems_task test_task(
) )
{ {
rtems_event_set out; rtems_event_set out;
printf( "task %i has started.\n", my_number); printf( "task %i has started.\n", my_number);
rtems_event_receive(1, RTEMS_WAIT | RTEMS_EVENT_ANY, 0, &out); rtems_event_receive(1, RTEMS_WAIT | RTEMS_EVENT_ANY, 0, &out);
printf( "task %i ending.\n", my_number); printf( "task %i ending.\n", my_number);
rtems_task_delete(RTEMS_SELF); rtems_task_delete(RTEMS_SELF);
@@ -81,11 +81,11 @@ void destory_all_tasks(
) )
{ {
uint32_t task; uint32_t task;
/* /*
* If the id is not zero, signal the task to delete. * If the id is not zero, signal the task to delete.
*/ */
for (task = 0; task < MAX_TASKS; task++) for (task = 0; task < MAX_TASKS; task++)
if (task_id[task]) if (task_id[task])
{ {
@@ -103,15 +103,15 @@ boolean status_code_bad(
if (status_code != RTEMS_SUCCESSFUL) if (status_code != RTEMS_SUCCESSFUL)
{ {
printf("failure, "); printf("failure, ");
if (status_code == RTEMS_TOO_MANY) if (status_code == RTEMS_TOO_MANY)
{ {
printf("too many.\n"); printf("too many.\n");
return TRUE; return TRUE;
} }
if (status_code == RTEMS_UNSATISFIED) if (status_code == RTEMS_UNSATISFIED)
{ {
printf("unsatisfied.\n"); printf("unsatisfied.\n");
return TRUE; return TRUE;
} }

View File

@@ -28,12 +28,12 @@ void test1()
rtems_status_code result; rtems_status_code result;
uint32_t task_count = 0; uint32_t task_count = 0;
Objects_Information *the_information; Objects_Information *the_information;
char c1 = 'a'; char c1 = 'a';
char c2 = 'a'; char c2 = 'a';
char c3 = '0'; char c3 = '0';
char c4 = '0'; char c4 = '0';
printf( "\n TEST1 : auto-extend disabled.\n" ); printf( "\n TEST1 : auto-extend disabled.\n" );
/* /*
@@ -41,17 +41,17 @@ void test1()
* saves having another test. * saves having another test.
*/ */
the_information = the_information =
_Objects_Information_table[OBJECTS_CLASSIC_API][OBJECTS_RTEMS_TASKS]; _Objects_Information_table[OBJECTS_CLASSIC_API][OBJECTS_RTEMS_TASKS];
auto_extend = the_information->auto_extend; auto_extend = the_information->auto_extend;
the_information->auto_extend = FALSE; the_information->auto_extend = FALSE;
while (task_count < MAX_TASKS) while (task_count < MAX_TASKS)
{ {
rtems_name name; rtems_name name;
printf(" TEST1 : creating task '%c%c%c%c', ", c1, c2, c3, c4); printf(" TEST1 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
name = rtems_build_name(c1, c2, c3, c4); name = rtems_build_name(c1, c2, c3, c4);
result = rtems_task_create(name, result = rtems_task_create(name,
@@ -63,29 +63,29 @@ void test1()
if (status_code_bad(result)) if (status_code_bad(result))
break; break;
printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]); printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]);
fflush(stdout); fflush(stdout);
result = rtems_task_start(task_id[task_count], result = rtems_task_start(task_id[task_count],
test_task, test_task,
(rtems_task_argument) task_count); (rtems_task_argument) task_count);
if (status_code_bad(result)) if (status_code_bad(result))
break; break;
/* /*
* Update the name. * Update the name.
*/ */
NEXT_TASK_NAME(c1, c2, c3, c4); NEXT_TASK_NAME(c1, c2, c3, c4);
task_count++; task_count++;
} }
if (task_count >= MAX_TASKS) if (task_count >= MAX_TASKS)
printf( "\nMAX_TASKS too small for work-space size, please make larger !!\n\n" ); printf( "\nMAX_TASKS too small for work-space size, please make larger !!\n\n" );
if (task_count != (TASK_ALLOCATION_SIZE - 1)) { if (task_count != (TASK_ALLOCATION_SIZE - 1)) {
printf( " FAIL1 : the number of tasks does not equal the expected size -\n" printf( " FAIL1 : the number of tasks does not equal the expected size -\n"
" task created = %i, required number = %i\n", " task created = %i, required number = %i\n",
@@ -94,8 +94,8 @@ void test1()
} }
destory_all_tasks("TEST1"); destory_all_tasks("TEST1");
the_information->auto_extend = auto_extend; the_information->auto_extend = auto_extend;
printf( " TEST1 : completed\n" ); printf( " TEST1 : completed\n" );
} }

View File

@@ -32,25 +32,25 @@ void test2()
uint32_t block; uint32_t block;
uint32_t task_count = 0; uint32_t task_count = 0;
rtems_id removed_ids[TASK_ALLOCATION_SIZE * 2]; rtems_id removed_ids[TASK_ALLOCATION_SIZE * 2];
char c1 = 'a'; char c1 = 'a';
char c2 = 'a'; char c2 = 'a';
char c3 = '0'; char c3 = '0';
char c4 = '0'; char c4 = '0';
printf( "\n TEST2 : re-allocate of index numbers, and a block free'ed and one inactive\n" ); 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 * Allocate enought tasks so the Inactive list is empty. Remember
* to count the Init task, ie ... - 1. * to count the Init task, ie ... - 1.
*/ */
while (task_count < ((TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET)) while (task_count < ((TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET))
{ {
rtems_name name; rtems_name name;
printf(" TEST2 : creating task '%c%c%c%c', ", c1, c2, c3, c4); printf(" TEST2 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
name = rtems_build_name(c1, c2, c3, c4); name = rtems_build_name(c1, c2, c3, c4);
result = rtems_task_create(name, result = rtems_task_create(name,
@@ -62,23 +62,23 @@ void test2()
if (status_code_bad(result)) if (status_code_bad(result))
break; break;
printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]); printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]);
fflush(stdout); fflush(stdout);
result = rtems_task_start(task_id[task_count], result = rtems_task_start(task_id[task_count],
test_task, test_task,
(rtems_task_argument) task_count); (rtems_task_argument) task_count);
if (status_code_bad(result)) if (status_code_bad(result))
break; break;
/* /*
* Update the name. * Update the name.
*/ */
NEXT_TASK_NAME(c1, c2, c3, c4); NEXT_TASK_NAME(c1, c2, c3, c4);
task_count++; task_count++;
} }
@@ -95,7 +95,7 @@ void test2()
} }
task = 0; task = 0;
for (block = 1; block < 4; block += 2) for (block = 1; block < 4; block += 2)
{ {
for (remove_task = (block * TASK_ALLOCATION_SIZE) - TASK_INDEX_OFFSET; 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 * Save the id's to match them against the reallocated ids
*/ */
removed_ids[task++] = task_id[remove_task]; removed_ids[task++] = task_id[remove_task];
printf(" TEST2 : block %i remove, signal task %08x, ", block, 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); rtems_event_send(task_id[remove_task], 1);
task_id[remove_task] = 0; task_id[remove_task] = 0;
@@ -135,7 +135,7 @@ void test2()
for (id_slot = 0; id_slot < MAX_TASKS; id_slot++) for (id_slot = 0; id_slot < MAX_TASKS; id_slot++)
if (!task_id[id_slot]) if (!task_id[id_slot])
break; break;
if (id_slot == MAX_TASKS) if (id_slot == MAX_TASKS)
{ {
printf( " FAIL2 : no free task id slot.\n"); 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); printf(" TEST2 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
name = rtems_build_name(c1, c2, c3, c4); name = rtems_build_name(c1, c2, c3, c4);
result = rtems_task_create(name, result = rtems_task_create(name,
@@ -153,7 +153,7 @@ void test2()
RTEMS_DEFAULT_ATTRIBUTES, RTEMS_DEFAULT_ATTRIBUTES,
RTEMS_LOCAL, RTEMS_LOCAL,
&task_id[id_slot]); &task_id[id_slot]);
if (status_code_bad(result)) if (status_code_bad(result))
{ {
printf( " FAIL2 : re-creating a task -\n" printf( " FAIL2 : re-creating a task -\n"
@@ -162,13 +162,13 @@ void test2()
destory_all_tasks("TEST2"); destory_all_tasks("TEST2");
exit( 1 ); exit( 1 );
} }
printf("number = %3i, id = %08x, starting, ", task_count, task_id[id_slot]); printf("number = %3i, id = %08x, starting, ", task_count, task_id[id_slot]);
result = rtems_task_start(task_id[id_slot], result = rtems_task_start(task_id[id_slot],
test_task, test_task,
(rtems_task_argument) task_count); (rtems_task_argument) task_count);
if (status_code_bad(result)) if (status_code_bad(result))
{ {
printf( " FAIL : re-starting a task -\n" printf( " FAIL : re-starting a task -\n"
@@ -177,17 +177,17 @@ void test2()
destory_all_tasks("TEST2"); destory_all_tasks("TEST2");
exit( 1 ); exit( 1 );
} }
/* /*
* Update the name. * Update the name.
*/ */
NEXT_TASK_NAME(c1, c2, c3, c4); NEXT_TASK_NAME(c1, c2, c3, c4);
/* /*
* Search the removed ids to see if it existed, clear the removed id when found * 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++) for (remove_task = 0; remove_task < (TASK_ALLOCATION_SIZE * 2); remove_task++)
if (removed_ids[remove_task] == task_id[id_slot]) 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 * If not located in the removed id table, check and make sure it is not
* already allocated * already allocated
*/ */
if (remove_task == (TASK_ALLOCATION_SIZE * 2)) if (remove_task == (TASK_ALLOCATION_SIZE * 2))
{ {
uint32_t allocated_id; uint32_t allocated_id;
for (allocated_id = 0; allocated_id < MAX_TASKS; 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)) if ((task_id[id_slot] == task_id[allocated_id]) && (id_slot != allocated_id))
{ {
@@ -212,7 +212,7 @@ void test2()
task_id[id_slot]); task_id[id_slot]);
exit( 1 ); exit( 1 );
} }
printf( " FAIL2 : could not find the task id in the removed table -\n" printf( " FAIL2 : could not find the task id in the removed table -\n"
" task id = %08x\n", " task id = %08x\n",
task_id[id_slot]); task_id[id_slot]);
@@ -221,8 +221,8 @@ void test2()
task_count++; task_count++;
} }
destory_all_tasks("TEST2"); destory_all_tasks("TEST2");
printf( " TEST2 : completed\n" ); printf( " TEST2 : completed\n" );
} }

View File

@@ -30,12 +30,12 @@ void test3()
uint32_t remove_task; uint32_t remove_task;
uint32_t block; uint32_t block;
uint32_t task_count = 0; uint32_t task_count = 0;
char c1 = 'a'; char c1 = 'a';
char c2 = 'a'; char c2 = 'a';
char c3 = '0'; char c3 = '0';
char c4 = '0'; char c4 = '0';
printf( "\n TEST3 : free more than 3 x allocation size, but not the same block,\n" printf( "\n TEST3 : free more than 3 x allocation size, but not the same block,\n"
" then free a block\n"); " then free a block\n");
@@ -48,17 +48,17 @@ void test3()
printf( " FAIL3 : task allocation size must be greater than 4.\n"); printf( " FAIL3 : task allocation size must be greater than 4.\n");
exit( 1 ); exit( 1 );
} }
/* /*
* Allocate as many tasks as possible. * Allocate as many tasks as possible.
*/ */
while (task_count < MAX_TASKS) while (task_count < MAX_TASKS)
{ {
rtems_name name; rtems_name name;
printf(" TEST3 : creating task '%c%c%c%c', ", c1, c2, c3, c4); printf(" TEST3 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
name = rtems_build_name(c1, c2, c3, c4); name = rtems_build_name(c1, c2, c3, c4);
result = rtems_task_create(name, result = rtems_task_create(name,
@@ -70,23 +70,23 @@ void test3()
if (status_code_bad(result)) if (status_code_bad(result))
break; break;
printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]); printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]);
fflush(stdout); fflush(stdout);
result = rtems_task_start(task_id[task_count], result = rtems_task_start(task_id[task_count],
test_task, test_task,
(rtems_task_argument) task_count); (rtems_task_argument) task_count);
if (status_code_bad(result)) if (status_code_bad(result))
break; break;
/* /*
* Update the name. * Update the name.
*/ */
NEXT_TASK_NAME(c1, c2, c3, c4); NEXT_TASK_NAME(c1, c2, c3, c4);
task_count++; task_count++;
} }
@@ -127,7 +127,7 @@ void test3()
* Remove a complete block, not the first, forces a scan of the blocks in the * Remove a complete block, not the first, forces a scan of the blocks in the
* allocator's free routine * allocator's free routine
*/ */
for (remove_task = (TASK_ALLOCATION_SIZE - TASK_INDEX_OFFSET); for (remove_task = (TASK_ALLOCATION_SIZE - TASK_INDEX_OFFSET);
remove_task < ((TASK_ALLOCATION_SIZE * 2) - - TASK_INDEX_OFFSET); remove_task < ((TASK_ALLOCATION_SIZE * 2) - - TASK_INDEX_OFFSET);
remove_task++) remove_task++)
@@ -139,8 +139,8 @@ void test3()
task_id[remove_task] = 0; task_id[remove_task] = 0;
} }
} }
destory_all_tasks("TEST3"); destory_all_tasks("TEST3");
printf( " TEST3 : completed\n" ); printf( " TEST3 : completed\n" );
} }

View File

@@ -1,6 +1,6 @@
/* /*
* Support for running the test output through a buffer * Support for running the test output through a buffer
* *
* $Id$ * $Id$
*/ */
@@ -27,7 +27,7 @@ extern "C" {
#undef printf #undef printf
#define printf(...) \ #define printf(...) \
do { \ do { \
iprintf( __VA_ARGS__); \ iprintf( __VA_ARGS__); \
} while (0) } while (0)
#endif #endif
@@ -58,7 +58,7 @@ void _test_output_flush(void);
#define printf(...) \ #define printf(...) \
do { \ do { \
char _buffer[128]; \ char _buffer[128]; \
sprintf( _buffer, __VA_ARGS__); \ sprintf( _buffer, __VA_ARGS__); \
_test_output_append( _buffer ); \ _test_output_append( _buffer ); \
} while (0) } while (0)
@@ -66,7 +66,7 @@ void _test_output_flush(void);
#define puts(_string) \ #define puts(_string) \
do { \ do { \
char _buffer[128]; \ char _buffer[128]; \
sprintf( _buffer, "%s\n", _string ); \ sprintf( _buffer, "%s\n", _string ); \
_test_output_append( _buffer ); \ _test_output_append( _buffer ); \
} while (0) } while (0)
@@ -90,7 +90,7 @@ int _test_output_buffer_index = 0;
void _test_output_append(char *_buffer) void _test_output_append(char *_buffer)
{ {
char *p; char *p;
for ( p=_buffer ; *p ; p++ ) { for ( p=_buffer ; *p ; p++ ) {
_test_output_buffer[_test_output_buffer_index++] = *p; _test_output_buffer[_test_output_buffer_index++] = *p;
_test_output_buffer[_test_output_buffer_index] = '\0'; _test_output_buffer[_test_output_buffer_index] = '\0';
@@ -101,7 +101,7 @@ void _test_output_append(char *_buffer)
_test_output_buffer[0] = '\0'; _test_output_buffer[0] = '\0';
} }
#endif #endif
if ( _test_output_buffer_index >= (_TEST_OUTPUT_BUFFER_SIZE - 80) ) if ( _test_output_buffer_index >= (_TEST_OUTPUT_BUFFER_SIZE - 80) )
_test_output_flush(); _test_output_flush();
} }
} }

View File

@@ -31,7 +31,7 @@ extern "C" {
#define FOREVER 1 /* infinite loop */ #define FOREVER 1 /* infinite loop */
#ifdef TEST_INIT #ifdef TEST_INIT
#define TEST_EXTERN #define TEST_EXTERN
#define CONFIGURE_INIT #define CONFIGURE_INIT
#else #else
#define TEST_EXTERN extern #define TEST_EXTERN extern
@@ -53,7 +53,7 @@ extern "C" {
FLUSH_OUTPUT(); \ FLUSH_OUTPUT(); \
rtems_test_exit( 1 ); \ rtems_test_exit( 1 ); \
} \ } \
} while ( 0 ) } while ( 0 )
/* /*
* These macros properly report errors within the Classic API * These macros properly report errors within the Classic API
@@ -83,7 +83,7 @@ extern "C" {
do { \ do { \
check_dispatch_disable_level( _level ); \ check_dispatch_disable_level( _level ); \
fatal_directive_check_status_only( _stat, _desired, _msg ); \ fatal_directive_check_status_only( _stat, _desired, _msg ); \
} while ( 0 ) } while ( 0 )
/* /*
* These macros properly report errors from the POSIX API * These macros properly report errors from the POSIX API

View File

@@ -19,7 +19,7 @@
* How many times a particular operation is performed while timed. * How many times a particular operation is performed while timed.
*/ */
#ifndef OPERATION_COUNT #ifndef OPERATION_COUNT
#define OPERATION_COUNT 100 #define OPERATION_COUNT 100
#endif #endif

View File

@@ -56,7 +56,7 @@ void ITRON_Init( void )
* time one invocation of del_sem * time one invocation of del_sem
*/ */
Timer_initialize(); Timer_initialize();
(void) del_sem( 1 ); (void) del_sem( 1 );
end_time = Read_timer(); end_time = Read_timer();
put_time( put_time(
@@ -107,8 +107,8 @@ void ITRON_Init( void )
/* /*
* time sig_sem (no waiting tasks) * time sig_sem (no waiting tasks)
*/ */
Timer_initialize(); Timer_initialize();
for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) for ( index = 1 ; index<=OPERATION_COUNT ; index++ )
(void) sig_sem( 1 ); (void) sig_sem( 1 );
end_time = Read_timer(); end_time = Read_timer();

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (4 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (4 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 3 #define CONFIGURE_MAXIMUM_TASKS 3
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) #define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE)

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -118,7 +118,7 @@ rtems_task High_task(
) )
{ {
uint32_t size; uint32_t size;
Timer_initialize(); Timer_initialize();
(void) rtems_message_queue_receive( (void) rtems_message_queue_receive(
Queue_id, Queue_id,
@@ -134,7 +134,7 @@ rtems_task Middle_tasks(
) )
{ {
uint32_t size; uint32_t size;
(void) rtems_message_queue_receive( (void) rtems_message_queue_receive(
Queue_id, Queue_id,
(long (*)[4]) Buffer, (long (*)[4]) Buffer,

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -132,7 +132,7 @@ rtems_task High_task(
) )
{ {
uint32_t size; uint32_t size;
(void) rtems_message_queue_receive( (void) rtems_message_queue_receive(
Queue_id, Queue_id,
(long (*)[4]) Buffer, (long (*)[4]) Buffer,

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 4 #define CONFIGURE_MAXIMUM_TASKS 4
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,7 +25,7 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER #define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
@@ -34,7 +34,7 @@ rtems_task Init(
#define CONFIGURE_MAXIMUM_PARTITIONS 1 #define CONFIGURE_MAXIMUM_PARTITIONS 1
#define CONFIGURE_MAXIMUM_REGIONS 1 #define CONFIGURE_MAXIMUM_REGIONS 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,7 +25,7 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
@@ -39,7 +39,7 @@ rtems_task Init(
#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT #define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 4 #define CONFIGURE_MAXIMUM_TASKS 4
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (1 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (1 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_TIMERS OPERATION_COUNT #define CONFIGURE_MAXIMUM_TIMERS OPERATION_COUNT
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (6 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (6 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_MAXIMUM_SEMAPHORES 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -197,15 +197,15 @@ rtems_task High_task(
Timer_initialize(); Timer_initialize();
rtems_interrupt_disable( level ); rtems_interrupt_disable( level );
isr_disable_time = Read_timer(); isr_disable_time = Read_timer();
Timer_initialize(); Timer_initialize();
rtems_interrupt_flash( level ); rtems_interrupt_flash( level );
isr_flash_time = Read_timer(); isr_flash_time = Read_timer();
Timer_initialize(); Timer_initialize();
rtems_interrupt_enable( level ); rtems_interrupt_enable( level );
isr_enable_time = Read_timer(); isr_enable_time = Read_timer();
Timer_initialize(); Timer_initialize();
_Thread_Disable_dispatch(); _Thread_Disable_dispatch();
thread_disable_dispatch_time = Read_timer(); thread_disable_dispatch_time = Read_timer();
@@ -445,7 +445,7 @@ void complete_test( void )
0, 0,
0 0
); );
put_time( put_time(
"_ISR_Enable", "_ISR_Enable",
isr_enable_time, isr_enable_time,
@@ -453,7 +453,7 @@ void complete_test( void )
0, 0,
0 0
); );
put_time( put_time(
"_Thread_Disable_dispatch", "_Thread_Disable_dispatch",
thread_disable_dispatch_time, thread_disable_dispatch_time,

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 3 #define CONFIGURE_MAXIMUM_TASKS 3
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -11,7 +11,7 @@
*/ */
/* /*
* WARNING!!!!!!!!! * WARNING!!!!!!!!!
* *
* THIS TEST USES INTERNAL RTEMS VARIABLES!!! * 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 * regarding the placement of the currently executing task's TCB
* on the ready chains have been violated. At least the assumption * on the ready chains have been violated. At least the assumption
* that this task is at the head of the chain for its priority * 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_Dispatch_disable_level = 0;
_Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].first; _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].first;
_Context_Switch_necessary = 1; _Context_Switch_necessary = 1;
_Thread_Dispatch(); _Thread_Dispatch();

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_PORTS 1 #define CONFIGURE_MAXIMUM_PORTS 1
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -25,14 +25,14 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) #define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT)
#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT #define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) #define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)

View File

@@ -25,13 +25,13 @@ rtems_task Init(
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -35,7 +35,7 @@ rtems_task Init(
rtems_status_code status; 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 ); Set_find_average_overhead( 1 );
@@ -152,12 +152,12 @@ void check_read_timer()
end_time = Read_timer(); end_time = Read_timer();
if ( end_time > MAXIMUM_DISTRIBUTION ) { 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. * consider valid for our testing purposes.
*/ */
printf( "TOO LONG (%d) at index %d!!!\n", end_time, index ); printf( "TOO LONG (%d) at index %d!!!\n", end_time, index );
#if defined(unix) #if defined(unix)
index--; index--;
continue; continue;
#else #else
rtems_test_exit( 1 ); rtems_test_exit( 1 );

View File

@@ -25,31 +25,31 @@ rtems_task Init(
rtems_timer_service_routine Timer_handler( rtems_timer_service_routine Timer_handler(
rtems_id argument rtems_id argument
); );
rtems_asr Isr_handler( rtems_asr Isr_handler(
rtems_signal_set signals rtems_signal_set signals
); );
rtems_asr Asr_handler( rtems_asr Asr_handler(
rtems_signal_set signals rtems_signal_set signals
); );
rtems_task task_func(); rtems_task task_func();
void null_func(); void null_func();
rtems_status_code Empty_directive(); rtems_status_code Empty_directive();
#include <timesys.h> #include <timesys.h>
/* configuration information */ /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_TICKS_PER_TIMESLICE 0
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#include <rtems/confdefs.h> #include <rtems/confdefs.h>

View File

@@ -13,7 +13,7 @@
static char buf[512]; static char buf[512];
static void static void
usage(void) usage(void)
{ {
printf("usage: binpatch [-h] <ofile> <ifile> <reloc> <off> <byte0> " printf("usage: binpatch [-h] <ofile> <ifile> <reloc> <off> <byte0> "
@@ -40,8 +40,8 @@ main(int argc, char **argv)
FILE *ofp, *ifp; FILE *ofp, *ifp;
char patch[4], *end; char patch[4], *end;
int patchLen, tmp, i, off, cnt, patched, len, reloc; int patchLen, tmp, i, off, cnt, patched, len, reloc;
/* parse command line options */ /* parse command line options */
while ((c = getopt(argc, argv, "h")) >= 0) while ((c = getopt(argc, argv, "h")) >= 0)
{ {
@@ -93,7 +93,7 @@ main(int argc, char **argv)
} }
patch[i] = tmp; patch[i] = tmp;
} }
ifp = fopen(argv[2], "r"); ifp = fopen(argv[2], "r");
if(ifp == NULL) if(ifp == NULL)
{ {
@@ -137,7 +137,7 @@ main(int argc, char **argv)
} }
patched = 1; patched = 1;
} }
fwrite(buf, 1, len, ofp); fwrite(buf, 1, len, ofp);
cnt += len; cnt += len;
@@ -145,7 +145,7 @@ main(int argc, char **argv)
fclose(ifp); fclose(ifp);
fclose(ofp); fclose(ofp);
if(!patched) if(!patched)
{ {
fprintf(stderr, "warning: offset is beyond input file length\n"); fprintf(stderr, "warning: offset is beyond input file length\n");

View File

@@ -493,7 +493,7 @@ int main(
} }
length = strlen(inbuff); length = strlen(inbuff);
inbuff[length - 1] = '\0'; inbuff[length - 1] = '\0';
} }

View File

@@ -111,7 +111,7 @@ void error(int errn, ...);
#else #else
#define stol(p) strtol(p, (char **) NULL, 0) #define stol(p) strtol(p, (char **) NULL, 0)
#endif #endif
int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm); int unhex(FILE *ifp, char *inm, FILE *ofp, char *onm);
int convert_Intel_records(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_S_records(FILE *ifp, char *inm, FILE *ofp, char *onm);

View File

@@ -12,11 +12,11 @@
/* /*
n .. baudrate generator source 0,1,2,3 n .. baudrate generator source 0,1,2,3
N .. BRR setting (0..255) N .. BRR setting (0..255)
Phi .. processor baud rate Phi .. processor baud rate
B .. bitrate B .. bitrate
*/ */
@@ -51,20 +51,20 @@ static unsigned int bitrate [] = {
static sci_tab_t test_array[4] ; static sci_tab_t test_array[4] ;
static void Compute( static void Compute(
unsigned int n, unsigned int n,
unsigned int B, unsigned int B,
double Phi, double Phi,
struct sci_tab *entry ) struct sci_tab *entry )
{ {
int a = ( 32 << ( 2 * n ) ) * B ; int a = ( 32 << ( 2 * n ) ) * B ;
entry->n = n ; entry->n = n ;
entry->B = B ; entry->B = B ;
entry->N = rint( ( Phi / a ) - 1.0 ) ; entry->N = rint( ( Phi / a ) - 1.0 ) ;
if ( ( entry->N > 0 ) && ( entry->N < 256 ) ) if ( ( entry->N > 0 ) && ( entry->N < 256 ) )
entry->err = entry->err =
( ( Phi / ( (entry->N + 1) * a ) - 1.0 ) * 100.0 ); ( ( Phi / ( (entry->N + 1) * a ) - 1.0 ) * 100.0 );
else else
{ {
@@ -74,17 +74,17 @@ static void Compute(
} }
} }
static sci_tab_t *SelectN( static sci_tab_t *SelectN(
unsigned int B, unsigned int B,
double Phi ) double Phi )
{ {
unsigned int i ; unsigned int i ;
struct sci_tab* best = NULL ; struct sci_tab* best = NULL ;
for ( i = 0 ; i < 4 ; i++ ) for ( i = 0 ; i < 4 ; i++ )
{ {
double err ; double err ;
Compute( i, B, Phi, &test_array[i] ); Compute( i, B, Phi, &test_array[i] );
err = fabs( test_array[i].err ); err = fabs( test_array[i].err );
@@ -97,7 +97,7 @@ static sci_tab_t *SelectN(
best = &test_array[i] ; best = &test_array[i] ;
} }
return best ; return best ;
} }
int shgen_gensci( int shgen_gensci(
@@ -106,7 +106,7 @@ int shgen_gensci(
{ {
unsigned int i ; unsigned int i ;
fprintf( file, fprintf( file,
"/*\n * Bitrate table for the serial devices (sci) of the SH at %.3f MHz\n" "/*\n * Bitrate table for the serial devices (sci) of the SH at %.3f MHz\n"
" */\n\n", Phi / 1000000.0 ); " */\n\n", Phi / 1000000.0 );
fprintf( file, fprintf( file,
@@ -118,13 +118,13 @@ int shgen_gensci(
" * We experienced values less than 2%% to be stable\n" " * We experienced values less than 2%% to be stable\n"
" */\n\n" ); " */\n\n" );
fprintf( file, "#include <termios.h>\n\n" ); fprintf( file, "#include <termios.h>\n\n" );
fprintf( file, fprintf( file,
"static struct sci_bitrate_t {\n" "static struct sci_bitrate_t {\n"
" unsigned char n ;\n" " unsigned char n ;\n"
" unsigned char N ;\n" " unsigned char N ;\n"
"} _sci_bitrates[] = {\n" "} _sci_bitrates[] = {\n"
"/* n N error */\n" ); "/* n N error */\n" );
for ( i = 0 ; i < sizeof(bitrate)/sizeof(int) ; i++ ) for ( i = 0 ; i < sizeof(bitrate)/sizeof(int) ; i++ )
{ {
struct sci_tab* best = SelectN( bitrate[i], Phi ); struct sci_tab* best = SelectN( bitrate[i], Phi );
@@ -143,7 +143,7 @@ int shgen_gensci(
fprintf( file, "\n};\n\n" ); fprintf( file, "\n};\n\n" );
fprintf( file, fprintf( file,
"int _sci_get_brparms( \n" "int _sci_get_brparms( \n"
" tcflag_t cflag,\n" " tcflag_t cflag,\n"
" unsigned char *smr,\n" " unsigned char *smr,\n"
@@ -160,6 +160,6 @@ int shgen_gensci(
" *brr = _sci_bitrates[offset].N;\n\n" " *brr = _sci_bitrates[offset].N;\n\n"
" return 0;\n" " return 0;\n"
"}\n" ); "}\n" );
return 0 ; return 0 ;
} }

View File

@@ -44,12 +44,12 @@ static struct option long_options[] =
static void shgen_header( FILE *file ) static void shgen_header( FILE *file )
{ {
fprintf( file, fprintf( file,
"/*\n * DO NOT EDIT - this file is automatically generated by shgen %s\n", "/*\n * DO NOT EDIT - this file is automatically generated by shgen %s\n",
VERSION ); VERSION );
fprintf( file, fprintf( file,
" * Copyright (c) 1998,1999,2000 Ralf Corsepius (corsepiu@faw.uni-ulm.de)\n */\n" ); " * 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" ); "\n/* This file is not copyrighted */\n\n" );
} }
@@ -57,7 +57,7 @@ int main( int argc, char *argv[] )
{ {
double Phi = 20000000.0 ; double Phi = 20000000.0 ;
#if HAVE_GETOPT_LONG #if HAVE_GETOPT_LONG
int option_index = 0 ; int option_index = 0 ;
while( ( optopt = getopt_long( argc, argv, "M:K:H:hv", while( ( optopt = getopt_long( argc, argv, "M:K:H:hv",
long_options, &option_index ) ) > 0 ) long_options, &option_index ) ) > 0 )
@@ -68,11 +68,11 @@ int main( int argc, char *argv[] )
switch ( optopt ) switch ( optopt )
{ {
case 'M' : case 'M' :
sscanf( optarg, "%lf", &Phi ); sscanf( optarg, "%lf", &Phi );
Phi = Phi * 1000000.0; Phi = Phi * 1000000.0;
break ; break ;
case 'K' : case 'K' :
sscanf( optarg, "%lf", &Phi ); sscanf( optarg, "%lf", &Phi );
Phi = Phi * 1000.0; Phi = Phi * 1000.0;
break ; break ;
case 'H' : case 'H' :
@@ -96,9 +96,9 @@ int main( int argc, char *argv[] )
fprintf( stderr, "%s: Missing argument: driver\n", argv[0] ); fprintf( stderr, "%s: Missing argument: driver\n", argv[0] );
exit(1); exit(1);
} }
shgen_header( stdout ); shgen_header( stdout );
if ( strcmp( argv[optind], "sci" ) == 0 ) if ( strcmp( argv[optind], "sci" ) == 0 )
{ {
shgen_gensci( stdout, Phi ); shgen_gensci( stdout, Phi );
@@ -108,6 +108,6 @@ int main( int argc, char *argv[] )
fprintf( stderr, "%s: Invalid argument: driver\n", argv[0] ); fprintf( stderr, "%s: Invalid argument: driver\n", argv[0] );
exit(1); exit(1);
} }
return 0 ; return 0 ;
} }