Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2014 18:54:41 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r269346 - projects/arm64/sys/boot/efi/libefi
Message-ID:  <201407311854.s6VIsfDC049108@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 



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