Moving all NetBSD headers back where they belong.

Moving include/sys NetBSD headers to /sys/sys
Moving include/arch/*/ NetBSD headers to /sys/arch/*/include

Change-Id: Ia1a45d4e83ab806c84093ec2b61bdbea9bed65a0
This commit is contained in:
2012-11-26 16:59:26 +01:00
parent be89757ef5
commit f6aac1c3b5
222 changed files with 4556 additions and 5262 deletions

View File

@@ -0,0 +1,24 @@
# $NetBSD: Makefile,v 1.43 2012/08/15 20:38:49 matt Exp $
INCSDIR= /usr/include/arm
INCS= ansi.h asm.h \
bswap.h byte_swap.h \
cdefs.h cpu.h \
disklabel.h \
elf_machdep.h endian.h endian_machdep.h \
float.h \
ieee.h ieeefp.h \
int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
\
limits.h lock.h \
math.h mcontext.h mutex.h \
param.h profile.h \
\
\
setjmp.h signal.h \
types.h \
\
wchar_limits.h
.include <bsd.kinc.mk>

View File

@@ -0,0 +1,62 @@
/* $NetBSD: ansi.h,v 1.13 2011/07/17 20:54:37 joerg Exp $ */
/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* 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.
* 3. 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: @(#)ansi.h 8.2 (Berkeley) 1/4/94
*/
#ifndef _ANSI_H_
#define _ANSI_H_
#include <sys/cdefs.h>
#include <machine/int_types.h>
/*
* Types which are fundamental to the implementation and may appear in
* more than one standard header are defined here. Standard headers
* then use:
* #ifdef _BSD_SIZE_T_
* typedef _BSD_SIZE_T_ size_t;
* #undef _BSD_SIZE_T_
* #endif
*/
#define _BSD_CLOCK_T_ long /* clock() */
#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
#define _BSD_SIZE_T_ unsigned int /* sizeof() */
#define _BSD_SSIZE_T_ int /* byte count or error */
#define _BSD_TIME_T_ long /* time() */
#define _BSD_CLOCKID_T_ int /* clockid_t */
#define _BSD_TIMER_T_ int /* timer_t */
#define _BSD_SUSECONDS_T_ long /* suseconds_t */
#define _BSD_USECONDS_T_ long /* useconds_t */
#define _BSD_WCHAR_T_ int /* wchar_t */
#define _BSD_WINT_T_ int /* wint_t */
#endif /* _ANSI_H_ */

View File

@@ -0,0 +1,7 @@
# $NetBSD: Makefile,v 1.9 2002/11/26 23:30:12 lukem Exp $
INCSDIR= /usr/include/arm/arm32
INCS= types.h vmparam.h
.include <bsd.kinc.mk>

View File

@@ -0,0 +1,53 @@
/* $NetBSD: types.h,v 1.9 2010/07/07 01:20:50 chs Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
* All rights reserved.
*
* Written by Jason R. Thorpe for Wasabi Systems, Inc.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed for the NetBSD Project by
* Wasabi Systems, Inc.
* 4. The name of Wasabi Systems, Inc. may not be used to endorse
* or promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
* 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.
*/
#ifndef _ARM_ARM32_TYPES_H_
#define _ARM_ARM32_TYPES_H_
#ifdef _KERNEL
#define __PROG32 /* indicate 32-bit mode */
#ifdef _KERNEL_OPT
#include "opt_arm32_pmap.h"
#endif
#endif
#include <arm/types.h> /* pull in generic ARM definitions */
#define __HAVE_CPU_LWP_SETPRIVATE
#endif /* _ARM_ARM32_TYPES_H_ */

View File

@@ -0,0 +1,12 @@
#ifndef _ARM_ARM32_VMPARAM_H_
#define _ARM_ARM32_VMPARAM_H_
/*
* Virtual Memory parameters common to all arm32 platforms.
*/
#define PAGE_SHIFT 12
#define PAGE_SIZE (1 << PAGE_SHIFT)
#define PAGE_MASK (PAGE_SIZE - 1)
#endif /* _ARM_ARM32_VMPARAM_H_ */

184
sys/arch/arm/include/asm.h Normal file
View File

@@ -0,0 +1,184 @@
/* $NetBSD: asm.h,v 1.16 2012/09/01 14:46:25 matt Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* 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.
* 3. 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: @(#)asm.h 5.5 (Berkeley) 5/7/91
*/
#ifndef _ARM32_ASM_H_
#define _ARM32_ASM_H_
#include <arm/cdefs.h>
#define __BIT(n) (1 << (n))
#define __BITS(hi,lo) ((~((~0)<<((hi)+1)))&((~0)<<(lo)))
#define _C_LABEL(x) x
#define _ASM_LABEL(x) x
#ifdef __STDC__
# define __CONCAT(x,y) x ## y
# define __STRING(x) #x
#else
# define __CONCAT(x,y) x/**/y
# define __STRING(x) "x"
#endif
#ifndef _ALIGN_TEXT
# define _ALIGN_TEXT .align 0
#endif
/*
* gas/arm uses @ as a single comment character and thus cannot be used here
* Instead it recognised the # instead of an @ symbols in .type directives
* We define a couple of macros so that assembly code will not be dependent
* on one or the other.
*/
#define _ASM_TYPE_FUNCTION %function
#define _ASM_TYPE_OBJECT %object
#ifdef __thumb__
#define _ENTRY(x) \
.text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; .thumb_func; x:
#else
#define _ENTRY(x) \
.text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x:
#endif
#define _END(x) .size x,.-x
#ifdef GPROF
# define _PROF_PROLOGUE \
mov ip, lr; bl __mcount
#else
# define _PROF_PROLOGUE
#endif
#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
#define ENTRY_NP(y) _ENTRY(_C_LABEL(y))
#define END(y) _END(_C_LABEL(y))
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
#define ASENTRY_NP(y) _ENTRY(_ASM_LABEL(y))
#define ASEND(y) _END(_ASM_LABEL(y))
#define ASMSTR .asciz
#if defined(PIC)
#ifdef __thumb__
#define PLT_SYM(x) x
#define GOT_SYM(x) PIC_SYM(x, GOTOFF)
#define GOT_GET(x,got,sym) \
ldr x, sym; \
add x, got; \
ldr x, [x]
#else
#define PLT_SYM(x) PIC_SYM(x, PLT)
#define GOT_SYM(x) PIC_SYM(x, GOT)
#define GOT_GET(x,got,sym) \
ldr x, sym; \
ldr x, [x, got]
#endif /* __thumb__ */
#define GOT_INIT(got,gotsym,pclabel) \
ldr got, gotsym; \
add got, got, pc; \
pclabel:
#define GOT_INITSYM(gotsym,pclabel) \
gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (pclabel+4))
#ifdef __STDC__
#define PIC_SYM(x,y) x ## ( ## y ## )
#else
#define PIC_SYM(x,y) x/**/(/**/y/**/)
#endif
#else
#define PLT_SYM(x) x
#define GOT_SYM(x) x
#define GOT_GET(x,got,sym) \
ldr x, sym;
#define GOT_INIT(got,gotsym,pclabel)
#define GOT_INITSYM(gotsym,pclabel)
#define PIC_SYM(x,y) x
#endif /* PIC */
#define RCSID(x) .pushsection ".ident"; .asciz x; .popsection
#define WEAK_ALIAS(alias,sym) \
.weak alias; \
alias = sym
/*
* STRONG_ALIAS: create a strong alias.
*/
#define STRONG_ALIAS(alias,sym) \
.globl alias; \
alias = sym
#ifdef __STDC__
#define WARN_REFERENCES(sym,msg) \
.pushsection .gnu.warning. ## sym; \
.ascii msg; \
.popsection
#else
#define WARN_REFERENCES(sym,msg) \
.pushsection .gnu.warning./**/sym; \
.ascii msg; \
.popsection
#endif /* __STDC__ */
#ifdef __thumb__
# define XPUSH push
# define XPOP pop
# define XPOPRET pop {pc}
#else
# define XPUSH stmfd sp!,
# define XPOP ldmfd sp!,
# ifdef _ARM_ARCH_5
# define XPOPRET ldmfd sp!, {pc}
# else
# define XPOPRET ldmfd sp!, {lr}; mov pc, lr
# endif
#endif
#if defined (_ARM_ARCH_4T)
# define RET bx lr
# define RETc(c) __CONCAT(bx,c) lr
#else
# define RET mov pc, lr
# define RETc(c) __CONCAT(mov,c) pc, lr
#endif
#ifdef __minix
#define IMPORT(sym) \
.extern _C_LABEL(sym)
#endif
#endif /* !_ARM_ASM_H_ */

