Module Name: src
Committed By: skrll
Date: Mon Apr 1 16:24:01 UTC 2024
Modified Files:
src/sys/arch/riscv/riscv: trap.c
Log Message:
Return the correct error from {fetch,store}_user_data and fix
futex_wake_op_op: [0.273033s] Failed:
/usr/src/tests/lib/libc/sys/t_futex_ops.c:942: Expected errno 14, got 1, in
__futex(&futex_word, FUTEX_WAKE_OP | flags, 0, NULL, NULL, 0, op) == -1
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/riscv/riscv/trap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/riscv/riscv/trap.c
diff -u src/sys/arch/riscv/riscv/trap.c:1.24 src/sys/arch/riscv/riscv/trap.c:1.25
--- src/sys/arch/riscv/riscv/trap.c:1.24 Thu Sep 7 12:48:49 2023
+++ src/sys/arch/riscv/riscv/trap.c Mon Apr 1 16:24:01 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.24 2023/09/07 12:48:49 skrll Exp $ */
+/* $NetBSD: trap.c,v 1.25 2024/04/01 16:24:01 skrll Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#define __PMAP_PRIVATE
#define __UFETCHSTORE_PRIVATE
-__RCSID("$NetBSD: trap.c,v 1.24 2023/09/07 12:48:49 skrll Exp $");
+__RCSID("$NetBSD: trap.c,v 1.25 2024/04/01 16:24:01 skrll Exp $");
#include <sys/param.h>
@@ -672,7 +672,7 @@ fetch_user_data(const void *uaddr, void
if (__predict_false(uva > VM_MAXUSER_ADDRESS - size))
return EFAULT;
- if ((error = cpu_set_onfault(&fb, 1)) != 0)
+ if ((error = cpu_set_onfault(&fb, EFAULT)) != 0)
return error;
csr_sstatus_set(SR_SUM);
@@ -737,7 +737,7 @@ store_user_data(void *uaddr, const void
if (__predict_false(uva > VM_MAXUSER_ADDRESS - size))
return EFAULT;
- if ((error = cpu_set_onfault(&fb, 1)) != 0)
+ if ((error = cpu_set_onfault(&fb, EFAULT)) != 0)
return error;
csr_sstatus_set(SR_SUM);