Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Move cpu_sysct and dump{mag, lo, siz} & cpu_dumpconf ...



details:   https://anonhg.NetBSD.org/src/rev/cd1f8505d308
branches:  trunk
changeset: 504205:cd1f8505d308
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Feb 24 22:39:16 2001 +0000

description:
Move cpu_sysct and dump{mag,lo,siz} & cpu_dumpconf to powerpc_machdep.c.
dumpsys is still port-specific for now.  XXX dumpsys is still a stub
on all powerpc ports.

diffstat:

 sys/arch/amigappc/amigappc/machdep.c       |  34 +------------
 sys/arch/bebox/bebox/machdep.c             |  70 +-------------------------
 sys/arch/macppc/macppc/disksubr.c          |  39 +--------------
 sys/arch/macppc/macppc/machdep.c           |  30 +----------
 sys/arch/ofppc/ofppc/machdep.c             |  30 +----------
 sys/arch/powerpc/powerpc/powerpc_machdep.c |  80 +++++++++++++++++++++++++++++-
 sys/arch/prep/prep/machdep.c               |  72 +--------------------------
 sys/arch/sandpoint/sandpoint/machdep.c     |  27 +---------
 8 files changed, 86 insertions(+), 296 deletions(-)

diffs (truncated from 508 to 300 lines):

diff -r c594dae62401 -r cd1f8505d308 sys/arch/amigappc/amigappc/machdep.c
--- a/sys/arch/amigappc/amigappc/machdep.c      Sat Feb 24 21:43:01 2001 +0000
+++ b/sys/arch/amigappc/amigappc/machdep.c      Sat Feb 24 22:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.8 2001/02/24 04:35:34 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.9 2001/02/24 22:39:19 matt Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -837,11 +837,6 @@
        bufinit();
 }
 
-void
-cpu_dumpconf()
-{
-}
-
 /*
  * consinit
  * Initialize system console.
@@ -857,33 +852,6 @@
 }
 
 /*
- * Machine dependent system variables
- */
-int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
-       int *name;
-       u_int namelen;
-       void *oldp;
-       size_t *oldlenp;
-       void *newp;
-       size_t newlen;
-       struct proc *p;
-{
-       /* all sysctl names at this level are terminal */
-       if (namelen != 1) {
-               return ENOTDIR;
-       }
-
-       switch (name[0]) {
-       case CPU_CACHELINE:
-               return sysctl_rdint(oldp, oldlenp, newp, CACHELINESIZE);
-       default:
-               return EOPNOTSUPP;
-       }
-}
-
-
-/*
  * Halt or reboot the machine after syncing/dumping according to howto
  */
 void
diff -r c594dae62401 -r cd1f8505d308 sys/arch/bebox/bebox/machdep.c
--- a/sys/arch/bebox/bebox/machdep.c    Sat Feb 24 21:43:01 2001 +0000
+++ b/sys/arch/bebox/bebox/machdep.c    Sat Feb 24 22:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.58 2001/02/24 04:35:33 matt Exp $        */
+/*     $NetBSD: machdep.c,v 1.59 2001/02/24 22:39:16 matt Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -670,74 +670,6 @@
 }
 #endif
 
-/*
- * Machine dependent system variables.
- */
-int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
-       int *name;
-       u_int namelen;
-       void *oldp;
-       size_t *oldlenp;
-       void *newp;
-       size_t newlen;
-       struct proc *p;
-{
-       /* all sysctl names at this level are terminal */
-       if (namelen != 1)
-               return (ENOTDIR);
-
-       switch (name[0]) {
-       case CPU_CACHELINE:
-               return sysctl_rdint(oldp, oldlenp, newp, CACHELINESIZE);
-       default:
-               return (EOPNOTSUPP);
-       }
-}
-
-/*
- * Crash dump handling.
- */
-u_long dumpmag = 0x8fca0101;           /* magic number */
-int dumpsize = 0;                      /* size of dump in pages */
-long dumplo = -1;                      /* blocks */
-
-/*
- * This is called by main to set dumplo and dumpsize.
- * Dumps always skip the first NBPG of disk space
- * in case there might be a disk label stored there.
- * If there is extra space, put dump at the end to
- * reduce the chance that swapping trashes it.
- */
-void
-cpu_dumpconf()
-{
-       int nblks;      /* size of dump area */
-       int maj;
-
-       if (dumpdev == NODEV)
-               return;
-       maj = major(dumpdev);
-       if (maj < 0 || maj >= nblkdev)
-               panic("dumpconf: bad dumpdev=0x%x", dumpdev);
-       if (bdevsw[maj].d_psize == NULL)
-               return;
-       nblks = (*bdevsw[maj].d_psize)(dumpdev);
-       if (nblks <= ctod(1))
-               return;
-
-       dumpsize = physmem;
-
-       /* Always skip the first NBPG, in case there is a label there. */
-       if (dumplo < ctod(1))
-               dumplo = ctod(1);
-
-       /* Put dump at end of partition, and make it fit. */
-       if (dumpsize > dtoc(nblks - dumplo))
-               dumpsize = dtoc(nblks - dumplo);
-       if (dumplo < nblks - ctod(dumpsize))
-               dumplo = nblks - ctod(dumpsize);
-}
 
 void
 dumpsys()
