summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/FirmwareKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/FirmwareKit')
-rw-r--r--dev/kernel/FirmwareKit/CoreBoot/BootNet.h2
-rw-r--r--dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h4
-rw-r--r--dev/kernel/FirmwareKit/EFI/API.h2
-rw-r--r--dev/kernel/FirmwareKit/EFI/EFI.h109
-rw-r--r--dev/kernel/FirmwareKit/GPT.h2
5 files changed, 114 insertions, 5 deletions
diff --git a/dev/kernel/FirmwareKit/CoreBoot/BootNet.h b/dev/kernel/FirmwareKit/CoreBoot/BootNet.h
index e3cda0ba..c2bfe161 100644
--- a/dev/kernel/FirmwareKit/CoreBoot/BootNet.h
+++ b/dev/kernel/FirmwareKit/CoreBoot/BootNet.h
@@ -26,5 +26,5 @@ typedef struct BOOTNET_INTERNET_HEADER
Kernel::Char Target[kBootNetNameLen]; /// the target file.
Kernel::Boolean ImpliesProgram : 1; /// does it imply an EEPROM program?
Kernel::Boolean Preflight : 1; /// is it a preflight packet.
- Kernel::Char Data[]; /// non preflight packet has a patch blob for a **PatchTarget**
+ Kernel::Char Data[1]; /// non preflight packet has a patch blob for a **PatchTarget**
} ATTRIBUTE(packed) BOOTNET_INTERNET_HEADER;
diff --git a/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h b/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h
index f5470877..e1f3fbc6 100644
--- a/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h
+++ b/dev/kernel/FirmwareKit/CoreBoot/CoreBoot.h
@@ -24,12 +24,12 @@ namespace Firmware::Detail::CoreBoot
const UInt32 fStartAddress; // start address (master/slave(s) thread)
#ifdef NE_IS_EXTENDED_COREBOOT
- UIntPtr fMasterStructure; // master structure for MP/PM and device tree and such. (ARM)
+ UIntPtr fMasterStructure; // master structure for MP/PM and device tree and such. (ARM)
UIntPtr fMasterStructureVersion; // master structure version.
#endif
#ifdef NE_IS_MBCI_COREBOOT
- UIntPtr fMBCIStructure; // MBCI structure for MBCI (ARM)
+ UIntPtr fMBCIStructure; // MBCI structure for MBCI (ARM)
UIntPtr fMBCIStructureVersion; // MBCI structure version.
#endif
};
diff --git a/dev/kernel/FirmwareKit/EFI/API.h b/dev/kernel/FirmwareKit/EFI/API.h
index 403e017e..9140d131 100644
--- a/dev/kernel/FirmwareKit/EFI/API.h
+++ b/dev/kernel/FirmwareKit/EFI/API.h
@@ -83,7 +83,7 @@ Bascially frees everything we have in the EFI side.
}
} // namespace Boot
-inline void InitEFI(EfiSystemTable* SystemTable) noexcept
+inline void fw_init_efi(EfiSystemTable* SystemTable) noexcept
{
if (!SystemTable)
return;
diff --git a/dev/kernel/FirmwareKit/EFI/EFI.h b/dev/kernel/FirmwareKit/EFI/EFI.h
index 1e6de42c..24f474d1 100644
--- a/dev/kernel/FirmwareKit/EFI/EFI.h
+++ b/dev/kernel/FirmwareKit/EFI/EFI.h
@@ -21,10 +21,16 @@ using namespace Kernel;
#define EFI_API __attribute__((ms_abi))
#endif // ifndef EPI_API
+#ifndef EPIAPI
+#define EFIAPI __attribute__((ms_abi))
+#endif // ifndef EPIAPI
+
#define IN
#define OUT
#define OPTIONAL
+#define EFI_STATUS EfiStatusType
+
#define EFI_FINAL final
// Forward decls
@@ -285,6 +291,24 @@ typedef struct EfiTableHeader
} \
}
+#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \
+ { \
+ 0xA19832B9, 0xAC25, 0x11D3, \
+ { \
+ 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
+ } \
+ }
+
+#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000
+
+#define EFI_IP4_PROTOCOL_GUID \
+ { \
+ 0x41d94cd2, 0x35b6, 0x455a, \
+ { \
+ 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd \
+ } \
+ }
+
#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
@@ -330,6 +354,91 @@ enum
kPixelFormatMax
};
+struct EFI_SIMPLE_NETWORK_PROTOCOL;
+
+typedef EFI_STATUS(EFI_API* EFI_SIMPLE_NETWORK_START)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL* This);
+
+typedef EFI_STATUS(EFI_API* EFI_SIMPLE_NETWORK_STOP)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL* This);
+
+typedef EFI_STATUS(EFI_API* EFI_SIMPLE_NETWORK_INITIALIZE)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL* This,
+ IN UInt32 ExtraRxBufferSize OPTIONAL,
+ IN UInt32 ExtraTxBufferSize OPTIONAL);
+
+typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_RESET)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL* This,
+ IN Boolean ExtendedVerification);
+
+typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_SHUTDOWN)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL* This);
+
+typedef UInt8 EfiMacAddress[32];
+
+#define MAX_MCAST_FILTER_CNT 16
+
+typedef struct
+{
+ UInt32 State;
+ UInt32 HwAddressSize;
+ UInt32 MediaHeaderSize;
+ UInt32 MaxPacketSize;
+ UInt32 NvRamSize;
+ UInt32 NvRamAccessSize;
+ UInt32 ReceiveFilterMask;
+ UInt32 ReceiveFilterSetting;
+ UInt32 MaxMCastFilterCount;
+ UInt32 MCastFilterCount;
+ EfiMacAddress MCastFilter[MAX_MCAST_FILTER_CNT];
+ EfiMacAddress CurrentAddress;
+ EfiMacAddress BroadcastAddress;
+ EfiMacAddress PermanentAddress;
+ UInt8 IfType;
+ BOOL MacAddressChangeable;
+ BOOL MultipleTxSupported;
+ BOOL MediaPresentSupported;
+ BOOL MediaPresent;
+} EFI_SIMPLE_NETWORK_MODE;
+
+typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_TRANSMIT)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL* This,
+ IN UInt32 HeaderSize,
+ IN UInt32 BufferSize,
+ IN Void* Buffer,
+ IN EfiMacAddress* SrcAddr OPTIONAL,
+ IN EfiMacAddress* DestAddr OPTIONAL,
+ IN UInt16* Protocol OPTIONAL);
+
+typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_RECEIVE)(
+ IN EFI_SIMPLE_NETWORK_PROTOCOL* This,
+ OUT UInt32* HeaderSize OPTIONAL,
+ IN OUT UInt32* BufferSize,
+ OUT Void* Buffer,
+ OUT EfiMacAddress* SrcAddr OPTIONAL,
+ OUT EfiMacAddress* DestAddr OPTIONAL,
+ OUT UInt16* Protocol OPTIONAL);
+
+typedef struct EFI_SIMPLE_NETWORK_PROTOCOL
+{
+ UInt64 Revision;
+ EFI_SIMPLE_NETWORK_START Start;
+ EFI_SIMPLE_NETWORK_STOP Stop;
+ EFI_SIMPLE_NETWORK_INITIALIZE Initialize;
+ EFI_SIMPLE_NETWORK_RESET Reset;
+ EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown;
+ VoidPtr ReceiveFilters;
+ VoidPtr StationAddress;
+ VoidPtr Statistics;
+ VoidPtr MCastIpToMac;
+ VoidPtr NvData;
+ VoidPtr GetStatus;
+ EFI_SIMPLE_NETWORK_TRANSMIT Transmit;
+ EFI_SIMPLE_NETWORK_RECEIVE Receive;
+ VoidPtr WaitForPacket;
+ EFI_SIMPLE_NETWORK_MODE* Mode;
+} EFI_SIMPLE_NETWORK_PROTOCOL;
+
typedef struct EfiBitmask
{
UInt32 RedMask;
diff --git a/dev/kernel/FirmwareKit/GPT.h b/dev/kernel/FirmwareKit/GPT.h
index c903f3ab..a8b53ead 100644
--- a/dev/kernel/FirmwareKit/GPT.h
+++ b/dev/kernel/FirmwareKit/GPT.h
@@ -10,7 +10,7 @@
#include <FirmwareKit/EFI/EFI.h>
#define kSectorSizeGPT (512U)
-#define kPartNameGPT (8U)
+#define kPartNameGPT (8U)
namespace Kernel
{