From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 12 09:11:58 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B093106564A for ; Mon, 12 Sep 2011 09:11:58 +0000 (UTC) (envelope-from filippo.sironi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id CCB998FC08 for ; Mon, 12 Sep 2011 09:11:57 +0000 (UTC) Received: by wyh15 with SMTP id 15so4218853wyh.13 for ; Mon, 12 Sep 2011 02:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=v3/gVopqB+Fua3W+r7SGt/gcfq6uY3xvfc07UmZUmDc=; b=hHfID4Oki0NSufYpgPw10Q3uLhfbNRUQFU5r/OdWfmnJfbOKebfach8xIATTPKlJ0Z ivLuXUTdk8fjpn/EKCXpsgt4mSPB8RHnsxvad/Xtvf9fpJvmVB3PRJuSbaW2BOiRL/x4 PzuBOARoQiO5Ewd1BfRiPmK0+geUA7RHdmnY0= Received: by 10.227.209.21 with SMTP id ge21mr3009362wbb.42.1315816965264; Mon, 12 Sep 2011 01:42:45 -0700 (PDT) Received: from filippo.sironi.dynamic.micro.elet.polimi.it (micro.elet.polimi.it [131.175.127.118]) by mx.google.com with ESMTPS id fa7sm15442107wbb.26.2011.09.12.01.42.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Sep 2011 01:42:44 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=us-ascii From: Filippo Sironi In-Reply-To: <023BD0FF-053C-4DCB-81EA-5D69B2411819@gmail.com> Date: Mon, 12 Sep 2011 10:42:40 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <023BD0FF-053C-4DCB-81EA-5D69B2411819@gmail.com> To: Riccardo Cattaneo X-Mailer: Apple Mail (2.1244.3) Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel timers infrastructure X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2011 09:11:58 -0000 This is what I wrote for FreeBSD 7.2 and it does not work: = --------------------------------------------------------------------------= ------ #include #include #include #include static struct callout timer_callout; static void timer_function(void *arg) { if (callout_reset(&timer_callout, hz, timer_function, NULL)) uprintf("callout_reset() !=3D 0\n"); uprintf("Hello, World!\n"); } static int timer_event_handler(struct module *mod, int cmd, void *arg) { switch (cmd) { case MOD_LOAD: callout_init(&timer_callout, CALLOUT_MPSAFE); if (callout_reset(&timer_callout, hz, timer_function, = NULL)) uprintf("callout_reset() !=3D 0\n"); break; case MOD_UNLOAD: callout_drain(&timer_callout); break; case MOD_SHUTDOWN: break; default: return EOPNOTSUPP; } return 0; } static struct moduledata timer_moduledata =3D { "timer", timer_event_handler, NULL }; DECLARE_MODULE(timer, timer_moduledata, SI_SUB_DRIVERS, = SI_ORDER_MIDDLE); = --------------------------------------------------------------------------= ------ but I do not know why... I basically run through many different examples I found within the = kernel and they are not different from this module. Does anyone see any clear issue? Filippo On 10/set/2011, at 19:39, Riccardo Cattaneo wrote: > Hi all, > Me in the same situation: university project, freebsd os, required to = call a certain function X times/second (say, uprintf). > Got no luck till now :( > Thanks > Riccardo_______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to = "freebsd-hackers-unsubscribe@freebsd.org"