diff --git a/include/kernaux/multiboot2.h b/include/kernaux/multiboot2.h index c4466ac..18402c6 100644 --- a/include/kernaux/multiboot2.h +++ b/include/kernaux/multiboot2.h @@ -10,6 +10,13 @@ extern "C" { #define KERNAUX_MULTIBOOT2_MAGIC 0x36d76289 +#define KERNAUX_MULTIBOOT2_CHECKSUM(arch, total_size) \ + ((uint32_t)(-( \ + ((uint32_t)KERNAUX_MULTIBOOT2_MAGIC) + \ + ((uint32_t)(arch)) + \ + ((uint32_t)(total_size)) \ + ))) + #define KERNAUX_MULTIBOOT2_DATA(ptr) (((uint8_t*)(ptr)) + sizeof(*(ptr))) #define KERNAUX_MULTIBOOT2_HTAG_NEXT(tag_base) \