lkml.org 
[lkml]   [2000]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: VRAM protection in setup.c
Date
Jeff Garzik <jgarzik@mandrakesoft.com> wrote:
> I disagree. We either need to follow Linus' advice (hope and pray
> accessing 0xA0000 is ok), or we need to implement a more flexible way of
> arbitrating resource sharing of the VGA regions. Adding a hack flag to
> the resource system is not a good short-term nor long-term fix, IMHO.

Why not do like the PCI IRQs, and add a new ``shareable'' IO region
type like this:

linux/include/ioport.h
...
#define IORESOURCE_SHAREABLE 0x00020000
...

Such that multiple drivers can request the same region, and
do something like the following (referencing headers I've never
personally used.. ;^)

vga.c

void vga_init()
{
...
allocate_resource(&iomem_resource,
&vidmem,
0x20000,
0xA0000,0xC000, /* Not too sure about the next */
IORESOURCE_MEM|IORESOURCE_SHARABLE,
NULL,NULL);
...
}


void do_something()
{
...
spin_lock(vidmem->lock);
/* Do something to memory */
spin_unlock(vidmem->lock);
}



--
Jason McMullan, Senior Linux Consultant, Linuxcare, Inc.
412.422.8077 tel, 415.701.0792 fax
jmcmullan@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.438 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site