Module: xenomai-rpm
Branch: for-upstream
Commit: 14009ff61ea2d9b126e472f7b1b57ea2b142e974
URL:    
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=14009ff61ea2d9b126e472f7b1b57ea2b142e974

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Mar 28 23:18:35 2010 +0200

nucleus: introduce bufd reset operation

---

 include/nucleus/bufd.h |    5 +++++
 ksrc/nucleus/bufd.c    |   20 ++++++++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/include/nucleus/bufd.h b/include/nucleus/bufd.h
index ac1998a..262e546 100644
--- a/include/nucleus/bufd.h
+++ b/include/nucleus/bufd.h
@@ -97,6 +97,11 @@ ssize_t xnbufd_copy_from_kmem(struct xnbufd *bufd,
 
 void xnbufd_invalidate(struct xnbufd *bufd);
 
+static inline void xnbufd_reset(struct xnbufd *bufd)
+{
+       bufd->b_off = 0;
+}
+
 /*...@}*/
 
 #endif /* !_XENO_NUCLEUS_BUFD_H */
diff --git a/ksrc/nucleus/bufd.c b/ksrc/nucleus/bufd.c
index 8dd655c..cf2f1c4 100644
--- a/ksrc/nucleus/bufd.c
+++ b/ksrc/nucleus/bufd.c
@@ -631,6 +631,26 @@ done:
 EXPORT_SYMBOL_GPL(xnbufd_unmap_uwrite);
 
 /*!
+ * \fn void xnbufd_reset(struct xnbufd *bufd)
+ * \brief Reset a buffer descriptor.
+ *
+ * The buffer descriptor is reset, so that all data already copied is
+ * forgotten. Any carry over buffer allocated is kept, though.
+ *
+ * @param bufd The address of the buffer descriptor to reset.
+ *
+ * Environments:
+ *
+ * This service can be called from:
+ *
+ * - Kernel code (including from primary mode)
+ * - Kernel-based task
+ * - Interrupt service routine
+ *
+ * Rescheduling: never.
+ */
+
+/*!
  * \fn void xnbufd_invalidate(struct xnbufd *bufd)
  * \brief Invalidate a buffer descriptor.
  *


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

Reply via email to