MOS Source Code
Loading...
Searching...
No Matches
types.h File Reference
#include <mos/mos_global.h>
#include <stdbool.h>
#include <stddef.h>
+ Include dependency graph for types.h:

Go to the source code of this file.

Classes

union  byte_t
 
struct  hash_t
 

Macros

#define PTR_FMT   "0x%16.16lx"
 
#define PTR_VLFMT   "0x%lx"
 
#define PTR_RANGE   "[" PTR_FMT " - " PTR_FMT "]"
 
#define PTR_VLRANGE   "[" PTR_VLFMT " - " PTR_VLFMT "]"
 
#define PTR_RANGE64   "[0x%.16llx - 0x%.16llx]"
 
#define PFN_FMT   "%llu"
 
#define PFN_RANGE   "[" PFN_FMT " - " PFN_FMT "]"
 
#define PFNADDR_RANGE   "[" PTR_FMT " - " PTR_FMT "] (PFN " PFN_FMT " - " PFN_FMT ")"
 
#define PFNADDR(pfn, end)
 
#define new_named_opaque_type(base, name, type)
 
#define new_opaque_type(type, name)
 
#define new_opaque_ptr_type(name)
 
#define __atomic(type)
 

Typedefs

typedef signed char s8
 
typedef signed short s16
 
typedef signed int s32
 
typedef signed long slong
 
typedef signed long long int s64
 
typedef unsigned char u8
 
typedef unsigned short u16
 
typedef unsigned int u32
 
typedef unsigned long ulong
 
typedef unsigned long long u64
 
typedef unsigned long ptr_t
 
typedef unsigned int ptr32_t
 
typedef unsigned long long ptr64_t
 
typedef signed long intn
 
typedef unsigned long uintn
 
typedef unsigned long long pfn_t
 
typedef uintn reg_t
 
typedef u16 reg16_t
 
typedef u32 reg32_t
 
typedef u64 reg64_t
 
typedef u32 id_t
 
typedef u32 uid_t
 
typedef u32 gid_t
 
typedef s32 pid_t
 
typedef s32 tid_t
 
typedef s32 fd_t
 
typedef signed long ssize_t
 
typedef ssize_t off_t
 
typedef long pte_content_t
 
typedef s32 futex_word_t
 
typedef void(* thread_entry_t) (void *arg)
 

Functions

 MOS_STATIC_ASSERT (sizeof(void *)==8, "pointer size check failed")
 
 MOS_STATIC_ASSERT (sizeof(ptr_t)==sizeof(void *), "ptr_t is not the same size as void *")
 
 MOS_STATIC_ASSERT (sizeof(byte_t)==1, "byte_t is not 1 byte")
 
typedef _Atomic (size_t) atomic_t
 

Macro Definition Documentation

◆ PTR_FMT

◆ PTR_VLFMT

#define PTR_VLFMT   "0x%lx"

◆ PTR_RANGE

#define PTR_RANGE   "[" PTR_FMT " - " PTR_FMT "]"

◆ PTR_VLRANGE

#define PTR_VLRANGE   "[" PTR_VLFMT " - " PTR_VLFMT "]"

Definition at line 37 of file types.h.

◆ PTR_RANGE64

#define PTR_RANGE64   "[0x%.16llx - 0x%.16llx]"

Definition at line 38 of file types.h.

◆ PFN_FMT

◆ PFN_RANGE

◆ PFNADDR_RANGE

#define PFNADDR_RANGE   "[" PTR_FMT " - " PTR_FMT "] (PFN " PFN_FMT " - " PFN_FMT ")"

Definition at line 44 of file types.h.

Referenced by add_to_memmap(), and pmm_init().

◆ PFNADDR

#define PFNADDR ( pfn,
end )
Value:
(((ptr_t) (pfn)) * MOS_PAGE_SIZE), ((((ptr_t) end) * MOS_PAGE_SIZE) - 1), (pfn), (end)
#define MOS_PAGE_SIZE
Definition autoconf.h:6
unsigned long ptr_t
Definition types.h:25

Definition at line 46 of file types.h.

