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:
@@ -58,7 +58,7 @@ SUBDIR+= ../common/include/prop
|
||||
|
||||
.if defined(__MINIX)
|
||||
SUBDIR+= arch sys minix
|
||||
SUBDIR+= net netinet netinet6
|
||||
SUBDIR+= net
|
||||
SUBDIR+= ddekit
|
||||
.else
|
||||
SUBDIR+= ../common/include/ppath
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# $NetBSD: Makefile,v 1.36 2007/12/20 23:46:12 ad Exp $
|
||||
.include <bsd.own.mk>
|
||||
|
||||
INCSDIR= /usr/include/arm
|
||||
|
||||
INCS= ansi.h asm.h bswap.h byte_swap.h cdefs.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 param.h profile.h \
|
||||
setjmp.h signal.h stdarg.h types.h \
|
||||
vmparam.h wchar_limits.h \
|
||||
archconst.h archtypes.h cpu.h diskparm.h \
|
||||
interrupt.h memory.h multiboot.h partition.h \
|
||||
stackframe.h vm.h elf.h elf_machdep.h mutex.h \
|
||||
disklabel.h ipcconst.h
|
||||
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
@@ -1,69 +0,0 @@
|
||||
/* $NetBSD: ansi.h,v 1.12 2010/03/27 22:14:09 tnozaki 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
|
||||
*/
|
||||
|
||||
/* These types are Minix specific. */
|
||||
|
||||
#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() */
|
||||
#if __GNUC_PREREQ__(2, 96)
|
||||
#define _BSD_VA_LIST_ __builtin_va_list /* GCC built-in type */
|
||||
#else
|
||||
#define _BSD_VA_LIST_ char * /* va_list */
|
||||
#endif
|
||||
#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_ */
|
||||
@@ -1,184 +0,0 @@
|
||||
/* $NetBSD: asm.h,v 1.14 2011/06/30 20:09:20 wiz 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 _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
|
||||
#define _LABEL(x) \
|
||||
.globl 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 LABEL(y) _LABEL(_C_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_ */
|
||||
@@ -1,11 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,82 +0,0 @@
|
||||
/* $NetBSD: byte_swap.h,v 1.8 2008/04/28 20:23:14 martin 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 __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)
|
||||
{
|
||||
#ifdef _ARM_ARCH_6
|
||||
__asm("rev\t%0, %1" : "=r" (v) : "0" (v));
|
||||
#else
|
||||
uint32_t t1;
|
||||
|
||||
t1 = v ^ ((v << 16) | (v >> 16));
|
||||
t1 &= 0xff00ffffU;
|
||||
v = (v >> 8) | (v << 24);
|
||||
v ^= (t1 >> 8);
|
||||
#endif
|
||||
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
|
||||
__asm("rev16\t%0, %1" : "=r" (v) : "0" (v));
|
||||
#elif !defined(__thumb__)
|
||||
__asm volatile(
|
||||
"mov %0, %1, ror #8\n"
|
||||
"orr %0, %0, %0, lsr #16\n"
|
||||
"bic %0, %0, %0, lsl #16"
|
||||
: "=r" (v)
|
||||
: "0" (v));
|
||||
#else
|
||||
v &= 0xffff;
|
||||
v = (v >> 8) | (v << 8);
|
||||
#endif
|
||||
|
||||
return (v);
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _ARM_BYTE_SWAP_H_ */
|
||||
@@ -1,22 +0,0 @@
|
||||
/* $NetBSD: cdefs.h,v 1.4 2012/01/20 14:08:05 joerg Exp $ */
|
||||
|
||||
#ifndef _MACHINE_CDEFS_H_
|
||||
#define _MACHINE_CDEFS_H_
|
||||
|
||||
#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__)
|
||||
#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
|
||||
|
||||
#define __ALIGNBYTES (sizeof(int) - 1)
|
||||
|
||||
#endif /* !_MACHINE_CDEFS_H_ */
|
||||
@@ -1,55 +0,0 @@
|
||||
#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_ */
|
||||
@@ -1,83 +0,0 @@
|
||||
/* $NetBSD: disklabel.h,v 1.9 2009/11/23 13:40:09 pooka 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_
|
||||
|
||||
#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_ */
|
||||
@@ -1,117 +0,0 @@
|
||||
/* $NetBSD: elf_machdep.h,v 1.8 2009/05/30 05:56:52 skrll Exp $ */
|
||||
|
||||
#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 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
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: endian.h,v 1.3 2001/06/23 12:20:27 bjh21 Exp $ */
|
||||
|
||||
#include <sys/endian.h>
|
||||
@@ -1,8 +0,0 @@
|
||||
/* $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
|
||||
@@ -1,31 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,13 +0,0 @@
|
||||
/* $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
|
||||
@@ -1,58 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,56 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,212 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,127 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,86 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,68 +0,0 @@
|
||||
/* $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_ */
|
||||
@@ -1,94 +0,0 @@
|
||||
/* $NetBSD: limits.h,v 1.10 2010/06/07 13:52:30 tnozaki 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 SCHAR_MIN (-0x7f-1) /* max value for a signed char */
|
||||
#define SCHAR_MAX 0x7f /* min value for a signed char */
|
||||
|
||||
#define UCHAR_MAX 0xff /* max value for an unsigned char */
|
||||
#define CHAR_MAX 0xff /* max value for a char */
|
||||
#define CHAR_MIN 0 /* min value for a 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 0xffffffffffffffffLL /* 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_ */
|
||||
@@ -1,125 +0,0 @@
|
||||
/* $NetBSD: lock.h,v 1.17 2008/04/28 20:23:14 martin 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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
*alp = __SIMPLELOCK_UNLOCKED;
|
||||
}
|
||||
|
||||
#endif /* _ARM_LOCK_H_ */
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: math.h,v 1.2 2002/02/19 13:08:14 simonb Exp $ */
|
||||
|
||||
#define __HAVE_NANF
|
||||
@@ -1,19 +0,0 @@
|
||||
#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 */
|
||||
@@ -1,101 +0,0 @@
|
||||
/* $NetBSD: mutex.h,v 1.10 2008/04/28 20:23:14 martin 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 {
|
||||
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 */
|
||||
|
||||
unsigned long _lock_cas(volatile unsigned long *,
|
||||
unsigned long, unsigned long);
|
||||
|
||||
#define MUTEX_CAS(p, o, n) \
|
||||
(_lock_cas((volatile unsigned long *)(p), (o), (n)) == (o))
|
||||
|
||||
#endif /* __MUTEX_PRIVATE */
|
||||
|
||||
#endif /* _ARM_MUTEX_H_ */
|
||||
@@ -1,153 +0,0 @@
|
||||
/* $NetBSD: param.h,v 1.13 2010/05/06 19:10:26 joerg 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
|
||||
|
||||
/*
|
||||
* Round p (pointer or byte index) up to a correctly-aligned value
|
||||
* for all data types (int, long, ...). The result is u_int and
|
||||
* must be cast to any desired pointer type.
|
||||
*
|
||||
* 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 ALIGNBYTES (sizeof(int) - 1)
|
||||
#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
|
||||
#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0)
|
||||
/* ARM-specific macro to align a stack pointer (downwards). */
|
||||
#define STACKALIGNBYTES (8 - 1)
|
||||
#define STACKALIGN(p) ((u_int)(p) &~ STACKALIGNBYTES)
|
||||
|
||||
#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_ */
|
||||
@@ -1,102 +0,0 @@
|
||||
/* $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 */
|
||||
@@ -1,82 +0,0 @@
|
||||
/* $NetBSD: setjmp.h,v 1.3 2008/08/29 19:08:29 matt 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 (dependant 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 (dependant 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
|
||||
@@ -1,58 +0,0 @@
|
||||
#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_ */
|
||||
@@ -1,92 +0,0 @@
|
||||
/* $NetBSD: types.h,v 1.18 2010/12/22 01:04:23 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;
|
||||
#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_MINIMAL_EMUL
|
||||
#define __HAVE_CPU_DATA_FIRST
|
||||
|
||||
#if defined(_KERNEL)
|
||||
#define __HAVE_RAS
|
||||
#endif
|
||||
|
||||
#endif /* _ARM_TYPES_H_ */
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef _ARM_VMPARAM_H_
|
||||
#define _ARM_VMPARAM_H_
|
||||
|
||||
/*
|
||||
* Machine dependent constants for ARM.
|
||||
*/
|
||||
|
||||
#define PAGE_SHIFT 12
|
||||
#define PAGE_SIZE (1 << PAGE_SHIFT)
|
||||
#define PAGE_MASK (PAGE_SIZE - 1)
|
||||
|
||||
#endif /* _ARM_VMPARAM_H_ */
|
||||
@@ -1,47 +0,0 @@
|
||||
/* $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_ */
|
||||
8
include/arch/evbarm/include/Makefile
Normal file
8
include/arch/evbarm/include/Makefile
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
INCSDIR= /usr/include/arm
|
||||
|
||||
INCS= archconst.h archtypes.h diskparm.h elf.h interrupt.h \
|
||||
ipcconst.h memory.h multiboot.h partition.h \
|
||||
stackframe.h stdarg.h vm.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
@@ -1,6 +1,6 @@
|
||||
# $NetBSD: Makefile,v 1.38 2009/08/30 02:00:56 dyoung Exp $
|
||||
|
||||
|
||||
SUBDIR= include ../x86/include
|
||||
SUBDIR= include
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
# $NetBSD: Makefile,v 1.36 2007/12/20 23:46:12 ad Exp $
|
||||
.include <bsd.own.mk>
|
||||
|
||||
INCSDIR= /usr/include/i386
|
||||
|
||||
INCS= ansi.h asm.h bswap.h byte_swap.h cdefs.h \
|
||||
endian.h endian_machdep.h fenv.h float.h ieee.h \
|
||||
ieeefp.h int_const.h int_fmtio.h int_limits.h \
|
||||
int_mwgwtypes.h int_types.h limits.h \
|
||||
math.h mcontext.h npx.h param.h profile.h \
|
||||
setjmp.h signal.h stdarg.h types.h \
|
||||
vmparam.h wchar_limits.h \
|
||||
archconst.h archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \
|
||||
interrupt.h memory.h multiboot.h partition.h \
|
||||
pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \
|
||||
ports.h stackframe.h vm.h elf.h elf_machdep.h mutex.h \
|
||||
disklabel.h ipcconst.h
|
||||
|
||||
INCS= archconst.h archtypes.h bios.h cmos.h cpu.h \
|
||||
diskparm.h elf.h fpu.h int86.h interrupt.h \
|
||||
ipcconst.h memory.h partition.h \
|
||||
pci_amd.h pci.h pci_intel.h pci_sis.h \
|
||||
pci_via.h ports.h stackframe.h stdarg.h vm.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
.include <bsd.own.mk>
|
||||
.PATH: ${NETBSDSRCDIR}/common/include/arch/i386
|
||||
|
||||
INCS+= archtypes.h bios.h cmos.h cpu.h diskparm.h fpu.h int86.h \
|
||||
interrupt.h memory.h multiboot.h partition.h \
|
||||
pci.h pci_amd.h pci_intel.h pci_sis.h pci_via.h \
|
||||
ports.h stackframe.h vm.h elf.h elf_machdep.h mutex.h \
|
||||
disklabel.h
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/* $NetBSD: ansi.h,v 1.24 2010/03/27 22:14:09 tnozaki 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.
|
||||
*
|
||||
* @(#)ansi.h 8.2 (Berkeley) 1/4/94
|
||||
*/
|
||||
|
||||
/* These types are Minix specific. */
|
||||
|
||||
#ifndef _I386_ANSI_H_
|
||||
#define _I386_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
|
||||
|
||||
#define _BSD_PTRDIFF_T_ int
|
||||
|
||||
#define _BSD_SIZE_T_ unsigned int
|
||||
#define _BSD_SSIZE_T_ int
|
||||
#define _BSD_TIME_T_ long /* time() */
|
||||
#if __GNUC_PREREQ__(2, 96)
|
||||
#define _BSD_VA_LIST_ __builtin_va_list /* GCC built-in type */
|
||||
#else
|
||||
#define _BSD_VA_LIST_ char * /* va_list */
|
||||
#endif
|
||||
#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 /* _I386_ANSI_H_ */
|
||||
@@ -1,230 +0,0 @@
|
||||
/* $NetBSD: asm.h,v 1.39 2010/12/20 21:11:24 joerg 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.
|
||||
*
|
||||
* @(#)asm.h 5.5 (Berkeley) 5/7/91
|
||||
*/
|
||||
|
||||
#ifndef _I386_ASM_H_
|
||||
#define _I386_ASM_H_
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_multiprocessor.h"
|
||||
#endif
|
||||
|
||||
#ifdef PIC
|
||||
#define PIC_PROLOGUE \
|
||||
pushl %ebx; \
|
||||
call 1f; \
|
||||
1: \
|
||||
popl %ebx; \
|
||||
addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
|
||||
#define PIC_EPILOGUE \
|
||||
popl %ebx
|
||||
#define PIC_PLT(x) x@PLT
|
||||
#define PIC_GOT(x) x@GOT(%ebx)
|
||||
#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
|
||||
#else
|
||||
#define PIC_PROLOGUE
|
||||
#define PIC_EPILOGUE
|
||||
#define PIC_PLT(x) x
|
||||
#define PIC_GOT(x) x
|
||||
#define PIC_GOTOFF(x) x
|
||||
#endif
|
||||
|
||||
#ifdef __ELF__
|
||||
# define _C_LABEL(x) x
|
||||
#else
|
||||
# ifdef __STDC__
|
||||
# define _C_LABEL(x) _ ## x
|
||||
# else
|
||||
# define _C_LABEL(x) _/**/x
|
||||
# endif
|
||||
#endif
|
||||
#define _ASM_LABEL(x) x
|
||||
|
||||
#define CVAROFF(x, y) _C_LABEL(x) + y
|
||||
|
||||
#ifdef __STDC__
|
||||
# define __CONCAT(x,y) x ## y
|
||||
# define __STRING(x) #x
|
||||
#else
|
||||
# define __CONCAT(x,y) x/**/y
|
||||
# define __STRING(x) "x"
|
||||
#endif
|
||||
|
||||
/* let kernels and others override entrypoint alignment */
|
||||
#if !defined(_ALIGN_TEXT) && !defined(_KERNEL)
|
||||
# ifdef _STANDALONE
|
||||
# define _ALIGN_TEXT .align 4
|
||||
# elif defined __ELF__
|
||||
# define _ALIGN_TEXT .align 16
|
||||
# else
|
||||
# define _ALIGN_TEXT .align 4
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define _ENTRY(x) \
|
||||
.text; _ALIGN_TEXT; .globl x; .type x,@function; x:
|
||||
#define _LABEL(x) \
|
||||
.globl x; x:
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#define CPUVAR(off) %fs:__CONCAT(CPU_INFO_,off)
|
||||
|
||||
/* XXX Can't use __CONCAT() here, as it would be evaluated incorrectly. */
|
||||
#ifdef __ELF__
|
||||
#ifdef __STDC__
|
||||
#define IDTVEC(name) \
|
||||
ALIGN_TEXT; .globl X ## name; .type X ## name,@function; X ## name:
|
||||
#define IDTVEC_END(name) \
|
||||
.size X ## name, . - X ## name
|
||||
#else
|
||||
#define IDTVEC(name) \
|
||||
ALIGN_TEXT; .globl X/**/name; .type X/**/name,@function; X/**/name:
|
||||
#define IDTVEC_END(name) \
|
||||
.size X/**/name, . - X/**/name
|
||||
#endif /* __STDC__ */
|
||||
#else
|
||||
#ifdef __STDC__
|
||||
#define IDTVEC(name) \
|
||||
ALIGN_TEXT; .globl _X ## name; .type _X ## name,@function; _X ## name:
|
||||
#define IDTVEC_END(name) \
|
||||
.size _X ## name, . - _X ## name
|
||||
#else
|
||||
#define IDTVEC(name) \
|
||||
ALIGN_TEXT; .globl _X/**/name; .type _X/**/name,@function; _X/**/name:
|
||||
#define IDTVEC_END(name) \
|
||||
.size _X/**/name, . - _X/**/name
|
||||
#endif /* __STDC__ */
|
||||
#endif /* __ELF__ */
|
||||
|
||||
#ifdef _STANDALONE
|
||||
#define ALIGN_DATA .align 4
|
||||
#define ALIGN_TEXT .align 4 /* 4-byte boundaries */
|
||||
#define SUPERALIGN_TEXT .align 16 /* 15-byte boundaries */
|
||||
#elif defined __ELF__
|
||||
#define ALIGN_DATA .align 4
|
||||
#define ALIGN_TEXT .align 16 /* 16-byte boundaries */
|
||||
#define SUPERALIGN_TEXT .align 16 /* 16-byte boundaries */
|
||||
#else
|
||||
#define ALIGN_DATA .align 2
|
||||
#define ALIGN_TEXT .align 4 /* 16-byte boundaries */
|
||||
#define SUPERALIGN_TEXT .align 4 /* 16-byte boundaries */
|
||||
#endif /* __ELF__ */
|
||||
|
||||
#define _ALIGN_TEXT ALIGN_TEXT
|
||||
|
||||
#ifdef GPROF
|
||||
#ifdef __ELF__
|
||||
#define MCOUNT_ASM call _C_LABEL(__mcount)
|
||||
#else /* __ELF__ */
|
||||
#define MCOUNT_ASM call _C_LABEL(mcount)
|
||||
#endif /* __ELF__ */
|
||||
#else /* GPROF */
|
||||
#define MCOUNT_ASM /* nothing */
|
||||
#endif /* GPROF */
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
||||
|
||||
#ifdef GPROF
|
||||
# ifdef __ELF__
|
||||
# define _PROF_PROLOGUE \
|
||||
pushl %ebp; movl %esp,%ebp; call PIC_PLT(__mcount); popl %ebp
|
||||
# else
|
||||
# define _PROF_PROLOGUE \
|
||||
pushl %ebp; movl %esp,%ebp; call PIC_PLT(mcount); popl %ebp
|
||||
# endif
|
||||
#else
|
||||
# define _PROF_PROLOGUE
|
||||
#endif
|
||||
|
||||
#define ENTRY(y) _ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
|
||||
#define NENTRY(y) _ENTRY(_C_LABEL(y))
|
||||
#define ASENTRY(y) _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
|
||||
#define LABEL(y) _LABEL(_C_LABEL(y))
|
||||
#define END(y) .size y, . - y
|
||||
|
||||
#define ASMSTR .asciz
|
||||
|
||||
#ifdef __ELF__
|
||||
#define RCSID(x) .pushsection ".ident"; .asciz x; .popsection
|
||||
#else
|
||||
#define RCSID(x) .text; .asciz x
|
||||
#endif
|
||||
|
||||
#ifdef NO_KERNEL_RCSIDS
|
||||
#define __KERNEL_RCSID(_n, _s) /* nothing */
|
||||
#else
|
||||
#define __KERNEL_RCSID(_n, _s) RCSID(_s)
|
||||
#endif
|
||||
|
||||
#if defined(__ELF__) || defined(__minix)
|
||||
#define WEAK_ALIAS(alias,sym) \
|
||||
.weak alias; \
|
||||
alias = sym
|
||||
#endif
|
||||
/*
|
||||
* 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 __minix
|
||||
#define IMPORT(sym) \
|
||||
.extern _C_LABEL(sym)
|
||||
|
||||
#define KERVEC_ORIG 32 /* syscall trap to kernel */
|
||||
#define IPCVEC_ORIG 33 /* ipc trap to kernel */
|
||||
|
||||
#define KERVEC_UM 34 /* syscall trap to kernel, user-mapped code */
|
||||
#define IPCVEC_UM 35 /* ipc trap to kernel, user-mapped code */
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* !_I386_ASM_H_ */
|
||||
@@ -1,13 +0,0 @@
|
||||
/* $NetBSD: bswap.h,v 1.4 2008/10/26 06:57:30 mrg Exp $ */
|
||||
|
||||
/* Written by Manuel Bouyer. Public domain */
|
||||
|
||||
#ifndef _I386_BSWAP_H_
|
||||
#define _I386_BSWAP_H_
|
||||
|
||||
#include <machine/byte_swap.h>
|
||||
|
||||
#define __BSWAP_RENAME
|
||||
#include <sys/bswap.h>
|
||||
|
||||
#endif /* !_I386_BSWAP_H_ */
|
||||
@@ -1,68 +0,0 @@
|
||||
/* $NetBSD: byte_swap.h,v 1.15 2008/04/28 20:23:24 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Charles M. Hannum.
|
||||
*
|
||||
* 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 _I386_BYTE_SWAP_H_
|
||||
#define _I386_BYTE_SWAP_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define __BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
|
||||
static __inline uint32_t __byte_swap_u32_variable(uint32_t);
|
||||
static __inline uint32_t
|
||||
__byte_swap_u32_variable(uint32_t x)
|
||||
{
|
||||
__asm volatile (
|
||||
"bswap %1"
|
||||
: "=r" (x) : "0" (x));
|
||||
return (x);
|
||||
}
|
||||
|
||||
#define __BYTE_SWAP_U16_VARIABLE __byte_swap_u16_variable
|
||||
static __inline uint16_t __byte_swap_u16_variable(uint16_t);
|
||||
static __inline uint16_t
|
||||
__byte_swap_u16_variable(uint16_t x)
|
||||
{
|
||||
__asm volatile ("rorw $8, %w1" : "=r" (x) : "0" (x));
|
||||
return (x);
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
#elif defined(_KERNEL) || defined(_LKM)
|
||||
#define __BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
|
||||
#define __BYTE_SWAP_U16_VARIABLE __byte_swap_u16_variable
|
||||
uint32_t __byte_swap_u32_variable(uint32_t);
|
||||
uint16_t __byte_swap_u16_variable(uint16_t);
|
||||
#endif
|
||||
|
||||
#endif /* !_I386_BYTE_SWAP_H_ */
|
||||
@@ -1,16 +0,0 @@
|
||||
/* $NetBSD: cdefs.h,v 1.7 2008/10/26 06:57:30 mrg Exp $ */
|
||||
|
||||
#ifndef _I386_CDEFS_H_
|
||||
#define _I386_CDEFS_H_
|
||||
|
||||
#ifdef __minix
|
||||
#ifndef __ELF__
|
||||
#define __LEADING_UNDERSCORE
|
||||
#endif
|
||||
#else /* !__minix */
|
||||
/* No arch-specific cdefs. */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* !_I386_CDEFS_H_ */
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef _IBM_CPU_H
|
||||
#define _IBM_CPU_H 1
|
||||
|
||||
#define X86_FLAG_C (1L << 0) /* S Carry */
|
||||
#define X86_FLAG_P (1L << 2) /* S Parity */
|
||||
#define X86_FLAG_A (1L << 4) /* S Aux. carry */
|
||||
#define X86_FLAG_Z (1L << 6) /* S Zero */
|
||||
#define X86_FLAG_S (1L << 7) /* S Sign */
|
||||
|
||||
#define X86_FLAG_T (1L << 8) /* X Trap */
|
||||
#define X86_FLAG_I (1L << 9) /* X Interrupt */
|
||||
#define X86_FLAG_D (1L << 10) /* C Direction */
|
||||
#define X86_FLAG_O (1L << 11) /* S Overflow */
|
||||
|
||||
/* User flags are S (Status) and C (Control) flags. */
|
||||
#define X86_FLAGS_USER (X86_FLAG_C | X86_FLAG_P | X86_FLAG_A | X86_FLAG_Z | \
|
||||
X86_FLAG_S | X86_FLAG_D | X86_FLAG_O)
|
||||
|
||||
#endif
|
||||
@@ -1,75 +0,0 @@
|
||||
/* $NetBSD: disklabel.h,v 1.16 2011/08/30 12:39:55 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christopher G. Demetriou
|
||||
* 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 Christopher G. Demetriou.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _I386_DISKLABEL_H_
|
||||
#define _I386_DISKLABEL_H_
|
||||
|
||||
#define LABELUSESMBR 1 /* use MBR partitionning */
|
||||
#define LABELSECTOR 1 /* sector containing label */
|
||||
#define LABELOFFSET 0 /* offset of label in sector */
|
||||
#define MAXPARTITIONS 16 /* number of partitions */
|
||||
#define OLDMAXPARTITIONS 8 /* number of partitions before 1.6 */
|
||||
#define RAW_PART 3 /* raw partition: XX?d (XXX) */
|
||||
|
||||
/*
|
||||
* We use the highest bit of the minor number for the partition number.
|
||||
* This maintains backward compatibility with device nodes created before
|
||||
* MAXPARTITIONS was increased.
|
||||
*/
|
||||
#define __I386_MAXDISKS ((1 << 20) / MAXPARTITIONS)
|
||||
#define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __I386_MAXDISKS)
|
||||
#define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \
|
||||
((minor(dev) / (__I386_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
|
||||
#define DISKMINOR(unit, part) \
|
||||
(((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
|
||||
((part) / OLDMAXPARTITIONS) * (__I386_MAXDISKS * OLDMAXPARTITIONS))
|
||||
|
||||
/* Pull in MBR partition definitions. */
|
||||
#if HAVE_NBTOOL_CONFIG_H
|
||||
#include <nbinclude/sys/bootblock.h>
|
||||
#else
|
||||
#include <sys/bootblock.h>
|
||||
#endif /* HAVE_NBTOOL_CONFIG_H */
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
#if HAVE_NBTOOL_CONFIG_H
|
||||
#include <nbinclude/sys/dkbad.h>
|
||||
#else
|
||||
#include <sys/dkbad.h>
|
||||
#endif /* HAVE_NBTOOL_CONFIG_H */
|
||||
struct cpu_disklabel {
|
||||
#define __HAVE_DISKLABEL_DKBAD
|
||||
struct dkbad bad;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _I386_DISKLABEL_H_ */
|
||||
@@ -1,63 +0,0 @@
|
||||
/* $NetBSD: elf_machdep.h,v 1.10 2009/05/30 05:56:52 skrll Exp $ */
|
||||
|
||||
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
|
||||
#define ELF32_MACHDEP_ID_CASES \
|
||||
case EM_386: \
|
||||
case EM_486: \
|
||||
break;
|
||||
|
||||
#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
|
||||
#define ELF64_MACHDEP_ID_CASES \
|
||||
/* no 64-bit ELF machine types supported */
|
||||
|
||||
#define ELF32_MACHDEP_ID EM_386
|
||||
|
||||
#define ARCH_ELFSIZE 32 /* MD native binary size */
|
||||
|
||||
/* i386 relocations */
|
||||
#define R_386_NONE 0
|
||||
#define R_386_32 1
|
||||
#define R_386_PC32 2
|
||||
#define R_386_GOT32 3
|
||||
#define R_386_PLT32 4
|
||||
#define R_386_COPY 5
|
||||
#define R_386_GLOB_DAT 6
|
||||
#define R_386_JMP_SLOT 7
|
||||
#define R_386_RELATIVE 8
|
||||
#define R_386_GOTOFF 9
|
||||
#define R_386_GOTPC 10
|
||||
|
||||
/* TLS relocations */
|
||||
#define R_386_TLS_TPOFF 14
|
||||
#define R_386_TLS_IE 15
|
||||
#define R_386_TLS_GOTIE 16
|
||||
#define R_386_TLS_LE 17
|
||||
#define R_386_TLS_GD 18
|
||||
#define R_386_TLS_LDM 19
|
||||
|
||||
/* The following relocations are GNU extensions. */
|
||||
#define R_386_16 20
|
||||
#define R_386_PC16 21
|
||||
#define R_386_8 22
|
||||
#define R_386_PC8 23
|
||||
|
||||
/* More TLS relocations */
|
||||
#define R_386_TLS_GD_32 24
|
||||
#define R_386_TLS_GD_PUSH 25
|
||||
#define R_386_TLS_GD_CALL 26
|
||||
#define R_386_TLS_GD_POP 27
|
||||
#define R_386_TLS_LDM_32 28
|
||||
#define R_386_TLS_LDM_PUSH 29
|
||||
#define R_386_TLS_LDM_CALL 30
|
||||
#define R_386_TLS_LDM_POP 31
|
||||
#define R_386_TLS_LDO_32 32
|
||||
#define R_386_TLS_IE_32 33
|
||||
#define R_386_TLS_LE_32 34
|
||||
#define R_386_TLS_DTPMOD32 35
|
||||
#define R_386_TLS_DTPOFF32 36
|
||||
#define R_386_TLS_TPOFF32 37
|
||||
#define R_386_TLS_GOTDESC 39
|
||||
#define R_386_TLS_DESC_CALL 40
|
||||
#define R_386_TLS_DESC 41
|
||||
|
||||
#define R_TYPE(name) __CONCAT(R_386_,name)
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: endian.h,v 1.29 2000/03/17 00:09:20 mycroft Exp $ */
|
||||
|
||||
#include <sys/endian.h>
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: endian_machdep.h,v 1.3 2006/01/30 21:52:38 dsl Exp $ */
|
||||
|
||||
#define _BYTE_ORDER _LITTLE_ENDIAN
|
||||
@@ -1,116 +0,0 @@
|
||||
/* $NetBSD: fenv.h,v 1.1 2010/07/31 21:47:54 joerg Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2004-2005 David Schultz <das (at) FreeBSD.ORG>
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _X86_FENV_H_
|
||||
#define _X86_FENV_H_
|
||||
|
||||
#include <sys/stdint.h>
|
||||
#include <i386/npx.h>
|
||||
|
||||
/*
|
||||
* Each symbol representing a floating point exception expands to an integer
|
||||
* constant expression with values, such that bitwise-inclusive ORs of _all
|
||||
* combinations_ of the constants result in distinct values.
|
||||
*
|
||||
* We use such values that allow direct bitwise operations on FPU/SSE registers.
|
||||
*/
|
||||
#define FE_INVALID 0x01 /* 000000000001 */
|
||||
#define FE_DENORMAL 0x02 /* 000000000010 */
|
||||
#define FE_DIVBYZERO 0x04 /* 000000000100 */
|
||||
#define FE_OVERFLOW 0x08 /* 000000001000 */
|
||||
#define FE_UNDERFLOW 0x10 /* 000000010000 */
|
||||
#define FE_INEXACT 0x20 /* 000000100000 */
|
||||
|
||||
/*
|
||||
* The following symbol is simply the bitwise-inclusive OR of all floating-point
|
||||
* exception constants defined above.
|
||||
*/
|
||||
#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_DENORMAL | FE_INEXACT | \
|
||||
FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
|
||||
|
||||
/*
|
||||
* Each symbol representing the rounding direction, expands to an integer
|
||||
* constant expression whose value is distinct non-negative value.
|
||||
*
|
||||
* We use such values that allow direct bitwise operations on FPU/SSE registers.
|
||||
*/
|
||||
#define FE_TONEAREST 0x000 /* 000000000000 */
|
||||
#define FE_DOWNWARD 0x400 /* 010000000000 */
|
||||
#define FE_UPWARD 0x800 /* 100000000000 */
|
||||
#define FE_TOWARDZERO 0xC00 /* 110000000000 */
|
||||
|
||||
/*
|
||||
* As compared to the x87 control word, the SSE unit's control has the rounding
|
||||
* control bits offset by 3 and the exception mask bits offset by 7
|
||||
*/
|
||||
#define __X87_ROUND_MASK 0xC00 /* 110000000000 */
|
||||
#define __SSE_ROUND_SHIFT 3
|
||||
#define __SSE_EMASK_SHIFT 7
|
||||
|
||||
/*
|
||||
* fenv_t represents the entire floating-point environment
|
||||
*/
|
||||
typedef struct {
|
||||
struct {
|
||||
uint16_t control; /* Control word register */
|
||||
uint16_t unused1;
|
||||
uint16_t status; /* Status word register */
|
||||
uint16_t unused2;
|
||||
uint16_t tag; /* Tag word register */
|
||||
uint16_t unused3;
|
||||
uint32_t others[4]; /* EIP, Pointer Selector, etc */
|
||||
} x87;
|
||||
|
||||
uint32_t mxcsr; /* Control and status register */
|
||||
} fenv_t;
|
||||
|
||||
/*
|
||||
* The following constant represents the default floating-point environment
|
||||
* (that is, the one installed at program startup) and has type pointer to
|
||||
* const-qualified fenv_t.
|
||||
*
|
||||
* It can be used as an argument to the functions within the <fenv.h> header
|
||||
* that manage the floating-point environment.
|
||||
*/
|
||||
extern fenv_t __fe_dfl_env;
|
||||
#define FE_DFL_ENV ((const fenv_t *) &__fe_dfl_env)
|
||||
|
||||
/*
|
||||
* fexcept_t represents the floating-point status flags collectively, including
|
||||
* any status the implementation associates with the flags.
|
||||
*
|
||||
* A floating-point status flag is a system variable whose value is set (but
|
||||
* never cleared) when a floating-point exception is raised, which occurs as a
|
||||
* side effect of exceptional floating-point arithmetic to provide auxiliary
|
||||
* information.
|
||||
*
|
||||
* A floating-point control mode is a system variable whose value may be set by
|
||||
* the user to affect the subsequent behavior of floating-point arithmetic.
|
||||
*/
|
||||
typedef uint32_t fexcept_t;
|
||||
|
||||
#endif /* ! _X86_FENV_H_ */
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: float.h,v 1.12 2003/02/26 21:29:00 fvdl Exp $ */
|
||||
|
||||
#include <x86/float.h>
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: ieee.h,v 1.2 2003/02/26 21:29:01 fvdl Exp $ */
|
||||
|
||||
#include <x86/ieee.h>
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: ieeefp.h,v 1.3 2003/02/26 21:29:01 fvdl Exp $ */
|
||||
|
||||
#include <x86/ieeefp.h>
|
||||
@@ -1,56 +0,0 @@
|
||||
/* $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 _I386_INT_CONST_H_
|
||||
#define _I386_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 /* !_I386_INT_CONST_H_ */
|
||||
@@ -1,212 +0,0 @@
|
||||
/* $NetBSD: int_fmtio.h,v 1.7 2008/04/28 20:23:24 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 _I386_INT_FMTIO_H_
|
||||
#define _I386_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 "d" /* 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 "i" /* 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 "o" /* 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 "u" /* 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 "x" /* 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 "X" /* 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 "hhd" /* 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 "d" /* 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 "hhi" /* 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 "i" /* 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 "hho" /* 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 "o" /* 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 "hhu" /* 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 "u" /* 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 "hhx" /* 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 "x" /* uintptr_t */
|
||||
|
||||
#endif /* !_I386_INT_FMTIO_H_ */
|
||||
@@ -1,127 +0,0 @@
|
||||
/* $NetBSD: int_limits.h,v 1.8 2008/04/28 20:23:24 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 _I386_INT_LIMITS_H_
|
||||
#define _I386_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 (-0x7f-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 0x7f /* 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 0xff /* 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 (-0x7fffffff-1) /* intptr_t */
|
||||
#define INTPTR_MAX 0x7fffffff /* intptr_t */
|
||||
#define UINTPTR_MAX 0xffffffffU /* 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 (-0x7fffffff-1) /* ptrdiff_t */
|
||||
#define PTRDIFF_MAX 0x7fffffff /* 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 0xffffffffU /* size_t */
|
||||
|
||||
#endif /* !_I386_INT_LIMITS_H_ */
|
||||
@@ -1,87 +0,0 @@
|
||||
/* $NetBSD: int_mwgwtypes.h,v 1.6 2008/04/28 20:23:24 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 _I386_INT_MWGWTYPES_H_
|
||||
#define _I386_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 signed char int_fast8_t;
|
||||
typedef unsigned char 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 unsigned __COMPILER_INT64__ uintmax_t;
|
||||
#else
|
||||
/* LONGLONG */
|
||||
typedef long long int intmax_t;
|
||||
/* LONGLONG */
|
||||
typedef unsigned long long int uintmax_t;
|
||||
#endif
|
||||
|
||||
#endif /* !_I386_INT_MWGWTYPES_H_ */
|
||||
@@ -1,68 +0,0 @@
|
||||
/* $NetBSD: int_types.h,v 1.10 2005/12/24 20:07:10 perry 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 _I386_INT_TYPES_H_
|
||||
#define _I386_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 int __intptr_t;
|
||||
typedef unsigned int __uintptr_t;
|
||||
|
||||
#endif /* !_I386_INT_TYPES_H_ */
|
||||
@@ -1,94 +0,0 @@
|
||||
/* $NetBSD: limits.h,v 1.22 2010/06/07 13:52:30 tnozaki 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.
|
||||
*
|
||||
* @(#)limits.h 7.2 (Berkeley) 6/28/90
|
||||
*/
|
||||
|
||||
#ifndef _I386_LIMITS_H_
|
||||
#define _I386_LIMITS_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
#define CHAR_BIT 8 /* number of bits in a char */
|
||||
|
||||
#define SCHAR_MAX 0x7f /* max value for a signed char */
|
||||
#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */
|
||||
|
||||
#define UCHAR_MAX 0xff /* max value for an unsigned char */
|
||||
#define CHAR_MAX 0x7f /* max value for a char */
|
||||
#define CHAR_MIN (-0x7f-1) /* min value for a 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 INT_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 UINT_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 /* _I386_LIMITS_H_ */
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: math.h,v 1.5 2003/10/22 11:54:23 kleink Exp $ */
|
||||
|
||||
#include <x86/math.h>
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef _MACHINE_MCONTEXT_H
|
||||
#define _MACHINE_MCONTEXT_H 1
|
||||
|
||||
#include <machine/fpu.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;
|
||||
union fpu_state_u mc_fpu_state;
|
||||
short mc_fpu_flags;
|
||||
} mcontext_t;
|
||||
|
||||
__BEGIN_DECLS
|
||||
int setmcontext(const mcontext_t *mcp);
|
||||
int getmcontext(mcontext_t *mcp);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _MACHINE_MCONTEXT_H */
|
||||
@@ -1,143 +0,0 @@
|
||||
#ifndef __MULTIBOOT_H__
|
||||
#define __MULTIBOOT_H__
|
||||
|
||||
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||
|
||||
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
|
||||
|
||||
/* Must pass memory information to OS. */
|
||||
#define MULTIBOOT_PAGE_ALIGN 0x00000001
|
||||
|
||||
#define MULTIBOOT_MEMORY_INFO 0x00000002
|
||||
|
||||
#define MULTIBOOT_VIDEO_MODE 0x00000004
|
||||
|
||||
#define MULTIBOOT_AOUT_KLUDGE 0x00010000
|
||||
|
||||
/* consts used for Multiboot pre-init */
|
||||
|
||||
#define MULTIBOOT_VIDEO_MODE_EGA 1
|
||||
|
||||
#define MULTIBOOT_VIDEO_BUFFER 0xB8000
|
||||
|
||||
/* Usable lower memory chunk has a upper bound */
|
||||
#define MULTIBOOT_LOWER_MEM_MAX 0x7f800
|
||||
|
||||
#define MULTIBOOT_CONSOLE_LINES 25
|
||||
#define MULTIBOOT_CONSOLE_COLS 80
|
||||
|
||||
#define MULTIBOOT_VIDEO_BUFFER_BYTES \
|
||||
(MULTIBOOT_CONSOLE_LINES*MULTIBOOT_CONSOLE_COLS*2)
|
||||
|
||||
#define MULTIBOOT_STACK_SIZE 4096
|
||||
#define MULTIBOOT_PARAM_BUF_SIZE 1024
|
||||
|
||||
#define MULTIBOOT_MAX_MODS 20
|
||||
|
||||
/* Flags to be set in the ’flags’ member of the multiboot info structure. */
|
||||
|
||||
#define MULTIBOOT_INFO_MEMORY 0x00000001
|
||||
#define MULTIBOOT_INFO_MEM_MAP 0x00000040
|
||||
|
||||
/* Is there a boot device set? */
|
||||
#define MULTIBOOT_INFO_BOOTDEV 0x00000002
|
||||
|
||||
/* Is the command-line defined? */
|
||||
#define MULTIBOOT_INFO_CMDLINE 0x00000004
|
||||
|
||||
/* Are there modules to do something with? */
|
||||
#define MULTIBOOT_INFO_MODS 0x00000008
|
||||
|
||||
#define MULTIBOOT_HIGH_MEM_BASE 0x100000
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <sys/types.h>
|
||||
/* The symbol table for a.out. */
|
||||
struct multiboot_aout_symbol_table
|
||||
{
|
||||
u32_t tabsize;
|
||||
u32_t strsize;
|
||||
u32_t addr;
|
||||
u32_t reserved;
|
||||
};
|
||||
/* The section header table for ELF. */
|
||||
struct multiboot_elf_section_header_table
|
||||
{
|
||||
u32_t num;
|
||||
u32_t size;
|
||||
u32_t addr;
|
||||
u32_t shndx;
|
||||
};
|
||||
|
||||
typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;
|
||||
typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
|
||||
|
||||
struct multiboot_info
|
||||
{
|
||||
/* Multiboot info version number */
|
||||
u32_t flags;
|
||||
/* Available memory from BIOS */
|
||||
u32_t mem_lower_unused; /* minix uses memmap instead */
|
||||
u32_t mem_upper_unused;
|
||||
/* "root" partition */
|
||||
u32_t boot_device;
|
||||
/* Kernel command line */
|
||||
u32_t cmdline;
|
||||
/* Boot-Module list */
|
||||
u32_t mods_count;
|
||||
u32_t mods_addr;
|
||||
union
|
||||
{
|
||||
multiboot_aout_symbol_table_t aout_sym;
|
||||
multiboot_elf_section_header_table_t elf_sec;
|
||||
} u;
|
||||
/* Memory Mapping buffer */
|
||||
u32_t mmap_length;
|
||||
u32_t mmap_addr;
|
||||
/* Drive Info buffer */
|
||||
u32_t drives_length;
|
||||
u32_t drives_addr;
|
||||
/* ROM configuration table */
|
||||
u32_t config_table;
|
||||
/* Boot Loader Name */
|
||||
u32_t boot_loader_name;
|
||||
/* APM table */
|
||||
u32_t apm_table;
|
||||
/* Video */
|
||||
u32_t vbe_control_info;
|
||||
u32_t vbe_mode_info;
|
||||
u16_t vbe_mode;
|
||||
u16_t vbe_interface_seg;
|
||||
u16_t vbe_interface_off;
|
||||
u16_t vbe_interface_len;
|
||||
};
|
||||
typedef struct multiboot_info multiboot_info_t;
|
||||
|
||||
struct multiboot_mod_list
|
||||
{
|
||||
/* Memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
|
||||
u32_t mod_start;
|
||||
u32_t mod_end;
|
||||
/* Module command line */
|
||||
u32_t cmdline;
|
||||
/* Pad struct to 16 bytes (must be zero) */
|
||||
u32_t pad;
|
||||
};
|
||||
typedef struct multiboot_mod_list multiboot_module_t;
|
||||
|
||||
#define MULTIBOOT_MEMORY_AVAILABLE 1
|
||||
#define MULTIBOOT_MEMORY_RESERVED 2
|
||||
struct multiboot_mmap_entry
|
||||
{
|
||||
u32_t size;
|
||||
u64_t addr;
|
||||
u64_t len;
|
||||
#define MULTIBOOT_MEMORY_AVAILABLE 1
|
||||
#define MULTIBOOT_MEMORY_RESERVED 2
|
||||
u32_t type;
|
||||
} __attribute__((packed));
|
||||
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __MULTIBOOT_H__ */
|
||||
@@ -1,3 +0,0 @@
|
||||
/* $NetBSD: mutex.h,v 1.2 2007/02/09 21:55:05 ad Exp $ */
|
||||
|
||||
#include <x86/mutex.h>
|
||||
@@ -1,199 +0,0 @@
|
||||
/* $NetBSD: npx.h,v 1.25 2010/07/31 21:47:54 joerg 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.
|
||||
*
|
||||
* @(#)npx.h 5.3 (Berkeley) 1/18/91
|
||||
*/
|
||||
|
||||
/*
|
||||
* 287/387 NPX Coprocessor Data Structures and Constants
|
||||
* W. Jolitz 1/90
|
||||
*/
|
||||
|
||||
#ifndef _I386_NPX_H_
|
||||
#define _I386_NPX_H_
|
||||
|
||||
#ifndef __minix
|
||||
/* Environment information of floating point unit */
|
||||
struct env87 {
|
||||
long en_cw; /* control word (16bits) */
|
||||
long en_sw; /* status word (16bits) */
|
||||
long en_tw; /* tag word (16bits) */
|
||||
long en_fip; /* floating point instruction pointer */
|
||||
uint16_t en_fcs; /* floating code segment selector */
|
||||
uint16_t en_opcode; /* opcode last executed (11 bits ) */
|
||||
long en_foo; /* floating operand offset */
|
||||
long en_fos; /* floating operand segment selector */
|
||||
};
|
||||
|
||||
/* Contents of each floating point accumulator */
|
||||
struct fpacc87 {
|
||||
#ifdef dontdef /* too unportable */
|
||||
uint32_t fp_mantlo; /* mantissa low (31:0) */
|
||||
uint32_t fp_manthi; /* mantissa high (63:32) */
|
||||
int fp_exp:15; /* exponent */
|
||||
int fp_sgn:1; /* mantissa sign */
|
||||
#else
|
||||
uint8_t fp_bytes[10];
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Floating point context */
|
||||
struct save87 {
|
||||
struct env87 sv_env; /* floating point control/status */
|
||||
struct fpacc87 sv_ac[8]; /* accumulator contents, 0-7 */
|
||||
#ifndef dontdef
|
||||
uint32_t sv_ex_sw; /* status word for last exception (was pad) */
|
||||
uint32_t sv_ex_tw; /* tag word for last exception (was pad) */
|
||||
uint8_t sv_pad[8 * 2 - 2 * 4]; /* bogus historical padding */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Environment of FPU/MMX/SSE/SSE2. */
|
||||
struct envxmm {
|
||||
/*0*/ uint16_t en_cw; /* FPU Control Word */
|
||||
uint16_t en_sw; /* FPU Status Word */
|
||||
uint8_t en_tw; /* FPU Tag Word (abridged) */
|
||||
uint8_t en_rsvd0;
|
||||
uint16_t en_opcode; /* FPU Opcode */
|
||||
uint32_t en_fip; /* FPU Instruction Pointer */
|
||||
uint16_t en_fcs; /* FPU IP selector */
|
||||
uint16_t en_rsvd1;
|
||||
/*16*/ uint32_t en_foo; /* FPU Data pointer */
|
||||
uint16_t en_fos; /* FPU Data pointer selector */
|
||||
uint16_t en_rsvd2;
|
||||
uint32_t en_mxcsr; /* MXCSR Register State */
|
||||
uint32_t en_rsvd3;
|
||||
};
|
||||
|
||||
/* FPU regsters in the extended save format. */
|
||||
struct fpaccxmm {
|
||||
uint8_t fp_bytes[10];
|
||||
uint8_t fp_rsvd[6];
|
||||
};
|
||||
|
||||
/* SSE/SSE2 registers. */
|
||||
struct xmmreg {
|
||||
uint8_t sse_bytes[16];
|
||||
};
|
||||
|
||||
/* FPU/MMX/SSE/SSE2 context */
|
||||
struct savexmm {
|
||||
struct envxmm sv_env; /* control/status context */
|
||||
struct fpaccxmm sv_ac[8]; /* ST/MM regs */
|
||||
struct xmmreg sv_xmmregs[8]; /* XMM regs */
|
||||
uint8_t sv_rsvd[16 * 14];
|
||||
/* 512-bytes --- end of hardware portion of save area */
|
||||
uint32_t sv_ex_sw; /* saved SW from last exception */
|
||||
uint32_t sv_ex_tw; /* saved TW from last exception */
|
||||
} __aligned(16);
|
||||
|
||||
union savefpu {
|
||||
struct save87 sv_87;
|
||||
struct savexmm sv_xmm;
|
||||
};
|
||||
#endif /* !__minix */
|
||||
|
||||
/*
|
||||
* The i387 defaults to Intel extended precision mode and round to nearest,
|
||||
* with all exceptions masked.
|
||||
*/
|
||||
#define __INITIAL_NPXCW__ 0x037f
|
||||
/* NetBSD uses IEEE double precision. */
|
||||
#define __NetBSD_NPXCW__ 0x127f
|
||||
/* FreeBSD leaves some exceptions unmasked as well. */
|
||||
#define __FreeBSD_NPXCW__ 0x1272
|
||||
/* iBCS2 goes a bit further and leaves the underflow exception unmasked. */
|
||||
#define __iBCS2_NPXCW__ 0x0262
|
||||
/* Linux just uses the default control word. */
|
||||
#define __Linux_NPXCW__ 0x037f
|
||||
/* SVR4 uses the same control word as iBCS2. */
|
||||
#define __SVR4_NPXCW__ 0x0262
|
||||
|
||||
/*
|
||||
* The default MXCSR value at reset is 0x1f80, IA-32 Instruction
|
||||
* Set Reference, pg. 3-369.
|
||||
*/
|
||||
#define __INITIAL_MXCSR__ 0x1f80
|
||||
|
||||
|
||||
/*
|
||||
* 80387 control word bits
|
||||
*/
|
||||
#define EN_SW_INVOP 0x0001 /* Invalid operation */
|
||||
#define EN_SW_DENORM 0x0002 /* Denormalized operand */
|
||||
#define EN_SW_ZERODIV 0x0004 /* Divide by zero */
|
||||
#define EN_SW_OVERFLOW 0x0008 /* Overflow */
|
||||
#define EN_SW_UNDERFLOW 0x0010 /* Underflow */
|
||||
#define EN_SW_PRECLOSS 0x0020 /* Loss of precision */
|
||||
#define EN_SW_DATACHAIN 0x0080 /* Data chain exception */
|
||||
#define EN_SW_CTL_PREC 0x0300 /* Precision control */
|
||||
#define EN_SW_CTL_ROUND 0x0c00 /* Rounding control */
|
||||
#define EN_SW_CTL_INF 0x1000 /* Infinity control */
|
||||
|
||||
/*
|
||||
* The standard control word from finit is 0x37F, giving:
|
||||
* round to nearest
|
||||
* 64-bit precision
|
||||
* all exceptions masked.
|
||||
*
|
||||
* Now we want:
|
||||
* affine mode (if we decide to support 287's)
|
||||
* round to nearest
|
||||
* 53-bit precision
|
||||
* all exceptions masked.
|
||||
*
|
||||
* 64-bit precision often gives bad results with high level languages
|
||||
* because it makes the results of calculations depend on whether
|
||||
* intermediate values are stored in memory or in FPU registers.
|
||||
*
|
||||
* The iBCS control word has underflow, overflow, zero divide, and invalid
|
||||
* operation exceptions unmasked. But that causes an unexpected exception
|
||||
* in the test program 'paranoia' and makes denormals useless (DBL_MIN / 2
|
||||
* underflows). It doesn't make a lot of sense to trap underflow without
|
||||
* trapping denormals.
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
void probeintr(void);
|
||||
void probetrap(void);
|
||||
int npx586bug1(int, int);
|
||||
void npxinit(struct cpu_info *);
|
||||
void process_xmm_to_s87(const struct savexmm *, struct save87 *);
|
||||
void process_s87_to_xmm(const struct save87 *, struct savexmm *);
|
||||
struct lwp;
|
||||
int npxtrap(struct lwp *);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* !_I386_NPX_H_ */
|
||||
@@ -1,94 +0,0 @@
|
||||
/* $NetBSD: param.h,v 1.72 2010/02/08 19:02:29 joerg 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.
|
||||
*
|
||||
* @(#)param.h 5.8 (Berkeley) 6/28/91
|
||||
*/
|
||||
|
||||
#ifndef _I386_PARAM_H_
|
||||
#define _I386_PARAM_H_
|
||||
|
||||
/*
|
||||
* Machine dependent constants for Intel 386.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Round p (pointer or byte index) up to a correctly-aligned value
|
||||
* for all data types (int, long, ...). The result is u_int and
|
||||
* must be cast to any desired pointer type.
|
||||
*
|
||||
* 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 ALIGNBYTES (sizeof(int) - 1)
|
||||
#define ALIGN(p) (((u_int)(u_long)(p) + ALIGNBYTES) &~ \
|
||||
ALIGNBYTES)
|
||||
#define ALIGNED_POINTER(p,t) 1
|
||||
|
||||
#define PGSHIFT 12 /* LOG2(NBPG) */
|
||||
#define NBPG (1 << PGSHIFT) /* bytes/page */
|
||||
#define PGOFSET (NBPG-1) /* byte offset into page */
|
||||
#define NPTEPG (NBPG/(sizeof (pt_entry_t)))
|
||||
|
||||
#ifndef MAXPHYS
|
||||
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
|
||||
#endif
|
||||
|
||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||
#define DEV_BSIZE (1 << DEV_BSHIFT)
|
||||
|
||||
/*
|
||||
* Mach derived conversion macros
|
||||
*/
|
||||
#define x86_round_pdr(x) \
|
||||
((((unsigned long)(x)) + (NBPD_L2 - 1)) & ~(NBPD_L2 - 1))
|
||||
#define x86_trunc_pdr(x) ((unsigned long)(x) & ~(NBPD_L2 - 1))
|
||||
#define x86_btod(x) ((unsigned long)(x) >> L2_SHIFT)
|
||||
#define x86_dtob(x) ((unsigned long)(x) << L2_SHIFT)
|
||||
#define x86_round_page(x) ((((paddr_t)(x)) + PGOFSET) & ~PGOFSET)
|
||||
#define x86_trunc_page(x) ((paddr_t)(x) & ~PGOFSET)
|
||||
#define x86_btop(x) ((paddr_t)(x) >> PGSHIFT)
|
||||
#define x86_ptob(x) ((paddr_t)(x) << PGSHIFT)
|
||||
|
||||
#ifdef __minix
|
||||
/* Minix expect to find in this file PAGE_* defines. */
|
||||
#include <machine/vmparam.h>
|
||||
|
||||
#define trunc_page(x) x86_trunc_page(x)
|
||||
#define round_page(x) x86_round_page(x)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _I386_PARAM_H_ */
|
||||
@@ -1,137 +0,0 @@
|
||||
/* $NetBSD: profile.h,v 1.33 2007/12/20 23:46:13 ad Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 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.
|
||||
*
|
||||
* @(#)profile.h 8.1 (Berkeley) 6/11/93
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_multiprocessor.h"
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <machine/cpufunc.h>
|
||||
#include <machine/lock.h>
|
||||
#endif
|
||||
|
||||
#define _MCOUNT_DECL static __inline void _mcount
|
||||
|
||||
#ifdef __ELF__
|
||||
#define MCOUNT_ENTRY "__mcount"
|
||||
#define MCOUNT_COMPAT __weak_alias(mcount, __mcount)
|
||||
#else
|
||||
#define MCOUNT_ENTRY "mcount"
|
||||
#define MCOUNT_COMPAT /* nothing */
|
||||
#endif
|
||||
|
||||
#define MCOUNT \
|
||||
MCOUNT_COMPAT \
|
||||
extern void mcount(void) __asm(MCOUNT_ENTRY) \
|
||||
__attribute__((__no_instrument_function__)); \
|
||||
void \
|
||||
mcount(void) \
|
||||
{ \
|
||||
int selfpc, frompcindex; \
|
||||
int eax, ecx, edx; \
|
||||
\
|
||||
__asm volatile("movl %%eax,%0" : "=g" (eax)); \
|
||||
__asm volatile("movl %%ecx,%0" : "=g" (ecx)); \
|
||||
__asm volatile("movl %%edx,%0" : "=g" (edx)); \
|
||||
/* \
|
||||
* find the return address for mcount, \
|
||||
* and the return address for mcount's caller. \
|
||||
* \
|
||||
* selfpc = pc pushed by mcount call \
|
||||
*/ \
|
||||
__asm volatile("movl 4(%%ebp),%0" : "=r" (selfpc)); \
|
||||
/* \
|
||||
* frompcindex = pc pushed by call into self. \
|
||||
*/ \
|
||||
__asm volatile("movl (%%ebp),%0;movl 4(%0),%0" \
|
||||
: "=r" (frompcindex)); \
|
||||
_mcount((u_long)frompcindex, (u_long)selfpc); \
|
||||
\
|
||||
__asm volatile("movl %0,%%edx" : : "g" (edx)); \
|
||||
__asm volatile("movl %0,%%ecx" : : "g" (ecx)); \
|
||||
__asm volatile("movl %0,%%eax" : : "g" (eax)); \
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifdef MULTIPROCESSOR
|
||||
__cpu_simple_lock_t __mcount_lock;
|
||||
|
||||
static inline void
|
||||
MCOUNT_ENTER_MP(void)
|
||||
{
|
||||
__cpu_simple_lock(&__mcount_lock);
|
||||
__insn_barrier();
|
||||
}
|
||||
|
||||
static inline void
|
||||
MCOUNT_EXIT_MP(void)
|
||||
{
|
||||
__insn_barrier();
|
||||
__mcount_lock = __SIMPLELOCK_UNLOCKED;
|
||||
}
|
||||
#else
|
||||
#define MCOUNT_ENTER_MP()
|
||||
#define MCOUNT_EXIT_MP()
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
mcount_disable_intr(void)
|
||||
{
|
||||
__asm volatile("cli");
|
||||
}
|
||||
|
||||
static inline u_long
|
||||
mcount_read_psl(void)
|
||||
{
|
||||
u_long ef;
|
||||
|
||||
__asm volatile("pushfl; popl %0" : "=r" (ef));
|
||||
return (ef);
|
||||
}
|
||||
|
||||
static inline void
|
||||
mcount_write_psl(u_long ef)
|
||||
{
|
||||
__asm volatile("pushl %0; popfl" : : "r" (ef));
|
||||
}
|
||||
|
||||
#define MCOUNT_ENTER \
|
||||
s = (int)mcount_read_psl(); \
|
||||
mcount_disable_intr(); \
|
||||
MCOUNT_ENTER_MP();
|
||||
|
||||
#define MCOUNT_EXIT \
|
||||
MCOUNT_EXIT_MP(); \
|
||||
mcount_write_psl(s);
|
||||
|
||||
#endif /* _KERNEL */
|
||||
@@ -1,7 +0,0 @@
|
||||
/* $NetBSD: setjmp.h,v 1.2 1998/09/14 21:31:52 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* machine/setjmp.h: machine dependent setjmp-related information.
|
||||
*/
|
||||
|
||||
#define _JBLEN 13 /* size, in longs, of a jmp_buf */
|
||||
@@ -1,63 +0,0 @@
|
||||
#ifndef _I386_SIGNAL_H_
|
||||
#define _I386_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>
|
||||
#include <machine/fpu.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 trap_style; /* how should context be restored? KTS_* */
|
||||
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 */
|
||||
union fpu_state_u sc_fpu_state;
|
||||
};
|
||||
|
||||
#define sc_gs sc_regs.gs
|
||||
#define sc_fs sc_regs.fs
|
||||
#define sc_es sc_regs.es
|
||||
#define sc_ds sc_regs.ds
|
||||
#define sc_di sc_regs.di
|
||||
#define sc_si sc_regs.si
|
||||
#define sc_fp sc_regs.bp
|
||||
#define sc_st sc_regs.st /* stack top -- used in kernel */
|
||||
#define sc_bx sc_regs.bx
|
||||
#define sc_dx sc_regs.dx
|
||||
#define sc_cx sc_regs.cx
|
||||
#define sc_retreg sc_regs.retreg
|
||||
#define sc_retadr sc_regs.retadr /* return address to caller of
|
||||
save -- used in kernel */
|
||||
#define sc_pc sc_regs.pc
|
||||
#define sc_cs sc_regs.cs
|
||||
#define sc_psw sc_regs.psw
|
||||
#define sc_sp sc_regs.sp
|
||||
#define sc_ss sc_regs.ss
|
||||
|
||||
#ifdef _MINIX
|
||||
__BEGIN_DECLS
|
||||
int sigreturn(struct sigcontext *_scp);
|
||||
__END_DECLS
|
||||
#endif /* _MINIX */
|
||||
|
||||
#endif /* !_I386_SIGNAL_H_ */
|
||||
@@ -1,120 +0,0 @@
|
||||
/* $NetBSD: types.h,v 1.70 2010/12/22 04:15:02 christos 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.
|
||||
*
|
||||
* @(#)types.h 7.5 (Berkeley) 3/9/91
|
||||
*/
|
||||
|
||||
#ifndef _I386_MACHTYPES_H_
|
||||
#define _I386_MACHTYPES_H_
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_xen.h"
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/featuretest.h>
|
||||
#include <machine/int_types.h>
|
||||
|
||||
#if defined(_KERNEL)
|
||||
typedef struct label_t {
|
||||
int val[6];
|
||||
} label_t;
|
||||
#endif
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#if defined(_KERNEL)
|
||||
|
||||
/*
|
||||
* XXX JYM for now, in kernel paddr_t can be 32 or 64 bits, depending
|
||||
* on PAE. Revisit when paddr_t becomes 64 bits for !PAE systems.
|
||||
*/
|
||||
#ifdef PAE
|
||||
typedef __uint64_t paddr_t;
|
||||
typedef __uint64_t psize_t;
|
||||
#define PRIxPADDR "llx"
|
||||
#define PRIxPSIZE "llx"
|
||||
#define PRIuPSIZE "llu"
|
||||
#else /* PAE */
|
||||
typedef unsigned long paddr_t;
|
||||
typedef unsigned long psize_t;
|
||||
#define PRIxPADDR "lx"
|
||||
#define PRIxPSIZE "lx"
|
||||
#define PRIuPSIZE "lu"
|
||||
#endif /* PAE */
|
||||
|
||||
#else /* _KERNEL */
|
||||
/* paddr_t is always 64 bits for userland */
|
||||
typedef __uint64_t paddr_t;
|
||||
typedef __uint64_t psize_t;
|
||||
#define PRIxPADDR "llx"
|
||||
#define PRIxPSIZE "llx"
|
||||
#define PRIuPSIZE "llu"
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
typedef unsigned long vaddr_t;
|
||||
typedef unsigned long vsize_t;
|
||||
#define PRIxVADDR "lx"
|
||||
#define PRIxVSIZE "lx"
|
||||
#define PRIuVSIZE "lu"
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
|
||||
typedef int pmc_evid_t;
|
||||
typedef __uint64_t pmc_ctr_t;
|
||||
typedef int register_t;
|
||||
#define PRIxREGISTER "x"
|
||||
|
||||
typedef volatile unsigned char __cpu_simple_lock_t;
|
||||
|
||||
/* __cpu_simple_lock_t used to be a full word. */
|
||||
#define __CPU_SIMPLE_LOCK_PAD
|
||||
|
||||
#define __SIMPLELOCK_LOCKED 1
|
||||
#define __SIMPLELOCK_UNLOCKED 0
|
||||
|
||||
/* The x86 does not have strict alignment requirements. */
|
||||
#define __NO_STRICT_ALIGNMENT
|
||||
|
||||
#define __HAVE_DEVICE_REGISTER
|
||||
#define __HAVE_CPU_DATA_FIRST
|
||||
#define __HAVE_CPU_COUNTER
|
||||
#define __HAVE_MD_CPU_OFFLINE
|
||||
#define __HAVE_SYSCALL_INTERN
|
||||
#define __HAVE_MINIMAL_EMUL
|
||||
#define __HAVE_OLD_DISKLABEL
|
||||
#define __HAVE_ATOMIC64_OPS
|
||||
#define __HAVE_ATOMIC_AS_MEMBAR
|
||||
#define __HAVE_CPU_LWP_SETPRIVATE
|
||||
#define __HAVE_INTR_CONTROL
|
||||
|
||||
#if defined(_KERNEL)
|
||||
#define __HAVE_RAS
|
||||
#endif
|
||||
|
||||
#endif /* _I386_MACHTYPES_H_ */
|
||||
@@ -1,52 +0,0 @@
|
||||
/* $NetBSD: vmparam.h,v 1.72 2010/11/14 13:33:21 uebayasi 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.
|
||||
*
|
||||
* @(#)vmparam.h 5.9 (Berkeley) 5/12/91
|
||||
*/
|
||||
|
||||
#ifndef _I386_VMPARAM_H_
|
||||
#define _I386_VMPARAM_H_
|
||||
|
||||
/*
|
||||
* Machine dependent constants for 386.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Page size on the IA-32 is not variable in the traditional sense.
|
||||
* We override the PAGE_* definitions to compile-time constants.
|
||||
*/
|
||||
#define PAGE_SHIFT 12
|
||||
#define PAGE_SIZE (1 << PAGE_SHIFT)
|
||||
#define PAGE_MASK (PAGE_SIZE - 1)
|
||||
|
||||
#endif /* _I386_VMPARAM_H_ */
|
||||
@@ -1,47 +0,0 @@
|
||||
/* $NetBSD: wchar_limits.h,v 1.2 2008/04/28 20:23:24 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 _I386_WCHAR_LIMITS_H_
|
||||
#define _I386_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 /* !_I386_WCHAR_LIMITS_H_ */
|
||||
@@ -1,11 +0,0 @@
|
||||
# $NetBSD: Makefile,v 1.13 2008/05/11 15:32:20 ad Exp $
|
||||
|
||||
INCSDIR=/usr/include/x86
|
||||
|
||||
INCS= float.h \
|
||||
ieee.h \
|
||||
ieeefp.h \
|
||||
math.h \
|
||||
mutex.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
@@ -1,27 +0,0 @@
|
||||
/* $NetBSD: float.h,v 1.5 2003/10/23 23:26:06 kleink Exp $ */
|
||||
|
||||
#ifndef _X86_FLOAT_H_
|
||||
#define _X86_FLOAT_H_
|
||||
|
||||
#define LDBL_MANT_DIG 64
|
||||
#define LDBL_EPSILON 1.0842021724855044340E-19L
|
||||
#define LDBL_DIG 18
|
||||
#define LDBL_MIN_EXP (-16381)
|
||||
#define LDBL_MIN 3.3621031431120935063E-4932L
|
||||
#define LDBL_MIN_10_EXP (-4931)
|
||||
#define LDBL_MAX_EXP 16384
|
||||
#define LDBL_MAX 1.1897314953572317650E+4932L
|
||||
#define LDBL_MAX_10_EXP 4932
|
||||
|
||||
#include <sys/float_ieee754.h>
|
||||
|
||||
#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 /* _X86_FLOAT_H_ */
|
||||
@@ -1,117 +0,0 @@
|
||||
/* $NetBSD: ieee.h,v 1.11 2010/09/15 16:11:28 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This software was developed by the Computer Systems Engineering group
|
||||
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
|
||||
* contributed to Berkeley.
|
||||
*
|
||||
* All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Lawrence Berkeley Laboratory.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @(#)ieee.h 8.1 (Berkeley) 6/11/93
|
||||
*/
|
||||
|
||||
/*
|
||||
* ieee.h defines the machine-dependent layout of the machine's IEEE
|
||||
* floating point. It does *not* define (yet?) any of the rounding
|
||||
* mode bits, exceptions, and so forth.
|
||||
*/
|
||||
|
||||
#include <sys/ieee754.h>
|
||||
|
||||
#define EXT_EXPBITS 15
|
||||
#define EXT_FRACHBITS 32
|
||||
#define EXT_FRACLBITS 32
|
||||
#define EXT_FRACBITS (EXT_FRACLBITS + EXT_FRACHBITS)
|
||||
|
||||
#define EXT_TO_ARRAY32(u, a) do { \
|
||||
(a)[0] = (uint32_t)(u).extu_ext.ext_fracl; \
|
||||
(a)[1] = (uint32_t)(u).extu_ext.ext_frach; \
|
||||
} while(/*CONSTCOND*/0)
|
||||
|
||||
/*
|
||||
* struct ieee_ext is the raw storage layout of the 80-bit
|
||||
* extended-precision type as implemented by the FPU. Per the
|
||||
* respective ABI specifications, it is followed by a tail padding of
|
||||
*
|
||||
* amd64: 48 bits,
|
||||
* i386: 16 bits.
|
||||
*/
|
||||
struct ieee_ext {
|
||||
u_int ext_fracl:EXT_FRACLBITS;
|
||||
u_int ext_frach:EXT_FRACHBITS;
|
||||
#if 0
|
||||
u_int ext_int:1;
|
||||
#endif
|
||||
u_int ext_exp:EXT_EXPBITS;
|
||||
u_int ext_sign:1;
|
||||
};
|
||||
|
||||
/*
|
||||
* Floats whose exponent is in [1..INFNAN) (of whatever type) are
|
||||
* `normal'. Floats whose exponent is INFNAN are either Inf or NaN.
|
||||
* Floats whose exponent is zero are either zero (iff all fraction
|
||||
* bits are zero) or subnormal values.
|
||||
*
|
||||
* 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'.
|
||||
*/
|
||||
#define EXT_EXP_INFNAN 0x7fff
|
||||
#define EXT_EXP_INF 0x7fff
|
||||
#define EXT_EXP_NAN 0x7fff
|
||||
|
||||
#if 0
|
||||
#define SNG_QUIETNAN (1 << 22)
|
||||
#define DBL_QUIETNAN (1 << 19)
|
||||
#define EXT_QUIETNAN (1 << 30)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Exponent biases.
|
||||
*/
|
||||
#define EXT_EXP_BIAS 16383
|
||||
|
||||
/*
|
||||
* Convenience data structures.
|
||||
*/
|
||||
union ieee_ext_u {
|
||||
long double extu_ld;
|
||||
struct ieee_ext extu_ext;
|
||||
};
|
||||
|
||||
#define extu_exp extu_ext.ext_exp
|
||||
#define extu_sign extu_ext.ext_sign
|
||||
#define extu_fracl extu_ext.ext_fracl
|
||||
#define extu_frach extu_ext.ext_frach
|
||||
|
||||
#define LDBL_NBIT 0x80000000
|
||||
#define mask_nbit_l(u) ((u).extu_frach &= ~LDBL_NBIT)
|
||||
@@ -1,29 +0,0 @@
|
||||
/* $NetBSD: ieeefp.h,v 1.3 2010/07/31 21:47:54 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Written by J.T. Conklin, Apr 6, 1995
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#ifndef _X86_IEEEFP_H_
|
||||
#define _X86_IEEEFP_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
#include <machine/fenv.h>
|
||||
|
||||
typedef int fp_except;
|
||||
#define FP_X_INV FE_INVALID /* invalid operation exception */
|
||||
#define FP_X_DNML FE_DENORMAL /* denormalization 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 (loss of precision) */
|
||||
|
||||
typedef enum {
|
||||
FP_RN=FE_TONEAREST, /* round to nearest representable number */
|
||||
FP_RM=FE_DOWNWARD, /* round toward negative infinity */
|
||||
FP_RP=FE_UPWARD, /* round toward positive infinity */
|
||||
FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */
|
||||
} fp_rnd;
|
||||
|
||||
#endif /* _X86_IEEEFP_H_ */
|
||||
@@ -1,4 +0,0 @@
|
||||
/* $NetBSD: math.h,v 1.2 2003/10/28 00:55:28 kleink Exp $ */
|
||||
|
||||
#define __HAVE_LONG_DOUBLE
|
||||
#define __HAVE_NANF
|
||||
@@ -1,80 +0,0 @@
|
||||
/* $NetBSD: mutex.h,v 1.6 2009/04/24 17:49:51 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002, 2006, 2009 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 _X86_MUTEX_H_
|
||||
#define _X86_MUTEX_H_
|
||||
|
||||
struct kmutex {
|
||||
union {
|
||||
volatile uintptr_t mtxa_owner;
|
||||
#ifdef __MUTEX_PRIVATE
|
||||
struct {
|
||||
volatile uint8_t mtxs_dummy;
|
||||
ipl_cookie_t mtxs_ipl;
|
||||
__cpu_simple_lock_t mtxs_lock;
|
||||
volatile uint8_t mtxs_unused;
|
||||
} s;
|
||||
#endif
|
||||
} u;
|
||||
};
|
||||
|
||||
#ifdef __MUTEX_PRIVATE
|
||||
|
||||
#define mtx_owner u.mtxa_owner
|
||||
#define mtx_ipl u.s.mtxs_ipl
|
||||
#define mtx_lock u.s.mtxs_lock
|
||||
|
||||
#define __HAVE_MUTEX_STUBS 1
|
||||
#define __HAVE_SPIN_MUTEX_STUBS 1
|
||||
#define __HAVE_SIMPLE_MUTEXES 1
|
||||
|
||||
/*
|
||||
* MUTEX_RECEIVE: technically, no memory barrier is required
|
||||
* as 'ret' implies a load fence. However we need this to
|
||||
* handle a bug with some Opteron revisions. See patch.c,
|
||||
* lock_stubs.S.
|
||||
*/
|
||||
#define MUTEX_RECEIVE(mtx) membar_consumer()
|
||||
|
||||
/*
|
||||
* MUTEX_GIVE: no memory barrier required, as _lock_cas() will take care of it.
|
||||
*/
|
||||
#define MUTEX_GIVE(mtx) /* nothing */
|
||||
|
||||
#define MUTEX_CAS(p, o, n) \
|
||||
(_atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
|
||||
|
||||
unsigned long _atomic_cas_ulong(volatile unsigned long *,
|
||||
unsigned long, unsigned long);
|
||||
|
||||
#endif /* __MUTEX_PRIVATE */
|
||||
|
||||
#endif /* _X86_MUTEX_H_ */
|
||||
@@ -1,6 +1,6 @@
|
||||
INCSDIR= /usr/include/net
|
||||
|
||||
INCS+= hton.h ethertypes.h if.h if_ether.h netlib.h
|
||||
INCS+= hton.h if.h netlib.h
|
||||
|
||||
SUBDIR+= gen
|
||||
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
/* $NetBSD: ethertypes.h,v 1.17 2005/12/10 23:21:38 elad Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 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.
|
||||
*
|
||||
* @(#)if_ether.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
/*
|
||||
* Ethernet protocol types.
|
||||
*
|
||||
* According to "assigned numbers", the Ethernet protocol numbers are also
|
||||
* used as ARP protocol type numbers.
|
||||
*
|
||||
* I factor them out here to avoid pulling all the Ethernet header file
|
||||
* into the hardware independent ARP code. -is
|
||||
*
|
||||
* Additional sources of information:
|
||||
* http://www.mit.edu/~map/Ethernet/Ethernet.txt
|
||||
* ftp://venera.isi.edu/in-notes/iana/assignments/ethernet-numbers
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _NET_ETHERTYPES_H_
|
||||
#define _NET_ETHERTYPES_H_
|
||||
|
||||
/*
|
||||
* NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
|
||||
* However, there are some conflicts.
|
||||
*/
|
||||
|
||||
#define ETHERTYPE_8023 0x0004 /* IEEE 802.3 packet */
|
||||
/* 0x0101 .. 0x1FF Experimental */
|
||||
#define ETHERTYPE_PUP 0x0200 /* Xerox PUP protocol - see 0A00 */
|
||||
#define ETHERTYPE_PUPAT 0x0200 /* PUP Address Translation - see 0A01 */
|
||||
#define ETHERTYPE_SPRITE 0x0500 /* ??? */
|
||||
/* 0x0400 Nixdorf */
|
||||
#define ETHERTYPE_NS 0x0600 /* XNS */
|
||||
#define ETHERTYPE_NSAT 0x0601 /* XNS Address Translation (3Mb only) */
|
||||
#define ETHERTYPE_DLOG1 0x0660 /* DLOG (?) */
|
||||
#define ETHERTYPE_DLOG2 0x0661 /* DLOG (?) */
|
||||
#define ETHERTYPE_IP 0x0800 /* IP protocol */
|
||||
#define ETHERTYPE_X75 0x0801 /* X.75 Internet */
|
||||
#define ETHERTYPE_NBS 0x0802 /* NBS Internet */
|
||||
#define ETHERTYPE_ECMA 0x0803 /* ECMA Internet */
|
||||
#define ETHERTYPE_CHAOS 0x0804 /* CHAOSnet */
|
||||
#define ETHERTYPE_X25 0x0805 /* X.25 Level 3 */
|
||||
#define ETHERTYPE_ARP 0x0806 /* Address resolution protocol */
|
||||
#define ETHERTYPE_NSCOMPAT 0x0807 /* XNS Compatibility */
|
||||
#define ETHERTYPE_FRARP 0x0808 /* Frame Relay ARP (RFC1701) */
|
||||
/* 0x081C Symbolics Private */
|
||||
/* 0x0888 - 0x088A Xyplex */
|
||||
#define ETHERTYPE_UBDEBUG 0x0900 /* Ungermann-Bass network debugger */
|
||||
#define ETHERTYPE_IEEEPUP 0x0A00 /* Xerox IEEE802.3 PUP */
|
||||
#define ETHERTYPE_IEEEPUPAT 0x0A01 /* Xerox IEEE802.3 PUP Address Translation */
|
||||
#define ETHERTYPE_VINES 0x0BAD /* Banyan VINES */
|
||||
#define ETHERTYPE_VINESLOOP 0x0BAE /* Banyan VINES Loopback */
|
||||
#define ETHERTYPE_VINESECHO 0x0BAF /* Banyan VINES Echo */
|
||||
|
||||
/* 0x1000 - 0x100F Berkeley Trailer */
|
||||
/*
|
||||
* The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
|
||||
* (type-ETHERTYPE_TRAIL)*512 bytes of data followed
|
||||
* by an ETHER type (as given above) and then the (variable-length) header.
|
||||
*/
|
||||
#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
|
||||
#define ETHERTYPE_NTRAILER 16
|
||||
|
||||
#define ETHERTYPE_DCA 0x1234 /* DCA - Multicast */
|
||||
#define ETHERTYPE_VALID 0x1600 /* VALID system protocol */
|
||||
#define ETHERTYPE_DOGFIGHT 0x1989 /* Artificial Horizons ("Aviator" dogfight simulator [on Sun]) */
|
||||
#define ETHERTYPE_RCL 0x1995 /* Datapoint Corporation (RCL lan protocol) */
|
||||
|
||||
/* The following 3C0x types
|
||||
are unregistered: */
|
||||
#define ETHERTYPE_NBPVCD 0x3C00 /* 3Com NBP virtual circuit datagram (like XNS SPP) not registered */
|
||||
#define ETHERTYPE_NBPSCD 0x3C01 /* 3Com NBP System control datagram not registered */
|
||||
#define ETHERTYPE_NBPCREQ 0x3C02 /* 3Com NBP Connect request (virtual cct) not registered */
|
||||
#define ETHERTYPE_NBPCRSP 0x3C03 /* 3Com NBP Connect repsonse not registered */
|
||||
#define ETHERTYPE_NBPCC 0x3C04 /* 3Com NBP Connect complete not registered */
|
||||
#define ETHERTYPE_NBPCLREQ 0x3C05 /* 3Com NBP Close request (virtual cct) not registered */
|
||||
#define ETHERTYPE_NBPCLRSP 0x3C06 /* 3Com NBP Close response not registered */
|
||||
#define ETHERTYPE_NBPDG 0x3C07 /* 3Com NBP Datagram (like XNS IDP) not registered */
|
||||
#define ETHERTYPE_NBPDGB 0x3C08 /* 3Com NBP Datagram broadcast not registered */
|
||||
#define ETHERTYPE_NBPCLAIM 0x3C09 /* 3Com NBP Claim NetBIOS name not registered */
|
||||
#define ETHERTYPE_NBPDLTE 0x3C0A /* 3Com NBP Delete Netbios name not registered */
|
||||
#define ETHERTYPE_NBPRAS 0x3C0B /* 3Com NBP Remote adaptor status request not registered */
|
||||
#define ETHERTYPE_NBPRAR 0x3C0C /* 3Com NBP Remote adaptor response not registered */
|
||||
#define ETHERTYPE_NBPRST 0x3C0D /* 3Com NBP Reset not registered */
|
||||
|
||||
#define ETHERTYPE_PCS 0x4242 /* PCS Basic Block Protocol */
|
||||
#define ETHERTYPE_IMLBLDIAG 0x424C /* Information Modes Little Big LAN diagnostic */
|
||||
#define ETHERTYPE_DIDDLE 0x4321 /* THD - Diddle */
|
||||
#define ETHERTYPE_IMLBL 0x4C42 /* Information Modes Little Big LAN */
|
||||
#define ETHERTYPE_SIMNET 0x5208 /* BBN Simnet Private */
|
||||
#define ETHERTYPE_DECEXPER 0x6000 /* DEC Unassigned, experimental */
|
||||
#define ETHERTYPE_MOPDL 0x6001 /* DEC MOP dump/load */
|
||||
#define ETHERTYPE_MOPRC 0x6002 /* DEC MOP remote console */
|
||||
#define ETHERTYPE_DECnet 0x6003 /* DEC DECNET Phase IV route */
|
||||
#define ETHERTYPE_DN ETHERTYPE_DECnet /* libpcap, tcpdump */
|
||||
#define ETHERTYPE_LAT 0x6004 /* DEC LAT */
|
||||
#define ETHERTYPE_DECDIAG 0x6005 /* DEC diagnostic protocol (at interface initialization?) */
|
||||
#define ETHERTYPE_DECCUST 0x6006 /* DEC customer protocol */
|
||||
#define ETHERTYPE_SCA 0x6007 /* DEC LAVC, SCA */
|
||||
#define ETHERTYPE_AMBER 0x6008 /* DEC AMBER */
|
||||
#define ETHERTYPE_DECMUMPS 0x6009 /* DEC MUMPS */
|
||||
/* 0x6010 - 0x6014 3Com Corporation */
|
||||
#define ETHERTYPE_TRANSETHER 0x6558 /* Trans Ether Bridging (RFC1701)*/
|
||||
#define ETHERTYPE_RAWFR 0x6559 /* Raw Frame Relay (RFC1701) */
|
||||
#define ETHERTYPE_UBDL 0x7000 /* Ungermann-Bass download */
|
||||
#define ETHERTYPE_UBNIU 0x7001 /* Ungermann-Bass NIUs */
|
||||
#define ETHERTYPE_UBDIAGLOOP 0x7002 /* Ungermann-Bass diagnostic/loopback */
|
||||
#define ETHERTYPE_UBNMC 0x7003 /* Ungermann-Bass ??? (NMC to/from UB Bridge) */
|
||||
#define ETHERTYPE_UBBST 0x7005 /* Ungermann-Bass Bridge Spanning Tree */
|
||||
#define ETHERTYPE_OS9 0x7007 /* OS/9 Microware */
|
||||
#define ETHERTYPE_OS9NET 0x7009 /* OS/9 Net? */
|
||||
/* 0x7020 - 0x7029 LRT (England) (now Sintrom) */
|
||||
#define ETHERTYPE_RACAL 0x7030 /* Racal-Interlan */
|
||||
#define ETHERTYPE_PRIMENTS 0x7031 /* Prime NTS (Network Terminal Service) */
|
||||
#define ETHERTYPE_CABLETRON 0x7034 /* Cabletron */
|
||||
#define ETHERTYPE_CRONUSVLN 0x8003 /* Cronus VLN */
|
||||
#define ETHERTYPE_CRONUS 0x8004 /* Cronus Direct */
|
||||
#define ETHERTYPE_HP 0x8005 /* HP Probe */
|
||||
#define ETHERTYPE_NESTAR 0x8006 /* Nestar */
|
||||
#define ETHERTYPE_ATTSTANFORD 0x8008 /* AT&T/Stanford (local use) */
|
||||
#define ETHERTYPE_EXCELAN 0x8010 /* Excelan */
|
||||
#define ETHERTYPE_SG_DIAG 0x8013 /* SGI diagnostic type */
|
||||
#define ETHERTYPE_SG_NETGAMES 0x8014 /* SGI network games */
|
||||
#define ETHERTYPE_SG_RESV 0x8015 /* SGI reserved type */
|
||||
#define ETHERTYPE_SG_BOUNCE 0x8016 /* SGI bounce server */
|
||||
#define ETHERTYPE_APOLLODOMAIN 0x8019 /* Apollo DOMAIN */
|
||||
#define ETHERTYPE_TYMSHARE 0x802E /* Tymeshare */
|
||||
#define ETHERTYPE_TIGAN 0x802F /* Tigan, Inc. */
|
||||
#define ETHERTYPE_REVARP 0x8035 /* Reverse addr resolution protocol */
|
||||
#define ETHERTYPE_AEONIC 0x8036 /* Aeonic Systems */
|
||||
#define ETHERTYPE_IPXNEW 0x8037 /* IPX (Novell Netware?) */
|
||||
#define ETHERTYPE_LANBRIDGE 0x8038 /* DEC LANBridge */
|
||||
#define ETHERTYPE_DSMD 0x8039 /* DEC DSM/DDP */
|
||||
#define ETHERTYPE_ARGONAUT 0x803A /* DEC Argonaut Console */
|
||||
#define ETHERTYPE_VAXELN 0x803B /* DEC VAXELN */
|
||||
#define ETHERTYPE_DECDNS 0x803C /* DEC DNS Naming Service */
|
||||
#define ETHERTYPE_ENCRYPT 0x803D /* DEC Ethernet Encryption */
|
||||
#define ETHERTYPE_DECDTS 0x803E /* DEC Distributed Time Service */
|
||||
#define ETHERTYPE_DECLTM 0x803F /* DEC LAN Traffic Monitor */
|
||||
#define ETHERTYPE_DECNETBIOS 0x8040 /* DEC PATHWORKS DECnet NETBIOS Emulation */
|
||||
#define ETHERTYPE_DECLAST 0x8041 /* DEC Local Area System Transport */
|
||||
/* 0x8042 DEC Unassigned */
|
||||
#define ETHERTYPE_PLANNING 0x8044 /* Planning Research Corp. */
|
||||
/* 0x8046 - 0x8047 AT&T */
|
||||
#define ETHERTYPE_DECAM 0x8048 /* DEC Availability Manager for Distributed Systems DECamds (but someone at DEC says not) */
|
||||
#define ETHERTYPE_EXPERDATA 0x8049 /* ExperData */
|
||||
#define ETHERTYPE_VEXP 0x805B /* Stanford V Kernel exp. */
|
||||
#define ETHERTYPE_VPROD 0x805C /* Stanford V Kernel prod. */
|
||||
#define ETHERTYPE_ES 0x805D /* Evans & Sutherland */
|
||||
#define ETHERTYPE_LITTLE 0x8060 /* Little Machines */
|
||||
#define ETHERTYPE_COUNTERPOINT 0x8062 /* Counterpoint Computers */
|
||||
/* 0x8065 - 0x8066 Univ. of Mass @ Amherst */
|
||||
#define ETHERTYPE_VEECO 0x8067 /* Veeco Integrated Auto. */
|
||||
#define ETHERTYPE_GENDYN 0x8068 /* General Dynamics */
|
||||
#define ETHERTYPE_ATT 0x8069 /* AT&T */
|
||||
#define ETHERTYPE_AUTOPHON 0x806A /* Autophon */
|
||||
#define ETHERTYPE_COMDESIGN 0x806C /* ComDesign */
|
||||
#define ETHERTYPE_COMPUGRAPHIC 0x806D /* Compugraphic Corporation */
|
||||
/* 0x806E - 0x8077 Landmark Graphics Corp. */
|
||||
#define ETHERTYPE_MATRA 0x807A /* Matra */
|
||||
#define ETHERTYPE_DDE 0x807B /* Dansk Data Elektronik */
|
||||
#define ETHERTYPE_MERIT 0x807C /* Merit Internodal (or Univ of Michigan?) */
|
||||
/* 0x807D - 0x807F Vitalink Communications */
|
||||
#define ETHERTYPE_VLTLMAN 0x8080 /* Vitalink TransLAN III Management */
|
||||
/* 0x8081 - 0x8083 Counterpoint Computers */
|
||||
/* 0x8088 - 0x808A Xyplex */
|
||||
#define ETHERTYPE_ATALK 0x809B /* AppleTalk */
|
||||
#define ETHERTYPE_AT ETHERTYPE_ATALK /* old NetBSD */
|
||||
#define ETHERTYPE_APPLETALK ETHERTYPE_ATALK /* HP-UX */
|
||||
/* 0x809C - 0x809E Datability */
|
||||
#define ETHERTYPE_SPIDER 0x809F /* Spider Systems Ltd. */
|
||||
/* 0x80A3 Nixdorf */
|
||||
/* 0x80A4 - 0x80B3 Siemens Gammasonics Inc. */
|
||||
/* 0x80C0 - 0x80C3 DCA (Digital Comm. Assoc.) Data Exchange Cluster */
|
||||
/* 0x80C4 - 0x80C5 Banyan Systems */
|
||||
#define ETHERTYPE_PACER 0x80C6 /* Pacer Software */
|
||||
#define ETHERTYPE_APPLITEK 0x80C7 /* Applitek Corporation */
|
||||
/* 0x80C8 - 0x80CC Intergraph Corporation */
|
||||
/* 0x80CD - 0x80CE Harris Corporation */
|
||||
/* 0x80CF - 0x80D2 Taylor Instrument */
|
||||
/* 0x80D3 - 0x80D4 Rosemount Corporation */
|
||||
#define ETHERTYPE_SNA 0x80D5 /* IBM SNA Services over Ethernet */
|
||||
#define ETHERTYPE_VARIAN 0x80DD /* Varian Associates */
|
||||
/* 0x80DE - 0x80DF TRFS (Integrated Solutions Transparent Remote File System) */
|
||||
/* 0x80E0 - 0x80E3 Allen-Bradley */
|
||||
/* 0x80E4 - 0x80F0 Datability */
|
||||
#define ETHERTYPE_RETIX 0x80F2 /* Retix */
|
||||
#define ETHERTYPE_AARP 0x80F3 /* AppleTalk AARP */
|
||||
/* 0x80F4 - 0x80F5 Kinetics */
|
||||
#define ETHERTYPE_APOLLO 0x80F7 /* Apollo Computer */
|
||||
#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */
|
||||
/* 0x80FF - 0x8101 Wellfleet Communications (XXX conflicts) */
|
||||
#define ETHERTYPE_BOFL 0x8102 /* Wellfleet; BOFL (Breath OF Life) pkts [every 5-10 secs.] */
|
||||
#define ETHERTYPE_WELLFLEET 0x8103 /* Wellfleet Communications */
|
||||
/* 0x8107 - 0x8109 Symbolics Private */
|
||||
#define ETHERTYPE_TALARIS 0x812B /* Talaris */
|
||||
#define ETHERTYPE_WATERLOO 0x8130 /* Waterloo Microsystems Inc. (XXX which?) */
|
||||
#define ETHERTYPE_HAYES 0x8130 /* Hayes Microcomputers (XXX which?) */
|
||||
#define ETHERTYPE_VGLAB 0x8131 /* VG Laboratory Systems */
|
||||
/* 0x8132 - 0x8137 Bridge Communications */
|
||||
#define ETHERTYPE_IPX 0x8137 /* Novell (old) NetWare IPX (ECONFIG E option) */
|
||||
#define ETHERTYPE_NOVELL 0x8138 /* Novell, Inc. */
|
||||
/* 0x8139 - 0x813D KTI */
|
||||
#define ETHERTYPE_MUMPS 0x813F /* M/MUMPS data sharing */
|
||||
#define ETHERTYPE_AMOEBA 0x8145 /* Vrije Universiteit (NL) Amoeba 4 RPC (obsolete) */
|
||||
#define ETHERTYPE_FLIP 0x8146 /* Vrije Universiteit (NL) FLIP (Fast Local Internet Protocol) */
|
||||
#define ETHERTYPE_VURESERVED 0x8147 /* Vrije Universiteit (NL) [reserved] */
|
||||
#define ETHERTYPE_LOGICRAFT 0x8148 /* Logicraft */
|
||||
#define ETHERTYPE_NCD 0x8149 /* Network Computing Devices */
|
||||
#define ETHERTYPE_ALPHA 0x814A /* Alpha Micro */
|
||||
#define ETHERTYPE_SNMP 0x814C /* SNMP over Ethernet (see RFC1089) */
|
||||
/* 0x814D - 0x814E BIIN */
|
||||
#define ETHERTYPE_TEC 0x814F /* Technically Elite Concepts */
|
||||
#define ETHERTYPE_RATIONAL 0x8150 /* Rational Corp */
|
||||
/* 0x8151 - 0x8153 Qualcomm */
|
||||
/* 0x815C - 0x815E Computer Protocol Pty Ltd */
|
||||
/* 0x8164 - 0x8166 Charles River Data Systems */
|
||||
#define ETHERTYPE_XTP 0x817D /* Protocol Engines XTP */
|
||||
#define ETHERTYPE_SGITW 0x817E /* SGI/Time Warner prop. */
|
||||
#define ETHERTYPE_HIPPI_FP 0x8180 /* HIPPI-FP encapsulation */
|
||||
#define ETHERTYPE_STP 0x8181 /* Scheduled Transfer STP, HIPPI-ST */
|
||||
/* 0x8182 - 0x8183 Reserved for HIPPI-6400 */
|
||||
/* 0x8184 - 0x818C SGI prop. */
|
||||
#define ETHERTYPE_MOTOROLA 0x818D /* Motorola */
|
||||
#define ETHERTYPE_NETBEUI 0x8191 /* PowerLAN NetBIOS/NetBEUI (PC) */
|
||||
/* 0x819A - 0x81A3 RAD Network Devices */
|
||||
/* 0x81B7 - 0x81B9 Xyplex */
|
||||
/* 0x81CC - 0x81D5 Apricot Computers */
|
||||
/* 0x81D6 - 0x81DD Artisoft Lantastic */
|
||||
/* 0x81E6 - 0x81EF Polygon */
|
||||
/* 0x81F0 - 0x81F2 Comsat Labs */
|
||||
/* 0x81F3 - 0x81F5 SAIC */
|
||||
/* 0x81F6 - 0x81F8 VG Analytical */
|
||||
/* 0x8203 - 0x8205 QNX Software Systems Ltd. */
|
||||
/* 0x8221 - 0x8222 Ascom Banking Systems */
|
||||
/* 0x823E - 0x8240 Advanced Encryption Systems */
|
||||
/* 0x8263 - 0x826A Charles River Data Systems */
|
||||
/* 0x827F - 0x8282 Athena Programming */
|
||||
/* 0x829A - 0x829B Inst Ind Info Tech */
|
||||
/* 0x829C - 0x82AB Taurus Controls */
|
||||
/* 0x82AC - 0x8693 Walker Richer & Quinn */
|
||||
#define ETHERTYPE_ACCTON 0x8390 /* Accton Technologies (unregistered) */
|
||||
#define ETHERTYPE_TALARISMC 0x852B /* Talaris multicast */
|
||||
#define ETHERTYPE_KALPANA 0x8582 /* Kalpana */
|
||||
/* 0x8694 - 0x869D Idea Courier */
|
||||
/* 0x869E - 0x86A1 Computer Network Tech */
|
||||
/* 0x86A3 - 0x86AC Gateway Communications */
|
||||
#define ETHERTYPE_SECTRA 0x86DB /* SECTRA */
|
||||
#define ETHERTYPE_IPV6 0x86DD /* IP protocol version 6 */
|
||||
#define ETHERTYPE_DELTACON 0x86DE /* Delta Controls */
|
||||
#define ETHERTYPE_ATOMIC 0x86DF /* ATOMIC */
|
||||
/* 0x86E0 - 0x86EF Landis & Gyr Powers */
|
||||
/* 0x8700 - 0x8710 Motorola */
|
||||
#define ETHERTYPE_RDP 0x8739 /* Control Technology Inc. RDP Without IP */
|
||||
#define ETHERTYPE_MICP 0x873A /* Control Technology Inc. Mcast Industrial Ctrl Proto. */
|
||||
/* 0x873B - 0x873C Control Technology Inc. Proprietary */
|
||||
#define ETHERTYPE_TCPCOMP 0x876B /* TCP/IP Compression (RFC1701) */
|
||||
#define ETHERTYPE_IPAS 0x876C /* IP Autonomous Systems (RFC1701) */
|
||||
#define ETHERTYPE_SECUREDATA 0x876D /* Secure Data (RFC1701) */
|
||||
#define ETHERTYPE_FLOWCONTROL 0x8808 /* 802.3x flow control packet */
|
||||
#define ETHERTYPE_SLOWPROTOCOLS 0x8809 /* Slow protocols */
|
||||
#define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPOE) */
|
||||
#define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */
|
||||
#define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */
|
||||
#define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */
|
||||
#define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */
|
||||
#define ETHERTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */
|
||||
#define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */
|
||||
#define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */
|
||||
#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */
|
||||
#define ETHERTYPE_LOOPBACK 0x9000 /* Loopback */
|
||||
#define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */
|
||||
#define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */
|
||||
#define ETHERTYPE_TCPSM 0x9002 /* 3Com (Formerly Bridge Communications), TCP/IP Systems Management */
|
||||
#define ETHERTYPE_BCLOOP 0x9003 /* 3Com (Formerly Bridge Communications), loopback detection */
|
||||
#define ETHERTYPE_DEBNI 0xAAAA /* DECNET? Used by VAX 6220 DEBNI */
|
||||
#define ETHERTYPE_SONIX 0xFAF5 /* Sonix Arpeggio */
|
||||
#define ETHERTYPE_VITAL 0xFF00 /* BBN VITAL-LanBridge cache wakeups */
|
||||
/* 0xFF00 - 0xFFOF ISC Bunker Ramo */
|
||||
|
||||
#define ETHERTYPE_MAX 0xFFFF /* Maximum valid ethernet type, reserved */
|
||||
|
||||
#endif /* !_NET_ETHERTYPES_H_ */
|
||||
@@ -1,109 +0,0 @@
|
||||
/* $NetBSD: if_ether.h,v 1.58 2010/05/19 20:41:59 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 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.
|
||||
*
|
||||
* @(#)if_ether.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef _NET_IF_ETHER_H_
|
||||
#define _NET_IF_ETHER_H_
|
||||
|
||||
/*
|
||||
* Some basic Ethernet constants.
|
||||
*/
|
||||
#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
|
||||
#define ETHER_TYPE_LEN 2 /* length of the Ethernet type field */
|
||||
#define ETHER_CRC_LEN 4 /* length of the Ethernet CRC */
|
||||
#define ETHER_HDR_LEN ((ETHER_ADDR_LEN * 2) + ETHER_TYPE_LEN)
|
||||
#define ETHER_MIN_LEN 64 /* minimum frame length, including CRC */
|
||||
#define ETHER_MAX_LEN 1518 /* maximum frame length, including CRC */
|
||||
#define ETHER_MAX_LEN_JUMBO 9018 /* maximum jumbo frame len, including CRC */
|
||||
|
||||
/*
|
||||
* Some Ethernet extensions.
|
||||
*/
|
||||
#define ETHER_VLAN_ENCAP_LEN 4 /* length of 802.1Q VLAN encapsulation */
|
||||
#define ETHER_PPPOE_ENCAP_LEN 8 /* length of PPPoE encapsulation */
|
||||
|
||||
/*
|
||||
* Ethernet address - 6 octets
|
||||
* this is only used by the ethers(3) functions.
|
||||
*/
|
||||
struct ether_addr {
|
||||
uint8_t ether_addr_octet[ETHER_ADDR_LEN];
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* Structure of a 10Mb/s Ethernet header.
|
||||
*/
|
||||
struct ether_header {
|
||||
uint8_t ether_dhost[ETHER_ADDR_LEN];
|
||||
uint8_t ether_shost[ETHER_ADDR_LEN];
|
||||
uint16_t ether_type;
|
||||
} __packed;
|
||||
|
||||
#include <net/ethertypes.h>
|
||||
|
||||
#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */
|
||||
#define ETHER_IS_LOCAL(addr) (*(addr) & 0x02) /* is address local? */
|
||||
|
||||
#define ETHERMTU_JUMBO (ETHER_MAX_LEN_JUMBO - ETHER_HDR_LEN - ETHER_CRC_LEN)
|
||||
#define ETHERMTU (ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
|
||||
#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
|
||||
|
||||
/*
|
||||
* Compute the maximum frame size based on ethertype (i.e. possible
|
||||
* encapsulation) and whether or not an FCS is present.
|
||||
*/
|
||||
#define ETHER_MAX_FRAME(ifp, etype, hasfcs) \
|
||||
((ifp)->if_mtu + ETHER_HDR_LEN + \
|
||||
((hasfcs) ? ETHER_CRC_LEN : 0) + \
|
||||
(((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0) + \
|
||||
(((etype) == ETHERTYPE_PPPOE) ? ETHER_PPPOE_ENCAP_LEN : 0))
|
||||
|
||||
/*
|
||||
* Ethernet CRC32 polynomials (big- and little-endian verions).
|
||||
*/
|
||||
#define ETHER_CRC_POLY_LE 0xedb88320
|
||||
#define ETHER_CRC_POLY_BE 0x04c11db6
|
||||
|
||||
/*
|
||||
* Prototype ethers(3) functions.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__BEGIN_DECLS
|
||||
char * ether_ntoa(const struct ether_addr *);
|
||||
struct ether_addr *
|
||||
ether_aton(const char *);
|
||||
int ether_ntohost(char *, const struct ether_addr *);
|
||||
int ether_hostton(const char *, struct ether_addr *);
|
||||
int ether_line(const char *, struct ether_addr *, char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_NET_IF_ETHER_H_ */
|
||||
@@ -1,5 +0,0 @@
|
||||
INCSDIR= /usr/include/netinet
|
||||
|
||||
INCS+= in.h tcp.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
@@ -1,512 +0,0 @@
|
||||
/* $NetBSD: in.h,v 1.86 2009/09/14 10:36:50 degroote Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 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.
|
||||
*
|
||||
* @(#)in.h 8.3 (Berkeley) 1/3/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* Constants and structures defined by the internet system,
|
||||
* Per RFC 790, September 1981, and numerous additions.
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_IN_H_
|
||||
#define _NETINET_IN_H_
|
||||
|
||||
#include <machine/int_types.h>
|
||||
|
||||
#ifndef uint8_t
|
||||
typedef __uint8_t uint8_t;
|
||||
#define uint8_t __uint8_t
|
||||
#endif
|
||||
|
||||
#ifndef uint32_t
|
||||
typedef __uint32_t uint32_t;
|
||||
#define uint32_t __uint32_t
|
||||
#endif
|
||||
|
||||
#include <sys/ansi.h>
|
||||
|
||||
#ifndef in_addr_t
|
||||
typedef __in_addr_t in_addr_t;
|
||||
#define in_addr_t __in_addr_t
|
||||
#endif
|
||||
|
||||
#ifndef in_port_t
|
||||
typedef __in_port_t in_port_t;
|
||||
#define in_port_t __in_port_t
|
||||
#endif
|
||||
|
||||
#ifndef sa_family_t
|
||||
typedef __sa_family_t sa_family_t;
|
||||
#define sa_family_t __sa_family_t
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Protocols
|
||||
*/
|
||||
#define IPPROTO_IP 0 /* dummy for IP */
|
||||
#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */
|
||||
#define IPPROTO_ICMP 1 /* control message protocol */
|
||||
#define IPPROTO_IGMP 2 /* group mgmt protocol */
|
||||
#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
|
||||
#define IPPROTO_IPV4 4 /* IP header */
|
||||
#define IPPROTO_IPIP 4 /* IP inside IP */
|
||||
#define IPPROTO_TCP 6 /* tcp */
|
||||
#define IPPROTO_EGP 8 /* exterior gateway protocol */
|
||||
#define IPPROTO_PUP 12 /* pup */
|
||||
#define IPPROTO_UDP 17 /* user datagram protocol */
|
||||
#define IPPROTO_IDP 22 /* xns idp */
|
||||
#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
|
||||
#define IPPROTO_IPV6 41 /* IP6 header */
|
||||
#define IPPROTO_ROUTING 43 /* IP6 routing header */
|
||||
#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */
|
||||
#define IPPROTO_RSVP 46 /* resource reservation */
|
||||
#define IPPROTO_GRE 47 /* GRE encaps RFC 1701 */
|
||||
#define IPPROTO_ESP 50 /* encap. security payload */
|
||||
#define IPPROTO_AH 51 /* authentication header */
|
||||
#define IPPROTO_MOBILE 55 /* IP Mobility RFC 2004 */
|
||||
#define IPPROTO_IPV6_ICMP 58 /* IPv6 ICMP */
|
||||
#define IPPROTO_ICMPV6 58 /* ICMP6 */
|
||||
#define IPPROTO_NONE 59 /* IP6 no next header */
|
||||
#define IPPROTO_DSTOPTS 60 /* IP6 destination option */
|
||||
#define IPPROTO_EON 80 /* ISO cnlp */
|
||||
#define IPPROTO_ETHERIP 97 /* Ethernet-in-IP */
|
||||
#define IPPROTO_ENCAP 98 /* encapsulation header */
|
||||
#define IPPROTO_PIM 103 /* Protocol indep. multicast */
|
||||
#define IPPROTO_IPCOMP 108 /* IP Payload Comp. Protocol */
|
||||
#define IPPROTO_VRRP 112 /* VRRP RFC 2338 */
|
||||
#define IPPROTO_CARP 112 /* Common Address Resolution Protocol */
|
||||
#define IPPROTO_PFSYNC 240 /* PFSYNC */
|
||||
#define IPPROTO_RAW 255 /* raw IP packet */
|
||||
#define IPPROTO_MAX 256
|
||||
|
||||
/* last return value of *_input(), meaning "all job for this pkt is done". */
|
||||
#define IPPROTO_DONE 257
|
||||
|
||||
/* sysctl placeholder for (FAST_)IPSEC */
|
||||
#define CTL_IPPROTO_IPSEC 258
|
||||
|
||||
|
||||
/*
|
||||
* Local port number conventions:
|
||||
*
|
||||
* Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),
|
||||
* unless a kernel is compiled with IPNOPRIVPORTS defined.
|
||||
*
|
||||
* When a user does a bind(2) or connect(2) with a port number of zero,
|
||||
* a non-conflicting local port address is chosen.
|
||||
*
|
||||
* The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
|
||||
* that is settable by sysctl(3); net.inet.ip.anonportmin and
|
||||
* net.inet.ip.anonportmax respectively.
|
||||
*
|
||||
* A user may set the IPPROTO_IP option IP_PORTRANGE to change this
|
||||
* default assignment range.
|
||||
*
|
||||
* The value IP_PORTRANGE_DEFAULT causes the default behavior.
|
||||
*
|
||||
* The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
|
||||
* and exists only for FreeBSD compatibility purposes.
|
||||
*
|
||||
* The value IP_PORTRANGE_LOW changes the range to the "low" are
|
||||
* that is (by convention) restricted to privileged processes.
|
||||
* This convention is based on "vouchsafe" principles only.
|
||||
* It is only secure if you trust the remote host to restrict these ports.
|
||||
* The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
|
||||
*/
|
||||
|
||||
#define IPPORT_RESERVED 1024
|
||||
#define IPPORT_ANONMIN 49152
|
||||
#define IPPORT_ANONMAX 65535
|
||||
#define IPPORT_RESERVEDMIN 600
|
||||
#define IPPORT_RESERVEDMAX (IPPORT_RESERVED-1)
|
||||
|
||||
/*
|
||||
* Internet address (a structure for historical reasons)
|
||||
*/
|
||||
struct in_addr {
|
||||
in_addr_t s_addr;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* Definitions of bits in internet address integers.
|
||||
* On subnets, the decomposition of addresses to host and net parts
|
||||
* is done according to subnet mask, not the masks here.
|
||||
*
|
||||
* By byte-swapping the constants, we avoid ever having to byte-swap IP
|
||||
* addresses inside the kernel. Unfortunately, user-level programs rely
|
||||
* on these macros not doing byte-swapping.
|
||||
*/
|
||||
#ifdef _KERNEL
|
||||
#define __IPADDR(x) ((uint32_t) htonl((uint32_t)(x)))
|
||||
#else
|
||||
#define __IPADDR(x) ((uint32_t)(x))
|
||||
#endif
|
||||
|
||||
#define IN_CLASSA(i) (((uint32_t)(i) & __IPADDR(0x80000000)) == \
|
||||
__IPADDR(0x00000000))
|
||||
#define IN_CLASSA_NET __IPADDR(0xff000000)
|
||||
#define IN_CLASSA_NSHIFT 24
|
||||
#define IN_CLASSA_HOST __IPADDR(0x00ffffff)
|
||||
#define IN_CLASSA_MAX 128
|
||||
|
||||
#define IN_CLASSB(i) (((uint32_t)(i) & __IPADDR(0xc0000000)) == \
|
||||
__IPADDR(0x80000000))
|
||||
#define IN_CLASSB_NET __IPADDR(0xffff0000)
|
||||
#define IN_CLASSB_NSHIFT 16
|
||||
#define IN_CLASSB_HOST __IPADDR(0x0000ffff)
|
||||
#define IN_CLASSB_MAX 65536
|
||||
|
||||
#define IN_CLASSC(i) (((uint32_t)(i) & __IPADDR(0xe0000000)) == \
|
||||
__IPADDR(0xc0000000))
|
||||
#define IN_CLASSC_NET __IPADDR(0xffffff00)
|
||||
#define IN_CLASSC_NSHIFT 8
|
||||
#define IN_CLASSC_HOST __IPADDR(0x000000ff)
|
||||
|
||||
#define IN_CLASSD(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \
|
||||
__IPADDR(0xe0000000))
|
||||
/* These ones aren't really net and host fields, but routing needn't know. */
|
||||
#define IN_CLASSD_NET __IPADDR(0xf0000000)
|
||||
#define IN_CLASSD_NSHIFT 28
|
||||
#define IN_CLASSD_HOST __IPADDR(0x0fffffff)
|
||||
#define IN_MULTICAST(i) IN_CLASSD(i)
|
||||
|
||||
#define IN_EXPERIMENTAL(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \
|
||||
__IPADDR(0xf0000000))
|
||||
#define IN_BADCLASS(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \
|
||||
__IPADDR(0xf0000000))
|
||||
|
||||
#define IN_LINKLOCAL(i) (((uint32_t)(i) & __IPADDR(0xffff0000)) == \
|
||||
__IPADDR(0xa9fe0000))
|
||||
|
||||
#define IN_PRIVATE(i) ((((uint32_t)(i) & __IPADDR(0xff000000)) == \
|
||||
__IPADDR(0x0a000000)) || \
|
||||
(((uint32_t)(i) & __IPADDR(0xfff00000)) == \
|
||||
__IPADDR(0xac100000)) || \
|
||||
(((uint32_t)(i) & __IPADDR(0xffff0000)) == \
|
||||
__IPADDR(0xc0a80000)))
|
||||
|
||||
#define IN_LOCAL_GROUP(i) (((uint32_t)(i) & __IPADDR(0xffffff00)) == \
|
||||
__IPADDR(0xe0000000))
|
||||
|
||||
#define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i))
|
||||
|
||||
#define INADDR_ANY __IPADDR(0x00000000)
|
||||
#define INADDR_LOOPBACK __IPADDR(0x7f000001)
|
||||
#define INADDR_BROADCAST __IPADDR(0xffffffff) /* must be masked */
|
||||
#define INADDR_NONE __IPADDR(0xffffffff) /* -1 return */
|
||||
|
||||
#define INADDR_UNSPEC_GROUP __IPADDR(0xe0000000) /* 224.0.0.0 */
|
||||
#define INADDR_ALLHOSTS_GROUP __IPADDR(0xe0000001) /* 224.0.0.1 */
|
||||
#define INADDR_ALLRTRS_GROUP __IPADDR(0xe0000002) /* 224.0.0.2 */
|
||||
#define INADDR_CARP_GROUP __IPADDR(0xe0000012) /* 224.0.0.18 */
|
||||
#define INADDR_MAX_LOCAL_GROUP __IPADDR(0xe00000ff) /* 224.0.0.255 */
|
||||
|
||||
#define IN_LOOPBACKNET 127 /* official! */
|
||||
|
||||
/*
|
||||
* Socket address, internet style.
|
||||
*/
|
||||
#ifdef __minix
|
||||
struct sockaddr_in
|
||||
{
|
||||
sa_family_t sin_family;
|
||||
in_port_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
};
|
||||
#else /* !__minix */
|
||||
struct sockaddr_in {
|
||||
uint8_t sin_len;
|
||||
sa_family_t sin_family;
|
||||
in_port_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
__int8_t sin_zero[8];
|
||||
};
|
||||
#endif /* !__minix */
|
||||
|
||||
#define INET_ADDRSTRLEN 16
|
||||
|
||||
#ifndef __minix
|
||||
/*
|
||||
* Structure used to describe IP options.
|
||||
* Used to store options internally, to pass them to a process,
|
||||
* or to restore options retrieved earlier.
|
||||
* The ip_dst is used for the first-hop gateway when using a source route
|
||||
* (this gets put into the header proper).
|
||||
*/
|
||||
struct ip_opts {
|
||||
struct in_addr ip_dst; /* first hop, 0 w/o src rt */
|
||||
#if defined(__cplusplus)
|
||||
__int8_t Ip_opts[40]; /* actually variable in size */
|
||||
#else
|
||||
__int8_t ip_opts[40]; /* actually variable in size */
|
||||
#endif
|
||||
};
|
||||
#endif /* __minix */
|
||||
|
||||
/*
|
||||
* Options for use with [gs]etsockopt at the IP level.
|
||||
* First word of comment is data type; bool is stored in int.
|
||||
*/
|
||||
#ifndef __minix
|
||||
#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
|
||||
#define IP_HDRINCL 2 /* int; header is included with data */
|
||||
#define IP_TOS 3 /* int; IP type of service and preced. */
|
||||
#define IP_TTL 4 /* int; IP time to live */
|
||||
#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
|
||||
#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
|
||||
#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
|
||||
#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
|
||||
#define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */
|
||||
#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
|
||||
#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
|
||||
#endif /* !__minix */
|
||||
#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
|
||||
#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
|
||||
#ifndef __minix
|
||||
#define IP_PORTRANGE 19 /* int; range to use for ephemeral port */
|
||||
#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
|
||||
#define IP_ERRORMTU 21 /* int; get MTU of last xmit = EMSGSIZE */
|
||||
#if 1 /*IPSEC*/
|
||||
#define IP_IPSEC_POLICY 22 /* struct; get/set security policy */
|
||||
#endif
|
||||
#define IP_RECVTTL 23 /* bool; receive IP TTL w/dgram */
|
||||
#define IP_MINTTL 24 /* minimum TTL for packet or drop */
|
||||
#endif /* !__minix */
|
||||
|
||||
#ifndef __minix
|
||||
/*
|
||||
* Defaults and limits for options
|
||||
*/
|
||||
#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
|
||||
#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
|
||||
#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */
|
||||
#endif /* !__minix */
|
||||
|
||||
/*
|
||||
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
|
||||
*/
|
||||
struct ip_mreq {
|
||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||
struct in_addr imr_interface; /* local IP address of interface */
|
||||
};
|
||||
|
||||
#ifndef __minix
|
||||
/*
|
||||
* Argument for IP_PORTRANGE:
|
||||
* - which range to search when port is unspecified at bind() or connect()
|
||||
*/
|
||||
#define IP_PORTRANGE_DEFAULT 0 /* default range */
|
||||
#define IP_PORTRANGE_HIGH 1 /* same as DEFAULT (FreeBSD compat) */
|
||||
#define IP_PORTRANGE_LOW 2 /* use privileged range */
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
/*
|
||||
* Definitions for inet sysctl operations.
|
||||
*
|
||||
* Third level is protocol number.
|
||||
* Fourth level is desired variable within that protocol.
|
||||
*/
|
||||
#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */
|
||||
|
||||
#define CTL_IPPROTO_NAMES { \
|
||||
{ "ip", CTLTYPE_NODE }, \
|
||||
{ "icmp", CTLTYPE_NODE }, \
|
||||
{ "igmp", CTLTYPE_NODE }, \
|
||||
{ "ggp", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "tcp", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ "egp", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "pup", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "udp", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "idp", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "ipsec", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "pim", CTLTYPE_NODE }, \
|
||||
}
|
||||
|
||||
/*
|
||||
* Names for IP sysctl objects
|
||||
*/
|
||||
#define IPCTL_FORWARDING 1 /* act as router */
|
||||
#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
|
||||
#define IPCTL_DEFTTL 3 /* default TTL */
|
||||
#ifdef notyet
|
||||
#define IPCTL_DEFMTU 4 /* default MTU */
|
||||
#endif
|
||||
#define IPCTL_FORWSRCRT 5 /* forward source-routed packets */
|
||||
#define IPCTL_DIRECTEDBCAST 6 /* default broadcast behavior */
|
||||
#define IPCTL_ALLOWSRCRT 7 /* allow/drop all source-routed pkts */
|
||||
#define IPCTL_SUBNETSARELOCAL 8 /* treat subnets as local addresses */
|
||||
#define IPCTL_MTUDISC 9 /* allow path MTU discovery */
|
||||
#define IPCTL_ANONPORTMIN 10 /* minimum ephemeral port */
|
||||
#define IPCTL_ANONPORTMAX 11 /* maximum ephemeral port */
|
||||
#define IPCTL_MTUDISCTIMEOUT 12 /* allow path MTU discovery */
|
||||
#define IPCTL_MAXFLOWS 13 /* maximum ip flows allowed */
|
||||
#define IPCTL_HOSTZEROBROADCAST 14 /* is host zero a broadcast addr? */
|
||||
#define IPCTL_GIF_TTL 15 /* default TTL for gif encap packet */
|
||||
#define IPCTL_LOWPORTMIN 16 /* minimum reserved port */
|
||||
#define IPCTL_LOWPORTMAX 17 /* maximum reserved port */
|
||||
#define IPCTL_MAXFRAGPACKETS 18 /* max packets reassembly queue */
|
||||
#define IPCTL_GRE_TTL 19 /* default TTL for gre encap packet */
|
||||
#define IPCTL_CHECKINTERFACE 20 /* drop pkts in from 'wrong' iface */
|
||||
#define IPCTL_IFQ 21 /* ipintrq node */
|
||||
#define IPCTL_RANDOMID 22 /* use random IP ids (if configured) */
|
||||
#define IPCTL_LOOPBACKCKSUM 23 /* do IP checksum on loopback */
|
||||
#define IPCTL_STATS 24 /* IP statistics */
|
||||
#define IPCTL_MAXID 25
|
||||
|
||||
#define IPCTL_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
{ "forwarding", CTLTYPE_INT }, \
|
||||
{ "redirect", CTLTYPE_INT }, \
|
||||
{ "ttl", CTLTYPE_INT }, \
|
||||
{ "mtu", CTLTYPE_INT }, \
|
||||
{ "forwsrcrt", CTLTYPE_INT }, \
|
||||
{ "directed-broadcast", CTLTYPE_INT }, \
|
||||
{ "allowsrcrt", CTLTYPE_INT }, \
|
||||
{ "subnetsarelocal", CTLTYPE_INT }, \
|
||||
{ "mtudisc", CTLTYPE_INT }, \
|
||||
{ "anonportmin", CTLTYPE_INT }, \
|
||||
{ "anonportmax", CTLTYPE_INT }, \
|
||||
{ "mtudisctimeout", CTLTYPE_INT }, \
|
||||
{ "maxflows", CTLTYPE_INT }, \
|
||||
{ "hostzerobroadcast", CTLTYPE_INT }, \
|
||||
{ "gifttl", CTLTYPE_INT }, \
|
||||
{ "lowportmin", CTLTYPE_INT }, \
|
||||
{ "lowportmax", CTLTYPE_INT }, \
|
||||
{ "maxfragpackets", CTLTYPE_INT }, \
|
||||
{ "grettl", CTLTYPE_INT }, \
|
||||
{ "checkinterface", CTLTYPE_INT }, \
|
||||
{ "ifq", CTLTYPE_NODE }, \
|
||||
{ "random_id", CTLTYPE_INT }, \
|
||||
{ "do_loopback_cksum", CTLTYPE_INT }, \
|
||||
{ "stats", CTLTYPE_STRUCT }, \
|
||||
}
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
#endif /* __minix */
|
||||
|
||||
/* INET6 stuff */
|
||||
#define __KAME_NETINET_IN_H_INCLUDED_
|
||||
#include <netinet6/in6.h>
|
||||
#undef __KAME_NETINET_IN_H_INCLUDED_
|
||||
|
||||
#endif /* !_NETINET_IN_H_ */
|
||||
@@ -1,119 +0,0 @@
|
||||
/* $NetBSD: tcp.h,v 1.28 2007/12/25 18:33:47 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 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.
|
||||
*
|
||||
* @(#)tcp.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_TCP_H_
|
||||
#define _NETINET_TCP_H_
|
||||
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
|
||||
typedef u_int32_t tcp_seq;
|
||||
/*
|
||||
* TCP header.
|
||||
* Per RFC 793, September, 1981.
|
||||
* Updated by RFC 3168, September, 2001.
|
||||
*/
|
||||
struct tcphdr {
|
||||
u_int16_t th_sport; /* source port */
|
||||
u_int16_t th_dport; /* destination port */
|
||||
tcp_seq th_seq; /* sequence number */
|
||||
tcp_seq th_ack; /* acknowledgement number */
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
/*LINTED non-portable bitfields*/
|
||||
u_int8_t th_x2:4, /* (unused) */
|
||||
th_off:4; /* data offset */
|
||||
#endif
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
/*LINTED non-portable bitfields*/
|
||||
u_int8_t th_off:4, /* data offset */
|
||||
th_x2:4; /* (unused) */
|
||||
#endif
|
||||
u_int8_t th_flags;
|
||||
#define TH_FIN 0x01
|
||||
#define TH_SYN 0x02
|
||||
#define TH_RST 0x04
|
||||
#define TH_PUSH 0x08
|
||||
#define TH_ACK 0x10
|
||||
#define TH_URG 0x20
|
||||
#define TH_ECE 0x40
|
||||
#define TH_CWR 0x80
|
||||
u_int16_t th_win; /* window */
|
||||
u_int16_t th_sum; /* checksum */
|
||||
u_int16_t th_urp; /* urgent pointer */
|
||||
} __packed;
|
||||
|
||||
#define TCPOPT_EOL 0
|
||||
#define TCPOPT_NOP 1
|
||||
#define TCPOPT_MAXSEG 2
|
||||
#define TCPOLEN_MAXSEG 4
|
||||
#define TCPOPT_WINDOW 3
|
||||
#define TCPOLEN_WINDOW 3
|
||||
#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
|
||||
#define TCPOLEN_SACK_PERMITTED 2
|
||||
#define TCPOPT_SACK 5 /* Experimental */
|
||||
#define TCPOPT_TIMESTAMP 8
|
||||
#define TCPOLEN_TIMESTAMP 10
|
||||
#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
|
||||
|
||||
#define TCPOPT_TSTAMP_HDR \
|
||||
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
|
||||
|
||||
#define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */
|
||||
#define TCPOLEN_SIGNATURE 18
|
||||
#define TCPOLEN_SIGLEN (TCPOLEN_SIGNATURE+2) /* padding */
|
||||
|
||||
#define MAX_TCPOPTLEN 40 /* max # bytes that go in options */
|
||||
|
||||
/*
|
||||
* Default maximum segment size for TCP.
|
||||
* This is defined by RFC 1112 Sec 4.2.2.6.
|
||||
*/
|
||||
#define TCP_MSS 536
|
||||
|
||||
#define TCP_MINMSS 216
|
||||
|
||||
#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
|
||||
|
||||
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
|
||||
|
||||
#define TCP_MAXBURST 4 /* maximum segments in a burst */
|
||||
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
|
||||
/*
|
||||
* User-settable options (used with setsockopt).
|
||||
*/
|
||||
#define TCP_NODELAY 1 /* don't delay send to coalesce packets */
|
||||
|
||||
#endif /* !_NETINET_TCP_H_ */
|
||||
@@ -1,5 +0,0 @@
|
||||
INCSDIR= /usr/include/netinet6
|
||||
|
||||
INCS+= in6.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
@@ -1,808 +0,0 @@
|
||||
/* $NetBSD: in6.h,v 1.68 2009/09/11 22:06:29 dyoung Exp $ */
|
||||
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
* 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 project 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 PROJECT 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 PROJECT 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 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.
|
||||
*
|
||||
* @(#)in.h 8.3 (Berkeley) 1/3/94
|
||||
*/
|
||||
|
||||
#ifndef _NETINET6_IN6_H_
|
||||
#define _NETINET6_IN6_H_
|
||||
|
||||
#ifndef __KAME_NETINET_IN_H_INCLUDED_
|
||||
#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"
|
||||
#endif
|
||||
|
||||
#include <sys/socket.h>
|
||||
|
||||
/*
|
||||
* Identification of the network protocol stack
|
||||
* for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE
|
||||
* has the table of implementation/integration differences.
|
||||
*/
|
||||
#define __KAME__
|
||||
#define __KAME_VERSION "NetBSD-current"
|
||||
|
||||
/*
|
||||
* Local port number conventions:
|
||||
*
|
||||
* Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),
|
||||
* unless a kernel is compiled with IPNOPRIVPORTS defined.
|
||||
*
|
||||
* When a user does a bind(2) or connect(2) with a port number of zero,
|
||||
* a non-conflicting local port address is chosen.
|
||||
*
|
||||
* The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
|
||||
* that is settable by sysctl(3); net.inet.ip.anonportmin and
|
||||
* net.inet.ip.anonportmax respectively.
|
||||
*
|
||||
* A user may set the IPPROTO_IP option IP_PORTRANGE to change this
|
||||
* default assignment range.
|
||||
*
|
||||
* The value IP_PORTRANGE_DEFAULT causes the default behavior.
|
||||
*
|
||||
* The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
|
||||
* and exists only for FreeBSD compatibility purposes.
|
||||
*
|
||||
* The value IP_PORTRANGE_LOW changes the range to the "low" are
|
||||
* that is (by convention) restricted to privileged processes.
|
||||
* This convention is based on "vouchsafe" principles only.
|
||||
* It is only secure if you trust the remote host to restrict these ports.
|
||||
* The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
|
||||
*/
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define IPV6PORT_RESERVED 1024
|
||||
#define IPV6PORT_ANONMIN 49152
|
||||
#define IPV6PORT_ANONMAX 65535
|
||||
#define IPV6PORT_RESERVEDMIN 600
|
||||
#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IPv6 address
|
||||
*/
|
||||
struct in6_addr {
|
||||
union {
|
||||
__uint8_t __u6_addr8[16];
|
||||
__uint16_t __u6_addr16[8];
|
||||
uint32_t __u6_addr32[4];
|
||||
} __u6_addr; /* 128-bit IP6 address */
|
||||
};
|
||||
|
||||
#define s6_addr __u6_addr.__u6_addr8
|
||||
#ifdef _KERNEL /* XXX nonstandard */
|
||||
#define s6_addr8 __u6_addr.__u6_addr8
|
||||
#define s6_addr16 __u6_addr.__u6_addr16
|
||||
#define s6_addr32 __u6_addr.__u6_addr32
|
||||
#endif
|
||||
|
||||
#define INET6_ADDRSTRLEN 46
|
||||
|
||||
/*
|
||||
* Socket address for IPv6
|
||||
*/
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define SIN6_LEN
|
||||
#endif
|
||||
struct sockaddr_in6 {
|
||||
#ifndef __minix
|
||||
uint8_t sin6_len; /* length of this struct(socklen_t)*/
|
||||
#endif /* !__minix */
|
||||
sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */
|
||||
in_port_t sin6_port; /* Transport layer port */
|
||||
uint32_t sin6_flowinfo; /* IP6 flow information */
|
||||
struct in6_addr sin6_addr; /* IP6 address */
|
||||
uint32_t sin6_scope_id; /* scope zone index */
|
||||
};
|
||||
|
||||
#ifndef __minix
|
||||
/*
|
||||
* Local definition for masks
|
||||
*/
|
||||
#ifdef _KERNEL /* XXX nonstandard */
|
||||
#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
|
||||
#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
|
||||
#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
|
||||
#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
|
||||
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}}
|
||||
#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL
|
||||
extern const struct sockaddr_in6 sa6_any;
|
||||
|
||||
extern const struct in6_addr in6mask0;
|
||||
extern const struct in6_addr in6mask32;
|
||||
extern const struct in6_addr in6mask64;
|
||||
extern const struct in6_addr in6mask96;
|
||||
extern const struct in6_addr in6mask128;
|
||||
#endif /* _KERNEL */
|
||||
|
||||
/*
|
||||
* Macros started with IPV6_ADDR is KAME local
|
||||
*/
|
||||
#ifdef _KERNEL /* XXX nonstandard */
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
#define IPV6_ADDR_INT32_ONE 1
|
||||
#define IPV6_ADDR_INT32_TWO 2
|
||||
#define IPV6_ADDR_INT32_MNL 0xff010000
|
||||
#define IPV6_ADDR_INT32_MLL 0xff020000
|
||||
#define IPV6_ADDR_INT32_SMP 0x0000ffff
|
||||
#define IPV6_ADDR_INT16_ULL 0xfe80
|
||||
#define IPV6_ADDR_INT16_USL 0xfec0
|
||||
#define IPV6_ADDR_INT16_MLL 0xff02
|
||||
#elif BYTE_ORDER == LITTLE_ENDIAN
|
||||
#define IPV6_ADDR_INT32_ONE 0x01000000
|
||||
#define IPV6_ADDR_INT32_TWO 0x02000000
|
||||
#define IPV6_ADDR_INT32_MNL 0x000001ff
|
||||
#define IPV6_ADDR_INT32_MLL 0x000002ff
|
||||
#define IPV6_ADDR_INT32_SMP 0xffff0000
|
||||
#define IPV6_ADDR_INT16_ULL 0x80fe
|
||||
#define IPV6_ADDR_INT16_USL 0xc0fe
|
||||
#define IPV6_ADDR_INT16_MLL 0x02ff
|
||||
#endif
|
||||
#endif
|
||||
#endif /* !__minix */
|
||||
|
||||
/*
|
||||
* Definition of some useful macros to handle IP6 addresses
|
||||
*/
|
||||
#define IN6ADDR_ANY_INIT \
|
||||
{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
|
||||
#define IN6ADDR_LOOPBACK_INIT \
|
||||
{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
|
||||
#define IN6ADDR_NODELOCAL_ALLNODES_INIT \
|
||||
{{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
|
||||
#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
|
||||
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
|
||||
#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
|
||||
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
|
||||
|
||||
extern const struct in6_addr in6addr_any;
|
||||
extern const struct in6_addr in6addr_loopback;
|
||||
extern const struct in6_addr in6addr_nodelocal_allnodes;
|
||||
extern const struct in6_addr in6addr_linklocal_allnodes;
|
||||
extern const struct in6_addr in6addr_linklocal_allrouters;
|
||||
|
||||
#define IN6_ARE_ADDR_EQUAL(a, b) \
|
||||
(memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
|
||||
|
||||
/*
|
||||
* Unspecified
|
||||
*/
|
||||
#define IN6_IS_ADDR_UNSPECIFIED(a) \
|
||||
((a)->__u6_addr.__u6_addr32[0] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[1] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[2] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[3] == 0)
|
||||
|
||||
/*
|
||||
* Loopback
|
||||
*/
|
||||
#define IN6_IS_ADDR_LOOPBACK(a) \
|
||||
((a)->__u6_addr.__u6_addr32[0] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[1] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[2] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[3] == ntohl(1))
|
||||
|
||||
/*
|
||||
* IPv4 compatible
|
||||
*/
|
||||
#define IN6_IS_ADDR_V4COMPAT(a) \
|
||||
((a)->__u6_addr.__u6_addr32[0] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[1] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[2] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[3] != 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[3] != ntohl(1))
|
||||
|
||||
/*
|
||||
* Mapped
|
||||
*/
|
||||
#define IN6_IS_ADDR_V4MAPPED(a) \
|
||||
((a)->__u6_addr.__u6_addr32[0] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[1] == 0 && \
|
||||
(a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff))
|
||||
|
||||
/*
|
||||
* KAME Scope Values
|
||||
*/
|
||||
|
||||
#ifdef _KERNEL /* XXX nonstandard */
|
||||
#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
|
||||
#define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01
|
||||
#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
|
||||
#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
|
||||
#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
|
||||
#define IPV6_ADDR_SCOPE_GLOBAL 0x0e
|
||||
#else
|
||||
#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01
|
||||
#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02
|
||||
#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
|
||||
#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
|
||||
#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Unicast Scope
|
||||
* Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
|
||||
*/
|
||||
#define IN6_IS_ADDR_LINKLOCAL(a) \
|
||||
(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
|
||||
#define IN6_IS_ADDR_SITELOCAL(a) \
|
||||
(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
|
||||
|
||||
/*
|
||||
* Multicast
|
||||
*/
|
||||
#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
|
||||
|
||||
#ifdef _KERNEL /* XXX nonstandard */
|
||||
#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
|
||||
#else
|
||||
#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Multicast Scope
|
||||
*/
|
||||
#ifdef _KERNEL /* refers nonstandard items */
|
||||
#define IN6_IS_ADDR_MC_NODELOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL))
|
||||
#define IN6_IS_ADDR_MC_INTFACELOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL))
|
||||
#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL))
|
||||
#define IN6_IS_ADDR_MC_SITELOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL))
|
||||
#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL))
|
||||
#define IN6_IS_ADDR_MC_GLOBAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL))
|
||||
#else
|
||||
#define IN6_IS_ADDR_MC_NODELOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL))
|
||||
#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL))
|
||||
#define IN6_IS_ADDR_MC_SITELOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
|
||||
#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
|
||||
#define IN6_IS_ADDR_MC_GLOBAL(a) \
|
||||
(IN6_IS_ADDR_MULTICAST(a) && \
|
||||
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL /* nonstandard */
|
||||
/*
|
||||
* KAME Scope
|
||||
*/
|
||||
#define IN6_IS_SCOPE_LINKLOCAL(a) \
|
||||
((IN6_IS_ADDR_LINKLOCAL(a)) || \
|
||||
(IN6_IS_ADDR_MC_LINKLOCAL(a)))
|
||||
|
||||
#define IN6_IS_SCOPE_EMBEDDABLE(__a) \
|
||||
(IN6_IS_SCOPE_LINKLOCAL(__a) || IN6_IS_ADDR_MC_INTFACELOCAL(__a))
|
||||
|
||||
#define IFA6_IS_DEPRECATED(a) \
|
||||
((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \
|
||||
(u_int32_t)((time_second - (a)->ia6_updatetime)) > \
|
||||
(a)->ia6_lifetime.ia6t_pltime)
|
||||
#define IFA6_IS_INVALID(a) \
|
||||
((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \
|
||||
(u_int32_t)((time_second - (a)->ia6_updatetime)) > \
|
||||
(a)->ia6_lifetime.ia6t_vltime)
|
||||
#endif
|
||||
|
||||
#ifndef __minix
|
||||
/*
|
||||
* Options for use with [gs]etsockopt at the IPV6 level.
|
||||
* First word of comment is data type; bool is stored in int.
|
||||
*/
|
||||
/* no hdrincl */
|
||||
#if 0
|
||||
/* These are deprecated non-standard options which are no longer supported. */
|
||||
#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */
|
||||
#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */
|
||||
#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */
|
||||
#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */
|
||||
#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */
|
||||
#endif
|
||||
#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */
|
||||
#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */
|
||||
#define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */
|
||||
#define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */
|
||||
#define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */
|
||||
#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */
|
||||
#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */
|
||||
#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */
|
||||
#endif
|
||||
/* RFC2292 options */
|
||||
#ifdef _KERNEL
|
||||
#define IPV6_2292PKTINFO 19 /* bool; send/recv if, src/dst addr */
|
||||
#define IPV6_2292HOPLIMIT 20 /* bool; hop limit */
|
||||
#define IPV6_2292NEXTHOP 21 /* bool; next hop addr */
|
||||
#define IPV6_2292HOPOPTS 22 /* bool; hop-by-hop option */
|
||||
#define IPV6_2292DSTOPTS 23 /* bool; destination option */
|
||||
#define IPV6_2292RTHDR 24 /* bool; routing header */
|
||||
#define IPV6_2292PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */
|
||||
#endif
|
||||
#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */
|
||||
#define IPV6_V6ONLY 27 /* bool; make AF_INET6 sockets v6 only */
|
||||
|
||||
#if 1 /* IPSEC */
|
||||
#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */
|
||||
#endif
|
||||
#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */
|
||||
|
||||
/* new socket options introduced in RFC3542 */
|
||||
#define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */
|
||||
|
||||
#define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */
|
||||
#define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */
|
||||
#define IPV6_RECVRTHDR 38 /* bool; recv routing header */
|
||||
#define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */
|
||||
#define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */
|
||||
#ifdef _KERNEL
|
||||
#define IPV6_RECVRTHDRDSTOPTS 41 /* bool; recv dst option before rthdr */
|
||||
#endif
|
||||
#define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */
|
||||
#define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */
|
||||
#define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt),
|
||||
4 bytes int; MTU notification (cmsg) */
|
||||
|
||||
/* more new socket options introduced in RFC3542 */
|
||||
#define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */
|
||||
#define IPV6_HOPLIMIT 47 /* int; send hop limit */
|
||||
#define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */
|
||||
#define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */
|
||||
#define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */
|
||||
#define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */
|
||||
|
||||
#define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */
|
||||
#ifdef _KERNEL
|
||||
#define IPV6_OTCLASS 58 /* u_int8_t; send traffic class value */
|
||||
#endif
|
||||
|
||||
#define IPV6_TCLASS 61 /* int; send traffic class value */
|
||||
#define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */
|
||||
/* to define items, should talk with KAME guys first, for *BSD compatibility */
|
||||
|
||||
#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */
|
||||
#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */
|
||||
#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */
|
||||
|
||||
/*
|
||||
* Defaults and limits for options
|
||||
*/
|
||||
#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */
|
||||
#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
|
||||
|
||||
/*
|
||||
* Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
|
||||
*/
|
||||
struct ipv6_mreq {
|
||||
struct in6_addr ipv6mr_multiaddr;
|
||||
unsigned int ipv6mr_interface;
|
||||
};
|
||||
|
||||
/*
|
||||
* IPV6_PKTINFO: Packet information(RFC2292 sec 5)
|
||||
*/
|
||||
struct in6_pktinfo {
|
||||
struct in6_addr ipi6_addr; /* src/dst IPv6 address */
|
||||
unsigned int ipi6_ifindex; /* send/recv interface index */
|
||||
};
|
||||
|
||||
/*
|
||||
* Control structure for IPV6_RECVPATHMTU socket option.
|
||||
*/
|
||||
struct ip6_mtuinfo {
|
||||
struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */
|
||||
uint32_t ip6m_mtu;
|
||||
};
|
||||
|
||||
/*
|
||||
* Argument for IPV6_PORTRANGE:
|
||||
* - which range to search when port is unspecified at bind() or connect()
|
||||
*/
|
||||
#define IPV6_PORTRANGE_DEFAULT 0 /* default range */
|
||||
#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
|
||||
#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
/*
|
||||
* Definitions for inet6 sysctl operations.
|
||||
*
|
||||
* Third level is protocol number.
|
||||
* Fourth level is desired variable within that protocol.
|
||||
*/
|
||||
#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */
|
||||
|
||||
#define CTL_IPV6PROTO_NAMES { \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "tcp6", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "udp6", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "ip6", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "ipsec6", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "icmp6", CTLTYPE_NODE }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "pim6", CTLTYPE_NODE }, \
|
||||
}
|
||||
|
||||
/*
|
||||
* Names for IP sysctl objects
|
||||
*/
|
||||
#define IPV6CTL_FORWARDING 1 /* act as router */
|
||||
#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/
|
||||
#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */
|
||||
#ifdef notyet
|
||||
#define IPV6CTL_DEFMTU 4 /* default MTU */
|
||||
#endif
|
||||
#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */
|
||||
#define IPV6CTL_STATS 6 /* stats */
|
||||
#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */
|
||||
#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */
|
||||
#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */
|
||||
#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */
|
||||
#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */
|
||||
#define IPV6CTL_ACCEPT_RTADV 12
|
||||
#define IPV6CTL_KEEPFAITH 13
|
||||
#define IPV6CTL_LOG_INTERVAL 14
|
||||
#define IPV6CTL_HDRNESTLIMIT 15
|
||||
#define IPV6CTL_DAD_COUNT 16
|
||||
#define IPV6CTL_AUTO_FLOWLABEL 17
|
||||
#define IPV6CTL_DEFMCASTHLIM 18
|
||||
#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */
|
||||
#define IPV6CTL_KAME_VERSION 20
|
||||
#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */
|
||||
#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */
|
||||
/* 23: reserved */
|
||||
#define IPV6CTL_V6ONLY 24
|
||||
/* 25 to 27: reserved */
|
||||
#define IPV6CTL_ANONPORTMIN 28 /* minimum ephemeral port */
|
||||
#define IPV6CTL_ANONPORTMAX 29 /* maximum ephemeral port */
|
||||
#define IPV6CTL_LOWPORTMIN 30 /* minimum reserved port */
|
||||
#define IPV6CTL_LOWPORTMAX 31 /* maximum reserved port */
|
||||
/* 32 to 38: reserved */
|
||||
#define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */
|
||||
/* 40: reserved */
|
||||
#define IPV6CTL_MAXFRAGS 41 /* max fragments */
|
||||
#define IPV6CTL_IFQ 42 /* ip6intrq node */
|
||||
/* New entries should be added here from current IPV6CTL_MAXID value. */
|
||||
/* to define items, should talk with KAME guys first, for *BSD compatibility */
|
||||
#define IPV6CTL_MAXID 43
|
||||
|
||||
#define IPV6CTL_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
{ "forwarding", CTLTYPE_INT }, \
|
||||
{ "redirect", CTLTYPE_INT }, \
|
||||
{ "hlim", CTLTYPE_INT }, \
|
||||
{ "mtu", CTLTYPE_INT }, \
|
||||
{ "forwsrcrt", CTLTYPE_INT }, \
|
||||
{ "stats", CTLTYPE_STRUCT }, \
|
||||
{ 0, 0 }, \
|
||||
{ "mrtproto", CTLTYPE_INT }, \
|
||||
{ "maxfragpackets", CTLTYPE_INT }, \
|
||||
{ "sourcecheck", CTLTYPE_INT }, \
|
||||
{ "sourcecheck_logint", CTLTYPE_INT }, \
|
||||
{ "accept_rtadv", CTLTYPE_INT }, \
|
||||
{ "keepfaith", CTLTYPE_INT }, \
|
||||
{ "log_interval", CTLTYPE_INT }, \
|
||||
{ "hdrnestlimit", CTLTYPE_INT }, \
|
||||
{ "dad_count", CTLTYPE_INT }, \
|
||||
{ "auto_flowlabel", CTLTYPE_INT }, \
|
||||
{ "defmcasthlim", CTLTYPE_INT }, \
|
||||
{ "gifhlim", CTLTYPE_INT }, \
|
||||
{ "kame_version", CTLTYPE_STRING }, \
|
||||
{ "use_deprecated", CTLTYPE_INT }, \
|
||||
{ "rr_prune", CTLTYPE_INT }, \
|
||||
{ 0, 0 }, \
|
||||
{ "v6only", CTLTYPE_INT }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "anonportmin", CTLTYPE_INT }, \
|
||||
{ "anonportmax", CTLTYPE_INT }, \
|
||||
{ "lowportmin", CTLTYPE_INT }, \
|
||||
{ "lowportmax", CTLTYPE_INT }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ 0, 0 }, \
|
||||
{ "maxfrags", CTLTYPE_INT }, \
|
||||
{ "ifq", CTLTYPE_NODE }, \
|
||||
}
|
||||
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
|
||||
#ifdef _KERNEL
|
||||
struct cmsghdr;
|
||||
|
||||
/*
|
||||
* in6_cksum_phdr:
|
||||
*
|
||||
* Compute significant parts of the IPv6 checksum pseudo-header
|
||||
* for use in a delayed TCP/UDP checksum calculation.
|
||||
*
|
||||
* Args:
|
||||
*
|
||||
* src Source IPv6 address
|
||||
* dst Destination IPv6 address
|
||||
* len htonl(proto-hdr-len)
|
||||
* nxt htonl(next-proto-number)
|
||||
*
|
||||
* NOTE: We expect the src and dst addresses to be 16-bit
|
||||
* aligned!
|
||||
*/
|
||||
static __inline u_int16_t __unused
|
||||
in6_cksum_phdr(const struct in6_addr *src, const struct in6_addr *dst,
|
||||
u_int32_t len, u_int32_t nxt)
|
||||
{
|
||||
u_int32_t sum = 0;
|
||||
const u_int16_t *w;
|
||||
|
||||
/*LINTED*/
|
||||
w = (const u_int16_t *) src;
|
||||
sum += w[0];
|
||||
if (!IN6_IS_SCOPE_LINKLOCAL(src))
|
||||
sum += w[1];
|
||||
sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5];
|
||||
sum += w[6]; sum += w[7];
|
||||
|
||||
/*LINTED*/
|
||||
w = (const u_int16_t *) dst;
|
||||
sum += w[0];
|
||||
if (!IN6_IS_SCOPE_LINKLOCAL(dst))
|
||||
sum += w[1];
|
||||
sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5];
|
||||
sum += w[6]; sum += w[7];
|
||||
|
||||
sum += (u_int16_t)(len >> 16) + (u_int16_t)(len /*& 0xffff*/);
|
||||
|
||||
sum += (u_int16_t)(nxt >> 16) + (u_int16_t)(nxt /*& 0xffff*/);
|
||||
|
||||
sum = (u_int16_t)(sum >> 16) + (u_int16_t)(sum /*& 0xffff*/);
|
||||
|
||||
if (sum > 0xffff)
|
||||
sum -= 0xffff;
|
||||
|
||||
return (sum);
|
||||
}
|
||||
|
||||
struct mbuf;
|
||||
struct ifnet;
|
||||
int sockaddr_in6_cmp(const struct sockaddr *, const struct sockaddr *);
|
||||
struct sockaddr *sockaddr_in6_externalize(struct sockaddr *, socklen_t,
|
||||
const struct sockaddr *);
|
||||
int in6_cksum(struct mbuf *, u_int8_t, u_int32_t, u_int32_t);
|
||||
void in6_delayed_cksum(struct mbuf *);
|
||||
int in6_localaddr(const struct in6_addr *);
|
||||
int in6_addrscope(const struct in6_addr *);
|
||||
struct in6_ifaddr *in6_ifawithifp(struct ifnet *, struct in6_addr *);
|
||||
extern void in6_if_up(struct ifnet *);
|
||||
#ifndef __FreeBSD__
|
||||
extern int in6_src_sysctl(void *, size_t *, void *, size_t);
|
||||
#endif
|
||||
extern void addrsel_policy_init(void);
|
||||
extern u_char ip6_protox[];
|
||||
|
||||
#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
|
||||
#define satocsin6(sa) ((const struct sockaddr_in6 *)(sa))
|
||||
#define sin6tosa(sin6) ((struct sockaddr *)(sin6))
|
||||
#define sin6tocsa(sin6) ((const struct sockaddr *)(sin6))
|
||||
#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
|
||||
|
||||
static inline void
|
||||
sockaddr_in6_init1(struct sockaddr_in6 *sin6, const struct in6_addr *addr,
|
||||
in_port_t port, uint32_t flowinfo, uint32_t scope_id)
|
||||
{
|
||||
sin6->sin6_port = port;
|
||||
sin6->sin6_flowinfo = flowinfo;
|
||||
sin6->sin6_addr = *addr;
|
||||
sin6->sin6_scope_id = scope_id;
|
||||
}
|
||||
|
||||
static inline void
|
||||
sockaddr_in6_init(struct sockaddr_in6 *sin6, const struct in6_addr *addr,
|
||||
in_port_t port, uint32_t flowinfo, uint32_t scope_id)
|
||||
{
|
||||
sin6->sin6_family = AF_INET6;
|
||||
sin6->sin6_len = sizeof(*sin6);
|
||||
sockaddr_in6_init1(sin6, addr, port, flowinfo, scope_id);
|
||||
}
|
||||
|
||||
static inline struct sockaddr *
|
||||
sockaddr_in6_alloc(const struct in6_addr *addr, in_port_t port,
|
||||
uint32_t flowinfo, uint32_t scope_id, int flags)
|
||||
{
|
||||
struct sockaddr *sa;
|
||||
|
||||
if ((sa = sockaddr_alloc(AF_INET6, sizeof(struct sockaddr_in6),
|
||||
flags)) == NULL)
|
||||
return NULL;
|
||||
|
||||
sockaddr_in6_init1(satosin6(sa), addr, port, flowinfo, scope_id);
|
||||
|
||||
return sa;
|
||||
}
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#if defined(_NETBSD_SOURCE)
|
||||
|
||||
#include <machine/ansi.h>
|
||||
|
||||
#ifdef _BSD_SIZE_T_
|
||||
typedef _BSD_SIZE_T_ size_t;
|
||||
#define _SIZE_T
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
struct cmsghdr;
|
||||
|
||||
void in6_sin6_2_sin(struct sockaddr_in *, struct sockaddr_in6 *);
|
||||
void in6_sin_2_v4mapsin6(struct sockaddr_in *, struct sockaddr_in6 *);
|
||||
void in6_sin6_2_sin_in_sock(struct sockaddr *);
|
||||
void in6_sin_2_v4mapsin6_in_sock(struct sockaddr **);
|
||||
|
||||
extern int inet6_option_space(int);
|
||||
extern int inet6_option_init(void *, struct cmsghdr **, int);
|
||||
extern int inet6_option_append(struct cmsghdr *, const uint8_t *,
|
||||
int, int);
|
||||
extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int);
|
||||
extern int inet6_option_next(const struct cmsghdr *, uint8_t **);
|
||||
extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int);
|
||||
|
||||
extern size_t inet6_rthdr_space(int, int);
|
||||
extern struct cmsghdr *inet6_rthdr_init(void *, int);
|
||||
extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *,
|
||||
unsigned int);
|
||||
extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);
|
||||
#if 0 /* not implemented yet */
|
||||
extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *);
|
||||
#endif
|
||||
extern int inet6_rthdr_segments(const struct cmsghdr *);
|
||||
extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int);
|
||||
extern int inet6_rthdr_getflags(const struct cmsghdr *, int);
|
||||
|
||||
extern int inet6_opt_init(void *, socklen_t);
|
||||
extern int inet6_opt_append(void *, socklen_t, int, uint8_t,
|
||||
socklen_t, uint8_t, void **);
|
||||
extern int inet6_opt_finish(void *, socklen_t, int);
|
||||
extern int inet6_opt_set_val(void *, int, void *, socklen_t);
|
||||
|
||||
extern int inet6_opt_next(void *, socklen_t, int, uint8_t *,
|
||||
socklen_t *, void **);
|
||||
extern int inet6_opt_find(void *, socklen_t, int, uint8_t,
|
||||
socklen_t *, void **);
|
||||
extern int inet6_opt_get_val(void *, int, void *, socklen_t);
|
||||
extern socklen_t inet6_rth_space(int, int);
|
||||
extern void *inet6_rth_init(void *, socklen_t, int, int);
|
||||
extern int inet6_rth_add(void *, const struct in6_addr *);
|
||||
extern int inet6_rth_reverse(const void *, void *);
|
||||
extern int inet6_rth_segments(const void *);
|
||||
extern struct in6_addr *inet6_rth_getaddr(const void *, int);
|
||||
__END_DECLS
|
||||
#endif /* _NETBSD_SOURCE */
|
||||
#endif /* !__minix */
|
||||
|
||||
#endif /* !_NETINET6_IN6_H_ */
|
||||
@@ -1,65 +1,11 @@
|
||||
# $NetBSD: Makefile,v 1.143 2012/02/19 21:06:57 rmind Exp $
|
||||
|
||||
.include <bsd.sys.mk>
|
||||
|
||||
INCSDIR= /usr/include/sys
|
||||
|
||||
# Present only in minix
|
||||
INCS+= ioc_net.h statfs.h
|
||||
|
||||
INCS+= ansi.h atomic.h \
|
||||
bitops.h bswap.h \
|
||||
cdefs.h cdefs_aout.h cdefs_elf.h ctype_bits.h ctype_inline.h \
|
||||
dirent.h \
|
||||
endian.h errno.h \
|
||||
fcntl.h fd_set.h featuretest.h file.h \
|
||||
float_ieee754.h gcq.h gmon.h hash.h \
|
||||
ieee754.h inttypes.h ioctl.h ipc.h \
|
||||
localedef.h lock.h \
|
||||
md4.h md5.h \
|
||||
mman.h mount.h \
|
||||
null.h \
|
||||
param.h poll.h ptrace.h \
|
||||
ptree.h \
|
||||
queue.h \
|
||||
rbtree.h resource.h rmd160.h \
|
||||
select.h sha1.h \
|
||||
sha2.h siginfo.h signal.h sigtypes.h \
|
||||
ras.h reboot.h sem.h shm.h socket.h \
|
||||
stat.h statvfs.h \
|
||||
sysctl.h stdint.h \
|
||||
syslimits.h syslog.h \
|
||||
termios.h time.h times.h \
|
||||
tree.h ttycom.h ttydefaults.h \
|
||||
types.h \
|
||||
ucontext.h ucred.h uio.h un.h unistd.h utsname.h uuid.h \
|
||||
extattr.h \
|
||||
wait.h exec.h
|
||||
|
||||
# Present only in minix
|
||||
INCS+= ioc_net.h statfs.h
|
||||
INCS+= elf64.h elf_common.h elf_generic.h \
|
||||
ioc_block.h ioc_fbd.h ioc_file.h ioc_tape.h ioc_disk.h \
|
||||
ioc_memory.h ioc_sound.h ioc_tty.h \
|
||||
kbdio.h mtio.h svrctl.h video.h vm.h procfs.h elf_core.h exec_elf.h \
|
||||
disk.h dkio.h ioccom.h mutex.h iostat.h disklabel.h disklabel_gpt.h \
|
||||
bootblock.h dkbad.h
|
||||
|
||||
INCSYMLINKS=\
|
||||
sys/fcntl.h /usr/include/fcntl.h \
|
||||
sys/poll.h /usr/include/poll.h \
|
||||
sys/stdint.h /usr/include/stdint.h \
|
||||
sys/syslog.h /usr/include/syslog.h \
|
||||
sys/termios.h /usr/include/termios.h \
|
||||
sys/rmd160.h /usr/include/rmd160.h \
|
||||
sys/sha1.h /usr/include/sha1.h \
|
||||
sys/sha2.h /usr/include/sha2.h \
|
||||
sys/md4.h /usr/include/md4.h \
|
||||
sys/md5.h /usr/include/md5.h
|
||||
|
||||
#INCSYMLINKS+= ../soundcard.h ${INCSDIR}/soundcard.h
|
||||
|
||||
namei: namei.src gennameih.awk
|
||||
${TOOL_AWK} -f gennameih.awk < namei.src
|
||||
# Minix specific system headers
|
||||
INCS= elf64.h elf_common.h elf_core.h elf_generic.h \
|
||||
ioc_block.h ioc_disk.h ioc_fbd.h ioc_file.h ioc_memory.h ioc_net.h \
|
||||
ioc_sound.h ioc_tape.h ioc_tty.h \
|
||||
kbdio.h \
|
||||
procfs.h statfs.h svrctl.h video.h vm.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
/* $NetBSD: ansi.h,v 1.13 2010/03/27 22:14:10 tnozaki Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Jun-ichiro itojun Hagino and 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 _SYS_ANSI_H_
|
||||
#define _SYS_ANSI_H_
|
||||
|
||||
#include <machine/ansi.h>
|
||||
|
||||
typedef char * __caddr_t; /* core address */
|
||||
typedef __uint32_t __gid_t; /* group id */
|
||||
typedef __uint32_t __in_addr_t; /* IP(v4) address */
|
||||
typedef __uint16_t __in_port_t; /* "Internet" port number */
|
||||
typedef unsigned short __mode_t; /* file permissions */
|
||||
typedef long __off_t; /* file offset */
|
||||
typedef int __pid_t; /* process id */
|
||||
typedef __uint8_t __sa_family_t; /* socket address family */
|
||||
typedef __int32_t __socklen_t; /* socket-related datum length */
|
||||
typedef __uint32_t __uid_t; /* user id */
|
||||
typedef unsigned long __fsblkcnt_t; /* fs block count (statvfs) */
|
||||
typedef unsigned long __fsfilcnt_t; /* fs file count */
|
||||
|
||||
struct __tag_wctrans_t;
|
||||
typedef struct __tag_wctrans_t *__wctrans_t;
|
||||
|
||||
struct __tag_wctype_t;
|
||||
typedef struct __tag_wctype_t *__wctype_t;
|
||||
|
||||
/*
|
||||
* mbstate_t is an opaque object to keep conversion state, during multibyte
|
||||
* stream conversions. The content must not be referenced by user programs.
|
||||
*/
|
||||
typedef union {
|
||||
__int64_t __mbstateL; /* for alignment */
|
||||
char __mbstate8[128];
|
||||
} __mbstate_t;
|
||||
|
||||
#define _BSD_WCTRANS_T_ __wctrans_t /* wctrans_t */
|
||||
#define _BSD_WCTYPE_T_ __wctype_t /* wctype_t */
|
||||
#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
|
||||
|
||||
#endif /* !_SYS_ANSI_H_ */
|
||||
@@ -1,154 +0,0 @@
|
||||
/* $NetBSD: atomic.h,v 1.11 2009/11/20 02:17:07 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007, 2008 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.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_ATOMIC_H_
|
||||
#define _SYS_ATOMIC_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
/*
|
||||
* Atomic ADD
|
||||
*/
|
||||
void atomic_add_32(volatile uint32_t *, int32_t);
|
||||
void atomic_add_int(volatile unsigned int *, int);
|
||||
void atomic_add_long(volatile unsigned long *, long);
|
||||
void atomic_add_ptr(volatile void *, ssize_t);
|
||||
void atomic_add_64(volatile uint64_t *, int64_t);
|
||||
|
||||
uint32_t atomic_add_32_nv(volatile uint32_t *, int32_t);
|
||||
unsigned int atomic_add_int_nv(volatile unsigned int *, int);
|
||||
unsigned long atomic_add_long_nv(volatile unsigned long *, long);
|
||||
void * atomic_add_ptr_nv(volatile void *, ssize_t);
|
||||
uint64_t atomic_add_64_nv(volatile uint64_t *, int64_t);
|
||||
|
||||
/*
|
||||
* Atomic AND
|
||||
*/
|
||||
void atomic_and_32(volatile uint32_t *, uint32_t);
|
||||
void atomic_and_uint(volatile unsigned int *, unsigned int);
|
||||
void atomic_and_ulong(volatile unsigned long *, unsigned long);
|
||||
void atomic_and_64(volatile uint64_t *, uint64_t);
|
||||
|
||||
uint32_t atomic_and_32_nv(volatile uint32_t *, uint32_t);
|
||||
unsigned int atomic_and_uint_nv(volatile unsigned int *, unsigned int);
|
||||
unsigned long atomic_and_ulong_nv(volatile unsigned long *, unsigned long);
|
||||
uint64_t atomic_and_64_nv(volatile uint64_t *, uint64_t);
|
||||
|
||||
/*
|
||||
* Atomic OR
|
||||
*/
|
||||
void atomic_or_32(volatile uint32_t *, uint32_t);
|
||||
void atomic_or_uint(volatile unsigned int *, unsigned int);
|
||||
void atomic_or_ulong(volatile unsigned long *, unsigned long);
|
||||
void atomic_or_64(volatile uint64_t *, uint64_t);
|
||||
|
||||
uint32_t atomic_or_32_nv(volatile uint32_t *, uint32_t);
|
||||
unsigned int atomic_or_uint_nv(volatile unsigned int *, unsigned int);
|
||||
unsigned long atomic_or_ulong_nv(volatile unsigned long *, unsigned long);
|
||||
uint64_t atomic_or_64_nv(volatile uint64_t *, uint64_t);
|
||||
|
||||
/*
|
||||
* Atomic COMPARE-AND-SWAP
|
||||
*/
|
||||
uint32_t atomic_cas_32(volatile uint32_t *, uint32_t, uint32_t);
|
||||
unsigned int atomic_cas_uint(volatile unsigned int *, unsigned int,
|
||||
unsigned int);
|
||||
unsigned long atomic_cas_ulong(volatile unsigned long *, unsigned long,
|
||||
unsigned long);
|
||||
void * atomic_cas_ptr(volatile void *, void *, void *);
|
||||
uint64_t atomic_cas_64(volatile uint64_t *, uint64_t, uint64_t);
|
||||
|
||||
/*
|
||||
* Non-interlocked atomic COMPARE-AND-SWAP.
|
||||
*/
|
||||
uint32_t atomic_cas_32_ni(volatile uint32_t *, uint32_t, uint32_t);
|
||||
unsigned int atomic_cas_uint_ni(volatile unsigned int *, unsigned int,
|
||||
unsigned int);
|
||||
unsigned long atomic_cas_ulong_ni(volatile unsigned long *, unsigned long,
|
||||
unsigned long);
|
||||
void * atomic_cas_ptr_ni(volatile void *, void *, void *);
|
||||
uint64_t atomic_cas_64_ni(volatile uint64_t *, uint64_t, uint64_t);
|
||||
|
||||
/*
|
||||
* Atomic SWAP
|
||||
*/
|
||||
uint32_t atomic_swap_32(volatile uint32_t *, uint32_t);
|
||||
unsigned int atomic_swap_uint(volatile unsigned int *, unsigned int);
|
||||
unsigned long atomic_swap_ulong(volatile unsigned long *, unsigned long);
|
||||
void * atomic_swap_ptr(volatile void *, void *);
|
||||
uint64_t atomic_swap_64(volatile uint64_t *, uint64_t);
|
||||
|
||||
/*
|
||||
* Atomic DECREMENT
|
||||
*/
|
||||
void atomic_dec_32(volatile uint32_t *);
|
||||
void atomic_dec_uint(volatile unsigned int *);
|
||||
void atomic_dec_ulong(volatile unsigned long *);
|
||||
void atomic_dec_ptr(volatile void *);
|
||||
void atomic_dec_64(volatile uint64_t *);
|
||||
|
||||
uint32_t atomic_dec_32_nv(volatile uint32_t *);
|
||||
unsigned int atomic_dec_uint_nv(volatile unsigned int *);
|
||||
unsigned long atomic_dec_ulong_nv(volatile unsigned long *);
|
||||
void * atomic_dec_ptr_nv(volatile void *);
|
||||
uint64_t atomic_dec_64_nv(volatile uint64_t *);
|
||||
|
||||
/*
|
||||
* Atomic INCREMENT
|
||||
*/
|
||||
void atomic_inc_32(volatile uint32_t *);
|
||||
void atomic_inc_uint(volatile unsigned int *);
|
||||
void atomic_inc_ulong(volatile unsigned long *);
|
||||
void atomic_inc_ptr(volatile void *);
|
||||
void atomic_inc_64(volatile uint64_t *);
|
||||
|
||||
uint32_t atomic_inc_32_nv(volatile uint32_t *);
|
||||
unsigned int atomic_inc_uint_nv(volatile unsigned int *);
|
||||
unsigned long atomic_inc_ulong_nv(volatile unsigned long *);
|
||||
void * atomic_inc_ptr_nv(volatile void *);
|
||||
uint64_t atomic_inc_64_nv(volatile uint64_t *);
|
||||
|
||||
/*
|
||||
* Memory barrier operations
|
||||
*/
|
||||
void membar_enter(void);
|
||||
void membar_exit(void);
|
||||
void membar_producer(void);
|
||||
void membar_consumer(void);
|
||||
void membar_sync(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ! _SYS_ATOMIC_H_ */
|
||||
@@ -1,294 +0,0 @@
|
||||
/* $NetBSD: bitops.h,v 1.7 2010/03/21 14:28:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Christos Zoulas and Joerg Sonnenberger.
|
||||
*
|
||||
* 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 _SYS_BITOPS_H_
|
||||
#define _SYS_BITOPS_H_
|
||||
|
||||
#include <sys/stdint.h>
|
||||
|
||||
/*
|
||||
* Find First Set functions
|
||||
*/
|
||||
#ifndef ffs32
|
||||
static __inline int __unused
|
||||
ffs32(uint32_t _n)
|
||||
{
|
||||
int _v;
|
||||
|
||||
if (!_n)
|
||||
return 0;
|
||||
|
||||
_v = 1;
|
||||
if ((_n & 0x0000FFFFU) == 0) {
|
||||
_n >>= 16;
|
||||
_v += 16;
|
||||
}
|
||||
if ((_n & 0x000000FFU) == 0) {
|
||||
_n >>= 8;
|
||||
_v += 8;
|
||||
}
|
||||
if ((_n & 0x0000000FU) == 0) {
|
||||
_n >>= 4;
|
||||
_v += 4;
|
||||
}
|
||||
if ((_n & 0x00000003U) == 0) {
|
||||
_n >>= 2;
|
||||
_v += 2;
|
||||
}
|
||||
if ((_n & 0x00000001U) == 0) {
|
||||
_n >>= 1;
|
||||
_v += 1;
|
||||
}
|
||||
return _v;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ffs64
|
||||
static __inline int __unused
|
||||
ffs64(uint64_t _n)
|
||||
{
|
||||
int _v;
|
||||
|
||||
if (!_n)
|
||||
return 0;
|
||||
|
||||
_v = 1;
|
||||
if ((_n & 0x00000000FFFFFFFFULL) == 0) {
|
||||
_n >>= 32;
|
||||
_v += 32;
|
||||
}
|
||||
if ((_n & 0x000000000000FFFFULL) == 0) {
|
||||
_n >>= 16;
|
||||
_v += 16;
|
||||
}
|
||||
if ((_n & 0x00000000000000FFULL) == 0) {
|
||||
_n >>= 8;
|
||||
_v += 8;
|
||||
}
|
||||
if ((_n & 0x000000000000000FULL) == 0) {
|
||||
_n >>= 4;
|
||||
_v += 4;
|
||||
}
|
||||
if ((_n & 0x0000000000000003ULL) == 0) {
|
||||
_n >>= 2;
|
||||
_v += 2;
|
||||
}
|
||||
if ((_n & 0x0000000000000001ULL) == 0) {
|
||||
_n >>= 1;
|
||||
_v += 1;
|
||||
}
|
||||
return _v;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find Last Set functions
|
||||
*/
|
||||
#ifndef fls32
|
||||
static __inline int __unused
|
||||
fls32(uint32_t _n)
|
||||
{
|
||||
int _v;
|
||||
|
||||
if (!_n)
|
||||
return 0;
|
||||
|
||||
_v = 32;
|
||||
if ((_n & 0xFFFF0000U) == 0) {
|
||||
_n <<= 16;
|
||||
_v -= 16;
|
||||
}
|
||||
if ((_n & 0xFF000000U) == 0) {
|
||||
_n <<= 8;
|
||||
_v -= 8;
|
||||
}
|
||||
if ((_n & 0xF0000000U) == 0) {
|
||||
_n <<= 4;
|
||||
_v -= 4;
|
||||
}
|
||||
if ((_n & 0xC0000000U) == 0) {
|
||||
_n <<= 2;
|
||||
_v -= 2;
|
||||
}
|
||||
if ((_n & 0x80000000U) == 0) {
|
||||
_n <<= 1;
|
||||
_v -= 1;
|
||||
}
|
||||
return _v;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef fls64
|
||||
static __inline int __unused
|
||||
fls64(uint64_t _n)
|
||||
{
|
||||
int _v;
|
||||
|
||||
if (!_n)
|
||||
return 0;
|
||||
|
||||
_v = 64;
|
||||
if ((_n & 0xFFFFFFFF00000000ULL) == 0) {
|
||||
_n <<= 32;
|
||||
_v -= 32;
|
||||
}
|
||||
if ((_n & 0xFFFF000000000000ULL) == 0) {
|
||||
_n <<= 16;
|
||||
_v -= 16;
|
||||
}
|
||||
if ((_n & 0xFF00000000000000ULL) == 0) {
|
||||
_n <<= 8;
|
||||
_v -= 8;
|
||||
}
|
||||
if ((_n & 0xF000000000000000ULL) == 0) {
|
||||
_n <<= 4;
|
||||
_v -= 4;
|
||||
}
|
||||
if ((_n & 0xC000000000000000ULL) == 0) {
|
||||
_n <<= 2;
|
||||
_v -= 2;
|
||||
}
|
||||
if ((_n & 0x8000000000000000ULL) == 0) {
|
||||
_n <<= 1;
|
||||
_v -= 1;
|
||||
}
|
||||
return _v;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Integer logarithm, returns -1 on error. Inspired by the linux
|
||||
* version written by David Howells.
|
||||
*/
|
||||
#define _ilog2_helper(_n, _x) ((_n) & (1ULL << (_x))) ? _x :
|
||||
#define ilog2(_n) \
|
||||
( \
|
||||
__builtin_constant_p(_n) ? ( \
|
||||
_ilog2_helper(_n, 63) \
|
||||
_ilog2_helper(_n, 62) \
|
||||
_ilog2_helper(_n, 61) \
|
||||
_ilog2_helper(_n, 60) \
|
||||
_ilog2_helper(_n, 59) \
|
||||
_ilog2_helper(_n, 58) \
|
||||
_ilog2_helper(_n, 57) \
|
||||
_ilog2_helper(_n, 56) \
|
||||
_ilog2_helper(_n, 55) \
|
||||
_ilog2_helper(_n, 54) \
|
||||
_ilog2_helper(_n, 53) \
|
||||
_ilog2_helper(_n, 52) \
|
||||
_ilog2_helper(_n, 51) \
|
||||
_ilog2_helper(_n, 50) \
|
||||
_ilog2_helper(_n, 49) \
|
||||
_ilog2_helper(_n, 48) \
|
||||
_ilog2_helper(_n, 47) \
|
||||
_ilog2_helper(_n, 46) \
|
||||
_ilog2_helper(_n, 45) \
|
||||
_ilog2_helper(_n, 44) \
|
||||
_ilog2_helper(_n, 43) \
|
||||
_ilog2_helper(_n, 42) \
|
||||
_ilog2_helper(_n, 41) \
|
||||
_ilog2_helper(_n, 40) \
|
||||
_ilog2_helper(_n, 39) \
|
||||
_ilog2_helper(_n, 38) \
|
||||
_ilog2_helper(_n, 37) \
|
||||
_ilog2_helper(_n, 36) \
|
||||
_ilog2_helper(_n, 35) \
|
||||
_ilog2_helper(_n, 34) \
|
||||
_ilog2_helper(_n, 33) \
|
||||
_ilog2_helper(_n, 32) \
|
||||
_ilog2_helper(_n, 31) \
|
||||
_ilog2_helper(_n, 30) \
|
||||
_ilog2_helper(_n, 29) \
|
||||
_ilog2_helper(_n, 28) \
|
||||
_ilog2_helper(_n, 27) \
|
||||
_ilog2_helper(_n, 26) \
|
||||
_ilog2_helper(_n, 25) \
|
||||
_ilog2_helper(_n, 24) \
|
||||
_ilog2_helper(_n, 23) \
|
||||
_ilog2_helper(_n, 22) \
|
||||
_ilog2_helper(_n, 21) \
|
||||
_ilog2_helper(_n, 20) \
|
||||
_ilog2_helper(_n, 19) \
|
||||
_ilog2_helper(_n, 18) \
|
||||
_ilog2_helper(_n, 17) \
|
||||
_ilog2_helper(_n, 16) \
|
||||
_ilog2_helper(_n, 15) \
|
||||
_ilog2_helper(_n, 14) \
|
||||
_ilog2_helper(_n, 13) \
|
||||
_ilog2_helper(_n, 12) \
|
||||
_ilog2_helper(_n, 11) \
|
||||
_ilog2_helper(_n, 10) \
|
||||
_ilog2_helper(_n, 9) \
|
||||
_ilog2_helper(_n, 8) \
|
||||
_ilog2_helper(_n, 7) \
|
||||
_ilog2_helper(_n, 6) \
|
||||
_ilog2_helper(_n, 5) \
|
||||
_ilog2_helper(_n, 4) \
|
||||
_ilog2_helper(_n, 3) \
|
||||
_ilog2_helper(_n, 2) \
|
||||
_ilog2_helper(_n, 1) \
|
||||
_ilog2_helper(_n, 0) \
|
||||
-1) : ((sizeof(_n) >= 4 ? fls64(_n) : fls32(_n)) - 1) \
|
||||
)
|
||||
|
||||
static __inline void
|
||||
fast_divide32_prepare(uint32_t _div, uint32_t * __restrict _m,
|
||||
uint8_t *__restrict _s1, uint8_t *__restrict _s2)
|
||||
{
|
||||
uint64_t _mt;
|
||||
int _l;
|
||||
|
||||
_l = fls32(_div - 1);
|
||||
_mt = 0x100000000ULL * ((1ULL << _l) - _div);
|
||||
*_m = (uint32_t)(_mt / _div + 1);
|
||||
*_s1 = (_l > 1) ? 1 : _l;
|
||||
*_s2 = (_l == 0) ? 0 : _l - 1;
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
static __inline uint32_t
|
||||
fast_divide32(uint32_t _v, uint32_t _div, uint32_t _m, uint8_t _s1,
|
||||
uint8_t _s2)
|
||||
{
|
||||
uint32_t _t;
|
||||
|
||||
_t = (uint32_t)(((uint64_t)_v * _m) >> 32);
|
||||
return (_t + ((_v - _t) >> _s1)) >> _s2;
|
||||
}
|
||||
|
||||
static __inline uint32_t
|
||||
fast_remainder32(uint32_t _v, uint32_t _div, uint32_t _m, uint8_t _s1,
|
||||
uint8_t _s2)
|
||||
{
|
||||
|
||||
return _v - _div * fast_divide32(_v, _div, _m, _s1, _s2);
|
||||
}
|
||||
|
||||
#endif /* _SYS_BITOPS_H_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,79 +0,0 @@
|
||||
/* $NetBSD: bswap.h,v 1.16 2009/08/08 21:23:15 christos Exp $ */
|
||||
|
||||
/* Written by Manuel Bouyer. Public domain */
|
||||
|
||||
#ifndef _SYS_BSWAP_H_
|
||||
#define _SYS_BSWAP_H_
|
||||
|
||||
#ifndef _LOCORE
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <machine/bswap.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
/* Always declare the functions in case their address is taken (etc) */
|
||||
#if defined(_KERNEL) || defined(_STANDALONE) || !defined(__BSWAP_RENAME)
|
||||
uint16_t bswap16(uint16_t) __constfunc;
|
||||
uint32_t bswap32(uint32_t) __constfunc;
|
||||
#else
|
||||
uint16_t bswap16(uint16_t) __RENAME(__bswap16) __constfunc;
|
||||
uint32_t bswap32(uint32_t) __RENAME(__bswap32) __constfunc;
|
||||
#endif
|
||||
uint64_t bswap64(uint64_t) __constfunc;
|
||||
__END_DECLS
|
||||
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(__lint__)
|
||||
|
||||
/* machine/byte_swap.h might have defined inline versions */
|
||||
#ifndef __BYTE_SWAP_U64_VARIABLE
|
||||
#define __BYTE_SWAP_U64_VARIABLE bswap64
|
||||
#endif
|
||||
|
||||
#ifndef __BYTE_SWAP_U32_VARIABLE
|
||||
#define __BYTE_SWAP_U32_VARIABLE bswap32
|
||||
#endif
|
||||
|
||||
#ifndef __BYTE_SWAP_U16_VARIABLE
|
||||
#define __BYTE_SWAP_U16_VARIABLE bswap16
|
||||
#endif
|
||||
|
||||
#define __byte_swap_u64_constant(x) \
|
||||
(__CAST(uint64_t, \
|
||||
((((x) & 0xff00000000000000ull) >> 56) | \
|
||||
(((x) & 0x00ff000000000000ull) >> 40) | \
|
||||
(((x) & 0x0000ff0000000000ull) >> 24) | \
|
||||
(((x) & 0x000000ff00000000ull) >> 8) | \
|
||||
(((x) & 0x00000000ff000000ull) << 8) | \
|
||||
(((x) & 0x0000000000ff0000ull) << 24) | \
|
||||
(((x) & 0x000000000000ff00ull) << 40) | \
|
||||
(((x) & 0x00000000000000ffull) << 56))))
|
||||
|
||||
#define __byte_swap_u32_constant(x) \
|
||||
(__CAST(uint32_t, \
|
||||
((((x) & 0xff000000) >> 24) | \
|
||||
(((x) & 0x00ff0000) >> 8) | \
|
||||
(((x) & 0x0000ff00) << 8) | \
|
||||
(((x) & 0x000000ff) << 24))))
|
||||
|
||||
#define __byte_swap_u16_constant(x) \
|
||||
(__CAST(uint16_t, \
|
||||
((((x) & 0xff00) >> 8) | \
|
||||
(((x) & 0x00ff) << 8))))
|
||||
|
||||
#define bswap64(x) \
|
||||
(__builtin_constant_p((x)) ? \
|
||||
__byte_swap_u64_constant(x) : __BYTE_SWAP_U64_VARIABLE(x))
|
||||
|
||||
#define bswap32(x) \
|
||||
(__builtin_constant_p((x)) ? \
|
||||
__byte_swap_u32_constant(x) : __BYTE_SWAP_U32_VARIABLE(x))
|
||||
|
||||
#define bswap16(x) \
|
||||
(__builtin_constant_p((x)) ? \
|
||||
__byte_swap_u16_constant(x) : __BYTE_SWAP_U16_VARIABLE(x))
|
||||
|
||||
#endif /* __GNUC__ && __OPTIMIZE__ */
|
||||
#endif /* !_LOCORE */
|
||||
|
||||
#endif /* !_SYS_BSWAP_H_ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user