Deleted Added
full compact
kern_cpu.c (173204) kern_cpu.c (175376)
1/*-
2 * Copyright (c) 2004-2007 Nate Lawson (SDG)
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004-2007 Nate Lawson (SDG)
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/kern/kern_cpu.c 173204 2007-10-30 22:18:08Z njl $");
28__FBSDID("$FreeBSD: head/sys/kern/kern_cpu.c 175376 2008-01-16 01:05:21Z njl $");
29
30#include <sys/param.h>
31#include <sys/bus.h>
32#include <sys/cpu.h>
33#include <sys/eventhandler.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>

--- 564 unchanged lines hidden (view full) ---

601 *count = sc->all_count;
602 error = E2BIG;
603 goto out;
604 }
605
606 /* Finally, output the list of levels. */
607 i = 0;
608 TAILQ_FOREACH(lev, &sc->all_levels, link) {
29
30#include <sys/param.h>
31#include <sys/bus.h>
32#include <sys/cpu.h>
33#include <sys/eventhandler.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>

--- 564 unchanged lines hidden (view full) ---

601 *count = sc->all_count;
602 error = E2BIG;
603 goto out;
604 }
605
606 /* Finally, output the list of levels. */
607 i = 0;
608 TAILQ_FOREACH(lev, &sc->all_levels, link) {
609 /*
610 * Skip levels that are too close in frequency to the
611 * previous levels. Some systems report bogus duplicate
612 * settings (i.e., for acpi_perf).
613 */
614 if (i > 0 && CPUFREQ_CMP(lev->total_set.freq,
615 levels[i - 1].total_set.freq)) {
616 sc->all_count--;
617 continue;
618 }
619
609 /* Skip levels that have a frequency that is too low. */
610 if (lev->total_set.freq < cf_lowest_freq) {
611 sc->all_count--;
612 continue;
613 }
614
615 levels[i] = *lev;
616 i++;

--- 427 unchanged lines hidden ---
620 /* Skip levels that have a frequency that is too low. */
621 if (lev->total_set.freq < cf_lowest_freq) {
622 sc->all_count--;
623 continue;
624 }
625
626 levels[i] = *lev;
627 i++;

--- 427 unchanged lines hidden ---