XenevaOS
Loading...
Searching...
No Matches
Macros | Typedefs
kernel.h File Reference
#include <stdint.h>
#include <Hal/AA64/aa64cpu.h>
#include <Mm/kmalloc.h>
#include <_null.h>
#include <Hal/AA64/aa64lowlevel.h>
#include <linux/bitmap.h>
#include <linux/list.h>
#include <linux/usb/ch9.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include <linux/usb/otg.h>
Include dependency graph for kernel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define udelay(us)   AA64SleepUS(us)
 
#define mdelay(ms)   AA64SleepMS(ms)
 
#define msleep(ms)   mdelay(ms)
 
#define usleep(us)   AA64SleepUS(us)
 
#define GFP_KERNEL   0
 
#define GFP_ATOMIC   1
 
#define GFP_DMA   2
 
#define kmalloc(size, flags)   kmalloc(size)
 
#define kzalloc(size, flags)   kcalloc(size)
 
#define container_of(ptr, type, member)    ((type*)((char*)(ptr)- offsetof(type,member)))
 
#define offsetof(type, member)    ((size_t)&((type*)0)->member)
 
#define IS_ENABLED(opt)   (!!(opt))
 
#define spin_lock_init(l)   do{} while(0)
 
#define spin_lock_irqsave(l, f)   do{(f) = 0;}while(0)
 
#define spin_unlock_irqrestore(l, f)   do{}while(0)
 
#define mutex_init(m)   do{} while(0)
 
#define mutex_lock(m)   do{}while(0)
 
#define mutex_unlock(m)   do{} while(0)
 
#define IRQ_NONE   0
 
#define IRQ_HANDLED   1
 
#define IRQ_WAKE_THREAD   2
 
#define __iomem
 
#define __user
 
#define __kernel
 
#define __force
 
#define __nocast
 
#define __safe
 
#define __chk_user_ptr(x)   (void)0
 
#define __chk_io_ptr(x)   (void)0
 
#define EPERM   1
 
#define ENOENT   2
 
#define EIO   5
 
#define ENOMEM   12
 
#define EBUSY   16
 
#define ENODEV   19
 
#define EINVAL   22
 
#define ENOSPC   28
 
#define ETIMEDOUT   110
 
#define ENOTSUPP   524
 
#define MAX_ERRNO   4095
 
#define IS_ERR_VALUE(x)   ((x) >= (uintptr_t)-MAX_ERRNO)
 
#define EDEADLK   35
 
#define ENAMETOOLONG   36
 
#define ENOLCK   37
 
#define ENOSYS   38
 
#define ENOTEMPTY   39
 
#define ELOOP   40
 
#define EWOULDBLOCK   EAGAIN
 
#define ENOMSG   42
 
#define EIDRM   43
 
#define ENOSTR   60
 
#define ENODATA   61
 
#define ETIME   62
 
#define ENOSR   63
 
#define EREMOTE   66
 
#define ENOLINK   67
 
#define EPROTO   71
 
#define EMULTIHOP   72
 
#define EBADMSG   74
 
#define EOVERFLOW   75
 
#define EILSEQ   84
 
#define EUSERS   87
 
#define ENOTSOCK   88
 
#define EDESTADDRREQ   89
 
#define EMSGSIZE   90
 
#define ENOPROTOOPT   92
 
#define EPROTONOSUPPORT   93
 
#define ESOCKTNOSUPPORT   94
 
#define EOPNOTSUPP   95
 
#define EAFNOSUPPORT   97
 
#define EADDRINUSE   98
 
#define EADDRNOTAVAIL   99
 
#define ENETDOWN   100
 
#define ENETUNREACH   101
 
#define ENETRESET   102
 
#define ECONNABORTED   103
 
#define ECONNRESET   104
 
#define ECONNRESET   104
 
#define ENOBUFS   105
 
#define EISCONN   106
 
#define ENOTCONN   107
 
#define ESHUTDOWN   108
 
#define ETOOMANYREGS   109
 
#define ETIMEDOUT   110
 
#define ECONNREFUSED   111
 
#define EHOSTDOWN   112
 
#define readb(addr)   (*(volatile u8*)((uint8_t*)addr))
 
#define readw(addr)   (*(volatile u16*)((uint8_t*)addr))
 
#define readl(addr)   (*(volatile u32*)((uint8_t*)addr))
 
