2022-11-30 18:49:16 -05:00
|
|
|
#ifndef KERNAUX_INCLUDED_MULTIBOOT2_HEADER_MACRO
|
|
|
|
#define KERNAUX_INCLUDED_MULTIBOOT2_HEADER_MACRO
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <kernaux/macro.h>
|
|
|
|
#include <kernaux/multiboot2.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-12-16 03:28:58 -05:00
|
|
|
#define KERNAUX_MULTIBOOT2_HEADER_CHECKSUM(arch, total_size) \
|
|
|
|
((uint32_t)(-( \
|
|
|
|
((uint32_t)KERNAUX_MULTIBOOT2_HEADER_MAGIC) + \
|
|
|
|
((uint32_t)(arch)) + \
|
|
|
|
((uint32_t)(total_size)) \
|
|
|
|
)))
|
|
|
|
|
2022-11-30 18:49:16 -05:00
|
|
|
#define KERNAUX_MULTIBOOT2_HFIELDS_COMMON(name, type) \
|
|
|
|
struct { \
|
|
|
|
struct KernAux_Multiboot2_HTag_##type tag; \
|
|
|
|
} KERNAUX_PACKED name;
|
|
|
|
|
|
|
|
#define KERNAUX_MULTIBOOT2_HFIELDS_INFO_REQ_ODD( \
|
|
|
|
name, mbi_tag_types_count, align_name \
|
|
|
|
) \
|
|
|
|
struct { \
|
|
|
|
struct KernAux_Multiboot2_HTag_InfoReq tag; \
|
|
|
|
uint32_t mbi_tag_types[mbi_tag_types_count]; \
|
|
|
|
} KERNAUX_PACKED name; \
|
|
|
|
uint8_t align_name[4];
|
|
|
|
|
|
|
|
#define KERNAUX_MULTIBOOT2_HFIELDS_INFO_REQ_EVEN( \
|
|
|
|
name, mbi_tag_types_count \
|
|
|
|
) \
|
|
|
|
struct { \
|
|
|
|
struct KernAux_Multiboot2_HTag_InfoReq tag; \
|
|
|
|
uint32_t mbi_tag_types[mbi_tag_types_count]; \
|
|
|
|
} KERNAUX_PACKED name;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|