Introduce COHERENCY_UNIT/coherency_unit as proposed on tech-kern.

This commit is contained in:
ad 2008-03-27 18:28:20 +00:00
parent 14f850861b
commit 0f33676c6c
2 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.c,v 1.54 2008/03/15 14:55:22 ad Exp $ */
/* $NetBSD: param.c,v 1.55 2008/03/27 18:28:20 ad Exp $ */
/*
* Copyright (c) 1980, 1986, 1989 Regents of the University of California.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.54 2008/03/15 14:55:22 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.55 2008/03/27 18:28:20 ad Exp $");
#include "opt_hz.h"
#include "opt_rtc_offset.h"
@ -111,10 +111,13 @@ int maxproc = NPROC;
int desiredvnodes = NVNODE;
u_int maxfiles = MAXFILES;
int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */
#ifdef MULTIPROCESSOR
u_int maxcpus = MAXCPUS;
size_t coherency_unit = COHERENCY_UNIT;
#else
u_int maxcpus = 1;
size_t coherency_unit = ALIGNBYTES;
#endif
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.312 2008/03/25 23:21:42 yamt Exp $ */
/* $NetBSD: param.h,v 1.313 2008/03/27 18:28:20 ad Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -163,6 +163,9 @@
#define dbtob(x) ((x) << DEV_BSHIFT)
#define btodb(x) ((x) >> DEV_BSHIFT)
#ifndef COHERENCY_UNIT
#define COHERENCY_UNIT 64
#endif
#ifndef CACHE_LINE_SIZE
#define CACHE_LINE_SIZE 64
#endif
@ -270,8 +273,6 @@
#define PRI_IDLE PRI_USER
extern const int schedppq;
/*
* Miscellaneous.
*/
@ -409,6 +410,10 @@ extern const int schedppq;
((t +0u) / hz) * 1000u : \
((t +0u) * 1000u) / hz)
#endif
extern const int schedppq;
extern size_t coherency_unit;
#endif /* _KERNEL */
/*