From c64e4ed48285a0c944905bc02de89c20038f428b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 15 Jan 1996 21:50:28 +0000 Subject: updates from Tony Bennett for PA and UNIX ports --- c/src/lib/libbsp/unix/posix/shmsupp/getcfg.c | 3 ++- c/src/lib/libbsp/unix/posix/shmsupp/intr.c | 3 ++- c/src/lib/libbsp/unix/posix/shmsupp/lock.c | 2 -- c/src/lib/libbsp/unix/posix/startup/no-ctor.c | 16 ++++++++++++++++ c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc | 10 +++++++++- 5 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 c/src/lib/libbsp/unix/posix/startup/no-ctor.c (limited to 'c/src/lib/libbsp/unix') 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 #include +#include /* 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 #include +#include /* 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 #include -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, @@ -95,6 +97,12 @@ extern "C" { else rtems_progname = "RTEMS"; + /* + * run any non-gnu constructors we may need + */ + + invoke_non_gnu_constructors(); + /* * Start multitasking */ -- cgit v1.2.3