From owner-svn-src-all@FreeBSD.ORG Sun May 3 02:37:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F151065670; Sun, 3 May 2009 02:37:13 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1ED78FC14; Sun, 3 May 2009 02:37:13 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n432bDSj001880; Sun, 3 May 2009 02:37:13 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n432bD2x001879; Sun, 3 May 2009 02:37:13 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200905030237.n432bD2x001879@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 3 May 2009 02:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191761 - head/sys/pc98/cbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2009 02:37:14 -0000 Author: nyan Date: Sun May 3 02:37:13 2009 New Revision: 191761 URL: http://svn.freebsd.org/changeset/base/191761 Log: MFi386: revision 191745 Add support for using i8254 and rtc timers as event sources for i386 SMP system. Redistribute hard-/stat-/profclock events to other CPUs using IPI. Modified: head/sys/pc98/cbus/clock.c Modified: head/sys/pc98/cbus/clock.c ============================================================================== --- head/sys/pc98/cbus/clock.c Sat May 2 22:30:33 2009 (r191760) +++ head/sys/pc98/cbus/clock.c Sun May 3 02:37:13 2009 (r191761) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -71,6 +72,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include #ifdef DEV_ISA @@ -123,6 +125,31 @@ static struct timecounter i8254_timecoun 0 /* quality */ }; +int +hardclockintr(struct trapframe *frame) +{ + + if (PCPU_GET(cpuid) == 0) + hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + else + hardclock_cpu(TRAPF_USERMODE(frame)); + return (FILTER_HANDLED); +} + +int +statclockintr(struct trapframe *frame) +{ + + return (FILTER_HANDLED); +} + +int +profclockintr(struct trapframe *frame) +{ + + return (FILTER_HANDLED); +} + static int clkintr(struct trapframe *frame) { @@ -151,7 +178,14 @@ clkintr(struct trapframe *frame) (*lapic_cyclic_clock_func[cpu])(frame); #endif - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); +#ifdef SMP + if (smp_started) + ipi_all_but_self(IPI_HARDCLOCK); +#endif + if (PCPU_GET(cpuid) == 0) + hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + else + hardclock_cpu(TRAPF_USERMODE(frame)); return (FILTER_HANDLED); }