From owner-freebsd-hackers Sun Dec 14 01:50:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA24899 for hackers-outgoing; Sun, 14 Dec 1997 01:50:41 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from hydrogen.nike.efn.org (resnet.uoregon.edu [128.223.170.28]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id BAA24887 for ; Sun, 14 Dec 1997 01:50:28 -0800 (PST) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by hydrogen.nike.efn.org (8.8.7/8.8.7) id BAA07085; Sun, 14 Dec 1997 01:50:03 -0800 (PST) Message-ID: <19971214015002.48331@hydrogen.nike.efn.org> Date: Sun, 14 Dec 1997 01:50:02 -0800 From: John-Mark Gurney To: "Justin T. Gibbs" Cc: Amancio Hasty , hackers@FreeBSD.ORG Subject: Re: Bus/Processor specific I/O methods - was Re: Beginning SPARC port References: <199712140658.WAA09916@rah.star-gate.com> <199712140817.BAA07657@narnia.plutotech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: <199712140817.BAA07657@narnia.plutotech.com>; from Justin T. Gibbs on Sun, Dec 14, 1997 at 01:17:39AM -0700 Reply-To: John-Mark Gurney Organization: Cu Networking X-Operating-System: FreeBSD 2.2.1-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Justin T. Gibbs scribbled this message on Dec 14: > NetBSD has already dealt with this issue. It's called "bus.h". All > of the new CAM SCSI drivers use a FreeBSD version of this file to > perform device I/O. It also covers DMA and in fact the ISA bounce > buffers that are used in CAM use "bus DMA" instead of the older > bounce buffer scheme used in current. We shouldn't re-invent the > wheel unless there are sound reasons to do so. Please review these > files from a recent CAM snapshot to see if this is an acceptable > solution to the problem: in my opinion, they didn't go far enough... they still have seperate structures for each bus... and their resource is bus dependant.. there isn't a common structure between all busses... with my code, very little will actually have to be done to allow devices to be used between bus types... and if the interface to the bus isn't radicly different (like supporting same memory/io/interrupt) sets, the only difference will be the probe code... the hardest part of the whole thing though, is to some how create a way for common resources to be able to use keys... because if your trying to do dma with channel one on the first isa bus, how do you tell the different between dma channel one on the second bus... so far, the only way that I've come up with a way to solve this is to pass back three parameters when the device allocates a resource... this is a function pointer, a device pointer (an interrupt handler is a device just like a dma controller or an ethernet card is, and will require a device entry along with other devices) and the special parameter that identifies the resource (like irq number or dma number).. we can make a special exception though... and that would be for memory and io port accesses... which I think should either ALWAYS use a macro along with the parameter passed back (for access), or compare against the function pointer for possible "constants"... the former is probably better than the later... right now the latest specs for the bus/device code is at: http://resnet.uoregon.edu:6971/~jmg/FreeBSD/busdevice.html I've started working on code (I've written the header files).. but right now I'm working on some B-tree code first... hopefully I'll have something that will be usable in the next few weeks.. -- John-Mark Gurney Modem/FAX: +1 541 683 6954 Cu Networking Live in Peace, destroy Micro$oft, support free software, run FreeBSD