All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	Zou Nan hai <nanhai.zou@intel.com>, Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-ia64@vger.kernel.org
Subject: Re: 2.6.17-rc1-mm1
Date: Thu, 06 Apr 2006 10:34:27 +0000	[thread overview]
Message-ID: <20060406103427.GC28056@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060406102154.GB28056@flint.arm.linux.org.uk>

On Thu, Apr 06, 2006 at 11:21:54AM +0100, Russell King wrote:
> On Wed, Apr 05, 2006 at 04:01:08PM -0600, Bjorn Helgaas wrote:
> > [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use
> 
> Ah, seems to be what I just suggested...
> 
> > @@ -1020,14 +1019,14 @@
> >  	char *charmap;
> >  	
> >  	if (vga_video_type != VIDEO_TYPE_EGAM) {
> > -		charmap = (char *) VGA_MAP_MEM(colourmap);
> > +		charmap = (char *) VGA_MAP_MEM(colourmap, 0);
> 
> Don't like this though - can't we pass a real size here rather than zero?
> There seems to be several clues as to the maximum size:
> 
> #define cmapsz 8192
> 
>         if (!vga_font_is_default)
>                 charmap += 4 * cmapsz;
> 
>                         charmap += 2 * cmapsz;
>                                 for (i = 0; i < cmapsz; i++)
>                                         vga_writeb(arg[i], charmap + i);
> 
> so that's about 7 * cmapsz - call that 8 for completeness, which is 64K.

Oh, and obviously, can we also have a VGA_UNMAP_MEM() macro as well please?
8)  IOW, something like this (which I cobbled together from your patch, some
of it by hand-edits - couldn't get it to apply cleanly to current -git.)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -391,7 +391,7 @@ static const char __init *vgacon_startup
 			static struct resource ega_console_resource  			    { .name = "ega", .start = 0x3B0, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_EGAM;
-			vga_vram_end = 0xb8000;
+			vga_vram_size = 0x8000;
 			display_desc = "EGA+";
 			request_resource(&ioport_resource,
 					 &ega_console_resource);
@@ -401,7 +401,7 @@ static const char __init *vgacon_startup
 			static struct resource mda2_console_resource  			    { .name = "mda", .start = 0x3BF, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_MDA;
-			vga_vram_end = 0xb2000;
+			vga_vram_size = 0x2000;
 			display_desc = "*MDA";
 			request_resource(&ioport_resource,
 					 &mda1_console_resource);
@@ -418,7 +418,7 @@ static const char __init *vgacon_startup
 		if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) {
 			int i;
 
-			vga_vram_end = 0xc0000;
+			vga_vram_size = 0x8000;
 
 			if (!ORIG_VIDEO_ISVGA) {
 				static struct resource ega_console_resource
@@ -443,7 +443,7 @@ static const char __init *vgacon_startup
 				 * and COE=1 isn't necessarily a good idea)
 				 */
 				vga_vram_base = 0xa0000;
-				vga_vram_end = 0xb0000;
+				vga_vram_size = 0x10000;
 				outb_p(6, VGA_GFX_I);
 				outb_p(6, VGA_GFX_D);
 #endif
@@ -475,7 +475,7 @@ static const char __init *vgacon_startup
 			static struct resource cga_console_resource  			    { .name = "cga", .start = 0x3D4, .end = 0x3D5 };
 			vga_video_type = VIDEO_TYPE_CGA;
-			vga_vram_end = 0xba000;
+			vga_vram_size = 0x2000;
 			display_desc = "*CGA";
 			request_resource(&ioport_resource,
 					 &cga_console_resource);
@@ -483,9 +483,8 @@ static const char __init *vgacon_startup
 		}
 	}
 
-	vga_vram_base = VGA_MAP_MEM(vga_vram_base);
-	vga_vram_end = VGA_MAP_MEM(vga_vram_end);
-	vga_vram_size = vga_vram_end - vga_vram_base;
+	vga_vram_base = VGA_MAP_MEM(vga_vram_base, vga_vram_size);
+	vga_vram_end = vga_vram_base + vga_vram_size;
 
 	/*
 	 *      Find out if there is a graphics card present.
@@ -1020,14 +1019,14 @@ static int vgacon_do_font_op(struct vgas
 	char *charmap;
 	
 	if (vga_video_type != VIDEO_TYPE_EGAM) {
-		charmap = (char *) VGA_MAP_MEM(colourmap);
+		charmap = (char *) VGA_MAP_MEM(colourmap, 8 * cmapsz);
 		beg = 0x0e;
 #ifdef VGA_CAN_DO_64KB
 		if (vga_video_type = VIDEO_TYPE_VGAC)
 			beg = 0x06;
 #endif
 	} else {
-		charmap = (char *) VGA_MAP_MEM(blackwmap);
+		charmap = (char *) VGA_MAP_MEM(blackwmap, 8 * cmapsz);
 		beg = 0x0a;
 	}
 
@@ -1102,6 +1101,8 @@ static int vgacon_do_font_op(struct vgas
 		}
 	}
 
+	VGA_UNMAP_MEM(charmap, 8 * cmapsz);
+
 	spin_lock_irq(&vga_lock);
 	/* First, the sequencer, Synchronous reset */
 	vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x01);	
Index: work-mm5/include/asm-alpha/vga.h
=================================--- work-mm5.orig/include/asm-alpha/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-alpha/vga.h	2006-04-05 15:42:35.000000000 -0600
@@ -46,6 +46,7 @@
 #define vga_readb(a)	readb((u8 __iomem *)(a))
 #define vga_writeb(v,a)	writeb(v, (u8 __iomem *)(a))
 
-#define VGA_MAP_MEM(x)	((unsigned long) ioremap(x, 0))
+#define VGA_MAP_MEM(x,s)	((unsigned long) ioremap(x, s))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #endif
Index: work-mm5/include/asm-arm/vga.h
=================================--- work-mm5.orig/include/asm-arm/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-arm/vga.h	2006-04-05 15:42:21.000000000 -0600
@@ -4,7 +4,8 @@
 #include <asm/hardware.h>
 #include <asm/io.h>
 
-#define VGA_MAP_MEM(x)	(PCIMEM_BASE + (x))
+#define VGA_MAP_MEM(x,s)	(PCIMEM_BASE + (x))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*((volatile unsigned char *)x))
 #define vga_writeb(x,y)	(*((volatile unsigned char *)y) = (x))
Index: work-mm5/include/asm-i386/vga.h
=================================--- work-mm5.orig/include/asm-i386/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-i386/vga.h	2006-04-05 15:42:49.000000000 -0600
@@ -12,7 +12,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x) (*(x))
 #define vga_writeb(x,y) (*(y) = (x))
Index: work-mm5/include/asm-ia64/vga.h
=================================--- work-mm5.orig/include/asm-ia64/vga.h	2006-04-05 09:57:55.000000000 -0600
+++ work-mm5/include/asm-ia64/vga.h	2006-04-05 15:43:09.000000000 -0600
@@ -17,7 +17,8 @@
 extern unsigned long vga_console_iobase;
 extern unsigned long vga_console_membase;
 
-#define VGA_MAP_MEM(x)	((unsigned long) ioremap_nocache(vga_console_membase + (x), 0))
+#define VGA_MAP_MEM(x,s)	((unsigned long) ioremap_nocache(vga_console_membase + (x), s))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*(x))
 #define vga_writeb(x,y)	(*(y) = (x))
Index: work-mm5/include/asm-m32r/vga.h
=================================--- work-mm5.orig/include/asm-m32r/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-m32r/vga.h	2006-04-05 15:43:22.000000000 -0600
@@ -14,7 +14,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x) (*(x))
 #define vga_writeb(x,y) (*(y) = (x))
