This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

synth syscalls patch


Just a little patch I wrote when I needed to use shared memory from within the synth target.

2009-09-30 Simon Kallweit <simon.kallweit@intefo.ch>

        * include/hal_io.h: added resource get request flags, using
        struct cyg_hal_sys_new_stat for cyg_hal_sys_newstat().
        * src/synth_syscalls.c: using cyg_hal_sys_newstat() instead
        of cyg_hal_sys_oldstat() in cyg_hal_sys_mmap().
diff --git a/packages/hal/synth/arch/current/ChangeLog b/packages/hal/synth/arch/current/ChangeLog
index 7c51ec3..cde4010 100644
--- a/packages/hal/synth/arch/current/ChangeLog
+++ b/packages/hal/synth/arch/current/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-30  Simon Kallweit  <simon.kallweit@intefo.ch>
+
+	* include/hal_io.h: added resource get request flags, using
+	struct cyg_hal_sys_new_stat for cyg_hal_sys_newstat().
+	* src/synth_syscalls.c: using cyg_hal_sys_newstat() instead
+	of cyg_hal_sys_oldstat() in cyg_hal_sys_mmap().
+
 2009-08-13  Bart Veer  <bartv@ecoscentric.com>
 
 	* src/synth.ld (SECTION_eh_frame): allow for a .eh_frame_hdr
diff --git a/packages/hal/synth/arch/current/include/hal_io.h b/packages/hal/synth/arch/current/include/hal_io.h
index f540e30..64c2d87 100644
--- a/packages/hal/synth/arch/current/include/hal_io.h
+++ b/packages/hal/synth/arch/current/include/hal_io.h
@@ -421,6 +421,11 @@ struct cyg_hal_sys_mmap_args {
 #define CYG_HAL_SYS_MAP_SHARED      0x01     /* Share changes.  */
 #define CYG_HAL_SYS_MAP_PRIVATE     0x02     /* Changes are private.  */
 #define CYG_HAL_SYS_MAP_FIXED       0x10     /* Interpret addr exactly.  */
+
+/* resource get request flags */
+#define CYG_HAL_SYS_IPC_CREAT   00001000    /* create if key is nonexistent */
+#define CYG_HAL_SYS_IPC_EXCL    00002000    /* fail if key exists */
+#define CYG_HAL_SYS_IPC_NOWAIT  00004000    /* return error on wait */
  
 struct cyg_hal_sys_dirent
 {
@@ -574,7 +579,7 @@ externC int cyg_hal_sys_newlstat(const char* name,
                                  struct cyg_hal_sys_new_stat *buf);
 externC int cyg_hal_sys_newfstat(int fd, struct cyg_hal_sys_new_stat *buf);
 externC int cyg_hal_sys_newstat(const char* name,
-                                struct cyg_hal_sys_old_stat *buf);
+                                struct cyg_hal_sys_new_stat *buf);
 
 externC int cyg_hal_sys_mkdir(const char* path, int mode);
 
diff --git a/packages/hal/synth/arch/current/src/synth_syscalls.c b/packages/hal/synth/arch/current/src/synth_syscalls.c
index 5cb4fa8..f21f191 100644
--- a/packages/hal/synth/arch/current/src/synth_syscalls.c
+++ b/packages/hal/synth/arch/current/src/synth_syscalls.c
@@ -96,9 +96,9 @@ cyg_hal_sys_mmap(void *addr, unsigned long length, unsigned long prot,
 
 int cyg_hal_sys_ftok(const char* path, int id)
 {
-  struct cyg_hal_sys_old_stat st;
+  struct cyg_hal_sys_new_stat st;
   
-  if (cyg_hal_sys_oldstat(path, &st) != 0)
+  if (cyg_hal_sys_newstat(path, &st) != 0)
     return (cyg_uint32)-1;
   
   return (cyg_uint32) (id << 24 | 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]