Re: [Xenomai-core] [PATCH] private heaps for native pipes
Philippe Gerum wrote: > Jan Kiszka wrote: >> Hi, >> >> this is basically the last version of my rt_pipe_create-ext patch to add >> private, user-resizeable heaps to native pipes. Joerg has tested this >> patch successfully under the 2.1 trunk, and I added a ChangeLog snippet. >> Attached both 2.0.x and 2.1.x patches - please apply at least the 2.1 >> variant. >> > > Applied to 2.1, thanks. We need to keep the 2.0 branch 100% compatible > with the former RTAI/fusion API-wise, so I won't merge this in 2.0 though. > No problem. The patch was first developed on 2.0, so I just attached that version. Now, as I returned from my short travel, Joerg told me that he is already happily working over 2.1-trunk and had adapted my patch. :) BTW, RTnet also compiles against trunk now, I just have to get the patch into SVN. Jan signature.asc Description: OpenPGP digital signature
Re: [Xenomai-core] [PATCH] private heaps for native pipes
Jan Kiszka wrote: Hi, this is basically the last version of my rt_pipe_create-ext patch to add private, user-resizeable heaps to native pipes. Joerg has tested this patch successfully under the 2.1 trunk, and I added a ChangeLog snippet. Attached both 2.0.x and 2.1.x patches - please apply at least the 2.1 variant. Applied to 2.1, thanks. We need to keep the 2.0 branch 100% compatible with the former RTAI/fusion API-wise, so I won't merge this in 2.0 though. -- Philippe.
[Xenomai-core] [PATCH] private heaps for native pipes
Hi, this is basically the last version of my rt_pipe_create-ext patch to add private, user-resizeable heaps to native pipes. Joerg has tested this patch successfully under the 2.1 trunk, and I added a ChangeLog snippet. Attached both 2.0.x and 2.1.x patches - please apply at least the 2.1 variant. Jan Index: ChangeLog === --- ChangeLog (revision 182) +++ ChangeLog (working copy) @@ -1,3 +1,12 @@ +2005-11-25 Jan Kiszka <[EMAIL PROTECTED]> + + * skins/native/{pipe.c,pipe.h,syscall.c,lib/pipe.c}: Added poolsize + parameter to rt_pipe_create for setting up pipes with private buffer + pools of user-defined size. Also, the addressed pipe has to be passed + to rt_pipe_alloc and rt_pipe_free now. + + * testsuite/klatency/latency-module.c: Adapted to rt_pipe_* changes. + 2005-11-21 Philippe Gerum <[EMAIL PROTECTED]> * skins/native, nucleus/pipe.c: Globally replace ENOSPC by Index: skins/native/pipe.h === --- skins/native/pipe.h (revision 182) +++ skins/native/pipe.h (working copy) @@ -37,6 +37,8 @@ #ifdef __KERNEL__ +#include + #define XENO_PIPE_MAGIC 0x0202 typedef xnpipe_mh_t RT_PIPE_MSG; @@ -57,6 +59,10 @@ RT_PIPE_MSG *buffer; /* !< Buffer used in byte stream mode. */ +xnheap_t *bufpool; /* !< Current buffer pool. */ + +xnheap_t privpool; /* !< Private buffer pool. */ + size_t fillsz; /* !< Bytes written to the buffer. */ u_long flushable; /* !< Flush request flag. */ @@ -85,7 +91,8 @@ int rt_pipe_create(RT_PIPE *pipe, const char *name, - int minor); + int minor, + size_t poolsize); int rt_pipe_delete(RT_PIPE *pipe); @@ -113,9 +120,11 @@ size_t size, int mode); -RT_PIPE_MSG *rt_pipe_alloc(size_t size); +RT_PIPE_MSG *rt_pipe_alloc(RT_PIPE *pipe, + size_t size); -int rt_pipe_free(RT_PIPE_MSG *msg); +int rt_pipe_free(RT_PIPE *pipe, + RT_PIPE_MSG *msg); ssize_t rt_pipe_flush(RT_PIPE *pipe); Index: skins/native/syscall.c === --- skins/native/syscall.c (revision 182) +++ skins/native/syscall.c (working copy) @@ -3194,6 +3194,7 @@ char name[XNOBJECT_NAME_LEN]; RT_PIPE_PLACEHOLDER ph; int err, minor; +size_t poolsize; RT_PIPE *pipe; if (!__xn_access_ok(curr,VERIFY_WRITE,__xn_reg_arg1(regs),sizeof(ph))) @@ -3213,12 +3214,15 @@ /* Device minor. */ minor = (int)__xn_reg_arg3(regs); +/* Buffer pool size. */ +poolsize = (size_t)__xn_reg_arg4(regs); + pipe = (RT_PIPE *)xnmalloc(sizeof(*pipe)); if (!pipe) return -ENOMEM; -err = rt_pipe_create(pipe,name,minor); +err = rt_pipe_create(pipe,name,minor,poolsize); if (err == 0) { @@ -3332,7 +3336,7 @@ /* Zero-sized messages are allowed, so we still need to free the message buffer even if no data copy took place. */ -rt_pipe_free(msg); +rt_pipe_free(pipe,msg); return err; } @@ -3374,7 +3378,7 @@ if (!__xn_access_ok(curr,VERIFY_READ,__xn_reg_arg2(regs),size)) return -EFAULT; -msg = rt_pipe_alloc(size); +msg = rt_pipe_alloc(pipe,size); if (!msg) return -ENOMEM; @@ -3386,7 +3390,7 @@ if (err != size) /* If the operation failed, we need to free the message buffer by ourselves. */ - rt_pipe_free(msg); + rt_pipe_free(pipe,msg); return err; } @@ -3436,7 +3440,7 @@ } else { - msg = rt_pipe_alloc(size); + msg = rt_pipe_alloc(pipe,size); if (!msg) return -ENOMEM; @@ -3449,7 +3453,7 @@ err = rt_pipe_stream(pipe,buf,size); if (msg) - rt_pipe_free(msg); + rt_pipe_free(pipe,msg); return err; } @@ -3595,7 +3599,7 @@ [__xeno_intr_enable ] = { &__rt_intr_enable, __xn_exec_any }, [__xeno_intr_disable ] = { &__rt_intr_disable, __xn_exec_any }, [__xeno_intr_inquire ] = { &__rt_intr_inquire, __xn_exec_any }, -[__xeno_pipe_create ] = { &__rt_pipe_create, __xn_exec_any }, +[__xeno_pipe_create ] = { &__rt_pipe_create, __xn_exec_lostage }, [__xeno_pipe_bind ] = { &__rt_pipe_bind, __xn_exec_conforming }, [__xeno_pipe_delete ] = { &__rt_pipe_delete, __xn_exec_any }, [__xeno_pipe_read ] = { &__rt_pipe_read, __xn_exec_primary }, Index: skins/native/lib/pipe.c === --- skins/native/lib/pipe.c (revision 182) +++ skins/native/lib/pipe.c (working copy) @@ -23,13 +23,15 @@ int rt_pipe_create (RT_PIPE *pipe, const char *name, - int minor) + int mino
Re: [Xenomai-core] [PATCH] private heaps for native pipes
Philippe Gerum wrote: > Jan Kiszka wrote: >> Hi, >> >> this is basically the last version of my rt_pipe_create-ext patch to add >> private, user-resizeable heaps to native pipes. Joerg has tested this >> patch successfully under the 2.1 trunk, and I added a ChangeLog snippet. >> Attached both 2.0.x and 2.1.x patches - please apply at least the 2.1 >> variant. >> > > Applied to 2.1, thanks. We need to keep the 2.0 branch 100% compatible > with the former RTAI/fusion API-wise, so I won't merge this in 2.0 though. > No problem. The patch was first developed on 2.0, so I just attached that version. Now, as I returned from my short travel, Joerg told me that he is already happily working over 2.1-trunk and had adapted my patch. :) BTW, RTnet also compiles against trunk now, I just have to get the patch into SVN. Jan signature.asc Description: OpenPGP digital signature ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] [PATCH] private heaps for native pipes
Jan Kiszka wrote: Hi, this is basically the last version of my rt_pipe_create-ext patch to add private, user-resizeable heaps to native pipes. Joerg has tested this patch successfully under the 2.1 trunk, and I added a ChangeLog snippet. Attached both 2.0.x and 2.1.x patches - please apply at least the 2.1 variant. Applied to 2.1, thanks. We need to keep the 2.0 branch 100% compatible with the former RTAI/fusion API-wise, so I won't merge this in 2.0 though. -- Philippe. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
[Xenomai-core] [PATCH] private heaps for native pipes
Hi, this is basically the last version of my rt_pipe_create-ext patch to add private, user-resizeable heaps to native pipes. Joerg has tested this patch successfully under the 2.1 trunk, and I added a ChangeLog snippet. Attached both 2.0.x and 2.1.x patches - please apply at least the 2.1 variant. Jan Index: ChangeLog === --- ChangeLog (revision 182) +++ ChangeLog (working copy) @@ -1,3 +1,12 @@ +2005-11-25 Jan Kiszka <[EMAIL PROTECTED]> + + * skins/native/{pipe.c,pipe.h,syscall.c,lib/pipe.c}: Added poolsize + parameter to rt_pipe_create for setting up pipes with private buffer + pools of user-defined size. Also, the addressed pipe has to be passed + to rt_pipe_alloc and rt_pipe_free now. + + * testsuite/klatency/latency-module.c: Adapted to rt_pipe_* changes. + 2005-11-21 Philippe Gerum <[EMAIL PROTECTED]> * skins/native, nucleus/pipe.c: Globally replace ENOSPC by Index: skins/native/pipe.h === --- skins/native/pipe.h (revision 182) +++ skins/native/pipe.h (working copy) @@ -37,6 +37,8 @@ #ifdef __KERNEL__ +#include + #define XENO_PIPE_MAGIC 0x0202 typedef xnpipe_mh_t RT_PIPE_MSG; @@ -57,6 +59,10 @@ RT_PIPE_MSG *buffer; /* !< Buffer used in byte stream mode. */ +xnheap_t *bufpool; /* !< Current buffer pool. */ + +xnheap_t privpool; /* !< Private buffer pool. */ + size_t fillsz; /* !< Bytes written to the buffer. */ u_long flushable; /* !< Flush request flag. */ @@ -85,7 +91,8 @@ int rt_pipe_create(RT_PIPE *pipe, const char *name, - int minor); + int minor, + size_t poolsize); int rt_pipe_delete(RT_PIPE *pipe); @@ -113,9 +120,11 @@ size_t size, int mode); -RT_PIPE_MSG *rt_pipe_alloc(size_t size); +RT_PIPE_MSG *rt_pipe_alloc(RT_PIPE *pipe, + size_t size); -int rt_pipe_free(RT_PIPE_MSG *msg); +int rt_pipe_free(RT_PIPE *pipe, + RT_PIPE_MSG *msg); ssize_t rt_pipe_flush(RT_PIPE *pipe); Index: skins/native/syscall.c === --- skins/native/syscall.c (revision 182) +++ skins/native/syscall.c (working copy) @@ -3194,6 +3194,7 @@ char name[XNOBJECT_NAME_LEN]; RT_PIPE_PLACEHOLDER ph; int err, minor; +size_t poolsize; RT_PIPE *pipe; if (!__xn_access_ok(curr,VERIFY_WRITE,__xn_reg_arg1(regs),sizeof(ph))) @@ -3213,12 +3214,15 @@ /* Device minor. */ minor = (int)__xn_reg_arg3(regs); +/* Buffer pool size. */ +poolsize = (size_t)__xn_reg_arg4(regs); + pipe = (RT_PIPE *)xnmalloc(sizeof(*pipe)); if (!pipe) return -ENOMEM; -err = rt_pipe_create(pipe,name,minor); +err = rt_pipe_create(pipe,name,minor,poolsize); if (err == 0) { @@ -3332,7 +3336,7 @@ /* Zero-sized messages are allowed, so we still need to free the message buffer even if no data copy took place. */ -rt_pipe_free(msg); +rt_pipe_free(pipe,msg); return err; } @@ -3374,7 +3378,7 @@ if (!__xn_access_ok(curr,VERIFY_READ,__xn_reg_arg2(regs),size)) return -EFAULT; -msg = rt_pipe_alloc(size); +msg = rt_pipe_alloc(pipe,size); if (!msg) return -ENOMEM; @@ -3386,7 +3390,7 @@ if (err != size) /* If the operation failed, we need to free the message buffer by ourselves. */ - rt_pipe_free(msg); + rt_pipe_free(pipe,msg); return err; } @@ -3436,7 +3440,7 @@ } else { - msg = rt_pipe_alloc(size); + msg = rt_pipe_alloc(pipe,size); if (!msg) return -ENOMEM; @@ -3449,7 +3453,7 @@ err = rt_pipe_stream(pipe,buf,size); if (msg) - rt_pipe_free(msg); + rt_pipe_free(pipe,msg); return err; } @@ -3595,7 +3599,7 @@ [__xeno_intr_enable ] = { &__rt_intr_enable, __xn_exec_any }, [__xeno_intr_disable ] = { &__rt_intr_disable, __xn_exec_any }, [__xeno_intr_inquire ] = { &__rt_intr_inquire, __xn_exec_any }, -[__xeno_pipe_create ] = { &__rt_pipe_create, __xn_exec_any }, +[__xeno_pipe_create ] = { &__rt_pipe_create, __xn_exec_lostage }, [__xeno_pipe_bind ] = { &__rt_pipe_bind, __xn_exec_conforming }, [__xeno_pipe_delete ] = { &__rt_pipe_delete, __xn_exec_any }, [__xeno_pipe_read ] = { &__rt_pipe_read, __xn_exec_primary }, Index: skins/native/lib/pipe.c === --- skins/native/lib/pipe.c (revision 182) +++ skins/native/lib/pipe.c (working copy) @@ -23,13 +23,15 @@ int rt_pipe_create (RT_PIPE *pipe, const char *name, - int minor) + int mino