From 86caa28e078eb0a6bc2340209cd07ce71359d78c Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Sun, 24 Mar 2019 13:01:30 +0100
Subject: [PATCH 1/3] Use true/false in sys/boot/efi.

---
 sys/boot/efi/boot1/boot1.c        | 33 ++++++++++++++++---------------
 sys/boot/efi/libefi/efi_console.c |  4 +++-
 sys/boot/efi/libefi/efinet.c      |  3 ++-
 3 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/sys/boot/efi/boot1/boot1.c b/sys/boot/efi/boot1/boot1.c
index f078d3b40b..1c2c043679 100644
--- a/sys/boot/efi/boot1/boot1.c
+++ b/sys/boot/efi/boot1/boot1.c
@@ -26,6 +26,7 @@
 #include <machine/stdarg.h>
 #include <stand.h>
 #include <stdarg.h>
+#include <stdbool.h>
 
 #include <efi.h>
 #include <eficonsctl.h>
@@ -91,8 +92,8 @@ Free(void *buf, const char *file __unused, int line __unused)
 #endif
 
 /*
- * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match,
- * FALSE otherwise.
+ * nodes_match returns true if the imgpath isn't NULL and the nodes match,
+ * false otherwise.
  */
 static BOOLEAN
 nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath)
@@ -101,40 +102,40 @@ nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath)
 
 	if (imgpath == NULL || imgpath->Type != devpath->Type ||
 	    imgpath->SubType != devpath->SubType)
-		return (FALSE);
+		return (false);
 
 	len = DevicePathNodeLength(imgpath);
 	if (len != DevicePathNodeLength(devpath))
-		return (FALSE);
+		return (false);
 
 	return (memcmp(imgpath, devpath, (size_t)len) == 0);
 }
 
 /*
- * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes
+ * device_paths_match returns true if the imgpath isn't NULL and all nodes
  * in imgpath and devpath match up to their respect occurances of a media
- * node, FALSE otherwise.
+ * node, false otherwise.
  */
 static BOOLEAN
 device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath)
 {
 
 	if (imgpath == NULL)
-		return (FALSE);
+		return (false);
 
 	while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) {
 		if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) &&
 		    IsDevicePathType(devpath, MEDIA_DEVICE_PATH))
-			return (TRUE);
+			return (true);
 
 		if (!nodes_match(imgpath, devpath))
-			return (FALSE);
+			return (false);
 
 		imgpath = NextDevicePathNode(imgpath);
 		devpath = NextDevicePathNode(devpath);
 	}
 
-	return (FALSE);
+	return (false);
 }
 
 /*
@@ -380,10 +381,10 @@ try_boot(void)
 	EFI_LOADED_IMAGE *loaded_image;
 	EFI_STATUS status;
 
-	status = load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE);
+	status = load_loader(&mod, &dev, &loaderbuf, &loadersize, true);
 	if (status != EFI_SUCCESS) {
 		status = load_loader(&mod, &dev, &loaderbuf, &loadersize,
-		    FALSE);
+		    false);
 		if (status != EFI_SUCCESS) {
 			printf("Failed to load '%s' or '%s'\n",
 			    PATH_LOADER, PATH_LOADER_ALT);
@@ -417,7 +418,7 @@ try_boot(void)
 		buf = NULL;
 	}
 
-	if ((status = bs->LoadImage(TRUE, image, devpath_last(dev->devpath),
+	if ((status = bs->LoadImage(true, image, devpath_last(dev->devpath),
 	    loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) {
 		printf("Failed to load image provided by %s, size: %zu, (%llu)\n",
 		     mod->name, loadersize, status);
@@ -549,7 +550,7 @@ probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath)
 	EFI_STATUS status;
 	BOOLEAN preferred;
 
-	preferred = FALSE;
+	preferred = false;
 	status = probe_handle(h, imgpath, &preferred);
 
 	DPRINTF("probe: ");
@@ -601,7 +602,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
 	 * Reset the console and find the best text mode.
 	 */
 	conout = systab->ConOut;
-	conout->Reset(conout, TRUE);
+	conout->Reset(conout, true);
 	max_dim = best_mode = 0;
 	for (i = 0; ; i++) {
 		status = conout->QueryMode(conout, i, &cols, &rows);
@@ -619,7 +620,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
 	}
 	if (max_dim > 0)
 		conout->SetMode(conout, best_mode);
-	conout->EnableCursor(conout, TRUE);
+	conout->EnableCursor(conout, true);
 	conout->ClearScreen(conout);
 
 	printf("\n>> DragonFly EFI boot block\n");
diff --git a/sys/boot/efi/libefi/efi_console.c b/sys/boot/efi/libefi/efi_console.c
index 29a3bc3745..b67385449c 100644
--- a/sys/boot/efi/libefi/efi_console.c
+++ b/sys/boot/efi/libefi/efi_console.c
@@ -27,6 +27,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: head/sys/boot/efi/libefi/efi_console.c 293724 2016-01-12 02:17:39Z smh $");
 
+#include <stdbool.h>
+
 #include <efi.h>
 #include <efilib.h>
 
@@ -120,7 +122,7 @@ efi_cons_init(int arg)
 	fg_c = DEFAULT_FGCOLOR;
 	bg_c = DEFAULT_BGCOLOR;
 #endif
-	conout->EnableCursor(conout, TRUE);
+	conout->EnableCursor(conout, true);
 	return 0;
 }
 
diff --git a/sys/boot/efi/libefi/efinet.c b/sys/boot/efi/libefi/efinet.c
index 62b1fd80a4..0b6d666769 100644
--- a/sys/boot/efi/libefi/efinet.c
+++ b/sys/boot/efi/libefi/efinet.c
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD: head/sys/boot/efi/libefi/efinet.c 295210 2016-02-03 14:34:25
 
 #include <stand.h>
 #include <stdarg.h>
+#include <stdbool.h>
 #include <net.h>
 #include <netif.h>
 
@@ -221,7 +222,7 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
 		UINT32 mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
 		    EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
 
-		status = net->ReceiveFilters(net, mask, 0, FALSE, 0, 0);
+		status = net->ReceiveFilters(net, mask, 0, false, 0, 0);
 		if (status != EFI_SUCCESS) {
 			printf("net%d: cannot set rx. filters (status=%llu)\n",
 			    nif->nif_unit, status);
-- 
2.21.0

