]> code.delx.au - refind/blob - EfiLib/gnuefi-helper.h
Fixed uninitialized-pointer bug that manifested as a crash with
[refind] / EfiLib / gnuefi-helper.h
1 /*
2 * EfiLib/gnuefi-helper.h
3 * Header file for GNU-EFI support in legacy boot code
4 *
5 * Borrowed from the TianoCore EDK II, with modifications by Rod Smith
6 *
7 * Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
8 * This program and the accompanying materials
9 * are licensed and made available under the terms and conditions of the BSD License
10 * which accompanies this distribution. The full text of the license may be found at
11 * http://opensource.org/licenses/bsd-license.php
12 *
13 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 *
16 */
17 /*
18 * THIS FILE SHOULD NOT BE INCLUDED WHEN COMPILING UNDER TIANOCORE'S TOOLKIT!
19 */
20
21 #ifndef __EFILIB_GNUEFI_H
22 #define __EFILIB_GNUEFI_H
23
24 #include "efi.h"
25 #include "efilib.h"
26
27 #define EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH
28 #define UnicodeSPrint SPrint
29 #define gRT RT
30 #define gBS BS
31 #ifndef CONST
32 #define CONST
33 #endif
34 #define ASSERT_EFI_ERROR(status) ASSERT(!EFI_ERROR(status))
35
36 CHAR8 *
37 UnicodeStrToAsciiStr (
38 IN CHAR16 *Source,
39 OUT CHAR8 *Destination
40 );
41
42 UINTN
43 AsciiStrLen (
44 IN CONST CHAR8 *String
45 );
46
47 UINTN
48 EFIAPI
49 GetDevicePathSize (
50 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
51 );
52
53 EFI_DEVICE_PATH_PROTOCOL *
54 EFIAPI
55 GetNextDevicePathInstance (
56 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
57 OUT UINTN *Size
58 );
59
60 #endif