]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/TianoTools/Include/Common/UefiBaseTypes.h
Remove the dependence to MdePkg
[mirror_edk2.git] / Tools / Source / TianoTools / Include / Common / UefiBaseTypes.h
1 /** @file
2 This file makes the BaseTypes.h backward compatible with the ones used in the
3 past for EFI and Tiano development. It's mostly just prepending an EFI_ on the
4 definitions.
5
6 Copyright (c) 2006, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 Module Name: UefiBaseTypes.h
16
17 **/
18
19 #ifndef __UEFI_BASE_TYPES_H__
20 #define __UEFI_BASE_TYPES_H__
21
22 #include <Common/BaseTypes.h>
23
24 typedef UINT64 EFI_LBA;
25
26 #define EFIERR(_a) ENCODE_ERROR(_a)
27
28 #define EFI_MAX_BIT MAX_BIT
29 #define EFI_MAX_ADDRESS MAX_ADDRESS
30 #define EFI_BREAKPOINT() CpuBreakpoint ()
31 #define EFI_DEADLOOP() CpuDeadLoop ()
32 #define EFI_ERROR(A) RETURN_ERROR(A)
33
34 typedef GUID EFI_GUID;
35 typedef RETURN_STATUS EFI_STATUS;
36
37 #define EFI_SUCCESS RETURN_SUCCESS
38 #define EFI_LOAD_ERROR RETURN_LOAD_ERROR
39 #define EFI_INVALID_PARAMETER RETURN_INVALID_PARAMETER
40 #define EFI_UNSUPPORTED RETURN_UNSUPPORTED
41 #define EFI_BAD_BUFFER_SIZE RETURN_BAD_BUFFER_SIZE
42 #define EFI_BUFFER_TOO_SMALL RETURN_BUFFER_TOO_SMALL
43 #define EFI_NOT_READY RETURN_NOT_READY
44 #define EFI_DEVICE_ERROR RETURN_DEVICE_ERROR
45 #define EFI_WRITE_PROTECTED RETURN_WRITE_PROTECTED
46 #define EFI_OUT_OF_RESOURCES RETURN_OUT_OF_RESOURCES
47 #define EFI_VOLUME_CORRUPTED RETURN_VOLUME_CORRUPTED
48 #define EFI_VOLUME_FULL RETURN_VOLUME_FULL
49 #define EFI_NO_MEDIA RETURN_NO_MEDIA
50 #define EFI_MEDIA_CHANGED RETURN_MEDIA_CHANGED
51 #define EFI_NOT_FOUND RETURN_NOT_FOUND
52 #define EFI_ACCESS_DENIED RETURN_ACCESS_DENIED
53 #define EFI_NO_RESPONSE RETURN_NO_RESPONSE
54 #define EFI_NO_MAPPING RETURN_NO_MAPPING
55 #define EFI_TIMEOUT RETURN_TIMEOUT
56 #define EFI_NOT_STARTED RETURN_NOT_STARTED
57 #define EFI_ALREADY_STARTED RETURN_ALREADY_STARTED
58 #define EFI_ABORTED RETURN_ABORTED
59 #define EFI_ICMP_ERROR RETURN_ICMP_ERROR
60 #define EFI_TFTP_ERROR RETURN_TFTP_ERROR
61 #define EFI_PROTOCOL_ERROR RETURN_PROTOCOL_ERROR
62 #define EFI_INCOMPATIBLE_VERSION RETURN_INCOMPATIBLE_VERSION
63 #define EFI_SECURITY_VIOLATION RETURN_SECURITY_VIOLATION
64 #define EFI_CRC_ERROR RETURN_CRC_ERROR
65 #define EFI_END_OF_MEDIA RETURN_END_OF_MEDIA
66 #define EFI_END_OF_FILE RETURN_END_OF_FILE
67
68 #define EFI_WARN_UNKNOWN_GLYPH RETURN_WARN_UNKNOWN_GLYPH
69 #define EFI_WARN_DELETE_FAILURE RETURN_WARN_DELETE_FAILURE
70 #define EFI_WARN_WRITE_FAILURE RETURN_WARN_WRITE_FAILURE
71 #define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL
72
73 //
74 // The EFI memory allocation functions work in units of EFI_PAGEs that are
75 // 4K. This should in no way be confused with the page size of the processor.
76 // An EFI_PAGE is just the quanta of memory in EFI.
77 //
78 #define EFI_PAGE_MASK 0xFFF
79 #define EFI_PAGE_SHIFT 12
80
81 #define EFI_SIZE_TO_PAGES(a) (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0))
82
83 #define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT)
84
85 #endif