#define writeb(v, addr)   (*(volatile u8*)((uint8_t*)addr) = (v))
 
#define writew(v, addr)   (*(volatile u16*)((uint8_t*)addr) = (v))
 
#define writel(v, addr)   (*(volatile u32*)((uint8_t*)addr) = (v))
 
#define BITS_PER_LONG   64
 
#define BITS_PER_BYTE   8
 
#define BIT(n)   (1UL << (n))
 
#define BIT_ULL(n)   (1ULL << (n))
 
#define GENMASK(h, l)   (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG-1-(h))))
 
#define GENMASK_ULL(h, l)   (((~0ULL) << (l)) & (~0ULL >> (63-(h))))
 
#define NSEC_PER_USEC   1000LL
 
#define NSEC_PER_MSEC   1000000LL
 
#define NSEC_PER_SEC   1000000000LL
 
#define USEC_PER_MSEC   1000LL
 
#define USEC_PER_SEC   1000000LL
 
#define MSEC_PER_SEC   1000LL
 
#define KTIME_MAX   ((ktime_t)~((uint64_t)1<<63))
 
#define KTIME_MIN   (~KTIME_MAX - 1)
 
#define KTIME_SEC_MAX   (KTIME_MAX / NSEC_PER_SEC)
 

Typedefs

typedef uint8_t u8
 
typedef uint16_t u16
 
typedef uint32_t u32
 
typedef uint64_t u64
 
typedef int8_t s8
 
typedef int16_t s16
 
typedef int32_t s32
 
typedef int64_t s64
 
typedef uint8_t __u8
 
typedef uint16_t __u16
 
typedef uint32_t __u32
 
typedef uint64_t __u64
 
typedef int8_t __s8
 
typedef int16_t __s16
 
typedef int32_t __s32
 
typedef int64_t __s64
 
typedef uint8_t __le8
 
typedef uint16_t __le16
 
typedef uint32_t __le32
 
typedef uint64_t __le64
 
typedef uint16_t __be16
 
typedef uint32_t __be32
 
typedef uint64_t __be64
 
typedef uintptr_t phys_addr_t
 
typedef uintptr_t resource_size_t
 
typedef uintptr_t dma_addr_t
 
typedef uintptr_t io_addr_t
 
typedef int spinlock_t
 
typedef int mutex
 
typedef uint64_t sector_t
 
typedef uint64_t blkcnt_t
 
typedef uint64_t loff_t
 
typedef uint32_t uid_t
 
typedef uint32_t gid_t
 
typedef uint32_t dev_t
 
typedef uint32_t ino_t
 
typedef uint32_t nlink_t
 
typedef unsigned int gfp_t
 
typedef unsigned int fmode_t
 
typedef unsigned int umode_t
 
typedef int irqreturn_t
 
typedef unsigned long irq_hw_number_t
 
typedef unsigned long pgoff_t
 
typedef unsigned long kernel_ulong_t
 
typedef int64_t ktime_t
 

Macro Definition Documentation

◆ __chk_io_ptr

#define __chk_io_ptr (   x)    (void)0

◆ __chk_user_ptr

#define __chk_user_ptr (   x)    (void)0

◆ __force

#define __force

◆ __iomem

#define __iomem

◆ __kernel

#define __kernel

◆ __nocast

#define __nocast

◆ __safe

#define __safe

◆ __user

#define __user

◆ BIT

#define BIT (   n)    (1UL << (n))

◆ BIT_ULL

#define BIT_ULL (   n)    (1ULL << (n))

◆ BITS_PER_BYTE

#define BITS_PER_BYTE   8

◆ BITS_PER_LONG

#define BITS_PER_LONG   64

◆ container_of

#define container_of (   ptr,
  type,
  member 
)     ((type*)((char*)(ptr)- offsetof(type,member)))

◆ EADDRINUSE

#define EADDRINUSE   98

◆ EADDRNOTAVAIL

#define EADDRNOTAVAIL   99

◆ EAFNOSUPPORT

#define EAFNOSUPPORT   97

◆ EBADMSG

#define EBADMSG   74

◆ EBUSY

#define EBUSY   16

◆ ECONNABORTED

#define ECONNABORTED   103

◆ ECONNREFUSED

#define ECONNREFUSED   111

◆ ECONNRESET [1/2]

#define ECONNRESET   104

◆ ECONNRESET [2/2]

