svn commit: r269346 - projects/arm64/sys/boot/efi/libefi

Andrew Turner andrew at FreeBSD.org
Thu Jul 31 18:54:41 UTC 2014


Author: andrew
Date: Thu Jul 31 18:54:40 2014
New Revision: 269346
URL: http://svnweb.freebsd.org/changeset/base/269346

Log:
  Work around a bug with the Semihosting FS driver where it returns
  EFI_ABORTED there is no data to read.

Modified:
  projects/arm64/sys/boot/efi/libefi/efisimplefs.c

Modified: projects/arm64/sys/boot/efi/libefi/efisimplefs.c
==============================================================================
--- projects/arm64/sys/boot/efi/libefi/efisimplefs.c	Thu Jul 31 18:02:38 2014	(r269345)
+++ projects/arm64/sys/boot/efi/libefi/efisimplefs.c	Thu Jul 31 18:54:40 2014	(r269346)
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
 #include <efilib.h>
 #include <efiprot.h>
 
+#define	SEMIHOSTING_HACKS
+
 static EFI_GUID sfs_guid = SIMPLE_FILE_SYSTEM_PROTOCOL;
 static EFI_GUID file_info_guid = EFI_FILE_INFO_ID;
 
@@ -145,6 +147,16 @@ efifs_read(struct open_file *f, void *bu
 
 	read_size = size;
 	status = file->Read(file, &read_size, buf);
+#ifdef SEMIHOSTING_HACKS
+	if (status == EFI_ABORTED) {
+		/*
+		 * Semihosting incorrectly returns EFI_ABORTED on EOF
+		 * with nothing to read.
+		 */
+		*resid = size;
+		return (0);
+	}
+#endif
 	if (EFI_ERROR(status))
 		return (efi_status_to_errno(status));
 


More information about the svn-src-projects mailing list