diff options
author | Dimitry Andric <dim@cvs.openbsd.org> | 2006-12-12 23:14:29 +0000 |
---|---|---|
committer | Dimitry Andric <dim@cvs.openbsd.org> | 2006-12-12 23:14:29 +0000 |
commit | 1c2fd965cf1531278e01bc91beaa67624286988c (patch) | |
tree | d401479d5ccf18380f5057cd0a4b6e8135bdb23b /sys/arch/i386 | |
parent | cd866cbd96c21d51b3fa4c3d76d66a7e899f7b80 (diff) |
Complete gwk's previous patch to stop setperf methods from returning
errors to userland: make all cpu_setperf functions return void.
Tested by many, ok gwk@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/est.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/longrun.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/p4tcc.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/powernow-k7.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/i386/powernow-k8.c | 20 | ||||
-rw-r--r-- | sys/arch/i386/i386/powernow.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 14 | ||||
-rw-r--r-- | sys/arch/i386/pci/elan520.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/pci/gscpm.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/pci/ichpcib.c | 10 |
10 files changed, 40 insertions, 58 deletions
diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c index 41d5330952b..46c40d5fc6d 100644 --- a/sys/arch/i386/i386/est.c +++ b/sys/arch/i386/i386/est.c @@ -1,4 +1,4 @@ -/* $OpenBSD: est.c,v 1.23 2006/11/28 19:58:27 dim Exp $ */ +/* $OpenBSD: est.c,v 1.24 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2003 Michael Eriksson. * All rights reserved. @@ -1063,14 +1063,14 @@ est_init(const char *cpu_device, int vendor) setperf_prio = 3; } -int +void est_setperf(int level) { int low, high, i, fq; uint64_t msr; if (est_fqlist == NULL) - return (EOPNOTSUPP); + return; low = MSR2MHZ(est_fqlist->table[est_fqlist->n - 1], bus_clock); high = MSR2MHZ(est_fqlist->table[0], bus_clock); @@ -1084,6 +1084,4 @@ est_setperf(int level) msr |= est_fqlist->table[i]; wrmsr(MSR_PERF_CTL, msr); pentium_mhz = MSR2MHZ(est_fqlist->table[i], bus_clock); - - return (0); } diff --git a/sys/arch/i386/i386/longrun.c b/sys/arch/i386/i386/longrun.c index 98de11c8d2b..357b8c84ca8 100644 --- a/sys/arch/i386/i386/longrun.c +++ b/sys/arch/i386/i386/longrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: longrun.c,v 1.10 2005/11/10 13:01:46 dlg Exp $ */ +/* $OpenBSD: longrun.c,v 1.11 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2003 Ted Unangst * Copyright (c) 2001 Tamotsu Hattori @@ -95,7 +95,7 @@ longrun_update(void *arg) * limits it handles. Typically, there are about 5 performance * levels selectable. */ -int +void longrun_setperf(int high) { uint32_t eflags, mode; @@ -122,7 +122,5 @@ longrun_setperf(int high) write_eflags(eflags); longrun_update(NULL); - - return (0); } diff --git a/sys/arch/i386/i386/p4tcc.c b/sys/arch/i386/i386/p4tcc.c index 7680ac3d060..4bd7d55930f 100644 --- a/sys/arch/i386/i386/p4tcc.c +++ b/sys/arch/i386/i386/p4tcc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p4tcc.c,v 1.11 2006/08/20 01:42:51 gwk Exp $ */ +/* $OpenBSD: p4tcc.c,v 1.12 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2003 Ted Unangst * All rights reserved. @@ -107,7 +107,7 @@ p4tcc_cpuspeed(int *speed) return 0; } -int +void p4tcc_setperf(int level) { int i; @@ -129,6 +129,4 @@ p4tcc_setperf(int level) printf("p4_tcc: cpu did not honor request\n"); else p4tcc_level = tcc[i].level; - - return (0); } diff --git a/sys/arch/i386/i386/powernow-k7.c b/sys/arch/i386/i386/powernow-k7.c index 362728f07bf..aae5da30910 100644 --- a/sys/arch/i386/i386/powernow-k7.c +++ b/sys/arch/i386/i386/powernow-k7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k7.c,v 1.28 2006/10/19 19:29:04 tom Exp $ */ +/* $OpenBSD: powernow-k7.c,v 1.29 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2004 Martin Végiard. @@ -136,7 +136,7 @@ int k7pnow_decode_pst(struct k7pnow_cpu_state *, uint8_t *, int); int k7pnow_states(struct k7pnow_cpu_state *, uint32_t, unsigned int, unsigned int); -int +void k7_powernow_setperf(int level) { unsigned int i, low, high, freq; @@ -158,7 +158,7 @@ k7_powernow_setperf(int level) } if (fid == 0 || vid == 0) - return (0); + return; status = rdmsr(MSR_AMDK7_FIDVID_STATUS); cfid = PN7_STA_CFID(status); @@ -168,7 +168,7 @@ k7_powernow_setperf(int level) * We're already at the requested level. */ if (fid == cfid && vid == cvid) - return (0); + return; ctl = rdmsr(MSR_AMDK7_FIDVID_CTL) & PN7_CTR_FIDCHRATIO; @@ -197,8 +197,6 @@ k7_powernow_setperf(int level) cvid = PN7_STA_CVID(status); if (cfid == fid || cvid == vid) pentium_mhz = cstate->state_table[i].freq; - - return (0); } /* diff --git a/sys/arch/i386/i386/powernow-k8.c b/sys/arch/i386/i386/powernow-k8.c index 71082ef1398..738e1eb96b8 100644 --- a/sys/arch/i386/i386/powernow-k8.c +++ b/sys/arch/i386/i386/powernow-k8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k8.c,v 1.19 2006/12/09 00:16:46 gwk Exp $ */ +/* $OpenBSD: powernow-k8.c,v 1.20 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2004 Martin Végiard. @@ -155,7 +155,7 @@ k8pnow_read_pending_wait(uint64_t *status) return 1; } -int +void k8_powernow_setperf(int level) { unsigned int i, low, high, freq; @@ -170,7 +170,7 @@ k8_powernow_setperf(int level) */ status = rdmsr(MSR_AMDK7_FIDVID_STATUS); if (PN8_STA_PENDING(status)) - return 0; + return; cfid = PN8_STA_CFID(status); cvid = PN8_STA_CVID(status); @@ -189,7 +189,7 @@ k8_powernow_setperf(int level) } if (fid == cfid && vid == cvid) - return (0); + return; /* * Phase 1: Raise core voltage to requested VID if frequency is @@ -199,7 +199,7 @@ k8_powernow_setperf(int level) val = cvid - (1 << cstate->mvs); WRITE_FIDVID(cfid, (val > 0) ? val : 0, 1ULL); if (k8pnow_read_pending_wait(&status)) - return 0; + return; cvid = PN8_STA_CVID(status); COUNT_OFF_VST(cstate->vst); } @@ -211,7 +211,7 @@ k8_powernow_setperf(int level) * under Linux */ WRITE_FIDVID(cfid, cvid - 1, 1ULL); if (k8pnow_read_pending_wait(&status)) - return 0; + return; cvid = PN8_STA_CVID(status); COUNT_OFF_VST(cstate->vst); } @@ -235,7 +235,7 @@ k8_powernow_setperf(int level) PN8_PLL_LOCK(cstate->pll)); if (k8pnow_read_pending_wait(&status)) - return 0; + return; cfid = PN8_STA_CFID(status); COUNT_OFF_IRT(cstate->irt); @@ -244,7 +244,7 @@ k8_powernow_setperf(int level) WRITE_FIDVID(fid, cvid, (uint64_t) PN8_PLL_LOCK(cstate->pll)); if (k8pnow_read_pending_wait(&status)) - return 0; + return; cfid = PN8_STA_CFID(status); COUNT_OFF_IRT(cstate->irt); } @@ -253,15 +253,13 @@ k8_powernow_setperf(int level) if (cvid != vid) { WRITE_FIDVID(cfid, vid, 1ULL); if (k8pnow_read_pending_wait(&status)) - return 0; + return; cvid = PN8_STA_CVID(status); COUNT_OFF_VST(cstate->vst); } if (cfid == fid || cvid == vid) pentium_mhz = cstate->state_table[i].freq; - - return (0); } /* diff --git a/sys/arch/i386/i386/powernow.c b/sys/arch/i386/i386/powernow.c index be59568a943..85dc628d5dd 100644 --- a/sys/arch/i386/i386/powernow.c +++ b/sys/arch/i386/i386/powernow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow.c,v 1.2 2004/04/08 09:50:29 kevlo Exp $ */ +/* $OpenBSD: powernow.c,v 1.3 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2004 Ted Unangst * All rights reserved. @@ -80,7 +80,7 @@ k6_powernow_init(void) cpu_setperf = k6_powernow_setperf; } -int +void k6_powernow_setperf(int level) { uint64_t msrval; @@ -100,6 +100,4 @@ k6_powernow_setperf(int level) outl(K6PORT + 8, portval); /* off */ wrmsr(MSR_K6_EPMR, 0LL); - - return (0); } diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index a437cd29c6b..d6b43259c55 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.83 2006/11/29 20:03:20 dim Exp $ */ +/* $OpenBSD: cpu.h,v 1.84 2006/12/12 23:14:27 dim Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -358,33 +358,33 @@ void i8254_initclocks(void); /* est.c */ #if !defined(SMALL_KERNEL) && defined(I686_CPU) void est_init(const char *, int); -int est_setperf(int); +void est_setperf(int); #endif /* longrun.c */ #if !defined(SMALL_KERNEL) && defined(I586_CPU) void longrun_init(void); -int longrun_setperf(int); +void longrun_setperf(int); #endif /* p4tcc.c */ #if !defined(SMALL_KERNEL) && defined(I686_CPU) void p4tcc_init(int, int); -int p4tcc_setperf(int); +void p4tcc_setperf(int); #endif #if !defined(SMALL_KERNEL) && defined(I586_CPU) /* powernow.c */ void k6_powernow_init(void); -int k6_powernow_setperf(int); +void k6_powernow_setperf(int); #endif #if !defined(SMALL_KERNEL) && defined(I686_CPU) /* powernow-k7.c */ void k7_powernow_init(void); -int k7_powernow_setperf(int); +void k7_powernow_setperf(int); /* powernow-k8.c */ void k8_powernow_init(void); -int k8_powernow_setperf(int); +void k8_powernow_setperf(int); #endif /* npx.c */ diff --git a/sys/arch/i386/pci/elan520.c b/sys/arch/i386/pci/elan520.c index c13a8d8a7a9..a97345b3ab5 100644 --- a/sys/arch/i386/pci/elan520.c +++ b/sys/arch/i386/pci/elan520.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elan520.c,v 1.11 2005/10/21 19:34:34 grange Exp $ */ +/* $OpenBSD: elan520.c,v 1.12 2006/12/12 23:14:27 dim Exp $ */ /* $NetBSD: elan520.c,v 1.4 2002/10/02 05:47:15 thorpej Exp $ */ /*- @@ -71,7 +71,7 @@ struct elansc_softc { int elansc_match(struct device *, void *, void *); void elansc_attach(struct device *, struct device *, void *); void elansc_update_cpuspeed(void); -int elansc_setperf(int); +void elansc_setperf(int); int elansc_cpuspeed(int *); void elansc_wdogctl(struct elansc_softc *, int, uint16_t); @@ -286,7 +286,7 @@ elansc_update_cpuspeed(void) #endif } -int +void elansc_setperf(int level) { uint32_t eflags; @@ -298,7 +298,7 @@ elansc_setperf(int level) MMCR_CPUCTL); speed = (level == 100) ? 2 : 1; if ((cpuctl & CPUCTL_CPU_CLK_SPD_MASK) == speed) - return (0); + return; eflags = read_eflags(); disable_intr(); @@ -308,8 +308,6 @@ elansc_setperf(int level) write_eflags(eflags); elansc_update_cpuspeed(); - - return (0); } int diff --git a/sys/arch/i386/pci/gscpm.c b/sys/arch/i386/pci/gscpm.c index 343fcf60466..5d45920869a 100644 --- a/sys/arch/i386/pci/gscpm.c +++ b/sys/arch/i386/pci/gscpm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gscpm.c,v 1.5 2006/12/11 20:57:40 deraadt Exp $ */ +/* $OpenBSD: gscpm.c,v 1.6 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -48,7 +48,7 @@ struct gscpm_softc { int gscpm_match(struct device *, void *, void *); void gscpm_attach(struct device *, struct device *, void *); -int gscpm_setperf(int); +void gscpm_setperf(int); #ifdef __HAVE_TIMECOUNTER u_int gscpm_get_timecount(struct timecounter *tc); @@ -142,7 +142,7 @@ gscpm_get_timecount(struct timecounter *tc) #endif /* __HAVE_TIMECOUNTER */ #if 0 -int +void gscpm_setperf(int level) { struct gscpm_softc *sc = gscpm_cookie; @@ -164,7 +164,5 @@ gscpm_setperf(int level) /* Update processor control register */ bus_space_write_4(sc->sc_iot, sc->sc_acpi_ioh, GSCPM_P_CNT, pctl); - - return (0); } #endif diff --git a/sys/arch/i386/pci/ichpcib.c b/sys/arch/i386/pci/ichpcib.c index 3a5ad83e790..e9390053820 100644 --- a/sys/arch/i386/pci/ichpcib.c +++ b/sys/arch/i386/pci/ichpcib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ichpcib.c,v 1.15 2006/11/29 20:03:20 dim Exp $ */ +/* $OpenBSD: ichpcib.c,v 1.16 2006/12/12 23:14:27 dim Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -52,7 +52,7 @@ int ichpcib_match(struct device *, void *, void *); void ichpcib_attach(struct device *, struct device *, void *); int ichss_present(struct pci_attach_args *); -int ichss_setperf(int); +void ichss_setperf(int); /* arch/i386/pci/pcib.c */ void pcibattach(struct device *, struct device *, void *); @@ -229,7 +229,7 @@ ichss_present(struct pci_attach_args *pa) return (0); } -int +void ichss_setperf(int level) { struct ichpcib_softc *sc = ichss_cookie; @@ -239,7 +239,7 @@ ichss_setperf(int level) #ifdef DIAGNOSTIC if (sc == NULL) { printf("%s: no cookie", __func__); - return (EFAULT); + return; } #endif @@ -278,8 +278,6 @@ ichss_setperf(int level) update_cpuspeed(); } splx(s); - - return (0); } #endif /* !SMALL_KERNEL */ |