Referenced by add_to_memmap(), and pmm_init().

◆ new_named_opaque_type

#define new_named_opaque_type ( base,
name,
type )
Value:
typedef struct \
{ \
base name; \
} type
const char * name
Definition slab.c:31

Definition at line 88 of file types.h.

◆ new_opaque_type

#define new_opaque_type ( type,
name )
Value:
#define new_named_opaque_type(base, name, type)
Definition types.h:88

Definition at line 94 of file types.h.

◆ new_opaque_ptr_type

#define new_opaque_ptr_type ( name)
Value:

Definition at line 95 of file types.h.

◆ __atomic

#define __atomic ( type)
Value:
_Atomic(type)
typedef _Atomic(size_t) atomic_t

Definition at line 102 of file types.h.

Typedef Documentation

◆ s8

typedef signed char s8

Definition at line 13 of file types.h.

◆ s16

typedef signed short s16

Definition at line 14 of file types.h.

◆ s32

typedef signed int s32

Definition at line 15 of file types.h.

◆ slong

typedef signed long slong

Definition at line 16 of file types.h.

◆ s64

typedef signed long long int s64

Definition at line 17 of file types.h.

◆ u8

typedef unsigned char u8

Definition at line 19 of file types.h.

◆ u16

typedef unsigned short u16

Definition at line 20 of file types.h.

◆ u32

typedef unsigned int u32

Definition at line 21 of file types.h.

◆ ulong

typedef unsigned long ulong

Definition at line 22 of file types.h.

◆ u64

typedef unsigned long long u64

Definition at line 23 of file types.h.

◆ ptr_t

typedef unsigned long ptr_t

Definition at line 25 of file types.h.

◆ ptr32_t

typedef unsigned int ptr32_t

Definition at line 26 of file types.h.

◆ ptr64_t

typedef unsigned long long ptr64_t

Definition at line 27 of file types.h.

◆ intn

typedef signed long intn

Definition at line 29 of file types.h.

◆ uintn

typedef unsigned long uintn

Definition at line 30 of file types.h.

◆ pfn_t

typedef unsigned long long pfn_t

Definition at line 41 of file types.h.

◆ reg_t

typedef uintn reg_t

Definition at line 51 of file types.h.

◆ reg16_t

typedef u16 reg16_t

Definition at line 52 of file types.h.

◆ reg32_t

typedef u32 reg32_t

Definition at line 53 of file types.h.

◆ reg64_t

typedef u64 reg64_t

Definition at line 54 of file types.h.

◆ id_t

typedef u32 id_t

Definition at line 74 of file types.h.

◆ uid_t

typedef u32 uid_t

Definition at line 75 of file types.h.

◆ gid_t

typedef u32 gid_t

Definition at line 76 of file types.h.

◆ pid_t

typedef s32 pid_t

Definition at line 78 of file types.h.

◆ tid_t

typedef s32 tid_t

Definition at line 79 of file types.h.

◆ fd_t

typedef s32 fd_t

Definition at line 81 of file types.h.

◆ ssize_t

typedef signed long ssize_t

Definition at line 83 of file types.h.

◆ off_t

typedef ssize_t off_t

Definition at line 84 of file types.h.

◆ pte_content_t

typedef long pte_content_t

Definition at line 86 of file types.h.

◆ futex_word_t

typedef s32 futex_word_t

Definition at line 99 of file types.h.

◆ thread_entry_t

typedef void(* thread_entry_t) (void *arg)

Definition at line 109 of file types.h.

Function Documentation

◆ MOS_STATIC_ASSERT() [1/3]

MOS_STATIC_ASSERT ( sizeof(void *) = =8,
"pointer size check failed"  )

◆ MOS_STATIC_ASSERT() [2/3]

MOS_STATIC_ASSERT ( sizeof(ptr_t) = =sizeof(void *),
"ptr_t is not the same size as void *"  )

◆ MOS_STATIC_ASSERT() [3/3]

MOS_STATIC_ASSERT ( sizeof(byte_t) = =1,
"byte_t is not 1 byte"  )

◆ _Atomic()

typedef _Atomic ( size_t )