atomic_t 和 atomic64_t

实际上 atomic_t  和 atomic64_t 这两个类型 是linux 头文件("kernel/include/linux/types.h")里定义

 

typedef unsigned long irq_hw_number_t;

typedef struct {
    int counter;
} atomic_t;

#ifdef CONFIG_64BIT
typedef struct {
    long counter;
} atomic64_t;
#endif
"kernel/include/linux/types.h"

 

它是一个结构体,所以不能直接在printf中转换为 unsigned int 等类型直接打印出来。编译器会报语法错误。

posted @ 2019-12-18 14:44  oude_yang  阅读(1357)  评论(0)    收藏  举报