linux/tools/include/linux/types.h
<<
>>
Prefs
   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#define __SANE_USERSPACE_TYPES__        /* For PPC64, to get LL64 types */
  10#include <asm/types.h>
  11#include <asm/posix_types.h>
  12
  13struct page;
  14struct kmem_cache;
  15
  16typedef enum {
  17        GFP_KERNEL,
  18        GFP_ATOMIC,
  19        __GFP_HIGHMEM,
  20        __GFP_HIGH
  21} gfp_t;
  22
  23/*
  24 * We define u64 as uint64_t for every architecture
  25 * so that we can print it with "%"PRIx64 without getting warnings.
  26 *
  27 * typedef __u64 u64;
  28 * typedef __s64 s64;
  29 */
  30typedef uint64_t u64;
  31typedef int64_t s64;
  32
  33typedef __u32 u32;
  34typedef __s32 s32;
  35
  36typedef __u16 u16;
  37typedef __s16 s16;
  38
  39typedef __u8  u8;
  40typedef __s8  s8;
  41
  42#ifdef __CHECKER__
  43#define __bitwise__ __attribute__((bitwise))
  44#else
  45#define __bitwise__
  46#endif
  47#define __bitwise __bitwise__
  48
  49#define __force
  50#define __user
  51#define __must_check
  52#define __cold
  53
  54typedef __u16 __bitwise __le16;
  55typedef __u16 __bitwise __be16;
  56typedef __u32 __bitwise __le32;
  57typedef __u32 __bitwise __be32;
  58typedef __u64 __bitwise __le64;
  59typedef __u64 __bitwise __be64;
  60
  61typedef struct {
  62        int counter;
  63} atomic_t;
  64
  65#ifndef __aligned_u64
  66# define __aligned_u64 __u64 __attribute__((aligned(8)))
  67#endif
  68
  69struct list_head {
  70        struct list_head *next, *prev;
  71};
  72
  73struct hlist_head {
  74        struct hlist_node *first;
  75};
  76
  77struct hlist_node {
  78        struct hlist_node *next, **pprev;
  79};
  80
  81#endif /* _TOOLS_LINUX_TYPES_H_ */
  82