est.c (256281) | est.c (260473) |
---|---|
1/*- 2 * Copyright (c) 2004 Colin Percival 3 * Copyright (c) 2005 Nate Lawson 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted providing that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Colin Percival 3 * Copyright (c) 2005 Nate Lawson 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted providing that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: stable/10/sys/x86/cpufreq/est.c 241885 2012-10-22 13:06:09Z eadler $"); | 29__FBSDID("$FreeBSD: stable/10/sys/x86/cpufreq/est.c 260473 2014-01-09 10:44:27Z mav $"); |
30 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/cpu.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> 37#include <sys/smp.h> --- 1245 unchanged lines hidden (view full) --- 1283 uint16_t new_id16; 1284 int ret = 0; 1285 1286 /* Read the current register, mask out the old, set the new id. */ 1287 msr = rdmsr(MSR_PERF_CTL); 1288 msr = (msr & ~0xffff) | id16; 1289 wrmsr(MSR_PERF_CTL, msr); 1290 | 30 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/cpu.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> 37#include <sys/smp.h> --- 1245 unchanged lines hidden (view full) --- 1283 uint16_t new_id16; 1284 int ret = 0; 1285 1286 /* Read the current register, mask out the old, set the new id. */ 1287 msr = rdmsr(MSR_PERF_CTL); 1288 msr = (msr & ~0xffff) | id16; 1289 wrmsr(MSR_PERF_CTL, msr); 1290 |
1291 /* Wait a short while for the new setting. XXX Is this necessary? */ 1292 DELAY(EST_TRANS_LAT); 1293 | |
1294 if (need_check) { | 1291 if (need_check) { |
1292 /* Wait a short while and read the new status. */ 1293 DELAY(EST_TRANS_LAT); |
|
1295 est_get_id16(&new_id16); 1296 if (new_id16 != id16) { 1297 if (bootverbose) 1298 device_printf(dev, "Invalid id16 (set, cur) " 1299 "= (%u, %u)\n", id16, new_id16); 1300 ret = ENXIO; 1301 } 1302 } --- 100 unchanged lines hidden --- | 1294 est_get_id16(&new_id16); 1295 if (new_id16 != id16) { 1296 if (bootverbose) 1297 device_printf(dev, "Invalid id16 (set, cur) " 1298 "= (%u, %u)\n", id16, new_id16); 1299 ret = ENXIO; 1300 } 1301 } --- 100 unchanged lines hidden --- |