218 lines
4.5 KiB
C
218 lines
4.5 KiB
C
/**
|
|
* PROJECT: ExectOS
|
|
* COPYRIGHT: See COPYING.md in the top level directory
|
|
* FILE: xtldr/includes/bootman.h
|
|
* DESCRIPTION: XTLDR Boot Loader related structures and routines forward references
|
|
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
|
*/
|
|
|
|
#ifndef __XTLDR_BOOTMAN_H
|
|
#define __XTLDR_BOOTMAN_H
|
|
|
|
#include <xtblapi.h>
|
|
|
|
|
|
/* XTLDR routine callbacks */
|
|
typedef VOID (BMPRINTCHAR)(IN USHORT Character);
|
|
|
|
/* XTLDR routines forward references */
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlCloseVolume(IN PEFI_HANDLE VolumeHandle);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlEnumerateBlockDevices();
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlExitBootServices(IN UINT_PTR MapKey);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlFindVolumeDevicePath(IN PEFI_DEVICE_PATH_PROTOCOL FsHandle,
|
|
IN CONST PWCHAR FileSystemPath,
|
|
OUT PEFI_DEVICE_PATH_PROTOCOL* DevicePath);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlGetVolumeDevicePath(IN PCHAR SystemPath,
|
|
OUT PEFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
|
OUT PCHAR *ArcName,
|
|
OUT PCHAR *Path);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlMemoryAllocatePages(IN UINT64 Pages,
|
|
OUT PEFI_PHYSICAL_ADDRESS Memory);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlMemoryAllocatePool(IN UINT_PTR Size,
|
|
OUT PVOID *Memory);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlOpenVolume(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath,
|
|
OUT PEFI_HANDLE DiskHandle,
|
|
OUT PEFI_FILE_HANDLE *FsHandle);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlConsoleClearScreen();
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlConsoleDisableCursor();
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlConsoleEnableCursor();
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlConsolePrint(IN PUINT16 Format,
|
|
IN ...);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlDebugPrint(IN PUINT16 Format,
|
|
IN ...);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlMemoryFreePages(IN UINT64 Pages,
|
|
IN EFI_PHYSICAL_ADDRESS Memory);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlMemoryFreePool(IN PVOID Memory);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlOpenXtProtocol(OUT PVOID *ProtocolHandler,
|
|
IN PEFI_GUID ProtocolGuid);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlSleepExecution(IN ULONG_PTR Milliseconds);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlStartXtLoader(IN EFI_HANDLE ImageHandle,
|
|
IN PEFI_SYSTEM_TABLE SystemTable);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlpActivateSerialIOController();
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlpDiscoverEfiBlockDevices(OUT PLIST_ENTRY BlockDevices);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlpDissectVolumeArcPath(IN PCHAR SystemPath,
|
|
OUT PCHAR *ArcName,
|
|
OUT PCHAR *Path,
|
|
OUT PUSHORT DriveType,
|
|
OUT PULONG DriveNumber,
|
|
OUT PULONG PartNumber);
|
|
|
|
XTCDECL
|
|
PEFI_DEVICE_PATH_PROTOCOL
|
|
BlpDuplicateDevicePath(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlpFindLastBlockDeviceNode(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath,
|
|
OUT PEFI_DEVICE_PATH_PROTOCOL *LastNode);
|
|
|
|
XTCDECL
|
|
BOOLEAN
|
|
BlpFindParentBlockDevice(IN PLIST_ENTRY BlockDevices,
|
|
IN PEFI_BLOCK_DEVICE_DATA ChildNode,
|
|
OUT PEFI_BLOCK_DEVICE_DATA ParentNode);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpParseCommandLineOptions(VOID);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpUpdateGlobalConfiguration(IN PWCHAR Options);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpConsoleInitialize();
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpConsolePrintChar(IN USHORT Character);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpDebugPutChar(IN USHORT Character);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlpInitializeDebugConsole();
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpInitializeEfiBootLoader();
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlpInitializeSerialPort(IN ULONG PortNumber,
|
|
IN ULONG PortAddress,
|
|
IN ULONG BaudRate);
|
|
|
|
XTCDECL
|
|
EFI_STATUS
|
|
BlpRegisterXtLoaderProtocol();
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpStringFormat(IN BMPRINTCHAR PrintCharRoutine,
|
|
IN PUINT16 Format,
|
|
IN ...);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpStringPrint(IN IN BMPRINTCHAR PrintCharRoutine,
|
|
IN PUINT16 Format,
|
|
IN VA_LIST Arguments);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpStringPrintSigned32(IN BMPRINTCHAR PrintCharRoutine,
|
|
IN INT Number,
|
|
IN UINT Base);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpStringPrintSigned64(IN BMPRINTCHAR PrintCharRoutine,
|
|
IN INT_PTR Number,
|
|
IN UINT_PTR Base);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpStringPrintUnsigned32(IN BMPRINTCHAR PrintCharRoutine,
|
|
IN UINT Number,
|
|
IN UINT Base,
|
|
IN UINT Padding);
|
|
|
|
XTCDECL
|
|
VOID
|
|
BlpStringPrintUnsigned64(IN BMPRINTCHAR PrintCharRoutine,
|
|
IN UINT_PTR Number,
|
|
IN UINT_PTR Base,
|
|
IN UINT_PTR Padding);
|
|
|
|
XTCDECL
|
|
UINT64
|
|
BlpStringReadPadding(IN PUINT16 *Format);
|
|
|
|
#endif /* __XTLDR_BOOTMAN_H */
|