Index: work-mm5/include/asm-mips/vga.h
=================================--- work-mm5.orig/include/asm-mips/vga.h	2006-03-23 10:22:17.000000000 -0700
+++ work-mm5/include/asm-mips/vga.h	2006-04-05 15:43:32.000000000 -0600
@@ -13,7 +13,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x)	(0xb0000000L + (unsigned long)(x))
+#define VGA_MAP_MEM(x,s)	(0xb0000000L + (unsigned long)(x))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*(x))
 #define vga_writeb(x,y)	(*(y) = (x))
Index: work-mm5/include/asm-powerpc/vga.h
=================================--- work-mm5.orig/include/asm-powerpc/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-powerpc/vga.h	2006-04-05 15:43:57.000000000 -0600
@@ -42,9 +42,11 @@
 extern unsigned long vgacon_remap_base;
 
 #ifdef __powerpc64__
-#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0))
+#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 #else
-#define VGA_MAP_MEM(x) (x + vgacon_remap_base)
+#define VGA_MAP_MEM(x,s) (x + vgacon_remap_base)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 #endif
 
 #define vga_readb(x) (*(x))
Index: work-mm5/include/asm-sparc64/vga.h
=================================--- work-mm5.orig/include/asm-sparc64/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-sparc64/vga.h	2006-04-05 15:44:08.000000000 -0600
@@ -28,6 +28,7 @@
 	return *addr;
 }
 
