Pintos プロジェクトには、タイトルに書いたようなポインターを変換するマクロがあります。
#define list_entry(LIST_ELEM, STRUCT, MEMBER)
((STRUCT *) ((uint8_t *) &(LIST_ELEM)->next
- offsetof (STRUCT, MEMBER.next)))
(src/lib/kernel/list.h)
なぜこのようにならないのですか?
#define list_entry(LIST_ELEM, STRUCT, MEMBER)
((STRUCT *) ((uint8_t *)LIST_ELEM
- offsetof (STRUCT, MEMBER)))