From 94e482dfeca0773e4607e9f80e4d8c32d74d9a25 Mon Sep 17 00:00:00 2001 From: dlg Date: Thu, 16 Nov 2023 02:45:20 +0000 Subject: [PATCH] cpu frequency and volt types for kstat_kvs --- sys/sys/kstat.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/sys/kstat.h b/sys/sys/kstat.h index 9e8baba9c88..1a94e8d9d82 100644 --- a/sys/sys/kstat.h +++ b/sys/sys/kstat.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kstat.h,v 1.3 2022/04/22 00:27:55 dlg Exp $ */ +/* $OpenBSD: kstat.h,v 1.4 2023/11/16 02:45:20 dlg Exp $ */ /* * Copyright (c) 2020 David Gwynne @@ -82,6 +82,9 @@ enum kstat_kv_type { KSTAT_KV_T_COUNTER16, KSTAT_KV_T_UINT16, KSTAT_KV_T_INT16, + KSTAT_KV_T_FREQ, /* frequency (Hz) */ + KSTAT_KV_T_VOLTS_DC, /* voltage (uV DC) */ + KSTAT_KV_T_VOLTS_AC, /* voltage (uV AC) */ }; /* units only apply to integer types */ @@ -119,6 +122,8 @@ struct kstat_kv { #define kstat_kv_s16(_kv) (_kv)->kv_v.v_s16 #define kstat_kv_len(_kv) (_kv)->kv_v.v_len #define kstat_kv_temp(_kv) (_kv)->kv_v.v_u64 +#define kstat_kv_freq(_kv) (_kv)->kv_v.v_u64 +#define kstat_kv_volts(_kv) (_kv)->kv_v.v_u64 #ifdef _KERNEL -- 2.20.1