From: kn Date: Mon, 16 Jan 2023 21:30:46 +0000 (+0000) Subject: Sync with original arm64 copy to get RAID 1C bits, fix include guard X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3ea821904929b51670b9229cfa61d557f677201f;p=openbsd Sync with original arm64 copy to get RAID 1C bits, fix include guard OK kettenis --- diff --git a/sys/arch/riscv64/stand/efiboot/softraid_riscv64.c b/sys/arch/riscv64/stand/efiboot/softraid_riscv64.c index d7691e0c7da..9b4bad3cee2 100644 --- a/sys/arch/riscv64/stand/efiboot/softraid_riscv64.c +++ b/sys/arch/riscv64/stand/efiboot/softraid_riscv64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_riscv64.c,v 1.2 2021/06/02 22:44:27 krw Exp $ */ +/* $OpenBSD: softraid_riscv64.c,v 1.3 2023/01/16 21:30:46 kn Exp $ */ /* * Copyright (c) 2012 Joel Sing @@ -285,6 +285,7 @@ srprobe(void) break; case 1: + case 0x1C: if (bv->sbv_chunk_no == bv->sbv_chunks_found) bv->sbv_state = BIOC_SVONLINE; else if (bv->sbv_chunks_found > 0) @@ -341,7 +342,7 @@ sr_strategy(struct sr_boot_volume *bv, int rw, daddr_t blk, size_t size, /* XXX - If I/O failed we should try another chunk... */ return dip->strategy(dip, rw, blk, size, buf, rsize); - } else if (bv->sbv_level == 'C') { + } else if (bv->sbv_level == 'C' || bv->sbv_level == 0x1C) { /* Select first online chunk. */ SLIST_FOREACH(bc, &bv->sbv_chunks, sbc_link) @@ -604,7 +605,8 @@ sropen(struct open_file *f, ...) return EADAPT; } - if (bv->sbv_level == 'C' && bv->sbv_keys == NULL) + if ((bv->sbv_level == 'C' || bv->sbv_level == 0x1C) + && bv->sbv_keys == NULL) if (sr_crypto_unlock_volume(bv) != 0) return EPERM; diff --git a/sys/arch/riscv64/stand/efiboot/softraid_riscv64.h b/sys/arch/riscv64/stand/efiboot/softraid_riscv64.h index db0c5227d99..5826efbc582 100644 --- a/sys/arch/riscv64/stand/efiboot/softraid_riscv64.h +++ b/sys/arch/riscv64/stand/efiboot/softraid_riscv64.h @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_riscv64.h,v 1.1 2021/04/28 19:01:00 drahn Exp $ */ +/* $OpenBSD: softraid_riscv64.h,v 1.2 2023/01/16 21:30:46 kn Exp $ */ /* * Copyright (c) 2012 Joel Sing @@ -16,8 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SOFTRAID_ARM64_H_ -#define _SOFTRAID_ARM64_H_ +#ifndef _SOFTRAID_RISCV64_H_ +#define _SOFTRAID_RISCV64_H_ void srprobe(void); @@ -30,4 +30,4 @@ int srdiskio(int, struct diskinfo *, u_int, int, void *); int srclose(struct open_file *); int srioctl(struct open_file *, u_long, void *); -#endif /* _SOFTRAID_ARM64_H */ +#endif /* _SOFTRAID_RISCV64_H */