-#define VGA_MAP_MEM(x) (x)
+#define VGA_MAP_MEM(x,s) (x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #endif
Index: work-mm5/include/asm-x86_64/vga.h
=================================--- work-mm5.orig/include/asm-x86_64/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-x86_64/vga.h	2006-04-05 15:44:18.000000000 -0600
@@ -12,7 +12,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x) (*(x))
 #define vga_writeb(x,y) (*(y) = (x))
Index: work-mm5/include/asm-xtensa/vga.h
=================================--- work-mm5.orig/include/asm-xtensa/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-xtensa/vga.h	2006-04-05 15:44:31.000000000 -0600
@@ -11,7 +11,8 @@
 #ifndef _XTENSA_VGA_H
 #define _XTENSA_VGA_H
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*(x))
 #define vga_writeb(x,y)	(*(y) = (x))
Index: work-mm5/drivers/video/console/mdacon.c
=================================--- work-mm5.orig/drivers/video/console/mdacon.c	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/drivers/video/console/mdacon.c	2006-04-05 15:46:33.000000000 -0600
@@ -313,8 +313,8 @@
 	mda_num_columns = 80;
 	mda_num_lines   = 25;
 
-	mda_vram_base = VGA_MAP_MEM(0xb0000);
 	mda_vram_len  = 0x01000;
+	mda_vram_base = VGA_MAP_MEM(0xb0000, mda_vram_len);
 
 	mda_index_port  = 0x3b4;
 	mda_value_port  = 0x3b5;
Index: work-mm5/drivers/video/vga16fb.c
=================================--- work-mm5.orig/drivers/video/vga16fb.c	2006-03-23 10:22:16.000000000 -0700
+++ work-mm5/drivers/video/vga16fb.c	2006-04-05 15:49:34.000000000 -0600
@@ -1351,7 +1351,7 @@
 	}
 
 	/* XXX share VGA_FB_PHYS and I/O region with vgacon and others */
