From 9a6994b490379074f546c395cb6d232cb1501348 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 18 Jun 1998 15:22:35 +0000 Subject: Added freebsd support from Dario Alcocer . --- c/ACKNOWLEDGEMENTS | 3 +++ c/src/exec/libcsupport/src/termios.c | 14 ++++++++++++++ c/src/exec/score/cpu/unix/cpu.c | 9 +++++++-- c/src/exec/score/cpu/unix/cpu.h | 9 +++++++++ c/src/exec/score/cpu/unix/unix.h | 4 ++++ c/src/exec/score/tools/generic/size_rtems.in | 7 +++++++ c/src/lib/libc/termios.c | 14 ++++++++++++++ 7 files changed, 58 insertions(+), 2 deletions(-) (limited to 'c') diff --git a/c/ACKNOWLEDGEMENTS b/c/ACKNOWLEDGEMENTS index 80bedd25e3..b44434287d 100644 --- a/c/ACKNOWLEDGEMENTS +++ b/c/ACKNOWLEDGEMENTS @@ -120,6 +120,9 @@ The following persons/organizations have made contributions: for numerous enhancements to the RTEMS autoconf support as well as for the Hitachi SH port. ++ Dario Alcocer submitted a port of the + RTEMS port to FreeBSD. + Finally, the RTEMS project would like to thank those who have contributed to the other free software efforts which RTEMS utilizes. The primary RTEMS development environment is from the Free Software Foundation (the GNU diff --git a/c/src/exec/libcsupport/src/termios.c b/c/src/exec/libcsupport/src/termios.c index 648e2c0c3e..0857f0eae7 100644 --- a/c/src/exec/libcsupport/src/termios.c +++ b/c/src/exec/libcsupport/src/termios.c @@ -24,6 +24,20 @@ #include #include +/* + * FreeBSD does not support a full POSIX termios so we have to help it out + */ + + +#if defined(__FreeBSD__) +#define XTABS 0 +#define ONLRET 0 +#define ONOCR 0 +#define TABDLY 0 +#define OLCUC 0 +#define ILCUC 0 +#endif + /* * The size of the cooked buffer */ diff --git a/c/src/exec/score/cpu/unix/cpu.c b/c/src/exec/score/cpu/unix/cpu.c index 5b927b7a40..796d46d267 100644 --- a/c/src/exec/score/cpu/unix/cpu.c +++ b/c/src/exec/score/cpu/unix/cpu.c @@ -152,8 +152,12 @@ void _CPU_Signal_initialize( void ) sigaction(SIGUSR1, &act, 0); sigaction(SIGUSR2, &act, 0); sigaction(SIGCHLD, &act, 0); +#ifdef SIGCLD sigaction(SIGCLD, &act, 0); +#endif +#ifdef SIGPWR sigaction(SIGPWR, &act, 0); +#endif sigaction(SIGVTALRM, &act, 0); sigaction(SIGPROF, &act, 0); sigaction(SIGIO, &act, 0); @@ -741,9 +745,10 @@ void _CPU_Stray_signal(int sig_num) switch (sig_num) { +#ifdef SIGCLD case SIGCLD: break; - +#endif default: { /* @@ -987,7 +992,7 @@ void _CPU_SHM_Init( help.val = 1; status = semctl( _CPU_SHM_Semid, i, SETVAL, help ); -#elif defined(__linux__) +#elif defined(__linux__) || defined(__FreeBSD__) union semun help; help.val = 1; diff --git a/c/src/exec/score/cpu/unix/cpu.h b/c/src/exec/score/cpu/unix/cpu.h index 5eb4147df6..1a33365c2b 100644 --- a/c/src/exec/score/cpu/unix/cpu.h +++ b/c/src/exec/score/cpu/unix/cpu.h @@ -382,6 +382,14 @@ extern "C" { */ #ifdef RTEMS_UNIXLIB +#if defined(__FreeBSD__) +#define RET_OFF 0 +#define EBX_OFF 1 +#define EBP_OFF 2 +#define ESP_OFF 3 +#define ESI_OFF 4 +#define EDI_OFF 5 +#else #define EBX_OFF 0 #define ESI_OFF 1 #define EDI_OFF 2 @@ -389,6 +397,7 @@ extern "C" { #define ESP_OFF 4 #define RET_OFF 5 #endif +#endif #endif diff --git a/c/src/exec/score/cpu/unix/unix.h b/c/src/exec/score/cpu/unix/unix.h index 5753e7bf1a..52cfef79e4 100644 --- a/c/src/exec/score/cpu/unix/unix.h +++ b/c/src/exec/score/cpu/unix/unix.h @@ -46,6 +46,10 @@ extern "C" { #define CPU_MODEL_NAME "Linux" +#elif defined(__FreeBSD__) + +#define CPU_MODEL_NAME "FreeBSD" + #else #error "Unsupported CPU Model" diff --git a/c/src/exec/score/tools/generic/size_rtems.in b/c/src/exec/score/tools/generic/size_rtems.in index 93f3507579..e3dde44a81 100644 --- a/c/src/exec/score/tools/generic/size_rtems.in +++ b/c/src/exec/score/tools/generic/size_rtems.in @@ -54,6 +54,13 @@ case $target in echo Not supported on unix port. exit 0 ;; + i[3456]86-unknown-freebsd2.[12]*) + echo freebsd + rtems_cpu=unix + bsp=freebsd2 + echo Not supported on unix port. + exit 0 + ;; *-rtems*) cpu=`echo $target | sed -e 's/-.*//'` rtems_cpu=$cpu diff --git a/c/src/lib/libc/termios.c b/c/src/lib/libc/termios.c index 648e2c0c3e..0857f0eae7 100644 --- a/c/src/lib/libc/termios.c +++ b/c/src/lib/libc/termios.c @@ -24,6 +24,20 @@ #include #include +/* + * FreeBSD does not support a full POSIX termios so we have to help it out + */ + + +#if defined(__FreeBSD__) +#define XTABS 0 +#define ONLRET 0 +#define ONOCR 0 +#define TABDLY 0 +#define OLCUC 0 +#define ILCUC 0 +#endif + /* * The size of the cooked buffer */ -- cgit v1.2.3