Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86 Move the sysctl function pointers used by acpic...
details: https://anonhg.NetBSD.org/src/rev/50657cbe6f76
branches: trunk
changeset: 756975:50657cbe6f76
user: jruoho <jruoho%NetBSD.org@localhost>
date: Mon Aug 09 04:18:48 2010 +0000
description:
Move the sysctl function pointers used by acpicpu(4) to x86/cpu.c.
Rename these so that the same pointers may be used in other parts.
diffstat:
sys/arch/x86/acpi/acpi_cpu_md.c | 32 ++++++++------------------------
sys/arch/x86/include/cpuvar.h | 8 ++++----
sys/arch/x86/x86/cpu.c | 8 ++++++--
sys/arch/x86/x86/est.c | 20 ++++++++------------
4 files changed, 26 insertions(+), 42 deletions(-)
diffs (170 lines):
diff -r 389ce3b4e165 -r 50657cbe6f76 sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c Sun Aug 08 20:04:54 2010 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c Mon Aug 09 04:18:48 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.5 2010/08/08 16:58:41 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.6 2010/08/09 04:18:48 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.5 2010/08/08 16:58:41 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.6 2010/08/09 04:18:48 jruoho Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -216,17 +216,9 @@
acpicpu_md_pstate_start(void)
{
- switch (cpu_vendor) {
-
- case CPUVENDOR_INTEL:
- est_sysctl_get = acpicpu_md_pstate_sysctl_get;
- est_sysctl_set = acpicpu_md_pstate_sysctl_set;
- est_sysctl_all = acpicpu_md_pstate_sysctl_all;
- break;
-
- default:
- return ENODEV;
- }
+ cpu_freq_sysctl_get = acpicpu_md_pstate_sysctl_get;
+ cpu_freq_sysctl_set = acpicpu_md_pstate_sysctl_set;
+ cpu_freq_sysctl_all = acpicpu_md_pstate_sysctl_all;
return 0;
}
@@ -235,17 +227,9 @@
acpicpu_md_pstate_stop(void)
{
- switch (cpu_vendor) {
-
- case CPUVENDOR_INTEL:
- est_sysctl_get = NULL;
- est_sysctl_set = NULL;
- est_sysctl_all = NULL;
- break;
-
- default:
- return ENODEV;
- }
+ cpu_freq_sysctl_get = NULL;
+ cpu_freq_sysctl_set = NULL;
+ cpu_freq_sysctl_all = NULL;
return 0;
}
diff -r 389ce3b4e165 -r 50657cbe6f76 sys/arch/x86/include/cpuvar.h
--- a/sys/arch/x86/include/cpuvar.h Sun Aug 08 20:04:54 2010 +0000
+++ b/sys/arch/x86/include/cpuvar.h Mon Aug 09 04:18:48 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuvar.h,v 1.35 2010/08/08 16:58:42 jruoho Exp $ */
+/* $NetBSD: cpuvar.h,v 1.36 2010/08/09 04:18:48 jruoho Exp $ */
/*-
* Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -142,9 +142,9 @@
int p4_get_bus_clock(struct cpu_info *);
#endif
-extern int (*est_sysctl_get)(SYSCTLFN_PROTO);
-extern int (*est_sysctl_set)(SYSCTLFN_PROTO);
-extern int (*est_sysctl_all)(SYSCTLFN_PROTO);
+extern int (*cpu_freq_sysctl_get)(SYSCTLFN_PROTO);
+extern int (*cpu_freq_sysctl_set)(SYSCTLFN_PROTO);
+extern int (*cpu_freq_sysctl_all)(SYSCTLFN_PROTO);
void cpu_get_tsc_freq(struct cpu_info *);
void pat_init(struct cpu_info *);
diff -r 389ce3b4e165 -r 50657cbe6f76 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c Sun Aug 08 20:04:54 2010 +0000
+++ b/sys/arch/x86/x86/cpu.c Mon Aug 09 04:18:48 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.74 2010/08/04 10:02:12 jruoho Exp $ */
+/* $NetBSD: cpu.c,v 1.75 2010/08/09 04:18:48 jruoho Exp $ */
/*-
* Copyright (c) 2000, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.74 2010/08/04 10:02:12 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.75 2010/08/09 04:18:48 jruoho Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -185,6 +185,10 @@
static vaddr_t cmos_data_mapping;
struct cpu_info *cpu_starting;
+int (*cpu_freq_sysctl_get)(SYSCTLFN_PROTO) = NULL;
+int (*cpu_freq_sysctl_set)(SYSCTLFN_PROTO) = NULL;
+int (*cpu_freq_sysctl_all)(SYSCTLFN_PROTO) = NULL;
+
void cpu_hatch(void *);
static void cpu_boot_secondary(struct cpu_info *ci);
static void cpu_start_secondary(struct cpu_info *ci);
diff -r 389ce3b4e165 -r 50657cbe6f76 sys/arch/x86/x86/est.c
--- a/sys/arch/x86/x86/est.c Sun Aug 08 20:04:54 2010 +0000
+++ b/sys/arch/x86/x86/est.c Mon Aug 09 04:18:48 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: est.c,v 1.16 2010/08/08 16:58:42 jruoho Exp $ */
+/* $NetBSD: est.c,v 1.17 2010/08/09 04:18:49 jruoho Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -81,7 +81,7 @@
/* #define EST_DEBUG */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.16 2010/08/08 16:58:42 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.17 2010/08/09 04:18:49 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1012,16 +1012,12 @@
static int est_sysctl_helper_set(SYSCTLFN_PROTO);
static int est_sysctl_helper_all(SYSCTLFN_PROTO);
-int (*est_sysctl_get)(SYSCTLFN_PROTO) = NULL;
-int (*est_sysctl_set)(SYSCTLFN_PROTO) = NULL;
-int (*est_sysctl_all)(SYSCTLFN_PROTO) = NULL;
-
static int
est_sysctl_helper_get(SYSCTLFN_ARGS)
{
- if (est_sysctl_get != NULL)
- return (*est_sysctl_get)(SYSCTLFN_CALL(rnode));
+ if (cpu_freq_sysctl_get != NULL)
+ return (*cpu_freq_sysctl_get)(SYSCTLFN_CALL(rnode));
return est_sysctl_helper(SYSCTLFN_CALL(rnode));
}
@@ -1030,8 +1026,8 @@
est_sysctl_helper_set(SYSCTLFN_ARGS)
{
- if (est_sysctl_set != NULL)
- return (*est_sysctl_set)(SYSCTLFN_CALL(rnode));
+ if (cpu_freq_sysctl_set != NULL)
+ return (*cpu_freq_sysctl_set)(SYSCTLFN_CALL(rnode));
return est_sysctl_helper(SYSCTLFN_CALL(rnode));
}
@@ -1042,8 +1038,8 @@
struct sysctlnode node;
int err;
- if (est_sysctl_all != NULL)
- return (*est_sysctl_all)(SYSCTLFN_CALL(rnode));
+ if (cpu_freq_sysctl_all != NULL)
+ return (*cpu_freq_sysctl_all)(SYSCTLFN_CALL(rnode));
if (freq_names == NULL)
return ENXIO;
Home |
Main Index |
Thread Index |
Old Index