-	info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS);
+	info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS, VGA_FB_PHYS_LEN);
 
 	if (!info->screen_base) {
 		printk(KERN_ERR "vga16fb: unable to map device\n");

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

WARNING: multiple messages have this Message-ID (diff)
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	Zou Nan hai <nanhai.zou@intel.com>, Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-ia64@vger.kernel.org
Subject: Re: 2.6.17-rc1-mm1
Date: Thu, 6 Apr 2006 11:34:27 +0100	[thread overview]
Message-ID: <20060406103427.GC28056@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060406102154.GB28056@flint.arm.linux.org.uk>

On Thu, Apr 06, 2006 at 11:21:54AM +0100, Russell King wrote:
> On Wed, Apr 05, 2006 at 04:01:08PM -0600, Bjorn Helgaas wrote:
> > [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use
> 
> Ah, seems to be what I just suggested...
> 
> > @@ -1020,14 +1019,14 @@
> >  	char *charmap;
> >  	
> >  	if (vga_video_type != VIDEO_TYPE_EGAM) {
> > -		charmap = (char *) VGA_MAP_MEM(colourmap);
> > +		charmap = (char *) VGA_MAP_MEM(colourmap, 0);
> 
> Don't like this though - can't we pass a real size here rather than zero?
> There seems to be several clues as to the maximum size:
> 
> #define cmapsz 8192
> 
>         if (!vga_font_is_default)
>                 charmap += 4 * cmapsz;
> 
>                         charmap += 2 * cmapsz;
>                                 for (i = 0; i < cmapsz; i++)
>                                         vga_writeb(arg[i], charmap + i);
> 
> so that's about 7 * cmapsz - call that 8 for completeness, which is 64K.

Oh, and obviously, can we also have a VGA_UNMAP_MEM() macro as well please?
8)  IOW, something like this (which I cobbled together from your patch, some
of it by hand-edits - couldn't get it to apply cleanly to current -git.)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -391,7 +391,7 @@ static const char __init *vgacon_startup
 			static struct resource ega_console_resource =
 			    { .name = "ega", .start = 0x3B0, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_EGAM;
-			vga_vram_end = 0xb8000;
+			vga_vram_size = 0x8000;
 			display_desc = "EGA+";
 			request_resource(&ioport_resource,
 					 &ega_console_resource);
@@ -401,7 +401,7 @@ static const char __init *vgacon_startup
 			static struct resource mda2_console_resource =
 			    { .name = "mda", .start = 0x3BF, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_MDA;
-			vga_vram_end = 0xb2000;
+			vga_vram_size = 0x2000;
 			display_desc = "*MDA";
 			request_resource(&ioport_resource,
 					 &mda1_console_resource);
@@ -418,7 +418,7 @@ static const char __init *vgacon_startup
 		if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) {
 			int i;
 
-			vga_vram_end = 0xc0000;
+			vga_vram_size = 0x8000;
 
 			if (!ORIG_VIDEO_ISVGA) {
 				static struct resource ega_console_resource
@@ -443,7 +443,7 @@ static const char __init *vgacon_startup
 				 * and COE=1 isn't necessarily a good idea)
 				 */
 				vga_vram_base = 0xa0000;
-				vga_vram_end = 0xb0000;
+				vga_vram_size = 0x10000;
 				outb_p(6, VGA_GFX_I);
 				outb_p(6, VGA_GFX_D);
 #endif
@@ -475,7 +475,7 @@ static const char __init *vgacon_startup
 			static struct resource cga_console_resource =
 			    { .name = "cga", .start = 0x3D4, .end = 0x3D5 };
 			vga_video_type = VIDEO_TYPE_CGA;
-			vga_vram_end = 0xba000;
+			vga_vram_size = 0x2000;
 			display_desc = "*CGA";
 			request_resource(&ioport_resource,
 					 &cga_console_resource);
@@ -483,9 +483,8 @@ static const char __init *vgacon_startup
 		}
 	}
 
-	vga_vram_base = VGA_MAP_MEM(vga_vram_base);
-	vga_vram_end = VGA_MAP_MEM(vga_vram_end);
-	vga_vram_size = vga_vram_end - vga_vram_base;
+	vga_vram_base = VGA_MAP_MEM(vga_vram_base, vga_vram_size);
+	vga_vram_end = vga_vram_base + vga_vram_size;
 
 	/*
 	 *      Find out if there is a graphics card present.
@@ -1020,14 +1019,14 @@ static int vgacon_do_font_op(struct vgas
 	char *charmap;
 	
 	if (vga_video_type != VIDEO_TYPE_EGAM) {
-		charmap = (char *) VGA_MAP_MEM(colourmap);
+		charmap = (char *) VGA_MAP_MEM(colourmap, 8 * cmapsz);
 		beg = 0x0e;
 #ifdef VGA_CAN_DO_64KB
 		if (vga_video_type == VIDEO_TYPE_VGAC)
 			beg = 0x06;
 #endif
 	} else {
-		charmap = (char *) VGA_MAP_MEM(blackwmap);
+		charmap = (char *) VGA_MAP_MEM(blackwmap, 8 * cmapsz);
 		beg = 0x0a;
 	}
 
@@ -1102,6 +1101,8 @@ static int vgacon_do_font_op(struct vgas
 		}
 	}
 
+	VGA_UNMAP_MEM(charmap, 8 * cmapsz);
+
 	spin_lock_irq(&vga_lock);
 	/* First, the sequencer, Synchronous reset */
 	vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x01);	
Index: work-mm5/include/asm-alpha/vga.h
===================================================================
--- work-mm5.orig/include/asm-alpha/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-alpha/vga.h	2006-04-05 15:42:35.000000000 -0600
@@ -46,6 +46,7 @@
 #define vga_readb(a)	readb((u8 __iomem *)(a))
 #define vga_writeb(v,a)	writeb(v, (u8 __iomem *)(a))
 
-#define VGA_MAP_MEM(x)	((unsigned long) ioremap(x, 0))
+#define VGA_MAP_MEM(x,s)	((unsigned long) ioremap(x, s))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #endif
Index: work-mm5/include/asm-arm/vga.h
===================================================================
--- work-mm5.orig/include/asm-arm/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-arm/vga.h	2006-04-05 15:42:21.000000000 -0600
@@ -4,7 +4,8 @@
 #include <asm/hardware.h>
 #include <asm/io.h>
 
-#define VGA_MAP_MEM(x)	(PCIMEM_BASE + (x))
+#define VGA_MAP_MEM(x,s)	(PCIMEM_BASE + (x))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*((volatile unsigned char *)x))
 #define vga_writeb(x,y)	(*((volatile unsigned char *)y) = (x))
Index: work-mm5/include/asm-i386/vga.h
===================================================================
--- work-mm5.orig/include/asm-i386/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-i386/vga.h	2006-04-05 15:42:49.000000000 -0600
@@ -12,7 +12,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x) (*(x))
 #define vga_writeb(x,y) (*(y) = (x))
Index: work-mm5/include/asm-ia64/vga.h
===================================================================
--- work-mm5.orig/include/asm-ia64/vga.h	2006-04-05 09:57:55.000000000 -0600
+++ work-mm5/include/asm-ia64/vga.h	2006-04-05 15:43:09.000000000 -0600
@@ -17,7 +17,8 @@
 extern unsigned long vga_console_iobase;
 extern unsigned long vga_console_membase;
 
-#define VGA_MAP_MEM(x)	((unsigned long) ioremap_nocache(vga_console_membase + (x), 0))
+#define VGA_MAP_MEM(x,s)	((unsigned long) ioremap_nocache(vga_console_membase + (x), s))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*(x))
 #define vga_writeb(x,y)	(*(y) = (x))
Index: work-mm5/include/asm-m32r/vga.h
===================================================================
--- work-mm5.orig/include/asm-m32r/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-m32r/vga.h	2006-04-05 15:43:22.000000000 -0600
@@ -14,7 +14,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x) (*(x))
 #define vga_writeb(x,y) (*(y) = (x))
Index: work-mm5/include/asm-mips/vga.h
===================================================================
--- work-mm5.orig/include/asm-mips/vga.h	2006-03-23 10:22:17.000000000 -0700
+++ work-mm5/include/asm-mips/vga.h	2006-04-05 15:43:32.000000000 -0600
@@ -13,7 +13,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x)	(0xb0000000L + (unsigned long)(x))
+#define VGA_MAP_MEM(x,s)	(0xb0000000L + (unsigned long)(x))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*(x))
 #define vga_writeb(x,y)	(*(y) = (x))
