OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
Ubsan.h File Reference
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>

Go to the source code of this file.

Macros

#define _KERNEL   1
 
#define __HAVE_LONG_DOUBLE
 
#define __RCSID(x)
 
#define __KERNEL_RCSID(x, s)
 
#define int8_t   INT8
 
#define int16_t   INT16
 
#define int32_t   INT32
 
#define int64_t   INT64
 
#define uint8_t   UINT8
 
#define uint16_t   UINT16
 
#define uint32_t   UINT32
 
#define uint64_t   UINT64
 
#define bool   BOOLEAN
 
#define intptr_t   INTN
 
#define uintptr_t   UINTN
 
#define ssize_t   INTN
 
#define size_t   UINTN
 
#define false   FALSE
 
#define true   TRUE
 
#define va_list   VA_LIST
 
#define va_start   VA_START
 
#define va_end   VA_END
 
#define va_arg   VA_ARG
 
#define PRIx8   "hhx"
 
#define PRIx16   "hx"
 
#define PRIx32   "x"
 
#define PRId32   "d"
 
#define PRIu32   "u"
 
#define UINT8_MAX   0xffU
 
#define UINT16_MAX   0xffffU
 
#define UINT32_MAX   0xffffffffU
 
#define UINT64_MAX   0xffffffffffffffffULL
 
#define KASSERT(Expression)
 
#define PATH_MAX   1024
 
#define CHAR_BIT   8
 
#define __BIT(__n)
 
#define __LOWEST_SET_BIT(__mask)
 
#define __SHIFTOUT(__x, __mask)
 
#define __SHIFTIN(__x, __mask)
 
#define __SHIFTOUT_MASK(__mask)
 
#define SET(t, f)
 
#define ISSET(t, f)
 
#define CLR(t, f)
 
#define __printflike(x, y)
 
#define __arraycount(a)
 
#define __unreachable()
 
#define TINYPRINTF_DEFINE_TFP_SPRINTF   1
 
#define snprintf   tfp_snprintf
 
#define vprintf(f, v)
 
#define vpanic(f, v)
 
#define memcpy(Dst, Src, Size)
 
#define strlcpy(Dst, Src, Size)
 
#define strlcat(Dst, Src, Size)
 

Typedefs

typedef void(* putcf) (void *, char)
 

Functions

void EFIAPI tfp_format (void *putp, putcf putf, const char *fmt, va_list va)
 
int tfp_vsnprintf (char *str, size_t size, const char *fmt, va_list ap)
 
int EFIAPI tfp_snprintf (char *str, size_t size, const char *fmt,...) __printflike(3
 
int EFIAPI int EFIAPI tfp_vsprintf (char *str, const char *fmt, va_list ap)
 
int EFIAPI tfp_sprintf (char *str, const char *fmt,...) __printflike(2
 

Detailed Description

OcGuardLib

Copyright (c) 2018, vit9696

All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file Ubsan.h.

Macro Definition Documentation

◆ __arraycount

#define __arraycount ( a)
Value:
#define ARRAY_SIZE(Array)
Definition AppleMacEfi.h:34

Definition at line 183 of file Ubsan.h.

◆ __BIT

#define __BIT ( __n)
Value:
(((UINTN)(__n) >= CHAR_BIT * sizeof(UINTN)) ? 0 : \
((UINTN)1 << (UINTN)((__n) & (CHAR_BIT * sizeof(UINTN) - 1))))
#define CHAR_BIT
Definition Ubsan.h:146

Definition at line 151 of file Ubsan.h.

◆ __HAVE_LONG_DOUBLE

#define __HAVE_LONG_DOUBLE

Definition at line 39 of file Ubsan.h.

◆ __KERNEL_RCSID

#define __KERNEL_RCSID ( x,
s )
Value:
#define __RCSID(x)
Definition Ubsan.h:44

Definition at line 48 of file Ubsan.h.

◆ __LOWEST_SET_BIT

#define __LOWEST_SET_BIT ( __mask)
Value:
((((__mask) - 1) & (__mask)) ^ (__mask))

Definition at line 159 of file Ubsan.h.

◆ __printflike

#define __printflike ( x,
y )

