Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Dec 1997 01:50:02 -0800
From:      John-Mark Gurney <gurney_j@efn.org>
To:        "Justin T. Gibbs" <gibbs@narnia.plutotech.com>
Cc:        Amancio Hasty <hasty@rah.star-gate.com>, hackers@FreeBSD.ORG
Subject:   Re: Bus/Processor specific I/O methods - was Re: Beginning SPARC port
Message-ID:  <19971214015002.48331@hydrogen.nike.efn.org>
In-Reply-To: <199712140817.BAA07657@narnia.plutotech.com>; from Justin T. Gibbs on Sun, Dec 14, 1997 at 01:17:39AM -0700
References:  <199712140658.WAA09916@rah.star-gate.com> <199712140817.BAA07657@narnia.plutotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971214015002.48331>