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