summaryrefslogtreecommitdiff
path: root/sys/arch/mips
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1998-09-15 10:50:14 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1998-09-15 10:50:14 +0000
commit8811594d2793d27a5f0997ba7f687030b6910809 (patch)
tree9212ba549b64f445b6a4fb66d2728c017826bfd9 /sys/arch/mips
parent7e8a980818320d7911c4411f049eb2532f4ea2bf (diff)
New mi code to add a real trapframe and remove the need for __FORK_BRAINDAMAGE.
Diffstat (limited to 'sys/arch/mips')
-rw-r--r--sys/arch/mips/include/archtype.h5
-rw-r--r--sys/arch/mips/include/cpu.h5
-rw-r--r--sys/arch/mips/include/db_machdep.h5
-rw-r--r--sys/arch/mips/include/frame.h77
-rw-r--r--sys/arch/mips/include/pcb.h12
-rw-r--r--sys/arch/mips/include/pio.h64
-rw-r--r--sys/arch/mips/include/proc.h4
-rw-r--r--sys/arch/mips/include/types.h4
-rw-r--r--sys/arch/mips/include/vmparam.h10
-rw-r--r--sys/arch/mips/mips/clock.c34
-rw-r--r--sys/arch/mips/mips/cpu.c23
-rw-r--r--sys/arch/mips/mips/cpu_ecoff.c6
-rw-r--r--sys/arch/mips/mips/db_machdep.c88
-rw-r--r--sys/arch/mips/mips/mainbus.c18
-rw-r--r--sys/arch/mips/mips/process_machdep.c14
-rw-r--r--sys/arch/mips/mips/vm_machdep.c69
16 files changed, 301 insertions, 137 deletions
diff --git a/sys/arch/mips/include/archtype.h b/sys/arch/mips/include/archtype.h
index be052dc4c5a..3d51c430ada 100644
--- a/sys/arch/mips/include/archtype.h
+++ b/sys/arch/mips/include/archtype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archtype.h,v 1.3 1998/06/06 06:33:31 mickey Exp $ */
+/* $OpenBSD: archtype.h,v 1.4 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
*
@@ -59,6 +59,9 @@
#define ALGOR_P4032 0x21 /* ALGORITHMICS P-4032 */
#define ALGOR_P5064 0x22 /* ALGORITHMICS P-5064 */
+#define GALILEO_CLASS 0x30 /* Galileo PCI based Class */
+#define GALILEO_G9 0x31 /* Galileo GT-64011 Eval board */
+
extern int system_type; /* Global system type indicator */
#endif /* _MACHINE_ARCHTYPE_H_ */
diff --git a/sys/arch/mips/include/cpu.h b/sys/arch/mips/include/cpu.h
index 385ea9f4451..6fe882f31de 100644
--- a/sys/arch/mips/include/cpu.h
+++ b/sys/arch/mips/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.3 1998/07/11 21:40:59 imp Exp $ */
+/* $OpenBSD: cpu.h,v 1.4 1998/09/15 10:50:12 pefo Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -281,7 +281,6 @@
#define COPY_SIGCODE /* copy sigcode above user stack in exec */
#define cpu_wait(p) /* nothing */
-#define cpu_set_init_frame(p, fp) /* nothing */
#define cpu_swapout(p) panic("cpu_swapout: can't get here");
#ifndef _LOCORE
@@ -422,7 +421,9 @@ void R4K_SetCOMPARE __P((u_int));
void R4K_FlushCache __P((void));
void R4K_FlushDCache __P((vm_offset_t, int));
void R4K_HitFlushDCache __P((vm_offset_t, int));
+void R4K_InvalidateDCache __P((vm_offset_t, int));
void R4K_FlushICache __P((vm_offset_t, int));
+void R4K_InvalidateICache __P((vm_offset_t, int));
void R4K_TLBFlush __P((int));
void R4K_TLBFlushAddr __P((vm_offset_t));
void R4K_TLBWriteIndexed __P((int, struct tlb *));
diff --git a/sys/arch/mips/include/db_machdep.h b/sys/arch/mips/include/db_machdep.h
index 3f01969b422..e705f625596 100644
--- a/sys/arch/mips/include/db_machdep.h
+++ b/sys/arch/mips/include/db_machdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.h,v 1.1 1998/03/16 09:03:05 pefo Exp $ */
+/* $OpenBSD: db_machdep.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -35,7 +35,6 @@
#ifndef _MACHINE_DB_MACHDEP_H_
#define _MACHINE_DB_MACHDEP_H_
-#include <machine/regnum.h>
#include <machine/frame.h>
#include <machine/trap.h>
#include <vm/vm_param.h>
@@ -58,7 +57,7 @@ db_addr_t next_instr_address __P((db_addr_t, boolean_t));
#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAK)
#define IS_WATCHPOINT_TRAP(type, code) (0) /* XXX mips3 watchpoint */
-#define PC_REGS(regs) ((db_addr_t)(regs)->reg[PC])
+#define PC_REGS(regs) ((db_addr_t)(regs)->pc)
#define DDB_REGS (&ddb_regs)
/*
diff --git a/sys/arch/mips/include/frame.h b/sys/arch/mips/include/frame.h
index c67c8ee481b..fdeb45fb447 100644
--- a/sys/arch/mips/include/frame.h
+++ b/sys/arch/mips/include/frame.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: frame.h,v 1.2 1998/03/16 09:03:06 pefo Exp $ */
+/* $OpenBSD: frame.h,v 1.3 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -35,7 +35,80 @@
#define _MACHINE_FRAME_H_
struct trap_frame {
- int reg[NUMSAVEREGS];
+ register_t zero;
+ register_t ast;
+ register_t v0;
+ register_t v1;
+ register_t a0;
+ register_t a1;
+ register_t a2;
+ register_t a3;
+ register_t t0;
+ register_t t1;
+ register_t t2;
+ register_t t3;
+ register_t t4;
+ register_t t5;
+ register_t t6;
+ register_t t7;
+ register_t s0;
+ register_t s1;
+ register_t s2;
+ register_t s3;
+ register_t s4;
+ register_t s5;
+ register_t s6;
+ register_t s7;
+ register_t t8;
+ register_t t9;
+ register_t k0;
+ register_t k1;
+ register_t gp;
+ register_t sp;
+ register_t s8;
+ register_t ra;
+ register_t sr;
+ register_t mullo;
+ register_t mulhi;
+ register_t badvaddr;
+ register_t cause;
+ register_t pc;
+
+/* From here and on, only saved user processes. */
+
+ f_register_t f0;
+ f_register_t f1;
+ f_register_t f2;
+ f_register_t f3;
+ f_register_t f4;
+ f_register_t f5;
+ f_register_t f6;
+ f_register_t f7;
+ f_register_t f8;
+ f_register_t f9;
+ f_register_t f10;
+ f_register_t f11;
+ f_register_t f12;
+ f_register_t f13;
+ f_register_t f14;
+ f_register_t f15;
+ f_register_t f16;
+ f_register_t f17;
+ f_register_t f18;
+ f_register_t f19;
+ f_register_t f20;
+ f_register_t f21;
+ f_register_t f22;
+ f_register_t f23;
+ f_register_t f24;
+ f_register_t f25;
+ f_register_t f26;
+ f_register_t f27;
+ f_register_t f28;
+ f_register_t f29;
+ f_register_t f30;
+ f_register_t f31;
+ register_t fsr;
};
#endif /*_MACHINE_FRAME_H_*/
diff --git a/sys/arch/mips/include/pcb.h b/sys/arch/mips/include/pcb.h
index 97d678b1541..bb7e1a69933 100644
--- a/sys/arch/mips/include/pcb.h
+++ b/sys/arch/mips/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.2 1998/05/08 16:32:10 millert Exp $ */
+/* $OpenBSD: pcb.h,v 1.3 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -41,15 +41,17 @@
* from: @(#)pcb.h 8.1 (Berkeley) 6/10/93
*/
+#include <machine/frame.h>
+
/*
* MIPS process control block
*/
struct pcb
{
- int pcb_regs[71]; /* saved CPU and floating point registers */
- label_t pcb_context; /* kernel context for resume */
- int pcb_onfault; /* for copyin/copyout faults */
- void *pcb_segtab; /* copy of pmap pm_segtab */
+ struct trap_frame pcb_regs; /* saved CPU and registers */
+ label_t pcb_context; /* kernel context for resume */
+ int pcb_onfault; /* for copyin/copyout faults */
+ void *pcb_segtab; /* copy of pmap pm_segtab */
};
/*
diff --git a/sys/arch/mips/include/pio.h b/sys/arch/mips/include/pio.h
index 7ac00c0c6e5..5f3dd0912b1 100644
--- a/sys/arch/mips/include/pio.h
+++ b/sys/arch/mips/include/pio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pio.h,v 1.1 1998/01/28 11:14:50 pefo Exp $ */
+/* $OpenBSD: pio.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1995 Per Fogelstrom. All rights reserved.
@@ -37,16 +37,78 @@
*/
#define outb(a,v) (*(volatile unsigned char*)(a) = (v))
+#define out8(a,v) (*(volatile unsigned char*)(a) = (v))
#define outw(a,v) (*(volatile unsigned short*)(a) = (v))
#define out16(a,v) outw(a,v)
#define outl(a,v) (*(volatile unsigned int*)(a) = (v))
#define out32(a,v) outl(a,v)
#define inb(a) (*(volatile unsigned char*)(a))
+#define in8(a) (*(volatile unsigned char*)(a))
#define inw(a) (*(volatile unsigned short*)(a))
#define in16(a) inw(a)
#define inl(a) (*(volatile unsigned int*)(a))
#define in32(a) inl(a)
+#define out8rb(a,v) (*(volatile unsigned char*)(a) = (v))
+#define out16rb(a,v) (__out16rb((volatile u_int16_t *)(a), v))
+#define out32rb(a,v) (__out32rb((volatile u_int32_t *)(a), v))
+#define in8rb(a) (*(volatile unsigned char*)(a))
+#define in16rb(a) (__in16rb((volatile u_int16_t *)(a)))
+#define in32rb(a) (__in32rb((volatile u_int32_t *)(a)))
+
+#define _swap_(x) \
+ (((x) >> 24) | ((x) << 24) | \
+ (((x) >> 8) & 0xff00) | (((x) & 0xff00) << 8))
+
+static __inline void __out32rb __P((volatile u_int32_t *, u_int32_t));
+static __inline void __out16rb __P((volatile u_int16_t *, u_int16_t));
+static __inline u_int32_t __in32rb __P((volatile u_int32_t *));
+static __inline u_int16_t __in16rb __P((volatile u_int16_t *));
+
+static __inline void
+__out32rb(a,v)
+ volatile u_int32_t *a;
+ u_int32_t v;
+{
+ u_int32_t _v_ = v;
+
+ _v_ = _swap_(_v_);
+ out32(a, _v_);
+}
+
+static __inline void
+__out16rb(a,v)
+ volatile u_int16_t *a;
+ u_int16_t v;
+{
+ u_int16_t _v_;
+
+ _v_ = ((v >> 8) & 0xff) | (v << 8);
+ out16(a, _v_);
+}
+
+static __inline u_int32_t
+__in32rb(a)
+ volatile u_int32_t *a;
+{
+ u_int32_t _v_;
+
+ _v_ = in32(a);
+ _v_ = _swap_(_v_);
+ return _v_;
+}
+
+static __inline u_int16_t
+__in16rb(a)
+ volatile u_int16_t *a;
+{
+ u_int16_t _v_;
+
+ _v_ = in16(a);
+ _v_ = ((_v_ >> 8) & 0xff) | (_v_ << 8);
+ return _v_;
+}
+
void insb __P((u_int8_t *, u_int8_t *,int));
void insw __P((u_int16_t *, u_int16_t *,int));
void insl __P((u_int32_t *, u_int32_t *,int));
diff --git a/sys/arch/mips/include/proc.h b/sys/arch/mips/include/proc.h
index cd69a36aab1..49f5a1b86f9 100644
--- a/sys/arch/mips/include/proc.h
+++ b/sys/arch/mips/include/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.1 1998/01/28 11:14:51 pefo Exp $ */
+/* $OpenBSD: proc.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
* Machine-dependent part of the proc structure.
*/
struct mdproc {
- int *md_regs; /* registers on current frame */
+ struct trap_frame *md_regs; /* registers on current frame */
int md_flags; /* machine-dependent flags */
int md_upte[UPAGES]; /* ptes for mapping u page */
int md_ss_addr; /* single step address for ptrace */
diff --git a/sys/arch/mips/include/types.h b/sys/arch/mips/include/types.h
index 74fc2388873..c1654225418 100644
--- a/sys/arch/mips/include/types.h
+++ b/sys/arch/mips/include/types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.h,v 1.1 1998/01/28 11:14:58 pefo Exp $ */
+/* $OpenBSD: types.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -73,8 +73,8 @@ typedef long long int64_t;
typedef unsigned long long u_int64_t;
typedef int32_t register_t;
+typedef int32_t f_register_t;
#define __SWAP_BROKEN
-#define __FORK_BRAINDAMAGE
#endif /* _MACHINE_TYPES_H_ */
diff --git a/sys/arch/mips/include/vmparam.h b/sys/arch/mips/include/vmparam.h
index fec40858381..918255a455a 100644
--- a/sys/arch/mips/include/vmparam.h
+++ b/sys/arch/mips/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.1 1998/01/28 11:14:59 pefo Exp $ */
+/* $OpenBSD: vmparam.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */
/* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */
/*
@@ -56,19 +56,19 @@
* Virtual memory related constants, all in bytes
*/
#ifndef MAXTSIZ
-#define MAXTSIZ (24*1024*1024) /* max text size */
+#define MAXTSIZ (64*1024*1024) /* max text size */
#endif
#ifndef DFLDSIZ
#define DFLDSIZ (64*1024*1024) /* initial data size limit */
#endif
#ifndef MAXDSIZ
-#define MAXDSIZ (256*1024*1024) /* max data size */
+#define MAXDSIZ (1*1024*1024*1024) /* max data size */
#endif
#ifndef DFLSSIZ
-#define DFLSSIZ (1024*1024) /* initial stack size limit */
+#define DFLSSIZ (2*1024*1024) /* initial stack size limit */
#endif
#ifndef MAXSSIZ
-#define MAXSSIZ MAXDSIZ /* max stack size */
+#define MAXSSIZ (32*1024*1024) /* max stack size */
#endif
/*
diff --git a/sys/arch/mips/mips/clock.c b/sys/arch/mips/mips/clock.c
index ea381e5dca6..5ced6723c5d 100644
--- a/sys/arch/mips/mips/clock.c
+++ b/sys/arch/mips/mips/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.4 1998/03/25 11:53:26 pefo Exp $ */
+/* $OpenBSD: clock.c,v 1.5 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom.
* Copyright (c) 1988 University of Utah.
@@ -40,7 +40,7 @@
* from: Utah Hdr: clock.c 1.18 91/01/21
*
* from: @(#)clock.c 8.1 (Berkeley) 6/10/93
- * $Id: clock.c,v 1.4 1998/03/25 11:53:26 pefo Exp $
+ * $Id: clock.c,v 1.5 1998/09/15 10:50:12 pefo Exp $
*/
#include <sys/param.h>
@@ -91,6 +91,12 @@ struct cfattach clock_indy_ca = {
};
#endif
+#ifdef galileo
+struct cfattach clock_ca = {
+ sizeof(struct clock_softc), clockmatch, clockattach
+};
+#endif
+
void md_clk_attach __P((struct device *, struct device *, void *));
int clockintr __P((void *));
@@ -136,6 +142,12 @@ clockmatch(parent, cfdata, aux)
case SGI_INDY:
break;
#endif
+
+#ifdef galileo
+ case GALILEO_G9:
+ break;
+#endif
+
default:
panic("clockmatch unknown CPU");
}
@@ -184,6 +196,11 @@ clockattach(parent, self, aux)
break;
#endif
+#ifdef galileo
+ case GALILEO_G9:
+ break;
+#endif
+
default:
panic("clockattach: it didn't get here. really.");
}
@@ -287,7 +304,14 @@ inittodr(base)
badbase = 0;
/* Read RTC chip registers */
- (*csc->sc_get)(csc, base, &c);
+ if(csc->sc_get) {
+ (*csc->sc_get)(csc, base, &c);
+ }
+ else {
+ time.tv_sec = base;
+ printf("WARNING: No TOD clock, beliving file system.\n");
+ goto bad;
+ }
csc->sc_initted = 1;
@@ -378,5 +402,7 @@ resettodr()
c.min = t / 60;
c.sec = t % 60;
- (*csc->sc_set)(csc, &c);
+ if(csc->sc_set) {
+ (*csc->sc_set)(csc, &c);
+ }
}
diff --git a/sys/arch/mips/mips/cpu.c b/sys/arch/mips/mips/cpu.c
index afbcb3caa5d..cf325304c5c 100644
--- a/sys/arch/mips/mips/cpu.c
+++ b/sys/arch/mips/mips/cpu.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: cpu.c,v 1.3 1998/07/11 21:41:15 imp Exp $ */
+/* $OpenBSD: cpu.c,v 1.4 1998/09/15 10:50:12 pefo Exp $ */
/*
- * Copyright (c) 1997 Per Fogelstrom
+ * Copyright (c) 1997, 1998 Per Fogelstrom, Opsycon AB
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -14,7 +14,7 @@
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed under OpenBSD by
- * Per Fogelstrom.
+ * Per Fogelstrom, Opsycon AB, Sweden.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
@@ -193,16 +193,17 @@ cpuattach(parent, dev, aux)
printf(" Rev. %d.%d", fpu_id.cpu.cp_majrev, fpu_id.cpu.cp_minrev);
printf("\n");
- printf("Primary cache size: %dkb Instruction, %dkb Data.",
+ printf("\tL1 Cache I size %dkb(%d line),",
CpuPrimaryInstCacheSize / 1024,
- CpuPrimaryDataCacheSize / 1024);
+ CpuPrimaryInstCacheLSize);
+ printf(" D size %dkb(%d line), ",
+ CpuPrimaryDataCacheSize / 1024,
+ CpuPrimaryDataCacheLSize);
if(CpuTwoWayCache)
- printf(" Two way set associative.\n");
+ printf("two way.\n");
else
- printf(" Direct mapped.\n");
+ printf("direct mapped.\n");
- if(l2cache_is_snooping)
- printf("Missing L2 cache or Snooping L2 cache.\n");
- else
- printf("No Snooping L2 cache!\n");
+ printf("\t%s snoop uncached cpu accesses.\n", l2cache_is_snooping ?
+ "No L2 cache or L2 cache" : "L2 cache doesn't");
}
diff --git a/sys/arch/mips/mips/cpu_ecoff.c b/sys/arch/mips/mips/cpu_ecoff.c
index 9e10d578e04..32c22123d11 100644
--- a/sys/arch/mips/mips/cpu_ecoff.c
+++ b/sys/arch/mips/mips/cpu_ecoff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu_ecoff.c,v 1.1 1998/01/28 12:12:07 pefo Exp $ */
+/* $OpenBSD: cpu_ecoff.c,v 1.2 1998/09/15 10:50:12 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
#include <sys/resourcevar.h>
#include <vm/vm.h>
-#include <machine/reg.h>
+#include <machine/frame.h>
#if defined(_KERN_DO_ECOFF)
#include <sys/exec_ecoff.h>
@@ -66,7 +66,7 @@ cpu_exec_ecoff_setregs(p, pack, stack, retval)
setregs(p, pack, stack, retval);
eap = (struct ecoff_aouthdr *)
((caddr_t)pack->ep_hdr + sizeof(struct ecoff_filehdr));
- p->p_md.md_regs[GP] = eap->ea_gp_value;
+ p->p_md.md_regs->gp = eap->ea_gp_value;
}
/*
diff --git a/sys/arch/mips/mips/db_machdep.c b/sys/arch/mips/mips/db_machdep.c
index 7a23f88c981..195cf8acfef 100644
--- a/sys/arch/mips/mips/db_machdep.c
+++ b/sys/arch/mips/mips/db_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.c,v 1.1 1998/03/16 09:03:25 pefo Exp $ */
+/* $OpenBSD: db_machdep.c,v 1.2 1998/09/15 10:50:13 pefo Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -46,8 +46,8 @@
#include <ddb/db_variables.h>
#include <ddb/db_interface.h>
-u_int MipsEmulateBranch __P((int *, int, int, u_int));
-void stacktrace_subr __P((int *, int (*)(const char*, ...)));
+u_int MipsEmulateBranch __P((db_regs_t *, int, int, u_int));
+void stacktrace_subr __P((db_regs_t *, int (*)(const char*, ...)));
int kdbpeek __P((int));
void kdbpoke __P((int, int));
@@ -57,43 +57,43 @@ int db_active = 0;
db_regs_t ddb_regs;
struct db_variable db_regs[] = {
- { "at", (long *)&ddb_regs.reg[AST], FCN_NULL },
- { "v0", (long *)&ddb_regs.reg[V0], FCN_NULL },
- { "v1", (long *)&ddb_regs.reg[V1], FCN_NULL },
- { "a0", (long *)&ddb_regs.reg[A0], FCN_NULL },
- { "a1", (long *)&ddb_regs.reg[A1], FCN_NULL },
- { "a2", (long *)&ddb_regs.reg[A2], FCN_NULL },
- { "a3", (long *)&ddb_regs.reg[A3], FCN_NULL },
- { "t0", (long *)&ddb_regs.reg[T0], FCN_NULL },
- { "t1", (long *)&ddb_regs.reg[T1], FCN_NULL },
- { "t2", (long *)&ddb_regs.reg[T2], FCN_NULL },
- { "t3", (long *)&ddb_regs.reg[T3], FCN_NULL },
- { "t4", (long *)&ddb_regs.reg[T4], FCN_NULL },
- { "t5", (long *)&ddb_regs.reg[T5], FCN_NULL },
- { "t6", (long *)&ddb_regs.reg[T6], FCN_NULL },
- { "t7", (long *)&ddb_regs.reg[T7], FCN_NULL },
- { "s0", (long *)&ddb_regs.reg[S0], FCN_NULL },
- { "s1", (long *)&ddb_regs.reg[S1], FCN_NULL },
- { "s2", (long *)&ddb_regs.reg[S2], FCN_NULL },
- { "s3", (long *)&ddb_regs.reg[S3], FCN_NULL },
- { "s4", (long *)&ddb_regs.reg[S4], FCN_NULL },
- { "s5", (long *)&ddb_regs.reg[S5], FCN_NULL },
- { "s6", (long *)&ddb_regs.reg[S6], FCN_NULL },
- { "s7", (long *)&ddb_regs.reg[S7], FCN_NULL },
- { "t8", (long *)&ddb_regs.reg[T8], FCN_NULL },
- { "t9", (long *)&ddb_regs.reg[T9], FCN_NULL },
- { "k0", (long *)&ddb_regs.reg[K0], FCN_NULL },
- { "k1", (long *)&ddb_regs.reg[K1], FCN_NULL },
- { "gp", (long *)&ddb_regs.reg[GP], FCN_NULL },
- { "sp", (long *)&ddb_regs.reg[SP], FCN_NULL },
- { "s8", (long *)&ddb_regs.reg[S8], FCN_NULL },
- { "ra", (long *)&ddb_regs.reg[RA], FCN_NULL },
- { "sr", (long *)&ddb_regs.reg[SR], FCN_NULL },
- { "lo", (long *)&ddb_regs.reg[MULLO], FCN_NULL },
- { "hi", (long *)&ddb_regs.reg[MULHI], FCN_NULL },
- { "bad", (long *)&ddb_regs.reg[BADVADDR],FCN_NULL },
- { "cs", (long *)&ddb_regs.reg[CAUSE], FCN_NULL },
- { "pc", (long *)&ddb_regs.reg[PC], FCN_NULL },
+ { "at", (long *)&ddb_regs.ast, FCN_NULL },
+ { "v0", (long *)&ddb_regs.v0, FCN_NULL },
+ { "v1", (long *)&ddb_regs.v1, FCN_NULL },
+ { "a0", (long *)&ddb_regs.a0, FCN_NULL },
+ { "a1", (long *)&ddb_regs.a1, FCN_NULL },
+ { "a2", (long *)&ddb_regs.a2, FCN_NULL },
+ { "a3", (long *)&ddb_regs.a3, FCN_NULL },
+ { "t0", (long *)&ddb_regs.t0, FCN_NULL },
+ { "t1", (long *)&ddb_regs.t1, FCN_NULL },
+ { "t2", (long *)&ddb_regs.t2, FCN_NULL },
+ { "t3", (long *)&ddb_regs.t3, FCN_NULL },
+ { "t4", (long *)&ddb_regs.t4, FCN_NULL },
+ { "t5", (long *)&ddb_regs.t5, FCN_NULL },
+ { "t6", (long *)&ddb_regs.t6, FCN_NULL },
+ { "t7", (long *)&ddb_regs.t7, FCN_NULL },
+ { "s0", (long *)&ddb_regs.s0, FCN_NULL },
+ { "s1", (long *)&ddb_regs.s1, FCN_NULL },
+ { "s2", (long *)&ddb_regs.s2, FCN_NULL },
+ { "s3", (long *)&ddb_regs.s3, FCN_NULL },
+ { "s4", (long *)&ddb_regs.s4, FCN_NULL },
+ { "s5", (long *)&ddb_regs.s5, FCN_NULL },
+ { "s6", (long *)&ddb_regs.s6, FCN_NULL },
+ { "s7", (long *)&ddb_regs.s7, FCN_NULL },
+ { "t8", (long *)&ddb_regs.t8, FCN_NULL },
+ { "t9", (long *)&ddb_regs.t9, FCN_NULL },
+ { "k0", (long *)&ddb_regs.k0, FCN_NULL },
+ { "k1", (long *)&ddb_regs.k1, FCN_NULL },
+ { "gp", (long *)&ddb_regs.gp, FCN_NULL },
+ { "sp", (long *)&ddb_regs.sp, FCN_NULL },
+ { "s8", (long *)&ddb_regs.s8, FCN_NULL },
+ { "ra", (long *)&ddb_regs.ra, FCN_NULL },
+ { "sr", (long *)&ddb_regs.sr, FCN_NULL },
+ { "lo", (long *)&ddb_regs.mullo, FCN_NULL },
+ { "hi", (long *)&ddb_regs.mulhi, FCN_NULL },
+ { "bad", (long *)&ddb_regs.badvaddr,FCN_NULL },
+ { "cs", (long *)&ddb_regs.cause, FCN_NULL },
+ { "pc", (long *)&ddb_regs.pc, FCN_NULL },
};
struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
@@ -105,8 +105,8 @@ kdb_trap(type, t_frame)
{
switch(type) {
case T_BREAK: /* breakpoint */
- if(db_get_value((t_frame)->reg[PC], sizeof(int), FALSE) == BREAK_SOVER) {
- (t_frame)->reg[PC] += BKPT_SIZE;
+ if(db_get_value((t_frame)->pc, sizeof(int), FALSE) == BREAK_SOVER) {
+ (t_frame)->pc += BKPT_SIZE;
}
break;
case -1:
@@ -191,7 +191,7 @@ db_stack_trace_cmd(addr, have_addr, count, modif)
db_expr_t count;
char *modif;
{
- stacktrace_subr(ddb_regs.reg, db_printf);
+ stacktrace_subr(&ddb_regs, db_printf);
}
/*
@@ -207,7 +207,7 @@ next_instr_address(db_addr_t pc, boolean_t bd)
{
db_addr_t next;
- next = (db_addr_t)MipsEmulateBranch(ddb_regs.reg, pc, 0, 0);
+ next = (db_addr_t)MipsEmulateBranch(&ddb_regs, pc, 0, 0);
return(next);
}
diff --git a/sys/arch/mips/mips/mainbus.c b/sys/arch/mips/mips/mainbus.c
index 3ae2c4927bb..00c7e2063d5 100644
--- a/sys/arch/mips/mips/mainbus.c
+++ b/sys/arch/mips/mips/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.2 1998/03/16 09:03:34 pefo Exp $ */
+/* $OpenBSD: mainbus.c,v 1.3 1998/09/15 10:50:13 pefo Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom.
@@ -149,6 +149,22 @@ mbattach(parent, self, aux)
config_found(self, &nca, mbprint);
}
#endif
+
+#ifdef galileo
+ if (system_type == GALILEO_G9) {
+ nca.ca_name = "localbus";
+ nca.ca_slot = 0;
+ nca.ca_offset = 0;
+ nca.ca_bus = &sc->sc_bus;
+ config_found(self, &nca, mbprint);
+
+ nca.ca_name = "galpcibr";
+ nca.ca_slot = 0;
+ nca.ca_offset = 0;
+ nca.ca_bus = &sc->sc_bus;
+ config_found(self, &nca, mbprint);
+ }
+#endif
}
static int
diff --git a/sys/arch/mips/mips/process_machdep.c b/sys/arch/mips/mips/process_machdep.c
index 7a5e2b4d7d0..9f4018c19ef 100644
--- a/sys/arch/mips/mips/process_machdep.c
+++ b/sys/arch/mips/mips/process_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process_machdep.c,v 1.1 1998/01/28 12:12:09 pefo Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.2 1998/09/15 10:50:13 pefo Exp $ */
/*
* Copyright (c) 1994 Adam Glass
* Copyright (c) 1993 The Regents of the University of California.
@@ -39,7 +39,7 @@
* From:
* Id: procfs_i386.c,v 4.1 1993/12/17 10:47:45 jsp Rel
*
- * $Id: process_machdep.c,v 1.1 1998/01/28 12:12:09 pefo Exp $
+ * $Id: process_machdep.c,v 1.2 1998/09/15 10:50:13 pefo Exp $
*/
/*
@@ -74,7 +74,9 @@
#include <sys/ptrace.h>
#include <machine/pte.h>
#include <machine/psl.h>
-#include <machine/reg.h>
+#include <machine/frame.h>
+
+#define REGSIZE sizeof(struct trap_frame)
extern void cpu_singlestep __P((struct proc *));
int
@@ -82,7 +84,7 @@ process_read_regs(p, regs)
struct proc *p;
struct reg *regs;
{
- bcopy((caddr_t)p->p_md.md_regs, (caddr_t)regs, sizeof(struct reg));
+ bcopy((caddr_t)p->p_md.md_regs, (caddr_t)regs, REGSIZE);
return (0);
}
@@ -91,7 +93,7 @@ process_write_regs(p, regs)
struct proc *p;
struct reg *regs;
{
- bcopy((caddr_t)regs, (caddr_t)p->p_md.md_regs, sizeof(struct reg));
+ bcopy((caddr_t)regs, (caddr_t)p->p_md.md_regs, REGSIZE);
/*XXX Clear to user set bits!! */
return (0);
}
@@ -110,7 +112,7 @@ process_set_pc(p, addr)
struct proc *p;
caddr_t addr;
{
- p->p_md.md_regs[PC] = (int)addr;
+ p->p_md.md_regs->pc = (int)addr;
return (0);
}
diff --git a/sys/arch/mips/mips/vm_machdep.c b/sys/arch/mips/mips/vm_machdep.c
index 44ea62488b3..1d02b00b2c3 100644
--- a/sys/arch/mips/mips/vm_machdep.c
+++ b/sys/arch/mips/mips/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.3 1998/07/28 00:13:42 millert Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.4 1998/09/15 10:50:13 pefo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
@@ -64,70 +64,49 @@ static int vm_map_findspace_align __P((vm_map_t map, vm_offset_t, vm_size_t,
int vm_map_find_U __P((vm_map_t, vm_object_t, vm_offset_t, vm_offset_t *,
vm_size_t, boolean_t));
+extern void child_return __P((struct proc *));
+extern void proc_trampoline __P((void));
/*
* Finish a fork operation, with process p2 nearly set up.
- * Copy and update the kernel stack and pcb, making the child
- * ready to run, and marking it so that it can return differently
- * than the parent. Returns 1 in the child process, 0 in the parent.
- * We currently double-map the user area so that the stack is at the same
- * address in each process; in the future we will probably relocate
- * the frame pointers on the stack after copying.
*/
-int
+void
cpu_fork(p1, p2)
- register struct proc *p1, *p2;
+ struct proc *p1, *p2;
{
- struct user *up = p2->p_addr;
pt_entry_t *pte;
+ struct pcb *pcb;
int i;
extern struct proc *machFPCurProcPtr;
- p2->p_md.md_regs = up->u_pcb.pcb_regs;
+ p2->p_md.md_regs = &p2->p_addr->u_pcb.pcb_regs;
p2->p_md.md_flags = p1->p_md.md_flags & MDP_FPUSED;
- /*
- * Cache the PTEs for the user area in the machine dependent
- * part of the proc struct so cpu_switch() can quickly map in
- * the user struct and kernel stack. Note: if the virtual address
- * translation changes (e.g. swapout) we have to update this.
- */
- pte = kvtopte(up);
+ pte = kvtopte(p2->p_addr);
for (i = 0; i < UPAGES; i++) {
- p2->p_md.md_upte[i] = pte->pt_entry & ~(PG_G | PG_RO | PG_WIRED);
+ p2->p_md.md_upte[i] = pte->pt_entry & ~(PG_G|PG_RO|PG_WIRED);
pte++;
}
- /*
- * Copy floating point state from the FP chip if this process
- * has state stored there.
- */
if (p1 == machFPCurProcPtr)
MipsSaveCurFPState(p1);
- /*
- * Copy pcb and stack from proc p1 to p2.
- * We do this as cheaply as possible, copying only the active
- * part of the stack. The stack and pcb need to agree;
- */
+ pcb = &p2->p_addr->u_pcb;
p2->p_addr->u_pcb = p1->p_addr->u_pcb;
- /* cache segtab for ULTBMiss() */
- p2->p_addr->u_pcb.pcb_segtab = (void *)p2->p_vmspace->vm_pmap.pm_segtab;
- /*
- * Arrange for a non-local goto when the new process
- * is started, to resume here, returning nonzero from setjmp.
- */
-#ifdef DIAGNOSTIC
- if (p1 != curproc)
- panic("cpu_fork: curproc");
-#endif
- if (copykstack(up)) {
- /*
- * Return 1 in child.
- */
- return (1);
- }
- return (0);
+ pcb->pcb_segtab = (void *)p2->p_vmspace->vm_pmap.pm_segtab;
+
+ pcb->pcb_context.val[10] = (int)proc_trampoline;
+ pcb->pcb_context.val[8] = (int)(KERNELSTACK - 24);
+ pcb->pcb_context.val[0] = (int)child_return;
+ pcb->pcb_context.val[1] = (int)p2;
+}
+
+void
+cpu_set_kpc(p, pc)
+ struct proc *p;
+ void (*pc) __P((struct proc *));
+{
+ p->p_addr->u_pcb.pcb_context.val[0] = (int)pc;
}
/*