diff options
author | phk <phk@FreeBSD.org> | 2009-09-08 20:45:40 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2009-09-08 20:45:40 +0000 |
commit | e645b495eda0a345c1b9caa5f932817c25234633 (patch) | |
tree | e7b582548488a3ceddf28413807147ffef4e2857 /sys | |
parent | aead28d158d987de2bf0e3069685beb09741b21f (diff) | |
download | FreeBSD-src-e645b495eda0a345c1b9caa5f932817c25234633.zip FreeBSD-src-e645b495eda0a345c1b9caa5f932817c25234633.tar.gz |
Get rid of the _NO_NAMESPACE_POLLUTION kludge by creating an
architecture specific include file containing the _ALIGN*
stuff which <sys/socket.h> needs.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/include/_align.h | 53 | ||||
-rw-r--r-- | sys/amd64/include/param.h | 17 | ||||
-rw-r--r-- | sys/arm/include/_align.h | 52 | ||||
-rw-r--r-- | sys/arm/include/param.h | 23 | ||||
-rw-r--r-- | sys/i386/include/_align.h | 47 | ||||
-rw-r--r-- | sys/i386/include/param.h | 12 | ||||
-rw-r--r-- | sys/ia64/include/_align.h | 53 | ||||
-rw-r--r-- | sys/ia64/include/param.h | 22 | ||||
-rw-r--r-- | sys/mips/include/_align.h | 53 | ||||
-rw-r--r-- | sys/mips/include/param.h | 10 | ||||
-rw-r--r-- | sys/pc98/include/_align.h | 29 | ||||
-rw-r--r-- | sys/powerpc/include/_align.h | 52 | ||||
-rw-r--r-- | sys/powerpc/include/param.h | 23 | ||||
-rw-r--r-- | sys/sparc64/include/_align.h | 44 | ||||
-rw-r--r-- | sys/sparc64/include/param.h | 23 | ||||
-rw-r--r-- | sys/sun4v/include/_align.h | 44 | ||||
-rw-r--r-- | sys/sun4v/include/param.h | 25 | ||||
-rw-r--r-- | sys/sys/param.h | 4 | ||||
-rw-r--r-- | sys/sys/socket.h | 4 |
19 files changed, 467 insertions, 123 deletions
diff --git a/sys/amd64/include/_align.h b/sys/amd64/include/_align.h new file mode 100644 index 0000000..40d70aa --- /dev/null +++ b/sys/amd64/include/_align.h @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2002 David E. O'Brien. All rights reserved. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)param.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD$ + */ + +#ifndef _AMD64_INCLUDE__ALIGN_H_ +#define _AMD64_INCLUDE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is u_long and + * must be cast to any desired pointer type. + */ +#define _ALIGNBYTES (sizeof(long) - 1) +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) + +#endif /* !_AMD64_INCLUDE__ALIGN_H_ */ diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 746ba30..f9b6bd8 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -39,26 +39,16 @@ * $FreeBSD$ */ + #ifndef _AMD64_INCLUDE_PARAM_H_ #define _AMD64_INCLUDE_PARAM_H_ -/* - * Machine dependent constants for AMD64. - */ +#include <machine/_align.h> /* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is u_long and - * must be cast to any desired pointer type. + * Machine dependent constants for AMD64. */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES (sizeof(long) - 1) -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) -#endif -#ifndef _NO_NAMESPACE_POLLUTION #define __HAVE_ACPI #define __PCI_REROUTE_INTERRUPT @@ -150,5 +140,4 @@ #define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) -#endif /* !_NO_NAMESPACE_POLLUTION */ #endif /* !_AMD64_INCLUDE_PARAM_H_ */ diff --git a/sys/arm/include/_align.h b/sys/arm/include/_align.h new file mode 100644 index 0000000..5a1db62 --- /dev/null +++ b/sys/arm/include/_align.h @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2001 David E. O'Brien + * 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. 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, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)param.h 5.8 (Berkeley) 6/28/91 + * $FreeBSD$ + */ + +#ifndef _ARM_INCLUDE__ALIGN_H_ +#define _ARM_INCLUDE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES (sizeof(int) - 1) +#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) + +#endif /* !_ARM_INCLUDE__ALIGN_H_ */ diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h index c680148..2161103 100644 --- a/sys/arm/include/param.h +++ b/sys/arm/include/param.h @@ -38,32 +38,20 @@ * $FreeBSD$ */ +#ifndef _ARM_INCLUDE_PARAM_H_ +#define _ARM_INCLUDE_PARAM_H_ + /* * Machine dependent constants for StrongARM */ -/* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. - */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES (sizeof(int) - 1) -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) -#endif +#include <machine/_align.h> #define STACKALIGNBYTES (8 - 1) #define STACKALIGN(p) ((u_int)(p) & ~STACKALIGNBYTES) -#ifndef _NO_NAMESPACE_POLLUTION - #define __PCI_REROUTE_INTERRUPT -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - #ifndef MACHINE #define MACHINE "arm" #endif @@ -136,5 +124,4 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_ARM_INCLUDE_PARAM_H_ */ diff --git a/sys/i386/include/_align.h b/sys/i386/include/_align.h new file mode 100644 index 0000000..20df0b8 --- /dev/null +++ b/sys/i386/include/_align.h @@ -0,0 +1,47 @@ +/*- + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)param.h 5.8 (Berkeley) 6/28/91 + * $FreeBSD$ + */ + +#ifndef _I386_INCLUDE__ALIGN_H_ +#define _I386_INCLUDE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES (sizeof(int) - 1) +#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) + +#endif /* !_I386_INCLUDE__ALIGN_H_ */ diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 2bcbaf4..b6a527d 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -33,6 +33,11 @@ * $FreeBSD$ */ +#include <machine/_align.h> + +#ifndef _I386_INCLUDE_PARAM_H_ +#define _I386_INCLUDE_PARAM_H_ + /* * Machine dependent constants for Intel 386. */ @@ -49,14 +54,10 @@ #define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) #endif -#ifndef _NO_NAMESPACE_POLLUTION #define __HAVE_ACPI #define __PCI_REROUTE_INTERRUPT -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - #ifndef MACHINE #define MACHINE "i386" #endif @@ -149,5 +150,4 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_I386_INCLUDE_PARAM_H_ */ diff --git a/sys/ia64/include/_align.h b/sys/ia64/include/_align.h new file mode 100644 index 0000000..26df35b --- /dev/null +++ b/sys/ia64/include/_align.h @@ -0,0 +1,53 @@ +/* $FreeBSD$ */ +/* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */ + +/*- + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: Utah $Hdr: machparam.h 1.11 89/08/14$ + * + * @(#)param.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _IA64_INCLUDE__ALIGN_H_ +#define _IA64_INCLUDE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is u_long and must be cast to + * any desired pointer type. + */ +#define _ALIGNBYTES 15 +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) + +#endif /* !_IA64_INCLUDE__ALIGN_H_ */ diff --git a/sys/ia64/include/param.h b/sys/ia64/include/param.h index cb805a6..8518020 100644 --- a/sys/ia64/include/param.h +++ b/sys/ia64/include/param.h @@ -39,29 +39,18 @@ * @(#)param.h 8.1 (Berkeley) 6/10/93 */ +#ifndef _IA64_INCLUDE_PARAM_H_ +#define _IA64_INCLUDE_PARAM_H_ + /* * Machine dependent constants for the IA64. */ -/* - * Round p (pointer or byte index) up to a correctly-aligned value for all - * data types (int, long, ...). The result is u_long and must be cast to - * any desired pointer type. - */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES 15 -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) -#endif -#ifndef _NO_NAMESPACE_POLLUTION +#include <machine/_align.h> #define __HAVE_ACPI #define __PCI_REROUTE_INTERRUPT -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - #ifndef MACHINE #define MACHINE "ia64" #endif @@ -119,5 +108,4 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_IA64_INCLUDE_PARAM_H_ */ diff --git a/sys/mips/include/_align.h b/sys/mips/include/_align.h new file mode 100644 index 0000000..4484a28 --- /dev/null +++ b/sys/mips/include/_align.h @@ -0,0 +1,53 @@ +/* $OpenBSD: param.h,v 1.11 1998/08/30 22:05:35 millert Exp $ */ + +/*- + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department and Ralph Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: Utah Hdr: machparam.h 1.11 89/08/14 + * from: @(#)param.h 8.1 (Berkeley) 6/10/93 + * JNPR: param.h,v 1.6.2.1 2007/09/10 07:49:36 girish + * $FreeBSD$ + */ + +#ifndef _MIPS_INCLUDE__ALIGN_H_ +#define _MIPS_INCLUDE__ALIGN_H_ + +/* + * 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. + */ +#define _ALIGNBYTES 7 +#define _ALIGN(p) (((u_int)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) + +#endif /* !_MIPS_INCLUDE__ALIGN_H_ */ diff --git a/sys/mips/include/param.h b/sys/mips/include/param.h index 250de77..10f348a 100644 --- a/sys/mips/include/param.h +++ b/sys/mips/include/param.h @@ -39,8 +39,10 @@ * $FreeBSD$ */ -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ +#ifndef _MIPS_INCLUDE_PARAM_H_ +#define _MIPS_INCLUDE_PARAM_H_ + +#include <machine/_align.h> #include <sys/cdefs.h> #ifdef _KERNEL @@ -82,8 +84,6 @@ * data types (int, long, ...). The result is u_int and must be cast to * any desired pointer type. */ -#define _ALIGNBYTES 7 -#define _ALIGN(p) (((u_int)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) @@ -167,4 +167,4 @@ #define DELAY(n) { register int N = (n); while (--N > 0); } #endif /* !_KERNEL */ -#endif /* !_MACHINE_PARAM_H_ */ +#endif /* !_MIPS_INCLUDE_PARAM_H_ */ diff --git a/sys/pc98/include/_align.h b/sys/pc98/include/_align.h new file mode 100644 index 0000000..8f6942f --- /dev/null +++ b/sys/pc98/include/_align.h @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2005 TAKAHASHI Yoshihiro. + * 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. + * + * $FreeBSD$ + */ + +#include <i386/_align.h> diff --git a/sys/powerpc/include/_align.h b/sys/powerpc/include/_align.h new file mode 100644 index 0000000..ef38f35 --- /dev/null +++ b/sys/powerpc/include/_align.h @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2001 David E. O'Brien + * 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. 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, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)param.h 5.8 (Berkeley) 6/28/91 + * $FreeBSD$ + */ + +#ifndef _POWERPC_INCLUDE__ALIGN_H_ +#define _POWERPC_INCLUDE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES (sizeof(int) - 1) +#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) + +#endif /* !_POWERPC_INCLUDE__ALIGN_H_ */ diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h index 9728fe4..160cd78 100644 --- a/sys/powerpc/include/param.h +++ b/sys/powerpc/include/param.h @@ -38,30 +38,18 @@ * $FreeBSD$ */ +#ifndef _POWERPC_INCLUDE_PARAM_H_ +#define _POWERPC_INCLUDE_PARAM_H_ + /* * Machine dependent constants for PowerPC (32-bit only currently) */ -/* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. - */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES (sizeof(int) - 1) -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) -#endif - -#ifndef _NO_NAMESPACE_POLLUTION +#include <machine/_align.h> /* Needed to display interrupts on OFW PCI */ #define __PCI_REROUTE_INTERRUPT -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - #ifndef MACHINE #define MACHINE "powerpc" #endif @@ -120,5 +108,4 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_POWERPC_INCLUDE_PARAM_H_ */ diff --git a/sys/sparc64/include/_align.h b/sys/sparc64/include/_align.h new file mode 100644 index 0000000..1dbd909 --- /dev/null +++ b/sys/sparc64/include/_align.h @@ -0,0 +1,44 @@ +/*- + * 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. + * + * 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: @(#)param.h 5.8 (Berkeley) 6/28/91 + * $FreeBSD$ + */ + +#ifndef _SPARC64_INCLUDE__ALIGN_H_ +#define _SPARC64_INCLUDE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES 0xf +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) + +#endif /* !_SPARC64_INCLUDE__ALIGN_H_ */ diff --git a/sys/sparc64/include/param.h b/sys/sparc64/include/param.h index 2642a8a..90864b0 100644 --- a/sys/sparc64/include/param.h +++ b/sys/sparc64/include/param.h @@ -30,29 +30,17 @@ * $FreeBSD$ */ +#ifndef _SPARC64_INCLUDE_PARAM_H_ +#define _SPARC64_INCLUDE_PARAM_H_ + /* * Machine dependent constants for sparc64. */ -/* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. - */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES 0xf -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) -#endif - -#ifndef _NO_NAMESPACE_POLLUTION +#include <machine/_align.h> #define __PCI_BAR_ZERO_VALID -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - #ifndef MACHINE #define MACHINE "sparc64" #endif @@ -150,5 +138,4 @@ #define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_SPARC64_INCLUDE_PARAM_H_ */ diff --git a/sys/sun4v/include/_align.h b/sys/sun4v/include/_align.h new file mode 100644 index 0000000..bce1557 --- /dev/null +++ b/sys/sun4v/include/_align.h @@ -0,0 +1,44 @@ +/*- + * 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. + * + * 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: @(#)param.h 5.8 (Berkeley) 6/28/91 + * $FreeBSD$ + */ + +#ifndef _SUN4V_INCLUDE__ALIGN_H_ +#define _SUN4V_INCLUDE__ALIGN_H_ + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES 0xf +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) + +#endif /* !_SUN4V_INCLUDE__ALIGN_H_ */ diff --git a/sys/sun4v/include/param.h b/sys/sun4v/include/param.h index 4b26748..069ab54 100644 --- a/sys/sun4v/include/param.h +++ b/sys/sun4v/include/param.h @@ -30,26 +30,14 @@ * $FreeBSD$ */ +#ifndef _SUN4V_INCLUDE_PARAM_H_ +#define _SUN4V_INCLUDE_PARAM_H_ + /* * Machine dependent constants for sparc64. */ -/* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. - */ -#ifndef _ALIGNBYTES -#define _ALIGNBYTES 0xf -#endif -#ifndef _ALIGN -#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) -#endif - -#ifndef _NO_NAMESPACE_POLLUTION - -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ +#include <machine/_align.h> #ifndef MACHINE #define MACHINE "sun4v" @@ -147,7 +135,4 @@ #define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) #endif /* LOCORE */ - - -#endif /* !_MACHINE_PARAM_H_ */ -#endif /* !_NO_NAMESPACE_POLLUTION */ +#endif /* !_SUN4V_INCLUDE_PARAM_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 0c7f34b..46d016b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -112,8 +112,6 @@ #include <sys/limits.h> #endif -#ifndef _NO_NAMESPACE_POLLUTION - #ifndef DEV_BSHIFT #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ #endif @@ -182,8 +180,6 @@ ((off_t)(db) << DEV_BSHIFT) #endif -#endif /* _NO_NAMESPACE_POLLUTION */ - #define PRIMASK 0x0ff #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ #define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */ diff --git a/sys/sys/socket.h b/sys/sys/socket.h index ab9f213..13961e0 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -36,9 +36,7 @@ #include <sys/cdefs.h> #include <sys/_types.h> #include <sys/_iovec.h> -#define _NO_NAMESPACE_POLLUTION -#include <machine/param.h> -#undef _NO_NAMESPACE_POLLUTION +#include <machine/_align.h> /* * Definitions related to sockets: types, address families, options. |