Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Aug 2017 18:29:38 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322931 - in head/sys/boot/efi: boot1 include loader
Message-ID:  <201708261829.v7QITcjP099439@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Aug 26 18:29:37 2017
New Revision: 322931
URL: https://svnweb.freebsd.org/changeset/base/322931

Log:
  Cleanup efi_main return type
  
  Make the return type of efi_main uniform. Declare the Exit() function
  as not returning. Move efi_main's declaration to the proper header.
  
  Sponsored by: Netflix

Modified:
  head/sys/boot/efi/boot1/boot1.c
  head/sys/boot/efi/include/efiapi.h
  head/sys/boot/efi/include/efilib.h
  head/sys/boot/efi/loader/efi_main.c

Modified: head/sys/boot/efi/boot1/boot1.c
==============================================================================
--- head/sys/boot/efi/boot1/boot1.c	Sat Aug 26 18:29:24 2017	(r322930)
+++ head/sys/boot/efi/boot1/boot1.c	Sat Aug 26 18:29:37 2017	(r322931)
@@ -47,8 +47,6 @@ static const boot_module_t *boot_modules[] =
 /* The initial number of handles used to query EFI for partitions. */
 #define NUM_HANDLES_INIT	24
 
-EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab);
-
 EFI_SYSTEM_TABLE *systab;
 EFI_BOOT_SERVICES *bs;
 static EFI_HANDLE *image;

Modified: head/sys/boot/efi/include/efiapi.h
==============================================================================
--- head/sys/boot/efi/include/efiapi.h	Sat Aug 26 18:29:24 2017	(r322930)
+++ head/sys/boot/efi/include/efiapi.h	Sat Aug 26 18:29:37 2017	(r322931)
@@ -353,7 +353,7 @@ EFI_STATUS
     IN EFI_STATUS                   ExitStatus,
     IN UINTN                        ExitDataSize,
     IN CHAR16                       *ExitData OPTIONAL
-    );
+    ) __dead2;
 
 typedef
 EFI_STATUS

Modified: head/sys/boot/efi/include/efilib.h
==============================================================================
--- head/sys/boot/efi/include/efilib.h	Sat Aug 26 18:29:24 2017	(r322930)
+++ head/sys/boot/efi/include/efilib.h	Sat Aug 26 18:29:37 2017	(r322931)
@@ -89,8 +89,10 @@ EFI_STATUS errno_to_efi_status(int errno);
 void efi_time_init(void);
 void efi_time_fini(void);
 
+EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab);
+
 EFI_STATUS main(int argc, CHAR16 *argv[]);
-void exit(EFI_STATUS status);
+void exit(EFI_STATUS status) __dead2;
 void delay(int usecs);
 
 /* EFI environment initialization. */

Modified: head/sys/boot/efi/loader/efi_main.c
==============================================================================
--- head/sys/boot/efi/loader/efi_main.c	Sat Aug 26 18:29:24 2017	(r322930)
+++ head/sys/boot/efi/loader/efi_main.c	Sat Aug 26 18:29:37 2017	(r322931)
@@ -66,9 +66,7 @@ arg_skipword(CHAR16 *argp)
 	return (argp);
 }
 
-void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table);
-
-void
+EFI_STATUS
 efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
 {
 	static EFI_GUID image_protocol = LOADED_IMAGE_PROTOCOL;
@@ -184,4 +182,5 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy
 
 	status = main(argc, argv);
 	exit(status);
+	return (status);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708261829.v7QITcjP099439>