freebsd-dev/sys/ia64/include/param.h

120 lines
3.9 KiB
C
Raw Normal View History

/* $FreeBSD$ */
/* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */
/*-
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
* Science Department and Ralph Campbell.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* from: Utah $Hdr: machparam.h 1.11 89/08/14$
*
* @(#)param.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _IA64_INCLUDE_PARAM_H_
#define _IA64_INCLUDE_PARAM_H_
/*
* Machine dependent constants for the IA64.
*/
2000-12-30 13:06:01 +00:00
#include <machine/_align.h>
#define __HAVE_ACPI
#define __PCI_REROUTE_INTERRUPT
#ifndef MACHINE
#define MACHINE "ia64"
#endif
#ifndef MACHINE_ARCH
#define MACHINE_ARCH "ia64"
#endif
#ifndef MACHINE_ARCH32
#define MACHINE_ARCH32 "i386"
#endif
#if defined(SMP) || defined(KLD_MODULE)
#ifndef MAXCPU
#define MAXCPU 64
#endif
#else
#define MAXCPU 1
#endif
#ifndef MAXMEMDOM
#define MAXMEMDOM 1
#endif
#define ALIGNBYTES _ALIGNBYTES
#define ALIGN(p) _ALIGN(p)
/*
* ALIGNED_POINTER is a boolean macro that checks whether an address
* is valid to fetch data elements of type t from on this architecture.
* This does not reflect the optimal alignment, just the possibility
* (within reasonable limits).
*/
#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0)
/*
* CACHE_LINE_SIZE is the compile-time maximum cache line size for an
* architecture. It should be used with appropriate caution.
*/
#define CACHE_LINE_SHIFT 7
#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT)
#ifndef LOG2_PAGE_SIZE
#define LOG2_PAGE_SIZE 13 /* 8K pages by default. */
#endif
#define PAGE_SHIFT (LOG2_PAGE_SIZE)
#define PAGE_SIZE (1<<(LOG2_PAGE_SIZE))
#define PAGE_MASK (PAGE_SIZE-1)
#define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t)))
#define MAXPAGESIZES 1 /* maximum number of supported page sizes */
#ifndef KSTACK_PAGES
Revert previous commit. The problem was not related to overrunning the kernel stack at all. The new USB stack simply caused a change in timing that triggered a firmware bug more often. The addition of PRINTF_BUFR_SIZE apparently triggered the same firmware bug even more reliably. But even with KSTACK_PAGES=5, one instance of the firmware bug remained: booting with a CD inserted. This problem was run into by accident after installing Debian and having to boot FreeBSD to fixup the GPT partitioning (Thanks... not). After bumping KSTACK_PAGES to 5, it was pretty unbelievable that the stack was still being too small. After updating the firmware we could boot with a CD inserted and KSTACK_PAGES could be lowered back to 4 pages without problems. Note: It is believed to be a timing related firmware bug, because the machine check information showed access to the serial console on one CPU and access to the EHCI HCD on the other CPU. Since both are devices on the management unit and thus virtualized in some way, any execution trace that does not include concurrent access to the BMC from both CPUs is fine. Note also that it's not understood exactly how increasing the kernel stack avoided hitting the firmware bug. A change in page faults does change timing, but it's not known if that's what's happening here. In any case: the problem is being monitored. Reverting back to 4 pages for the kernel stack is preferred, because it makes it easier to switch to 16K pages (double the page size) without wasting too much memory by not being able to half the number of pages...
2009-11-23 21:09:23 +00:00
#define KSTACK_PAGES 4 /* pages of kernel stack */
#endif
#define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */
/*
* Mach derived conversion macros
*/
#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK))
#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK))
#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT)
#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT)
#define pgtok(x) ((x) * (PAGE_SIZE / 1024))
#endif /* !_IA64_INCLUDE_PARAM_H_ */