Definition at line 177 of file Ubsan.h.

◆ __RCSID

#define __RCSID ( x)

Definition at line 44 of file Ubsan.h.

◆ __SHIFTIN

#define __SHIFTIN ( __x,
__mask )
Value:
((__x) * __LOWEST_SET_BIT(__mask))
#define __LOWEST_SET_BIT(__mask)
Definition Ubsan.h:159

Definition at line 161 of file Ubsan.h.

◆ __SHIFTOUT

#define __SHIFTOUT ( __x,
__mask )
Value:
(((__x) & (__mask)) / __LOWEST_SET_BIT(__mask))

Definition at line 160 of file Ubsan.h.

◆ __SHIFTOUT_MASK

#define __SHIFTOUT_MASK ( __mask)
Value:
__SHIFTOUT((__mask), (__mask))
#define __SHIFTOUT(__x, __mask)
Definition Ubsan.h:160

Definition at line 162 of file Ubsan.h.

◆ __unreachable

#define __unreachable ( )

Definition at line 191 of file Ubsan.h.

◆ _KERNEL

#define _KERNEL   1

Definition at line 29 of file Ubsan.h.

◆ bool

#define bool   BOOLEAN

Definition at line 61 of file Ubsan.h.

◆ CHAR_BIT

#define CHAR_BIT   8

Definition at line 146 of file Ubsan.h.

◆ CLR

#define CLR ( t,
f )
Value:
((t) &= ~(f))

Definition at line 169 of file Ubsan.h.

◆ false

#define false   FALSE

Definition at line 92 of file Ubsan.h.

◆ int16_t

typedef INT16 int16_t   INT16

Definition at line 54 of file Ubsan.h.

◆ int32_t

typedef INT32 int32_t   INT32

Definition at line 55 of file Ubsan.h.

◆ int64_t

#define int64_t   INT64

Definition at line 56 of file Ubsan.h.

◆ int8_t

#define int8_t   INT8

Definition at line 53 of file Ubsan.h.

◆ intptr_t

#define intptr_t   INTN

Definition at line 62 of file Ubsan.h.

◆ ISSET

#define ISSET ( t,
f )
Value:
((t) & (f))

Definition at line 168 of file Ubsan.h.

◆ KASSERT

#define KASSERT ( Expression)
Value:
do { \
if (DebugAssertEnabled ()) { \
if (!(Expression)) { \
_ASSERT (Expression); \
ANALYZER_UNREACHABLE (); \
} \
} \
} while (FALSE)
BOOLEAN EFIAPI DebugAssertEnabled(VOID)

Definition at line 126 of file Ubsan.h.

◆ memcpy

#define memcpy ( Dst,
Src,
Size )
Value:
do { gBS->CopyMem(Dst, Src, Size); } while (0)
DMG_SIZE_DEVICE_PATH Size
EFI_BOOT_SERVICES * gBS

Definition at line 212 of file Ubsan.h.

◆ PATH_MAX

#define PATH_MAX   1024

Definition at line 141 of file Ubsan.h.

◆ PRId32

#define PRId32   "d"

Definition at line 107 of file Ubsan.h.

◆ PRIu32

#define PRIu32   "u"

Definition at line 108 of file Ubsan.h.

◆ PRIx16

#define PRIx16   "hx"

Definition at line 105 of file Ubsan.h.

◆ PRIx32

#define PRIx32   "x"

Definition at line 106 of file Ubsan.h.

◆ PRIx8

#define PRIx8   "hhx"

Definition at line 104 of file Ubsan.h.

◆ SET

#define SET ( t,
f )
Value:
((t) |= (f))

Definition at line 167 of file Ubsan.h.

◆ size_t

typedef UINTN size_t   UINTN

