Subject: Re: sharing drivers (was re: m68k comman...)
To: Justin T. Gibbs <>
From: Julian Bean <>
List: current-users
Date: 03/22/1996 10:16:20
[Problems because some ports use memory space and some ports use I/O space
for drivers]

I don't have a great deal of experience with driver code, but can't we
#define all the interfaces to the driver data.  Something like:

#define  ADriverRegA  (*(int *)(0xAddress))
#define  ADriverRegB  (*(int *)(0xAddress))

in <machince/ADriver.h>, on a memory mapped machine, and have equivalent
code on the I/O space machines.

Then, the actual code in  ADriver.c can be

ADriverRegIER |= A_FLAG;
ADriverRegA = 0x45;


return ADriverRegB;

or whatever is appropriate, which can be shared between all machine which
have the same chipset...


|  Jelibean aka  |           |  6 Evelyn Road      |
|  Jules aka     |                               |  Richmond, Surrey   |
|  Julian Bean   |(|  TW9 2TF    *UK*    |
|  The Other Place - n. (pop.) Depending on the affiliation of the     |
|  speaker, one of Oxford, Cambridge, The House of Lords, The House of |
|  Commons, Hell.  Draw your own conclusions.                          |