Print this page
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
loader: pxe receive cleanup
9475 libefi: Do not return only if ReceiveFilter
installboot: should support efi system partition
8931 boot1.efi: scan all display modes rather than
loader: spinconsole updates
loader: gfx experiment to try GOP Blt() function.
sha1 build test
loader: add sha1 hash calculation
common/sha1: update for loader build
loader: biosdisk rework
uts: 32-bit kernel FB needs mapping in low memory
uts: add diag-device
uts: boot console mirror with diag-device
uts: enable very early console on ttya
kmdb: add diag-device as input/output device
uts: test VGA memory exclusion from mapping
uts: clear boot mapping and protect boot pages test
uts: add dboot map debug printf
uts: need to release FB pages in release_bootstrap()
uts: add screenmap ioctl
uts: update sys/queue.h
loader: add illumos uts/common to include path
loader: tem/gfx font cleanup
loader: vbe checks
uts: gfx_private set KD_TEXT when KD_RESETTEXT is
uts: gfx 8-bit update
loader: gfx 8-bit fix
loader: always set media size from partition.
uts: MB2 support for 32-bit kernel
loader: x86 should have tem 80x25
uts: x86 should have tem 80x25
uts: font update
loader: font update
uts: tem attributes
loader: tem.c comment added
uts: use font module
loader: add font module
loader: build rules for new font setup
uts: gfx_private update for new font structure
uts: early boot update for new font structure
uts: font update
uts: font build rules update for new fonts
uts: tem update to new font structure
loader: module.c needs to include tem_impl.h
uts: gfx_private 8x16 font rework
uts: make font_lookup public
loader: font rework
uts: font rework
9259 libefi: efi_alloc_and_read should check for PMBR
uts: tem utf-8 support
loader: implement tem utf-8 support
loader: tem should be able to display UTF-8
7784 uts: console input should support utf-8
7796 uts: ldterm default to utf-8
uts: do not reset serial console
uts: set up colors even if tem is not console
uts: add type for early boot properties
uts: gfx_private experiment with drm and vga
uts: gfx_private should use setmode drm callback.
uts: identify FB types and set up gfx_private based
loader: replace gop and vesa with framebuffer
uts: boot needs simple tem to support mdb
uts: boot_keyboard should emit esc sequences for
uts: gfx_private FB showuld be written by line
kmdb: set terminal window size
uts: gfx_private needs to keep track of early boot FB
pnglite: move pnglite to usr/src/common
loader: gfx_fb
ficl-sys: add gfx primitives
loader: add illumos.png logo
ficl: add fb-putimage
loader: add png support
loader: add alpha blending for gfx_fb
loader: use term-drawrect for menu frame
ficl: add simple gfx words
uts: provide fb_info via fbgattr dev_specific array.
uts: gfx_private add alpha blending
uts: update sys/ascii.h
uts: tem OSC support (incomplete)
uts: implement env module support and use data from
uts: tem get colors from early boot data
loader: use crc32 from libstand (libz)
loader: optimize for size
loader: pass tem info to the environment
loader: import tem for loader console
loader: UEFI loader needs to set ISADIR based on
loader: need UEFI32 support
8918 loader.efi: add vesa edid support
uts: tem_safe_pix_clear_prom_output() should only
uts: tem_safe_pix_clear_entire_screen() should use
uts: tem_safe_check_first_time() should query cursor
uts: tem implement cls callback & visual_io v4
uts: gfx_vgatext use block cursor for vgatext
uts: gfx_private implement cls callback & visual_io
uts: gfx_private bitmap framebuffer implementation
uts: early start frame buffer console support
uts: font functions should check the input char
uts: font rendering should support 16/24/32bit depths
uts: use smallest font as fallback default.
uts: update terminal dimensions based on selected
7834 uts: vgatext should use gfx_private
uts: add spacing property to 8859-1.bdf
terminfo: add underline for sun-color
terminfo: sun-color has 16 colors
uts: add font load callback type
loader: do not repeat int13 calls with error 0x20 and
8905 loader: add skein/edonr support
8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Revert "NEX-16819 loader UEFI support"
This reverts commit ec06b9fc617b99234e538bf2e7e4d02a24993e0c.
Reverting due to failures in the zfs-tests and the sharefs-tests
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
loader: pxe receive cleanup
9475 libefi: Do not return only if ReceiveFilter
installboot: should support efi system partition
8931 boot1.efi: scan all display modes rather than
loader: spinconsole updates
loader: gfx experiment to try GOP Blt() function.
sha1 build test
loader: add sha1 hash calculation
common/sha1: update for loader build
loader: biosdisk rework
uts: 32-bit kernel FB needs mapping in low memory
uts: add diag-device
uts: boot console mirror with diag-device
uts: enable very early console on ttya
kmdb: add diag-device as input/output device
uts: test VGA memory exclusion from mapping
uts: clear boot mapping and protect boot pages test
uts: add dboot map debug printf
uts: need to release FB pages in release_bootstrap()
uts: add screenmap ioctl
uts: update sys/queue.h
loader: add illumos uts/common to include path
loader: tem/gfx font cleanup
loader: vbe checks
uts: gfx_private set KD_TEXT when KD_RESETTEXT is
uts: gfx 8-bit update
loader: gfx 8-bit fix
loader: always set media size from partition.
uts: MB2 support for 32-bit kernel
loader: x86 should have tem 80x25
uts: x86 should have tem 80x25
uts: font update
loader: font update
uts: tem attributes
loader: tem.c comment added
uts: use font module
loader: add font module
loader: build rules for new font setup
uts: gfx_private update for new font structure
uts: early boot update for new font structure
uts: font update
uts: font build rules update for new fonts
uts: tem update to new font structure
loader: module.c needs to include tem_impl.h
uts: gfx_private 8x16 font rework
uts: make font_lookup public
loader: font rework
uts: font rework
libefi: efi_alloc_and_read should check for PMBR
uts: tem utf-8 support
loader: implement tem utf-8 support
loader: tem should be able to display UTF-8
7784 uts: console input should support utf-8
7796 uts: ldterm default to utf-8
uts: do not reset serial console
uts: set up colors even if tem is not console
uts: add type for early boot properties
uts: gfx_private experiment with drm and vga
uts: gfx_private should use setmode drm callback.
uts: identify FB types and set up gfx_private based
loader: replace gop and vesa with framebuffer
uts: boot needs simple tem to support mdb
uts: boot_keyboard should emit esc sequences for
uts: gfx_private FB showuld be written by line
kmdb: set terminal window size
uts: gfx_private needs to keep track of early boot FB
pnglite: move pnglite to usr/src/common
loader: gfx_fb
ficl-sys: add gfx primitives
loader: add illumos.png logo
ficl: add fb-putimage
loader: add png support
loader: add alpha blending for gfx_fb
loader: use term-drawrect for menu frame
ficl: add simple gfx words
uts: provide fb_info via fbgattr dev_specific array.
uts: gfx_private add alpha blending
uts: update sys/ascii.h
uts: tem OSC support (incomplete)
uts: implement env module support and use data from
uts: tem get colors from early boot data
loader: use crc32 from libstand (libz)
loader: optimize for size
loader: pass tem info to the environment
loader: import tem for loader console
loader: UEFI loader needs to set ISADIR based on
loader: need UEFI32 support
8918 loader.efi: add vesa edid support
uts: tem_safe_pix_clear_prom_output() should only
uts: tem_safe_pix_clear_entire_screen() should use
uts: tem_safe_check_first_time() should query cursor
uts: tem implement cls callback & visual_io v4
uts: gfx_vgatext use block cursor for vgatext
uts: gfx_private implement cls callback & visual_io
uts: gfx_private bitmap framebuffer implementation
uts: early start frame buffer console support
uts: font functions should check the input char
uts: font rendering should support 16/24/32bit depths
uts: use smallest font as fallback default.
uts: update terminal dimensions based on selected
7834 uts: vgatext should use gfx_private
uts: add spacing property to 8859-1.bdf
terminfo: add underline for sun-color
terminfo: sun-color has 16 colors
uts: add font load callback type
loader: do not repeat int13 calls with error 0x20 and
8905 loader: add skein/edonr support
8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/boot/sys/boot/efi/include/i386/efibind.h
+++ new/usr/src/boot/sys/boot/efi/include/i386/efibind.h
1 -/* $FreeBSD$ */
2 1 /*++
3 2
4 3 Copyright (c) 1999 - 2003 Intel Corporation. All rights reserved
5 4 This software and associated documentation (if any) is furnished
6 5 under a license and may only be used or copied in accordance
7 6 with the terms of the license. Except as permitted by such
8 7 license, no part of this software or documentation may be
9 8 reproduced, stored in a retrieval system, or transmitted in any
10 9 form or by any means without the express written consent of
11 10 Intel Corporation.
12 11
13 12 Module Name:
14 13
15 14 efefind.h
16 15
17 16 Abstract:
18 17
19 18 EFI to compile bindings
20 19
|
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
21 20
22 21
23 22
24 23 Revision History
25 24
26 25 --*/
27 26
28 27 #pragma pack()
29 28
30 29
31 -#ifdef __FreeBSD__
32 30 #include <sys/stdint.h>
33 -#else
31 +
32 +#if 0
34 33 //
35 34 // Basic int types of various widths
36 35 //
37 36
38 37 #if (__STDC_VERSION__ < 199901L )
39 38
40 39 // No ANSI C 1999/2000 stdint.h integer width declarations
41 40
42 41 #ifdef _MSC_EXTENSIONS
43 42
44 43 // Use Microsoft C compiler integer width declarations
45 44
46 45 typedef unsigned __int64 uint64_t;
47 46 typedef __int64 int64_t;
48 47 typedef unsigned __int32 uint32_t;
49 48 typedef __int32 int32_t;
50 49 typedef unsigned short uint16_t;
51 50 typedef short int16_t;
52 51 typedef unsigned char uint8_t;
53 52 typedef char int8_t;
54 53 #else
55 54 #ifdef UNIX_LP64
56 55
57 56 // Use LP64 programming model from C_FLAGS for integer width declarations
58 57
59 58 typedef unsigned long uint64_t;
60 59 typedef long int64_t;
61 60 typedef unsigned int uint32_t;
62 61 typedef int int32_t;
63 62 typedef unsigned short uint16_t;
64 63 typedef short int16_t;
65 64 typedef unsigned char uint8_t;
66 65 typedef char int8_t;
67 66 #else
68 67
69 68 // Assume P64 programming model from C_FLAGS for integer width declarations
70 69
71 70 typedef unsigned long long uint64_t;
|
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
72 71 typedef long long int64_t;
73 72 typedef unsigned int uint32_t;
74 73 typedef int int32_t;
75 74 typedef unsigned short uint16_t;
76 75 typedef short int16_t;
77 76 typedef unsigned char uint8_t;
78 77 typedef char int8_t;
79 78 #endif
80 79 #endif
81 80 #endif
82 -#endif /* __FreeBSD__ */
81 +#endif
83 82
84 83 //
85 84 // Basic EFI types of various widths
86 85 //
87 86
88 87 #ifndef ACPI_THREAD_ID /* ACPI's definitions are fine, use those */
89 88 #define ACPI_USE_SYSTEM_INTTYPES 1 /* Tell ACPI we've defined types */
90 89
91 90 typedef uint64_t UINT64;
92 91 typedef int64_t INT64;
93 92
94 93 #ifndef _BASETSD_H_
95 94 typedef uint32_t UINT32;
96 95 typedef int32_t INT32;
97 96 #endif
98 97
99 98 typedef uint16_t UINT16;
100 99 typedef int16_t INT16;
101 100 typedef uint8_t UINT8;
102 101 typedef int8_t INT8;
103 102
104 103 #endif
105 104
106 105 #undef VOID
107 106 #define VOID void
108 107
109 108
110 109 typedef int32_t INTN;
111 110 typedef uint32_t UINTN;
112 111
113 112 #ifdef EFI_NT_EMULATOR
114 113 #define POST_CODE(_Data)
115 114 #else
116 115 #ifdef EFI_DEBUG
117 116 #define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al
118 117 #else
119 118 #define POST_CODE(_Data)
120 119 #endif
121 120 #endif
122 121
123 122 #define EFIERR(a) (0x80000000 | a)
124 123 #define EFI_ERROR_MASK 0x80000000
125 124 #define EFIERR_OEM(a) (0xc0000000 | a)
126 125
127 126
128 127 #define BAD_POINTER 0xFBFBFBFB
129 128 #define MAX_ADDRESS 0xFFFFFFFF
130 129
131 130 #define BREAKPOINT() __asm { int 3 }
132 131
133 132 //
134 133 // Pointers must be aligned to these address to function
135 134 //
136 135
137 136 #define MIN_ALIGNMENT_SIZE 4
138 137
139 138 #define ALIGN_VARIABLE(Value ,Adjustment) \
140 139 (UINTN)Adjustment = 0; \
141 140 if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
142 141 (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \
143 142 Value = (UINTN)Value + (UINTN)Adjustment
144 143
145 144
146 145 //
147 146 // Define macros to build data structure signatures from characters.
148 147 //
149 148
150 149 #define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
151 150 #define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16))
152 151 #define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
153 152
154 153 //
155 154 // EFIAPI - prototype calling convention for EFI function pointers
156 155 // BOOTSERVICE - prototype for implementation of a boot service interface
157 156 // RUNTIMESERVICE - prototype for implementation of a runtime service interface
158 157 // RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
159 158 // RUNTIME_CODE - pragma macro for declaring runtime code
160 159 //
161 160
162 161 #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
163 162 #ifdef _MSC_EXTENSIONS
164 163 #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
165 164 #else
166 165 #define EFIAPI // Substitute expresion to force C calling convention
167 166 #endif
168 167 #endif
169 168
170 169 #define BOOTSERVICE
171 170 //#define RUNTIMESERVICE(proto,a) alloc_text("rtcode",a); proto a
172 171 //#define RUNTIMEFUNCTION(proto,a) alloc_text("rtcode",a); proto a
173 172 #define RUNTIMESERVICE
174 173 #define RUNTIMEFUNCTION
175 174
176 175
177 176 #define RUNTIME_CODE(a) alloc_text("rtcode", a)
178 177 #define BEGIN_RUNTIME_DATA() data_seg("rtdata")
179 178 #define END_RUNTIME_DATA() data_seg()
180 179
181 180 #define VOLATILE volatile
182 181
183 182 #define MEMORY_FENCE()
184 183
185 184 #ifdef EFI_NO_INTERFACE_DECL
186 185 #define EFI_FORWARD_DECLARATION(x)
187 186 #define EFI_INTERFACE_DECL(x)
188 187 #else
189 188 #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
190 189 #define EFI_INTERFACE_DECL(x) typedef struct x
191 190 #endif
192 191
193 192 #ifdef EFI_NT_EMULATOR
194 193
195 194 //
196 195 // To help ensure proper coding of integrated drivers, they are
197 196 // compiled as DLLs. In NT they require a dll init entry pointer.
198 197 // The macro puts a stub entry point into the DLL so it will load.
199 198 //
200 199
201 200 #define EFI_DRIVER_ENTRY_POINT(InitFunction) \
202 201 EFI_STATUS \
203 202 InitFunction ( \
204 203 EFI_HANDLE ImageHandle, \
205 204 EFI_SYSTEM_TABLE *SystemTable \
206 205 ); \
207 206 \
208 207 UINTN \
209 208 __stdcall \
210 209 _DllMainCRTStartup ( \
211 210 UINTN Inst, \
212 211 UINTN reason_for_call, \
213 212 VOID *rserved \
214 213 ) \
215 214 { \
216 215 return 1; \
217 216 } \
218 217 \
219 218 int \
220 219 __declspec( dllexport ) \
221 220 __cdecl \
222 221 InitializeDriver ( \
223 222 void *ImageHandle, \
224 223 void *SystemTable \
225 224 ) \
226 225 { \
227 226 return InitFunction(ImageHandle, SystemTable); \
228 227 }
229 228
230 229
231 230 #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
232 231 (_if)->LoadInternal(type, name, NULL)
233 232
234 233 #else // EFI_NT_EMULATOR
235 234
236 235 //
237 236 // When building similar to FW, link everything together as
|
↓ open down ↓ |
145 lines elided |
↑ open up ↑ |
238 237 // one big module.
239 238 //
240 239
241 240 #define EFI_DRIVER_ENTRY_POINT(InitFunction)
242 241
243 242 #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
244 243 (_if)->LoadInternal(type, name, entry)
245 244
246 245 #endif // EFI_FW_NT
247 246
248 -#ifdef __FreeBSD__
249 247 #define INTERFACE_DECL(x) struct x
250 -#else
248 +#if 0
251 249 //
252 250 // Some compilers don't support the forward reference construct:
253 251 // typedef struct XXXXX
254 252 //
255 253 // The following macro provide a workaround for such cases.
256 254 //
257 255 #ifdef NO_INTERFACE_DECL
258 256 #define INTERFACE_DECL(x)
259 257 #else
260 258 #define INTERFACE_DECL(x) typedef struct x
261 259 #endif
262 260 #endif /* __FreeBSD__ */
263 261
264 262 #ifdef _MSC_EXTENSIONS
265 263 #pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP
266 264 #endif
267 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX