summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/efi/libefi/efifs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/boot/efi/libefi/efifs.c b/sys/boot/efi/libefi/efifs.c
index d42bc71..ce76e70 100644
--- a/sys/boot/efi/libefi/efifs.c
+++ b/sys/boot/efi/libefi/efifs.c
@@ -36,6 +36,9 @@
#include <efilib.h>
#include "efiboot.h"
+/* Perform I/O in blocks of size EFI_BLOCK_SIZE. */
+#define EFI_BLOCK_SIZE (1024 * 1024)
+
static int
efifs_open(const char *upath, struct open_file *f)
{
@@ -123,8 +126,8 @@ efifs_read(struct open_file *f, void *buf, size_t size, size_t *resid)
bufp = buf;
while (size > 0) {
sz = size;
- if (sz > 8192)
- sz = 8192;
+ if (sz > EFI_BLOCK_SIZE)
+ sz = EFI_BLOCK_SIZE;
status = file->Read(file, &sz, bufp);
twiddle();
if (EFI_ERROR(status))
@@ -150,8 +153,8 @@ efifs_write(struct open_file *f, void *buf, size_t size, size_t *resid)
bufp = buf;
while (size > 0) {
sz = size;
- if (sz > 8192)
- sz = 8192;
+ if (sz > EFI_BLOCK_SIZE)
+ sz = EFI_BLOCK_SIZE;
status = file->Write(file, &sz, bufp);
twiddle();
if (EFI_ERROR(status))
OpenPOWER on IntegriCloud