Deleted Added
full compact
kern_cpuset.c (251470) kern_cpuset.c (251703)
1/*-
2 * Copyright (c) 2008, Jeffrey Roberson <jeff@freebsd.org>
3 * All rights reserved.
4 *
5 * Copyright (c) 2008 Nokia Corporation
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008, Jeffrey Roberson <jeff@freebsd.org>
3 * All rights reserved.
4 *
5 * Copyright (c) 2008 Nokia Corporation
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/kern/kern_cpuset.c 251470 2013-06-06 14:43:19Z jhb $");
32__FBSDID("$FreeBSD: head/sys/kern/kern_cpuset.c 251703 2013-06-13 20:46:03Z jeff $");
33
34#include "opt_ddb.h"
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/sysproto.h>
39#include <sys/jail.h>
40#include <sys/kernel.h>

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

616 while ((nset = LIST_FIRST(&freelist)) != NULL) {
617 LIST_REMOVE(nset, cs_link);
618 uma_zfree(cpuset_zone, nset);
619 }
620 return (error);
621}
622
623/*
33
34#include "opt_ddb.h"
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/sysproto.h>
39#include <sys/jail.h>
40#include <sys/kernel.h>

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

616 while ((nset = LIST_FIRST(&freelist)) != NULL) {
617 LIST_REMOVE(nset, cs_link);
618 uma_zfree(cpuset_zone, nset);
619 }
620 return (error);
621}
622
623/*
624 * Calculate the ffs() of the cpuset.
625 */
626int
627cpusetobj_ffs(const cpuset_t *set)
628{
629 size_t i;
630 int cbit;
631
632 cbit = 0;
633 for (i = 0; i < _NCPUWORDS; i++) {
634 if (set->__bits[i] != 0) {
635 cbit = ffsl(set->__bits[i]);
636 cbit += i * _NCPUBITS;
637 break;
638 }
639 }
640 return (cbit);
641}
642
643/*
644 * Return a string representing a valid layout for a cpuset_t object.
645 * It expects an incoming buffer at least sized as CPUSETBUFSIZ.
646 */
647char *
648cpusetobj_strprint(char *buf, const cpuset_t *set)
649{
650 char *tbuf;
651 size_t i, bytesp, bufsiz;

--- 526 unchanged lines hidden ---
624 * Return a string representing a valid layout for a cpuset_t object.
625 * It expects an incoming buffer at least sized as CPUSETBUFSIZ.
626 */
627char *
628cpusetobj_strprint(char *buf, const cpuset_t *set)
629{
630 char *tbuf;
631 size_t i, bytesp, bufsiz;

--- 526 unchanged lines hidden ---