Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/riscv/include Use better types and struct member na...
details: https://anonhg.NetBSD.org/src/rev/25863fa15e94
branches: trunk
changeset: 372353:25863fa15e94
user: simonb <simonb%NetBSD.org@localhost>
date: Thu Nov 17 09:50:23 2022 +0000
description:
Use better types and struct member names in the clockframe.
Avoid a magic number in CLKF_USERMODE().
diffstat:
sys/arch/riscv/include/cpu.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (27 lines):
diff -r bc53b0ffb654 -r 25863fa15e94 sys/arch/riscv/include/cpu.h
--- a/sys/arch/riscv/include/cpu.h Thu Nov 17 08:45:35 2022 +0000
+++ b/sys/arch/riscv/include/cpu.h Thu Nov 17 09:50:23 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.8 2021/08/14 17:51:19 ryo Exp $ */
+/* $NetBSD: cpu.h,v 1.9 2022/11/17 09:50:23 simonb Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,13 +35,13 @@
#if defined(_KERNEL) || defined(_KMEMUSER)
struct clockframe {
- uintptr_t cf_pc;
- uint32_t cf_sr;
+ vaddr_t cf_epc;
+ register_t cf_status;
int cf_intr_depth;
};
-#define CLKF_USERMODE(cf) (((cf)->cf_sr & 1) == 0)
-#define CLKF_PC(cf) ((cf)->cf_pc)
+#define CLKF_USERMODE(cf) (((cf)->cf_status & SR_SPP) == 0)
+#define CLKF_PC(cf) ((cf)->cf_epc)
#define CLKF_INTR(cf) ((cf)->cf_intr_depth > 0)
#include <sys/cpu_data.h>
Home |
Main Index |
Thread Index |
Old Index