View File

@@ -0,0 +1,11 @@
/* $NetBSD: bswap.h,v 1.4 2006/01/31 07:49:18 dsl Exp $ */
#ifndef _MACHINE_BSWAP_H_
#define _MACHINE_BSWAP_H_
#include <arm/byte_swap.h>
#define __BSWAP_RENAME
#include <sys/bswap.h>
#endif /* !_MACHINE_BSWAP_H_ */

View File

@@ -0,0 +1,120 @@
/* $NetBSD: byte_swap.h,v 1.12 2012/09/05 01:03:53 matt Exp $ */
/*-
* Copyright (c) 1997, 1999, 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Charles M. Hannum, Neil A. Carson, and Jason R. Thorpe.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _ARM_BYTE_SWAP_H_
#define _ARM_BYTE_SWAP_H_
#ifdef _LOCORE
#if defined(_ARM_ARCH_6) || defined(_ARM_ARCH_7)
#define BSWAP16(_src, _dst, _tmp) \
rev16 _dst, _src
#define BSWAP32(_src, _dst, _tmp) \
rev _dst, _src
#else
#define BSWAP16(_src, _dst, _tmp) \
mov _tmp, _src, ror #8 ;\
orr _tmp, _tmp, _tmp, lsr #16 ;\
bic _dst, _tmp, _tmp, lsl #16
#define BSWAP32(_src, _dst, _tmp) \
eor _tmp, _src, _src, ror #16 ;\
bic _tmp, _tmp, #0x00FF0000 ;\
mov _dst, _src, ror #8 ;\
eor _dst, _dst, _tmp, lsr #8
#endif
#else
#ifdef __GNUC__
#include <sys/types.h>
__BEGIN_DECLS
#define __BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
static __inline uint32_t
__byte_swap_u32_variable(uint32_t v)
{
uint32_t t1;
#ifdef _ARM_ARCH_6
if (!__builtin_constant_p(v)) {
__asm("rev\t%0, %1" : "=r" (v) : "0" (v));
return v;
}
#endif
t1 = v ^ ((v << 16) | (v >> 16));
t1 &= 0xff00ffffU;
v = (v >> 8) | (v << 24);
v ^= (t1 >> 8);
return (v);
}
#define __BYTE_SWAP_U16_VARIABLE __byte_swap_u16_variable
static __inline uint16_t
__byte_swap_u16_variable(uint16_t v)
{
#ifdef _ARM_ARCH_6
if (!__builtin_constant_p(v)) {
__asm("rev16\t%0, %1" : "=r" (v) : "0" (v));
return v;
}
#elif !defined(__thumb__) && 0 /* gcc produces decent code for this */
if (!__builtin_constant_p(v)) {
uint32_t v0 = v;
__asm volatile(
"mov %0, %1, ror #8\n"
"orr %0, %0, %0, lsr #16\n"
"bic %0, %0, %0, lsl #16"
: "=&r" (v0)
: "0" (v0));
return v0;
}
#endif
v &= 0xffff;
v = (v >> 8) | (v << 8);
return (v);
}
__END_DECLS
#endif
#endif /* _LOCORE */
#endif /* _ARM_BYTE_SWAP_H_ */

View File

@@ -0,0 +1,40 @@
/* $NetBSD: cdefs.h,v 1.7 2012/08/05 04:13:19 matt Exp $ */
#ifndef _MACHINE_CDEFS_H_
#define _MACHINE_CDEFS_H_
#if defined (__ARM_ARCH_7__) || defined (__ARM_ARCH_7A__) || \
defined (__ARM_ARCH_7R__) || defined (__ARM_ARCH_7M__) || \
defined (__ARM_ARCH_7EM__) /* 7R, 7M, 7EM are for non MMU arms */
#define _ARM_ARCH_7
#endif
#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6__) || \
defined (__ARM_ARCH_6J__) || defined (__ARM_ARCH_6K__) || \
defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__) || \
defined (__ARM_ARCH_6T2__) || defined (__ARM_ARCH_6ZM__)
#define _ARM_ARCH_6
#endif
#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5__) || \
defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5TE__) || \
defined (__ARM_ARCH_5TEJ__)
#define _ARM_ARCH_5
#endif
#if defined (_ARM_ARCH_5) || defined (__ARM_ARCH_4T__)
#define _ARM_ARCH_4T
#endif
#if defined(_ARM_ARCH_6) || defined (__ARM_ARCH_5TE__) || \
defined (__ARM_ARCH_5TEJ__)
#define _ARM_ARCH_DWORD_OK
#endif
#ifdef __ARM_EABI__
#define __ALIGNBYTES (8 - 1)
#else
#define __ALIGNBYTES (sizeof(int) - 1)
#endif
#endif /* !_MACHINE_CDEFS_H_ */

View File

@@ -0,0 +1,55 @@
#ifndef _ARM_CPU_H_
#define _ARM_CPU_H_
/* xPSR - Program Status Registers */
#define PSR_T (1 << 5) /* Thumb execution state bit */
#define PSR_F (1 << 6) /* FIQ mask bit */
#define PSR_I (1 << 7) /* IRQ mask bit */
#define PSR_A (1 << 8) /* Asynchronous abort mask bit */
#define PSR_E (1 << 9) /* Endianness execution state bit */
#define PSR_J (1 << 24) /* Jazelle bit */
#define PSR_Q (1 << 27) /* Cumulative saturation bit */
#define PSR_V (1 << 28) /* Overflow condition flag */
#define PSR_C (1 << 29) /* Carry condition flag */
#define PSR_Z (1 << 30) /* Zero condition flag */
#define PSR_N (1 << 31) /* Negative condition flag */
#define PSR_MODE_MASK 0x0000001F /* Mode field mask */
#define MODE_USR 0x10 /* User mode */
#define MODE_FIQ 0x11 /* FIQ mode */
#define MODE_IRQ 0x12 /* IRQ mode */
#define MODE_SVC 0x13 /* Supervisor mode */
#define MODE_MON 0x16 /* Monitor mode */
#define MODE_ABT 0x17 /* Abort mode */
#define MODE_HYP 0x1A /* Hyp mode */
#define MODE_UND 0x1B /* Undefined mode */
#define MODE_SYS 0x1F /* System mode */
/* SCTLR - System Control Register */
#define SCTLR_M (1 << 0) /* MMU enable */
#define SCTLR_A (1 << 1) /* Alignment check enable */
#define SCTLR_C (1 << 2) /* Data and Unified Cache enable */
#define SCTLR_CP15BEN (1 << 5) /* CP15 barrier enable */
#define SCTLR_SW (1 << 10) /* SWP and SWPB enable */
#define SCTLR_Z (1 << 11) /* Branch prediction enable */
#define SCTLR_I (1 << 12) /* Instruction cache enable */
#define SCTLR_V (1 << 13) /* (High) Vectors bit */
#define SCTLR_RR (1 << 14) /* Round Robin (cache) select */
#define SCTLR_HA (1 << 17) /* Hardware Access flag enable */
#define SCTLR_FI (1 << 21) /* Fast interrupts configuration enable */
#define SCTLR_VE (1 << 24) /* Interrupt Vectors Enable */
#define SCTLR_EE (1 << 25) /* Exception Endianness */
#define SCTLR_NMFI (1 << 27) /* Non-maskable FIQ (NMFI) support */
#define SCTLR_TRE (1 << 28) /* TEX remap enable */
#define SCTLR_AFE (1 << 29) /* Access flag enable */
#define SCTLR_TE (1 << 30) /* Thumb Exception enable */
/* ACTLR - Auxiliary Control Register */
#define A8_ACTLR_L1ALIAS (1 << 0) /* L1 Dcache hw alias check enable */
#define A8_ACTLR_L2EN (1 << 1) /* L2 cache enable */
#define A8_ACTLR_L1RSTDIS (1 << 30) /* L1 hw reset disable */
#define A8_ACTLR_L2RSTDIS (1 << 31) /* L2 hw reset disable */
#endif /* _ARM_CPU_H_ */

View File

@@ -0,0 +1,86 @@
/* $NetBSD: disklabel.h,v 1.10 2011/08/30 12:39:53 bouyer Exp $ */
/*
* Copyright (c) 1994 Mark Brinicombe.
* Copyright (c) 1994 Brini.
* All rights reserved.
*
* This code is derived from software written for Brini by Mark Brinicombe
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Brini.
* 4. The name of the company nor the name of the author may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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.
*
* RiscBSD kernel project
*
* disklabel.h
*
* machine specific disk label info
*
* Created : 04/10/94
*/
#ifndef _ARM_DISKLABEL_H_
#define _ARM_DISKLABEL_H_
#ifndef LABELUSESMBR
#define LABELUSESMBR 0 /* no MBR partitionning */
#endif
#define LABELSECTOR 1 /* sector containing label */
#define LABELOFFSET 0 /* offset of label in sector */
#define MAXPARTITIONS 8 /* number of partitions */
#define RAW_PART 2 /* raw partition: XX?c */
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#include <nbinclude/sys/disklabel_acorn.h>
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/dkbad.h>
#include <sys/disklabel_acorn.h>
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition mbrparts[MBR_PART_COUNT];
#define __HAVE_DISKLABEL_DKBAD
struct dkbad bad;
};
#ifdef _KERNEL
struct buf;
struct disklabel;
/* for readdisklabel. rv != 0 -> matches, msg == NULL -> success */
int mbr_label_read(dev_t, void (*)(struct buf *), struct disklabel *,
struct cpu_disklabel *, const char **, int *, int *);
/* for writedisklabel. rv == 0 -> dosen't match, rv > 0 -> success */
int mbr_label_locate(dev_t, void (*)(struct buf *),
struct disklabel *, struct cpu_disklabel *, int *, int *);
#endif /* _KERNEL */
#endif /* _ARM_DISKLABEL_H_ */

View File

@@ -0,0 +1,138 @@
/* $NetBSD: elf_machdep.h,v 1.10 2012/08/05 04:12:46 matt Exp $ */
#ifndef _ARM_ELF_MACHDEP_H_
#define _ARM_ELF_MACHDEP_H_
#if defined(__ARMEB__)
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
#else
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
#endif
#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
#define ELF64_MACHDEP_ID_CASES \
/* no 64-bit ELF machine types supported */
/* Processor specific flags for the ELF header e_flags field. */
#define EF_ARM_RELEXEC 0x00000001
#define EF_ARM_HASENTRY 0x00000002
#define EF_ARM_INTERWORK 0x00000004 /* GNU binutils 000413 */
#define EF_ARM_SYMSARESORTED 0x00000004 /* ARM ELF A08 */
#define EF_ARM_APCS_26 0x00000008 /* GNU binutils 000413 */
#define EF_ARM_DYNSYMSUSESEGIDX 0x00000008 /* ARM ELF B01 */
#define EF_ARM_APCS_FLOAT 0x00000010 /* GNU binutils 000413 */
#define EF_ARM_MAPSYMSFIRST 0x00000010 /* ARM ELF B01 */
#define EF_ARM_PIC 0x00000020
#define EF_ARM_ALIGN8 0x00000040 /* 8-bit structure alignment. */
#define EF_ARM_NEW_ABI 0x00000080
#define EF_ARM_OLD_ABI 0x00000100
#define EF_ARM_SOFT_FLOAT 0x00000200
#define EF_ARM_EABIMASK 0xff000000
#define EF_ARM_EABI_VER1 0x01000000
#define EF_ARM_EABI_VER2 0x02000000
#define EF_ARM_EABI_VER3 0x03000000
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
#define ELF32_MACHDEP_ID_CASES \
case EM_ARM: \
break;
#define ELF32_MACHDEP_ID EM_ARM
#define ARCH_ELFSIZE 32 /* MD native binary size */
/* Processor specific relocation types */
#define R_ARM_NONE 0
#define R_ARM_PC24 1
#define R_ARM_ABS32 2
#define R_ARM_REL32 3
#define R_ARM_PC13 4
#define R_ARM_ABS16 5
#define R_ARM_ABS12 6
#define R_ARM_THM_ABS5 7
#define R_ARM_ABS8 8
#define R_ARM_SBREL32 9
#define R_ARM_THM_PC22 10
#define R_ARM_THM_PC8 11
#define R_ARM_AMP_VCALL9 12
#define R_ARM_SWI24 13
#define R_ARM_THM_SWI8 14
#define R_ARM_XPC25 15
#define R_ARM_THM_XPC22 16
/* TLS relocations */
#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */
#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */
#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */
/* 20-31 are reserved for ARM Linux. */
#define R_ARM_COPY 20
#define R_ARM_GLOB_DAT 21
#define R_ARM_JUMP_SLOT 22
#define R_ARM_RELATIVE 23
#define R_ARM_GOTOFF 24
#define R_ARM_GOTPC 25
#define R_ARM_GOT32 26
#define R_ARM_PLT32 27
#define R_ARM_ALU_PCREL_7_0 32
#define R_ARM_ALU_PCREL_15_8 33
#define R_ARM_ALU_PCREL_23_15 34
#define R_ARM_ALU_SBREL_11_0 35
#define R_ARM_ALU_SBREL_19_12 36
#define R_ARM_ALU_SBREL_27_20 37
/* 96-111 are reserved to G++. */
#define R_ARM_GNU_VTENTRY 100
#define R_ARM_GNU_VTINHERIT 101
#define R_ARM_THM_PC11 102
#define R_ARM_THM_PC9 103
/* More TLS relocations */
#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic */
#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic */
#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS */
#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of */
#define R_ARM_TLS_LE32 108
#define R_ARM_TLS_LDO12 109
#define R_ARM_TLS_LE12 110
#define R_ARM_TLS_IE12GP 111
/* 112-127 are reserved for private experiments. */
#define R_ARM_RXPC25 249
#define R_ARM_RSBREL32 250
#define R_ARM_THM_RPC22 251
#define R_ARM_RREL32 252
#define R_ARM_RABS32 253
#define R_ARM_RPC24 254
#define R_ARM_RBASE 255
#define R_TYPE(name) __CONCAT(R_ARM_,name)
/* Processor specific program header flags */
#define PF_ARM_SB 0x10000000
#define PF_ARM_PI 0x20000000
#define PF_ARM_ENTRY 0x80000000
/* Processor specific section header flags */
#define SHF_ENTRYSECT 0x10000000
#define SHF_COMDEF 0x80000000
/* Processor specific symbol types */
#define STT_ARM_TFUNC STT_LOPROC
#ifdef _KERNEL
#ifdef ELFSIZE
#define ELF_MD_PROBE_FUNC ELFNAME2(arm_netbsd,probe)
#endif
struct exec_package;
int arm_netbsd_elf32_probe(struct lwp *, struct exec_package *, void *, char *,
vaddr_t *);
#endif
#endif /* _ARM_ELF_MACHDEP_H_ */

View File

@@ -0,0 +1,3 @@
/* $NetBSD: endian.h,v 1.3 2001/06/23 12:20:27 bjh21 Exp $ */
#include <sys/endian.h>

View File

@@ -0,0 +1,8 @@
/* $NetBSD: endian_machdep.h,v 1.8 2006/01/30 21:52:38 dsl Exp $ */
/* GCC predefines __ARMEB__ when building for big-endian ARM. */
#ifdef __ARMEB__
#define _BYTE_ORDER _BIG_ENDIAN
#else
#define _BYTE_ORDER _LITTLE_ENDIAN
#endif

View File

@@ -0,0 +1,31 @@
/* $NetBSD: float.h,v 1.6 2005/12/11 12:16:47 christos Exp $ */
#ifndef _ARM_FLOAT_H_
#define _ARM_FLOAT_H_
#ifndef __VFP_FP__
#define LDBL_MANT_DIG 64
#define LDBL_EPSILON 1.0842021724855044340E-19L
#define LDBL_DIG 18
#define LDBL_MIN_EXP (-16381)
#define LDBL_MIN 1.6810515715560467531E-4932L
#define LDBL_MIN_10_EXP (-4931)
#define LDBL_MAX_EXP 16384
#define LDBL_MAX 1.1897314953572317650E+4932L
#define LDBL_MAX_10_EXP 4932
#endif
#include <sys/float_ieee754.h>
#ifndef __VFP_FP__
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
!defined(_XOPEN_SOURCE) || \
((__STDC_VERSION__ - 0) >= 199901L) || \
((_POSIX_C_SOURCE - 0) >= 200112L) || \
((_XOPEN_SOURCE - 0) >= 600) || \
defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
#define DECIMAL_DIG 21
#endif /* !defined(_ANSI_SOURCE) && ... */
#endif /* !__VFP_FP__ */
#endif /* !_ARM_FLOAT_H_ */

View File

@@ -0,0 +1,13 @@
/* $NetBSD: ieee.h,v 1.9 2005/12/11 12:16:47 christos Exp $ */
#include <sys/ieee754.h>
/*
* A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its
* high fraction; if the bit is set, it is a `quiet NaN'.
*/
#if 0
#define SNG_QUIETNAN (1 << 22)
#define DBL_QUIETNAN (1 << 19)
#endif

