summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-02-26 09:13:05 +0000
committermarcel <marcel@FreeBSD.org>2003-02-26 09:13:05 +0000
commit73e39b57bc1a7cdd564155102785ee690ad9583d (patch)
tree8f0c3b5e43a21b2308c1e8c38b1188e4e7a59067 /sys/boot
parent212ceca6b87c1370ebabda4d27d996e13c23a528 (diff)
downloadFreeBSD-src-73e39b57bc1a7cdd564155102785ee690ad9583d.zip
FreeBSD-src-73e39b57bc1a7cdd564155102785ee690ad9583d.tar.gz
Increase the block size for reading and writing from 8KB to 1MB and
introduce a preprocessor define for it. The larger block size significantly speeds up the loading of the kernel. Submitted by: Arun Sharma <arun.sharma@intel.com>
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