]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/machparam.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1990, 1991 The University of Utah and
27 * the Center for Software Science at the University of Utah (CSS).
28 * All rights reserved.
30 * Permission to use, copy, modify and distribute this software is hereby
31 * granted provided that (1) source code retains these copyright, permission,
32 * and disclaimer notices, and (2) redistributions including binaries
33 * reproduce the notices in supporting documentation, and (3) all advertising
34 * materials mentioning features or use of this software display the following
35 * acknowledgement: ``This product includes software developed by the Center
36 * for Software Science at the University of Utah.''
38 * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
39 * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF
40 * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 * CSS requests users of this software to return to css-dist@cs.utah.edu any
43 * improvements that they make and grant CSS redistribution rights.
45 * Utah $Hdr: machparam.h 1.7 92/05/22$
48 #ifndef _PPC_MACHPARAM_H_
49 #define _PPC_MACHPARAM_H_
52 * Machine dependent constants for ppc.
53 * Added as needed (for device drivers).
55 #define NBPG 4096 /* bytes/page */
56 #define PGSHIFT 12 /* LOG2(NBPG) */
58 #define DEV_BSHIFT 10 /* log2(DEV_BSIZE) */
61 * Disk devices do all IO in 1024-byte blocks.
63 #define DEV_BSIZE 1024
65 #define btop(x) ((x)>>PGSHIFT)
66 #define ptob(x) ((x)<<PGSHIFT)
68 /* Clicks to disk blocks */
69 #define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
71 /* Disk blocks to clicks */
72 #define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
75 #define ctob(x) ((x)<<PGSHIFT)
78 #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
80 #endif /* _PPC_MACHPARAM_H_ */