From: M. R. B. <mr...@0x...> - 2001-11-23 05:13:27
|
* Adrian McMenamin <ad...@mc...> on Thu, Nov 22, 2001: >=20 > The good news is that I am now pretty confident that this task (writing t= he=20 > driver) is doable... >=20 Two things about directly accessing the AICA hardware: 1) Use io_request_region() to reserve AICA registers and RAM, 2) Use the in{b,w,l}() out{b,w,l}() macros when accessing registers. This lets us do things like wait for the G2 bus FIFO (0xa05f688c) and other cool stuff, without the device driver ever needing to worry about it: void outl(u32 val, void *addr) { while ((u32 *)*(0xa05f688c) & 1) ; *reg =3D val; } You only have to worry about AICA-specific stuff in your driver at this poi= nt, you don't have to get all funky like libdream or KOS. See, even the kernel can do sane abstraction ;). M. R. |