summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsave2007-06-19 16:54:36 +0000
committersave2007-06-19 16:54:36 +0000
commit764f596a1c0d00ca753a7f04d7cc789924c4ead4 (patch)
tree60fdeae43c1c6752649245c50b1be893b24b53e9
parent8b2b77272f2dab3949e9c26f0f2475232774c5bd (diff)
Deleted libc dependances for eCos compilation
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@337 017c9cb6-072f-447c-8318-d5b54f68fe89
-rw-r--r--host/inc/syscall.h47
-rw-r--r--host/src/fcall.c3
-rw-r--r--host/src/fcall_param.c3
-rw-r--r--host/src/netclock.c3
-rw-r--r--host/src/sci.c2
-rw-r--r--host/src/sci_msg.c6
-rw-r--r--host/src/station.c9
7 files changed, 64 insertions, 9 deletions
diff --git a/host/inc/syscall.h b/host/inc/syscall.h
index 724c3dfb09..42802d5dc5 100644
--- a/host/inc/syscall.h
+++ b/host/inc/syscall.h
@@ -14,8 +14,55 @@
*
* Redefinition of Linux System Calls only when we don't compile for tests
*/
+
#include "ecos/packages/hal/maximus/arch/current/include/hal_syscall.h"
+/** flags redefinition */
+/* open/fcntl flags */
+#define O_RDONLY CYG_HAL_SYS_O_RDONLY
+#define O_WRONLY CYG_HAL_SYS_O_WRONLY
+#define O_RDWR CYG_HAL_SYS_O_RDWR
+#define O_CREAT CYG_HAL_SYS_O_CREAT
+#define O_EXCL CYG_HAL_SYS_O_EXCL
+#define O_NOCTTY CYG_HAL_SYS_O_NOCTTY
+#define O_TRUNC CYG_HAL_SYS_O_TRUNC
+#define O_APPEND CYG_HAL_SYS_O_APPEND
+#define O_NONBLOCK CYG_HAL_SYS_O_NONBLOCK
+#define O_NDELAY CYG_HAL_SYS_O_NDELAY
+#define O_SYNC CYG_HAL_SYS_O_SYNC
+#define O_FSYNC CYG_HAL_SYS_O_FSYNC
+#define O_ASYN CYG_HAL_SYS_O_ASYNC
+
+/* open mode flags */
+#define S_IRUSR CYG_HAL_SYS_S_IRUSR
+#define S_IREAD CYG_HAL_SYS_S_IREAD
+#define S_IWUSR CYG_HAL_SYS_S_IWUSR
+#define S_IWRITE CYG_HAL_SYS_S_IWRITE
+#define S_IXUSR CYG_HAL_SYS_S_IXUSR
+#define S_IEXEC CYG_HAL_SYS_S_IEXEC
+#define S_IRWXU CYG_HAL_SYS_S_IRWXU
+#define S_IRWXG CYG_HAL_SYS_S_IRWXG
+#define S_IRGRP CYG_HAL_SYS_S_IRGRP
+#define S_IWGRP CYG_HAL_SYS_S_IWGRP
+#define S_IXGRP CYG_HAL_SYS_S_IXGRP
+#define S_IRWXO CYG_HAL_SYS_S_IRWXO
+#define S_IROTH CYG_HAL_SYS_S_IROTH
+#define S_IWOTH CYG_HAL_SYS_S_IWOTH
+#define S_IXOTH CYG_HAL_SYS_S_IXOTH
+
+/* stat flags */
+#define S_IFMT CYG_HAL_SYS_S_IFMT
+#define S_IFSOCK CYG_HAL_SYS_S_IFSOCK
+#define S_IFLNK CYG_HAL_SYS_S_IFLNK
+#define S_IFREG CYG_HAL_SYS_S_IFREG
+#define S_IFBLK CYG_HAL_SYS_S_IFBLK
+#define S_IFDIR CYG_HAL_SYS_S_IFDIR
+#define S_IFCHR CYG_HAL_SYS_S_IFCHR
+#define S_IFIFO CYG_HAL_SYS_S_IFIFO
+#define S_ISUID CYG_HAL_SYS_S_ISUID
+#define S_ISGID CYG_HAL_SYS_S_ISGID
+#define S_ISVTX CYG_HAL_SYS_S_ISVTX
+
/** structures redefinition */
#define fd_set struct cyg_hal_sys_fd_set
#define timeval cyg_hal_sys_timeval
diff --git a/host/src/fcall.c b/host/src/fcall.c
index fbce7a46dd..88655af6e1 100644
--- a/host/src/fcall.c
+++ b/host/src/fcall.c
@@ -18,12 +18,13 @@
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
#include <errno.h>
#include "host/inc/fcall.h"
#ifndef UNIT_TEST
#include "lib/swap.h"
+#include "host/inc/syscall.h"
#else /* UNIT_TEST */
+#include <unistd.h>
#include <arpa/inet.h>
#endif /* UNIT_TEST */
diff --git a/host/src/fcall_param.c b/host/src/fcall_param.c
index f3c699c846..e05b9254ca 100644
--- a/host/src/fcall_param.c
+++ b/host/src/fcall_param.c
@@ -18,12 +18,13 @@
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
#include <errno.h>
#include "host/inc/fcall.h"
#ifndef UNIT_TEST
#include "lib/swap.h"
+#include "host/inc/syscall.h"
#else /* UNIT_TEST */
+#include <unistd.h>
#include <arpa/inet.h>
#endif /* UNIT_TEST */
diff --git a/host/src/netclock.c b/host/src/netclock.c
index 80bff5c523..23ed969725 100644
--- a/host/src/netclock.c
+++ b/host/src/netclock.c
@@ -18,12 +18,13 @@
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
#include <errno.h>
#include "host/inc/netclock.h"
#ifndef UNIT_TEST
#include "lib/swap.h"
+#include "host/inc/syscall.h"
#else /* UNIT_TEST */
+#include <unistd.h>
#include <arpa/inet.h>
#endif /* UNIT_TEST */
diff --git a/host/src/sci.c b/host/src/sci.c
index a0cc13d532..b16e300f08 100644
--- a/host/src/sci.c
+++ b/host/src/sci.c
@@ -17,13 +17,13 @@
*/
#include <string.h>
-#include <unistd.h>
#include <errno.h>
#include "host/inc/sci.h"
#ifndef UNIT_TEST
#include "host/inc/syscall.h"
#include "lib/swap.h"
#else /* UNIT_TEST */
+#include <unistd.h>
#include <arpa/inet.h>
#endif /* UNIT_TEST */
diff --git a/host/src/sci_msg.c b/host/src/sci_msg.c
index ae367c4c82..62abd80bc2 100644
--- a/host/src/sci_msg.c
+++ b/host/src/sci_msg.c
@@ -19,8 +19,12 @@
#include <errno.h>
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
#include "host/inc/sci.h"
+#ifndef UNIT_TEST
+#include "host/inc/syscall.h"
+#else /* UNIT_TEST */
+#include <unistd.h>
+#endif /* UNIT_TEST */
/**
* create a new sci message.
diff --git a/host/src/station.c b/host/src/station.c
index 9b38f40488..ed9a3b58c4 100644
--- a/host/src/station.c
+++ b/host/src/station.c
@@ -17,17 +17,18 @@
*/
#include <stdio.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
#include <string.h>
+#include <sys/types.h>
#include <errno.h>
#include "ecos/packages/hal/maximus/arch/current/include/hal_host_intr.h"
#include "host/inc/sci.h"
#include "host/inc/station.h"
#ifndef UNIT_TEST
#include "host/inc/syscall.h"
+#else
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
#endif
/* awfull, but needed */