Date: Sat, 13 Mar 2004 00:36:07 -0800 (PST) From: Juli Mallett <jmallett@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 48875 for review Message-ID: <200403130836.i2D8a7r3054516@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=48875 Change 48875 by jmallett@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403130836.i2D8a7r3054516>