public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Kallweit <simon.kallweit@intefo.ch>
To: ecos-patches@ecos.sourceware.org
Subject: synth syscalls patch
Date: Wed, 30 Sep 2009 07:00:00 -0000	[thread overview]
Message-ID: <4AC30205.5020800@intefo.ch> (raw)

[-- 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 | 

                 reply	other threads:[~2009-09-30  7:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AC30205.5020800@intefo.ch \
    --to=simon.kallweit@intefo.ch \
    --cc=ecos-patches@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).