Index: work-mm5/include/asm-powerpc/vga.h
===================================================================
--- work-mm5.orig/include/asm-powerpc/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-powerpc/vga.h	2006-04-05 15:43:57.000000000 -0600
@@ -42,9 +42,11 @@
 extern unsigned long vgacon_remap_base;
 
 #ifdef __powerpc64__
-#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0))
+#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 #else
-#define VGA_MAP_MEM(x) (x + vgacon_remap_base)
+#define VGA_MAP_MEM(x,s) (x + vgacon_remap_base)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 #endif
 
 #define vga_readb(x) (*(x))
Index: work-mm5/include/asm-sparc64/vga.h
===================================================================
--- work-mm5.orig/include/asm-sparc64/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-sparc64/vga.h	2006-04-05 15:44:08.000000000 -0600
@@ -28,6 +28,7 @@
 	return *addr;
 }
 
-#define VGA_MAP_MEM(x) (x)
+#define VGA_MAP_MEM(x,s) (x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #endif
Index: work-mm5/include/asm-x86_64/vga.h
===================================================================
--- work-mm5.orig/include/asm-x86_64/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-x86_64/vga.h	2006-04-05 15:44:18.000000000 -0600
@@ -12,7 +12,8 @@
  *	access the videoram directly without any black magic.
  */
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x) (*(x))
 #define vga_writeb(x,y) (*(y) = (x))
