1221499Sattilio/*- 2221499Sattilio * Copyright (c) 2008, Jeffrey Roberson <jeff@freebsd.org> 3221499Sattilio * All rights reserved. 4221499Sattilio * 5221499Sattilio * Copyright (c) 2008 Nokia Corporation 6221499Sattilio * All rights reserved. 7221499Sattilio * 8221499Sattilio * Redistribution and use in source and binary forms, with or without 9221499Sattilio * modification, are permitted provided that the following conditions 10221499Sattilio * are met: 11221499Sattilio * 1. Redistributions of source code must retain the above copyright 12221499Sattilio * notice unmodified, this list of conditions, and the following 13221499Sattilio * disclaimer. 14221499Sattilio * 2. Redistributions in binary form must reproduce the above copyright 15221499Sattilio * notice, this list of conditions and the following disclaimer in the 16221499Sattilio * documentation and/or other materials provided with the distribution. 17221499Sattilio * 18221499Sattilio * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19221499Sattilio * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20221499Sattilio * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21221499Sattilio * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22221499Sattilio * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23221499Sattilio * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24221499Sattilio * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25221499Sattilio * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26221499Sattilio * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27221499Sattilio * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28221499Sattilio * 29221499Sattilio * $FreeBSD$ 30221499Sattilio */ 31221499Sattilio 32221499Sattilio#ifndef _SYS__CPUSET_H_ 33221499Sattilio#define _SYS__CPUSET_H_ 34221499Sattilio 35250395Sattilio#include <sys/_bitset.h> 36250395Sattilio 37221499Sattilio#ifdef _KERNEL 38221499Sattilio#define CPU_SETSIZE MAXCPU 39221499Sattilio#endif 40221499Sattilio 41221511Sattilio#define CPU_MAXSIZE 128 42221499Sattilio 43221499Sattilio#ifndef CPU_SETSIZE 44221499Sattilio#define CPU_SETSIZE CPU_MAXSIZE 45221499Sattilio#endif 46221499Sattilio 47250395Sattilio#define _NCPUBITS _BITSET_BITS 48250395Sattilio#define _NCPUWORDS __bitset_words(CPU_SETSIZE) 49221499Sattilio 50250395SattilioBITSET_DEFINE(_cpuset, CPU_SETSIZE); 51250395Sattiliotypedef struct _cpuset cpuset_t; 52221499Sattilio 53250395Sattilio#define CPUSET_FSET BITSET_FSET(_NCPUWORDS) 54250395Sattilio#define CPUSET_T_INITIALIZER BITSET_T_INITIALIZER 55239923Sattilio 56221499Sattilio#endif /* !_SYS__CPUSET_H_ */ 57