View File

@@ -0,0 +1,58 @@
/* $NetBSD: ieeefp.h,v 1.2 2008/08/05 16:47:41 matt Exp $ */
/*
* Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995
* Public domain.
*/
#ifndef _ARM32_IEEEFP_H_
#define _ARM32_IEEEFP_H_
#include <sys/featuretest.h>
#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
typedef int fenv_t;
typedef int fexcept_t;
#define FE_INVALID 0x01 /* invalid operation exception */
#define FE_DIVBYZERO 0x02 /* divide-by-zero exception */
#define FE_OVERFLOW 0x04 /* overflow exception */
#define FE_UNDERFLOW 0x08 /* underflow exception */
#define FE_INEXACT 0x10 /* imprecise (loss of precision; "inexact") */
#define FE_ALL_EXCEPT 0x1f
#define FE_TONEAREST 0 /* round to nearest representable number */
#define FE_UPWARD 1 /* round toward positive infinity */
#define FE_DOWNWARD 2 /* round toward negative infinity */
#define FE_TOWARDZERO 3 /* round to zero (truncate) */
#if !defined(_ISOC99_SOURCE)
/* Exception type (used by fpsetmask() et al.) */
typedef int fp_except;
/* Bit defines for fp_except */
#define FP_X_INV FE_INVALID /* invalid operation exception */
#define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */
#define FP_X_OFL FE_OVERFLOW /* overflow exception */
#define FP_X_UFL FE_UNDERFLOW /* underflow exception */
#define FP_X_IMP FE_INEXACT /* imprecise (prec. loss; "inexact") */
/* Rounding modes */
typedef enum {
FP_RN=FE_TONEAREST, /* round to nearest representable number */
FP_RP=FE_UPWARD, /* round toward positive infinity */
FP_RM=FE_DOWNWARD, /* round toward negative infinity */
FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */
} fp_rnd;
#endif /* !_ISOC99_SOURCE */
#endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
#endif /* _ARM32_IEEEFP_H_ */

View File

@@ -0,0 +1,56 @@
/* $NetBSD: int_const.h,v 1.3 2010/05/29 17:33:57 tnozaki Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _ARM_INT_CONST_H_
#define _ARM_INT_CONST_H_
/*
* 7.18.4 Macros for integer constants
*/
/* 7.18.4.1 Macros for minimum-width integer constants */
#define INT8_C(c) c
#define INT16_C(c) c
#define INT32_C(c) c
#define INT64_C(c) c ## LL
#define UINT8_C(c) c
#define UINT16_C(c) c
#define UINT32_C(c) c ## U
#define UINT64_C(c) c ## ULL
/* 7.18.4.2 Macros for greatest-width integer constants */
#define INTMAX_C(c) c ## LL
#define UINTMAX_C(c) c ## ULL
#endif /* !_ARM_INT_CONST_H_ */

View File

@@ -0,0 +1,212 @@
/* $NetBSD: int_fmtio.h,v 1.5 2008/08/29 19:08:29 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _ARM_INT_FMTIO_H_
#define _ARM_INT_FMTIO_H_
/*
* 7.8.1 Macros for format specifiers
*/
/* fprintf macros for signed integers */
#define PRId8 "d" /* int8_t */
#define PRId16 "d" /* int16_t */
#define PRId32 "d" /* int32_t */
#define PRId64 "lld" /* int64_t */
#define PRIdLEAST8 "d" /* int_least8_t */
#define PRIdLEAST16 "d" /* int_least16_t */
#define PRIdLEAST32 "d" /* int_least32_t */
#define PRIdLEAST64 "lld" /* int_least64_t */
#define PRIdFAST8 "d" /* int_fast8_t */
#define PRIdFAST16 "d" /* int_fast16_t */
#define PRIdFAST32 "d" /* int_fast32_t */
#define PRIdFAST64 "lld" /* int_fast64_t */
#define PRIdMAX "lld" /* intmax_t */
#define PRIdPTR "ld" /* intptr_t */
#define PRIi8 "i" /* int8_t */
#define PRIi16 "i" /* int16_t */
#define PRIi32 "i" /* int32_t */
#define PRIi64 "lli" /* int64_t */
#define PRIiLEAST8 "i" /* int_least8_t */
#define PRIiLEAST16 "i" /* int_least16_t */
#define PRIiLEAST32 "i" /* int_least32_t */
#define PRIiLEAST64 "lli" /* int_least64_t */
#define PRIiFAST8 "i" /* int_fast8_t */
#define PRIiFAST16 "i" /* int_fast16_t */
#define PRIiFAST32 "i" /* int_fast32_t */
#define PRIiFAST64 "lli" /* int_fast64_t */
#define PRIiMAX "lli" /* intmax_t */
#define PRIiPTR "li" /* intptr_t */
/* fprintf macros for unsigned integers */
#define PRIo8 "o" /* uint8_t */
#define PRIo16 "o" /* uint16_t */
#define PRIo32 "o" /* uint32_t */
#define PRIo64 "llo" /* uint64_t */
#define PRIoLEAST8 "o" /* uint_least8_t */
#define PRIoLEAST16 "o" /* uint_least16_t */
#define PRIoLEAST32 "o" /* uint_least32_t */
#define PRIoLEAST64 "llo" /* uint_least64_t */
#define PRIoFAST8 "o" /* uint_fast8_t */
#define PRIoFAST16 "o" /* uint_fast16_t */
#define PRIoFAST32 "o" /* uint_fast32_t */
#define PRIoFAST64 "llo" /* uint_fast64_t */
#define PRIoMAX "llo" /* uintmax_t */
#define PRIoPTR "lo" /* uintptr_t */
#define PRIu8 "u" /* uint8_t */
#define PRIu16 "u" /* uint16_t */
#define PRIu32 "u" /* uint32_t */
#define PRIu64 "llu" /* uint64_t */
#define PRIuLEAST8 "u" /* uint_least8_t */
#define PRIuLEAST16 "u" /* uint_least16_t */
#define PRIuLEAST32 "u" /* uint_least32_t */
#define PRIuLEAST64 "llu" /* uint_least64_t */
#define PRIuFAST8 "u" /* uint_fast8_t */
#define PRIuFAST16 "u" /* uint_fast16_t */
#define PRIuFAST32 "u" /* uint_fast32_t */
#define PRIuFAST64 "llu" /* uint_fast64_t */
#define PRIuMAX "llu" /* uintmax_t */
#define PRIuPTR "lu" /* uintptr_t */
#define PRIx8 "x" /* uint8_t */
#define PRIx16 "x" /* uint16_t */
#define PRIx32 "x" /* uint32_t */
#define PRIx64 "llx" /* uint64_t */
#define PRIxLEAST8 "x" /* uint_least8_t */
#define PRIxLEAST16 "x" /* uint_least16_t */
#define PRIxLEAST32 "x" /* uint_least32_t */
#define PRIxLEAST64 "llx" /* uint_least64_t */
#define PRIxFAST8 "x" /* uint_fast8_t */
#define PRIxFAST16 "x" /* uint_fast16_t */
#define PRIxFAST32 "x" /* uint_fast32_t */
#define PRIxFAST64 "llx" /* uint_fast64_t */
#define PRIxMAX "llx" /* uintmax_t */
#define PRIxPTR "lx" /* uintptr_t */
#define PRIX8 "X" /* uint8_t */
#define PRIX16 "X" /* uint16_t */
#define PRIX32 "X" /* uint32_t */
#define PRIX64 "llX" /* uint64_t */
#define PRIXLEAST8 "X" /* uint_least8_t */
#define PRIXLEAST16 "X" /* uint_least16_t */
#define PRIXLEAST32 "X" /* uint_least32_t */
#define PRIXLEAST64 "llX" /* uint_least64_t */
#define PRIXFAST8 "X" /* uint_fast8_t */
#define PRIXFAST16 "X" /* uint_fast16_t */
#define PRIXFAST32 "X" /* uint_fast32_t */
#define PRIXFAST64 "llX" /* uint_fast64_t */
#define PRIXMAX "llX" /* uintmax_t */
#define PRIXPTR "lX" /* uintptr_t */
/* fscanf macros for signed integers */
#define SCNd8 "hhd" /* int8_t */
#define SCNd16 "hd" /* int16_t */
#define SCNd32 "d" /* int32_t */
#define SCNd64 "lld" /* int64_t */
#define SCNdLEAST8 "hhd" /* int_least8_t */
#define SCNdLEAST16 "hd" /* int_least16_t */
#define SCNdLEAST32 "d" /* int_least32_t */
#define SCNdLEAST64 "lld" /* int_least64_t */
#define SCNdFAST8 "d" /* int_fast8_t */
#define SCNdFAST16 "d" /* int_fast16_t */
#define SCNdFAST32 "d" /* int_fast32_t */
#define SCNdFAST64 "lld" /* int_fast64_t */
#define SCNdMAX "lld" /* intmax_t */
#define SCNdPTR "ld" /* intptr_t */
#define SCNi8 "hhi" /* int8_t */
#define SCNi16 "hi" /* int16_t */
#define SCNi32 "i" /* int32_t */
#define SCNi64 "lli" /* int64_t */
#define SCNiLEAST8 "hhi" /* int_least8_t */
#define SCNiLEAST16 "hi" /* int_least16_t */
#define SCNiLEAST32 "i" /* int_least32_t */
#define SCNiLEAST64 "lli" /* int_least64_t */
#define SCNiFAST8 "i" /* int_fast8_t */
#define SCNiFAST16 "i" /* int_fast16_t */
#define SCNiFAST32 "i" /* int_fast32_t */
#define SCNiFAST64 "lli" /* int_fast64_t */
#define SCNiMAX "lli" /* intmax_t */
#define SCNiPTR "li" /* intptr_t */
/* fscanf macros for unsigned integers */
#define SCNo8 "hho" /* uint8_t */
#define SCNo16 "ho" /* uint16_t */
#define SCNo32 "o" /* uint32_t */
#define SCNo64 "llo" /* uint64_t */
#define SCNoLEAST8 "hho" /* uint_least8_t */
#define SCNoLEAST16 "ho" /* uint_least16_t */
#define SCNoLEAST32 "o" /* uint_least32_t */
#define SCNoLEAST64 "llo" /* uint_least64_t */
#define SCNoFAST8 "o" /* uint_fast8_t */
#define SCNoFAST16 "o" /* uint_fast16_t */
#define SCNoFAST32 "o" /* uint_fast32_t */
#define SCNoFAST64 "llo" /* uint_fast64_t */
#define SCNoMAX "llo" /* uintmax_t */
#define SCNoPTR "lo" /* uintptr_t */
#define SCNu8 "hhu" /* uint8_t */
#define SCNu16 "hu" /* uint16_t */
#define SCNu32 "u" /* uint32_t */
#define SCNu64 "llu" /* uint64_t */
#define SCNuLEAST8 "hhu" /* uint_least8_t */
#define SCNuLEAST16 "hu" /* uint_least16_t */
#define SCNuLEAST32 "u" /* uint_least32_t */
#define SCNuLEAST64 "llu" /* uint_least64_t */
#define SCNuFAST8 "u" /* uint_fast8_t */
#define SCNuFAST16 "u" /* uint_fast16_t */
#define SCNuFAST32 "u" /* uint_fast32_t */
#define SCNuFAST64 "llu" /* uint_fast64_t */
#define SCNuMAX "llu" /* uintmax_t */
#define SCNuPTR "lu" /* uintptr_t */
#define SCNx8 "hhx" /* uint8_t */
#define SCNx16 "hx" /* uint16_t */
#define SCNx32 "x" /* uint32_t */
#define SCNx64 "llx" /* uint64_t */
#define SCNxLEAST8 "hhx" /* uint_least8_t */
#define SCNxLEAST16 "hx" /* uint_least16_t */
#define SCNxLEAST32 "x" /* uint_least32_t */
#define SCNxLEAST64 "llx" /* uint_least64_t */
#define SCNxFAST8 "x" /* uint_fast8_t */
#define SCNxFAST16 "x" /* uint_fast16_t */
#define SCNxFAST32 "x" /* uint_fast32_t */
#define SCNxFAST64 "llx" /* uint_fast64_t */
#define SCNxMAX "llx" /* uintmax_t */
#define SCNxPTR "lx" /* uintptr_t */
#endif /* !_ARM_INT_FMTIO_H_ */

