Home | History | Annotate | Line # | Download | only in include
param.h revision 1.22
      1  1.22   maxv /*	$NetBSD: param.h,v 1.22 2017/06/14 12:27:24 maxv Exp $	*/
      2   1.9    mrg 
      3   1.9    mrg #ifdef __x86_64__
      4   1.1   fvdl 
      5  1.18  rmind #ifndef XEN
      6  1.18  rmind /* Must be defined before cpu.h */
      7  1.18  rmind #define	MAXCPUS		256
      8  1.18  rmind #endif
      9  1.18  rmind 
     10   1.1   fvdl #ifdef _KERNEL
     11   1.1   fvdl #include <machine/cpu.h>
     12   1.1   fvdl #endif
     13   1.1   fvdl 
     14   1.1   fvdl #define	_MACHINE	amd64
     15   1.1   fvdl #define	MACHINE		"amd64"
     16   1.1   fvdl #define	_MACHINE_ARCH	x86_64
     17   1.1   fvdl #define	MACHINE_ARCH	"x86_64"
     18   1.1   fvdl #define MID_MACHINE	MID_X86_64
     19   1.1   fvdl 
     20   1.1   fvdl #define ALIGNED_POINTER(p,t)	1
     21   1.1   fvdl 
     22   1.1   fvdl #define ALIGNBYTES32		(sizeof(int) - 1)
     23   1.1   fvdl #define ALIGN32(p)		(((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)
     24   1.1   fvdl 
     25   1.1   fvdl #define	PGSHIFT		12		/* LOG2(NBPG) */
     26   1.1   fvdl #define	NBPG		(1 << PGSHIFT)	/* bytes/page */
     27   1.1   fvdl #define	PGOFSET		(NBPG-1)	/* byte offset into page */
     28   1.1   fvdl #define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
     29   1.1   fvdl 
     30  1.20   maya #define	MAXIOMEM	0xffffffffffff
     31  1.20   maya 
     32   1.1   fvdl /*
     33  1.22   maxv  * Maximum physical memory supported by the implementation.
     34  1.22   maxv  */
     35  1.22   maxv #define MAXPHYSMEM	0x100000000000ULL /* 16TB */
     36  1.22   maxv 
     37  1.22   maxv /*
     38   1.1   fvdl  * XXXfvdl change this (after bootstrap) to take # of bits from
     39   1.1   fvdl  * config info into account.
     40   1.1   fvdl  */
     41   1.1   fvdl #define	KERNBASE	0xffffffff80000000 /* start of kernel virtual space */
     42  1.21   maxv #define	KERNTEXTOFF	0xffffffff80200000 /* start of kernel text */
     43   1.1   fvdl #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)
     44   1.1   fvdl 
     45   1.1   fvdl #define KERNTEXTOFF_HI	0xffffffff
     46  1.21   maxv #define KERNTEXTOFF_LO	0x80200000
     47   1.1   fvdl 
     48   1.1   fvdl #define KERNBASE_HI	0xffffffff
     49   1.1   fvdl #define KERNBASE_LO	0x80000000
     50   1.1   fvdl 
     51   1.1   fvdl #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
     52   1.1   fvdl #define	DEV_BSIZE	(1 << DEV_BSHIFT)
     53   1.1   fvdl #define	BLKDEV_IOSIZE	2048
     54   1.1   fvdl #ifndef	MAXPHYS
     55   1.1   fvdl #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
     56   1.1   fvdl #endif
     57   1.1   fvdl 
     58  1.12   haad #define	SSIZE		1		/* initial stack size/NBPG */
     59  1.12   haad #define	SINCR		1		/* increment of stack/NBPG */
     60  1.10     ad #ifdef DIAGNOSTIC
     61  1.12   haad #define	UPAGES		4		/* pages of u-area (1 for redzone) */
     62  1.10     ad #else
     63  1.12   haad #define	UPAGES		3		/* pages of u-area */
     64  1.10     ad #endif
     65   1.1   fvdl #define	USPACE		(UPAGES * NBPG)	/* total size of u-area */
     66   1.7   yamt #define	INTRSTACKSIZE	4096
     67   1.1   fvdl 
     68   1.1   fvdl #ifndef MSGBUFSIZE
     69  1.19    mrg #define MSGBUFSIZE	(8*NBPG)	/* default message buffer size */
     70   1.1   fvdl #endif
     71   1.1   fvdl 
     72   1.1   fvdl /*
     73   1.1   fvdl  * Constants related to network buffer management.
     74   1.1   fvdl  * MCLBYTES must be no larger than NBPG (the software page size), and,
     75   1.1   fvdl  * on machines that exchange pages of input or output buffers with mbuf
     76   1.1   fvdl  * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
     77   1.1   fvdl  * of the hardware page size.
     78   1.1   fvdl  */
     79   1.1   fvdl #define	MSIZE		512		/* size of an mbuf */
     80   1.1   fvdl 
     81   1.1   fvdl #ifndef MCLSHIFT
     82   1.1   fvdl #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
     83   1.1   fvdl 					/* 2K cluster can hold Ether frame */
     84   1.1   fvdl #endif	/* MCLSHIFT */
     85   1.1   fvdl 
     86   1.1   fvdl #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
     87   1.1   fvdl 
     88   1.1   fvdl #ifndef NFS_RSIZE
     89   1.1   fvdl #define NFS_RSIZE       32768
     90   1.1   fvdl #endif
     91   1.1   fvdl #ifndef NFS_WSIZE
     92   1.1   fvdl #define NFS_WSIZE       32768
     93   1.1   fvdl #endif
     94   1.1   fvdl 
     95   1.1   fvdl /*
     96  1.17   para  * Minimum size of the kernel kmem_arena in PAGE_SIZE-sized
     97   1.1   fvdl  * logical pages.
     98  1.17   para  * No enforced maximum on amd64.
     99   1.1   fvdl  */
    100   1.1   fvdl #define	NKMEMPAGES_MIN_DEFAULT	((8 * 1024 * 1024) >> PAGE_SHIFT)
    101  1.17   para #define	NKMEMPAGES_MAX_UNLIMITED 1
    102   1.1   fvdl 
    103   1.1   fvdl /*
    104   1.1   fvdl  * XXXfvdl the PD* stuff is different from i386.
    105   1.1   fvdl  */
    106   1.1   fvdl /*
    107   1.1   fvdl  * Mach derived conversion macros
    108   1.1   fvdl  */
    109   1.1   fvdl #define	x86_round_pdr(x) \
    110   1.1   fvdl 	((((unsigned long)(x)) + (NBPD_L2 - 1)) & ~(NBPD_L2 - 1))
    111   1.1   fvdl #define	x86_trunc_pdr(x)	((unsigned long)(x) & ~(NBPD_L2 - 1))
    112   1.1   fvdl #define	x86_btod(x)		((unsigned long)(x) >> L2_SHIFT)
    113   1.1   fvdl #define	x86_dtob(x)		((unsigned long)(x) << L2_SHIFT)
    114   1.1   fvdl #define	x86_round_page(x)	((((unsigned long)(x)) + PGOFSET) & ~PGOFSET)
    115   1.1   fvdl #define	x86_trunc_page(x)	((unsigned long)(x) & ~PGOFSET)
    116   1.1   fvdl #define	x86_btop(x)		((unsigned long)(x) >> PGSHIFT)
    117   1.1   fvdl #define	x86_ptob(x)		((unsigned long)(x) << PGSHIFT)
    118   1.1   fvdl 
    119   1.1   fvdl #define btop(x)				x86_btop(x)
    120   1.1   fvdl #define ptob(x)				x86_ptob(x)
    121   1.1   fvdl 
    122   1.1   fvdl #define mstohz(ms) ((ms + 0UL) * hz / 1000)
    123   1.9    mrg 
    124   1.9    mrg #else	/*	__x86_64__	*/
    125   1.9    mrg 
    126   1.9    mrg #include <i386/param.h>
    127   1.9    mrg 
    128   1.9    mrg #endif	/*	__x86_64__	*/
    129