Some merging with NetBSD port.
--- /dev/null
+GENERIC
+NFS
+TST
+DDB
--- /dev/null
+$NetBSD: .keep_me,v 1.2 1994/10/26 02:32:30 cgd Exp $
+
+This normally empty directory needs to be kept in the distribution.
--- /dev/null
+#
+# First try for PPC GENERIC config file
+#
+
+machine powerpc
+
+maxusers 32
+
+# Standard system options (should go into std.powerpc?)
+options SWAPPAGER, VNODEPAGER, DEVPAGER
+options MACHINE_NONCONTIG
+options EXEC_ELF
+options EXEC_SCRIPT
+
+# various hacks due to bugs in Openfirmware implementation
+options FIREPOWERBUGS
+
+#options IPKDBUSERHACK
+#makeoptions DEBUG="-g"
+
+options DDB
+options KTRACE
+options SYSCALL_DEBUG
+options TCP_COMPAT_42
+options COMPAT_43
+options COMPAT_09
+options COMPAT_10
+options COMPAT_12
+
+options FFS
+options MFS
+
+options NFSCLIENT
+options NFSSERVER
+
+options CD9660
+options MSDOSFS
+options FDESC
+options FIFO
+options KERNFS
+options NULLFS
+options PORTAL
+options PROCFS
+options UMAPFS
+options UNION
+
+options INET
+options NMBCLUSTERS=1024
+
+options MAXUSERS=20
+#options TARGET_ELF
+
+config netbsd swap generic
+
+ofroot* at root
+
+ofbus* at openfirm?
+
+ofdisk* at openfirm?
+
+ofnet* at openfirm?
+#ipkdbif0 at ofnet?
+
+ofcons* at openfirm?
+
+ofrtc* at openfirm?
+
+pseudo-device loop
+pseudo-device pty 64
+pseudo-device random 1
file arch/powerpc/powerpc/vm_machdep.c
file dev/cons.c
file dev/cninit.c
-file arch/ppc/ppc/setjmp.S ddb
-file arch/ppc/ppc/db_memrw.c ddb
-file arch/ppc/ppc/db_disasm.c ddb
-file arch/ppc/ppc/db_interface.c ddb
-file arch/ppc/ppc/db_trace.c ddb
+file arch/powerpc/powerpc/setjmp.S ddb
+file arch/powerpc/powerpc/db_memrw.c ddb
+file arch/powerpc/powerpc/db_disasm.c ddb
+file arch/powerpc/powerpc/db_interface.c ddb
+file arch/powerpc/powerpc/db_trace.c ddb
# FirePower specific code
#device firepower: openfirm
-/* $NetBSD: ansi.h,v 1.1 1996/09/30 16:34:19 ws Exp $ */
+/* $NetBSD: ansi.h,v 1.2 1996/11/15 22:38:57 jtc Exp $ */
/*-
* Copyright (c) 1990, 1993
#define _BSD_TIME_T_ long /* time() */
struct __gnuc_va_list__;
#define _BSD_VA_LIST_ struct __gnuc_va_list__ * /* va_list */
+#define _BSD_CLOCKID_T_ int
+#define _BSD_TIMER_T_ int
/*
* Runes (wchar_t) is declared to be an ``int'' instead of the more natural
+/* $OpenBSD: asm.h,v 1.2 1996/12/28 06:09:16 rahnds Exp $ */
/* $NetBSD: asm.h,v 1.1 1996/09/30 16:34:20 ws Exp $ */
/*
--- /dev/null
+/* $OpenBSD: db_machdep.h,v 1.1 1996/12/28 06:09:17 rahnds Exp $ */
+/* $NetBSD: db_machdep.h,v 1.13 1996/04/29 20:50:08 leo Exp $ */
+
+/*
+ * Mach Operating System
+ * Copyright (c) 1992 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+
+/*
+ * Machine-dependent defines for new kernel debugger.
+ */
+#ifndef _PPC_DB_MACHDEP_H_
+#define _PPC_DB_MACHDEP_H_
+
+#include <vm/vm_prot.h>
+#include <vm/vm_param.h>
+#include <vm/vm_inherit.h>
+#include <vm/lock.h>
+#include <machine/trap.h>
+
+typedef vm_offset_t db_addr_t; /* address - unsigned */
+typedef int db_expr_t; /* expression - signed */
+struct powerpc_saved_state {
+ u_int32_t r0; /* data registers */
+ u_int32_t r1;
+ u_int32_t r2;
+ u_int32_t r3;
+ u_int32_t r4;
+ u_int32_t r5;
+ u_int32_t r6;
+ u_int32_t r7;
+ u_int32_t r8;
+ u_int32_t r9;
+ u_int32_t r10;
+ u_int32_t r11;
+ u_int32_t r12;
+ u_int32_t r13;
+ u_int32_t r14;
+ u_int32_t r15;
+ u_int32_t r16;
+ u_int32_t r17;
+ u_int32_t r18;
+ u_int32_t r19;
+ u_int32_t r20;
+ u_int32_t r21;
+ u_int32_t r22;
+ u_int32_t r23;
+ u_int32_t r24;
+ u_int32_t r25;
+ u_int32_t r26;
+ u_int32_t r27;
+ u_int32_t r28;
+ u_int32_t r29;
+ u_int32_t r30;
+ u_int32_t r31;
+ u_int32_t r32;
+ u_int32_t iar;
+ u_int32_t msr;
+};
+typedef struct powerpc_saved_state db_regs_t;
+db_regs_t ddb_regs; /* register state */
+#define DDB_REGS (&ddb_regs)
+
+#define PC_REGS(regs) ((db_addr_t)(regs)->iar)
+
+#define BKPT_INST 0x7C810808 /* breakpoint instruction */
+
+#define BKPT_SIZE (4) /* size of breakpoint inst */
+#define BKPT_SET(inst) (BKPT_INST)
+
+#define FIXUP_PC_AFTER_BREAK ddb_regs.iar -= 4;
+
+#define SR_SINGLESTEP 0x8000
+#define db_clear_single_step(regs) ((regs)->msr &= ~SR_SINGLESTEP)
+#define db_set_single_step(regs) ((regs)->msr |= SR_SINGLESTEP)
+
+#define T_BREAKPOINT 0xffff
+#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAKPOINT)
+
+#ifdef T_WATCHPOINT
+#define IS_WATCHPOINT_TRAP(type, code) ((type) == T_WATCHPOINT)
+#else
+#define IS_WATCHPOINT_TRAP(type, code) 0
+#endif
+
+#define M_RTS 0xfc0007fe
+#define I_RTS 0x4c000020
+#define M_BC 0xfc000000
+#define I_BC 0x40000000
+#define M_B 0xfc000000
+#define I_B 0x50000000
+#define M_RFI 0xfc0007fe
+#define I_RFI 0x4c000064
+
+#define inst_trap_return(ins) (((ins)&M_RFI) == I_RFI)
+#define inst_return(ins) (((ins)&M_RTS) == I_RTS)
+#define inst_call(ins) (((ins)&M_BC ) == I_BC || \
+ ((ins)&M_B ) == I_B )
+#define inst_load(ins) 0
+#define inst_store(ins) 0
+
+#ifdef _KERNEL
+
+void kdb_kintr __P((void *));
+int kdb_trap __P((int, void *));
+
+#endif /* _KERNEL */
+
+#endif /* _PPC_DB_MACHDEP_H_ */
#include <sys/cdefs.h>
__BEGIN_DECLS
-unsigned long htonl __P((unsigned long));
-unsigned short htons __P((unsigned short));
-unsigned long ntohl __P((unsigned long));
-unsigned short ntohs __P((unsigned short));
+u_int32_t htonl __P((u_int32_t));
+u_int16_t htons __P((u_int16_t));
+u_int32_t ntohl __P((u_int32_t));
+u_int16_t ntohs __P((u_int16_t));
__END_DECLS
/*
--- /dev/null
+/* $OpenBSD: ptrace.h,v 1.1 1996/12/28 06:09:22 rahnds Exp $ */
+/* $NetBSD: ptrace.h,v 1.7 1995/01/26 19:47:10 mycroft Exp $ */
+
+/*
+ * Copyright (c) 1993 Christopher G. Demetriou
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Christopher G. Demetriou.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
+ */
+#ifndef _POWERPC_PTRACE_H_
+#define _POWERPC_PTRACE_H_
+
+/*
+ * powerpc-dependent ptrace definitions
+ */
+#define PT_STEP (PT_FIRSTMACH + 0)
+#if NOT_SUPPORTED
+#define PT_GETREGS (PT_FIRSTMACH + 1)
+#define PT_SETREGS (PT_FIRSTMACH + 2)
+
+#define PT_GETFPREGS (PT_FIRSTMACH + 3)
+#define PT_SETFPREGS (PT_FIRSTMACH + 4)
+#endif
+
+#endif /* !_POWERPC_PTRACE_H_ */
typedef unsigned long vm_size_t;
typedef unsigned long vm_offset_t;
-/* This is only to make some unneeded function declaration happy */
-#define label_t void
+typedef struct label_t {
+ int val[40]; /* double check this XXX */
+} label_t;
#endif /* _MACHTYPES_H_ */
-/* $NetBSD: Locore.c,v 1.1 1996/09/30 16:34:39 ws Exp $ */
+/* $NetBSD: Locore.c,v 1.2 1996/11/06 20:19:50 cgd Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
* Calls should be made at splstatclock().
*/
void
-remrq(p)
+remrunqueue(p)
struct proc *p;
{
int which = p->p_priority >> 2;
#ifdef DIAGNOSTIC
if (!(whichqs & (0x80000000 >> which)))
- panic("remrq");
+ panic("remrunqueue");
#endif
p->p_forw->p_back = p->p_back;
p->p_back->p_forw = p->p_forw;
}
map = kernel_map;
}
+printf("kern dsi on addr %x iar %x\n", frame->dar, frame->srr0);
goto brain_damage;
case EXC_DSI|EXC_USER:
{
== KERN_SUCCESS)
break;
}
-printf("dsi on addr %x iar %x\n", frame->dsisr, frame->srr0);
+printf("dsi on addr %x iar %x\n", frame->dar, frame->srr0);
trapsignal(p, SIGSEGV, EXC_DSI);
break;
case EXC_ISI|EXC_USER:
int
copyin(udaddr, kaddr, len)
- void *udaddr;
+ const void *udaddr;
void *kaddr;
size_t len;
{
int
copyout(kaddr, udaddr, len)
- void *kaddr;
+ const void *kaddr;
void *udaddr;
size_t len;
{
+/* $OpenBSD: ofdev.h,v 1.2 1996/12/28 06:09:32 rahnds Exp $ */
/* $NetBSD: ofdev.h,v 1.1 1996/09/30 16:35:04 ws Exp $ */
/*
#define OFDEV_NET 1
#define OFDEV_DISK 2
-#define DEFAULT_KERNEL "/netbsd"
+#define DEFAULT_KERNEL "/bsd"
extern char opened_name[];
extern int floppyboot;