summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/BootKit/Protocol.hxx
blob: 2f84d0a8e82b2c6a02ba715f583e551f2d9a252c (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 *      ========================================================
 *
 *      NewBoot
 *      Copyright Mahrouss Logic, all rights reserved.
 *
 *      ========================================================
 */

#pragma once

#include <EFIKit/EFI.hxx>

/* useful macros */

#define kHandoverMagic 0xBAD55

#define kBaseHandoverStruct 0x80000000
#define kHandoverStructSz sizeof(HEL::HandoverHeader)

namespace HCore::HEL {
/**
    @brief the kind of executable we're loading.
*/
enum {
  kTypeKernel = 100,
  kTypeKernelDriver = 101,
  kTypeRsrc = 102,
  kTypeCount = 3,
};

/**
    @brief The executable architecture.
*/

enum {
  kArchAmd64 = 122,
  kArchCount = 2,
};

/**
@brief The first struct that we read when inspecting The executable
it tells us more about it and IS format independent.
*/
struct __attribute__((packed)) HandoverHeader final {
  Int32 f_TargetMagic;
  Int32 f_TargetType;
  Int32 f_TargetArch;
  UIntPtr f_TargetStartAddress;
};

struct HandoverInformationHeader {
  HandoverHeader* f_Header;
  voidPtr f_VirtualStart;
  SizeT f_VirtualSize;
  voidPtr f_PhysicalStart;
  SizeT f_PhysicalSize;
  Char f_FirmwareVendorName[32];
  SizeT f_FirmwareVendorLen;
  voidPtr f_RsdPtr;
  voidPtr f_SmBIOS;
  voidPtr f_RTC;
};

/**
    @brief Handover Jump Proc
*/
typedef UInt64 (*HandoverProc)(HandoverInformationHeader* pHandover);
}  // namespace HCore::HEL