From owner-freebsd-arch@FreeBSD.ORG Mon May 24 16:33:15 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 334721065674; Mon, 24 May 2010 16:33:15 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4635D8FC15; Mon, 24 May 2010 16:33:13 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA04759; Mon, 24 May 2010 19:33:12 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OGaaW-000C0m-I4; Mon, 24 May 2010 19:33:12 +0300 Message-ID: <4BFAAA47.5060802@freebsd.org> Date: Mon, 24 May 2010 19:33:11 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: Alexander Motin References: <4BFAA1F3.1070206@FreeBSD.org> In-Reply-To: <4BFAA1F3.1070206@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org Subject: Re: Event timers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 16:33:15 -0000 on 24/05/2010 18:57 Alexander Motin said the following: > I have defined several points on that way: > 1*. clean low-level timer drivers from unrelated stuff, > 2*. make some common code machine-independent, > 3. write common driver API for event timers (alike to one we have now > for time counters) to make adding more drivers possible, > 4. add support for HPET as event timer in addition to time counter, > 5. add support for timers in one-shot mode (LAPIC and HPET). Alexander, I wonder how much you have progressed for 3,4,5. I have some low level code for 4. Some additional things that could be useful: a. It would be nice to replace special handling of NULL as interrupt arg with something more convenient. Right now if interrupt arg is NULL then a pointer to an interrupted frame is passed to interrupt handler. This is used by clock interrupt handlers. It would be good to be able to pass both frame pointer and some context to handler. jhb suggested that frame pointer could be passed via struct thread. b. On some x86 systems it is possible to broadcast APIC interrupts to all CPUs by using broadcast ID (0xFF) instead of a specific CPU ID. This could be used to avoid IPI overhead. I have some code for b. -- Andriy Gapon