From owner-freebsd-drivers@FreeBSD.ORG Wed Sep 2 09:16:07 2009 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B43C106568D for ; Wed, 2 Sep 2009 09:16:07 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-fx0-f210.google.com (mail-fx0-f210.google.com [209.85.220.210]) by mx1.freebsd.org (Postfix) with ESMTP id BB8418FC0A for ; Wed, 2 Sep 2009 09:16:06 +0000 (UTC) Received: by fxm6 with SMTP id 6so619557fxm.43 for ; Wed, 02 Sep 2009 02:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=vhEHmK6qeEK6bT1a0zxt+gV1ToFKGxNotxFk0Aqf9Sc=; b=YOrlEiddB5juRiVGq2c6zaRZIJpiSPE7034FazrgTsmS4k1NgJ01rVYLGnmbvb6742 qgFwV1b3zjx7S/2EboUudUG6DWUyIxAxy1T0Rjf8k0Pa7NnSs+BPlXEX7VVvJBgM6kt2 0ftBVnW2T1mQSbNUS5lxELgLCt3TyWT47onIk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=LZJLASjfuGKx6Mowc2DoIJH7mGnhbI2mayOiIv3e6Ce6wVf73aCWTjmLvZA4tiD5dX eeDnM0HV7M4tuyzvX2sRRp3sz9vKnUR+KWk3lWyDAyWPsXq2aF6vPrgpMxjq8dU+Ip54 Ps4KJSGaY0SNlbtO8k4sKVIDIzlZXBSWcIzh4= MIME-Version: 1.0 Received: by 10.103.127.34 with SMTP id e34mr3457024mun.108.1251881717800; Wed, 02 Sep 2009 01:55:17 -0700 (PDT) In-Reply-To: <426bed110908191416q35cf8613ue912b741d6285f1c@mail.gmail.com> References: <426bed110908190616m21d39e9bm95a60f624b831418@mail.gmail.com> <20090819194426.3bf401d9@baby-jane.lamaiziere.net> <426bed110908191416q35cf8613ue912b741d6285f1c@mail.gmail.com> Date: Wed, 2 Sep 2009 08:55:17 +0000 Message-ID: <3a142e750909020155t584be8fck34596e715f4a466c@mail.gmail.com> From: "Paul B. Mahol" To: Rohit Grover Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-drivers@freebsd.org Subject: Re: introducing a FreeBSD driver for the Apple Touchpad; and a few questions.. X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2009 09:16:07 -0000 On 8/19/09, Rohit Grover wrote: > On Thu, Aug 20, 2009 at 1:44 AM, Patrick Lamaiziere > wrote: > >> Le Wed, 19 Aug 2009 21:16:06 +0800, >> Rohit Grover a =E9crit : >> >> > I have developed a driver for the Touchpad device on Apple Macbooks. >> > Mine is a Macbook 3,1, and I run FreeBSD7.2 >> >> Cool! Shall it work on a MacBookPro 3,1? > > > Please give it a try. The number of Y sensors on a MacBookPro might be > different. On my MacBook, I've got 20 X sensors and 10 Y sensors; but tha= t > is with a mouse-button at the bottom of the touch-sensitive area. The but= ton > has been replaced with additional touchpad surface in the MacBookPro. So = it > will require a bit of experimentation, and even some reverse-engineering. > The key to interpreting data from the device is atp_read_sensors(). That > might have to change to support newer models. > > If someone is willing to contribute with testing, I can create a version = of > the driver which logs additional detail to help us with the reverse > engineering. > > >> Do you plan a version to the new usb stack on 8.0? >> > > Certainly. I can't yet run 8.0 on my MacBook. ACPI panics the kernel righ= t > at the beginning of boot, and even if I disable ACPI, the kernel is still > unable to mount the root partition. I have tried compiling my driver agai= nst > 8.0, and I see that I will need to adapt to the new USB stack. I'm very k= een > on moving to 8.0 once it can boot on my laptop. I'd be happy to maintain > support for multiple versions of FreeBSD. > > >> >> > For my algorithms, I would like to allocate memory dynamically out of >> > a small pool of fixed sized structures. I have read a bit about UMA; >> > is UMA a good alternative for managing a small pool (~20) of buffers >> > (of around 20 bytes in size)? >> >> I'm not sure for this, IMHO UMA does not care about the size of the >> buffers, and malloc uses UMA for the allocation. >> > > But is UMA a very heavy-weight approach to managing a small pool of fixed > sized buffers whose total footprint is under 512 bytes? > > >> I've read a bit the source, you should not use spl on 7.x, they are >> no-ops. Instead use some mutexes. And you should not use the giant lock. >> > > Thanks for pointing this out. I will research the use of SMP primitives. = The > 'ums' driver, which is what I am replacing, also uses splx(). Could you t= ell > me which giant lock I am using in my code? Is there any documentation I c= an > refer to for SMP synchronization under FreeBSD? mutex(9) > regards, > Rohit. > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org= " > --=20 Paul