Rename /usr/src/sys/machine to /usr/src/sys/platform. Give the platform
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 19 Jan 2007 07:23:43 +0000 (07:23 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 19 Jan 2007 07:23:43 +0000 (07:23 +0000)
name its own variable, MACHINE_PLATFORM, instead of trying to use MACHINE
to name it.  Adjust the build infrastructure to match.

Revert MACHINE back to its original definition and remove uname shims.
This removes confusion with third party software.

This means a pc32 build has MACHINE=i386 and MACHINE_ARCH=i386, and a
vkernel build also has MACHINE=i386 and MACHINE_ARCH=i386.  The new
MACHINE_PLAFORM would be pc32 for a pc32 build, and vkernel for a vkernel
build.

Adjust all kernel configuration files to specify platform, machine, AND
machine_arch.

44 files changed:
Makefile.inc1
include/Makefile
lib/libc/gen/uname.c
share/mk/sys.mk
sys/boot/i386/libi386/Makefile
sys/boot/i386/libi386/biosacpi.c
sys/boot/ia64/libski/acpi_stub.c
sys/conf/acpi.mk
sys/conf/bsd.kern.mk
sys/conf/kern.post.mk
sys/conf/kern.pre.mk
sys/conf/kmod.mk
sys/conf/options
sys/config/GENERIC
sys/config/LINT
sys/config/TINDERBOX
sys/config/VKERNEL
sys/cpu/i386/include/param.h
sys/dev/Makefile
sys/dev/acpica5/Makefile
sys/dev/est/Makefile
sys/dev/misc/syscons/Makefile
sys/kern/Makefile
sys/kern/Makefile.misc
sys/kern/kern_mib.c
sys/platform/pc32/conf/Makefile
sys/platform/pc32/conf/files
sys/platform/pc32/include/param.h
sys/platform/vkernel/conf/Makefile
sys/platform/vkernel/conf/files
sys/platform/vkernel/i386/vm_machdep.c
sys/platform/vkernel/include/param.h [new file with mode: 0644]
sys/sys/sysctl.h
usr.bin/make/main.c
usr.bin/make/make.1
usr.bin/uname/uname.c
usr.sbin/Makefile
usr.sbin/config/config.h
usr.sbin/config/config.y
usr.sbin/config/configvers.h
usr.sbin/config/lang.l
usr.sbin/config/main.c
usr.sbin/config/mkmakefile.c
usr.sbin/config/mkoptions.c

index e6890e7..8867e53 100644 (file)
@@ -1,6 +1,6 @@
 #
 # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $
-# $DragonFly: src/Makefile.inc1,v 1.100 2007/01/15 18:29:44 corecode Exp $
+# $DragonFly: src/Makefile.inc1,v 1.101 2007/01/19 07:23:33 dillon Exp $
 #
 # Build-time options are documented in make.conf(5).
 #
@@ -144,6 +144,14 @@ BUILD_ARCH!=       sysctl -n hw.machine_arch
 .endif
 .endif
 
+# Backwards compatibility with older make's or older sys.mk's.  make
+# is expected to define MACHINE_PLATFORM.
+#
+.if !defined(MACHINE_PLATFORM)
+MACHINE_PLATFORM= pc32
+.endif
+TARGET_PLATFORM?= ${MACHINE_PLATFORM}
+
 # BTOOLS       (Natively built) All non-cross-development tools that the
 #              main build needs.  This includes things like 'mkdir' and 'rm'.
 #              We will not use the native system's exec path once we start
@@ -155,10 +163,12 @@ BUILD_ARCH!=      sysctl -n hw.machine_arch
 # WORLD                (Cross built) Our ultimate buildworld, using only BTOOLS and
 #              CTOOLS.
 #
-# MACHINE      Platform Architecture we are buliding on
+# MACHINE_PLATFORM Platform Architecture we are building on
+# MACHINE      Machine Architecture (usually the same as MACHINE_ARCH)
 # MACHINE_ARCH Cpu Architecture we are building on
 #
-# TARGET       Platform Architecture we are building for
+# TARGET_PLATFORM Platform Architecture we are building for
+# TARGET       Machine Architecture we are building for
 # TARGET_ARCH  Cpu Architecture we are building for
 #
 BTOOLSDEST=    ${DESTDIRBASE}/btools_${MACHINE_ARCH}
@@ -253,6 +263,7 @@ CROSSENV=   MAKEOBJDIRPREFIX=${WORLDDEST} \
                OBJTREE=${OBJTREE} \
                MACHINE_ARCH=${TARGET_ARCH} \
                MACHINE=${TARGET} \
+               MACHINE_PLATFORM=${TARGET_PLATFORM} \
                OBJFORMAT_PATH=${CTOOLSDEST}
 
 WMAKEENV=      ${CROSSENV} \
index f397dd6..db74c77 100644 (file)
@@ -1,6 +1,6 @@
 #      @(#)Makefile    8.2 (Berkeley) 1/4/94
 # $FreeBSD: src/include/Makefile,v 1.109.2.27 2003/01/24 05:12:29 sam Exp $
-# $DragonFly: src/include/Makefile,v 1.32 2007/01/09 14:22:16 corecode Exp $
+# $DragonFly: src/include/Makefile,v 1.33 2007/01/19 07:23:39 dillon Exp $
 #
 # Doing a make install builds /usr/include
 #
@@ -174,12 +174,12 @@ copies:           mtree_setup
        # then it needs to.
        cpdup -o ${DESTDIR}/usr/include/cpu ${DESTDIR}/usr/include/machine
 .endif
-.if exists(${.CURDIR}/../sys/machine/${MACHINE}/include)
-       cd ${.CURDIR}/../sys/machine/${MACHINE}/include; \
+.if exists(${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include)
+       cd ${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include; \
                ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
                ${DESTDIR}/usr/include/machine
-.if exists(${.CURDIR}/../sys/machine/${MACHINE}/include/pc)
-       cd ${.CURDIR}/../sys/machine/${MACHINE}/include/pc; \
+.if exists(${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include/pc)
+       cd ${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include/pc; \
                ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
                ${DESTDIR}/usr/include/machine/pc
 .endif
@@ -217,7 +217,7 @@ symlinks:   mtree_setup
        rm -rf ${DESTDIR}/usr/include/machine
        cpdup ${.CURDIR}/../sys/cpu/${MACHINE_ARCH}/include \
                ${DESTDIR}/usr/include/machine
-       cpdup -o ${.CURDIR}/../sys/machine/${MACHINE}/include \
+       cpdup -o ${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include \
                ${DESTDIR}/usr/include/machine
        rm -rf ${DESTDIR}/usr/include/i4b_machine
        ${LN} -s ../../sys/net/i4b/include/${MACHINE_ARCH} ${DESTDIR}/usr/include/i4b_machine
index 31b05b8..f5c9206 100644 (file)
@@ -32,7 +32,7 @@
  *
  * @(#)uname.c 8.1 (Berkeley) 1/4/94
  * $FreeBSD: src/lib/libc/gen/uname.c,v 1.7 1999/08/27 23:59:06 peter Exp $
- * $DragonFly: src/lib/libc/gen/uname.c,v 1.4 2006/12/26 11:27:44 sephe Exp $
+ * $DragonFly: src/lib/libc/gen/uname.c,v 1.5 2007/01/19 07:23:40 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -46,7 +46,7 @@ uname(struct utsname *name)
        int mib[2], rval;
        size_t len;
        char *p;
-       int oerrno, noent = 0;
+       int oerrno;
 
        rval = 0;
 
@@ -108,17 +108,12 @@ uname(struct utsname *name)
        }
 
        oerrno = errno;
-       mib[1] = HW_MACHINE_UNAME;
-again:
+       mib[1] = HW_MACHINE;
        mib[0] = CTL_HW;
        len = sizeof(name->machine);
        if (sysctl(mib, 2, &name->machine, &len, NULL, 0) == -1) {
                if (errno == ENOMEM) {
                        errno = oerrno;
-               } else if (!noent && errno == ENOENT) {
-                       noent = 1;
-                       mib[1] = HW_MACHINE;
-                       goto again;
                } else {
                        rval = -1;
                }
index d223f6b..1fb704b 100644 (file)
@@ -1,6 +1,6 @@
 #      from: @(#)sys.mk        8.2 (Berkeley) 3/21/94
 # $FreeBSD: src/share/mk/sys.mk,v 1.45.2.6 2002/12/23 16:33:37 ru Exp $
-# $DragonFly: src/share/mk/sys.mk,v 1.18 2006/11/15 03:27:10 corecode Exp $
+# $DragonFly: src/share/mk/sys.mk,v 1.19 2007/01/19 07:23:41 dillon Exp $
 
 unix           ?=      We run FreeBSD, not UNIX.
 
@@ -114,9 +114,9 @@ YFLAGS              ?=      -d
 
 # The 'make' program is expected to define the following.
 #
-# MACHINE      machine class
-# MACHINE_ARCH machine architecture (i386, amd64, vkernel, etc)
-# MACHINE_CPU  cpu architecture (i386)
+# MACHINE_PLATFORM     platform architecture (vkernel, pc32)
+# MACHINE              machine architecture (i386, etc..)
+# MACHINE_ARCH         cpu architecture (i386, amd64, etc)
 #
 .if !defined(MACHINE)
 .error "MACHINE was not defined by make"
@@ -124,17 +124,17 @@ YFLAGS            ?=      -d
 .if !defined(MACHINE_ARCH)
 .error "MACHINE_ARCH was not defined by make"
 .endif
-# I want to do this too, but bmake apparently uses these .mk files too.
+
+# Backwards compatibility.  There was a time during 1.7 development
+# where we tried to rename MACHINE.  This failed and was reverted,
+# and MACHINE_PLATFORM was added to make the distinction.  These shims
+# prevent buildworld from breaking.
 #
-#.if !defined(MACHINE_CPU)
-#.error "MACHINE_CPU was not defined by make"
-#.endif
-
-# Backwards compat:  old systems have hw.machine set to "i386", but it
-# is expected to be "pc32" in the build system.  Try and don't break
-# build/installworld for upgrading users.
-.if ${MACHINE} == "i386"
-MACHINE=pc32
+.if !defined(MACHINE_PLATFORM)
+MACHINE_PLATFORM=pc32
+.endif
+.if ${MACHINE} == "pc32"
+MACHINE=i386
 .endif
 
 .if defined(%POSIX)
index 1f41828..dcc0c30 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/boot/i386/libi386/Makefile,v 1.32 2003/07/02 12:45:45 ru Exp $
-# $DragonFly: src/sys/boot/i386/libi386/Attic/Makefile,v 1.7 2006/10/22 18:43:52 dillon Exp $
+# $DragonFly: src/sys/boot/i386/libi386/Attic/Makefile,v 1.8 2007/01/19 07:23:42 dillon Exp $
 #
 LIB=                   i386
 INTERNALLIB=           true
@@ -35,17 +35,18 @@ CFLAGS+=    -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \
 # the location of libstand
 CFLAGS+=       -I${.CURDIR}/../../../../lib/libstand/
 
+# If it's not there, don't consider it a target
+.if exists(${.CURDIR}/../../../cpu/i386/include)
+
 # Make "machine" required for all objects
 # (based on the more complete case in sys/arch/i386/boot/Makefile.inc)
 ${SRCS:M*.c:R:S/$/.o/g}: machine
 
-# If it's not there, don't consider it a target
-.if exists(${.CURDIR}/../../../arch/i386/include)
 beforedepend ${OBJS}: machine
 
 CLEANFILES+=   machine
 machine:
-       ${LN} -sf ${.CURDIR}/../../../arch/i386/include machine
+       ${LN} -sf ${.CURDIR}/../../../cpu/i386/include machine
 
 .endif
 
index e16e12a..600cef6 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/boot/i386/libi386/biosacpi.c,v 1.7 2003/08/25 23:28:31 obrien Exp $
- * $DragonFly: src/sys/boot/i386/libi386/Attic/biosacpi.c,v 1.4 2005/08/16 10:31:35 y0netan1 Exp $
+ * $DragonFly: src/sys/boot/i386/libi386/Attic/biosacpi.c,v 1.5 2007/01/19 07:23:42 dillon Exp $
  */
 
 #include <stand.h>
  * environment.
  */
 
-static RSDP_DESCRIPTOR *biosacpi_find_rsdp(void);
-static RSDP_DESCRIPTOR *biosacpi_search_rsdp(char *base, int length);
+static ACPI_TABLE_RSDP *biosacpi_find_rsdp(void);
+static ACPI_TABLE_RSDP *biosacpi_search_rsdp(char *base, int length);
 
 #define RSDP_CHECKSUM_LENGTH 20
 
 void
 biosacpi_detect(void)
 {
-    RSDP_DESCRIPTOR    *rsdp;
+    ACPI_TABLE_RSDP    *rsdp;
     char               buf[160];
     int                        revision;
 
@@ -86,10 +86,10 @@ biosacpi_detect(void)
 /*
  * Find the RSDP in low memory.  See section 5.2.2 of the ACPI spec.
  */
-static RSDP_DESCRIPTOR *
+static ACPI_TABLE_RSDP *
 biosacpi_find_rsdp(void)
 {
-    RSDP_DESCRIPTOR    *rsdp;
+    ACPI_TABLE_RSDP    *rsdp;
     uint16_t           *addr;
 
     /* EBDA is the 1 KB addressed by the 16 bit pointer at 0x40E. */
@@ -104,19 +104,19 @@ biosacpi_find_rsdp(void)
     return (NULL);
 }
 
-static RSDP_DESCRIPTOR *
+static ACPI_TABLE_RSDP *
 biosacpi_search_rsdp(char *base, int length)
 {
-    RSDP_DESCRIPTOR    *rsdp;
+    ACPI_TABLE_RSDP    *rsdp;
     u_int8_t           *cp, sum;
     int                        ofs, idx;
 
     /* search on 16-byte boundaries */
     for (ofs = 0; ofs < length; ofs += 16) {
-       rsdp = (RSDP_DESCRIPTOR *)(base + ofs);
+       rsdp = (ACPI_TABLE_RSDP *)(base + ofs);
 
        /* compare signature, validate checksum */
-       if (!strncmp(rsdp->Signature, RSDP_SIG, strlen(RSDP_SIG))) {
+       if (!strncmp(rsdp->Signature, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP))) {
            cp = (u_int8_t *)rsdp;
            sum = 0;
            for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++)
index 47c963e..813b688 100644 (file)
@@ -24,7 +24,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/boot/ia64/libski/acpi_stub.c,v 1.2 2003/09/08 09:11:32 obrien Exp $
- * $DragonFly: src/sys/boot/ia64/libski/acpi_stub.c,v 1.1 2003/11/10 06:08:37 dillon Exp $
+ * $DragonFly: src/sys/boot/ia64/libski/acpi_stub.c,v 1.2 2007/01/19 07:23:42 dillon Exp $
  */
 
 #include <contrib/dev/acpica/acpi.h>
@@ -159,7 +159,7 @@ struct {
        NULL                            /* XXX APIC table address. */
 };
 
-RSDP_DESCRIPTOR acpi_root = {
+ACPI_TABLE_RSDP acpi_root = {
        RSDP_SIG,
        0,                              /* XXX checksum. */
        "FBSD",
index cc7167d..3e5e67c 100644 (file)
@@ -1,10 +1,10 @@
-# $DragonFly: src/sys/conf/acpi.mk,v 1.5 2007/01/17 17:31:19 y0netan1 Exp $
+# $DragonFly: src/sys/conf/acpi.mk,v 1.6 2007/01/19 07:23:42 dillon Exp $
 #
 
 ACPICA_VERSION=                20061109
 ACPICA_DIR?=           contrib/dev/acpica-unix-${ACPICA_VERSION}
 OSACPI_MI_DIR?=                dev/acpica5
-OSACPI_MD_DIR?=                machine/${MACHINE}/acpica5
+OSACPI_MD_DIR?=                platform/${MACHINE_PLATFORM}/acpica5
 
 .if !defined(SYSDIR) && defined(S)
 SYSDIR=        $S
index 1853fbb..4470d2a 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/share/mk/bsd.kern.mk,v 1.17.2.1 2001/08/01 16:56:56 obrien Exp $
-# $DragonFly: src/sys/conf/bsd.kern.mk,v 1.11 2006/11/07 06:43:22 dillon Exp $
+# $DragonFly: src/sys/conf/bsd.kern.mk,v 1.12 2007/01/19 07:23:42 dillon Exp $
 
 #
 # Warning flags for compiling the kernel and components of the kernel.
@@ -32,4 +32,4 @@ CFLAGS+=      -fno-common
 #
 CFLAGS+=       -ffreestanding
 
-.include "../machine/${MACHINE}/conf/kern.mk"
+.include "../platform/${MACHINE_PLATFORM}/conf/kern.mk"
index 5f0fa8a..89dfe54 100644 (file)
@@ -1,4 +1,4 @@
-# $DragonFly: src/sys/conf/kern.post.mk,v 1.7 2007/01/11 02:49:56 corecode Exp $
+# $DragonFly: src/sys/conf/kern.post.mk,v 1.8 2007/01/19 07:23:42 dillon Exp $
 # 
 # This Makefile covers the bottom part of the MI build instructions
 #
@@ -47,11 +47,11 @@ kernel-clean:
 
 #lint: /tmp
 #      @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} \
-#        $S/machine/$P/$M/Locore.c ${CFILES} ioconf.c | \
+#        $S/platform/$P/$M/Locore.c ${CFILES} ioconf.c | \
 #          grep -v 'struct/union .* never defined' | \
 #          grep -v 'possible pointer alignment problem'
 
-locore.o: $S/machine/$P/$M/locore.s assym.s
+locore.o: $S/platform/$P/$M/locore.s assym.s
        ${NORMAL_S}
 
 # This is a hack.  BFD "optimizes" away dynamic mode if there are no
@@ -68,8 +68,8 @@ hack.So: Makefile
 assym.s: $S/kern/genassym.sh genassym.o
        sh $S/kern/genassym.sh genassym.o > ${.TARGET}
 
-genassym.o: $S/machine/$P/$M/genassym.c ${FORWARD_HEADERS_COOKIE}
-       ${CC} -c ${CFLAGS:N-fno-common} $S/machine/$P/$M/genassym.c
+genassym.o: $S/platform/$P/$M/genassym.c ${FORWARD_HEADERS_COOKIE}
+       ${CC} -c ${CFLAGS:N-fno-common} $S/platform/$P/$M/genassym.c
 
 ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
 
index 5709d31..35fd2bc 100644 (file)
@@ -1,4 +1,4 @@
-# $DragonFly: src/sys/conf/kern.pre.mk,v 1.3 2006/11/07 06:43:22 dillon Exp $
+# $DragonFly: src/sys/conf/kern.pre.mk,v 1.4 2007/01/19 07:23:42 dillon Exp $
 #
 # This Makefile covers the top part of the MI kernel build instructions
 #
@@ -11,7 +11,7 @@ KERNEL?=      kernel
 
 # Set the platform and machine architectures
 #
-P=     ${MACHINE}
+P=     ${MACHINE_PLATFORM}
 M=     ${MACHINE_ARCH}
 
 SIZE?=         size
@@ -77,17 +77,17 @@ PROFILE_C= ${CC} -c ${CFLAGS} ${.IMPSRC}
 NORMAL_M= awk -f $S/tools/makeobjops.awk -- -c $<; \
        ${CC} -c ${CFLAGS} ${PROF} ${.PREFIX}.c
 
-GEN_CFILES= $S/machine/$P/$M/genassym.c
+GEN_CFILES= $S/platform/$P/$M/genassym.c
 SYSTEM_CFILES= ioconf.c config.c
-SYSTEM_SFILES= $S/machine/$P/$M/locore.s
+SYSTEM_SFILES= $S/platform/$P/$M/locore.s
 SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
 SYSTEM_OBJS= locore.o ${OBJS} ioconf.o config.o hack.So
-SYSTEM_LD= @${LD} -Bdynamic -T $S/machine/$P/conf/ldscript.$M \
+SYSTEM_LD= @${LD} -Bdynamic -T $S/platform/$P/conf/ldscript.$M \
        -export-dynamic -dynamic-linker /red/herring \
        -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
        ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
-SYSTEM_DEP+= $S/machine/$P/conf/ldscript.$M
+SYSTEM_DEP+= $S/platform/$P/conf/ldscript.$M
 
 # Normalize output files to make it absolutely crystal clear to
 # anyone examining the build directory.
index 1abb7c7..2849c75 100644 (file)
@@ -1,6 +1,6 @@
 #      From: @(#)bsd.prog.mk   5.26 (Berkeley) 6/25/91
 # $FreeBSD: src/sys/conf/kmod.mk,v 1.82.2.15 2003/02/10 13:11:50 nyan Exp $
-# $DragonFly: src/sys/conf/kmod.mk,v 1.31 2007/01/10 16:41:37 corecode Exp $
+# $DragonFly: src/sys/conf/kmod.mk,v 1.32 2007/01/19 07:23:42 dillon Exp $
 #
 # The include file <bsd.kmod.mk> handles installing Kernel Loadable Device
 # drivers (KLD's).
@@ -197,9 +197,9 @@ S=  ${SYSDIR}
 ${_ILINKS}:
        @case ${.TARGET} in \
        machine) \
-               path=${SYSDIR}/machine/${MACHINE}/include ;; \
+               path=${SYSDIR}/platform/${MACHINE_PLATFORM}/include ;; \
        machine_base) \
-               path=${SYSDIR}/machine/${MACHINE} ;; \
+               path=${SYSDIR}/platform/${MACHINE_PLATFORM} ;; \
        cpu) \
                path=${SYSDIR}/cpu/${MACHINE_ARCH}/include ;; \
        cpu_base) \
index 130b4df..3d25677 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/conf/options,v 1.191.2.53 2003/06/04 17:56:58 sam Exp $
-# $DragonFly: src/sys/conf/options,v 1.60 2007/01/13 21:58:11 tgen Exp $
+# $DragonFly: src/sys/conf/options,v 1.61 2007/01/19 07:23:42 dillon Exp $
 #
 #        On the handling of kernel options
 #
@@ -13,7 +13,7 @@
 # coverage.
 #
 # All new options shall also be listed in either "conf/options" or
-# "<machine>/conf/options.<machine>".  Options that affect a single
+# "<platform>/conf/options.<platform>".  Options that affect a single
 # source-file <xxx>.[c|s] should be directed into "opt_<xxx>.h", while
 # options that affect multiple files should either go in
 # "opt_global.h" if this is a kernel-wide option (used just about
@@ -149,7 +149,7 @@ UDF         opt_dontuse.h
 NTFS           opt_dontuse.h
 
 # These static filesystems has one slightly bogus static dependency in
-# sys/machine/.../i386/autoconf.c.  If any of these filesystems are
+# sys/platform/.../i386/autoconf.c.  If any of these filesystems are
 # statically compiled into the kernel, code for mounting them as root
 # filesystems will be enabled - but look below.  Boot-code is purposely
 # unavailable for the LKM-based versions.
index 95652dd..667abb2 100644 (file)
@@ -4,9 +4,10 @@
 # Check the LINT configuration file in sys/config, for an
 # exhaustive list of options.
 #
-# $DragonFly: src/sys/config/GENERIC,v 1.47 2007/01/13 21:58:11 tgen Exp $
+# $DragonFly: src/sys/config/GENERIC,v 1.48 2007/01/19 07:23:42 dillon Exp $
 
-machine                pc32
+platform       pc32
+machine                i386
 machine_arch   i386
 cpu            I386_CPU
 cpu            I486_CPU
index 82cbb46..4ae6641 100644 (file)
@@ -3,7 +3,7 @@
 #      as much of the source tree as it can.
 #
 # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $
-# $DragonFly: src/sys/config/LINT,v 1.103 2007/01/13 22:26:54 tgen Exp $
+# $DragonFly: src/sys/config/LINT,v 1.104 2007/01/19 07:23:42 dillon Exp $
 #
 # NB: You probably don't want to try running a kernel built from this
 # file.  Instead, you should start from GENERIC, and add options from
@@ -13,7 +13,8 @@
 # These directives are mandatory.  The machine directive specifies the
 # platform and the machine_arch directive specifies the cpu architecture.
 #
-machine                pc32
+platform       pc32
+machine                i386
 machine_arch   i386
 
 #
index 4559c92..6efe519 100644 (file)
@@ -1,8 +1,9 @@
 # DragonFly BSD Tinderbox Configuration File
 #
-# $DragonFly: src/sys/config/Attic/TINDERBOX,v 1.21 2006/11/07 06:43:22 dillon Exp $
+# $DragonFly: src/sys/config/Attic/TINDERBOX,v 1.22 2007/01/19 07:23:42 dillon Exp $
 
-machine                pc32
+platform       pc32
+machine                i386
 machine_arch   i386
 cpu            I686_CPU
 ident          TINDERBOX
index fa458d6..754a2e3 100644 (file)
@@ -1,8 +1,9 @@
 # VKERNEL - test rid for virtual kernel
 #
-# $DragonFly: src/sys/config/VKERNEL,v 1.8 2007/01/13 23:09:17 dillon Exp $
+# $DragonFly: src/sys/config/VKERNEL,v 1.9 2007/01/19 07:23:42 dillon Exp $
 
-machine                vkernel         # platform architecture (i386, vkernel, etc)
+platform       vkernel         # platform architecture (i386, vkernel, etc)
+machine                i386
 machine_arch   i386            # cpu architecture (i386, etc)
 ident          VKERNEL
 maxusers       0
index cc9d6fc..c4a37a3 100644 (file)
@@ -35,7 +35,7 @@
  *
  *     from: @(#)param.h       5.8 (Berkeley) 6/28/91
  * $FreeBSD: src/sys/i386/include/param.h,v 1.54.2.8 2002/08/31 21:15:55 dillon Exp $
- * $DragonFly: src/sys/cpu/i386/include/param.h,v 1.12 2006/12/26 11:27:44 sephe Exp $
+ * $DragonFly: src/sys/cpu/i386/include/param.h,v 1.13 2007/01/19 07:23:42 dillon Exp $
  */
 
 #ifndef _CPU_PARAM_H_
 #define _ALIGN(p)      (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
 #endif
 
+#ifndef _MACHINE
+#define        _MACHINE        i386    /* cpu architecture */
+#endif
 #ifndef _MACHINE_ARCH
 #define        _MACHINE_ARCH   i386    /* cpu architecture */
 #endif
-#ifndef _MACHINE_CPU
-#define _MACHINE_CPU   i386    /* minimum supported cpu rev */
-#endif
 
 #endif /* _CPU_PARAM_H1_ */
 
 #ifndef _NO_NAMESPACE_POLLUTION
 
+#ifndef MACHINE
+#define        MACHINE         "i386"  /* cpu architecture */
+#endif
 #ifndef MACHINE_ARCH
 #define        MACHINE_ARCH    "i386"  /* cpu architecture */
 #endif
 
-#ifndef MACHINE_CPU
-#define MACHINE_CPU    "i386"  /* minimum supported cpu rev */
-#endif
-
-#ifndef MACHINE_UNAME
-#define MACHINE_UNAME  "i386"  /* for uname(1)/uname(3) */
-#endif
-
 #define MID_MACHINE    MID_I386
 
 /*
index 274f4d7..b777462 100644 (file)
@@ -1,7 +1,7 @@
-# $DragonFly: src/sys/dev/Makefile,v 1.10 2007/01/07 02:41:18 dillon Exp $
+# $DragonFly: src/sys/dev/Makefile,v 1.11 2007/01/19 07:23:42 dillon Exp $
 #
 
-.include "../machine/${MACHINE}/Makefile.inc"
+.include "../platform/${MACHINE_PLATFORM}/Makefile.inc"
 
 .ifdef DEV_ACPICA5_SUPPORT
 SUBDIR+= acpica5
index 5d785d7..3af3dd7 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/modules/acpi/acpi/Makefile,v 1.3 2004/01/08 16:38:32 njl Exp $
-# $DragonFly: src/sys/dev/acpica5/Makefile,v 1.15 2007/01/17 17:31:19 y0netan1 Exp $
+# $DragonFly: src/sys/dev/acpica5/Makefile,v 1.16 2007/01/19 07:23:42 dillon Exp $
 
 CONTRIBDIR=    ${SYSDIR}/${ACPICA_DIR}
 PATCHES=       hardware,hwsleep.c.patch include,acglobal.h.patch
@@ -21,7 +21,7 @@ PATCHES+=     include,acpiosxf.h.patch
 .PATH: ${.OBJDIR}                                      \
        ${.OBJDIR}/include                              \
        ${SYSDIR}/${OSACPI_MD_DIR}                      \
-       ${SYSDIR}/machine/${MACHINE}/isa                \
+       ${SYSDIR}/platform/${MACHINE_PLATFORM}/isa      \
        ${SYSDIR}/bus/pci                               \
        ${.CURDIR}/Osd                                  \
        ${.CURDIR}                                      \
index 93c8f28..3228438 100644 (file)
@@ -1,7 +1,7 @@
-# $DragonFly: src/sys/dev/est/Makefile,v 1.3 2006/11/07 06:43:23 dillon Exp $
+# $DragonFly: src/sys/dev/est/Makefile,v 1.4 2007/01/19 07:23:42 dillon Exp $
 #
 
-.PATH: ${.CURDIR}/../../machine/${MACHINE}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/../../platform/${MACHINE_PLATFORM}/${MACHINE_ARCH}
 SRCS=  est.c
 KMOD=  est
 
index 4801292..c568143 100644 (file)
@@ -1,8 +1,8 @@
 # $FreeBSD: src/sys/modules/syscons/Makefile,v 1.11.2.2 2003/05/15 02:02:39 murray Exp $
-# $DragonFly: src/sys/dev/misc/syscons/Makefile,v 1.3 2006/11/07 20:48:11 dillon Exp $
+# $DragonFly: src/sys/dev/misc/syscons/Makefile,v 1.4 2007/01/19 07:23:42 dillon Exp $
 #
 
-.include "../../../machine/${MACHINE}/Makefile.inc"
+.include "../../../platform/${MACHINE_PLATFORM}/Makefile.inc"
 
 SUBDIR =
 SUBDIR += blank
index 6220474..8b59c21 100644 (file)
@@ -1,6 +1,6 @@
 #      @(#)Makefile    8.2 (Berkeley) 3/21/94
 # $FreeBSD: src/sys/kern/Makefile,v 1.6.2.1 2003/02/10 12:21:08 des Exp $
-# $DragonFly: src/sys/kern/Makefile,v 1.12 2006/11/07 06:43:24 dillon Exp $
+# $DragonFly: src/sys/kern/Makefile,v 1.13 2007/01/19 07:23:42 dillon Exp $
 
 # Makefile for kernel tags files, init_sysent, etc.
 
@@ -14,7 +14,7 @@ SUBDIR= libmchain
 # are placed in each source directory.  We need to have links to tags files
 # from the generic directories that are relative to the machine type, even
 # via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
-# ${SYSDIR}/machine/${MACHINE}/tags.
+# ${SYSDIR}/platform/${MACHINE_PLATFORM}/tags.
 
 SYSTAGS=/var/db/sys_tags
 SYSDIR=${.CURDIR:H}
index eae6b00..922e1a6 100644 (file)
@@ -1,4 +1,4 @@
-# $DragonFly: src/sys/kern/Makefile.misc,v 1.6 2006/11/07 06:43:24 dillon Exp $
+# $DragonFly: src/sys/kern/Makefile.misc,v 1.7 2007/01/19 07:23:42 dillon Exp $
 #
 # Makefile for kernel tags files, init_sysent, etc.
 
@@ -29,7 +29,7 @@ ${.CURDIR}/../sys/sysunion.h: ${.CURDIR}/makesyscalls.sh ${.CURDIR}/syscalls.mas
 # are placed in each source directory.  We need to have links to tags files
 # from the generic directories that are relative to the machine type, even
 # via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
-# ${SYSDIR}/machine/${MACHINE}/tags.
+# ${SYSDIR}/platform/${MACHINE_PLATFORM}/tags.
 
 SYSTAGS=/var/db/sys_tags
 SYSDIR=${.CURDIR:H}
@@ -52,7 +52,7 @@ DGEN= conf \
 #
 #links::
 #      rm -f ${.CURDIR}/${SYSTAGS}
-#      -${LN} -s ${SYSDIR}/machine/${MACHINE}/tags ${.CURDIR}/${SYSTAGS}
+#      -${LN} -s ${SYSDIR}/platform/${MACHINE_PLATFORM}/tags ${.CURDIR}/${SYSTAGS}
 #      -cd ${.CURDIR} && for i in ${DGEN}; do \
 #          (cd ../$$i && { rm -f tags; ${LN} -s ${SYSTAGS} tags; }) done
 #      -cd ${.CURDIR} && for i in ${TAGARCH}; do \
index 5a267f2..7ba9ce3 100644 (file)
@@ -38,7 +38,7 @@
  *
  *     @(#)kern_sysctl.c       8.4 (Berkeley) 4/14/94
  * $FreeBSD: src/sys/kern/kern_mib.c,v 1.29.2.4 2001/07/30 23:28:00 peter Exp $
- * $DragonFly: src/sys/kern/kern_mib.c,v 1.14 2007/01/15 20:51:14 dillon Exp $
+ * $DragonFly: src/sys/kern/kern_mib.c,v 1.15 2007/01/19 07:23:42 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -148,17 +148,13 @@ SYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD,
 SYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD, 
     0, PAGE_SIZE, "System memory page size");
 
+static char    platform[] = MACHINE_PLATFORM;
+SYSCTL_STRING(_hw, HW_MACHINE_PLATFORM, platform, CTLFLAG_RD,
+    platform, 0, "Platform architecture");
+
 static char    machine_arch[] = MACHINE_ARCH;
 SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
-    machine_arch, 0, "System architecture");
-
-static char    machine_cpu[] = MACHINE_CPU;
-SYSCTL_STRING(_hw, HW_MACHINE_CPU, machine_cpu, CTLFLAG_RD,
-    machine_cpu, 0, "Cpu architecture");
-
-static char    machine_uname[] = MACHINE_UNAME;
-SYSCTL_STRING(_hw, HW_MACHINE_UNAME, machine_uname, CTLFLAG_RD,
-    machine_uname, 0, "Machine class (for uname)");
+    machine_arch, 0, "Cpu architecture");
 
 char hostname[MAXHOSTNAMELEN];
 
index 69f5733..41d9760 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright 1990 W. Jolitz
 #      from: @(#)Makefile.i386 7.1 5/10/91
 # $FreeBSD: src/sys/conf/Makefile.i386,v 1.179.2.16 2002/11/18 11:26:49 ru Exp $
-# $DragonFly: src/sys/platform/pc32/conf/Makefile,v 1.3 2006/11/07 06:43:24 dillon Exp $
+# $DragonFly: src/sys/platform/pc32/conf/Makefile,v 1.4 2007/01/19 07:23:42 dillon Exp $
 #
 # Makefile for DragonFly BSD
 #
@@ -24,7 +24,7 @@
 #      -DDESTDIR               Where to install, defaults to /
 
 # Which version of config(8) is required.
-%VERSREQ=      400025
+%VERSREQ=      400026
 
 .if !defined(S)
 .if exists(./@/.)
index e981f1d..154e8d0 100644 (file)
@@ -2,7 +2,7 @@
 # files marked standard are always included.
 #
 # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $
-# $DragonFly: src/sys/platform/pc32/conf/files,v 1.7 2007/01/06 03:29:10 dillon Exp $
+# $DragonFly: src/sys/platform/pc32/conf/files,v 1.8 2007/01/19 07:23:42 dillon Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -44,8 +44,8 @@ emulation/linux/linux_misc.c  optional        compat_linux
 emulation/linux/linux_signal.c optional        compat_linux
 emulation/linux/linux_socket.c optional        compat_linux
 emulation/linux/linux_stats.c  optional        compat_linux
-emulation/linux/linux_sysctl.c     optional        compat_linux
-emulation/linux/linux_uid16.c      optional        compat_linux
+emulation/linux/linux_sysctl.c  optional        compat_linux
+emulation/linux/linux_uid16.c   optional        compat_linux
 emulation/linux/linux_util.c   optional        compat_linux
 #
 contrib/dev/fla/fla.c          optional        fla
@@ -70,7 +70,7 @@ crypto/des/arch/i386/des_enc.S                optional        ipsec ipsec_esp
 crypto/des/des_ecb.c                   optional        netsmbcrypto
 crypto/des/arch/i386/des_enc.S         optional        netsmbcrypto
 crypto/des/des_setkey.c                        optional        netsmbcrypto
-bf_enc.o                       optional        crypto          \
+bf_enc.o                               optional        crypto          \
        dependency      "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S"             \
        compile-with    "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}"    \
        no-implicit-rule
@@ -78,7 +78,7 @@ crypto/des/arch/i386/des_enc.S                optional        crypto
 crypto/des/des_ecb.c                   optional        crypto
 crypto/des/des_setkey.c                        optional        crypto
 dev/disk/advansys/adv_isa.c            optional        adv isa
-dev/disk/aic/aic_isa.c         optional        aic isa
+dev/disk/aic/aic_isa.c                 optional        aic isa
 dev/netif/ar/if_ar_isa.c               optional        ar isa
 dev/serial/dgb/dgm.c                   optional        dgm
 
@@ -105,32 +105,32 @@ acpi_wakecode.h                           optional        acpi            \
 
 dev/netif/cm/if_cm_isa.c               optional        cm isa
 dev/netif/ed/if_ed_isa.c               optional        ed isa
-bus/eisa/eisaconf.c            optional        eisa
+bus/eisa/eisaconf.c                    optional        eisa
 dev/netif/em/if_em.c                   optional        em
-dev/netif/em/if_em_hw.c                optional        em
+dev/netif/em/if_em_hw.c                        optional        em
 dev/video/fb/fb.c                      optional        fb
 dev/video/fb/fb.c                      optional        vga
 dev/video/fb/splash.c                  optional        splash
 dev/video/fb/vga.c                     optional        vga
 dev/netif/fe/if_fe_isa.c               optional        fe isa
 dev/misc/kbd/atkbd.c                   optional        atkbd
-dev/misc/kbd/atkbdc.c          optional        atkbdc
+dev/misc/kbd/atkbdc.c                  optional        atkbdc
 dev/misc/kbd/kbd.c                     optional        atkbd
 dev/misc/kbd/kbd.c                     optional        kbd
 dev/misc/kbd/kbd.c                     optional        sc
 dev/misc/kbd/kbd.c                     optional        ukbd
 dev/misc/kbd/kbd.c                     optional        vt
-dev/raid/pst/pst-pci.c         optional        pst pci
-dev/raid/pst/pst-iop.c         optional        pst
-dev/raid/pst/pst-raid.c                optional        pst
+dev/raid/pst/pst-pci.c                 optional        pst pci
+dev/raid/pst/pst-iop.c                 optional        pst
+dev/raid/pst/pst-raid.c                        optional        pst
 dev/misc/puc/puc.c                     optional        puc
-dev/misc/puc/pucdata.c         optional        puc
+dev/misc/puc/pucdata.c                 optional        puc
 dev/netif/sbni/if_sbni.c               optional        sbni
 dev/netif/sr/if_sr_isa.c               optional        sr isa
 dev/misc/syscons/schistory.c           optional        sc
 dev/misc/syscons/scmouse.c             optional        sc
 dev/misc/syscons/scterm.c              optional        sc
-dev/misc/syscons/scterm-dumb.c optional        sc
+dev/misc/syscons/scterm-dumb.c         optional        sc
 dev/misc/syscons/scterm-sc.c           optional        sc
 dev/misc/syscons/scvesactl.c           optional        sc vga vesa
 dev/misc/syscons/scvgarndr.c           optional        sc vga
@@ -148,8 +148,8 @@ vfs/smbfs/smbfs_smb.c               optional        smbfs
 vfs/smbfs/smbfs_subr.c         optional        smbfs
 vfs/smbfs/smbfs_vfsops.c       optional        smbfs
 vfs/smbfs/smbfs_vnops.c                optional        smbfs
-machine/pc32/gnu/isa/dgb.c     optional        dgb
-machine/pc32/apm/apm.c         optional        apm
+platform/pc32/gnu/isa/dgb.c    optional        dgb
+platform/pc32/apm/apm.c                optional        apm
 cpu/i386/misc/atomic.c         standard                                \
        compile-with    "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
 cpu/i386/misc/elf_machdep.c            standard
@@ -157,61 +157,61 @@ cpu/i386/misc/in_cksum2.s         optional        inet
 cpu/i386/misc/ktr.c                    optional        ktr
 cpu/i386/misc/db_disasm.c              optional        ddb
 cpu/i386/misc/i386-gdbstub.c           optional        ddb
-machine/pc32/i386/autoconf.c           standard
-machine/pc32/i386/bios.c               standard
-machine/pc32/i386/bioscall.s           standard
-machine/pc32/i386/busdma_machdep.c     standard
-machine/pc32/i386/db_interface.c       optional        ddb
-machine/pc32/i386/db_trace.c           optional        ddb
-machine/pc32/i386/elan-mmcr.c          optional        cpu_elan
-machine/pc32/i386/exception.s          standard
-machine/pc32/isa/ipl.s                 standard
-machine/pc32/i386/globals.s            standard
-machine/pc32/i386/i686_mem.c           standard
-machine/pc32/i386/identcpu.c           standard
-machine/pc32/i386/initcpu.c            standard
-machine/pc32/i386/k6_mem.c             standard
-machine/pc32/i386/tls.c                        standard
+platform/pc32/i386/autoconf.c          standard
+platform/pc32/i386/bios.c              standard
+platform/pc32/i386/bioscall.s          standard
+platform/pc32/i386/busdma_machdep.c    standard
+platform/pc32/i386/db_interface.c      optional        ddb
+platform/pc32/i386/db_trace.c          optional        ddb
+platform/pc32/i386/elan-mmcr.c         optional        cpu_elan
+platform/pc32/i386/exception.s         standard
+platform/pc32/isa/ipl.s                        standard
+platform/pc32/i386/globals.s           standard
+platform/pc32/i386/i686_mem.c          standard
+platform/pc32/i386/identcpu.c          standard
+platform/pc32/i386/initcpu.c           standard
+platform/pc32/i386/k6_mem.c            standard
+platform/pc32/i386/tls.c               standard
 # locore.s needs to be handled in Makefile to put it first.  Otherwise it's
 # now normal.
 # arch/i386/i386/locore.s              standard
-machine/pc32/i386/machdep.c            standard
-machine/pc32/i386/math_emulate.c       optional        math_emulate
-machine/pc32/icu/icu_abi.c             standard
-machine/pc32/icu/icu_ipl.s             standard
-machine/pc32/icu/icu_vector.s          standard
-machine/pc32/apic/apic_abi.c           optional        smp
-machine/pc32/apic/mpapic.c             optional        smp
-machine/pc32/apic/apic_ipl.s           optional        smp
-machine/pc32/apic/apic_vector.s                optional        smp
-machine/pc32/i386/est.c                        optional        cpu_enable_est
+platform/pc32/i386/machdep.c           standard
+platform/pc32/i386/math_emulate.c      optional        math_emulate
+platform/pc32/icu/icu_abi.c            standard
+platform/pc32/icu/icu_ipl.s            standard
+platform/pc32/icu/icu_vector.s         standard
+platform/pc32/apic/apic_abi.c          optional        smp
+platform/pc32/apic/mpapic.c            optional        smp
+platform/pc32/apic/apic_ipl.s          optional        smp
+platform/pc32/apic/apic_vector.s       optional        smp
+platform/pc32/i386/est.c               optional        cpu_enable_est
 # temporarily not in build until we get the 'apic' option working on UP
 #arch/i386/i386/io_apic.c              optional        smp
 #arch/i386/i386/local_apic.c           optional        smp
-machine/pc32/i386/mpboot.s             optional        smp
-machine/pc32/i386/mplock.s             optional        smp
-machine/pc32/i386/mp_clock.c           optional        smp
-machine/pc32/i386/mp_machdep.c         optional        smp
-machine/pc32/i386/nexus.c              standard
-machine/pc32/i386/p4tcc.c              optional        cpu_enable_tcc
-machine/pc32/i386/perfmon.c            optional        perfmon
-machine/pc32/i386/perfmon.c            optional        perfmon profiling-routine
-machine/pc32/i386/pmap.c               standard
-machine/pc32/i386/pmap_inval.c         standard
-machine/pc32/i386/pnpbios.c            optional        pnpbios
-machine/pc32/i386/procfs_machdep.c     standard
-machine/pc32/i386/spinlock.s           standard
-machine/pc32/i386/support.s            standard
-machine/pc32/i386/bcopy.s              standard
-machine/pc32/i386/bzero.s              standard
-machine/pc32/i386/swtch.s              standard
-machine/pc32/i386/sys_machdep.c                standard
-machine/pc32/i386/trap.c               standard
-machine/pc32/i386/userconfig.c         optional        userconfig
-machine/pc32/i386/vm86.c               standard
-machine/pc32/i386/vm_machdep.c         standard
-machine/pc32/isa/asc.c                         optional        asc
-machine/pc32/isa/clock.c                       standard
+platform/pc32/i386/mpboot.s            optional        smp
+platform/pc32/i386/mplock.s            optional        smp
+platform/pc32/i386/mp_clock.c          optional        smp
+platform/pc32/i386/mp_machdep.c                optional        smp
+platform/pc32/i386/nexus.c             standard
+platform/pc32/i386/p4tcc.c             optional        cpu_enable_tcc
+platform/pc32/i386/perfmon.c           optional        perfmon
+platform/pc32/i386/perfmon.c           optional        perfmon profiling-routine
+platform/pc32/i386/pmap.c              standard
+platform/pc32/i386/pmap_inval.c                standard
+platform/pc32/i386/pnpbios.c           optional        pnpbios
+platform/pc32/i386/procfs_machdep.c    standard
+platform/pc32/i386/spinlock.s          standard
+platform/pc32/i386/support.s           standard
+platform/pc32/i386/bcopy.s             standard
+platform/pc32/i386/bzero.s             standard
+platform/pc32/i386/swtch.s             standard
+platform/pc32/i386/sys_machdep.c       standard
+platform/pc32/i386/trap.c              standard
+platform/pc32/i386/userconfig.c                optional        userconfig
+platform/pc32/i386/vm86.c              standard
+platform/pc32/i386/vm_machdep.c                standard
+platform/pc32/isa/asc.c                        optional        asc
+platform/pc32/isa/clock.c              standard
 dev/serial/cronyx/cronyx.c             optional        cx
 dev/video/ctx/ctx.c                    optional        ctx
 dev/serial/cy/cy.c                     optional        cy
@@ -226,8 +226,8 @@ dev/netif/el/if_el.c                        optional        el
 dev/netif/le/if_le.c                   optional        le
 dev/netif/rdp/if_rdp.c                 optional        rdp
 dev/netif/wl/if_wl.c                   optional        wl
-machine/pc32/isa/intr_machdep.c                        standard
-machine/pc32/isa/ipl_funcs.c                   standard                   \
+platform/pc32/isa/intr_machdep.c       standard
+platform/pc32/isa/ipl_funcs.c          standard                   \
        compile-with    "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
 bus/isa/i386/isa.c                     optional        isa
 bus/isa/i386/isa_compat.c              optional        isa compat_oldisa
@@ -236,13 +236,13 @@ dev/serial/stli/istallion.c               optional        stli
 dev/misc/labpc/labpc.c                 optional        labpc
 dev/disk/mcd/mcd.c                     optional        mcd
 dev/misc/mse/mse.c                     optional        mse
-machine/pc32/isa/npx.c                         mandatory       npx
+platform/pc32/isa/npx.c                        mandatory       npx
 bus/iicbus/i386/pcf.c                  optional        pcf
 bus/pci/i386/pci_cfgreg.c              optional        pci
 bus/pci/i386/pcibus.c                  optional        pci
-machine/pc32/isa/pmtimer.c                     optional        pmtimer acpi
+platform/pc32/isa/pmtimer.c            optional        pmtimer acpi
 # XXX drhodus
-machine/pc32/isa/prof_machdep.c                        optional        profiling-routine
+platform/pc32/isa/prof_machdep.c       optional        profiling-routine
 dev/serial/rc/rc.c                     optional        rc
 dev/disk/scd/scd.c                     optional        scd
 dev/misc/spic/spic.c                   optional        spic
index d6b3862..fd1636d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $DragonFly: src/sys/platform/pc32/include/param.h,v 1.2 2007/01/06 08:25:01 dillon Exp $
+ * $DragonFly: src/sys/platform/pc32/include/param.h,v 1.3 2007/01/19 07:23:42 dillon Exp $
  */
 
 #ifndef _MACHINE_PARAM_H_
@@ -8,14 +8,14 @@
 #define _MACHINE_PARAM_H_
 #endif
 
-#ifndef _MACHINE
-#define _MACHINE        pc32
+#ifndef _MACHINE_PLATFORM
+#define _MACHINE_PLATFORM      pc32
 #endif
 
 #ifndef _NO_NAMESPACE_POLLUTION
 
-#ifndef MACHINE
-#define MACHINE         "pc32"
+#ifndef MACHINE_PLATFORM
+#define MACHINE_PLATFORM       "pc32"
 #endif
 
 #define _GDT_ARRAY_PRESENT     /* used by db_disasm */
index 75cc5fa..cdf0330 100644 (file)
@@ -1,7 +1,7 @@
-# $DragonFly: src/sys/platform/vkernel/conf/Makefile,v 1.5 2007/01/12 03:05:49 dillon Exp $
+# $DragonFly: src/sys/platform/vkernel/conf/Makefile,v 1.6 2007/01/19 07:23:42 dillon Exp $
 #
 # Which version of config(8) is required.
-%VERSREQ=      400025
+%VERSREQ=      400026
 
 .if !defined(S)
 .if exists(./@/.)
index dbc6ab2..885fcd5 100644 (file)
@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $DragonFly: src/sys/platform/vkernel/conf/files,v 1.14 2007/01/15 01:29:01 dillon Exp $
+# $DragonFly: src/sys/platform/vkernel/conf/files,v 1.15 2007/01/19 07:23:42 dillon Exp $
 #
 bf_enc.o                       optional        ipsec ipsec_esp         \
        dependency      "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S"             \
@@ -30,7 +30,7 @@ vfs/smbfs/smbfs_vfsops.c      optional        smbfs
 vfs/smbfs/smbfs_vnops.c                optional        smbfs
 cpu/i386/misc/atomic.c         standard                                \
        compile-with    "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
-machine/vkernel/i386/autoconf.c        standard
+platform/vkernel/i386/autoconf.c       standard
 #
 # DDB XXX
 cpu/i386/misc/elf_machdep.c            standard
@@ -49,28 +49,28 @@ dev/virtual/net/if_vke.c            optional        vke
 
 # PLATFORM FILES
 #
-machine/vkernel/i386/global.s          standard
-machine/vkernel/i386/swtch.s           standard
-machine/vkernel/i386/npx.c             mandatory       npx
-machine/vkernel/i386/db_interface.c    standard
-machine/vkernel/i386/db_trace.c                standard
-machine/vkernel/i386/vm_machdep.c      standard
-machine/vkernel/i386/cpu_regs.c                standard
-machine/vkernel/i386/userldt.c         standard
-machine/vkernel/i386/tls.c             standard
-machine/vkernel/i386/trap.c            standard
-machine/vkernel/i386/exception.c       standard
-machine/vkernel/i386/procfs_machdep.c  standard
-machine/vkernel/i386/fork_tramp.s      standard
-machine/vkernel/platform/init.c                standard
-machine/vkernel/platform/globaldata.c  standard
-machine/vkernel/platform/kqueue.c      standard
-machine/vkernel/platform/machintr.c    standard
-machine/vkernel/platform/copyio.c      standard
-machine/vkernel/platform/pmap.c                standard
-machine/vkernel/platform/pmap_inval.c  standard
-machine/vkernel/platform/busdma_machdep.c standard
-machine/vkernel/platform/sysarch.c     standard
-machine/vkernel/platform/systimer.c    standard
-machine/vkernel/platform/console.c     standard
-machine/vkernel/platform/ipl_funcs.c   standard
+platform/vkernel/i386/global.s         standard
+platform/vkernel/i386/swtch.s          standard
+platform/vkernel/i386/npx.c            mandatory       npx
+platform/vkernel/i386/db_interface.c   standard
+platform/vkernel/i386/db_trace.c       standard
+platform/vkernel/i386/vm_machdep.c     standard
+platform/vkernel/i386/cpu_regs.c       standard
+platform/vkernel/i386/userldt.c                standard
+platform/vkernel/i386/tls.c            standard
+platform/vkernel/i386/trap.c           standard
+platform/vkernel/i386/exception.c      standard
+platform/vkernel/i386/procfs_machdep.c standard
+platform/vkernel/i386/fork_tramp.s     standard
+platform/vkernel/platform/init.c       standard
+platform/vkernel/platform/globaldata.c standard
+platform/vkernel/platform/kqueue.c     standard
+platform/vkernel/platform/machintr.c   standard
+platform/vkernel/platform/copyio.c     standard
+platform/vkernel/platform/pmap.c       standard
+platform/vkernel/platform/pmap_inval.c standard
+platform/vkernel/platform/busdma_machdep.c standard
+platform/vkernel/platform/sysarch.c    standard
+platform/vkernel/platform/systimer.c   standard
+platform/vkernel/platform/console.c    standard
+platform/vkernel/platform/ipl_funcs.c  standard
index 958dd58..61774ac 100644 (file)
@@ -39,7 +39,7 @@
  *     from: @(#)vm_machdep.c  7.3 (Berkeley) 5/13/91
  *     Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
  * $FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.132.2.9 2003/01/25 19:02:23 dillon Exp $
- * $DragonFly: src/sys/platform/vkernel/i386/vm_machdep.c,v 1.5 2007/01/12 03:05:49 dillon Exp $
+ * $DragonFly: src/sys/platform/vkernel/i386/vm_machdep.c,v 1.6 2007/01/19 07:23:42 dillon Exp $
  */
 
 #include "use_npx.h"
@@ -83,7 +83,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-char machine[] = MACHINE_CPU;
+char machine[] = MACHINE;
 SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
              machine, 0, "Machine class");
 
diff --git a/sys/platform/vkernel/include/param.h b/sys/platform/vkernel/include/param.h
new file mode 100644 (file)
index 0000000..f063c40
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * $DragonFly: src/sys/platform/vkernel/include/param.h,v 1.1 2007/01/19 07:23:43 dillon Exp $
+ */
+
+#ifndef _MACHINE_PARAM_H_
+
+#ifndef _NO_NAMESPACE_POLLUTION
+#define _MACHINE_PARAM_H_
+#endif
+
+#ifndef _MACHINE_PLATFORM
+#define _MACHINE_PLATFORM      vkernel
+#endif
+
+#ifndef _NO_NAMESPACE_POLLUTION
+
+#ifndef MACHINE_PLATFORM
+#define MACHINE_PLATFORM       "vkernel"
+#endif
+
+#endif
+
+#include <cpu/param.h>
+
+#endif
+
index 630fbba..76764e6 100644 (file)
@@ -35,7 +35,7 @@
  *
  *     @(#)sysctl.h    8.1 (Berkeley) 6/2/93
  * $FreeBSD: src/sys/sys/sysctl.h,v 1.81.2.10 2003/05/01 22:48:09 trhodes Exp $
- * $DragonFly: src/sys/sys/sysctl.h,v 1.20 2006/12/26 11:27:44 sephe Exp $
+ * $DragonFly: src/sys/sys/sysctl.h,v 1.21 2007/01/19 07:23:43 dillon Exp $
  */
 
 #ifndef _SYS_SYSCTL_H_
@@ -458,9 +458,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
 #define        HW_DISKSTATS     9              /* struct: diskstats[] */
 #define HW_FLOATINGPT  10              /* int: has HW floating point? */
 #define HW_MACHINE_ARCH        11              /* string: machine architecture */
-#define HW_MACHINE_CPU 12              /* string: cpu architecture */
-#define HW_MACHINE_UNAME 13            /* string: machine class
-                                        *         (for uname only) */
+#define HW_MACHINE_PLATFORM 12         /* string: platform architecture */
+#define HW_MACHINE_RES13 13            /* no longer used (was machine_uname) */
 #define        HW_MAXID        14              /* number of valid hw ids */
 
 #define CTL_HW_NAMES { \
index 2c2756e..5294f03 100644 (file)
@@ -38,7 +38,7 @@
  * @(#) Copyright (c) 1988, 1989, 1990, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)main.c  8.3 (Berkeley) 3/19/94
  * $FreeBSD: src/usr.bin/make/main.c,v 1.118 2005/02/13 13:33:56 harti Exp $
- * $DragonFly: src/usr.bin/make/main.c,v 1.145 2006/11/07 06:57:02 dillon Exp $
+ * $DragonFly: src/usr.bin/make/main.c,v 1.146 2007/01/19 07:23:43 dillon Exp $
  */
 
 /*
@@ -766,9 +766,9 @@ FindObjDir(const char machine[], char curdir[], char objdir[])
 static void
 InitVariables(const char progname[])
 {
-       const char      *machine;
+       const char      *machine_platform;
        const char      *machine_arch;
-       const char      *machine_cpu;
+       const char      *machine;
        char buf[256];
        size_t bufsiz;
 
@@ -783,26 +783,34 @@ InitVariables(const char progname[])
 #endif
 
        /*
-        * The make program defines MACHINE and MACHINE_ARCH.  These
-        * parameters are taken from the running system but can be
+        * The make program defines MACHINE_PLATFORM, MACHINE and MACHINE_ARCH.
+        * These parameters are taken from the running system but can be
         * overridden by environment variables.
         *
-        * MACHINE      - This is the platform, e.g. "vkernel", "i386", "sun",
+        * MACHINE_PLATFORM     
+        *              - This is the platform, e.g. "vkernel", "pc32", 
         *                and so forth.
         *
+        * MACHINE      - This is the machine architecture and in most
+        *                cases is the same as the cpu architecture.
+        *
         * MACHINE_ARCH - This is the cpu architecture, for example "i386".
         *                Several different platforms may use the same
         *                cpu architecture.
         *
-        * MACHINE_CPU  - This is the minimum supported cpu revision based on
-        *                the target cpu architecture.  e.g. "i486", "i586",
-        *                etc.  NOTE: This field will often be "i386" even 
-        *                for kernels built without I386_CPU.
+        * In most, but not all cases, MACHINE == MACHINE_ARCH.
         *
-        * In some, but not all cases, MACHINE == MACHINE_ARCH.  A virtual
-        * kernel build, for example, would set MACHINE to "vkernel" and
-        * MACHINE_ARCH to the cpu architecture.
+        * PLATFORM distinguishes differences between, say, a virtual kernel
+        * build and a real kernel build.
         */
+       if ((machine_platform = getenv("MACHINE_PLATFORM")) == NULL) {
+               bufsiz = sizeof(buf);
+               if (sysctlbyname("hw.platform", buf, &bufsiz, NULL, 0) < 0)
+                       machine_platform = "unknown";
+               else
+                       machine_platform = strdup(buf);
+       }
+
        if ((machine = getenv("MACHINE")) == NULL) {
                bufsiz = sizeof(buf);
                if (sysctlbyname("hw.machine", buf, &bufsiz, NULL, 0) < 0)
@@ -819,21 +827,9 @@ InitVariables(const char progname[])
                        machine_arch = strdup(buf);
        }
 
-       /*
-        * Only newer kernels have machine_cpu.  If not otherwise known set
-        * the minimum supported cpu architecture to the machine architecture.
-        */
-       if ((machine_cpu = getenv("MACHINE_CPU")) == NULL) {
-               bufsiz = sizeof(buf);
-               if (sysctlbyname("hw.machine_cpu", buf, &bufsiz, NULL, 0) < 0)
-                       machine_cpu = machine_arch;
-               else
-                       machine_cpu = strdup(buf);
-       }
-
+       Var_SetGlobal("MACHINE_PLATFORM", machine_platform);
        Var_SetGlobal("MACHINE", machine);
        Var_SetGlobal("MACHINE_ARCH", machine_arch);
-       Var_SetGlobal("MACHINE_CPU", machine_cpu);
 }
 
 /**
index a8abfcc..b744096 100644 (file)
@@ -31,7 +31,7 @@
 .\"
 .\"    from: @(#)make.1        8.4 (Berkeley) 3/19/94
 .\" $FreeBSD: src/usr.bin/make/make.1,v 1.29.2.15 2002/12/17 19:01:18 seanc Exp $
-.\" $DragonFly: src/usr.bin/make/make.1,v 1.28 2005/08/03 17:33:30 okumoto Exp $
+.\" $DragonFly: src/usr.bin/make/make.1,v 1.29 2007/01/19 07:23:43 dillon Exp $
 .\"
 .Dd March 30, 2005
 .Dt MAKE 1
@@ -651,6 +651,14 @@ special target.
 See
 .Ic .LIBS
 special target.
+.It Va MACHINE_PLATFORM
+Name of the platform architecture
+.Nm
+is running on, obtained from the
+.Ev MACHINE_PLATFORM
+environment variable, or through
+.Xr uname 3
+if not defined.
 .It Va MACHINE
 Name of the machine architecture
 .Nm
index d676f47..12fd31c 100644 (file)
@@ -34,7 +34,7 @@
  * @(#) Copyright (c) 1993 The Regents of the University of California.  All rights reserved.
  * @(#)uname.c 8.2 (Berkeley) 5/4/95
  * $FreeBSD: src/usr.bin/uname/uname.c,v 1.4.6.2 2002/10/17 07:47:29 jmallett Exp $
- * $DragonFly: src/usr.bin/uname/uname.c,v 1.5 2007/01/04 14:19:03 y0netan1 Exp $
+ * $DragonFly: src/usr.bin/uname/uname.c,v 1.6 2007/01/19 07:23:43 dillon Exp $
  */
 
 #include <sys/param.h>
 #include <stdlib.h>
 #include <unistd.h>
 
-#ifndef HW_MACHINE_UNAME
-#define HW_MACHINE_UNAME       HW_MACHINE
-#endif
-
 #define        MFLAG   0x01
 #define        NFLAG   0x02
 #define        PFLAG   0x04
 #define        IFLAG   0x40
 
 typedef void (*get_t)(void);
-get_t get_ident, get_platform, get_hostname, get_arch, get_release, get_sysname, get_version;
+get_t get_ident, get_machine, get_hostname, get_arch, get_release, get_sysname, get_version;
   
 void native_ident(void);
-void native_platform(void);
+void native_machine(void);
 void native_hostname(void);
 void native_arch(void);
 void native_release(void);
@@ -71,7 +67,7 @@ void print_uname(u_int);
 void setup_get(void);
 void usage(void);
 
-char *ident, *platform, *hostname, *arch, *release, *sysname, *version;
+char *ident, *machine, *hostname, *arch, *release, *sysname, *version;
 int space;
 
 int
@@ -143,7 +139,7 @@ setup_get(void)
        CHECK_ENV("n", hostname);
        CHECK_ENV("r", release);
        CHECK_ENV("v", version);
-       CHECK_ENV("m", platform);
+       CHECK_ENV("m", machine);
        CHECK_ENV("p", arch);
        CHECK_ENV("i", ident);
 }
@@ -166,7 +162,7 @@ print_uname(u_int flags)
        PRINT_FLAG(flags, NFLAG, hostname);
        PRINT_FLAG(flags, RFLAG, release);
        PRINT_FLAG(flags, VFLAG, version);
-       PRINT_FLAG(flags, MFLAG, platform);
+       PRINT_FLAG(flags, MFLAG, machine);
        PRINT_FLAG(flags, PFLAG, arch);
        PRINT_FLAG(flags, IFLAG, ident);
        printf("\n");
@@ -227,7 +223,7 @@ NATIVE_SYSCTL2_GET(version, CTL_KERN, KERN_VERSION) {
                        *p = ' ';
 } NATIVE_SET;
 
-NATIVE_SYSCTL2_GET(platform, CTL_HW, HW_MACHINE_UNAME) {
+NATIVE_SYSCTL2_GET(machine, CTL_HW, HW_MACHINE) {
 } NATIVE_SET;
 
 NATIVE_SYSCTL2_GET(arch, CTL_HW, HW_MACHINE_ARCH) {
index c49b4a5..3ef945d 100644 (file)
@@ -1,8 +1,8 @@
 #      From: @(#)Makefile      5.20 (Berkeley) 6/12/93
 # $FreeBSD: src/usr.sbin/Makefile,v 1.183.2.14 2003/04/16 11:01:51 ru Exp $
-# $DragonFly: src/usr.sbin/Makefile,v 1.32 2006/11/11 20:01:29 dillon Exp $
+# $DragonFly: src/usr.sbin/Makefile,v 1.33 2007/01/19 07:23:43 dillon Exp $
 
-.include "../sys/machine/${MACHINE}/Makefile.inc"
+.include "../sys/platform/${MACHINE_PLATFORM}/Makefile.inc"
 
 # XXX MISSING:         mkproto
 SUBDIR= 802_11 \
index 0c6a63c..ffbe526 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)config.h    8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.sbin/config/config.h,v 1.35.2.1 2000/08/03 00:09:56 peter Exp $
- * $DragonFly: src/usr.sbin/config/config.h,v 1.8 2006/11/07 06:57:02 dillon Exp $
+ * $DragonFly: src/usr.sbin/config/config.h,v 1.9 2007/01/19 07:23:43 dillon Exp $
  */
 
 /*
@@ -108,8 +108,9 @@ struct config {
  * it will build from ``Makefile.i386'' and use ``../i386/inline''
  * in the makerules, etc.
  */
-char   *machinename;           /* machine/ headers and machine_base/ sources */
-char   *machinearchname;       /* cpu/ headers and cpu_base/ sources */
+char   *platformname;          /* MACHINE_PLATFORM  - (machine/ headers) */
+char   *machinename;           /* MACHINE      - third party programs */
+char   *machinearchname;       /* MACHINE_ARCH - (cpu/ headers) */
 
 /*
  * For each machine, a set of CPU's may be specified as supported.
index 577a7b9..8f86d25 100644 (file)
@@ -11,6 +11,7 @@
 %token CONFIG
 %token CONFIG_MACHINE
 %token CONFIG_MACHINE_ARCH
+%token CONFIG_PLATFORM
 %token CONFLICTS
 %token CONTROLLER
 %token CPU
@@ -84,7 +85,7 @@
  *
  *     @(#)config.y    8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.sbin/config/config.y,v 1.42.2.1 2001/01/23 00:09:32 peter Exp $
- * $DragonFly: src/usr.sbin/config/config.y,v 1.13 2006/11/07 06:57:02 dillon Exp $
+ * $DragonFly: src/usr.sbin/config/config.y,v 1.14 2007/01/19 07:23:43 dillon Exp $
  */
 
 #include <ctype.h>
@@ -131,6 +132,14 @@ Spec:
                ;
 
 Config_spec:
+       CONFIG_PLATFORM Save_id
+           = {
+               if (platformname != NULL) {
+                   errx(1, "%d: only one platform directive is allowed",
+                       yyline);
+               }
+               platformname = $2;
+             } |
        CONFIG_MACHINE Save_id
            = {
                if (machinename != NULL) {
index d1fb456..8ac1b86 100644 (file)
@@ -7,6 +7,6 @@
  * and <osreldate.h> system.
  *
  * $FreeBSD: src/usr.sbin/config/configvers.h,v 1.19.2.1 2001/12/19 18:09:32 silby Exp $
- * $DragonFly: src/usr.sbin/config/configvers.h,v 1.8 2006/11/07 06:57:02 dillon Exp $
+ * $DragonFly: src/usr.sbin/config/configvers.h,v 1.9 2007/01/19 07:23:43 dillon Exp $
  */
-#define        CONFIGVERS      400025
+#define        CONFIGVERS      400026
index ce9f5f8..8d0e9b9 100644 (file)
@@ -33,7 +33,7 @@
  *
  *     @(#)lang.l      8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.sbin/config/lang.l,v 1.27 1999/11/09 07:20:22 peter Exp $
- * $DragonFly: src/usr.sbin/config/lang.l,v 1.12 2006/11/07 06:57:02 dillon Exp $
+ * $DragonFly: src/usr.sbin/config/lang.l,v 1.13 2007/01/19 07:23:43 dillon Exp $
  */
 
 #include <ctype.h>
@@ -74,6 +74,7 @@ struct kt {
        { "nexus",      NEXUS },
        { "option",     OPTIONS },
        { "options",    OPTIONS },
+       { "platform",   CONFIG_PLATFORM },
        { "port",       PORT },
        { "pseudo-device",PSEUDO_DEVICE },
        { "tape",       TAPE },
index 8796e1c..5e67922 100644 (file)
@@ -33,7 +33,7 @@
  * @(#) Copyright (c) 1980, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)main.c  8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.sbin/config/main.c,v 1.37.2.3 2001/06/13 00:25:53 cg Exp $
- * $DragonFly: src/usr.sbin/config/main.c,v 1.20 2006/11/19 07:49:34 sephe Exp $
+ * $DragonFly: src/usr.sbin/config/main.c,v 1.21 2007/01/19 07:23:43 dillon Exp $
  */
 
 #include <sys/types.h>
@@ -157,8 +157,12 @@ main(int argc, char *argv[])
        dtab = NULL;
        if (yyparse())
                exit(3);
+       if (platformname == NULL) {
+               printf("Specify platform architecture, e.g. 'platform pc32'\n");
+               exit(1);
+       }
        if (machinename == NULL) {
-               printf("Specify platform architecture, e.g. 'machine pc32'\n");
+               printf("Specify machine architecture, e.g. 'machine i386'\n");
                exit(1);
        }
        if (machinearchname == NULL) {
@@ -168,25 +172,25 @@ main(int argc, char *argv[])
        newbus_ioconf();
        
        /*
-        * "machine" points into machine/<MACHINE>/include
+        * "machine" points into platform/<PLATFORM>/include
         */
        if (*srcdir == '\0')
-               snprintf(linkdest, sizeof(linkdest), "../../machine/%s/include",
-                   machinename);
+               snprintf(linkdest, sizeof(linkdest), "../../platform/%s/include",
+                   platformname);
        else
-               snprintf(linkdest, sizeof(linkdest), "%s/machine/%s/include",
-                   srcdir, machinename);
+               snprintf(linkdest, sizeof(linkdest), "%s/platform/%s/include",
+                   srcdir, platformname);
        symlink(linkdest, path("machine"));
 
        /*
-        * "machine_base" points into machine/<MACHINE>
+        * "machine_base" points into platform/<PLATFORM>
         */
        if (*srcdir == '\0')
-               snprintf(linkdest, sizeof(linkdest), "../../machine/%s",
-                   machinename);
+               snprintf(linkdest, sizeof(linkdest), "../../platform/%s",
+                   platformname);
        else
-               snprintf(linkdest, sizeof(linkdest), "%s/machine/%s",
-                   srcdir, machinename);
+               snprintf(linkdest, sizeof(linkdest), "%s/platform/%s",
+                   srcdir, platformname);
        symlink(linkdest, path("machine_base"));
 
        /*
index fb58706..3d8f53b 100644 (file)
@@ -32,7 +32,7 @@
  *
  * @(#)mkmakefile.c    8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.sbin/config/mkmakefile.c,v 1.51.2.3 2001/01/23 00:09:32 peter Exp $
- * $DragonFly: src/usr.sbin/config/mkmakefile.c,v 1.17 2006/11/07 06:57:02 dillon Exp $
+ * $DragonFly: src/usr.sbin/config/mkmakefile.c,v 1.18 2007/01/19 07:23:43 dillon Exp $
  */
 
 /*
@@ -144,11 +144,11 @@ makefile(void)
        int versreq;
 
        read_files();
-       snprintf(line, sizeof(line), "../machine/%s/conf/Makefile",
-                machinename);
+       snprintf(line, sizeof(line), "../platform/%s/conf/Makefile",
+                platformname);
        ifp = fopen(line, "r");
        if (ifp == NULL) {
-               snprintf(line, sizeof(line), "Makefile.%s", machinename);
+               snprintf(line, sizeof(line), "Makefile.%s", platformname);
                ifp = fopen(line, "r");
        }
        if (ifp == NULL)
@@ -157,8 +157,10 @@ makefile(void)
        if (ofp == NULL)
                err(1, "%s", path("Makefile.new"));
        fprintf(ofp, "KERN_IDENT=%s\n", raisestr(ident));
+       fprintf(ofp, "MACHINE_PLATFORM=%s\n", platformname);
        fprintf(ofp, "MACHINE=%s\n", machinename);
        fprintf(ofp, "MACHINE_ARCH=%s\n", machinearchname);
+       fprintf(ofp, ".makeenv MACHINE_PLATFORM\n");
        fprintf(ofp, ".makeenv MACHINE\n");
        fprintf(ofp, ".makeenv MACHINE_ARCH\n");
        fprintf(ofp, "IDENT=");
@@ -267,13 +269,13 @@ next:
                if (first == 1) {
                        first++;
                        snprintf(fname, sizeof(fname),
-                           "../machine/%s/conf/files",
-                           machinename);
+                           "../platform/%s/conf/files",
+                           platformname);
                        fp = fopen(fname, "r");
                        if (fp != NULL)
                                goto next;
                        snprintf(fname, sizeof(fname),
-                           "files.%s", machinename);
+                           "files.%s", platformname);
                        goto openit;
                }
                if (first == 2) {
index ac894df..43da860 100644 (file)
@@ -33,7 +33,7 @@
  *
  * @(#)mkheaders.c     8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.sbin/config/mkoptions.c,v 1.17.2.3 2001/12/13 19:18:01 dillon Exp $
- * $DragonFly: src/usr.sbin/config/mkoptions.c,v 1.18 2006/11/07 06:57:02 dillon Exp $
+ * $DragonFly: src/usr.sbin/config/mkoptions.c,v 1.19 2007/01/19 07:23:43 dillon Exp $
  */
 
 /*
@@ -303,13 +303,13 @@ next:
                if (first == 1) {
                        first++;
                        snprintf(fname, sizeof(fname),
-                                "../machine/%s/conf/options", 
-                                machinename);
+                                "../platform/%s/conf/options", 
+                                platformname);
                        fp = fopen(fname, "r");
                        if (fp != NULL)
                                goto next;
                        snprintf(fname, sizeof(fname), "options.%s",
-                                machinename);
+                                platformname);
                        goto openit;
                }
                if (first == 2) {