Sprinkle some #ifdef MIPS3 to be able to compile the port without

including MIPS3 code.

for upcoming IP12
This commit is contained in:
pooka 2004-03-25 15:06:37 +00:00
parent 5e196359ff
commit 39a22bd417
4 changed files with 41 additions and 20 deletions

View File

@ -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 @@ int_match(struct device *parent, struct cfdata *match, void *aux)
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 @@ int_attach(struct device *parent, struct device *self, void *aux)
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 @@ int_attach(struct device *parent, struct device *self, void *aux)
/* R4k/R4400/R4600/R5k count at half CPU frequency */
curcpu()->ci_cpu_freq = 2 * cps * hz;
}
#endif /* MIPS3 */
break;
default:
@ -302,6 +307,7 @@ int_intr_establish(int level, int ipl, int (*handler) (void *), void *arg)
return (void *)NULL;
}
#ifdef MIPS3
unsigned long
int_cal_timer(void)
{
@ -346,6 +352,7 @@ int_cal_timer(void)
return (endctr - startctr) / roundtime * roundtime;
}
#endif /* MIPS3 */
void
int_8254_cal(void)

View File

@ -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 @@ bus_space_write_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t o, u_i
}
}
#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 @@ bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t o, u_i
break;
}
}
#endif /* MIPS3 */
int
bus_space_map(t, bpa, size, flags, bshp)

View File

@ -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 @@ setstatclockrate(int newhz)
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 @@ cpu_initclocks()
tickfixinterval = hz >> (ftp - 1);
}
}
#endif /* MIPS3 */
(*clockfns->cf_init)(clockdev);
}
@ -256,13 +260,24 @@ resettodr()
}
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;
@ -290,12 +305,6 @@ mips3_clock_intr(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t ipen
hardclock(&cf);
}
unsigned long
mips1_clkread(void)
{
return 0;
}
unsigned long
mips3_clkread(void)
{
@ -305,3 +314,4 @@ mips3_clkread(void)
MIPS_COUNT_TO_MHZ(curcpu(), count, res);
return (res);
}
#endif /* MIPS3 */

View File

@ -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 @@ mach_init(int argc, char **argv, int magic, struct btinfo_common *btinfo)
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 @@ mach_init(int argc, char **argv, int magic, struct btinfo_common *btinfo)
platform.intr5 = mips3_clock_intr;
platform.clkread = mips3_clkread;
break;
#endif /* MIPS3 */
default:
panic("IP%d architecture not supported", mach_type);
break;