Cover lbas
This commit is contained in:
parent
4aed105616
commit
8425590c3f
|
@ -1,13 +1,14 @@
|
||||||
#ifndef __JABYENGINE_OVERLAY__H__
|
#ifndef __JABYENGINE_OVERLAY__HPP__
|
||||||
#define __JABYENGINE_OVERLAY__H__
|
#define __JABYENGINE_OVERLAY__HPP__
|
||||||
#include "../../stdint.h"
|
#include "../../stdint.h"
|
||||||
|
|
||||||
typedef struct __attribute__((packed)) {
|
typedef struct __attribute__((packed)) {
|
||||||
void (*execute)();
|
void (*execute)();
|
||||||
|
uint16_t lba_size;
|
||||||
} OverlayHeader;
|
} OverlayHeader;
|
||||||
|
|
||||||
typedef struct __attribute__((packed)) {
|
typedef struct __attribute__((packed)) {
|
||||||
uint16_t lba;
|
uint16_t lba;
|
||||||
uint16_t size;
|
uint16_t size;
|
||||||
} OverlayLBA;
|
} OverlayLBA;
|
||||||
#endif //!__JABYENGINE_OVERLAY__H__
|
#endif //!__JABYENGINE_OVERLAY__HPP__
|
|
@ -1,16 +1,14 @@
|
||||||
#ifndef __JABYENGINE_OVERLAY_DECLARATION__H__
|
#ifndef __JABYENGINE_OVERLAY_DECLARATION__HPP__
|
||||||
#define __JABYENGINE_OVERLAY_DECLARATION__H__
|
#define __JABYENGINE_OVERLAY_DECLARATION__HPP__
|
||||||
|
|
||||||
// No include here because this header should be included in a namespace and we don't want multiple namespace definitions of OverlayHeader and OverlayLBA
|
// No include here because this header should be included in a namespace and we don't want multiple namespace definitions of OverlayHeader and OverlayLBA
|
||||||
|
|
||||||
extern const OverlayHeader overlay_header;
|
extern const OverlayHeader overlay_header;
|
||||||
extern const OverlayLBA overlay_lba[];
|
extern const OverlayLBA overlay_lba[];
|
||||||
|
|
||||||
#define __declare_overlay_header(function) \
|
#define __declare_overlay_header(function, enum_struct) \
|
||||||
[[gnu::used]] \
|
[[gnu::used]] \
|
||||||
const OverlayHeader __section(".header") overlay_header = {.execute = &function};
|
const OverlayHeader __section(".header") overlay_header = {.execute = &function, .lba_size = static_cast<uint16_t>(enum_struct::EndOfRequest)}; \
|
||||||
|
|
||||||
#define __declare_overlay_lbas(...) \
|
|
||||||
[[gnu::used]] \
|
[[gnu::used]] \
|
||||||
const OverlayLBA __section(".header.lbas") overlay_lba[] = {__VA_ARGS__};
|
const OverlayLBA __section(".header.lbas") overlay_lba[static_cast<int>(enum_struct::EndOfRequest)] = {0}
|
||||||
#endif //!__JABYENGINE_OVERLAY_DECLARATION__H__
|
#endif //!__JABYENGINE_OVERLAY_DECLARATION__HPP__
|
|
@ -0,0 +1,8 @@
|
||||||
|
#ifndef __JABYENGINE_OVERLAY_LBA__HPP__
|
||||||
|
#define __JABYENGINE_OVERLAY_LBA__HPP__
|
||||||
|
|
||||||
|
#define __jabyengine_start_lba_request
|
||||||
|
#define __jabyengine_request_lba_for(name, file) name
|
||||||
|
#define __jabyengine_end_lba_request EndOfRequest
|
||||||
|
|
||||||
|
#endif //!__JABYENGINE_OVERLAY_LBA__HPP__
|
Loading…
Reference in New Issue