diff options
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r-- | c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h | 29 | ||||
-rw-r--r-- | c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/shmdr/getlq.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/shmdr/shm.h | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/shmdr/shm_driver.h | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c | 3 | ||||
-rw-r--r-- | c/src/lib/libbsp/unix/posix/shmsupp/intr.c | 3 | ||||
-rw-r--r-- | c/src/lib/libbsp/unix/posix/shmsupp/lock.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/unix/posix/startup/no-ctor.c | 16 | ||||
-rw-r--r-- | c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc | 10 |
11 files changed, 66 insertions, 23 deletions
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h b/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h index 1f68dea214..ead24536f5 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h +++ b/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h @@ -66,13 +66,38 @@ extern void Clock_delay(rtems_unsigned32 microseconds); Clock_delay(microseconds); /* + * Todo: this should be put somewhere else + */ + +#undef CLOCK_DRIVER_TABLE_ENTRY +#define CLOCK_DRIVER_TABLE_ENTRY { Clock_initialize, NULL, NULL, NULL, NULL, Clock_control } +rtems_device_driver Clock_control( + rtems_device_major_number major, + rtems_device_minor_number minor, + void *pargp +); + +/* * We printf() to a buffer if multiprocessing, *or* if this is set. - * ref: src/lib/libbsp/hppa/simhppa/iosupp/consupp.c + * ref: src/lib/libbsp/hppa/pxfl/iosupp/consupp.c */ extern int use_print_buffer; /* + * When not doing printf to a buffer, we do printf thru RTEMS libio + * and our tty driver. Set it up so that console is right. + */ + +#define CONSOLE_DRIVER_TABLE_ENTRY \ + { tty_initialize, tty_open, tty_close, tty_read, tty_write, tty_control } + +/* + * How many libio files we want + */ +#define BSP_LIBIO_MAX_FDS 20 + +/* * Device Driver Table Entries */ @@ -97,6 +122,8 @@ extern int use_print_buffer; rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int); +rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int); + void bsp_start( void ); void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c index f2cd34d219..f29eecf093 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c +++ b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/getcfg.c @@ -35,7 +35,6 @@ */ #include <bsp.h> -#include <runway.h> #include <shm.h> @@ -43,16 +42,16 @@ #define POLLING 1 #define HPPA_RUNWAY_PROC_HPA_BASE ((void *) 0xFFFA0000) - + /* given a processor number, where is its HPA? */ #define HPPA_RUNWAY_HPA(cpu) \ ((rtems_unsigned32) (HPPA_RUNWAY_PROC_HPA_BASE + ((cpu) * 0x2000))) - + #define HPPA_RUNWAY_REG_IO_EIR_OFFSET 0x000 shm_config_table BSP_shm_cfgtbl; -void Shm_Cause_interrupt_pxfl( rtems_unsigned32 node ); +extern void Shm_Cause_interrupt_pxfl( rtems_unsigned32 node ); void Shm_Get_configuration( rtems_unsigned32 localnode, diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c index fcd14428e1..161ae3f522 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c +++ b/c/src/lib/libbsp/hppa1.1/simhppa/shmsupp/intr.c @@ -22,6 +22,8 @@ #include <stdio.h> #include <rtems.h> +#include <rtems/error.h> + #include <shm.h> void Shm_Cause_interrupt_pxfl( @@ -38,13 +40,12 @@ void Shm_Cause_interrupt_pxfl( switch ( intr->length ) { case NO_INTERRUPT: break; + case LONG: u32 = (rtems_unsigned32 *)intr->address; HPPA_ASM_STWAS( value, 0, u32 ); break; default: fprintf( stderr, "Shm_Cause_interrupt_pxfl: Unsupported length!!!\n" ); - rtems_shutdown_executive( 0 ); - break; } } diff --git a/c/src/lib/libbsp/shmdr/getlq.c b/c/src/lib/libbsp/shmdr/getlq.c index ebc5bed8b6..efc7b0996c 100644 --- a/c/src/lib/libbsp/shmdr/getlq.c +++ b/c/src/lib/libbsp/shmdr/getlq.c @@ -22,7 +22,7 @@ */ #include <rtems.h> -#include "shm.h" +#include <shm.h> Shm_Envelope_control *Shm_Locked_queue_Get( Shm_Locked_queue_Control *lq_cb diff --git a/c/src/lib/libbsp/shmdr/shm.h b/c/src/lib/libbsp/shmdr/shm.h index f4671dde97..2b0e39320d 100644 --- a/c/src/lib/libbsp/shmdr/shm.h +++ b/c/src/lib/libbsp/shmdr/shm.h @@ -470,11 +470,7 @@ void Shm_Locked_queue_Initialize( /* portable routines */ void Init_env_pool(); void Shm_Print_statistics( void ); -void MPCI_Fatal( - Internal_errors_Source source, - boolean is_internal, - rtems_unsigned32 error - ); +void MPCI_Fatal( Internal_errors_Source, boolean, rtems_unsigned32 ); rtems_task Shm_Cause_interrupt( rtems_unsigned32 ); void Shm_Poll(); void Shm_setclockvec(); diff --git a/c/src/lib/libbsp/shmdr/shm_driver.h b/c/src/lib/libbsp/shmdr/shm_driver.h index f4671dde97..2b0e39320d 100644 --- a/c/src/lib/libbsp/shmdr/shm_driver.h +++ b/c/src/lib/libbsp/shmdr/shm_driver.h @@ -470,11 +470,7 @@ void Shm_Locked_queue_Initialize( /* portable routines */ void Init_env_pool(); void Shm_Print_statistics( void ); -void MPCI_Fatal( - Internal_errors_Source source, - boolean is_internal, - rtems_unsigned32 error - ); +void MPCI_Fatal( Internal_errors_Source, boolean, rtems_unsigned32 ); rtems_task Shm_Cause_interrupt( rtems_unsigned32 ); void Shm_Poll(); void Shm_setclockvec(); diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c b/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c index c912447631..cb3afabf98 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c +++ b/c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c @@ -27,10 +27,11 @@ #include <bsp.h> #include <shm.h> +#include <sys/types.h> /* pid_t */ shm_config_table BSP_shm_cfgtbl; -int semid; +int semid; void Shm_Cause_interrupt_unix( rtems_unsigned32 node diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/intr.c b/c/src/lib/libbsp/unix/posix/shmsupp/intr.c index 243af403d9..845cedd36f 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/intr.c +++ b/c/src/lib/libbsp/unix/posix/shmsupp/intr.c @@ -21,6 +21,7 @@ #include <bsp.h> #include <shm.h> +#include <sys/types.h> /* pid_t */ void Shm_Cause_interrupt_unix( rtems_unsigned32 node @@ -29,5 +30,5 @@ void Shm_Cause_interrupt_unix( Shm_Interrupt_information *intr; intr = &Shm_Interrupt_table[node]; - _CPU_SHM_Send_interrupt( (int) intr->address, (int) intr->value ); + _CPU_SHM_Send_interrupt( (pid_t) intr->address, intr->value ); } diff --git a/c/src/lib/libbsp/unix/posix/shmsupp/lock.c b/c/src/lib/libbsp/unix/posix/shmsupp/lock.c index 76a57d0a06..6ccd680842 100644 --- a/c/src/lib/libbsp/unix/posix/shmsupp/lock.c +++ b/c/src/lib/libbsp/unix/posix/shmsupp/lock.c @@ -20,8 +20,6 @@ #include <bsp.h> #include <shm.h> -extern int semid; - /* * Shm_Initialize_lock * diff --git a/c/src/lib/libbsp/unix/posix/startup/no-ctor.c b/c/src/lib/libbsp/unix/posix/startup/no-ctor.c new file mode 100644 index 0000000000..349ad2b1dd --- /dev/null +++ b/c/src/lib/libbsp/unix/posix/startup/no-ctor.c @@ -0,0 +1,16 @@ +/* + * rtems, floss, libc are always compiled with GNU compilers + * application code may be compiled with some other C++ compiler + * that has a different global constructor technique. + * + * For the simple case, where the app has no global constructors or + * is compiled by g++, we provide this empty routine + * In order to get both g++ constructors (RTEMS::RTEMS, for example) + * and application constructors run, we provide this routine. + * + * $Id$ + */ + +void invoke_non_gnu_constructors(void) +{ +} diff --git a/c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc b/c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc index 6fb132b469..0b4278eb19 100644 --- a/c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc +++ b/c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc @@ -1,5 +1,5 @@ -// @(#)rtems-ctor.cc 1.6 - 95/04/25 // +// @(#)rtems-ctor.cc 1.6 - 95/04/25 // /* @@ -81,6 +81,8 @@ RTEMS::~RTEMS() } extern "C" { + extern void invoke_non_gnu_constructors(void); + int main(int argc, char **argv, @@ -96,6 +98,12 @@ extern "C" { rtems_progname = "RTEMS"; /* + * run any non-gnu constructors we may need + */ + + invoke_non_gnu_constructors(); + + /* * Start multitasking */ |