From owner-p4-projects@FreeBSD.ORG Thu Jan 3 04:03:37 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 21C8516A41B; Thu, 3 Jan 2008 04:03:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB24216A419 for ; Thu, 3 Jan 2008 04:03:36 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CABC913C442 for ; Thu, 3 Jan 2008 04:03:36 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0343aW0050421 for ; Thu, 3 Jan 2008 04:03:36 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0343a1k050417 for perforce@freebsd.org; Thu, 3 Jan 2008 04:03:36 GMT (envelope-from imp@freebsd.org) Date: Thu, 3 Jan 2008 04:03:36 GMT Message-Id: <200801030403.m0343a1k050417@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 132367 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 04:03:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=132367 Change 132367 by imp@imp_paco-paco on 2008/01/03 04:03:01 Adjust mips2-based tick.c to the reality of the jnpr underpinnings. Add expected defines in clock.h, although they may ultimately be lame. Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/include/clock.h#5 edit .. //depot/projects/mips2-jnpr/src/sys/mips/mips/tick.c#2 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/include/clock.h#5 (text+ko) ==== @@ -32,6 +32,22 @@ extern intrmask_t clockintr(intrmask_t, struct clockframe *); +#define wall_cmos_clock 0 +#define adjkerntz 0 + +/* + * Default is to assume a CPU pipeline clock of 100Mhz, and + * that CP0_COUNT increments every 2 cycles. + */ +#define MIPS_DEFAULT_HZ (100 * 1000 * 1000) + +void tick_init_params(uint64_t, int); +void tick_init(void); +int sysbeep(int pitch, int period); + +extern uint64_t counter_freq; +extern int clocks_running; + #endif #endif /* !_MACHINE_CLOCK_H_ */ ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/tick.c#2 (text+ko) ==== @@ -196,10 +196,11 @@ /* * Magic. Setting up with an arg of NULL means we get passed tf. + * XXX this comment and the code don't match. */ tf = arg; - usermode = tf->tf_regs[TF_SR] & MIPS_SR_KSU_USER; - pc = tf->tf_regs[TF_EPC]; + usermode = tf->sr & MIPS_SR_KSU_USER; + pc = tf->pc; if (clocks_running) { hardclock(usermode, pc);