<div dir="ltr"><div><span style="color:rgb(76,17,48)">>Based on this error, I believe you need to drop the "struct", given<br>
>that Thread_Control is the typedef for "struct _Thread_Control".</span><br>
<br></div><div>Oh yes you are right. It was originally written with the "struct" so I somehow overlooked it. I tired it this way. It works thanks.</div><div><br></div><div><span style="color:rgb(76,17,48)">>Minor, but in most other places in RTEMS, I've seen pointers declared<br>
>with the asterisk on the variable not on the type ("int *ptr;" instead<br>
>of "int* ptr;").<br></span></div><div><br></div><div>The trace linker code was last updated couple of years ago and this isn't the convention used in it. I don't know if the convention has changed but I stuck with how it was done in the configuration files of the trace linker. <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 30, 2018 at 7:05 PM, Amaan Cheval <span dir="ltr"><<a href="mailto:amaan.cheval@gmail.com" target="_blank">amaan.cheval@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, May 30, 2018 at 6:33 PM, Vidushi Vashishth <<a href="mailto:reachvidu@gmail.com">reachvidu@gmail.com</a>> wrote:<br>
> Could you please change the<br>
><br>
> struct _Thread_Control<br>
><br>
> to<br>
><br>
> Thread_Control<br>
><br>
> and check if it still works.<br>
><br>
> In RTEMS, we use typedefs for structures in general.<br>
><br>
> I tried to include the threadq.h header file so that I could use the<br>
> variable Thread_Control instead of _Thread_Control. This header file has the<br>
> following typedef statement:<br>
><br>
> typedef struct _Thread_Control Thread_Control;<br>
><br>
> However this leads to the following error:<br>
><br>
> fileio-wrapper.c:389:31: warning: initialization from incompatible pointer<br>
> type [-Wincompatible-pointer-types]<br>
> struct Thread_Control* tc = _Thread_Get_executing();<br>
> ^~~~~~~~~~~~~~~~~~~~~<br>
<br>
</span>Based on this error, I believe you need to drop the "struct", given<br>
that Thread_Control is the typedef for "struct _Thread_Control".<br>
<br>
Minor, but in most other places in RTEMS, I've seen pointers declared<br>
with the asterisk on the variable not on the type ("int *ptr;" instead<br>
of "int* ptr;").<br>
<div class="HOEnZb"><div class="h5"><br>
> fileio-wrapper.c:390:32: warning: passing argument 1 of<br>
> '_Thread_Get_priority' from incompatible pointer type<br>
> [-Wincompatible-pointer-types]<br>
> return (_Thread_Get_priority(tc) << 8) | tc->Real_priority.priority;<br>
><br>
> I had tried this earlier too. So it doesn't work.<br>
><br>
><br>
><br>
> On Wed, May 30, 2018 at 10:59 AM, Sebastian Huber<br>
> <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-<wbr>brains.de</a>> wrote:<br>
>><br>
>><br>
>><br>
>> On 29/05/18 17:36, Vidushi Vashishth wrote:<br>
>>><br>
>>> ---<br>
>>> linkers/rtld-trace-buffer.ini | 5 +++--<br>
>>> 1 file changed, 3 insertions(+), 2 deletions(-)<br>
>>><br>
>>> diff --git a/linkers/rtld-trace-buffer.<wbr>ini<br>
>>> b/linkers/rtld-trace-buffer.<wbr>ini<br>
>>> index af9fc31..ee68d55 100644<br>
>>> --- a/linkers/rtld-trace-buffer.<wbr>ini<br>
>>> +++ b/linkers/rtld-trace-buffer.<wbr>ini<br>
>>> @@ -26,6 +26,7 @@ buffer-local = " uint8_t* in;"<br>
>>> header = "#include <stdint.h>"<br>
>>> header = "#include <rtems.h>"<br>
>>> header = "#include <rtems/rtems/tasksimpl.h>"<br>
>>> +header = "#include <rtems/score/threadimpl.h>"<br>
>>> [trace-buffer-tracers]<br>
>>> code = <<<CODE<br>
>>> @@ -84,8 +85,8 @@ static inline uint32_t __rtld_tbg_executing_id(void)<br>
>>> static inline uint32_t __rtld_tbg_executing_status(<wbr>void)<br>
>>> {<br>
>>> /* @fixme Add the current CPU for SMP. */<br>
>>> - struct Thread_Control* tc = _Thread_Get_executing();<br>
>><br>
>><br>
>> Could you please change the<br>
>><br>
>> struct _Thread_Control<br>
>><br>
>> to<br>
>><br>
>> Thread_Control<br>
>><br>
>> and check if it still works.<br>
>><br>
>> In RTEMS, we use typedefs for structures in general.<br>
>><br>
>>> - return (tc->current_priority << 8) | tc->real_priority;<br>
>>> + struct _Thread_Control* tc = _Thread_Get_executing();<br>
>>> + return (_Thread_Get_priority(tc) << 8) | tc->Real_priority.priority;<br>
>>> }<br>
>>> static inline uint32_t __rtld_tbg_executing_state(<wbr>void)<br>
>><br>
>><br>
>> --<br>
>> Sebastian Huber, embedded brains GmbH<br>
>><br>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
>> Phone : +49 89 189 47 41-16<br>
>> Fax : +49 89 189 47 41-09<br>
>> E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-<wbr>brains.de</a><br>
>> PGP : Public key available on request.<br>
>><br>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> devel mailing list<br>
>> <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
>> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div>