Add MIN and MAX helper macros
All checks were successful
Builds / ExectOS (i686, release) (push) Successful in 29s
Builds / ExectOS (amd64, debug) (push) Successful in 40s
Builds / ExectOS (amd64, release) (push) Successful in 32s
Builds / ExectOS (i686, debug) (push) Successful in 38s

This commit is contained in:
2026-02-26 20:12:28 +01:00
parent 7bdd0dfe2c
commit a72bfd3902

View File

@@ -74,6 +74,10 @@
/* Macro for calculating size of a field in the structure */
#define FIELD_SIZE(Structure, Field) (sizeof(((Structure *)0)->Field))
/* Macros for calculating minimum and maximum of two values */
#define MIN(A, B) (((A) < (B)) ? (A) : (B))
#define MAX(A, B) (((A) > (B)) ? (A) : (B))
/* Macro that page-aligns a virtual address */
#define PAGE_ALIGN(VirtualAddress) ((PVOID)((ULONG_PTR)VirtualAddress & ~MM_PAGE_MASK))