Index: work-mm5/include/asm-xtensa/vga.h
===================================================================
--- work-mm5.orig/include/asm-xtensa/vga.h	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/include/asm-xtensa/vga.h	2006-04-05 15:44:31.000000000 -0600
@@ -11,7 +11,8 @@
 #ifndef _XTENSA_VGA_H
 #define _XTENSA_VGA_H
 
-#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
+#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
+#define VGA_UNMAP_MEM(x,s)	do { } while (0)
 
 #define vga_readb(x)	(*(x))
 #define vga_writeb(x,y)	(*(y) = (x))
Index: work-mm5/drivers/video/console/mdacon.c
===================================================================
--- work-mm5.orig/drivers/video/console/mdacon.c	2006-01-02 20:21:10.000000000 -0700
+++ work-mm5/drivers/video/console/mdacon.c	2006-04-05 15:46:33.000000000 -0600
@@ -313,8 +313,8 @@
 	mda_num_columns = 80;
 	mda_num_lines   = 25;
 
-	mda_vram_base = VGA_MAP_MEM(0xb0000);
 	mda_vram_len  = 0x01000;
+	mda_vram_base = VGA_MAP_MEM(0xb0000, mda_vram_len);
 
 	mda_index_port  = 0x3b4;
 	mda_value_port  = 0x3b5;
Index: work-mm5/drivers/video/vga16fb.c
===================================================================
--- work-mm5.orig/drivers/video/vga16fb.c	2006-03-23 10:22:16.000000000 -0700
+++ work-mm5/drivers/video/vga16fb.c	2006-04-05 15:49:34.000000000 -0600
@@ -1351,7 +1351,7 @@
 	}
 
 	/* XXX share VGA_FB_PHYS and I/O region with vgacon and others */
