PERFORCE change 48875 for review
Juli Mallett
jmallett at FreeBSD.org
Sat Mar 13 00:36:08 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=48875
Change 48875 by jmallett at jmallett_oingo on 2004/03/13 00:35:23
Attempt to get some clock code here..
Affected files ...
.. //depot/projects/mips/sys/mips/sgimips/clock.c#4 edit
Differences ...
==== //depot/projects/mips/sys/mips/sgimips/clock.c#4 (text+ko) ====
@@ -28,10 +28,39 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/time.h>
+#include <sys/timetc.h>
+
+#include <machine/cpuinfo.h>
+#include <platform/models.h>
+static unsigned
+sgimips_get_timecount(struct timecounter *tc)
+{
+ return (mips_rd_count());
+}
+
+static struct timecounter sgimips_timecounter = {
+ sgimips_get_timecount,
+ NULL,
+ ~0,
+ 0,
+ "Uninitialized SGIMIPS",
+ 1000
+};
+
void
cpu_initclocks(void)
{
+ switch (mach_type) {
+ case MACH_SGI_IP22:
+ sgimips_timecounter.tc_frequency = curcpu()->ci_cpu_freq;
+ sgimips_timecounter.tc_name = "SGI IP22";
+ break;
+ default:
+ panic("cannot init clock for type %d", mach_type);
+ }
+ tc_init(&sgimips_timecounter);
+ mips_wr_status(mips_rd_status() | MIPS_SR_INT_IE | MIPS_INT_MASK_5);
}
void
More information about the p4-projects
mailing list