forked from numworks/epsilon
-
Notifications
You must be signed in to change notification settings - Fork 92
/
slot.h
37 lines (26 loc) · 847 Bytes
/
slot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef BOOTLOADER_SLOT_H
#define BOOTLOADER_SLOT_H
#include <stdint.h>
#include "kernel_header.h"
#include "userland_header.h"
#include "slot_exam_mode.h"
namespace Bootloader {
class Slot {
public:
Slot(uint32_t address) :
m_kernelHeader(reinterpret_cast<KernelHeader*>(address)),
m_userlandHeader(reinterpret_cast<UserlandHeader*>(address + 64 * 1024)),
m_userland2Header(reinterpret_cast<UserlandHeader*>(address + 128 * 1024)) { }
const KernelHeader* kernelHeader() const;
const UserlandHeader* userlandHeader() const;
const UserlandHeader* userland2Header() const;
[[ noreturn ]] void boot(const char* Slot) const;
static const Slot A();
static const Slot B();
private:
const KernelHeader* m_kernelHeader;
const UserlandHeader* m_userlandHeader;
const UserlandHeader* m_userland2Header;
};
}
#endif