PERFORCE change 100815 for review

Bruce M Simpson bms at FreeBSD.org
Thu Jul 6 23:05:38 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=100815

Change 100815 by bms at bms_montagne on 2006/07/06 23:04:42

	Bring in stubs from old mips branch

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/machdep.c#2 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/machdep.c#2 (text+ko) ====

@@ -1,21 +1,21 @@
 /*-
- * Copyright (c) 2006 Fill this file and put your name here
+ * Copyright (c) 2002-2004 Juli Mallett <jmallett at FreeBSD.org>
  * 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,
- *    without modification, immediately at the beginning of the file.
- * 2. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
@@ -23,7 +23,217 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD$
+ */
+
+#include "opt_ddb.h"
+
+#include <sys/param.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+#include <sys/imgact.h>
+#include <sys/bio.h>
+#include <sys/buf.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/ucontext.h>
+#include <sys/proc.h>
+#include <sys/kdb.h>
+#include <sys/ptrace.h>
+#include <sys/reboot.h>
+#include <sys/user.h>
+
+#include <vm/vm.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
+#include <vm/vm_pager.h>
+
+#include <machine/cache.h>
+#include <machine/cpu.h>
+#include <machine/cpufunc.h>
+#include <machine/cpuinfo.h>
+#include <machine/cpuregs.h>
+#include <machine/hwfunc.h>
+#include <machine/locore.h>
+#include <machine/md_var.h>
+#include <machine/pte.h>
+#include <machine/tlb.h>
+
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif
+
+int cold = 1;
+int clocks_running;
+
+static struct pcpu pcpu0;
+struct pcpu *pcpup = &pcpu0;
+
+struct cpu_info cpu_info_store;
+
+struct kva_md_info kmi;
+
+vm_offset_t kstack0;
+
+void cpu_startup(void *);
+SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL);
+
+void
+mips_init(void)
+{
+	init_param2(physmem);
+	mips_cpu_init();
+	pmap_bootstrap();
+
+	proc_linkup(&proc0, &ksegrp0, &thread0);
+	thread0.td_kstack = kstack0;
+	pcpu_init(pcpup, 0, sizeof(struct pcpu));
+	pcpup->pc_curthread = &thread0;
+	cpu_thread_setup(curthread);
+	pcpup->pc_curpcb = curthread->td_pcb;
+	mutex_init();
+#ifdef DDB
+	kdb_init();
+#endif
+}
+
+void
+cpu_startup(void *dummy)
+{
+	cpu_identify();
+	platform_identify();
+	vm_ksubmap_init(&kmi);
+	bufinit();
+	vm_pager_bufferinit();
+}
+
+/* Get current clock frequency for the given cpu id. */
+int
+cpu_est_clockrate(int cpu_id, uint64_t *rate)
+{
+	return (ENXIO);
+}
+
+void
+cpu_halt(void)
+{
+	printf("Halting...\n");
+	platform_halt();
+}
+
+void
+cpu_idle(void)
+{
+	/* Insert code to halt (until next interrupt) for the idle loop */
+}
+
+void
+cpu_reset(void)
+{
+	printf("Resetting...\n");
+	platform_reset();
+}
+
+void
+dumpsys(struct dumperinfo *dip)
+{
+}
+
+/*
+ * Construct a PCB from a trapframe. This is called from kdb_trap() where
+ * we want to start a backtrace from the function that caused us to enter
+ * the debugger. We have the context in the trapframe, but base the trace
+ * on the PCB. The PCB doesn't have to be perfect, as long as it contains
+ * enough for a backtrace.
  */
+void
+makectx(struct trapframe *tf, struct pcb *pcb)
+{
+	pcb->pcb_regs[PCB_REG_SR] = tf->tf_regs[TF_SR];
+	pcb->pcb_regs[PCB_REG_RA] = tf->tf_regs[TF_RA];
+	pcb->pcb_regs[PCB_REG_SP] = tf->tf_regs[TF_SP];
+}
+
+
+int
+get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
+{
+	return (0);
+}
+
+int
+set_mcontext(struct thread *td, const mcontext_t *mcp)
+{
+	return (0);
+}
+
+int
+fill_regs(struct thread *td, struct reg *regs)
+{
+	return (0);
+}
+
+int
+fill_dbregs(struct thread *td, struct dbreg *dbregs)
+{
+	return (0);
+}
+
+int
+fill_fpregs(struct thread *td, struct fpreg *fpregs)
+{
+	return (0);
+}
 
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+int
+set_regs(struct thread *td, struct reg *regs)
+{
+	return (0);
+}
+
+int
+set_dbregs(struct thread *td, struct dbreg *dbregs)
+{
+	return (0);
+}
+
+int
+set_fpregs(struct thread *td, struct fpreg *fpregs)
+{
+	return (0);
+}
+
+int
+ptrace_set_pc(struct thread *td, u_long addr)
+{
+	return (0);
+}
+
+int
+ptrace_clear_single_step(struct thread *td)
+{
+	return (0);
+}
+
+int
+ptrace_single_step(struct thread *td)
+{
+	return (0);
+}
+
+void
+cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t sz)
+{
+}
+
+void
+exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
+{
+}
+
+intptr_t
+casuptr(intptr_t *p, intptr_t old, intptr_t new)
+{
+	return (-1);
+}


More information about the p4-projects mailing list