summaryrefslogtreecommitdiff
path: root/sys/arch/armv7
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2019-07-29 22:33:27 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2019-07-29 22:33:27 +0000
commitf9e1a90d048719cdb2087fa8a4dd79f85c55a9f4 (patch)
treeddf66053befba18d64b2237e3190d04dd80a12b6 /sys/arch/armv7
parent2d55442798f590cac84ebdab8d90639f49ca7c9f (diff)
Support disk write in efiboot for armv7 and arm64.
ok patrick deraadt
Diffstat (limited to 'sys/arch/armv7')
-rw-r--r--sys/arch/armv7/stand/efiboot/efidev.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/arch/armv7/stand/efiboot/efidev.c b/sys/arch/armv7/stand/efiboot/efidev.c
index 9a76b9b152d..8591ac2602c 100644
--- a/sys/arch/armv7/stand/efiboot/efidev.c
+++ b/sys/arch/armv7/stand/efiboot/efidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efidev.c,v 1.2 2016/05/20 11:53:19 kettenis Exp $ */
+/* $OpenBSD: efidev.c,v 1.3 2019/07/29 22:33:26 yasuoka Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -82,8 +82,14 @@ efid_io(int rw, efi_diskinfo_t ed, u_int off, int nsect, void *buf)
case F_WRITE:
if (ed->blkio->Media->ReadOnly)
goto on_eio;
- /* XXX not yet */
- goto on_eio;
+ if (ed->blkio->Media->ReadOnly)
+ goto on_eio;
+ memcpy(data, buf, nsect * DEV_BSIZE);
+ status = EFI_CALL(ed->blkio->WriteBlocks,
+ ed->blkio, ed->mediaid, off,
+ nsect * DEV_BSIZE, data);
+ if (EFI_ERROR(status))
+ goto on_eio;
break;
}
return (EFI_SUCCESS);