Definition at line 87 of file Ubsan.h.

◆ snprintf

#define snprintf   tfp_snprintf

Definition at line 205 of file Ubsan.h.

◆ ssize_t

#define ssize_t   INTN

Definition at line 86 of file Ubsan.h.

◆ strlcat

#define strlcat ( Dst,
Src,
Size )
Value:
do { AsciiStrnCatS (Dst, Size, Src, AsciiStrLen (Src)); } while (0)

Definition at line 216 of file Ubsan.h.

◆ strlcpy

#define strlcpy ( Dst,
Src,
Size )
Value:
do { AsciiStrnCpyS (Dst, Size, Src, AsciiStrLen (Src)); } while (0)

Definition at line 215 of file Ubsan.h.

◆ TINYPRINTF_DEFINE_TFP_SPRINTF

#define TINYPRINTF_DEFINE_TFP_SPRINTF   1

Definition at line 196 of file Ubsan.h.

◆ true

#define true   TRUE

Definition at line 93 of file Ubsan.h.

◆ UINT16_MAX

#define UINT16_MAX   0xffffU

Definition at line 114 of file Ubsan.h.

◆ uint16_t

typedef UINT16 uint16_t   UINT16

Definition at line 58 of file Ubsan.h.

◆ UINT32_MAX

#define UINT32_MAX   0xffffffffU

Definition at line 115 of file Ubsan.h.

◆ uint32_t

typedef UINT32 uint32_t   UINT32

Definition at line 59 of file Ubsan.h.

◆ UINT64_MAX

#define UINT64_MAX   0xffffffffffffffffULL

Definition at line 116 of file Ubsan.h.

◆ uint64_t

typedef UINT64 uint64_t   UINT64

Definition at line 60 of file Ubsan.h.

◆ UINT8_MAX

#define UINT8_MAX   0xffU

Definition at line 113 of file Ubsan.h.

◆ uint8_t

#define uint8_t   UINT8

Definition at line 57 of file Ubsan.h.

◆ uintptr_t

#define uintptr_t   UINTN

Definition at line 63 of file Ubsan.h.

◆ va_arg

#define va_arg   VA_ARG

Definition at line 100 of file Ubsan.h.

◆ va_end

#define va_end   VA_END

Definition at line 99 of file Ubsan.h.

◆ va_list

#define va_list   VA_LIST

Definition at line 97 of file Ubsan.h.

◆ va_start

#define va_start   VA_START

Definition at line 98 of file Ubsan.h.

◆ vpanic

#define vpanic ( f,
v )
Value:
do { vprintf (f, v); do { } while (1); } while (0)
#define vprintf(f, v)
Definition Ubsan.h:206

Definition at line 208 of file Ubsan.h.

◆ vprintf

#define vprintf ( f,
v )
Value:
do { CHAR8 Tmp__[1024]; tfp_vsnprintf (Tmp__, sizeof (Tmp__), f, v); AsciiPrint ("%a", Tmp__); } while (0)
int tfp_vsnprintf(char *str, size_t size, const char *fmt, va_list ap)

Definition at line 206 of file Ubsan.h.

Typedef Documentation

◆ putcf

typedef void(* putcf) (void *, char)

Definition at line 197 of file Ubsan.h.

Function Documentation

◆ tfp_format()

void EFIAPI tfp_format ( void * putp,
putcf putf,
const char * fmt,
va_list va )

◆ tfp_snprintf()

int EFIAPI tfp_snprintf ( char * str,
size_t size,
const char * fmt,
... )

◆ tfp_sprintf()

int EFIAPI tfp_sprintf ( char * str,
const char * fmt,
... )

◆ tfp_vsnprintf()

int tfp_vsnprintf ( char * str,
size_t size,
const char * fmt,
va_list ap )

◆ tfp_vsprintf()

int EFIAPI int EFIAPI tfp_vsprintf ( char * str,
const char * fmt,
va_list ap )