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>
This commit is contained in:
parent
96dfe788ad
commit
21c598caae
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111543
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user