1139790Simp/*-
297261Sjake * Copyright (c) 2001 Jake Burkholder <jake@FreeBSD.org>
397261Sjake * All rights reserved.
497261Sjake *
597261Sjake * Redistribution and use in source and binary forms, with or without
697261Sjake * modification, are permitted provided that the following conditions
797261Sjake * are met:
897261Sjake * 1. Redistributions of source code must retain the above copyright
997261Sjake *    notice, this list of conditions and the following disclaimer.
1097261Sjake * 2. Redistributions in binary form must reproduce the above copyright
1197261Sjake *    notice, this list of conditions and the following disclaimer in the
1297261Sjake *    documentation and/or other materials provided with the distribution.
1397261Sjake *
1497261Sjake * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1597261Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1697261Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1797261Sjake * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1897261Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1997261Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2097261Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2197261Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2297261Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2397261Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2497261Sjake * SUCH DAMAGE.
2597261Sjake *
2697261Sjake * $FreeBSD$
2797261Sjake */
2897261Sjake
2997261Sjake#ifndef	_MACHINE_RUNQ_H_
3097261Sjake#define	_MACHINE_RUNQ_H_
3197261Sjake
3297261Sjake#define	RQB_LEN		(2)		/* Number of priority status words. */
3397261Sjake#define	RQB_L2BPW	(5)		/* Log2(sizeof(rqb_word_t) * NBBY)). */
3497261Sjake#define	RQB_BPW		(1<<RQB_L2BPW)	/* Bits in an rqb_word_t. */
3597261Sjake
3697261Sjake#define	RQB_BIT(pri)	(1 << ((pri) & (RQB_BPW - 1)))
3797261Sjake#define	RQB_WORD(pri)	((pri) >> RQB_L2BPW)
3897261Sjake
3998469Speter#define	RQB_FFS(word)	(ffs(word) - 1)
4097261Sjake
4197261Sjake/*
4297261Sjake * Type of run queue status word.
4397261Sjake */
4497261Sjaketypedef	u_int32_t	rqb_word_t;
4597261Sjake
4697261Sjake#endif
47