-	info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS);
+	info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS, VGA_FB_PHYS_LEN);
 
 	if (!info->screen_base) {
 		printk(KERN_ERR "vga16fb: unable to map device\n");

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  reply	other threads:[~2006-04-06 10:34 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-04  8:45 2.6.17-rc1-mm1 Andrew Morton
2006-04-04 14:31 ` 2.6.17-rc1-mm1 Kumar Gala
2006-04-04 16:02 ` 2.6.17-mm1: drivers/w1/: patch undoes reasonable cleanups Adrian Bunk
2006-04-04 16:35   ` Evgeniy Polyakov
2006-04-04 16:29 ` 2.6.17-rc1-mm1: KEXEC became SMP-only Adrian Bunk
2006-04-04 17:22   ` Zachary Amsden
2006-04-04 17:50     ` Eric W. Biederman
2006-04-06 22:37     ` Adrian Bunk
2006-04-04 17:43   ` Eric W. Biederman
2006-04-04 17:51     ` Zachary Amsden
2006-04-04 18:43       ` Eric W. Biederman
2006-04-04 19:23         ` Zachary Amsden
2006-04-04 19:38           ` Muli Ben-Yehuda
2006-04-04 20:25           ` Andrew Morton
2006-04-04 22:02             ` Zachary Amsden
2006-04-04 22:19               ` Andrew Morton
2006-04-04 22:34                 ` Zachary Amsden
2006-04-04 22:38                   ` Andrew Morton
2006-04-05  0:21                 ` Martin Bligh
2006-04-05  2:45                   ` Eric W. Biederman
2006-04-04 16:29 ` [-mm patch] i386: pre_intr_init_hook optimization Adrian Bunk
2006-04-04 17:16   ` Zachary Amsden
2006-04-04 16:29 ` 2.6.17-rc1-mm1: why did acpi_ns_build_external_path() become global? Adrian Bunk
2006-04-04 16:30 ` [-mm patch] drivers/media/video/bt866.c: small fixes Adrian Bunk
2006-04-04 18:32   ` Martin Samuelsson
2006-04-05  7:42     ` Andrew Morton
2006-04-05  9:02       ` Adrian Bunk
2006-04-05 13:44       ` Martin Samuelsson
2006-04-05  8:32     ` Johannes Stezenbach
2006-04-05 13:54       ` Martin Samuelsson
2006-04-04 16:30 ` [-mm patch] fs/nfsd/nfs4state.c: make a struct static Adrian Bunk
2006-04-04 16:30   ` Adrian Bunk
2006-04-04 16:50   ` [NFS] " J. Bruce Fields
2006-04-04 17:29     ` Adrian Bunk
2006-04-04 20:53 ` 2.6.17-rc1-mm1: mlockall() regression on x86_64 Rafael J. Wysocki
2006-04-04 22:24   ` Andrew Morton
2006-04-04 21:53 ` 2.6.17-rc1-mm1 Zan Lynx
2006-04-04 22:09   ` 2.6.17-rc1-mm1 Andrew Morton
2006-04-05  7:01     ` 2.6.17-rc1-mm1 Roger Luethi
2006-04-05  7:29       ` 2.6.17-rc1-mm1 Andrew Morton
2006-04-05 22:01         ` 2.6.17-rc1-mm1 Roger Luethi
2006-04-04 23:38 ` 2.6.17-rc1-mm1 Luck, Tony
2006-04-04 23:38   ` 2.6.17-rc1-mm1 Luck, Tony
2006-04-05  2:05   ` 2.6.17-rc1-mm1 Zou Nan hai
2006-04-05  2:05     ` 2.6.17-rc1-mm1 Zou Nan hai
2006-04-05 16:15     ` 2.6.17-rc1-mm1 Bjorn Helgaas
2006-04-05 16:15       ` 2.6.17-rc1-mm1 Bjorn Helgaas
2006-04-05 21:17       ` 2.6.17-rc1-mm1 Luck, Tony
2006-04-05 21:17         ` 2.6.17-rc1-mm1 Luck, Tony
2006-04-05 21:37         ` 2.6.17-rc1-mm1 Andrew Morton
2006-04-05 21:37           ` 2.6.17-rc1-mm1 Andrew Morton
2006-04-05 21:39         ` 2.6.17-rc1-mm1 Andreas Schwab
2006-04-05 21:39           ` 2.6.17-rc1-mm1 Andreas Schwab
2006-04-05 22:01         ` 2.6.17-rc1-mm1 Bjorn Helgaas
2006-04-05 22:01           ` 2.6.17-rc1-mm1 Bjorn Helgaas
2006-04-06  1:49           ` 2.6.17-rc1-mm1 Antonino A. Daplas
2006-04-06  1:49             ` 2.6.17-rc1-mm1 Antonino A. Daplas
2006-04-06 10:21           ` 2.6.17-rc1-mm1 Russell King
2006-04-06 10:21             ` 2.6.17-rc1-mm1 Russell King
2006-04-06 10:34             ` Russell King [this message]
2006-04-06 10:34               ` 2.6.17-rc1-mm1 Russell King
2006-04-06 14:55               ` 2.6.17-rc1-mm1 Bjorn Helgaas
2006-04-06 14:55                 ` 2.6.17-rc1-mm1 Bjorn Helgaas
2006-04-06 10:16         ` 2.6.17-rc1-mm1 Russell King
2006-04-06 10:16           ` 2.6.17-rc1-mm1 Russell King
2006-04-05 22:50   ` 2.6.17-rc1-mm1 Luck, Tony
2006-04-05 22:50     ` 2.6.17-rc1-mm1 Luck, Tony
2006-04-05  2:27 ` 2.6.17-rc1-mm1, nfsd/reiser4 BUG Zan Lynx
2006-04-07 12:27 ` 2.6.17-rc1-mm1: drivers/acpi/numa.c compile error Adrian Bunk
2006-04-07 20:59   ` Andrew Morton
2006-04-09 15:44     ` Adrian Bunk
2006-04-09 15:57       ` Randy.Dunlap
2006-04-07 20:58 ` 2.6.17-rc1-mm1 - detects buggy TSC on GEODE Jim Cromie
2006-04-08  0:07   ` Andrew Morton
2006-04-08  0:25     ` john stultz
2006-04-08  1:15     ` Jim Cromie
2006-04-13  7:39 ` 2.6.17-rc1-mm1 Heiko Carstens
2006-04-13  8:13   ` 2.6.17-rc1-mm1 Andrew Morton
2006-04-14 16:07     ` 2.6.17-rc1-mm1 Alasdair G Kergon
  -- strict thread matches above, loose matches on Subject: below --
2006-04-04  8:45 2.6.17-rc1-mm1 Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060406103427.GC28056@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nanhai.zou@intel.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.