mirror of
https://github.com/tailix/libkernaux.git
synced 2025-02-24 15:55:41 -05:00
Add macro KERNAUX_MULTIBOOT2_TAG_NEXT
This commit is contained in:
parent
0a309ec182
commit
23c479c411
5 changed files with 9 additions and 8 deletions
|
@ -11,6 +11,9 @@ extern "C" {
|
||||||
#define KERNAUX_MULTIBOOT2_MAGIC 0x36d76289
|
#define KERNAUX_MULTIBOOT2_MAGIC 0x36d76289
|
||||||
|
|
||||||
#define KERNAUX_MULTIBOOT2_DATA(ptr) (((uint8_t*)(ptr)) + sizeof(*(ptr)))
|
#define KERNAUX_MULTIBOOT2_DATA(ptr) (((uint8_t*)(ptr)) + sizeof(*(ptr)))
|
||||||
|
|
||||||
|
#define KERNAUX_MULTIBOOT2_TAG_NEXT(tag_base) \
|
||||||
|
((uint8_t*)tag_base + KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base))
|
||||||
#define KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base) \
|
#define KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base) \
|
||||||
(((tag_base)->size + 7) & ~7)
|
(((tag_base)->size + 7) & ~7)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ const struct KernAux_Multiboot2_HTagBase
|
||||||
if (tag_base->type == tag_type) return tag_base;
|
if (tag_base->type == tag_type) return tag_base;
|
||||||
|
|
||||||
tag_base = (struct KernAux_Multiboot2_HTagBase*)(
|
tag_base = (struct KernAux_Multiboot2_HTagBase*)(
|
||||||
(uint8_t*)tag_base + KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base)
|
KERNAUX_MULTIBOOT2_TAG_NEXT(tag_base)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ const struct KernAux_Multiboot2_HTagBase
|
||||||
if (tag_base->type == tag_type && tag_base > after_tag) return tag_base;
|
if (tag_base->type == tag_type && tag_base > after_tag) return tag_base;
|
||||||
|
|
||||||
tag_base = (struct KernAux_Multiboot2_HTagBase*)(
|
tag_base = (struct KernAux_Multiboot2_HTagBase*)(
|
||||||
(uint8_t*)tag_base + KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base)
|
KERNAUX_MULTIBOOT2_TAG_NEXT(tag_base)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ const struct KernAux_Multiboot2_ITagBase
|
||||||
if (tag_base->type == tag_type) return tag_base;
|
if (tag_base->type == tag_type) return tag_base;
|
||||||
|
|
||||||
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
||||||
(uint8_t*)tag_base + KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base)
|
KERNAUX_MULTIBOOT2_TAG_NEXT(tag_base)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ const struct KernAux_Multiboot2_ITagBase
|
||||||
if (tag_base->type == tag_type && tag_base > after_tag) return tag_base;
|
if (tag_base->type == tag_type && tag_base > after_tag) return tag_base;
|
||||||
|
|
||||||
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
||||||
(uint8_t*)tag_base + KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base)
|
KERNAUX_MULTIBOOT2_TAG_NEXT(tag_base)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,7 @@ bool KernAux_Multiboot2_Info_is_valid(
|
||||||
}
|
}
|
||||||
|
|
||||||
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
||||||
(unsigned char*)tag_base +
|
KERNAUX_MULTIBOOT2_TAG_NEXT(tag_base)
|
||||||
KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,8 +94,7 @@ void KernAux_Multiboot2_Info_print(
|
||||||
KernAux_Multiboot2_ITagBase_print(tag_base, printf);
|
KernAux_Multiboot2_ITagBase_print(tag_base, printf);
|
||||||
|
|
||||||
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
tag_base = (struct KernAux_Multiboot2_ITagBase*)(
|
||||||
(unsigned char*)tag_base +
|
KERNAUX_MULTIBOOT2_TAG_NEXT(tag_base)
|
||||||
KERNAUX_MULTIBOOT2_TAG_SIZE_ALIGN(tag_base)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue