1139825Simp/*- 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 32209975Snwhitehorn#ifdef __powerpc64__ 33209975Snwhitehorn#define RQB_LEN (1UL) /* Number of priority status words. */ 34209975Snwhitehorn#define RQB_L2BPW (6UL) /* Log2(sizeof(rqb_word_t) * NBBY)). */ 35209975Snwhitehorn#else 3697261Sjake#define RQB_LEN (2) /* Number of priority status words. */ 3797261Sjake#define RQB_L2BPW (5) /* Log2(sizeof(rqb_word_t) * NBBY)). */ 38209975Snwhitehorn#endif 39209975Snwhitehorn#define RQB_BPW (1UL<<RQB_L2BPW) /* Bits in an rqb_word_t. */ 4097261Sjake 41209975Snwhitehorn#define RQB_BIT(pri) (1UL << ((pri) & (RQB_BPW - 1))) 4297261Sjake#define RQB_WORD(pri) ((pri) >> RQB_L2BPW) 4397261Sjake 44209975Snwhitehorn#define RQB_FFS(word) (ffsl(word) - 1) 4597261Sjake 4697261Sjake/* 4797261Sjake * Type of run queue status word. 4897261Sjake */ 49209975Snwhitehorn#ifdef __powerpc64__ 50209975Snwhitehorntypedef u_int64_t rqb_word_t; 51209975Snwhitehorn#else 5297261Sjaketypedef u_int32_t rqb_word_t; 53209975Snwhitehorn#endif 5497261Sjake 5597261Sjake#endif 56