Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sgimips Sprinkle some #ifdef MIPS3 to be able to co...
details: https://anonhg.NetBSD.org/src/rev/17abe15f874c
branches: trunk
changeset: 559892:17abe15f874c
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Mar 25 15:06:37 2004 +0000
description:
Sprinkle some #ifdef MIPS3 to be able to compile the port without
including MIPS3 code.
for upcoming IP12
diffstat:
sys/arch/sgimips/dev/int.c | 17 ++++++++++++-----
sys/arch/sgimips/sgimips/bus.c | 6 ++++--
sys/arch/sgimips/sgimips/clock.c | 32 +++++++++++++++++++++-----------
sys/arch/sgimips/sgimips/machdep.c | 6 ++++--
4 files changed, 41 insertions(+), 20 deletions(-)
diffs (223 lines):
diff -r 22a73d20dad8 -r 17abe15f874c sys/arch/sgimips/dev/int.c
--- a/sys/arch/sgimips/dev/int.c Thu Mar 25 15:01:22 2004 +0000
+++ b/sys/arch/sgimips/dev/int.c Thu Mar 25 15:06:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: int.c,v 1.3 2004/03/09 14:05:09 sekiya Exp $ */
+/* $NetBSD: int.c,v 1.4 2004/03/25 15:06:37 pooka Exp $ */
/*
* Copyright (c) 2004 Christopher SEKIYA
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.3 2004/03/09 14:05:09 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.4 2004/03/25 15:06:37 pooka Exp $");
#include "opt_cputype.h"
@@ -87,9 +87,6 @@
static void
int_attach(struct device *parent, struct device *self, void *aux)
{
- int i;
- unsigned long cps;
- unsigned long ctrdiff[3];
u_int32_t address;
if (mach_type == MACH_SGI_IP12)
@@ -125,8 +122,14 @@
platform.intr2 = int_local1_intr;
int_8254_cal();
break;
+#ifdef MIPS3
case MACH_SGI_IP20:
case MACH_SGI_IP22:
+ {
+ int i;
+ unsigned long cps;
+ unsigned long ctrdiff[3];
+
platform.intr0 = int_local0_intr;
platform.intr1 = int_local1_intr;
@@ -148,6 +151,8 @@
/* R4k/R4400/R4600/R5k count at half CPU frequency */
curcpu()->ci_cpu_freq = 2 * cps * hz;
+ }
+#endif /* MIPS3 */
break;
default:
@@ -302,6 +307,7 @@
return (void *)NULL;
}
+#ifdef MIPS3
unsigned long
int_cal_timer(void)
{
@@ -346,6 +352,7 @@
return (endctr - startctr) / roundtime * roundtime;
}
+#endif /* MIPS3 */
void
int_8254_cal(void)
diff -r 22a73d20dad8 -r 17abe15f874c sys/arch/sgimips/sgimips/bus.c
--- a/sys/arch/sgimips/sgimips/bus.c Thu Mar 25 15:01:22 2004 +0000
+++ b/sys/arch/sgimips/sgimips/bus.c Thu Mar 25 15:06:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.c,v 1.27 2004/01/18 04:06:43 sekiya Exp $ */
+/* $NetBSD: bus.c,v 1.28 2004/03/25 15:06:37 pooka Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.27 2004/01/18 04:06:43 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.28 2004/03/25 15:06:37 pooka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -249,6 +249,7 @@
}
}
+#ifdef MIPS3
u_int64_t
bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t o)
{
@@ -288,6 +289,7 @@
break;
}
}
+#endif /* MIPS3 */
int
bus_space_map(t, bpa, size, flags, bshp)
diff -r 22a73d20dad8 -r 17abe15f874c sys/arch/sgimips/sgimips/clock.c
--- a/sys/arch/sgimips/sgimips/clock.c Thu Mar 25 15:01:22 2004 +0000
+++ b/sys/arch/sgimips/sgimips/clock.c Thu Mar 25 15:06:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.11 2004/01/19 03:26:14 sekiya Exp $ */
+/* $NetBSD: clock.c,v 1.12 2004/03/25 15:06:37 pooka Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.11 2004/01/19 03:26:14 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.12 2004/03/25 15:06:37 pooka Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -151,11 +151,14 @@
void
cpu_initclocks()
{
+
if (clockfns == NULL)
panic("cpu_initclocks: clock device not attached");
+#ifdef MIPS3
if (mach_type != MACH_SGI_IP12) {
- next_clk_intr = mips3_cp0_count_read() + curcpu()->ci_cycles_per_hz;
+ next_clk_intr = mips3_cp0_count_read()
+ + curcpu()->ci_cycles_per_hz;
mips3_cp0_compare_write(next_clk_intr);
/* number of microseconds between interrupts */
@@ -169,6 +172,7 @@
tickfixinterval = hz >> (ftp - 1);
}
}
+#endif /* MIPS3 */
(*clockfns->cf_init)(clockdev);
}
@@ -256,13 +260,24 @@
}
void
-mips1_clock_intr(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t ipending)
+mips1_clock_intr(u_int32_t status, u_int32_t cause, u_int32_t pc,
+ u_int32_t ipending)
{
+
return;
}
+unsigned long
+mips1_clkread(void)
+{
+
+ return 0;
+}
+
+#ifdef MIPS3
void
-mips3_clock_intr(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t ipending)
+mips3_clock_intr(u_int32_t status, u_int32_t cause, u_int32_t pc,
+ u_int32_t ipending)
{
u_int32_t newcnt;
struct clockframe cf;
@@ -291,12 +306,6 @@
}
unsigned long
-mips1_clkread(void)
-{
- return 0;
-}
-
-unsigned long
mips3_clkread(void)
{
uint32_t res, count;
@@ -305,3 +314,4 @@
MIPS_COUNT_TO_MHZ(curcpu(), count, res);
return (res);
}
+#endif /* MIPS3 */
diff -r 22a73d20dad8 -r 17abe15f874c sys/arch/sgimips/sgimips/machdep.c
--- a/sys/arch/sgimips/sgimips/machdep.c Thu Mar 25 15:01:22 2004 +0000
+++ b/sys/arch/sgimips/sgimips/machdep.c Thu Mar 25 15:06:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.80 2004/03/06 07:50:56 sekiya Exp $ */
+/* $NetBSD: machdep.c,v 1.81 2004/03/25 15:06:37 pooka Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.80 2004/03/06 07:50:56 sekiya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.81 2004/03/25 15:06:37 pooka Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -404,6 +404,7 @@
platform.intr3 = mips1_clock_intr;
platform.clkread = mips1_clkread;
break;
+#ifdef MIPS3
case MACH_SGI_IP20:
i = *(volatile u_int32_t *)MIPS_PHYS_TO_KSEG1(0x1fbd0000);
mach_boardrev = (i & 0x7000) >> 12;
@@ -431,6 +432,7 @@
platform.intr5 = mips3_clock_intr;
platform.clkread = mips3_clkread;
break;
+#endif /* MIPS3 */
default:
panic("IP%d architecture not supported", mach_type);
break;
Home |
Main Index |
Thread Index |
Old Index