Module: xenomai-head
Branch: master
Commit: b2593fbd6473f7cff5762af7a14441e8efde35e0
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=b2593fbd6473f7cff5762af7a14441e8efde35e0

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Jul 21 16:57:43 2009 +0200

native: fix fast path in rt_buffer_write_inner()

---

 ksrc/skins/native/buffer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ksrc/skins/native/buffer.c b/ksrc/skins/native/buffer.c
index 6bb2464..dee0c5d 100644
--- a/ksrc/skins/native/buffer.c
+++ b/ksrc/skins/native/buffer.c
@@ -378,7 +378,9 @@ ssize_t rt_buffer_write_inner(RT_BUFFER *bf,
        }
 
        /* Some bytes were not consumed, move them to the buffer. */
+       ptr = (caddr_t)ptr + n;
        rbytes -= n;
+       size = rbytes;
        resched = 1;    /* Rescheduling is pending. */
 
 accumulate:
@@ -537,6 +539,7 @@ ssize_t rt_buffer_read_inner(RT_BUFFER *bf,
                }
 
                thread = xnpod_current_thread();
+               thread->wait_u.buffer.ptr = ptr;
                thread->wait_u.buffer.size = size;
                xnsynch_sleep_on(&bf->isynch_base, timeout, timeout_mode);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to