RTEMS | Draft: cpukit: add support for common CAN/CAN FD stack (!49)

Pavel Pisa (@ppisa) gitlab at rtems.org
Fri Jun 28 13:15:33 UTC 2024




Pavel Pisa commented on a discussion on cpukit/include/dev/can/can-queue.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/49#note_108470

 > + */
 > +static inline void canque_edge_incref( struct canque_edge_t *edge )
 > +{
 > +  atomic_fetch_add( &edge->edge_used, 1 );
 > +}
 > +
 > +/* Non-inlined version of edge reference decrement */
 > +void __canque_edge_decref( struct canque_edge_t *edge );
 > +
 > +static inline void __canque_edge_decref_body( struct canque_edge_t *edge )
 > +{
 > +  int dead_fl = 0;
 > +  struct canque_ends_t *inends=edge->inends;
 > +  struct canque_ends_t *outends=edge->outends;
 > +
 > +  if ( inends < outends ) {

I have found original [canque_edge_lock_both_ends](https://sourceforge.net/p/ortcan/lincan/ci/master/tree/lincan/include/can_queue.h#l582) and [canque_edge_unlock_both_ends](https://sourceforge.net/p/ortcan/lincan/ci/master/tree/lincan/include/can_queue.h#l596). But the code has complicated, RTEMS has only one IRQ safe spilnlock and then flags has been required twice, stack order and TALQ requirements resulted in complex code and each copy is little different.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/49#note_108470
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240628/090f4059/attachment-0001.htm>


More information about the bugs mailing list