Regenerate this file from cvs repository in order to get back original
copyright.
This commit is contained in:
parent
4db02d75fa
commit
eb4f61df19
|
@ -1,12 +1,10 @@
|
||||||
/* $NetBSD: powerpc_machdep.c,v 1.3 2001/04/03 13:10:26 jdolecek Exp $ */
|
/* $NetBSD: powerpc_machdep.c,v 1.4 2001/04/05 09:58:05 tsubai Exp $ */
|
||||||
|
|
||||||
/*-
|
/*
|
||||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||||
|
* Copyright (C) 1995, 1996 TooLs GmbH.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This code is derived from software contributed to The NetBSD Foundation
|
|
||||||
* by Matt Thomas <matt@3am-software.com>.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
|
@ -17,47 +15,37 @@
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the NetBSD
|
* This product includes software developed by TooLs GmbH.
|
||||||
* Foundation, Inc. and its contributors.
|
* 4. The name of TooLs GmbH may not be used to endorse or promote products
|
||||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
* derived from this software without specific prior written permission.
|
||||||
* contributors may be used to endorse or promote products derived
|
|
||||||
* from this software without specific prior written permission.
|
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
|
||||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
|
|
||||||
__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.3 2001/04/03 13:10:26 jdolecek Exp $");
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/conf.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 <sys/disklabel.h>
|
||||||
#include <uvm/uvm_extern.h>
|
#include <sys/exec.h>
|
||||||
|
#include <sys/sysctl.h>
|
||||||
#include <machine/frame.h>
|
#include <sys/user.h>
|
||||||
#include <machine/pcb.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set set up registers on exec.
|
* Set set up registers on exec.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
setregs(struct proc *p, struct exec_package *pack, u_long stack)
|
setregs(p, pack, stack)
|
||||||
|
struct proc *p;
|
||||||
|
struct exec_package *pack;
|
||||||
|
u_long stack;
|
||||||
{
|
{
|
||||||
struct trapframe *tf = trapframe(p);
|
struct trapframe *tf = trapframe(p);
|
||||||
struct ps_strings arginfo;
|
struct ps_strings arginfo;
|
||||||
|
@ -69,7 +57,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack)
|
||||||
* XXX Machine-independent code has already copied arguments and
|
* XXX Machine-independent code has already copied arguments and
|
||||||
* XXX environment to userland. Get them back here.
|
* XXX environment to userland. Get them back here.
|
||||||
*/
|
*/
|
||||||
(void)copyin((char *)PS_STRINGS, &arginfo, sizeof(arginfo));
|
(void)copyin((char *)PS_STRINGS, &arginfo, sizeof (arginfo));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up arguments for _start():
|
* Set up arguments for _start():
|
||||||
|
@ -122,25 +110,20 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Crash dump handling.
|
* Crash dump handling.
|
||||||
*/
|
*/
|
||||||
u_long dumpmag = 0x8fca0101; /* magic number */
|
u_long dumpmag = 0x8fca0101; /* magic number */
|
||||||
long dumplo = -1; /* blocks */
|
|
||||||
int dumpsize = 0; /* size of dump in pages */
|
int dumpsize = 0; /* size of dump in pages */
|
||||||
|
long dumplo = -1; /* blocks */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called by main to set dumplo and dumpsize.
|
* 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
|
void
|
||||||
cpu_dumpconf(void)
|
cpu_dumpconf()
|
||||||
{
|
{
|
||||||
int nblks; /* size of dump area */
|
int nblks; /* size of dump device */
|
||||||
int skip;
|
int skip;
|
||||||
int maj;
|
int maj;
|
||||||
|
|
||||||
|
@ -157,15 +140,14 @@ cpu_dumpconf(void)
|
||||||
|
|
||||||
dumpsize = physmem;
|
dumpsize = physmem;
|
||||||
|
|
||||||
/* Skip enough block at the start of disk to preserve an eventual disklabel */
|
/* Skip enough blocks at start of disk to preserve an eventual disklabel. */
|
||||||
skip = LABELSECTOR + ctod(1);
|
skip = LABELSECTOR + 1;
|
||||||
|
skip += ctod(1) - 1;
|
||||||
skip = ctod(dtoc(skip));
|
skip = ctod(dtoc(skip));
|
||||||
|
|
||||||
/* Always skip the first NBPG, in case there is a label there. */
|
|
||||||
if (dumplo < skip)
|
if (dumplo < skip)
|
||||||
dumplo = skip;
|
dumplo = skip;
|
||||||
|
|
||||||
/* Put dump at end of partition, and make it fit. */
|
/* Put dump at end of partition */
|
||||||
if (dumpsize > dtoc(nblks - dumplo))
|
if (dumpsize > dtoc(nblks - dumplo))
|
||||||
dumpsize = dtoc(nblks - dumplo);
|
dumpsize = dtoc(nblks - dumplo);
|
||||||
if (dumplo < nblks - ctod(dumpsize))
|
if (dumplo < nblks - ctod(dumpsize))
|
||||||
|
|
Loading…
Reference in New Issue