xref: /illumos-gate/usr/src/compat/bhyve/amd64/machine/param.h (revision d0b3c59ba652f183eeec1414dd9fbdc56bf05cc8)
1*d0b3c59bSPatrick Mooney /*
2*d0b3c59bSPatrick Mooney  * This file and its contents are supplied under the terms of the
3*d0b3c59bSPatrick Mooney  * Common Development and Distribution License ("CDDL"), version 1.0.
4*d0b3c59bSPatrick Mooney  * You may only use this file in accordance with the terms of version
5*d0b3c59bSPatrick Mooney  * 1.0 of the CDDL.
6*d0b3c59bSPatrick Mooney  *
7*d0b3c59bSPatrick Mooney  * A full copy of the text of the CDDL should have accompanied this
8*d0b3c59bSPatrick Mooney  * source.  A copy of the CDDL is also available via the Internet at
9*d0b3c59bSPatrick Mooney  * http://www.illumos.org/license/CDDL.
10*d0b3c59bSPatrick Mooney  */
11*d0b3c59bSPatrick Mooney 
12*d0b3c59bSPatrick Mooney /*
13*d0b3c59bSPatrick Mooney  * Copyright 2013 Pluribus Networks Inc.
14*d0b3c59bSPatrick Mooney  */
15*d0b3c59bSPatrick Mooney 
16*d0b3c59bSPatrick Mooney #ifndef _COMPAT_FREEBSD_AMD64_MACHINE_PARAM_H_
17*d0b3c59bSPatrick Mooney #define	_COMPAT_FREEBSD_AMD64_MACHINE_PARAM_H_
18*d0b3c59bSPatrick Mooney 
19*d0b3c59bSPatrick Mooney #ifdef	_KERNEL
20*d0b3c59bSPatrick Mooney #define	MAXCPU		NCPU
21*d0b3c59bSPatrick Mooney #endif	/* _KERNEL */
22*d0b3c59bSPatrick Mooney 
23*d0b3c59bSPatrick Mooney #define	PAGE_SHIFT	12		/* LOG2(PAGE_SIZE) */
24*d0b3c59bSPatrick Mooney #define	PAGE_SIZE	(1<<PAGE_SHIFT)	/* bytes/page */
25*d0b3c59bSPatrick Mooney #define	PAGE_MASK	(PAGE_SIZE-1)
26*d0b3c59bSPatrick Mooney 
27*d0b3c59bSPatrick Mooney /* Size of the level 1 page table units */
28*d0b3c59bSPatrick Mooney #define	NPTEPG		(PAGE_SIZE/(sizeof (pt_entry_t)))
29*d0b3c59bSPatrick Mooney 
30*d0b3c59bSPatrick Mooney /* Size of the level 2 page directory units */
31*d0b3c59bSPatrick Mooney #define	NPDEPG		(PAGE_SIZE/(sizeof (pd_entry_t)))
32*d0b3c59bSPatrick Mooney 
33*d0b3c59bSPatrick Mooney /* Size of the level 3 page directory pointer table units */
34*d0b3c59bSPatrick Mooney #define	NPDPEPG		(PAGE_SIZE/(sizeof (pdp_entry_t)))
35*d0b3c59bSPatrick Mooney 
36*d0b3c59bSPatrick Mooney /* Size of the level 4 page-map level-4 table units */
37*d0b3c59bSPatrick Mooney #define	NPML4EPG	(PAGE_SIZE/(sizeof (pml4_entry_t)))
38*d0b3c59bSPatrick Mooney 
39*d0b3c59bSPatrick Mooney #define	CACHE_LINE_SIZE	64
40*d0b3c59bSPatrick Mooney 
41*d0b3c59bSPatrick Mooney #endif	/* _COMPAT_FREEBSD_AMD64_MACHINE_PARAM_H_ */
42