summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-09 14:57:27 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-09 14:57:27 +0000
commit742d43747326c808a6f441af721d78525f69f4a8 (patch)
treedf270ec266f214aeb803b1ee29decdc03b1da0aa /sys/arch/mips64
parentac8a30a6ca44a9d5f639c96c1c8fb2cf08ca1677 (diff)
Big cleanup. Removed some unused obsolete stuff and fixed copyrights
on some files. Arcbios support is now in, thus detects memorysize and cpu clock frequency.
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/conf/files.mips644
-rw-r--r--sys/arch/mips64/include/arcbios.h16
-rw-r--r--sys/arch/mips64/include/cpu.h25
-rw-r--r--sys/arch/mips64/include/dlfcn.h61
-rw-r--r--sys/arch/mips64/include/ecoff_machdep.h98
-rw-r--r--sys/arch/mips64/include/exception.h7
-rw-r--r--sys/arch/mips64/include/frame.h7
-rw-r--r--sys/arch/mips64/include/memconf.h15
-rw-r--r--sys/arch/mips64/include/pio.h7
-rw-r--r--sys/arch/mips64/include/regnum.h7
-rw-r--r--sys/arch/mips64/include/types.h4
-rw-r--r--sys/arch/mips64/mips64/arcbios.c21
-rw-r--r--sys/arch/mips64/mips64/busdma.c7
-rw-r--r--sys/arch/mips64/mips64/cache_r5k.S4
-rw-r--r--sys/arch/mips64/mips64/clock.c8
-rw-r--r--sys/arch/mips64/mips64/context.S7
-rw-r--r--sys/arch/mips64/mips64/cp0access.S13
-rw-r--r--sys/arch/mips64/mips64/cpu.c86
-rw-r--r--sys/arch/mips64/mips64/cpu_ecoff.c95
-rw-r--r--sys/arch/mips64/mips64/db_machdep.c17
-rw-r--r--sys/arch/mips64/mips64/exception.S9
-rw-r--r--sys/arch/mips64/mips64/interrupt.c7
-rw-r--r--sys/arch/mips64/mips64/lcore_access.S7
-rw-r--r--sys/arch/mips64/mips64/lcore_ddb.S7
-rw-r--r--sys/arch/mips64/mips64/lcore_float.S41
-rw-r--r--sys/arch/mips64/mips64/mainbus.c7
-rw-r--r--sys/arch/mips64/mips64/mem.c10
-rw-r--r--sys/arch/mips64/mips64/pmap.c13
-rw-r--r--sys/arch/mips64/mips64/sendsig.c7
-rw-r--r--sys/arch/mips64/mips64/tlbhandler.S4
30 files changed, 148 insertions, 473 deletions
diff --git a/sys/arch/mips64/conf/files.mips64 b/sys/arch/mips64/conf/files.mips64
index c67836f6251..44683523c52 100644
--- a/sys/arch/mips64/conf/files.mips64
+++ b/sys/arch/mips64/conf/files.mips64
@@ -1,12 +1,12 @@
-# $OpenBSD: files.mips64,v 1.1 2004/08/06 20:56:01 pefo Exp $
+# $OpenBSD: files.mips64,v 1.2 2004/08/09 14:57:26 pefo Exp $
-file arch/mips64/mips64/cpu_ecoff.c
file arch/mips64/mips64/disksubr.c
file arch/mips64/mips64/mem.c
file arch/mips64/mips64/process_machdep.c
file arch/mips64/mips64/sys_machdep.c
file arch/mips64/mips64/vm_machdep.c
+file arch/mips64/mips64/arcbios.c arcbios
file arch/mips64/mips64/clock.c
file arch/mips64/mips64/cpu.c
file arch/mips64/mips64/busdma.c
diff --git a/sys/arch/mips64/include/arcbios.h b/sys/arch/mips64/include/arcbios.h
index d5084a2b987..bb6bb2411b4 100644
--- a/sys/arch/mips64/include/arcbios.h
+++ b/sys/arch/mips64/include/arcbios.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: arcbios.h,v 1.1 2004/08/08 21:51:36 pefo Exp $ */
+/* $OpenBSD: arcbios.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*-
* Copyright (c) 1996 M. Warner Losh. All rights reserved.
*
@@ -356,11 +356,11 @@ void bios_display_info(int *, int *, int *, int *);
int Bios_Load(void);
int Bios_Invoke(void);
int Bios_Execute(void);
-int Bios_Halt(void);
-int Bios_PowerDown(void);
-int Bios_Restart(void);
-int Bios_Reboot(void);
-int Bios_EnterInteractiveMode(void);
+void Bios_Halt(void);
+void Bios_PowerDown(void);
+void Bios_Restart(void);
+void Bios_Reboot(void);
+void Bios_EnterInteractiveMode(void);
int Bios_GetPeer(void);
arc_config_t *Bios_GetChild(arc_config_t *);
int Bios_GetParent(void);
@@ -381,11 +381,11 @@ int Bios_GetReadStatus(void);
int Bios_Write(int, char *, int, int *);
int Bios_Seek(void);
int Bios_Mount(void);
-int Bios_GetEnvironmentVariable(void);
+char *Bios_GetEnvironmentVariable(const char *);
int Bios_SetEnvironmentVariable(void);
int Bios_GetFileInformation(void);
int Bios_SetFileInformation(void);
-int Bios_FlushAllCaches(void);
+void Bios_FlushAllCaches(void);
int Bios_TestUnicodeCharacter(void);
arc_dsp_stat_t *Bios_GetDisplayStatus(int);
diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h
index c3172d4639a..117c8aa194f 100644
--- a/sys/arch/mips64/include/cpu.h
+++ b/sys/arch/mips64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.1 2004/08/06 20:56:01 pefo Exp $ */
+/* $OpenBSD: cpu.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -357,25 +357,6 @@
int want_resched; /* resched() was called */
-/*
- * CPU identification, from PRID register.
- */
-union cpuprid {
- int cpuprid;
- struct {
-#if BYTE_ORDER == BIG_ENDIAN
- u_int pad1:16; /* reserved */
- u_int cp_imp:8; /* implementation identifier */
- u_int cp_majrev:4; /* major revision identifier */
- u_int cp_minrev:4; /* minor revision identifier */
-#else
- u_int cp_minrev:4; /* minor revision identifier */
- u_int cp_majrev:4; /* major revision identifier */
- u_int cp_imp:8; /* implementation identifier */
- u_int pad1:16; /* reserved */
-#endif
- } cpu;
-};
#endif /* !_LOCORE */
#endif /* _KERNEL */
@@ -439,8 +420,6 @@ union cpuprid {
#define MIPS_VR5400 0x54 /* NEC Vr5400 FPU ISA IV+ */
#if defined(_KERNEL) && !defined(_LOCORE)
-union cpuprid cpu_id;
-union cpuprid fpu_id;
u_int CpuPrimaryInstCacheSize;
u_int CpuPrimaryInstCacheLSize;
@@ -463,6 +442,8 @@ struct user;
void tlb_set_wired(int);
void tlb_set_pid(int);
+u_int cp0_get_prid(void);
+u_int cp1_get_prid(void);
u_int cp0_get_count(void);
void cp0_set_compare(u_int);
diff --git a/sys/arch/mips64/include/dlfcn.h b/sys/arch/mips64/include/dlfcn.h
deleted file mode 100644
index f242fcdc055..00000000000
--- a/sys/arch/mips64/include/dlfcn.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* $OpenBSD: dlfcn.h,v 1.1 2004/08/06 20:56:01 pefo Exp $ */
-
-/*
- * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
- *
- * 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 under OpenBSD by
- * 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.
- *
- * 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 _MIPS_DLFCN_H_
-#define _MIPS_DLFCN_H_
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-extern void *dlopen __P((const char *, int));
-extern int dlclose __P((void *));
-extern void *dlsym __P((void *, const char *));
-extern int dlctl __P((void *, int, void *));
-extern const char *dlerror __P((void));
-__END_DECLS
-
-/*
- * dlopen() modes.
- */
-#define DL_LAZY 1 /* Resolve when called */
-#define DL_NOW 2 /* Resolve immediatly */
-
-/*
- * dlctl() commands.
- */
-
-#define DL_DUMP_MAP 99
-
-
-#endif /* !_MIPS_DLFCN_H_ */
diff --git a/sys/arch/mips64/include/ecoff_machdep.h b/sys/arch/mips64/include/ecoff_machdep.h
deleted file mode 100644
index 1de7eeadc6d..00000000000
--- a/sys/arch/mips64/include/ecoff_machdep.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $OpenBSD: ecoff_machdep.h,v 1.1 2004/08/06 20:56:01 pefo Exp $ */
-/* $NetBSD: ecoff.h,v 1.4 1995/06/16 02:07:33 mellon Exp $ */
-
-/*
- * Copyright (c) 1994 Adam Glass
- * 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 Adam Glass.
- * 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 Adam Glass ``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 Adam Glass 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 _MIPS_ECOFF_H_
-#define _MIPS_ECOFF_H_
-
-#define ECOFF_LDPGSZ 4096
-
-#define ECOFF_PAD
-
-#define ECOFF_MACHDEP \
- u_long ea_gprmask; \
- u_long ea_cprmask[4]; \
- u_long ea_gp_value
-
-#define ECOFF_MAGIC_MIPSEL 0x0162
-#define ECOFF_BADMAG(ex) ((ex)->f.f_magic != ECOFF_MAGIC_MIPSEL)
-
-#define ECOFF_SEGMENT_ALIGNMENT(ep) ((ep)->a.vstamp < 23 ? 8 : 16)
-
-struct ecoff_symhdr {
- int16_t sh_magic;
- int16_t sh_vstamp;
- int32_t sh_linemax;
- int32_t sh_densenummax;
- int32_t sh_procmax;
- int32_t sh_lsymmax;
- int32_t sh_optsymmax;
- int32_t sh_auxxymmax;
- int32_t sh_lstrmax;
- int32_t sh_estrmax;
- int32_t sh_fdmax;
- int32_t sh_rfdmax;
- int32_t sh_esymmax;
- long sh_linesize;
- long sh_lineoff;
- long sh_densenumoff;
- long sh_procoff;
- long sh_lsymoff;
- long sh_optsymoff;
- long sh_auxsymoff;
- long sh_lstroff;
- long sh_estroff;
- long sh_fdoff;
- long sh_rfdoff;
- long sh_esymoff;
-};
-/* Some day they will make up their minds.... */
-#define esymMax sh_esymmax
-#define cbExtOffset sh_esymoff
-#define cbSsExtOffset sh_estroff
-
-struct ecoff_extsym {
- long es_value;
- int es_strindex;
- unsigned es_type:6;
- unsigned es_class:5;
- unsigned :1;
- unsigned es_symauxindex:20;
- unsigned es_jmptbl:1;
- unsigned es_cmain:1;
- unsigned es_weakext:1;
- unsigned :29;
- int es_indexfld;
-};
-
-#endif /* !_MIPS_ECOFF_H_ */
diff --git a/sys/arch/mips64/include/exception.h b/sys/arch/mips64/include/exception.h
index fdfd2c05ab7..3fd4792f7b5 100644
--- a/sys/arch/mips64/include/exception.h
+++ b/sys/arch/mips64/include/exception.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exception.h,v 1.1 2004/08/06 20:56:01 pefo Exp $ */
+/* $OpenBSD: exception.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/include/frame.h b/sys/arch/mips64/include/frame.h
index 4176328349a..21bb05b7940 100644
--- a/sys/arch/mips64/include/frame.h
+++ b/sys/arch/mips64/include/frame.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: frame.h,v 1.1 2004/08/06 20:56:01 pefo Exp $ */
+/* $OpenBSD: frame.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/include/memconf.h b/sys/arch/mips64/include/memconf.h
index 16a4201516b..1ad9c8b48a5 100644
--- a/sys/arch/mips64/include/memconf.h
+++ b/sys/arch/mips64/include/memconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: memconf.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */
+/* $OpenBSD: memconf.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -12,11 +12,6 @@
* 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 Per Fogelstrom.
- * 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
@@ -37,14 +32,14 @@
#ifndef _MIPS_MEMCONF_H_
#define _MIPS_MEMCONF_H_
-struct mem_descriptor {
- paddr_t mem_start;
- psize_t mem_size;
+struct phys_mem_desc {
+ u_int32_t mem_first_page;
+ u_int32_t mem_last_page;
};
#ifdef _KERNEL
#define MAXMEMSEGS 16
-extern struct mem_descriptor mem_layout[];
+extern struct phys_mem_desc mem_layout[];
#endif
#endif /* !_MIPS_MEMCONF_H_ */
diff --git a/sys/arch/mips64/include/pio.h b/sys/arch/mips64/include/pio.h
index 9ac0f842b4e..e8253b69c63 100644
--- a/sys/arch/mips64/include/pio.h
+++ b/sys/arch/mips64/include/pio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pio.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */
+/* $OpenBSD: pio.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/include/regnum.h b/sys/arch/mips64/include/regnum.h
index 296016dc01b..0de6f8e9f7f 100644
--- a/sys/arch/mips64/include/regnum.h
+++ b/sys/arch/mips64/include/regnum.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: regnum.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */
+/* $OpenBSD: regnum.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/include/types.h b/sys/arch/mips64/include/types.h
index 947e3a75374..9107f33dc96 100644
--- a/sys/arch/mips64/include/types.h
+++ b/sys/arch/mips64/include/types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */
+/* $OpenBSD: types.h,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -85,8 +85,6 @@ typedef int32_t register_t;
typedef int32_t f_register_t;
#endif
-#define __SWAP_BROKEN
-
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
typedef struct label_t {
register_t val[14];
diff --git a/sys/arch/mips64/mips64/arcbios.c b/sys/arch/mips64/mips64/arcbios.c
index 5e122a08a26..d9291a0f0ee 100644
--- a/sys/arch/mips64/mips64/arcbios.c
+++ b/sys/arch/mips64/mips64/arcbios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arcbios.c,v 1.1 2004/08/08 21:51:36 pefo Exp $ */
+/* $OpenBSD: arcbios.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*-
* Copyright (c) 1996 M. Warner Losh. All rights reserved.
* Copyright (c) 1996-2004 Opsycon AB. All rights reserved.
@@ -41,6 +41,7 @@
arc_param_blk_t *bios_base = ArcBiosBase;
extern int physmem; /* Total physical memory size */
+extern int rsvdmem; /* Total reserved memory size */
void bios_configure_memory(void);
int bios_get_system_type(void);
@@ -185,7 +186,6 @@ bios_configure_memory()
struct phys_mem_desc *m;
vaddr_t seg_start, seg_end;
int i;
- char str[100];
descr = (arc_mem_t *)Bios_GetMemoryDescriptor(descr);
while(descr != 0) {
@@ -197,12 +197,6 @@ bios_configure_memory()
case BadMemory: /* Have no use for theese */
break;
-#if 0
- case ExeceptionBlock:
- case SystemParameterBlock:
- case FirmwareTemporary:
- case FirmwarePermanent:
-#endif
case FreeMemory:
case FreeContigous:
physmem += descr->PageCount;
@@ -227,7 +221,15 @@ bios_configure_memory()
}
break;
- case LoadedProgram: /* This is the loaded kernel */
+ case ExeceptionBlock:
+ case SystemParameterBlock:
+ case FirmwareTemporary:
+ case FirmwarePermanent:
+ rsvdmem += descr->PageCount;
+ physmem += descr->PageCount;
+ break;
+
+ case LoadedProgram: /* Count this into total memory */
physmem += descr->PageCount;
break;
@@ -239,6 +241,7 @@ bios_configure_memory()
#ifdef DEBUG_MEM_LAYOUT
for ( i = 0; i < MAXMEMSEGS; i++) {
+ char str[100];
if (mem_layout[i].mem_first_page) {
snprintf(str, sizeof(str), "MEM %d, 0x%x to 0x%x\n",i,
mem_layout[i].mem_first_page * 4096,
diff --git a/sys/arch/mips64/mips64/busdma.c b/sys/arch/mips64/mips64/busdma.c
index bbfc5fea450..02c4396794c 100644
--- a/sys/arch/mips64/mips64/busdma.c
+++ b/sys/arch/mips64/mips64/busdma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: busdma.c,v 1.2 2004/08/06 22:11:54 pefo Exp $ */
+/* $OpenBSD: busdma.c,v 1.3 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/mips64/cache_r5k.S b/sys/arch/mips64/mips64/cache_r5k.S
index 26d3ee00679..334b5859550 100644
--- a/sys/arch/mips64/mips64/cache_r5k.S
+++ b/sys/arch/mips64/mips64/cache_r5k.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache_r5k.S,v 1.2 2004/08/07 14:48:26 pefo Exp $ */
+/* $OpenBSD: cache_r5k.S,v 1.3 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 1998-2004 Opsycon AB (www.opsycon.se)
@@ -160,7 +160,6 @@
* CpuNWayCache is set to 0 for direct mapped caches, 2 for two way
* caches and 4 for four way caches. This primarily indicates the
* primary cache associativity.
- * cpu_id is set for later decision testing.
*
* Allocation:
* t4, t5 t6 used to hold I and D set size and Alias mask.
@@ -171,7 +170,6 @@ LEAF(Mips5k_ConfigCache)
.set noreorder
mfc0 v1, COP_0_PRID # read processor ID register
mfc0 v0, COP_0_CONFIG # Get configuration register
- sw v1, cpu_id # save PRID register
srl t1, v0, 9 # Get I cache size.
and t1, 3
diff --git a/sys/arch/mips64/mips64/clock.c b/sys/arch/mips64/mips64/clock.c
index e7c9ed03dea..b936920b2ea 100644
--- a/sys/arch/mips64/mips64/clock.c
+++ b/sys/arch/mips64/mips64/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: clock.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -134,7 +134,7 @@ clock_int5_init(struct clock_softc *sc)
int s;
s = splclock();
- cpu_counter_interval = sys_config.cpu.clock / (hz * 2);
+ cpu_counter_interval = sys_config.cpu[0].clock / (hz * 2);
cpu_counter_last = cp0_get_count() + cpu_counter_interval * 4;
cp0_set_compare(cpu_counter_last);
splx(s);
@@ -201,7 +201,7 @@ delay(int n)
int p, c;
p = cp0_get_count();
- dly = (sys_config.cpu.clock / 1000000) * n / 2;
+ dly = (sys_config.cpu[0].clock / 1000000) * n / 2;
while (dly > 0) {
c = cp0_get_count();
dly -= c - p;
@@ -219,7 +219,7 @@ nanodelay(int n)
int p, c;
p = cp0_get_count();
- dly = ((sys_config.cpu.clock * n) / 1000000000) / 2;
+ dly = ((sys_config.cpu[0].clock * n) / 1000000000) / 2;
while (dly > 0) {
c = cp0_get_count();
dly -= c - p;
diff --git a/sys/arch/mips64/mips64/context.S b/sys/arch/mips64/mips64/context.S
index dd84d71fbfb..fdb0b4b7a18 100644
--- a/sys/arch/mips64/mips64/context.S
+++ b/sys/arch/mips64/mips64/context.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: context.S,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: context.S,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/mips64/cp0access.S b/sys/arch/mips64/mips64/cp0access.S
index 5e2d226e342..d789cf1a9e3 100644
--- a/sys/arch/mips64/mips64/cp0access.S
+++ b/sys/arch/mips64/mips64/cp0access.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp0access.S,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: cp0access.S,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -171,6 +166,12 @@ LEAF(setsr)
move v0, a0
END(setsr)
+LEAF(cp0_get_prid)
+ mfc0 v0, COP_0_PRID
+ j ra
+ nop
+END(cp0_get_prid)
+
LEAF(cp0_get_count)
mfc0 v0, COP_0_COUNT
j ra
diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c
index cb7ebf5f4a1..5e4dad6af54 100644
--- a/sys/arch/mips64/mips64/cpu.c
+++ b/sys/arch/mips64/mips64/cpu.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: cpu.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: cpu.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
- * Copyright (c) 1997-2003 Opsycon AB (www.opsycon.se)
+ * Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -42,9 +37,8 @@
#include <machine/autoconf.h>
-/* Definition of the driver for autoconfig. */
-static int cpumatch(struct device *, void *, void *);
-static void cpuattach(struct device *, struct device *, void *);
+int cpumatch(struct device *, void *, void *);
+void cpuattach(struct device *, struct device *, void *);
int cpu_is_rm7k = 0;
@@ -55,31 +49,32 @@ struct cfdriver cpu_cd = {
NULL, "cpu", DV_DULL, NULL, 0
};
-static int
-cpumatch(parent, cfdata, aux)
- struct device *parent;
- void *cfdata;
- void *aux;
+int
+cpumatch(struct device *parent, void *match, void *aux)
{
+ struct cfdata *cf = match;
struct confargs *ca = aux;
/* make sure that we're looking for a CPU. */
if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
- return (0);
+ return 0;
+ if (cf->cf_unit >= MAX_CPUS)
+ return 0;
- return (20); /* Make CPU probe first */
+ return 20; /* Make CPU probe first */
}
-static void
+void
cpuattach(parent, dev, aux)
struct device *parent;
struct device *dev;
void *aux;
{
+ int cpuno = dev->dv_unit;
printf(": ");
- switch(sys_config.cpu.type) {
+ switch(sys_config.cpu[cpuno].type) {
case MIPS_R4000:
if(CpuPrimaryInstCacheSize == 16384)
@@ -112,7 +107,7 @@ cpuattach(parent, dev, aux)
printf("PMC-Sierra RM52X0 CPU");
break;
case MIPS_RM7000:
- if(sys_config.cpu.vers_maj < 2) {
+ if(sys_config.cpu[cpuno].vers_maj < 2) {
printf("PMC-Sierra RM7000 CPU");
}
else {
@@ -124,13 +119,14 @@ cpuattach(parent, dev, aux)
printf("PMC-Sierra RM9000 CPU");
break;
default:
- printf("Unknown CPU type (0x%x)",sys_config.cpu.type);
+ printf("Unknown CPU type (0x%x)",sys_config.cpu[cpuno].type);
break;
}
- printf(" Rev. %d.%d with ", sys_config.cpu.vers_maj, sys_config.cpu.vers_min);
+ printf(" Rev. %d.%d with ", sys_config.cpu[cpuno].vers_maj,
+ sys_config.cpu[cpuno].vers_min);
- switch(fpu_id.cpu.cp_imp) {
+ switch(sys_config.cpu[cpuno].fptype) {
case MIPS_SOFT:
printf("Software emulation float");
@@ -164,14 +160,14 @@ cpuattach(parent, dev, aux)
break;
case MIPS_UNKF1:
default:
- printf("Unknown FPU type (0x%x)", fpu_id.cpu.cp_imp);
+ printf("Unknown FPU type (0x%x)", sys_config.cpu[cpuno].fptype);
break;
}
- printf(" Rev. %d.%d", fpu_id.cpu.cp_majrev, fpu_id.cpu.cp_minrev);
+ printf(" Rev. %d.%d", sys_config.cpu[cpuno].fpvers_maj,
+ sys_config.cpu[cpuno].fpvers_min);
printf("\n");
- printf(" CPU clock %dMhz\n",sys_config.cpu.clock/1000000);
- printf(" L1 Cache: I size %dkb(%d line),",
+ printf("cpu%d: L1 Cache: I size %dkb(%d line),", cpuno,
CpuPrimaryInstCacheSize / 1024,
CpuPrimaryInstCacheLSize);
printf(" D size %dkb(%d line), ",
@@ -189,53 +185,55 @@ cpuattach(parent, dev, aux)
break;
}
if(CpuSecondaryCacheSize != 0) {
- switch(fpu_id.cpu.cp_imp) {
+ switch(sys_config.cpu[cpuno].type) {
case MIPS_RM7000:
- printf(" L2 Cache: Size %dkb, four way\n",
- CpuSecondaryCacheSize / 1024);
+ case MIPS_RM9000:
+ printf("cpu%d: L2 Cache: Size %dkb, four way\n",
+ cpuno, CpuSecondaryCacheSize / 1024);
break;
default:
- printf(" L2 Cache: Size %dkb, direct mapped\n",
- CpuSecondaryCacheSize / 1024);
+ printf("cpu%d: L2 Cache: Size %dkb, direct mapped\n",
+ cpuno, CpuSecondaryCacheSize / 1024);
break;
}
}
if(CpuTertiaryCacheSize != 0) {
- printf(" L3 Cache: Size %dkb, direct mapped\n",
- CpuTertiaryCacheSize / 1024);
+ printf("cpu%d: L3 Cache: Size %dkb, direct mapped\n",
+ cpuno, CpuTertiaryCacheSize / 1024);
}
#ifdef DEBUG
- printf("\tSetsize %d:%d\n", CpuPrimaryInstSetSize, CpuPrimaryDataSetSize);
- printf("\tAlias mask 0x%x\n", CpuCacheAliasMask);
- printf("\tConfig Register %x\n",CpuConfigRegister);
- printf("\tCache type %x\n", CpuCacheType);
- if(fpu_id.cpu.cp_imp == MIPS_RM7000) {
+ printf("cpu%d: Setsize %d:%d\n", cpuno,
+ CpuPrimaryInstSetSize, CpuPrimaryDataSetSize);
+ printf("cpu%d: Alias mask 0x%x\n", cpuno, CpuCacheAliasMask);
+ printf("cpu%d: Config Register %x\n", cpuno, CpuConfigRegister);
+ printf("cpu%d: Cache type %x\n", cpuno, CpuCacheType);
+ if(fpu_id.cpu[cpuno].cp_imp == MIPS_RM7000) {
u_int tmp;
tmp = CpuConfigRegister;
- printf("\t\t\t");
+ printf("cpu%d: ", cpuno);
printf("K0 = %1d ",0x7 & tmp);
printf("SE = %1d ",0x1 & (tmp>>3));
printf("DB = %1d ",0x1 & (tmp>>4));
printf("IB = %1d\n",0x1 & (tmp>>5));
- printf("\t\t\t");
+ printf("cpu%d: ", cpuno);
printf("DC = %1d ",0x7 & (tmp>>6));
printf("IC = %1d ",0x7 & (tmp>>9));
printf("TE = %1d ",0x1 & (tmp>>12));
printf("EB = %1d\n",0x1 & (tmp>>13));
- printf("\t\t\t");
+ printf("cpu%d: ", cpuno);
printf("EM = %1d ",0x1 & (tmp>>14));
printf("BE = %1d ",0x1 & (tmp>>15));
printf("TC = %1d ",0x1 & (tmp>>17));
printf("EW = %1d\n",0x3 & (tmp>>18));
- printf("\t\t\t");
+ printf("cpu%d: ", cpuno);
printf("TS = %1d ",0x3 & (tmp>>20));
printf("EP = %1d ",0xf & (tmp>>24));
printf("EC = %1d ",0x7 & (tmp>>28));
printf("SC = %1d\n",0x1 & (tmp>>31));
}
- printf("\tStatus Register %x\n",CpuStatusRegister);
+ printf("cpu%d: Status Register %x\n", cpuno, CpuStatusRegister);
#endif
}
diff --git a/sys/arch/mips64/mips64/cpu_ecoff.c b/sys/arch/mips64/mips64/cpu_ecoff.c
deleted file mode 100644
index b9731837fca..00000000000
--- a/sys/arch/mips64/mips64/cpu_ecoff.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $OpenBSD: cpu_ecoff.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by Ralph
- * Campbell.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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
- * 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.
- *
- * @(#)machdep.c 8.3 (Berkeley) 1/12/94
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/vnode.h>
-#include <sys/exec.h>
-#include <sys/resourcevar.h>
-
-#include <machine/frame.h>
-
-#if defined(_KERN_DO_ECOFF)
-#include <sys/exec_ecoff.h>
-
-void cpu_exec_ecoff_setregs __P((struct proc *, struct exec_package *,
- u_long, register_t *));
-void
-cpu_exec_ecoff_setregs(p, pack, stack, retval)
- struct proc *p;
- struct exec_package *pack;
- u_long stack;
- register_t *retval;
-{
- struct ecoff_aouthdr *eap;
-
- setregs(p, pack, stack, retval);
- eap = (struct ecoff_aouthdr *)
- ((caddr_t)pack->ep_hdr + sizeof(struct ecoff_filehdr));
-#if defined(pmax)
- p->p_md.md_regs[GP] = eap->ea_gp_value;
-#else
- p->p_md.md_regs->gp = eap->ea_gp_value;
-#endif
-}
-
-/*
- * cpu_exec_ecoff_hook():
- * cpu-dependent ECOFF format hook for execve().
- *
- * Do any machine-dependent diddling of the exec package when doing ECOFF.
- *
- */
-int
-cpu_exec_ecoff_hook(p, epp)
- struct proc *p;
- struct exec_package *epp;
-{
-#ifdef COMPAT_ULTRIX
- extern struct emul emul_ultrix;
-
- epp->ep_emul = &emul_ultrix;
-#endif
- return 0;
-}
-
-#endif /* _KERN_DO_ECOFF */
diff --git a/sys/arch/mips64/mips64/db_machdep.c b/sys/arch/mips64/mips64/db_machdep.c
index da13380f195..335ed736796 100644
--- a/sys/arch/mips64/mips64/db_machdep.c
+++ b/sys/arch/mips64/mips64/db_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: db_machdep.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -573,10 +568,10 @@ char *attr[] = {
if(have_addr && addr < 256) {
pid = addr;
tlbno = 0;
- count = sys_config.cpu.tlbsize;
+ count = sys_config.cpu[0].tlbsize;
}
} else if (m[0] == 'c') {
- last = sys_config.cpu.tlbsize;
+ last = sys_config.cpu[0].tlbsize;
for (tlbno = 0; tlbno < last; tlbno++) {
tlb_read(tlbno, &tlb);
for (check = tlbno + 1; check < last; check++) {
@@ -592,17 +587,17 @@ if ((tlbp.tlb_hi == tlb.tlb_hi && (tlb.tlb_lo0 & PG_V || tlb.tlb_lo1 & PG_V)) ||
}
return;
} else {
- if(have_addr && addr < sys_config.cpu.tlbsize) {
+ if(have_addr && addr < sys_config.cpu[0].tlbsize) {
tlbno = addr;
}
else {
tlbno = 0;
- count = sys_config.cpu.tlbsize;
+ count = sys_config.cpu[0].tlbsize;
}
}
last = tlbno + count;
- for (; tlbno < sys_config.cpu.tlbsize && tlbno < last; tlbno++) {
+ for (; tlbno < sys_config.cpu[0].tlbsize && tlbno < last; tlbno++) {
tlb_read(tlbno, &tlb);
if (pid >= 0 && (tlb.tlb_hi & 0xff) != pid)
diff --git a/sys/arch/mips64/mips64/exception.S b/sys/arch/mips64/mips64/exception.S
index 61d20a8fba7..cd61b7ac8de 100644
--- a/sys/arch/mips64/mips64/exception.S
+++ b/sys/arch/mips64/mips64/exception.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: exception.S,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: exception.S,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2002-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -142,7 +137,7 @@ u_exception_table:
.globl exception
exception:
.set noat
-#if 0
+#ifdef TLB_TRACE
dmfc0 k0, COP_0_EXC_PC
PTR_L k1, tlbtrcptr
PTR_S k0, 0(k1)
diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c
index 9a47f98d504..b2d3ba6ae87 100644
--- a/sys/arch/mips64/mips64/interrupt.c
+++ b/sys/arch/mips64/mips64/interrupt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interrupt.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: interrupt.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/mips64/lcore_access.S b/sys/arch/mips64/mips64/lcore_access.S
index 05c4df8e454..84b3497b103 100644
--- a/sys/arch/mips64/mips64/lcore_access.S
+++ b/sys/arch/mips64/mips64/lcore_access.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcore_access.S,v 1.2 2004/08/08 14:21:27 pefo Exp $ */
+/* $OpenBSD: lcore_access.S,v 1.3 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/mips64/lcore_ddb.S b/sys/arch/mips64/mips64/lcore_ddb.S
index 45241f13a48..090bdf9add9 100644
--- a/sys/arch/mips64/mips64/lcore_ddb.S
+++ b/sys/arch/mips64/mips64/lcore_ddb.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcore_ddb.S,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: lcore_ddb.S,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/mips64/lcore_float.S b/sys/arch/mips64/mips64/lcore_float.S
index d9f03e7cd51..2a639ef91c4 100644
--- a/sys/arch/mips64/mips64/lcore_float.S
+++ b/sys/arch/mips64/mips64/lcore_float.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcore_float.S,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: lcore_float.S,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -517,3 +512,37 @@ FPReturn:
j ra
PTR_ADDU sp, sp, FRAMESZ(CF_SZ)
END(MipsFPTrap)
+
+/*----------------------------------------------------------------------------
+ *
+ * cp1_get_prid
+ *
+ * Get the floating point co-processor id.
+ *
+ * cp1_get_prid(void)
+ *
+ * Results:
+ * FPC_ID
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------------
+ */
+LEAF(cp1_get_prid)
+ mfc0 v1, COP_0_STATUS_REG
+ li a0, SR_COP_1_BIT
+ or v1, a0
+ mtc0 v1, COP_0_STATUS_REG
+ nop
+ nop
+ nop
+ nop
+ cfc1 v0, FPC_ID
+ xor v1, a0
+ mtc0 v1, COP_0_STATUS_REG
+ ITLBNOPFIX
+ jr ra
+ nop
+END(cp1_get_prid)
+
diff --git a/sys/arch/mips64/mips64/mainbus.c b/sys/arch/mips64/mips64/mainbus.c
index 02e4841e2cc..f9e21face6d 100644
--- a/sys/arch/mips64/mips64/mainbus.c
+++ b/sys/arch/mips64/mips64/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: mainbus.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/mips64/mem.c b/sys/arch/mips64/mips64/mem.c
index 47320f2fdc6..7508e4b524b 100644
--- a/sys/arch/mips64/mips64/mem.c
+++ b/sys/arch/mips64/mips64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: mem.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */
/*
@@ -65,7 +65,6 @@
static int ap_open_count = 0;
extern int allowaperture;
#endif
-extern vaddr_t avail_end;
caddr_t zeropage;
#define mmread mmrw
@@ -155,11 +154,8 @@ mmrw(dev, uio, flags)
c = min(iov->iov_len, MAXPHYS);
if (v < KSEG0_BASE)
return (EFAULT);
- if (v + c > PHYS_TO_KSEG0(avail_end +
- sizeof (struct msgbuf)) &&
- (v < VM_MIN_KERNEL_ADDRESS ||
- !uvm_kernacc((caddr_t)v, c,
- uio->uio_rw == UIO_READ ? B_READ : B_WRITE)))
+ if (!uvm_kernacc((caddr_t)v, c,
+ uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
error = uiomove((caddr_t)v, c, uio);
diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c
index c522ffad4c1..b22fd69ef8f 100644
--- a/sys/arch/mips64/mips64/pmap.c
+++ b/sys/arch/mips64/mips64/pmap.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: pmap.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: pmap.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
- * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
+ * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -11,11 +11,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -191,7 +186,7 @@ pmap_bootstrap()
*/
i = 0;
for( n = 0; n < MAXMEMSEGS; n++) {
- i += mem_layout[n].mem_size;
+ i += mem_layout[n].mem_last_page - mem_layout[n].mem_first_page + 1;
}
pv_table = (struct pv_entry *)uvm_pageboot_alloc(sizeof(struct pv_entry) * i);
@@ -1491,7 +1486,7 @@ pmap_alloc_tlbpid(p)
if (pmap->pm_tlbgen != tlbpid_gen) {
id = tlbpid_cnt;
if (id >= VMNUM_PIDS) {
- tlb_flush(sys_config.cpu.tlbsize);
+ tlb_flush(sys_config.cpu[0].tlbsize);
/* reserve tlbpid_gen == 0 to alway mean invalid */
if (++tlbpid_gen == 0)
tlbpid_gen = 1;
diff --git a/sys/arch/mips64/mips64/sendsig.c b/sys/arch/mips64/mips64/sendsig.c
index 01442baf648..b026cfa3103 100644
--- a/sys/arch/mips64/mips64/sendsig.c
+++ b/sys/arch/mips64/mips64/sendsig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendsig.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: sendsig.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -47,11 +47,6 @@
* 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 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
diff --git a/sys/arch/mips64/mips64/tlbhandler.S b/sys/arch/mips64/mips64/tlbhandler.S
index cd7ef33e076..e96e69d6e5f 100644
--- a/sys/arch/mips64/mips64/tlbhandler.S
+++ b/sys/arch/mips64/mips64/tlbhandler.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlbhandler.S,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: tlbhandler.S,v 1.2 2004/08/09 14:57:26 pefo Exp $ */
/*
* Copyright (c) 1995-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -59,7 +59,7 @@
.globl tlb_miss /* 0xffffffff80000000 */
.set noat
tlb_miss:
-#if 0
+#ifdef TLB_TRACE
dmfc0 k0, COP_0_EXC_PC
PTR_L k1, tlbtrcptr
PTR_S k0, 0(k1)