Convert to "bool".

This commit is contained in:
Ralf Corsepius
2008-09-05 08:46:27 +00:00
parent a65f9a227b
commit 907bf4b86b
27 changed files with 66 additions and 65 deletions

View File

@@ -28,6 +28,6 @@ benchmark_timer_read(void)
} }
void void
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
} }

View File

@@ -104,7 +104,7 @@ rtems_device_driver console_initialize(
* FALSE - no character available * FALSE - no character available
*/ */
rtems_boolean is_character_ready( bool is_character_ready(
char *ch /* -> character */ char *ch /* -> character */
) )
{ {
@@ -113,12 +113,12 @@ rtems_boolean is_character_ready(
for (;;) { for (;;) {
if (RXS & RBIT_HDLC_EMPTY_BIT) if (RXS & RBIT_HDLC_EMPTY_BIT)
return FALSE; return false;
*ch = RXD; *ch = RXD;
RXS = RBIT_HDLC_EMPTY_BIT | RBIT_HDLC_WRAP_BIT; RXS = RBIT_HDLC_EMPTY_BIT | RBIT_HDLC_WRAP_BIT;
if ( *ch >= ' ' && *ch <= '~' ) if ( *ch >= ' ' && *ch <= '~' )
return TRUE; return true;
} }
} }

View File

@@ -40,7 +40,7 @@
uint32_t Timer_interrupts; uint32_t Timer_interrupts;
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
@@ -95,7 +95,7 @@ int benchmark_timer_read( void )
total = (Timer_interrupts * TRR2_VAL) + clicks; total = (Timer_interrupts * TRR2_VAL) + clicks;
if ( benchmark_timer_find_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == true )
return total; /* in XXX microsecond units */ return total; /* in XXX microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -109,7 +109,7 @@ int benchmark_timer_read( void )
} }
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -269,6 +269,6 @@ benchmark_timer_read (void)
Description: - Description: -
*****************************************************/ *****************************************************/
void void
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
} }

View File

@@ -85,7 +85,7 @@ static rtems_status_code m360_spi_char_mode
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
m360_spi_softc_t *softc_ptr, /* handle */ m360_spi_softc_t *softc_ptr, /* handle */
uint32_t bits_per_char, /* bits per character */ uint32_t bits_per_char, /* bits per character */
boolean lsb_first, /* TRUE: send LSB first */ bool lsb_first, /* TRUE: send LSB first */
uint16_t *spimode /* result value */ uint16_t *spimode /* result value */
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\

View File

@@ -79,6 +79,6 @@ benchmark_timer_read (void)
} }
void void
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
} }

View File

