Getting rid of the static async_struct arrays...

mucci@cs.utk.edu
Sat, 15 Jul 1995 20:00:22 -0400


Hi all,

I'm in the (ugly) process of porting the x86 serial driver
to the 680x0 version of Linux. (I'm working on a prototype ISA->Zorro
board). Aside from the obvious problem, that x86 linux hasn't yet
incorportated the mach-ind extensions found in 1.2pl1 (680x0),
I'm wondering if there is a way to get rid of the static rs_table
arrays, which probably take up a decent chunk of memory.

My proposal is as follows:

1) Have a much smaller array that carries the flags, IRQ, address and
name of each type of interface. This is static and would contain entries
for all architectures. (Thus minor numbers would be unique.)
2) Have an array of length of the number of minors, with each entry
pointing to an init time allocated struct async_struct. Thus the
autoconfig procedure, would have to probe each entry in the 1st tabel
allocate memory and fill in the structure.

Can someone please critique this? Things definitely can't stay the
way they are...especially with the Mac and PPC ports on the horizon.

Next:

Why does some code do:

save_flags();
sti();
/* blah)
restore_flags();

and other code has a cli() at the end of it. I assume this has to do
with what context the routine is called in. (Fast/Slow/Soft/Non int)

Thanks,

-Phil

P.S. Should minors be unique to a specific type of interface? Now that
I think about it, maybe they should just be filled from 0, depending
on what is found in the system.