2525#ifndef ZEPHYR_INCLUDE_SYS_SFLIST_H_
2626#define ZEPHYR_INCLUDE_SYS_SFLIST_H_
2727
28- #include <stddef .h>
28+ #include <stdint .h>
2929#include <stdbool.h>
3030#include <zephyr/sys/__assert.h>
3131#include "list_gen.h"
3434extern "C" {
3535#endif
3636
37- #ifdef __LP64__
38- typedef uint64_t unative_t ;
39- #else
40- typedef uint32_t unative_t ;
41- #endif
42-
4337/** @cond INTERNAL_HIDDEN */
4438struct _sfnode {
45- unative_t next_and_flags ;
39+ uintptr_t next_and_flags ;
4640};
4741/** @endcond */
4842
@@ -218,7 +212,8 @@ static inline void sys_sflist_init(sys_sflist_t *list)
218212 * @param ptr_to_list A pointer on the list to initialize
219213 */
220214#define SYS_SFLIST_STATIC_INIT (ptr_to_list ) {NULL, NULL}
221- #define SYS_SFLIST_FLAGS_MASK 0x3UL
215+
216+ #define SYS_SFLIST_FLAGS_MASK ((uintptr_t)0x3)
222217
223218static inline sys_sfnode_t * z_sfnode_next_peek (sys_sfnode_t * node )
224219{
@@ -232,7 +227,7 @@ static inline void z_sfnode_next_set(sys_sfnode_t *parent,
232227{
233228 uint8_t cur_flags = sys_sfnode_flags_get (parent );
234229
235- parent -> next_and_flags = cur_flags | (unative_t )child ;
230+ parent -> next_and_flags = cur_flags | (uintptr_t )child ;
236231}
237232
238233static inline void z_sflist_head_set (sys_sflist_t * list , sys_sfnode_t * node )
@@ -316,7 +311,7 @@ static inline void sys_sfnode_init(sys_sfnode_t *node, uint8_t flags)
316311static inline void sys_sfnode_flags_set (sys_sfnode_t * node , uint8_t flags )
317312{
318313 __ASSERT ((flags & ~SYS_SFLIST_FLAGS_MASK ) == 0UL , "flags too large" );
319- node -> next_and_flags = (unative_t )(z_sfnode_next_peek (node )) | flags ;
314+ node -> next_and_flags = (uintptr_t )(z_sfnode_next_peek (node )) | flags ;
320315}
321316
322317/*
0 commit comments