mu578 commented on code in PR #10605: URL: https://github.com/apache/nuttx/pull/10605#discussion_r1333372111
########## arch/arm64/include/spinlock.h: ########## @@ -83,6 +83,25 @@ * -- Clear Exclusive access monitor (CLREX) This is used to * clear the state of the Local Exclusive Monitor. */ +#if defined(CONFIG_TICKET_SPINLOCK) +#include <stdatomic.h> + +/* Memory layout is related uint64_t in arm64 little endian + * if uint64 is 0x010203040A0B0C0D, the next is 0A0B0C0D and + * the owner is 01020304. + */ + +struct ticket_spinlock_s +{ + atomic_uint next; + atomic_uint owner; +}; +typedef struct ticket_spinlock_s ticket_spinlock_t; + +#define OWNER(l) (((struct ticket_spinlock_s *)l)->owner) +#define NEXT(l) (((struct ticket_spinlock_s *)l)->next) Review Comment: ``` # define TICKET_SPINLOCK_OWNER(l) (((struct ticket_spinlock_s *)l)->owner) # define TICKET_SPINLOCK_NEXT(l) (((struct ticket_spinlock_s *)l)->next) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org