forked from Imagelibrary/rtems
2009-08-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* bootcard.c, bsplibc.c, clockdrv_shell.h, console-polled.c: Fix formatting.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-08-28 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* bootcard.c, bsplibc.c, clockdrv_shell.h, console-polled.c: Fix
|
||||||
|
formatting.
|
||||||
|
|
||||||
2009-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* src/irq-legacy.c: Spacing, tabs, and proper format for license
|
* src/irq-legacy.c: Spacing, tabs, and proper format for license
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ static rtems_status_code bootcard_bsp_libc_helper(
|
|||||||
* For the default heap size use the free space from the end of the
|
* For the default heap size use the free space from the end of the
|
||||||
* work space up to the end of the work area as heap.
|
* work space up to the end of the work area as heap.
|
||||||
*/
|
*/
|
||||||
heap_size_default = work_area_size - rtems_configuration_get_work_space_size();
|
heap_size_default = work_area_size -
|
||||||
|
rtems_configuration_get_work_space_size();
|
||||||
|
|
||||||
/* Keep it as a multiple of 16 bytes */
|
/* Keep it as a multiple of 16 bytes */
|
||||||
heap_size_default &= ~((intptr_t) 0xf);
|
heap_size_default &= ~((intptr_t) 0xf);
|
||||||
|
|||||||
@@ -30,6 +30,5 @@ void bsp_libc_init(
|
|||||||
/*
|
/*
|
||||||
* Set up for the libc handling.
|
* Set up for the libc handling.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
libc_init();
|
libc_init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,43 +19,32 @@
|
|||||||
#error "clockdrv_shell.c: fast idle and N ISRs per tick is not supported"
|
#error "clockdrv_shell.c: fast idle and N ISRs per tick is not supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This method is rarely used so default it.
|
* This method is rarely used so default it.
|
||||||
*/
|
*/
|
||||||
#ifndef Clock_driver_support_find_timer
|
#ifndef Clock_driver_support_find_timer
|
||||||
#define Clock_driver_support_find_timer()
|
#define Clock_driver_support_find_timer()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ISRs until next clock tick
|
* ISRs until next clock tick
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
|
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
|
||||||
volatile uint32_t Clock_driver_isrs;
|
volatile uint32_t Clock_driver_isrs;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clock ticks since initialization
|
* Clock ticks since initialization
|
||||||
*/
|
*/
|
||||||
|
|
||||||
volatile uint32_t Clock_driver_ticks;
|
volatile uint32_t Clock_driver_ticks;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ISR formerly installed.
|
* ISR formerly installed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_isr_entry Old_ticker;
|
rtems_isr_entry Old_ticker;
|
||||||
|
|
||||||
void Clock_exit( void );
|
void Clock_exit( void );
|
||||||
|
|
||||||
/*
|
|
||||||
* Major and minor number.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_device_major_number rtems_clock_major = UINT32_MAX;
|
|
||||||
rtems_device_minor_number rtems_clock_minor;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clock_isr
|
* Clock_isr
|
||||||
*
|
*
|
||||||
@@ -67,9 +56,7 @@ rtems_device_minor_number rtems_clock_minor;
|
|||||||
* Output parameters: NONE
|
* Output parameters: NONE
|
||||||
*
|
*
|
||||||
* Return values: NONE
|
* Return values: NONE
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_isr Clock_isr(
|
rtems_isr Clock_isr(
|
||||||
rtems_vector_number vector
|
rtems_vector_number vector
|
||||||
)
|
)
|
||||||
@@ -77,48 +64,41 @@ rtems_isr Clock_isr(
|
|||||||
/*
|
/*
|
||||||
* Accurate count of ISRs
|
* Accurate count of ISRs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Clock_driver_ticks += 1;
|
Clock_driver_ticks += 1;
|
||||||
|
|
||||||
#ifdef CLOCK_DRIVER_USE_FAST_IDLE
|
#ifdef CLOCK_DRIVER_USE_FAST_IDLE
|
||||||
do {
|
do {
|
||||||
rtems_clock_tick();
|
rtems_clock_tick();
|
||||||
} while ( _Thread_Executing == _Thread_Idle &&
|
} while ( _Thread_Executing == _Thread_Idle &&
|
||||||
_Thread_Heir == _Thread_Executing);
|
_Thread_Heir == _Thread_Executing);
|
||||||
|
|
||||||
Clock_driver_support_at_tick();
|
Clock_driver_support_at_tick();
|
||||||
return;
|
return;
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* Do the hardware specific per-tick action.
|
||||||
|
*
|
||||||
|
* The counter/timer may or may not be set to automatically reload.
|
||||||
|
*/
|
||||||
|
Clock_driver_support_at_tick();
|
||||||
|
|
||||||
#else
|
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
|
||||||
|
/*
|
||||||
|
* The driver is multiple ISRs per clock tick.
|
||||||
|
*/
|
||||||
|
if ( !Clock_driver_isrs ) {
|
||||||
|
rtems_clock_tick();
|
||||||
|
|
||||||
/*
|
Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
|
||||||
* Do the hardware specific per-tick action.
|
}
|
||||||
*
|
Clock_driver_isrs--;
|
||||||
* The counter/timer may or may not be set to automatically reload.
|
#else
|
||||||
*/
|
/*
|
||||||
|
* The driver is one ISR per clock tick.
|
||||||
Clock_driver_support_at_tick();
|
*/
|
||||||
|
rtems_clock_tick();
|
||||||
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
|
#endif
|
||||||
/*
|
#endif
|
||||||
* The driver is multiple ISRs per clock tick.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ( !Clock_driver_isrs ) {
|
|
||||||
|
|
||||||
rtems_clock_tick();
|
|
||||||
|
|
||||||
Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
|
|
||||||
}
|
|
||||||
Clock_driver_isrs--;
|
|
||||||
#else
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The driver is one ISR per clock tick.
|
|
||||||
*/
|
|
||||||
rtems_clock_tick();
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -210,20 +190,12 @@ rtems_device_driver Clock_initialize(
|
|||||||
{
|
{
|
||||||
Install_clock( Clock_isr );
|
Install_clock( Clock_isr );
|
||||||
|
|
||||||
/*
|
|
||||||
* make major/minor avail to others such as shared memory driver
|
|
||||||
*/
|
|
||||||
|
|
||||||
rtems_clock_major = major;
|
|
||||||
rtems_clock_minor = minor;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are counting ISRs per tick, then initialize the counter.
|
* If we are counting ISRs per tick, then initialize the counter.
|
||||||
*/
|
*/
|
||||||
|
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
|
||||||
#ifdef CLOCK_DRIVER_ISRS_PER_TICK
|
Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
|
||||||
Clock_driver_isrs = CLOCK_DRIVER_ISRS_PER_TICK;
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,11 +35,10 @@ void console_initialize_hardware(void);
|
|||||||
* Console Termios Support Entry Points
|
* Console Termios Support Entry Points
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int console_write_support (
|
int console_write_support (
|
||||||
int minor,
|
int minor,
|
||||||
const char *bufarg,
|
const char *bufarg,
|
||||||
int len
|
int len
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int nwrite = 0;
|
int nwrite = 0;
|
||||||
@@ -65,18 +64,19 @@ rtems_device_driver console_initialize(
|
|||||||
{
|
{
|
||||||
rtems_status_code status;
|
rtems_status_code status;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ensure Termios is initialized
|
||||||
|
*/
|
||||||
rtems_termios_initialize();
|
rtems_termios_initialize();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure the hardware is initialized.
|
* Make sure the hardware is initialized.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
console_initialize_hardware();
|
console_initialize_hardware();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register Device Names
|
* Register Device Names
|
||||||
*/
|
*/
|
||||||
|
|
||||||
status = rtems_io_register_name( "/dev/console", major, 0 );
|
status = rtems_io_register_name( "/dev/console", major, 0 );
|
||||||
if (status != RTEMS_SUCCESSFUL)
|
if (status != RTEMS_SUCCESSFUL)
|
||||||
rtems_fatal_error_occurred(status);
|
rtems_fatal_error_occurred(status);
|
||||||
@@ -106,7 +106,7 @@ rtems_device_driver console_open(
|
|||||||
if ( minor > 1 )
|
if ( minor > 1 )
|
||||||
return RTEMS_INVALID_NUMBER;
|
return RTEMS_INVALID_NUMBER;
|
||||||
|
|
||||||
sc = rtems_termios_open (major, minor, arg, &pollCallbacks );
|
sc = rtems_termios_open( major, minor, arg, &pollCallbacks );
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ rtems_device_driver console_close(
|
|||||||
void * arg
|
void * arg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return rtems_termios_close (arg);
|
return rtems_termios_close( arg );
|
||||||
}
|
}
|
||||||
|
|
||||||
rtems_device_driver console_read(
|
rtems_device_driver console_read(
|
||||||
@@ -126,7 +126,7 @@ rtems_device_driver console_read(
|
|||||||
void * arg
|
void * arg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return rtems_termios_read (arg);
|
return rtems_termios_read( arg );
|
||||||
}
|
}
|
||||||
|
|
||||||
rtems_device_driver console_write(
|
rtems_device_driver console_write(
|
||||||
@@ -135,7 +135,7 @@ rtems_device_driver console_write(
|
|||||||
void * arg
|
void * arg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return rtems_termios_write (arg);
|
return rtems_termios_write( arg );
|
||||||
}
|
}
|
||||||
|
|
||||||
rtems_device_driver console_control(
|
rtems_device_driver console_control(
|
||||||
@@ -144,5 +144,5 @@ rtems_device_driver console_control(
|
|||||||
void * arg
|
void * arg
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return rtems_termios_ioctl (arg);
|
return rtems_termios_ioctl( arg );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user