diff -r c594dae62401 -r cd1f8505d308 sys/arch/macppc/macppc/disksubr.c
--- a/sys/arch/macppc/macppc/disksubr.c Sat Feb 24 21:43:01 2001 +0000
+++ b/sys/arch/macppc/macppc/disksubr.c Sat Feb 24 22:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.11 2000/11/20 08:24:16 chs Exp $        */
+/*     $NetBSD: disksubr.c,v 1.12 2001/02/24 22:39:18 matt Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -666,40 +666,3 @@
 done:
        return 0;
 }
-
-/*
- * This is called by main to set dumplo and dumpsize.
- */
-void
-cpu_dumpconf()
-{
-       int nblks;              /* size of dump device */
-       int skip;
-       int maj;
-
-       if (dumpdev == NODEV)
-               return;
-       maj = major(dumpdev);
-       if (maj < 0 || maj >= nblkdev)
-               panic("dumpconf: bad dumpdev=0x%x", dumpdev);
-       if (bdevsw[maj].d_psize == NULL)
-               return;
-       nblks = (*bdevsw[maj].d_psize)(dumpdev);
-       if (nblks <= ctod(1))
-               return;
-
-       dumpsize = physmem;
-
-       /* Skip enough blocks at start of disk to preserve an eventual disklabel. */
-       skip = LABELSECTOR + 1;
-       skip += ctod(1) - 1;
-       skip = ctod(dtoc(skip));
-       if (dumplo < skip)
-               dumplo = skip;
-
-       /* Put dump at end of partition */
-       if (dumpsize > dtoc(nblks - dumplo))
-               dumpsize = dtoc(nblks - dumplo);
-       if (dumplo < nblks - ctod(dumpsize))
-               dumplo = nblks - ctod(dumpsize);
-}
diff -r c594dae62401 -r cd1f8505d308 sys/arch/macppc/macppc/machdep.c
--- a/sys/arch/macppc/macppc/machdep.c  Sat Feb 24 21:43:01 2001 +0000
+++ b/sys/arch/macppc/macppc/machdep.c  Sat Feb 24 22:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.89 2001/02/24 04:35:33 matt Exp $        */
+/*     $NetBSD: machdep.c,v 1.90 2001/02/24 22:39:18 matt Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -535,36 +535,8 @@
 }
 
 /*
- * Machine dependent system variables.
- */
-int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
-       int *name;
-       u_int namelen;
-       void *oldp;
-       size_t *oldlenp;
-       void *newp;
-       size_t newlen;
-       struct proc *p;
-{
-       /* all sysctl names at this level are terminal */
-       if (namelen != 1)
-               return ENOTDIR;
-
-       switch (name[0]) {
-       case CPU_CACHELINE:
-               return sysctl_rdint(oldp, oldlenp, newp, CACHELINESIZE);
-       default:
-               return EOPNOTSUPP;
-       }
-}
-
-/*
  * Crash dump handling.
  */
-u_long dumpmag = 0x8fca0101;           /* magic number */
-int dumpsize = 0;                      /* size of dump in pages */
-long dumplo = -1;                      /* blocks */
 
 void
 dumpsys()
diff -r c594dae62401 -r cd1f8505d308 sys/arch/ofppc/ofppc/machdep.c
--- a/sys/arch/ofppc/ofppc/machdep.c    Sat Feb 24 21:43:01 2001 +0000
+++ b/sys/arch/ofppc/ofppc/machdep.c    Sat Feb 24 22:39:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.61 2001/02/24 04:35:34 matt Exp $        */
+/*     $NetBSD: machdep.c,v 1.62 2001/02/24 22:39:19 matt Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -502,36 +502,8 @@
 }
 
 /*
- * Machine dependent system variables.
- */
-int
-cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
-       int *name;
-       u_int namelen;
-       void *oldp;
-       size_t *oldlenp;
-       void *newp;
-       size_t newlen;
-       struct proc *p;
-{
-       /* all sysctl names at this level are terminal */
-       if (namelen != 1)
-               return (ENOTDIR);
-
-       switch (name[0]) {
-       case CPU_CACHELINE:
-               return sysctl_rdint(oldp, oldlenp, newp, CACHELINESIZE);
-       default:
-               return (EOPNOTSUPP);
-       }
-}
-
-/*
  * Crash dump handling.
  */
-u_long dumpmag = 0x8fca0101;           /* magic number */
-int dumpsize = 0;                      /* size of dump in pages */
-long dumplo = -1;                      /* blocks */
 
 void
 dumpsys()
diff -r c594dae62401 -r cd1f8505d308 sys/arch/powerpc/powerpc/powerpc_machdep.c
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c        Sat Feb 24 21:43:01 2001 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c        Sat Feb 24 22:39:16 2001 +0000
@@ -36,13 +36,16 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.1 2001/02/24 04:29:26 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.2 2001/02/24 22:39:20 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
+#include <sys/conf.h>
 #include <sys/exec.h>
 #include <sys/proc.h>
 #include <sys/user.h>
+#include <sys/sysctl.h>
+#include <sys/disklabel.h>
 #include <uvm/uvm_extern.h>



Home | Main Index | Thread Index | Old Index