Core include file. More...
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdatomic.h>
Go to the source code of this file.
Macros | |
#define | __forceinline inline __attribute__((always_inline)) |
Force a function to be inline, even in debug mode. More... | |
#define | arrsize(x) ((int)(sizeof(x) / sizeof(x[0]))) |
Return the number of elements in the C array. More... | |
#define | min(a, b) ((a) < (b) ? (a) : (b)) |
Generic min/max routines. More... | |
#define | max(a, b) ((a) > (b) ? (a) : (b)) |
#define | div_dn(a, b) ((a) / (b)) |
#define | div_up(a, b) (((a) + (b) - 1) / (b)) |
#define | align_dn(a, b) (div_dn(a, b) * (b)) |
#define | align_up(a, b) (div_up(a, b) * (b)) |
#define | ptr_add(t, p, o) ((t *)((uint8_t *)(p) + (o))) |
#define | ptr_sub(t, p, o) ((t *)((uint8_t *)(p) - (o))) |
#define | STATIC_ASSERT(a, b) _Static_assert(a, b) |
Compile-time static assertion. More... | |
#define | PACKSTRUCT __attribute__((packed, aligned(1))) |
Forced structure packing (use only when absolutely necessary) More... | |
Core include file.
Definition in file core.h.
#define __forceinline inline __attribute__((always_inline)) |
Force a function to be inline, even in debug mode.
Definition at line 23 of file core.h.
Referenced by cpuid(), disable_interrupts(), enable_interrupts(), halt(), invalid_opcode(), invalidate_page(), io_inb(), io_ind(), io_inw(), io_outb(), io_outd(), io_outw(), rdmsr(), set_pagetable(), and wrmsr().
#define arrsize | ( | x | ) | ((int)(sizeof(x) / sizeof(x[0]))) |
Return the number of elements in the C array.
Definition at line 26 of file core.h.
Referenced by cmd_display_help(), command_exec(), command_run(), isr_fatal(), kshell(), and logvf().
#define min | ( | a, | |
b | |||
) | ((a) < (b) ? (a) : (b)) |
#define max | ( | a, | |
b | |||
) | ((a) > (b) ? (a) : (b)) |
Definition at line 30 of file core.h.
Referenced by collapse_overlaps(), grow_heap(), and heap_create().
#define div_up | ( | a, | |
b | |||
) | (((a) + (b) - 1) / (b)) |
Definition at line 34 of file core.h.
Referenced by grow_heap().
#define ptr_add | ( | t, | |
p, | |||
o | |||
) | ((t *)((uint8_t *)(p) + (o))) |
Definition at line 41 of file core.h.
Referenced by grow_heap(), heap_alloc(), heap_create(), heap_free(), next_fblock(), next_fblock_adj(), prev_fblock(), and prev_fblock_adj().
#define ptr_sub | ( | t, | |
p, | |||
o | |||
) | ((t *)((uint8_t *)(p) - (o))) |
Definition at line 42 of file core.h.
Referenced by grow_heap(), heap_free(), prev_fblock(), and prev_fblock_adj().
#define STATIC_ASSERT | ( | a, | |
b | |||
) | _Static_assert(a, b) |
struct acpi_madt_iso PACKSTRUCT __attribute__((packed, aligned(1))) |