#define ECONNRESET   104

◆ EDEADLK

#define EDEADLK   35

◆ EDESTADDRREQ

#define EDESTADDRREQ   89

◆ EHOSTDOWN

#define EHOSTDOWN   112

◆ EIDRM

#define EIDRM   43

◆ EILSEQ

#define EILSEQ   84

◆ EINVAL

#define EINVAL   22

◆ EIO

#define EIO   5

◆ EISCONN

#define EISCONN   106

◆ ELOOP

#define ELOOP   40

◆ EMSGSIZE

#define EMSGSIZE   90

◆ EMULTIHOP

#define EMULTIHOP   72

◆ ENAMETOOLONG

#define ENAMETOOLONG   36

◆ ENETDOWN

#define ENETDOWN   100

◆ ENETRESET

#define ENETRESET   102

◆ ENETUNREACH

#define ENETUNREACH   101

◆ ENOBUFS

#define ENOBUFS   105

◆ ENODATA

#define ENODATA   61

◆ ENODEV

#define ENODEV   19

◆ ENOENT

#define ENOENT   2

◆ ENOLCK

#define ENOLCK   37

◆ ENOLINK

#define ENOLINK   67

◆ ENOMEM

#define ENOMEM   12

◆ ENOMSG

#define ENOMSG   42

◆ ENOPROTOOPT

#define ENOPROTOOPT   92

◆ ENOSPC

#define ENOSPC   28

◆ ENOSR

#define ENOSR   63

◆ ENOSTR

#define ENOSTR   60

◆ ENOSYS

#define ENOSYS   38

◆ ENOTCONN

#define ENOTCONN   107

◆ ENOTEMPTY

#define ENOTEMPTY   39

◆ ENOTSOCK

#define ENOTSOCK   88

◆ ENOTSUPP

#define ENOTSUPP   524

◆ EOPNOTSUPP

#define EOPNOTSUPP   95

◆ EOVERFLOW

#define EOVERFLOW   75

◆ EPERM

#define EPERM   1

◆ EPROTO

#define EPROTO   71

◆ EPROTONOSUPPORT

#define EPROTONOSUPPORT   93

◆ EREMOTE

#define EREMOTE   66

◆ ESHUTDOWN

#define ESHUTDOWN   108

◆ ESOCKTNOSUPPORT

#define ESOCKTNOSUPPORT   94

◆ ETIME

#define ETIME   62

◆ ETIMEDOUT [1/2]

#define ETIMEDOUT   110

◆ ETIMEDOUT [2/2]

#define ETIMEDOUT   110

◆ ETOOMANYREGS

#define ETOOMANYREGS   109

◆ EUSERS

#define EUSERS   87

◆ EWOULDBLOCK

#define EWOULDBLOCK   EAGAIN

◆ GENMASK

#define GENMASK (   h,
 
)    (((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG-1-(h))))

◆ GENMASK_ULL

#define GENMASK_ULL (   h,
 
)    (((~0ULL) << (l)) & (~0ULL >> (63-(h))))

◆ GFP_ATOMIC

#define GFP_ATOMIC   1

◆ GFP_DMA

#define GFP_DMA   2

◆ GFP_KERNEL

#define GFP_KERNEL   0

◆ IRQ_HANDLED

#define IRQ_HANDLED   1

◆ IRQ_NONE

#define IRQ_NONE   0

◆ IRQ_WAKE_THREAD

#define IRQ_WAKE_THREAD   2

◆ IS_ENABLED

#define IS_ENABLED (   opt)    (!!(opt))

◆ IS_ERR_VALUE

#define IS_ERR_VALUE (   x)    ((x) >= (uintptr_t)-MAX_ERRNO)

◆ kmalloc

#define kmalloc (   size,
  flags 
)    kmalloc(size)

◆ KTIME_MAX

#define KTIME_MAX   ((ktime_t)~((uint64_t)1<<63))

◆ KTIME_MIN

#define KTIME_MIN   (~KTIME_MAX - 1)

◆ KTIME_SEC_MAX

#define KTIME_SEC_MAX   (KTIME_MAX / NSEC_PER_SEC)

◆ kzalloc

#define kzalloc (   size,
  flags 
)    kcalloc(size)

◆ MAX_ERRNO

#define MAX_ERRNO   4095

◆ mdelay

#define mdelay (   ms)    AA64SleepMS(ms)

