Index: [thread] [date] [subject] [author]
  From: Steffen Seeger <seeger@physik.tu-chemnitz.de>
  To  : ggi-develop@eskimo.com
  Date: Mon, 3 Aug 1998 20:55:17 +0200 (MEST)

Re: Paged modes...

> Could anyone explain to me the difference between these definces in struct
> kgi_mmio_mapping
> 
> #define MAP_LINEAR_LINEAR       1
> #define MAP_LINEAR_PAGED        2
> #define MAP_PAGED_LINEAR        3
> #define MAP_PAGED_PAGED         4
> 
> I know of linerar framebuffer, with the entire framebuffer in a long
> line... and paged framebuffers, manipulated by moving a window, if my
> understanding is correct, wich it very well might not be.. but what are
> the others?
> 
> Thanks in advance.
> 
> Johan Karlberg


These are to export MMIO (memory mapped I/O regions) to applications.
There are two possibilities how the hardware may be accessed (one big region
or through one or more windows) and two possiblities how the application
may want to look at them (one big region or through a window). This gives
four possible mapping cases, expressed by these constants.

To give more details, there are three address spaces:

card-internal (e.g. RAM):		0...total size (letīs say 64KB)
acess window (e.g. the VGA aperture):	0...window size (e.g. 32KB or 64KB)
the applicationīs view of the region:	0...map size (e.g. 4KB, 32KB or 64KB)

The last one (together with the region properties) determines the type 
of mapping to apply:

linear region (total size == window size):

	- map size == total size:	LINEAR_LINEAR
	  (a linear region mapped so that the application has a linear view)

	- map size * N == total size:	LINEAR_PAGED
	  (a linear region mapped so, that the application has a paged view,
	  N is a integer > 1, and offset is adjusted using ioctl())

paged region (window size * N == total size; N is a integer > 1):

	- map size == total size:	PAGED_LINEAR
	  (a paged region mapped linear, offset is adjusted when neccessary
	   using pagefaults)

	- map size == window size:	PAGED_PAGED
	  (may be even map size * N == window size, but I have to look at the
	   code to tell you exactly).
	  (a paged region mapped so that the application has a paged view,
	   offset is adjusted using ioctl())


Hope this helps.
			Steffen

----------------- e-mail: seeger@physik.tu-chemnitz.de -----------------

Index: [thread] [date] [subject] [author]