View File

@@ -0,0 +1,127 @@
/* $NetBSD: int_limits.h,v 1.9 2008/08/29 19:08:29 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _ARM_INT_LIMITS_H_
#define _ARM_INT_LIMITS_H_
/*
* 7.18.2 Limits of specified-width integer types
*/
/* 7.18.2.1 Limits of exact-width integer types */
/* minimum values of exact-width signed integer types */
#define INT8_MIN (-0x7f-1) /* int8_t */
#define INT16_MIN (-0x7fff-1) /* int16_t */
#define INT32_MIN (-0x7fffffff-1) /* int32_t */
#define INT64_MIN (-0x7fffffffffffffffLL-1) /* int64_t */
/* maximum values of exact-width signed integer types */
#define INT8_MAX 0x7f /* int8_t */
#define INT16_MAX 0x7fff /* int16_t */
#define INT32_MAX 0x7fffffff /* int32_t */
#define INT64_MAX 0x7fffffffffffffffLL /* int64_t */
/* maximum values of exact-width unsigned integer types */
#define UINT8_MAX 0xff /* uint8_t */
#define UINT16_MAX 0xffff /* uint16_t */
#define UINT32_MAX 0xffffffffU /* uint32_t */
#define UINT64_MAX 0xffffffffffffffffULL /* uint64_t */
/* 7.18.2.2 Limits of minimum-width integer types */
/* minimum values of minimum-width signed integer types */
#define INT_LEAST8_MIN (-0x7f-1) /* int_least8_t */
#define INT_LEAST16_MIN (-0x7fff-1) /* int_least16_t */
#define INT_LEAST32_MIN (-0x7fffffff-1) /* int_least32_t */
#define INT_LEAST64_MIN (-0x7fffffffffffffffLL-1) /* int_least64_t */
/* maximum values of minimum-width signed integer types */
#define INT_LEAST8_MAX 0x7f /* int_least8_t */
#define INT_LEAST16_MAX 0x7fff /* int_least16_t */
#define INT_LEAST32_MAX 0x7fffffff /* int_least32_t */
#define INT_LEAST64_MAX 0x7fffffffffffffffLL /* int_least64_t */
/* maximum values of minimum-width unsigned integer types */
#define UINT_LEAST8_MAX 0xff /* uint_least8_t */
#define UINT_LEAST16_MAX 0xffff /* uint_least16_t */
#define UINT_LEAST32_MAX 0xffffffffU /* uint_least32_t */
#define UINT_LEAST64_MAX 0xffffffffffffffffULL /* uint_least64_t */
/* 7.18.2.3 Limits of fastest minimum-width integer types */
/* minimum values of fastest minimum-width signed integer types */
#define INT_FAST8_MIN (-0x7fffffff-1) /* int_fast8_t */
#define INT_FAST16_MIN (-0x7fffffff-1) /* int_fast16_t */
#define INT_FAST32_MIN (-0x7fffffff-1) /* int_fast32_t */
#define INT_FAST64_MIN (-0x7fffffffffffffffLL-1) /* int_fast64_t */
/* maximum values of fastest minimum-width signed integer types */
#define INT_FAST8_MAX 0x7fffffff /* int_fast8_t */
#define INT_FAST16_MAX 0x7fffffff /* int_fast16_t */
#define INT_FAST32_MAX 0x7fffffff /* int_fast32_t */
#define INT_FAST64_MAX 0x7fffffffffffffffLL /* int_fast64_t */
/* maximum values of fastest minimum-width unsigned integer types */
#define UINT_FAST8_MAX 0xffffffffU /* uint_fast8_t */
#define UINT_FAST16_MAX 0xffffffffU /* uint_fast16_t */
#define UINT_FAST32_MAX 0xffffffffU /* uint_fast32_t */
#define UINT_FAST64_MAX 0xffffffffffffffffULL /* uint_fast64_t */
/* 7.18.2.4 Limits of integer types capable of holding object pointers */
#define INTPTR_MIN (-0x7fffffffL-1) /* intptr_t */
#define INTPTR_MAX 0x7fffffffL /* intptr_t */
#define UINTPTR_MAX 0xffffffffUL /* uintptr_t */
/* 7.18.2.5 Limits of greatest-width integer types */
#define INTMAX_MIN (-0x7fffffffffffffffLL-1) /* intmax_t */
#define INTMAX_MAX 0x7fffffffffffffffLL /* intmax_t */
#define UINTMAX_MAX 0xffffffffffffffffULL /* uintmax_t */
/*
* 7.18.3 Limits of other integer types
*/
/* limits of ptrdiff_t */
#define PTRDIFF_MIN (-0x7fffffffL-1) /* ptrdiff_t */
#define PTRDIFF_MAX 0x7fffffffL /* ptrdiff_t */
/* limits of sig_atomic_t */
#define SIG_ATOMIC_MIN (-0x7fffffff-1) /* sig_atomic_t */
#define SIG_ATOMIC_MAX 0x7fffffff /* sig_atomic_t */
/* limit of size_t */
#define SIZE_MAX 0xffffffffUL /* size_t */
#endif /* !_ARM_INT_LIMITS_H_ */

