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/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 ++++++++++++++ 6 files changed, 55 insertions(+), 2 deletions(-) (limited to 'c/src') 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