@@ -54,13 +54,13 @@
#include <bsp.h> #include <bsp.h>
#include <mcf548x/mcf548x.h> #include <mcf548x/mcf548x.h>
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
static uint32_t microsecond_timer_value = 0; static uint32_t microsecond_timer_value = 0;
void benchmark_timer_initialize(void) void benchmark_timer_initialize(void)
{ {
MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF; MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF;
MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN); MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
} }
/* /*
@@ -70,12 +70,13 @@ MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
int int
benchmark_timer_read(void) benchmark_timer_read(void)
{ {
microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100; microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100;
return microsecond_timer_value; return microsecond_timer_value;
} }
void void
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -85,16 +85,16 @@ rtems_device_driver console_initialize(
* Return values: * Return values:
*/ */
rtems_boolean is_character_ready( bool is_character_ready(
char *ch, char *ch,
int port int port
) )
{ {
if ( Ring_buffer_Is_empty( &Console_Buffer[ port ] ) ) if ( Ring_buffer_Is_empty( &Console_Buffer[ port ] ) )
return FALSE; return false;
Ring_buffer_Remove_character( &Console_Buffer[ port ], *ch ); Ring_buffer_Remove_character( &Console_Buffer[ port ], *ch );
return TRUE; return true;
} }
/* quick_char_check /* quick_char_check
@@ -109,14 +109,14 @@ rtems_boolean is_character_ready(
* Return values: * Return values:
*/ */
rtems_boolean quick_char_check( bool quick_char_check(
int port int port
) )
{ {
if ( Ring_buffer_Is_empty( &Console_Buffer[ port ] ) ) if ( Ring_buffer_Is_empty( &Console_Buffer[ port ] ) )
return FALSE; return false;
return TRUE; return true;
} }
/* inbyte /* inbyte

View File

@@ -32,7 +32,7 @@
#define TIMER_VECTOR 0x4D #define TIMER_VECTOR 0x4D
int Ttimer_val; int Ttimer_val;
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
@@ -93,7 +93,7 @@ int benchmark_timer_read(void)
MC68230_WRITE (MC68230_TCR, 0xA1); MC68230_WRITE (MC68230_TCR, 0xA1);
/* do not restore old vector */ /* do not restore old vector */
if ( benchmark_timer_find_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == true )
return total; /* in countdown units */ return total; /* in countdown units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -106,7 +106,7 @@ int benchmark_timer_read(void)
} }
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -33,6 +33,6 @@ int benchmark_timer_read(void)
return MCF_DTIM3_DTCN; return MCF_DTIM3_DTCN;
} }
void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
} }

View File

@@ -28,6 +28,6 @@ benchmark_timer_read(void)
} }
void void
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
} }

View File

@@ -34,6 +34,6 @@ int benchmark_timer_read(void)
return MCF_DTIM3_DTCN; return MCF_DTIM3_DTCN;
} }
void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
} }

View File

@@ -21,7 +21,7 @@
#include <bsp.h> #include <bsp.h>
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
extern rtems_isr Clock_isr(void); extern rtems_isr Clock_isr(void);
@@ -54,7 +54,7 @@ int benchmark_timer_read( void )
uint32_t total; uint32_t total;
total = 0; total = 0;
if ( benchmark_timer_find_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == true )
return total; /* in XXX microsecond units */ return total; /* in XXX microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -64,7 +64,7 @@ int benchmark_timer_read( void )
} }
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -61,15 +61,15 @@ rtems_device_driver console_initialize(
* Return values: * Return values:
*/ */
rtems_boolean is_character_ready( bool is_character_ready(
char *ch char *ch
) )
{ {
if ( !(_Read_m681->srb & RXRDYB) ) if ( !(_Read_m681->srb & RXRDYB) )
return(FALSE); return false;
*ch = _Read_m681->rbb; *ch = _Read_m681->rbb;
return(TRUE); return true;
} }
/* inbyte /* inbyte

View File

@@ -29,7 +29,7 @@
#define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */ #define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */
int Ttimer_val; int Ttimer_val;
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
@@ -82,7 +82,7 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
*/ */
total = (Ttimer_val * 0x10000) + remaining; total = (Ttimer_val * 0x10000) + remaining;
if ( benchmark_timer_find_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == true )
return total; /* in one-half microsecond units */ return total; /* in one-half microsecond units */
else { else {
@@ -93,7 +93,7 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
} }
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -65,7 +65,7 @@ rtems_device_driver console_initialize(
* Return values: * Return values:
*/ */
rtems_boolean is_character_ready( bool is_character_ready(
char *ch char *ch
) )
{ {
@@ -74,10 +74,10 @@ rtems_boolean is_character_ready(
for ( ; ; ) { for ( ; ; ) {
Z8x30_READ_CONTROL( CONSOLE_CONTROL, RR_0, rr_0 ); Z8x30_READ_CONTROL( CONSOLE_CONTROL, RR_0, rr_0 );
if ( !(rr_0 & RR_0_RX_DATA_AVAILABLE) ) if ( !(rr_0 & RR_0_RX_DATA_AVAILABLE) )
return( FALSE ); return false;
Z8x30_READ_DATA( CONSOLE_DATA, *ch ); Z8x30_READ_DATA( CONSOLE_DATA, *ch );
return( TRUE ); return true;
} }
} }

View File

@@ -32,7 +32,7 @@
/* Each tick is 6.25 us */ /* Each tick is 6.25 us */
int Ttimer_val; int Ttimer_val;
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
@@ -71,7 +71,7 @@ int benchmark_timer_read(void)
} }
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -110,14 +110,14 @@ rtems_device_driver console_initialize(
* Non-blocking char input * Non-blocking char input
*/ */
rtems_boolean char_ready(int port, char *ch) bool char_ready(int port, char *ch)
{ {
if ( Ring_buffer_Is_empty( &Console_Buffer[port] ) ) if ( Ring_buffer_Is_empty( &Console_Buffer[port] ) )
return FALSE; return false;
Ring_buffer_Remove_character( &Console_Buffer[port], *ch ); Ring_buffer_Remove_character( &Console_Buffer[port], *ch );
return TRUE; return false;
} }
/* /*

View File

@@ -127,9 +127,9 @@ typedef volatile struct {
enum {portB, portA}; enum {portB, portA};
rtems_boolean char_ready(int port, char *ch); extern bool char_ready(int port, char *ch);
char char_wait(int port); extern char char_wait(int port);
void char_put(int port, char ch); extern void char_put(int port, char ch);
#define TX_BUFFER_EMPTY 0x04 #define TX_BUFFER_EMPTY 0x04
#define RX_DATA_AVAILABLE 0x01 #define RX_DATA_AVAILABLE 0x01

View File

@@ -38,7 +38,7 @@
#define TIMER_INT_LEVEL 6 #define TIMER_INT_LEVEL 6
uint32_t Ttimer_val; uint32_t Ttimer_val;
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
@@ -69,7 +69,7 @@ int benchmark_timer_read(void)
total = (Ttimer_val * TICK_INTERVAL) + lcsr->timer_cnt_1; total = (Ttimer_val * TICK_INTERVAL) + lcsr->timer_cnt_1;
if ( benchmark_timer_find_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == true )
return total; /* in one-half microsecond units */ return total; /* in one-half microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -79,7 +79,7 @@ int benchmark_timer_read(void)
} }
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -138,7 +138,7 @@ void cd2401_udelay( unsigned long delay );
void cd2401_chan_cmd( uint8_t channel, uint8_t cmd, uint8_t wait ); void cd2401_chan_cmd( uint8_t channel, uint8_t cmd, uint8_t wait );
uint16_t cd2401_bitrate_divisor( uint32_t clkrate, uint32_t * bitrate ); uint16_t cd2401_bitrate_divisor( uint32_t clkrate, uint32_t * bitrate );
void cd2401_initialize( void ); void cd2401_initialize( void );
void cd2401_interrupts_initialize( rtems_boolean enable ); void cd2401_interrupts_initialize( bool enable );
/* ISRs */ /* ISRs */
rtems_isr cd2401_modem_isr( rtems_vector_number vector ); rtems_isr cd2401_modem_isr( rtems_vector_number vector );
@@ -410,7 +410,7 @@ void cd2401_initialize( void )
* THE LAST CD2401 CHANNEL CLOSED SHOULD DISABLE INTERRUPTS. * THE LAST CD2401 CHANNEL CLOSED SHOULD DISABLE INTERRUPTS.
*/ */
void cd2401_interrupts_initialize( void cd2401_interrupts_initialize(
rtems_boolean enable bool enable
) )
{ {
if ( enable ) { if ( enable ) {

View File

@@ -63,7 +63,7 @@ static int mystrcat(
*/ */
User_extensions_routine bsp_fatal_error_occurred( User_extensions_routine bsp_fatal_error_occurred(
Internal_errors_Source the_source, Internal_errors_Source the_source,
rtems_boolean is_internal, bool is_internal,
uint32_t the_error uint32_t the_error
) )
{ {

View File

@@ -14,6 +14,6 @@
User_extensions_routine bsp_fatal_error_occurred( User_extensions_routine bsp_fatal_error_occurred(
Internal_errors_Source the_source, Internal_errors_Source the_source,
rtems_boolean is_internal, bool is_internal,
uint32_t the_error uint32_t the_error
); );

View File

@@ -42,11 +42,11 @@
uint32_t Ttimer_val; uint32_t Ttimer_val;
/* /*
* Set to TRUE to return raw value. Normally zero. Depends on being allocated * Set to true to return raw value. Normally zero. Depends on being allocated
* in the .bss section and on that section being explicitly zeroed at boot * in the .bss section and on that section being explicitly zeroed at boot
* time. * time.
*/ */
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
@@ -129,7 +129,7 @@ int benchmark_timer_read(void)
* Output parameters: time in microseconds * Output parameters: time in microseconds
*/ */
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -64,16 +64,16 @@ rtems_device_driver console_initialize(
* FALSE - no character available * FALSE - no character available
*/ */
rtems_boolean is_character_ready( bool is_character_ready(
char *ch /* -> character */ char *ch /* -> character */
) )
{ {
if (debug_port_status(0)) if (debug_port_status(0))
{ {
*ch = debug_port_in(); *ch = debug_port_in();
return TRUE; return true;
} }
return FALSE; return false;
} }
/* inbyte /* inbyte

View File

@@ -40,7 +40,7 @@
uint32_t Timer_interrupts; uint32_t Timer_interrupts;
rtems_boolean benchmark_timer_find_average_overhead; bool benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
@@ -95,7 +95,7 @@ int benchmark_timer_read( void )
total = (Timer_interrupts * TRR2_VAL) + clicks; total = (Timer_interrupts * TRR2_VAL) + clicks;
if ( benchmark_timer_find_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == true )
return total; /* in XXX microsecond units */ return total; /* in XXX microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -109,7 +109,7 @@ int benchmark_timer_read( void )
} }
void benchmark_timer_disable_subtracting_average_overhead( void benchmark_timer_disable_subtracting_average_overhead(
rtems_boolean find_flag bool find_flag
) )
{ {
benchmark_timer_find_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;

View File

@@ -41,6 +41,6 @@ benchmark_timer_read(void)
} }
void void
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
{ {
} }