View File

@@ -0,0 +1,86 @@
/* $NetBSD: int_mwgwtypes.h,v 1.4 2008/04/28 20:23:14 martin Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _ARM_INT_MWGWTYPES_H_
#define _ARM_INT_MWGWTYPES_H_
/*
* 7.18.1 Integer types
*/
/* 7.18.1.2 Minimum-width integer types */
typedef signed char int_least8_t;
typedef unsigned char uint_least8_t;
typedef short int int_least16_t;
typedef unsigned short int uint_least16_t;
typedef int int_least32_t;
typedef unsigned int uint_least32_t;
#ifdef __COMPILER_INT64__
typedef __COMPILER_INT64__ int_least64_t;
typedef __COMPILER_UINT64__ uint_least64_t;
#else
/* LONGLONG */
typedef long long int int_least64_t;
/* LONGLONG */
typedef unsigned long long int uint_least64_t;
#endif
/* 7.18.1.3 Fastest minimum-width integer types */
typedef int int_fast8_t;
typedef unsigned int uint_fast8_t;
typedef int int_fast16_t;
typedef unsigned int uint_fast16_t;
typedef int int_fast32_t;
typedef unsigned int uint_fast32_t;
#ifdef __COMPILER_INT64__
typedef __COMPILER_INT64__ int_fast64_t;
typedef __COMPILER_UINT64__ uint_fast64_t;
#else
/* LONGLONG */
typedef long long int int_fast64_t;
/* LONGLONG */
typedef unsigned long long int uint_fast64_t;
#endif
/* 7.18.1.5 Greatest-width integer types */
#ifdef __COMPILER_INT64__
typedef __COMPILER_INT64__ intmax_t;
typedef __COMPILER_UINT64__ uintmax_t;
#else
/* LONGLONG */
typedef long long int intmax_t;
/* LONGLONG */
typedef unsigned long long int uintmax_t;
#endif
#endif /* !_ARM_INT_MWGWTYPES_H_ */

View File

@@ -0,0 +1,68 @@
/* $NetBSD: int_types.h,v 1.9 2008/08/29 19:08:29 matt Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* 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.
* 3. 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: @(#)types.h 7.5 (Berkeley) 3/9/91
*/
#ifndef _ARM32_INT_TYPES_H_
#define _ARM32_INT_TYPES_H_
#include <sys/cdefs.h>
/*
* 7.18.1 Integer types
*/
/* 7.18.1.1 Exact-width integer types */
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short int __int16_t;
typedef unsigned short int __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
#ifdef __COMPILER_INT64__
typedef __COMPILER_INT64__ __int64_t;
typedef __COMPILER_UINT64__ __uint64_t;
#else
/* LONGLONG */
typedef long long int __int64_t;
/* LONGLONG */
typedef unsigned long long int __uint64_t;
#endif
#define __BIT_TYPES_DEFINED__
/* 7.18.1.4 Integer types capable of holding object pointers */
typedef long int __intptr_t;
typedef unsigned long int __uintptr_t;
#endif /* !_ARM32_INT_TYPES_H_ */

View File

@@ -0,0 +1,91 @@
/* $NetBSD: limits.h,v 1.12 2012/03/28 17:03:28 christos Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
* All rights reserved.
*
* 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.
* 3. 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: @(#)limits.h 7.2 (Berkeley) 6/28/90
*/
#ifndef _ARM32_LIMITS_H_
#define _ARM32_LIMITS_H_
#include <sys/featuretest.h>
#define CHAR_BIT 8 /* number of bits in a char */
#define UCHAR_MAX 0xff /* max value for an unsigned char */
#define SCHAR_MAX 0x7f /* max value for a signed char */
#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */
#define USHRT_MAX 0xffff /* max value for an unsigned short */
#define SHRT_MAX 0x7fff /* max value for a short */
#define SHRT_MIN (-0x7fff-1) /* min value for a short */
#define UINT_MAX 0xffffffffU /* max value for an unsigned int */
#define INT_MAX 0x7fffffff /* max value for an int */
#define INT_MIN (-0x7fffffff-1) /* min value for an int */
#define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */
#define LONG_MAX 0x7fffffffL /* max value for a long */
#define LONG_MIN (-0x7fffffffL-1) /* min value for a long */
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(_NETBSD_SOURCE)
#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */
#if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
defined(_NETBSD_SOURCE)
#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */
#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
#endif
#if defined(_NETBSD_SOURCE)
#define SIZE_T_MAX LONG_MAX /* max value for a size_t */
#define UQUAD_MAX 0xffffffffffffffffULL /* max unsigned quad */
#define QUAD_MAX 0x7fffffffffffffffLL /* max signed quad */
#define QUAD_MIN (-0x7fffffffffffffffLL-1) /* min signed quad */
#endif /* _NETBSD_SOURCE */
#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#define LONG_BIT 32
#define WORD_BIT 32
#define DBL_DIG 15
#define DBL_MAX 1.7976931348623157E+308
#define DBL_MIN 2.2250738585072014E-308
#define FLT_DIG 6
#define FLT_MAX 3.40282347E+38F
#define FLT_MIN 1.17549435E-38F
#endif
#endif /* _ARM32_LIMITS_H_ */

134
sys/arch/arm/include/lock.h Normal file
View File

@@ -0,0 +1,134 @@
/* $NetBSD: lock.h,v 1.21 2012/08/31 17:29:08 matt Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
/*
* Machine-dependent spin lock operations.
*
* NOTE: The SWP insn used here is available only on ARM architecture
* version 3 and later (as well as 2a). What we are going to do is
* expect that the kernel will trap and emulate the insn. That will
* be slow, but give us the atomicity that we need.
*/
#ifndef _ARM_LOCK_H_
#define _ARM_LOCK_H_
static __inline int
__SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr)
{
return *__ptr == __SIMPLELOCK_LOCKED;
}
static __inline int
__SIMPLELOCK_UNLOCKED_P(__cpu_simple_lock_t *__ptr)
{
return *__ptr == __SIMPLELOCK_UNLOCKED;
}
static __inline void
__cpu_simple_lock_clear(__cpu_simple_lock_t *__ptr)
{
*__ptr = __SIMPLELOCK_UNLOCKED;
}
static __inline void
__cpu_simple_lock_set(__cpu_simple_lock_t *__ptr)
{
*__ptr = __SIMPLELOCK_LOCKED;
}
#ifdef _KERNEL
#include <arm/cpufunc.h>
#define mb_read drain_writebuf /* in cpufunc.h */
#define mb_write drain_writebuf /* in cpufunc.h */
#define mb_memory drain_writebuf /* in cpufunc.h */
#endif
#if defined(_KERNEL)
static __inline int
__swp(int __val, volatile unsigned char *__ptr)
{
__asm volatile("swpb %0, %1, [%2]"
: "=&r" (__val) : "r" (__val), "r" (__ptr) : "memory");
return __val;
}
#else
static __inline int
__swp(int __val, volatile int *__ptr)
{
__asm volatile("swp %0, %1, [%2]"
: "=&r" (__val) : "r" (__val), "r" (__ptr) : "memory");
return __val;
}
#endif /* _KERNEL */
static __inline void __attribute__((__unused__))
__cpu_simple_lock_init(__cpu_simple_lock_t *alp)
{
*alp = __SIMPLELOCK_UNLOCKED;
#ifdef _ARM_ARCH_7
__asm __volatile("dsb");
#endif
}
static __inline void __attribute__((__unused__))
__cpu_simple_lock(__cpu_simple_lock_t *alp)
{
while (__swp(__SIMPLELOCK_LOCKED, alp) != __SIMPLELOCK_UNLOCKED)
continue;
}
static __inline int __attribute__((__unused__))
__cpu_simple_lock_try(__cpu_simple_lock_t *alp)
{
return (__swp(__SIMPLELOCK_LOCKED, alp) == __SIMPLELOCK_UNLOCKED);
}
static __inline void __attribute__((__unused__))
__cpu_simple_unlock(__cpu_simple_lock_t *alp)
{
#ifdef _ARM_ARCH_7
__asm __volatile("dmb");
#endif
*alp = __SIMPLELOCK_UNLOCKED;
#ifdef _ARM_ARCH_7
__asm __volatile("dsb");
#endif
}
#endif /* _ARM_LOCK_H_ */

