From owner-freebsd-hackers@FreeBSD.ORG Sun May 28 03:32:06 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E52FF16B158 for ; Sun, 28 May 2006 03:32:06 +0000 (UTC) (envelope-from fierykylin@gmail.com) Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3637C43D62 for ; Sun, 28 May 2006 03:32:03 +0000 (GMT) (envelope-from fierykylin@gmail.com) Received: by wx-out-0102.google.com with SMTP id i31so3812wxd for ; Sat, 27 May 2006 20:32:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=A23fc9bGLG1De821IxR+1+R2MQYjr83/0IGsURlEjPs05oVRJRWJubrWc/pqV02NB0Eb8oMn05JayvVKa1uLcZJTT+QMHkAs8ym+nDCREnszt2hGxmQmyProOfGnKPa8R71+b3QaohohQ5tereXV+JE4csfmggBxLEJjc05qlds= Received: by 10.70.92.19 with SMTP id p19mr1030426wxb; Sat, 27 May 2006 20:32:02 -0700 (PDT) Received: by 10.70.43.11 with HTTP; Sat, 27 May 2006 20:32:02 -0700 (PDT) Message-ID: <87ab37ab0605272032y700a910r74105c5b7eefe0f0@mail.gmail.com> Date: Sun, 28 May 2006 11:32:02 +0800 From: "william wallace" Sender: fierykylin@gmail.com To: "John-Mark Gurney" , "william wallace" , "Scott Long" , imp@bsdimp.com, "freebsd-hackers@freebsd.org" In-Reply-To: <20060524153153.GF49081@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <87ab37ab0605210108w127a235bue281428f52bbc784@mail.gmail.com> <20060521.114807.74702188.imp@bsdimp.com> <87ab37ab0605212328ue7c70fcu49c5fec8921ae229@mail.gmail.com> <20060522.005010.104089663.imp@bsdimp.com> <87ab37ab0605221816y6cca5387sc43fa1e1116f55cc@mail.gmail.com> <44729B81.8010909@samsco.org> <87ab37ab0605240048g224218a5s87cfe1b1ed5cc8c9@mail.gmail.com> <20060524075946.GE49081@funkthat.com> <87ab37ab0605240613n594c566q844b754043c2c10@mail.gmail.com> <20060524153153.GF49081@funkthat.com> X-Google-Sender-Auth: 4f40081e9a31d16f Cc: Subject: Re: misc questions about the device&driver arch 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: Sun, 28 May 2006 03:32:29 -0000 hi ,all I am porting something from linux to freebsd ,i found the DataTypes hard to translate ,then i saw that many types inlinux can be found in drm_os_freebsd.h,such as typedef int8_t s8; typedef int16_t s16; typedef int32_t s32; typedef u_int8_t u8; typedef u_int16_t u16; typedef u_int32_t u32; so ,what is the use of drm_os_freebsd.h and any advice for me to translate DT from linux to Freebsd? On 5/24/06, John-Mark Gurney wrote: > william wallace wrote this message on Wed, May 24, 2006 at 21:13 +0800: > > roger really good tips :) > > and so far as i know , > > the PCI configure space is accessed by pci_read_config,and so on > > the PCI IO space is accessed by > bus_space_read_1 and friends... > > > the PCI memory space is accessed by bus_space_read_1 and so on > > am i right sir? > > Yep... > > > On 5/24/06, John-Mark Gurney wrote: > > >william wallace wrote this message on Wed, May 24, 2006 at 15:48 +0800= : > > >> IN static device_method_t pci_methods[] =3D { > > >> what is the freeBSD's magic to connect pci_read_config_method wti= h > > >> PCI_READ_CONFIG? awk script?and so on? > > >> which > > >> DEVMETHOD(pci_read_config, pci_read_config_method), in pci.c > > >> command =3D PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); in > > >> pci_enable_io_method in pci.c > > >> > > >> and what if i create a new method in pci method interface ? > > >> such as DEVMETHOD(pci_have_rest , pci_have_rest_method) > > >> what else should i do when i want to use PCI_HAVE_REST(dev ) point t= o > > >> pci_have_rest_method > > > > > >These are handled by the _if.m files... look at sys/dev/pci/pci_if.m.= .. > > >There is an awk script in sys/tools/makeobjops.awk that converts the > > >_if.m to the appropriate .h and .c files... > > > > > >Please read: > > >http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/kernel-= objects-using.html > > >http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/newbus-= overview.html > > > > > >The device methods are implemented using kobj... > > > > > >> On 5/23/06, Scott Long wrote: > > >> >william wallace wrote: > > >> > > > >> >[...] > > >> > > > >> >> MSI: > > >> >> I've bantered around different suggestions for an API that will > > >support > > >> >> this. The basic thing that a driver needs from this is to know > > >> >> exactly how many message interrupt vectors are available to it. = It > > >> >> can't just register vectors and handlers blindly since the purpos= e of > > >> >> MSI is to assign special meanings to each vector and allow the dr= iver > > >to > > >> >> handle each one in specifically. > > >> > > > >> >[...] > > >> > > > >> >I just wanted to briefly say that an MSI implementation has been do= ne > > >> >recently, and that it should start getting wider circulation and re= view > > >> >soon. That's not to say that more work and design can't be done in= this > > >> >area, but we should probably wait a bit and see what has been done > > >> >already. > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." > --=20 we who r about to die,salute u!