move DEV_BSIZE, DEV_BSHIFT out of MD param.h, they are same on all ports

also move BLKDEV_IOSIZE, MAXPHYS, but allow override since some ports
have different value (powerpc uses NBPG for BLKDEV_IOSIZE, sun2/sun3
have lower MAXPHYS)
This commit is contained in:
jdolecek 2019-01-07 22:00:30 +00:00
parent 6779e7a282
commit 072aa173aa
29 changed files with 40 additions and 193 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.9 2019/01/04 21:39:38 rin Exp $ */
/* $NetBSD: param.h,v 1.10 2019/01/07 22:00:30 jdolecek Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -89,14 +89,6 @@
#define ALIGN32(p) \
(((uintptr_t)(p) + ALIGNBYTES32) & ~ALIGNBYTES32)
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS 65536 /* max I/O transfer size */
#endif
#define NKMEMPAGES_MIN_DEFAULT ((128UL * 1024 * 1024) >> PAGE_SHIFT)
#define NKMEMPAGES_MAX_UNLIMITED 1

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.11 2011/03/18 16:35:03 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.12 2019/01/07 22:00:30 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -50,11 +50,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.44 2016/01/20 12:49:21 jklos Exp $ */
/* $NetBSD: param.h,v 1.45 2019/01/07 22:00:30 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -60,13 +60,6 @@
#define KERNBASE 0xfffffc0000a00000 /* start of kernel virtual */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
#define SSIZE 1 /* initial stack size/NBPG */
#define SINCR 1 /* increment of stack/NBPG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.27 2018/12/02 21:00:13 maxv Exp $ */
/* $NetBSD: param.h,v 1.28 2019/01/07 22:00:30 jdolecek Exp $ */
#ifdef __x86_64__
@ -52,13 +52,6 @@
#define KERNBASE_HI 0xffffffff
#define KERNBASE_LO 0x80000000
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
#define SSIZE 1 /* initial stack size/NBPG */
#define SINCR 1 /* increment of stack/NBPG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.30 2016/07/13 00:04:28 maya Exp $ */
/* $NetBSD: param.h,v 1.31 2019/01/07 22:00:30 jdolecek Exp $ */
/* $OpenBSD: param.h,v 1.9 1997/04/30 09:54:15 niklas Exp $ */
/*
@ -59,11 +59,6 @@
#define KERNBASE 0x80000000 /* start of kernel virtual */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#define SSIZE 1 /* initial stack size/NBPG */
#define SINCR 1 /* increment of stack/NBPG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.21 2018/10/18 09:01:52 skrll Exp $ */
/* $NetBSD: param.h,v 1.22 2019/01/07 22:00:30 jdolecek Exp $ */
/*
* Copyright (c) 1994,1995 Mark Brinicombe.
@ -157,14 +157,6 @@
#define ALIGNBYTES32 7
#endif
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS 65536 /* max I/O transfer size */
#endif
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than NBPG (the software page size), and,

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.19 2011/03/18 16:19:13 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.20 2019/01/07 22:00:31 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -42,11 +42,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* Maximum raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.3 2011/03/18 16:39:58 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.4 2019/01/07 22:00:31 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -50,11 +50,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than NBPG (the software page size), and,

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.10 2017/07/24 09:56:45 mrg Exp $ */
/* $NetBSD: param.h,v 1.11 2019/01/07 22:00:31 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -46,11 +46,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.5 2011/03/18 16:23:09 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.6 2019/01/07 22:00:31 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -42,11 +42,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* Maximum raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.16 2011/03/18 16:36:50 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.17 2019/01/07 22:00:31 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -54,11 +54,6 @@
#define KERNTEXTOFF 0x80001000 /* start of kernel text for kvm_mkdb */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.21 2015/10/27 22:28:56 mrg Exp $ */
/* $NetBSD: param.h,v 1.22 2019/01/07 22:00:31 jdolecek Exp $ */
/* $OpenBSD: param.h,v 1.12 2001/07/06 02:07:41 provos Exp $ */
@ -50,11 +50,6 @@
#define KERNBASE 0x00000000 /* start of kernel virtual */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#define SSIZE (1) /* initial stack size/NBPG */
#define SINCR (1) /* increment of stack/NBPG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.83 2018/02/19 13:02:47 sborrill Exp $ */
/* $NetBSD: param.h,v 1.84 2019/01/07 22:00:31 jdolecek Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -87,13 +87,6 @@
#define KERNTEXTOFF (KERNBASE + 0x100000) /* start of kernel text */
#define BTOPKERNBASE (KERNBASE >> PGSHIFT)
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
#define SSIZE 1 /* initial stack size/NBPG */
#define SINCR 1 /* increment of stack/NBPG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.9 2017/04/08 18:03:33 scole Exp $ */
/* $NetBSD: param.h,v 1.10 2019/01/07 22:00:31 jdolecek Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -57,14 +57,6 @@
#define MAXCPU 1
#endif
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1<<DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
#define UPAGES 4
#define USPACE (UPAGES * NBPG) /* total size of u-area */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.21 2012/01/24 20:03:37 christos Exp $ */
/* $NetBSD: param.h,v 1.22 2019/01/07 22:00:31 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -61,13 +61,6 @@
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
#define SSIZE 1 /* initial stack size/NBPG */
#define SINCR 1 /* increment of stack/NBPG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.14 2011/03/18 16:37:18 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.15 2019/01/07 22:00:31 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -54,11 +54,6 @@
#define KERNTEXTOFF 0x80001000 /* start of kernel text for kvm_mkdb */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* from $NetBSD: param.h,v 1.21 2011/03/18 16:21:30 tsutsui Exp $ */
/* from $NetBSD: param.h,v 1.22 2019/01/07 22:00:32 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -54,11 +54,6 @@
#define KERNTEXTOFF 0x80001000 /* start of kernel text for kvm_mkdb */
#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.1 2014/09/03 19:34:26 matt Exp $ */
/* $NetBSD: param.h,v 1.2 2019/01/07 22:00:32 jdolecek Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -56,14 +56,6 @@
#define STACK_ALIGNBYTES (__BIGGEST_ALIGNMENT__ - 1)
#define ALIGNBYTES32 __BIGGEST_ALIGNMENT__
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS 65536 /* max I/O transfer size */
#endif
#define NKMEMPAGES_MAX_DEFAULT (2048UL * 1024 * 1024)
#define NKMEMPAGES_MIN_DEFAULT (128UL * 1024 * 1024)

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.10 2014/04/01 14:08:50 martin Exp $ */
/* $NetBSD: param.h,v 1.11 2019/01/07 22:00:32 jdolecek Exp $ */
/*
* Copyright (c) 1992, 1993
@ -76,11 +76,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* Maximum raw I/O transfer size */
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than NBPG (the software page size), and,

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.45 2011/03/18 16:28:51 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.46 2019/01/07 22:00:32 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -50,11 +50,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.30 2017/01/14 21:33:09 christos Exp $ */
/* $NetBSD: param.h,v 1.31 2019/01/07 22:00:32 jdolecek Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -75,12 +75,7 @@
#define NBPG (1 << PGSHIFT) /* Page size */
#define PGOFSET (NBPG - 1)
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE NBPG
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
#define USPACE (UPAGES * NBPG)

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */
/* $NetBSD: param.h,v 1.2 2019/01/07 22:00:32 jdolecek Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -63,14 +63,6 @@
#define STACK_ALIGNBYTES (__BIGGEST_ALIGNMENT__ - 1)
#define ALIGNBYTES32 __BIGGEST_ALIGNMENT__
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#ifndef MAXPHYS
#define MAXPHYS 65536 /* max I/O transfer size */
#endif
#define NKMEMPAGES_MAX_DEFAULT (2048UL * 1024 * 1024)
#define NKMEMPAGES_MIN_DEFAULT (128UL * 1024 * 1024)

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.10 2011/03/18 16:32:07 tsutsui Exp $ */
/* $NetBSD: param.h,v 1.11 2019/01/07 22:00:32 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -46,11 +46,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.16 2011/07/04 12:18:53 mrg Exp $ */
/* $NetBSD: param.h,v 1.17 2019/01/07 22:00:32 jdolecek Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -46,11 +46,6 @@
#include <mips/mips_param.h>
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* Maximum raw I/O transfer size */
#ifdef _KERNEL
#ifndef _LOCORE

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.23 2012/02/10 17:35:48 para Exp $ */
/* $NetBSD: param.h,v 1.24 2019/01/07 22:00:32 jdolecek Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@ -51,11 +51,6 @@
#define NBPG (1 << PGSHIFT)
#define PGOFSET (NBPG - 1)
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
/*
* u-space.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.71 2017/02/13 09:46:30 skrll Exp $ */
/* $NetBSD: param.h,v 1.72 2019/01/07 22:00:32 jdolecek Exp $ */
/*
* Copyright (c) 1992, 1993
@ -84,11 +84,6 @@ extern int nbpg, pgofset, pgshift;
#define PROM_LOADADDR 0x00004000 /* where the prom loads us */
#define KERNTEXTOFF (KERNBASE+PROM_LOADADDR)/* start of kernel text */
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024)
#define SSIZE 1 /* initial stack size in pages */
#define USPACE 8192

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.58 2017/02/13 09:46:30 skrll Exp $ */
/* $NetBSD: param.h,v 1.59 2019/01/07 22:00:32 jdolecek Exp $ */
/*
* Copyright (c) 1992, 1993
@ -102,11 +102,6 @@
extern int nbpg, pgofset, pgshift;
#endif
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024)
#ifdef __arch64__
#ifdef SUN4V

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.61 2014/01/23 21:37:09 jklos Exp $ */
/* $NetBSD: param.h,v 1.62 2019/01/07 22:00:33 jdolecek Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@ -57,12 +57,6 @@
#define KERNBASE 0x80000000 /* start of kernel virtual */
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT)
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#define UPAGES 2 /* pages of u-area */
#define USPACE (NBPG*UPAGES)
#define REDZONEADDR (VAX_NBPG*3) /* Must be > sizeof(struct pcb) */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.575 2019/01/01 10:06:54 hannken Exp $ */
/* $NetBSD: param.h,v 1.576 2019/01/07 22:00:33 jdolecek Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -173,6 +173,17 @@
#include <machine/param.h>
#include <machine/limits.h>
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define DEV_BSIZE (1 << DEV_BSHIFT) /* 512 */
#ifndef BLKDEV_IOSIZE
#define BLKDEV_IOSIZE 2048
#endif
#ifndef MAXPHYS
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#endif
/* pages ("clicks") to disk blocks */
#define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT))
#define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT))