Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/include Instead of doing #include </usr/in...



details:   https://anonhg.NetBSD.org/src/rev/7ef834dfd7a6
branches:  trunk
changeset: 769213:7ef834dfd7a6
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Sep 03 14:23:49 2011 +0000

description:
Instead of doing #include </usr/include/machine/..>, use the headers
that ship with the kernel sources as #include "../../$host/include/$hdr",
and auto-generate these ugly headers with a script.

diffstat:

 sys/arch/usermode/include/Makefile.headers   |   4 +
 sys/arch/usermode/include/asm.h              |  48 +++++++---------------
 sys/arch/usermode/include/bswap.h            |  48 +++++++---------------
 sys/arch/usermode/include/byte_swap.h        |  48 +++++++---------------
 sys/arch/usermode/include/disklabel.h        |  46 ++++++---------------
 sys/arch/usermode/include/elf_machdep.h      |  48 +++++++---------------
 sys/arch/usermode/include/endian.h           |  48 +++++++---------------
 sys/arch/usermode/include/endian_machdep.h   |  48 +++++++---------------
 sys/arch/usermode/include/genheaders.sh      |  58 ++++++++++++++++++++++++++++
 sys/arch/usermode/include/int_const.h        |  48 +++++++---------------
 sys/arch/usermode/include/int_fmtio.h        |  48 +++++++---------------
 sys/arch/usermode/include/int_limits.h       |  48 +++++++---------------
 sys/arch/usermode/include/int_mwgwtypes.h    |  48 +++++++---------------
 sys/arch/usermode/include/int_types.h        |  48 +++++++---------------
 sys/arch/usermode/include/limits.h           |  48 +++++++---------------
 sys/arch/usermode/include/netbsd32_machdep.h |  48 +++++++---------------
 sys/arch/usermode/include/param.h            |  48 +++++++---------------
 sys/arch/usermode/include/ptrace.h           |  44 ++++++--------------
 sys/arch/usermode/include/wchar_limits.h     |  48 +++++++---------------
 19 files changed, 329 insertions(+), 543 deletions(-)

diffs (truncated from 992 to 300 lines):

diff -r 007a2f56c86c -r 7ef834dfd7a6 sys/arch/usermode/include/Makefile.headers
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/usermode/include/Makefile.headers        Sat Sep 03 14:23:49 2011 +0000
@@ -0,0 +1,4 @@
+# $NetBSD: Makefile.headers,v 1.1 2011/09/03 14:23:49 jmcneill Exp $
+
+headers:
+       sh genheaders.sh
diff -r 007a2f56c86c -r 7ef834dfd7a6 sys/arch/usermode/include/asm.h
--- a/sys/arch/usermode/include/asm.h   Sat Sep 03 14:09:03 2011 +0000
+++ b/sys/arch/usermode/include/asm.h   Sat Sep 03 14:23:49 2011 +0000
@@ -1,34 +1,18 @@
-/* $NetBSD: asm.h,v 1.2 2009/10/21 16:06:59 snj Exp $ */
+/* $NetBSD: asm.h,v 1.3 2011/09/03 14:23:50 jmcneill Exp $ */
+
+/*
+ * Automatically generated by genheaders.sh on Sat Sep  3 10:13:14 EDT 2011
+ * Do not modify directly!
+ */
+#ifndef _USERMODE_ASM_H
+#define _USERMODE_ASM_H
 
-/*-
- * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * 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 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.
- */
+#if defined(__i386__)
+#include "../../i386/include/asm.h"
+#elif defined(__x86_64__)
+#include "../../amd64/include/asm.h"
+#else
+#error port me
+#endif
 
-#ifndef _ARCH_USERMODE_INCLUDE_ASM_H
-#define _ARCH_USERMODE_INCLUDE_ASM_H
-
-#include </usr/include/machine/asm.h>
-
-#endif /* !_ARCH_USERMODE_INCLUDE_ASM_H */
+#endif
diff -r 007a2f56c86c -r 7ef834dfd7a6 sys/arch/usermode/include/bswap.h
--- a/sys/arch/usermode/include/bswap.h Sat Sep 03 14:09:03 2011 +0000
+++ b/sys/arch/usermode/include/bswap.h Sat Sep 03 14:23:49 2011 +0000
@@ -1,34 +1,18 @@
-/* $NetBSD: bswap.h,v 1.2 2009/10/21 16:06:59 snj Exp $ */
+/* $NetBSD: bswap.h,v 1.3 2011/09/03 14:23:50 jmcneill Exp $ */
+
+/*
+ * Automatically generated by genheaders.sh on Sat Sep  3 10:13:14 EDT 2011
+ * Do not modify directly!
+ */
+#ifndef _USERMODE_BSWAP_H
+#define _USERMODE_BSWAP_H
 
-/*-
- * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * 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 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.
- */
+#if defined(__i386__)
+#include "../../i386/include/bswap.h"
+#elif defined(__x86_64__)
+#include "../../amd64/include/bswap.h"
+#else
+#error port me
+#endif
 
