102 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef _TOOLS_LINUX_TYPES_H_3#define _TOOLS_LINUX_TYPES_H_4 5#include <stdbool.h>6#include <stddef.h>7#include <stdint.h>8 9#ifndef __SANE_USERSPACE_TYPES__10#define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */11#endif12 13#include <asm/types.h>14#include <asm/posix_types.h>15 16struct page;17struct kmem_cache;18 19typedef enum {20 GFP_KERNEL,21 GFP_ATOMIC,22 __GFP_HIGHMEM,23 __GFP_HIGH24} gfp_t;25 26/*27 * We define u64 as uint64_t for every architecture28 * so that we can print it with "%"PRIx64 without getting warnings.29 *30 * typedef __u64 u64;31 * typedef __s64 s64;32 */33typedef uint64_t u64;34typedef int64_t s64;35 36typedef __u32 u32;37typedef __s32 s32;38 39typedef __u16 u16;40typedef __s16 s16;41 42typedef __u8 u8;43typedef __s8 s8;44 45#ifdef __CHECKER__46#define __bitwise __attribute__((bitwise))47#else48#define __bitwise49#endif50 51#define __force52/* This is defined in linux/compiler_types.h and is left for backward53 * compatibility.54 */55#ifndef __user56#define __user57#endif58#define __must_check59#define __cold60 61typedef __u16 __bitwise __le16;62typedef __u16 __bitwise __be16;63typedef __u32 __bitwise __le32;64typedef __u32 __bitwise __be32;65typedef __u64 __bitwise __le64;66typedef __u64 __bitwise __be64;67 68typedef __u16 __bitwise __sum16;69typedef __u32 __bitwise __wsum;70 71#ifdef CONFIG_PHYS_ADDR_T_64BIT72typedef u64 phys_addr_t;73#else74typedef u32 phys_addr_t;75#endif76 77typedef struct {78 int counter;79} atomic_t;80 81typedef struct {82 long counter;83} atomic_long_t;84 85#ifndef __aligned_u6486# define __aligned_u64 __u64 __attribute__((aligned(8)))87#endif88 89struct list_head {90 struct list_head *next, *prev;91};92 93struct hlist_head {94 struct hlist_node *first;95};96 97struct hlist_node {98 struct hlist_node *next, **pprev;99};100 101#endif /* _TOOLS_LINUX_TYPES_H_ */102