View File

@@ -0,0 +1,3 @@
/* $NetBSD: math.h,v 1.2 2002/02/19 13:08:14 simonb Exp $ */
#define __HAVE_NANF

View File

@@ -0,0 +1,19 @@
#ifndef _MACHINE_MCONTEXT_H
#define _MACHINE_MCONTEXT_H
#include <machine/stackframe.h>
#define MCF_MAGIC 0xc0ffee
/* Context to describe processor state */
typedef struct __mcontext {
int mc_magic;
struct stackframe_s mc_p_reg;
} mcontext_t;
__BEGIN_DECLS
int setmcontext(const mcontext_t *mcp);
int getmcontext(mcontext_t *mcp);
__END_DECLS
#endif /* _MACHINE_MCONTEXT_H */

View File

@@ -0,0 +1,107 @@
/* $NetBSD: mutex.h,v 1.13 2012/09/25 05:24:00 matt Exp $ */
/*-
* Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe and Andrew Doran.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _ARM_MUTEX_H_
#define _ARM_MUTEX_H_
/*
* The ARM mutex implementation is troublesome, because pre-v6 ARM lacks a
* compare-and-swap operation. However, there aren't any MP pre-v6 ARM
* systems to speak of. We are mostly concerned with atomicity with respect
* to interrupts.
*
* ARMv6, however, does have ldrex/strex, and can thus implement an MP-safe
* compare-and-swap.
*
* So, what we have done is impement simple mutexes using a compare-and-swap.
* We support pre-ARMv6 by implementing CAS as a restartable atomic sequence
* that is checked by the IRQ vector. MP-safe ARMv6 support will be added later.
*/
#ifndef __MUTEX_PRIVATE
struct kmutex {
uintptr_t mtx_pad1;
};
#else /* __MUTEX_PRIVATE */
struct kmutex {
union {
/* Adaptive mutex */
volatile uintptr_t mtxa_owner; /* 0-3 */
/* Spin mutex */
struct {
/*
* Since the low bit of mtax_owner is used to flag this
* mutex as a spin mutex, we can't use the first byte
* or the last byte to store the ipl or lock values.
*/
volatile uint8_t mtxs_dummy;
ipl_cookie_t mtxs_ipl;
__cpu_simple_lock_t mtxs_lock;
volatile uint8_t mtxs_unused;
} s;
} u;
};
#define mtx_owner u.mtxa_owner
#define mtx_ipl u.s.mtxs_ipl
#define mtx_lock u.s.mtxs_lock
#if 0
#define __HAVE_MUTEX_STUBS 1
#define __HAVE_SPIN_MUTEX_STUBS 1
#endif
#define __HAVE_SIMPLE_MUTEXES 1
/*
* MUTEX_RECEIVE: no memory barrier required; we're synchronizing against
* interrupts, not multiple processors.
*/
#define MUTEX_RECEIVE(mtx) /* nothing */
/*
* MUTEX_GIVE: no memory barrier required; same reason.
*/
#define MUTEX_GIVE(mtx) /* nothing */
#define MUTEX_CAS(p, o, n) \
(atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
#ifdef MULTIPROCESSOR
#define MUTEX_SMT_PAUSE() __asm __volatile("wfe")
#define MUTEX_SMT_WAKE() __asm __volatile("sev")
#endif
#endif /* __MUTEX_PRIVATE */
#endif /* _ARM_MUTEX_H_ */

View File

@@ -0,0 +1,143 @@
/* $NetBSD: param.h,v 1.17 2012/08/03 08:11:40 matt Exp $ */
/*
* Copyright (c) 1994,1995 Mark Brinicombe.
* All rights reserved.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the RiscBSD team.
* 4. The name "RiscBSD" nor the name of the author may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY RISCBSD ``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 RISCBSD 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.
*/
#ifndef _ARM_PARAM_H_
#define _ARM_PARAM_H_
/*
* Machine dependent constants for all ARM processors
*/
/*
* For KERNEL code:
* MACHINE must be defined by the individual port. This is so that
* uname returns the correct thing, etc.
*
* MACHINE_ARCH may be defined by individual ports as a temporary
* measure while we're finishing the conversion to ELF.
*
* For non-KERNEL code:
* If ELF, MACHINE and MACHINE_ARCH are forced to "arm/armeb".
*/
#if defined(_KERNEL)
#ifndef MACHINE_ARCH /* XXX For now */
#ifndef __ARMEB__
#define _MACHINE_ARCH arm
#define MACHINE_ARCH "arm"
#else
#define _MACHINE_ARCH armeb
#define MACHINE_ARCH "armeb"
#endif /* __ARMEB__ */
#endif /* MACHINE_ARCH */
#else
#undef _MACHINE
#undef MACHINE
#undef _MACHINE_ARCH
#undef MACHINE_ARCH
#define _MACHINE arm
#define MACHINE "arm"
#ifndef __ARMEB__
#define _MACHINE_ARCH arm
#define MACHINE_ARCH "arm"
#else
#define _MACHINE_ARCH armeb
#define MACHINE_ARCH "armeb"
#endif /* __ARMEB__ */
#endif /* !_KERNEL */
#define MID_MACHINE MID_ARM6
/* ARM-specific macro to align a stack pointer (downwards). */
#define STACK_ALIGNBYTES (8 - 1)
#ifdef __ARM_EABI__
#define ALIGNBYTES32 3
#else
#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,
* on machines that exchange pages of input or output buffers with mbuf
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
* of the hardware page size.
*/
#define MSIZE 256 /* size of an mbuf */
#ifndef MCLSHIFT
#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
/* 2K cluster can hold Ether frame */
#endif /* MCLSHIFT */
#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
#ifndef NMBCLUSTERS_MAX
#define NMBCLUSTERS_MAX (0x2000000 / MCLBYTES) /* Limit to 64MB for clusters */
#endif
/*
* Compatibility /dev/zero mapping.
*/
#ifdef _KERNEL
#ifdef COMPAT_16
#define COMPAT_ZERODEV(x) (x == makedev(0, _DEV_ZERO_oARM))
#endif
#endif /* _KERNEL */
#ifdef __minix
/* Minix expect to find in this file PAGE_* defines. */
#include <machine/vmparam.h>
#define PGSHIFT 12 /* LOG2(NBPG) */
#define NBPG (1 << PGSHIFT) /* bytes/page */
#define PGOFSET (NBPG-1) /* byte offset into page */
#define arm_round_page(x) ((((paddr_t)(x)) + PGOFSET) & ~PGOFSET)
#define arm_trunc_page(x) ((paddr_t)(x) & ~PGOFSET)
#define trunc_page(x) arm_trunc_page(x)
#define round_page(x) arm_round_page(x)
#endif
#endif /* _ARM_PARAM_H_ */

View File

@@ -0,0 +1,102 @@
/* $NetBSD: profile.h,v 1.8 2008/08/29 19:08:29 matt Exp $ */
/*
* Copyright (c) 2001 Ben Harris
* Copyright (c) 1995-1996 Mark Brinicombe
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
#define _MCOUNT_DECL void _mcount
/*
* Cannot implement mcount in C as GCC will trash the ip register when it
* pushes a trapframe. Pity we cannot insert assembly before the function
* prologue.
*/
#define MCOUNT_ASM_NAME "__mcount"
#ifdef PIC
#define PLTSYM "(PLT)"
#endif
#ifndef PLTSYM
#define PLTSYM
#endif
#define MCOUNT \
__asm(".text"); \
__asm(".align 0"); \
__asm(".type " MCOUNT_ASM_NAME ",%function"); \
__asm(".global " MCOUNT_ASM_NAME); \
__asm(MCOUNT_ASM_NAME ":"); \
/* \
* Preserve registers that are trashed during mcount \
*/ \
__asm("stmfd sp!, {r0-r3, ip, lr}"); \
/* Check what mode we're in. EQ => 32, NE => 26 */ \
__asm("teq r0, r0"); \
__asm("teq pc, r15"); \
/* \
* find the return address for mcount, \
* and the return address for mcount's caller. \
* \
* frompcindex = pc pushed by call into self. \
*/ \
__asm("moveq r0, ip"); \
__asm("bicne r0, ip, #0xfc000003"); \
/* \
* selfpc = pc pushed by mcount call \
*/ \
__asm("moveq r1, lr"); \
__asm("bicne r1, lr, #0xfc000003"); \
/* \
* Call the real mcount code \
*/ \
__asm("bl " ___STRING(_C_LABEL(_mcount)) PLTSYM); \
/* \
* Restore registers that were trashed during mcount \
*/ \
__asm("ldmfd sp!, {r0-r3, lr, pc}");
#ifdef _KERNEL
#ifdef __PROG26
extern int int_off_save(void);
extern void int_restore(int);
#define MCOUNT_ENTER (s = int_off_save())
#define MCOUNT_EXIT int_restore(s)
#else
#include <arm/cpufunc.h>
/*
* splhigh() and splx() are heavyweight, and call mcount(). Therefore
* we disabled interrupts (IRQ, but not FIQ) directly on the CPU.
*
* We're lucky that the CPSR and 's' both happen to be 'int's.
*/
#define MCOUNT_ENTER s = __set_cpsr_c(0x0080, 0x0080); /* kill IRQ */
#define MCOUNT_EXIT __set_cpsr_c(0xffffffff, s); /* restore old value */
#endif /* !acorn26 */
#endif /* _KERNEL */

View File

@@ -0,0 +1,82 @@
/* $NetBSD: setjmp.h,v 1.4 2011/06/30 20:09:20 wiz Exp $ */
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/
#define _JBLEN 64 /* size, in longs, of a jmp_buf */
/*
* NOTE: The internal structure of a jmp_buf is *PRIVATE*
* This information is provided as there is software
* that fiddles with this with obtain the stack pointer
* (yes really ! and its commercial !).
*
* Description of the setjmp buffer
*
* word 0 magic number (dependent on creator)
* 1 - 3 f4 fp register 4
* 4 - 6 f5 fp register 5
* 7 - 9 f6 fp register 6
* 10 - 12 f7 fp register 7
* 13 fpsr fp status register
* 14 r4 register 4
* 15 r5 register 5
* 16 r6 register 6
* 17 r7 register 7
* 18 r8 register 8
* 19 r9 register 9
* 20 r10 register 10 (sl)
* 21 r11 register 11 (fp)
* 22 r12 register 12 (ip)
* 23 r13 register 13 (sp)
* 24 r14 register 14 (lr)
* 25 signal mask (dependent on magic)
* 26 (con't)
* 27 (con't)
* 28 (con't)
*
* The magic number number identifies the jmp_buf and
* how the buffer was created as well as providing
* a sanity check
*
* A side note I should mention - Please do not tamper
* with the floating point fields. While they are
* always saved and restored at the moment this cannot
* be garenteed especially if the compiler happens
* to be generating soft-float code so no fp
* registers will be used.
*
* Whilst this can be seen an encouraging people to
* use the setjmp buffer in this way I think that it
* is for the best then if changes occur compiles will
* break rather than just having new builds falling over
* mysteriously.
*/
#define _JB_MAGIC__SETJMP 0x4278f500
#define _JB_MAGIC_SETJMP 0x4278f501
/* Valid for all jmp_buf's */
#define _JB_MAGIC 0
#define _JB_REG_F4 1
#define _JB_REG_F5 4
#define _JB_REG_F6 7
#define _JB_REG_F7 10
#define _JB_REG_FPSR 13
#define _JB_REG_R4 14
#define _JB_REG_R5 15
#define _JB_REG_R6 16
#define _JB_REG_R7 17
#define _JB_REG_R8 18
#define _JB_REG_R9 19
#define _JB_REG_R10 20
#define _JB_REG_R11 21
#define _JB_REG_R12 22
#define _JB_REG_R13 23
#define _JB_REG_R14 24
/* Only valid with the _JB_MAGIC_SETJMP magic */
#define _JB_SIGMASK 25

View File

@@ -0,0 +1,58 @@
#ifndef _ARM_SIGNAL_H_
#define _ARM_SIGNAL_H_
#include <sys/featuretest.h>
typedef int sig_atomic_t;
/* The following structure should match the stackframe_s structure used
* by the kernel's context switching code. Floating point registers should
* be added in a different struct.
*/
#include <machine/stackframe.h>
typedef struct stackframe_s sigregs;
struct sigframe { /* stack frame created for signalled process */
void (*sf_retadr)(void);
int sf_signo;
int sf_code;
struct sigcontext *sf_scp;
int sf_fp;
void (*sf_retadr2)(void);
struct sigcontext *sf_scpcopy;
};
struct sigcontext {
int sc_flags; /* sigstack state to restore (including
* MF_FPU_INITIALIZED)
*/
long sc_mask; /* signal mask to restore */
sigregs sc_regs; /* register set to restore */
};
#define sc_retreg sc_regs.retreg
#define sc_r1 sc_regs.r1
#define sc_r2 sc_regs.r2
#define sc_r3 sc_regs.r3
#define sc_r4 sc_regs.r4
#define sc_r5 sc_regs.r5
#define sc_r6 sc_regs.r6
#define sc_r7 sc_regs.r7
#define sc_r8 sc_regs.r8
#define sc_r9 sc_regs.r9
#define sc_r10 sc_regs.r10
#define sc_fp sc_regs.fp
#define sc_r12 sc_regs.r12
#define sc_sp sc_regs.sp
#define sc_lr sc_regs.lr
#define sc_pc sc_regs.pc
#define sc_psr sc_regs.psr
#ifdef _MINIX
__BEGIN_DECLS
int sigreturn(struct sigcontext *_scp);
__END_DECLS
#endif /* _MINIX */
#endif /* !_ARM_SIGNAL_H_ */

View File

@@ -0,0 +1,101 @@
/* $NetBSD: types.h,v 1.23 2012/08/12 05:05:47 matt Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* 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.
* 3. 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: @(#)types.h 7.5 (Berkeley) 3/9/91
*/
#ifndef _ARM_TYPES_H_
#define _ARM_TYPES_H_
#include <sys/cdefs.h>
#include <sys/featuretest.h>
#include <arm/int_types.h>
#if defined(_KERNEL)
typedef struct label_t { /* Used by setjmp & longjmp */
int val[11];
} label_t;
#endif
/* NB: This should probably be if defined(_KERNEL) */
#if defined(_NETBSD_SOURCE)
typedef unsigned long vm_offset_t; /* depreciated */
typedef unsigned long vm_size_t; /* depreciated */
typedef unsigned long paddr_t;
typedef unsigned long psize_t;
typedef unsigned long vaddr_t;
typedef unsigned long vsize_t;
#define PRIxPADDR "lx"
#define PRIxPSIZE "lx"
#define PRIuPSIZE "lu"
#define PRIxVADDR "lx"
#define PRIxVSIZE "lx"
#define PRIuVSIZE "lu"
#endif
typedef int register_t, register32_t;
#define PRIxREGISTER "x"
typedef unsigned long pmc_evid_t;
#define PMC_INVALID_EVID (-1)
typedef unsigned long pmc_ctr_t;
/*
* This should have always been an 8-bit type, but since it's been exposed
* to user-space, we don't want ABI breakage there.
*/
#if defined(_KERNEL)
typedef volatile unsigned char __cpu_simple_lock_t;
#else
typedef volatile int __cpu_simple_lock_t;
#endif /* _KERNEL */
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#define __HAVE_SYSCALL_INTERN
#define __HAVE_NEW_STYLE_BUS_H
#define __HAVE_MINIMAL_EMUL
#define __HAVE_CPU_DATA_FIRST
#define __HAVE___LWP_GETPRIVATE_FAST
#define __HAVE_COMMON___TLS_GET_ADDR
#define __HAVE_TLS_VARIANT_I
#if defined(_KERNEL) || defined(_KMEMUSER)
#define PCU_FPU 0
#define PCU_UNIT_COUNT 1
#endif
#if defined(_KERNEL)
#define __HAVE_RAS
#endif
#endif /* _ARM_TYPES_H_ */

View File

@@ -0,0 +1,47 @@
/* $NetBSD: wchar_limits.h,v 1.3 2008/04/28 20:23:14 martin Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _ARM_WCHAR_LIMITS_H_
#define _ARM_WCHAR_LIMITS_H_
/*
* 7.18.3 Limits of other integer types
*/
/* limits of wchar_t */
#define WCHAR_MIN (-0x7fffffff-1) /* wchar_t */
#define WCHAR_MAX 0x7fffffff /* wchar_t */
/* limits of wint_t */
#define WINT_MIN (-0x7fffffff-1) /* wint_t */
#define WINT_MAX 0x7fffffff /* wint_t */
#endif /* !_ARM_WCHAR_LIMITS_H_ */