-#ifndef _ARCH_USERMODE_INCLUDE_BSWAP_H
-#define _ARCH_USERMODE_INCLUDE_BSWAP_H
-
-#include </usr/include/machine/bswap.h>
-
-#endif /* !_ARCH_USERMODE_INCLUDE_BSWAP_H */
+#endif
diff -r 007a2f56c86c -r 7ef834dfd7a6 sys/arch/usermode/include/byte_swap.h
--- a/sys/arch/usermode/include/byte_swap.h     Sat Sep 03 14:09:03 2011 +0000
+++ b/sys/arch/usermode/include/byte_swap.h     Sat Sep 03 14:23:49 2011 +0000
@@ -1,34 +1,18 @@
-/* $NetBSD: byte_swap.h,v 1.2 2009/10/21 16:06:59 snj Exp $ */
+/* $NetBSD: byte_swap.h,v 1.3 2011/09/03 14:23:50 jmcneill Exp $ */
+
+/*
+ * Automatically generated by genheaders.sh on Sat Sep  3 10:13:14 EDT 2011
+ * Do not modify directly!
+ */
+#ifndef _USERMODE_BYTE_SWAP_H
+#define _USERMODE_BYTE_SWAP_H
 
-/*-
- * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * 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 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.
- */
+#if defined(__i386__)
+#include "../../i386/include/byte_swap.h"
+#elif defined(__x86_64__)
+#include "../../amd64/include/byte_swap.h"
+#else
+#error port me
+#endif
 
-#ifndef _ARCH_USERMODE_INCLUDE_BYTE_SWAP_H
-#define _ARCH_USERMODE_INCLUDE_BYTE_SWAP_H
-
-#include </usr/include/machine/byte_swap.h>
-
-#endif /* !_ARCH_USERMODE_INCLUDE_BYTE_SWAP_H */
+#endif
diff -r 007a2f56c86c -r 7ef834dfd7a6 sys/arch/usermode/include/disklabel.h
--- a/sys/arch/usermode/include/disklabel.h     Sat Sep 03 14:09:03 2011 +0000
+++ b/sys/arch/usermode/include/disklabel.h     Sat Sep 03 14:23:49 2011 +0000
@@ -1,41 +1,21 @@
-/* $NetBSD: disklabel.h,v 1.4 2011/08/31 12:56:13 jmcneill Exp $ */
+/* $NetBSD: disklabel.h,v 1.5 2011/09/03 14:23:50 jmcneill Exp $ */
 
-/*-
- * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * 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 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.
+/*
+ * Automatically generated by genheaders.sh on Sat Sep  3 10:13:14 EDT 2011
+ * Do not modify directly!
  */
+#ifndef _USERMODE_DISKLABEL_H
+#define _USERMODE_DISKLABEL_H
 
-#ifndef _ARCH_USERMODE_INCLUDE_DISKLABEL_H
-#define _ARCH_USERMODE_INCLUDE_DISKLABEL_H
-
-#include </usr/include/machine/disklabel.h>
+#if defined(__i386__)
+#include "../../i386/include/disklabel.h"
+#elif defined(__x86_64__)
+#include "../../amd64/include/disklabel.h"
+#else
+#error port me
+#endif
 #undef DISKUNIT
 #undef DISKPART
 #undef DISKMINOR
 
-#ifndef LABELUSESMBR
-#define LABELUSESMBR 1
 #endif
-
-#endif /* !_ARCH_USERMODE_INCLUDE_DISKLABEL_H */
diff -r 007a2f56c86c -r 7ef834dfd7a6 sys/arch/usermode/include/elf_machdep.h
--- a/sys/arch/usermode/include/elf_machdep.h   Sat Sep 03 14:09:03 2011 +0000
+++ b/sys/arch/usermode/include/elf_machdep.h   Sat Sep 03 14:23:49 2011 +0000
@@ -1,34 +1,18 @@
-/* $NetBSD: elf_machdep.h,v 1.2 2009/10/21 16:06:59 snj Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.3 2011/09/03 14:23:50 jmcneill Exp $ */
+
+/*
+ * Automatically generated by genheaders.sh on Sat Sep  3 10:13:14 EDT 2011
+ * Do not modify directly!
+ */
+#ifndef _USERMODE_ELF_MACHDEP_H
+#define _USERMODE_ELF_MACHDEP_H
 
-/*-
- * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * 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 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.
- */
+#if defined(__i386__)
+#include "../../i386/include/elf_machdep.h"
+#elif defined(__x86_64__)
+#include "../../amd64/include/elf_machdep.h"
+#else
+#error port me
+#endif
 
-#ifndef _ARCH_USERMODE_INCLUDE_ELF_MACHDEP_H
-#define _ARCH_USERMODE_INCLUDE_ELF_MACHDEP_H
-
-#include </usr/include/machine/elf_machdep.h>
-
-#endif /* !_ARCH_USERMODE_INCLUDE_ELF_MACHDEP_H */
+#endif
diff -r 007a2f56c86c -r 7ef834dfd7a6 sys/arch/usermode/include/endian.h
--- a/sys/arch/usermode/include/endian.h        Sat Sep 03 14:09:03 2011 +0000
+++ b/sys/arch/usermode/include/endian.h        Sat Sep 03 14:23:49 2011 +0000
@@ -1,34 +1,18 @@
-/* $NetBSD: endian.h,v 1.2 2009/10/21 16:06:59 snj Exp $ */
+/* $NetBSD: endian.h,v 1.3 2011/09/03 14:23:50 jmcneill Exp $ */
+
+/*
+ * Automatically generated by genheaders.sh on Sat Sep  3 10:13:14 EDT 2011
+ * Do not modify directly!
+ */
+#ifndef _USERMODE_ENDIAN_H
+#define _USERMODE_ENDIAN_H
 
-/*-
- * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * All rights reserved.
- *



Home | Main Index | Thread Index | Old Index