summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-06-18 15:22:35 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-06-18 15:22:35 +0000
commit9a6994b490379074f546c395cb6d232cb1501348 (patch)
tree1e9a0c27d18cdbd202e0284d48a026807c6368c7 /c/src
parentCorrected so it returns the correct date. Previously was getting the number (diff)
downloadrtems-9a6994b490379074f546c395cb6d232cb1501348.tar.bz2
Added freebsd support from Dario Alcocer <alcocer@connectnet.com>.
Diffstat (limited to 'c/src')
-rw-r--r--c/src/exec/libcsupport/src/termios.c14
-rw-r--r--c/src/exec/score/cpu/unix/cpu.c9
-rw-r--r--c/src/exec/score/cpu/unix/cpu.h9
-rw-r--r--c/src/exec/score/cpu/unix/unix.h4
-rw-r--r--c/src/exec/score/tools/generic/size_rtems.in7
-rw-r--r--c/src/lib/libc/termios.c14
6 files changed, 55 insertions, 2 deletions
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
@@ -25,6 +25,20 @@
#include <unistd.h>
/*
+ * 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
*/
#define CBUFSIZE 256
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
@@ -25,6 +25,20 @@
#include <unistd.h>
/*
+ * 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
*/
#define CBUFSIZE 256