Commit Graph

13 Commits

Author SHA1 Message Date
Steven Hartland
b2ec7c304e Modularise EFI boot loader
Make EFI boot loader modular in preparation for adding ZFS support.

This is a partial commit of the D4515.

Submitted by:	Eric McCorkle
Reviewed by:	emaste (in part)
MFC after:	2 weeks
X-MFC-With:	r293268
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D4515
2016-01-15 01:22:36 +00:00
Steven Hartland
022e692a47 Enable warnings in EFI boot code
Set WARNS if not set for EFI boot code and fix the issues highlighted by
setting it.

Most components are set to WARNS level 6 with few being left at lower
levels due to the amount of changes needed to fix at higher levels.

Error types fixed:
* Missing / invalid casts
* Missing inner structs
* Unused vars
* Missing static for internal only funcs
* Missing prototypes
* Alignment changes
* Use of uninitialised vars
* Unknown pragma (intrinsic)
* Missing types etc due to missing includes
* printf formatting types

Reviewed by:	emaste (in part)
MFC after:	2 weeks
X-MFC-With:	r293268
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D4839
2016-01-12 02:17:39 +00:00
Steven Hartland
1b1632a243 Remove hidden "Not ufs" printfs from boot code
Remove the printf("Not ufs\n") from the boot code which was hidden by the
local printf implementations, allowing these to have that code removed too.

MFC after:	2 weeks
X-MFC-With:	r293268
Sponsored by:	Multiplay
2016-01-09 03:30:33 +00:00
Steven Hartland
77e4457b19 Switch EFT boot1 to use libstand
ARM and i386 already required libstand so switch to using it for all
patforms, allowing the removal of custom print and memory methods.

This is also a pre-cursor to enabling WARNS which highlighted a number
of issues with the removed methods.

MFC after:	2 weeks
X-MFC-With:	r293268
Sponsored by:	Multiplay
2016-01-09 03:20:01 +00:00
Steven Hartland
5fc656f187 style(9) fixes for EFI boot
Fix some style(9) nits for EFI boot code, no functional changes.

MFC after:	2 weeks
X-MFC-With:	r293268
Sponsored by:	Multiplay
2016-01-06 20:48:29 +00:00
Ed Maste
c82e181b74 Introduce and use new EFI_ERROR_CODE macro for EFI errors
Submitted by:	smh
MFC after:	1 week
2016-01-06 19:15:16 +00:00
Ed Maste
d3525a9e36 boot1.efi: show EFI error number, not full status value
EFI return values set the high bit to indicate an error. The log
messages changed here are printed only in the case of an error,
so including the error bit is redundant. Also switch to decimal to
match the error definitions (in sys/boot/efi/include/efierr.h).

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-12-21 22:42:03 +00:00
Andrew Turner
23c48d2315 Print error values with hex to make it easier to find the EFI error type. 2015-04-09 10:15:47 +00:00
Andrew Turner
533e5098de Make global variabled only used in this file static. 2015-04-06 19:58:28 +00:00
Rui Paulo
c293bc993b Remove an unnecessary space in a printf call. 2015-04-04 04:29:31 +00:00
Rui Paulo
11d48637a1 boot1 EFI: reset the screen and select the best mode.
It's necessary to reset the screen to make sure any vendor pixels are
gone when we start boot1.  In the Lenovo X1 (3rd gen), this is the
only way to clear the screen.  Previously, the Lenovo logo would only
disappear after the kernel started scrolling the display.

After resetting the screen, EFI could put us in the worst LCD mode
(oversized characters), so we now find the largest mode we can use and
hope it's the most appropriate one (it's not trivial to tell what's
the correct LCD resolution at this point).  It's worth noting that the
final stage loader has a 'mode' command that can be used to switch
text modes.

While there, enable the software cursor, just like in the legacy boot
mode.

MFC after:	1 week
2015-04-04 04:27:54 +00:00
Rui Paulo
92de577931 Remove whitespace. 2015-04-04 04:18:52 +00:00
Andrew Turner
9e62ed8ff9 Move the efi loaders to be under sys/boot/efi. This will help us add
support for booting arm and arm64 from UEFI.

Differential Revision:	https://reviews.freebsd.org/D2164
Reviewed by:	emaste, imp (previous version)
Sponsored by:	The FreeBSD Foundation
2015-04-01 08:30:40 +00:00