Re: New kernel/resource.c

Jeff Garzik (jgarzik@pobox.com)
Sat, 10 Jul 1999 14:20:33 -0400


Linus Torvalds wrote:
> > 2. drivers/video/vgacon.c calls request_region() before the
> > slab allocator and kmalloc are initialised, causing request_region
> > to silently fail and a "NULL ptr" message in the kernel log.
> > The patch below fixes this (for vgacon only) by transparently
> > translating its request_region() calls to request_resource()
> > calls with static parameters. (The patch (ab)uses the pre-
> > processor. I kind of like it, but others may find it gross.)
>
> I'd prefer to rename it, so that people don't by mistake think that it
> does a "real" request_region(). But other than that I don't think it is
> gross - although I wonder if vgacon.c shouldn't just be using the native
> stuff directly, the way I made the architecture setup files do it.

IMHO vgacon is at the top of the list of modules that should get cleaned
up 'the right way'. I am definitely interested in having multi-head
with VGA cards, and getting vgacon to play nice with that sort of
situation is something I am looking at.

Anyway, for whoever does the vgacon update, it should clean itself up
too:
http://havoc.gtf.org/garzik/kernel/files/2.3.3-vgacon-release-region.patch.gz

> (The setup.c code actually got a lot _cleaner_ by using the new native
> primitives - it's not as if they are ugly or anything)

I like this approach much better, especially since the data structure is
much more generic and flexible than before. I can use it for mmio or
pio resources, store arbitrary data, etc.

'flags' in 'struct resource' should be renamed to 'data'. That makes it
more clear that the entire long is available for usage by the driver.
It might be a pointer to an additional data structure for example.

Jeff

-- 
One of the most overlooked advantages to computers is...  If they do
foul up, there's no law against whacking them around a little.
                -- Joe Martin

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/