public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* synth syscalls patch
@ 2009-09-30  7:00 Simon Kallweit
  0 siblings, 0 replies; only message in thread
From: Simon Kallweit @ 2009-09-30  7:00 UTC (permalink / raw)
  To: ecos-patches

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

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().

[-- Attachment #2: synth_syscalls.patch --]
[-- Type: text/x-patch, Size: 2570 bytes --]

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 | 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-30  7:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-30  7:00 synth syscalls patch Simon Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).