◆ MSEC_PER_SEC

#define MSEC_PER_SEC   1000LL

◆ msleep

#define msleep (   ms)    mdelay(ms)

◆ mutex_init

#define mutex_init (   m)    do{} while(0)

◆ mutex_lock

#define mutex_lock (   m)    do{}while(0)

◆ mutex_unlock

#define mutex_unlock (   m)    do{} while(0)

◆ NSEC_PER_MSEC

#define NSEC_PER_MSEC   1000000LL

◆ NSEC_PER_SEC

#define NSEC_PER_SEC   1000000000LL

◆ NSEC_PER_USEC

#define NSEC_PER_USEC   1000LL

◆ offsetof

#define offsetof (   type,
  member 
)     ((size_t)&((type*)0)->member)

◆ readb

#define readb (   addr)    (*(volatile u8*)((uint8_t*)addr))

◆ readl

#define readl (   addr)    (*(volatile u32*)((uint8_t*)addr))

◆ readw

#define readw (   addr)    (*(volatile u16*)((uint8_t*)addr))

◆ spin_lock_init

#define spin_lock_init (   l)    do{} while(0)

implementation needed

◆ spin_lock_irqsave

#define spin_lock_irqsave (   l,
 
)    do{(f) = 0;}while(0)

◆ spin_unlock_irqrestore

#define spin_unlock_irqrestore (   l,
 
)    do{}while(0)

◆ udelay

#define udelay (   us)    AA64SleepUS(us)

◆ USEC_PER_MSEC

#define USEC_PER_MSEC   1000LL

◆ USEC_PER_SEC

#define USEC_PER_SEC   1000000LL

◆ usleep

#define usleep (   us)    AA64SleepUS(us)

◆ writeb

#define writeb (   v,
  addr 
)    (*(volatile u8*)((uint8_t*)addr) = (v))

◆ writel

#define writel (   v,
  addr 
)    (*(volatile u32*)((uint8_t*)addr) = (v))

◆ writew

#define writew (   v,
  addr 
)    (*(volatile u16*)((uint8_t*)addr) = (v))

Typedef Documentation

◆ __be16

typedef uint16_t __be16

◆ __be32

typedef uint32_t __be32

◆ __be64

typedef uint64_t __be64

◆ __le16

typedef uint16_t __le16

◆ __le32

typedef uint32_t __le32

◆ __le64

typedef uint64_t __le64

◆ __le8

typedef uint8_t __le8

◆ __s16

typedef int16_t __s16

◆ __s32

typedef int32_t __s32

◆ __s64

typedef int64_t __s64

◆ __s8

typedef int8_t __s8

◆ __u16

typedef uint16_t __u16

◆ __u32

typedef uint32_t __u32

◆ __u64

typedef uint64_t __u64

◆ __u8

typedef uint8_t __u8

◆ blkcnt_t

typedef uint64_t blkcnt_t

◆ dev_t

typedef uint32_t dev_t

◆ dma_addr_t

◆ fmode_t

typedef unsigned int fmode_t

◆ gfp_t

typedef unsigned int gfp_t

◆ gid_t

typedef uint32_t gid_t

◆ ino_t

typedef uint32_t ino_t

◆ io_addr_t

◆ irq_hw_number_t

typedef unsigned long irq_hw_number_t

◆ irqreturn_t

typedef int irqreturn_t

◆ kernel_ulong_t

typedef unsigned long kernel_ulong_t

◆ ktime_t

typedef int64_t ktime_t

◆ loff_t

typedef uint64_t loff_t

◆ mutex

typedef int mutex

◆ nlink_t

typedef uint32_t nlink_t

◆ pgoff_t

typedef unsigned long pgoff_t

◆ phys_addr_t

◆ resource_size_t

◆ s16

typedef int16_t s16

◆ s32

typedef int32_t s32

◆ s64

typedef int64_t s64

◆ s8

typedef int8_t s8

◆ sector_t

typedef uint64_t sector_t

◆ spinlock_t

typedef int spinlock_t

◆ u16

typedef uint16_t u16

◆ u32

typedef uint32_t u32

◆ u64

typedef uint64_t u64

◆ u8

typedef uint8_t u8

WORK IN PROGRESS, Building Linux Compat Layer for drivers

◆ uid_t

typedef uint32_t uid_t

◆ umode_t

typedef unsigned int umode_t