heap binding of shared memory failed in fusion 0.9
Philippe Gerum
rpm at xenomai.org
Sun Sep 11 11:04:02 CEST 2005
Philippe Gerum wrote:
> 刘争晖 wrote:
>
>>I'v tried rtai-fusion 0.9 for my program but have a problem to bind the
>>heap of shared memory in user space. I first create a shared heap and
>>alloc memory in a kernel module as following:
>>err_heap=rt_heap_create(&myheap, "myheap", sizeof(...), H_SHARED);
>>err_heap=rt_heap_alloc(&myheap, 0, TM_NONBLOCK, &myheappointer);
>>then in a user space program, I tried binding of the shared heap in a
>>real time task as following:
>>void get_heap(void *cookie){
>> ...
>> rt_task_set_mode(0, T_PRIMARY, NULL); //switch to primary mode
>
>
> You don't need this.
>
>
>> err_heap=rt_heap_bind(&sharedmyheap, "myheap");
>> ...
>
>
> Please read skins/rtai/API.CHANGES: rt_heap_bind() (and all other
> binding ops) now takes a 3rd parameter which is a timeout. The compiler
> has likely emitted a warning for your program. You should fix it and retry.
>
Actually, this should not even compile at all.
>
>>}
>>The binding failed and return the error code -12. I readed the source
>>code and found it mean -ENOMEM.
>>But the same codes worked good for fusion-0.8.1. I tried several version
>>of patched linux kernel and gcc compiler, the result is all the same: With
>>module compiled with fusion-0.9, binding always failed, while with 0.8.1
>>alway successed. The following kernel and gcc compiler is tested:
>>linux-2.6.13 with adeos-ipipe-1.0 patched compiled by gcc-4.0.2
>>linux-2.6.13 with adeos-r13 patched compiled by gcc-4.0.2
>>linux-2.6.12 with adeos-r13 patched compiled by gcc-3.3.6
>>I think it may be a serious problem for fusion-0.9. I have done some
>>work to read the source and diff it with 0.8.1. I think there is some
>>thing wrong with rt_heap_creat() in fusion 0.9. But I haven't find it
>>yet.
>> By Liu Zh on 2005-09-11
>
>
>
--
Philippe.
More information about the Rtai
mailing list