forked from Imagelibrary/rtems
Convert to "bool".
This commit is contained in:
@@ -40,8 +40,8 @@ i2c_transfer_sema_done_func(uint32_t arg)
|
|||||||
static void
|
static void
|
||||||
i2c_transfer_poll_done_func(uint32_t arg)
|
i2c_transfer_poll_done_func(uint32_t arg)
|
||||||
{
|
{
|
||||||
rtems_boolean *poll_done_flag = (rtems_boolean *)arg;
|
bool *poll_done_flag = (bool *)arg;
|
||||||
*poll_done_flag = 1;
|
*poll_done_flag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* i2c_transfer_wait_sema --
|
/* i2c_transfer_wait_sema --
|
||||||
@@ -98,14 +98,14 @@ i2c_transfer_wait_sema(i2c_bus_number bus, i2c_message *msg, int nmsg)
|
|||||||
static rtems_status_code
|
static rtems_status_code
|
||||||
i2c_transfer_wait_poll(i2c_bus_number bus, i2c_message *msg, int nmsg)
|
i2c_transfer_wait_poll(i2c_bus_number bus, i2c_message *msg, int nmsg)
|
||||||
{
|
{
|
||||||
volatile rtems_boolean poll_done_flag;
|
volatile bool poll_done_flag;
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
poll_done_flag = 0;
|
poll_done_flag = false;
|
||||||
sc = i2c_transfer(bus, nmsg, msg, i2c_transfer_poll_done_func,
|
sc = i2c_transfer(bus, nmsg, msg, i2c_transfer_poll_done_func,
|
||||||
(uint32_t)&poll_done_flag);
|
(uint32_t)&poll_done_flag);
|
||||||
if (sc != RTEMS_SUCCESSFUL)
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
return sc;
|
return sc;
|
||||||
while (poll_done_flag == 0)
|
while (poll_done_flag == false)
|
||||||
{
|
{
|
||||||
i2c_poll(bus);
|
i2c_poll(bus);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ static volatile int tqueue_head;
|
|||||||
static volatile int tqueue_tail;
|
static volatile int tqueue_tail;
|
||||||
|
|
||||||
/* MBus I2C bus controller busy flag */
|
/* MBus I2C bus controller busy flag */
|
||||||
static volatile rtems_boolean mbus_busy;
|
static volatile bool mbus_busy;
|
||||||
|
|
||||||
/* MBus I2C bus controller descriptor */
|
/* MBus I2C bus controller descriptor */
|
||||||
static mcfmbus mbus;
|
static mcfmbus mbus;
|
||||||
@@ -91,7 +91,7 @@ i2cdrv_done(uint32_t arg)
|
|||||||
qel->done(qel->done_arg);
|
qel->done(qel->done_arg);
|
||||||
rtems_interrupt_disable(level);
|
rtems_interrupt_disable(level);
|
||||||
tqueue_tail = (tqueue_tail + 1) % tqueue_size;
|
tqueue_tail = (tqueue_tail + 1) % tqueue_size;
|
||||||
mbus_busy = 0;
|
mbus_busy = false;
|
||||||
rtems_interrupt_enable(level);
|
rtems_interrupt_enable(level);
|
||||||
i2cdrv_unload();
|
i2cdrv_unload();
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ i2cdrv_unload(void)
|
|||||||
rtems_interrupt_disable(level);
|
rtems_interrupt_disable(level);
|
||||||
if (!mbus_busy && (tqueue_head != tqueue_tail))
|
if (!mbus_busy && (tqueue_head != tqueue_tail))
|
||||||
{
|
{
|
||||||
mbus_busy = 1;
|
mbus_busy = true;
|
||||||
rtems_interrupt_enable(level);
|
rtems_interrupt_enable(level);
|
||||||
qel = tqueue + tqueue_tail;
|
qel = tqueue + tqueue_tail;
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ i2cdrv_initialize(rtems_device_major_number major,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
mbus_busy = 0;
|
mbus_busy = false;
|
||||||
tqueue_tail = tqueue_head = 0;
|
tqueue_tail = tqueue_head = 0;
|
||||||
tqueue_size = 32;
|
tqueue_size = 32;
|
||||||
tqueue = calloc(tqueue_size, sizeof(i2c_qel));
|
tqueue = calloc(tqueue_size, sizeof(i2c_qel));
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ rtems_device_driver console_initialize(
|
|||||||
* Return values:
|
* Return values:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_boolean is_character_ready(
|
bool is_character_ready(
|
||||||
char *ch
|
char *ch
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -82,10 +82,10 @@ rtems_boolean is_character_ready(
|
|||||||
{
|
{
|
||||||
*ch = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK)
|
*ch = (data & ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK)
|
||||||
>> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST;
|
>> ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST;
|
||||||
return TRUE;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* inbyte
|
/* inbyte
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
|
|
||||||
volatile uint32_t Timer_interrupts;
|
volatile uint32_t Timer_interrupts;
|
||||||
rtems_boolean benchmark_timer_find_average_overhead;
|
bool benchmark_timer_find_average_overhead;
|
||||||
|
|
||||||
#define TIMER_REGS ((altera_avalon_timer_regs*)NIOS2_IO_BASE(TIMER_BASE))
|
#define TIMER_REGS ((altera_avalon_timer_regs*)NIOS2_IO_BASE(TIMER_BASE))
|
||||||
|
|
||||||
@@ -133,9 +133,7 @@ int benchmark_timer_read( void )
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
void benchmark_timer_disable_subtracting_average_overhead(
|
void benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
|
||||||
rtems_boolean find_flag
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
benchmark_timer_find_average_overhead = find_flag;
|
benchmark_timer_find_average_overhead = find_flag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ rtems_device_driver console_initialize(
|
|||||||
* Return values:
|
* Return values:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_boolean is_character_ready(
|
bool is_character_ready(
|
||||||
char *ch
|
char *ch
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
*ch = '\0'; /* return NULL for no particular reason */
|
*ch = '\0'; /* return NULL for no particular reason */
|
||||||
return(TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* inbyte
|
/* inbyte
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
|
|
||||||
uint32_t Timer_interrupts;
|
uint32_t Timer_interrupts;
|
||||||
rtems_boolean benchmark_timer_find_average_overhead;
|
bool benchmark_timer_find_average_overhead;
|
||||||
|
|
||||||
void benchmark_timer_initialize( void )
|
void benchmark_timer_initialize( void )
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ int benchmark_timer_read( void )
|
|||||||
|
|
||||||
total = clicks * 0;
|
total = clicks * 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 */
|
||||||
else {
|
else {
|
||||||
if ( total < LEAST_VALID )
|
if ( total < LEAST_VALID )
|
||||||
@@ -86,7 +86,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;
|
||||||
|
|||||||
@@ -362,7 +362,8 @@ console_tbl Console_Port_Tbl[] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static boolean config_68360_scc_base_probe(int minor, unsigned long busNo, unsigned long slotNo, int channel){
|
static bool config_68360_scc_base_probe(int minor, unsigned long busNo, unsigned long slotNo, int channel)
|
||||||
|
{
|
||||||
M68360_t chip = M68360_chips;
|
M68360_t chip = M68360_chips;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -375,19 +376,19 @@ static boolean config_68360_scc_base_probe(int minor, unsigned long busNo, unsig
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!chip)
|
if (!chip)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
Console_Port_Tbl[minor].pDeviceParams = &chip->port[ channel-1 ];
|
Console_Port_Tbl[minor].pDeviceParams = &chip->port[ channel-1 ];
|
||||||
chip->port[ channel-1 ].minor = minor;
|
chip->port[ channel-1 ].minor = minor;
|
||||||
return (TRUE);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean config_68360_scc_base_probe_1( int minor ) {
|
static bool config_68360_scc_base_probe_1( int minor ) {
|
||||||
return config_68360_scc_base_probe( minor, 0, 11, 1);
|
return config_68360_scc_base_probe(minor, 0, 11, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean config_68360_scc_base_probe_2( int minor ) {
|
static bool config_68360_scc_base_probe_2( int minor ) {
|
||||||
return config_68360_scc_base_probe( minor, 0, 11, 2);
|
return config_68360_scc_base_probe(minor, 0, 11, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean config_68360_scc_base_probe_3( int minor ) {
|
static boolean config_68360_scc_base_probe_3( int minor ) {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
console_data Console_Port_Data[NUM_CONSOLE_PORTS];
|
console_data Console_Port_Data[NUM_CONSOLE_PORTS];
|
||||||
unsigned long Console_Port_Count;
|
unsigned long Console_Port_Count;
|
||||||
rtems_device_minor_number Console_Port_Minor;
|
rtems_device_minor_number Console_Port_Minor;
|
||||||
rtems_boolean Console_Is_Initialized = FALSE;
|
bool Console_Is_Initialized = false;
|
||||||
/* PAGE
|
/* PAGE
|
||||||
*
|
*
|
||||||
* console_open
|
* console_open
|
||||||
@@ -219,7 +219,7 @@ rtems_device_driver console_initialize(
|
|||||||
if ( Console_Port_Tbl[Console_Port_Minor].pDeviceFns->deviceInitialize ) {
|
if ( Console_Port_Tbl[Console_Port_Minor].pDeviceFns->deviceInitialize ) {
|
||||||
Console_Port_Tbl[Console_Port_Minor]
|
Console_Port_Tbl[Console_Port_Minor]
|
||||||
.pDeviceFns->deviceInitialize(Console_Port_Minor);
|
.pDeviceFns->deviceInitialize(Console_Port_Minor);
|
||||||
Console_Is_Initialized = TRUE;
|
Console_Is_Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(minor++;minor<Console_Port_Count;minor++)
|
for(minor++;minor<Console_Port_Count;minor++)
|
||||||
|
|||||||
@@ -71,10 +71,10 @@ static uint16_t kbd_end = KBD_BUF_SIZE - 1;
|
|||||||
| Global Variables: key_map, shift_map.
|
| Global Variables: key_map, shift_map.
|
||||||
| Arguments: outChar - character read in case of a valid reading,
|
| Arguments: outChar - character read in case of a valid reading,
|
||||||
| otherwise unchanged.
|
| otherwise unchanged.
|
||||||
| Returns: TRUE in case a valid character has been read,
|
| Returns: true in case a valid character has been read,
|
||||||
| FALSE otherwise.
|
| false otherwise.
|
||||||
+--------------------------------------------------------------------------*/
|
+--------------------------------------------------------------------------*/
|
||||||
rtems_boolean
|
bool
|
||||||
_IBMPC_scankey(char *outChar)
|
_IBMPC_scankey(char *outChar)
|
||||||
{
|
{
|
||||||
unsigned char inChar;
|
unsigned char inChar;
|
||||||
@@ -84,7 +84,7 @@ _IBMPC_scankey(char *outChar)
|
|||||||
static int caps_pressed = 0;
|
static int caps_pressed = 0;
|
||||||
static int extended = 0;
|
static int extended = 0;
|
||||||
|
|
||||||
*outChar = 0; /* default value if we return FALSE */
|
*outChar = 0; /* default value if we return false */
|
||||||
|
|
||||||
/* Read keyboard controller, toggle enable */
|
/* Read keyboard controller, toggle enable */
|
||||||
inChar=kbd_inb(KBD_CTL);
|
inChar=kbd_inb(KBD_CTL);
|
||||||
@@ -95,7 +95,7 @@ _IBMPC_scankey(char *outChar)
|
|||||||
/* See if it has data */
|
/* See if it has data */
|
||||||
inChar=kbd_inb(KBD_STATUS);
|
inChar=kbd_inb(KBD_STATUS);
|
||||||
if ((inChar & 0x01) == 0)
|
if ((inChar & 0x01) == 0)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
/* Read the data. Handle nonsense with shift, control, etc. */
|
/* Read the data. Handle nonsense with shift, control, etc. */
|
||||||
inChar=kbd_inb(KBD_DATA);
|
inChar=kbd_inb(KBD_DATA);
|
||||||
@@ -107,49 +107,49 @@ _IBMPC_scankey(char *outChar)
|
|||||||
{
|
{
|
||||||
case 0xe0:
|
case 0xe0:
|
||||||
extended = 2;
|
extended = 2;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x38:
|
case 0x38:
|
||||||
alt_pressed = 1;
|
alt_pressed = 1;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
case 0xb8:
|
case 0xb8:
|
||||||
alt_pressed = 0;
|
alt_pressed = 0;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x1d:
|
case 0x1d:
|
||||||
ctrl_pressed = 1;
|
ctrl_pressed = 1;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
case 0x9d:
|
case 0x9d:
|
||||||
ctrl_pressed = 0;
|
ctrl_pressed = 0;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x2a:
|
case 0x2a:
|
||||||
if (extended)
|
if (extended)
|
||||||
return FALSE;
|
return false;
|
||||||
case 0x36:
|
case 0x36:
|
||||||
shift_pressed = 1;
|
shift_pressed = 1;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
case 0xaa:
|
case 0xaa:
|
||||||
if (extended)
|
if (extended)
|
||||||
return FALSE;
|
return false;
|
||||||
case 0xb6:
|
case 0xb6:
|
||||||
shift_pressed = 0;
|
shift_pressed = 0;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x3a:
|
case 0x3a:
|
||||||
caps_pressed = 1;
|
caps_pressed = 1;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
case 0xba:
|
case 0xba:
|
||||||
caps_pressed = 0;
|
caps_pressed = 0;
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x53:
|
case 0x53:
|
||||||
@@ -163,7 +163,7 @@ _IBMPC_scankey(char *outChar)
|
|||||||
default:
|
default:
|
||||||
if ((inChar & 0x80) || (inChar > 0x39))
|
if ((inChar & 0x80) || (inChar > 0x39))
|
||||||
/* High-bit on means key is being released, not pressed */
|
/* High-bit on means key is being released, not pressed */
|
||||||
return FALSE;
|
return false;
|
||||||
break;
|
break;
|
||||||
} /* switch */
|
} /* switch */
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ _IBMPC_scankey(char *outChar)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
} /* _IBMPC_scankey */
|
} /* _IBMPC_scankey */
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
@@ -216,9 +216,9 @@ void _IBMPC_keyboard_isr(void)
|
|||||||
| Global Variables: kbd_buffer, kbd_first, kbd_last.
|
| Global Variables: kbd_buffer, kbd_first, kbd_last.
|
||||||
| Arguments: c - character read if keyboard buffer not empty, otherwise
|
| Arguments: c - character read if keyboard buffer not empty, otherwise
|
||||||
| unchanged.
|
| unchanged.
|
||||||
| Returns: TRUE if keyboard buffer not empty, FALSE otherwise.
|
| Returns: true if keyboard buffer not empty, false otherwise.
|
||||||
+--------------------------------------------------------------------------*/
|
+--------------------------------------------------------------------------*/
|
||||||
rtems_boolean
|
bool
|
||||||
_IBMPC_chrdy(char *c)
|
_IBMPC_chrdy(char *c)
|
||||||
{
|
{
|
||||||
/* Check buffer our ISR builds */
|
/* Check buffer our ISR builds */
|
||||||
@@ -227,10 +227,10 @@ _IBMPC_chrdy(char *c)
|
|||||||
*c = kbd_buffer[kbd_first];
|
*c = kbd_buffer[kbd_first];
|
||||||
|
|
||||||
kbd_first = (kbd_first + 1) % KBD_BUF_SIZE;
|
kbd_first = (kbd_first + 1) % KBD_BUF_SIZE;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
} /* _IBMPC_chrdy */
|
} /* _IBMPC_chrdy */
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------+
|
/*-------------------------------------------------------------------------+
|
||||||
|
|||||||
Reference in New Issue
Block a user