/*-1* SPDX-License-Identifier: BSD-4-Clause2*3* Copyright (c) 2001 David E. O'Brien4* Copyright (c) 1990 The Regents of the University of California.5* All rights reserved.6*7* This code is derived from software contributed to Berkeley by8* William Jolitz.9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions12* are met:13* 1. Redistributions of source code must retain the above copyright14* notice, this list of conditions and the following disclaimer.15* 2. Redistributions in binary form must reproduce the above copyright16* notice, this list of conditions and the following disclaimer in the17* documentation and/or other materials provided with the distribution.18* 3. All advertising materials mentioning features or use of this software19* must display the following acknowledgement:20* This product includes software developed by the University of21* California, Berkeley and its contributors.22* 4. Neither the name of the University nor the names of its contributors23* may be used to endorse or promote products derived from this software24* without specific prior written permission.25*26* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND27* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE28* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE29* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE30* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL31* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS32* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)33* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT34* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY35* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF36* SUCH DAMAGE.37*/3839#ifndef _ARM_INCLUDE_PARAM_H_40#define _ARM_INCLUDE_PARAM_H_4142/*43* Machine dependent constants for StrongARM44*/4546#include <machine/_align.h>4748#define STACKALIGNBYTES (8 - 1)49#define STACKALIGN(p) ((u_int)(p) & ~STACKALIGNBYTES)5051#ifndef MACHINE52#define MACHINE "arm"53#endif54#ifndef MACHINE_ARCH55#define MACHINE_ARCH "armv7"56#endif5758#ifdef SMP59#ifndef MAXCPU60#define MAXCPU 461#endif62#else63#define MAXCPU 164#endif6566#ifndef MAXMEMDOM67#define MAXMEMDOM 168#endif6970#define __HAVE_STATIC_DEVMAP7172#define ALIGNBYTES _ALIGNBYTES73#define ALIGN(p) _ALIGN(p)74/*75* ALIGNED_POINTER is a boolean macro that checks whether an address76* is valid to fetch data elements of type t from on this architecture.77* This does not reflect the optimal alignment, just the possibility78* (within reasonable limits).79*80* armv4 and v5 require alignment to the type's size. armv6 requires 8-byte81* alignment for the ldrd/strd instructions, but otherwise follows armv7 rules.82* armv7 requires that an 8-byte type be aligned to at least a 4-byte boundary;83* access to smaller types can be unaligned, except that the compiler may84* optimize access to adjacent uint32_t values into a single load/store-multiple85* instruction which requires 4-byte alignment, so we must provide the most-86* pessimistic answer possible even on armv7.87*/88#define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof(t)-1)) == 0)8990/*91* CACHE_LINE_SIZE is the compile-time maximum cache line size for an92* architecture. It should be used with appropriate caution.93*/94#define CACHE_LINE_SHIFT 695#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT)9697#define PAGE_SHIFT 1298#define PAGE_SIZE (1 << PAGE_SHIFT) /* Page size */99#define PAGE_MASK (PAGE_SIZE - 1)100101#define PDR_SHIFT 20 /* log2(NBPDR) */102#define NBPDR (1 << PDR_SHIFT)103#define PDRMASK (NBPDR - 1)104#define NPDEPG (1 << (32 - PDR_SHIFT))105106#define MAXPAGESIZES 2 /* maximum number of supported page sizes */107108#ifndef KSTACK_PAGES109#define KSTACK_PAGES 2110#endif /* !KSTACK_PAGES */111112#ifndef FPCONTEXTSIZE113#define FPCONTEXTSIZE (0x100)114#endif115116#ifndef KSTACK_GUARD_PAGES117#define KSTACK_GUARD_PAGES 1118#endif /* !KSTACK_GUARD_PAGES */119120#define USPACE_SVC_STACK_TOP (kstack_pages * PAGE_SIZE)121122/*123* Mach derived conversion macros124*/125#define trunc_1mpage(x) ((unsigned)(x) & ~PDRMASK)126#define round_1mpage(x) ((((unsigned)(x)) + PDRMASK) & ~PDRMASK)127128#define arm32_btop(x) ((unsigned)(x) >> PAGE_SHIFT)129#define arm32_ptob(x) ((unsigned)(x) << PAGE_SHIFT)130131#endif /* !_ARM_INCLUDE_PARAM_H_ */132133134