public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave <dave.jiang@gmail.com>
To: akpm@osdl.org, torvalds@osdl.org, linux-kernel@vger.kernel.org,
	smaurer@teja.com, linux@arm.linux.org.uk, dsaxena@plexity.net,
	drew.moseley@intel.com, mporter@kernel.crashing.org
Subject: [PATCH 2/5] Convert resource to u64 from unsigned long
Date: Thu, 13 Jan 2005 16:28:49 -0700	[thread overview]
Message-ID: <8746466a050113152843f32a2f@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

Fixed some of the drivers as example just to get working on i386.

Signed-off-by: Dave Jiang (dave.jiang@gmail.com)


-- 
-= Dave =-

Software Engineer - Advanced Development Engineering Team 
Storage Component Division - Intel Corp. 
mailto://dave.jiang @ intel
http://sourceforge.net/projects/xscaleiop/
----
The views expressed in this email are
mine alone and do not necessarily 
reflect the views of my employer
(Intel Corp.).

[-- Attachment #2: patch-driver_u64fix --]
[-- Type: application/octet-stream, Size: 5466 bytes --]

diff -Naur linux-2.6.11-rc1/drivers/ide/pci/cmd64x.c linux-2.6.11-rc1-u64/drivers/ide/pci/cmd64x.c
--- linux-2.6.11-rc1/drivers/ide/pci/cmd64x.c	2005-01-13 14:39:55.967192424 -0700
+++ linux-2.6.11-rc1-u64/drivers/ide/pci/cmd64x.c	2005-01-13 12:20:28.703209896 -0700
@@ -560,7 +560,7 @@
 #ifdef __i386__
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_byte(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%" U64FMT "\n", name, dev->resource[PCI_ROM_RESOURCE].start);
 	}
 #endif
 
diff -Naur linux-2.6.11-rc1/drivers/ide/pci/hpt34x.c linux-2.6.11-rc1-u64/drivers/ide/pci/hpt34x.c
--- linux-2.6.11-rc1/drivers/ide/pci/hpt34x.c	2005-01-13 14:39:56.013185432 -0700
+++ linux-2.6.11-rc1-u64/drivers/ide/pci/hpt34x.c	2005-01-13 12:25:06.456984904 -0700
@@ -175,7 +175,7 @@
 		if (pci_resource_start(dev, PCI_ROM_RESOURCE)) {
 			pci_write_config_byte(dev, PCI_ROM_ADDRESS,
 				dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-			printk(KERN_INFO "HPT345: ROM enabled at 0x%08lx\n",
+			printk(KERN_INFO "HPT345: ROM enabled at 0x%" U64FMT "\n",
 				dev->resource[PCI_ROM_RESOURCE].start);
 		}
 		pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0);
diff -Naur linux-2.6.11-rc1/drivers/ide/pci/pdc202xx_new.c linux-2.6.11-rc1-u64/drivers/ide/pci/pdc202xx_new.c
--- linux-2.6.11-rc1/drivers/ide/pci/pdc202xx_new.c	2005-01-13 14:39:56.561102136 -0700
+++ linux-2.6.11-rc1-u64/drivers/ide/pci/pdc202xx_new.c	2005-01-13 12:25:38.448121512 -0700
@@ -277,7 +277,7 @@
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 			dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
+		printk(KERN_INFO "%s: ROM enabled at 0x%" U64FMT "\n",
 			name, dev->resource[PCI_ROM_RESOURCE].start);
 	}
 
diff -Naur linux-2.6.11-rc1/drivers/ide/pci/pdc202xx_old.c linux-2.6.11-rc1-u64/drivers/ide/pci/pdc202xx_old.c
--- linux-2.6.11-rc1/drivers/ide/pci/pdc202xx_old.c	2005-01-13 14:39:56.562101984 -0700
+++ linux-2.6.11-rc1-u64/drivers/ide/pci/pdc202xx_old.c	2005-01-13 12:26:00.655745440 -0700
@@ -528,7 +528,7 @@
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 			dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
+		printk(KERN_INFO "%s: ROM enabled at 0x%" U64FMT "\n",
 			name, dev->resource[PCI_ROM_RESOURCE].start);
 	}
 

diff -Naur linux-2.6.11-rc1/drivers/serial/8250_pci.c linux-2.6.11-rc1-u64/drivers/serial/8250_pci.c
--- linux-2.6.11-rc1/drivers/serial/8250_pci.c	2004-12-24 14:35:23.000000000 -0700
+++ linux-2.6.11-rc1-u64/drivers/serial/8250_pci.c	2005-01-13 11:45:41.841461104 -0700
@@ -589,8 +589,19 @@
 	else
 		offset += idx * board->uart_offset;
 
+	/*
+	 * FIXME: apparently ia32 does not have u64 divide implementation
+	 * we cast the pci_resource_len to u32 for the time being
+	 * this probably should be fixed to support u64 for ia32
+	 * and other archs that do not have u64 divide 
+	 */
+#if BIS_PER_LONG == 64	
 	maxnr = (pci_resource_len(dev, bar) - board->first_offset) /
 		(8 << board->reg_shift);
+#else
+	maxnr = ((u32)pci_resource_len(dev, bar) - board->first_offset) /
+		(8 << board->reg_shift);
+#endif	
 
 	if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
 		return 1;
diff -Naur linux-2.6.11-rc1/drivers/video/console/vgacon.c linux-2.6.11-rc1-u64/drivers/video/console/vgacon.c
--- linux-2.6.11-rc1/drivers/video/console/vgacon.c	2005-01-13 14:40:05.305772744 -0700
+++ linux-2.6.11-rc1-u64/drivers/video/console/vgacon.c	2005-01-13 11:45:41.842460952 -0700
@@ -190,7 +190,7 @@
 		vga_video_port_val = VGA_CRT_DM;
 		if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) {
 			static struct resource ega_console_resource =
-			    { "ega", 0x3B0, 0x3BF };
+			    { .name = "ega", .start = 0x3B0, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_EGAM;
 			vga_vram_end = 0xb8000;
 			display_desc = "EGA+";
@@ -198,9 +198,9 @@
 					 &ega_console_resource);
 		} else {
 			static struct resource mda1_console_resource =
-			    { "mda", 0x3B0, 0x3BB };
+			    { .name = "mda", .start = 0x3B0, .end = 0x3BB };
 			static struct resource mda2_console_resource =
-			    { "mda", 0x3BF, 0x3BF };
+			    { .name = "mda", .start = 0x3BF, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_MDA;
 			vga_vram_end = 0xb2000;
 			display_desc = "*MDA";
@@ -223,14 +223,14 @@
 
 			if (!ORIG_VIDEO_ISVGA) {
 				static struct resource ega_console_resource
-				    = { "ega", 0x3C0, 0x3DF };
+				    = { .name = "ega", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_EGAC;
 				display_desc = "EGA";
 				request_resource(&ioport_resource,
 						 &ega_console_resource);
 			} else {
 				static struct resource vga_console_resource
-				    = { "vga+", 0x3C0, 0x3DF };
+				    = { .name = "vga+", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_VGAC;
 				display_desc = "VGA+";
 				request_resource(&ioport_resource,
@@ -274,7 +274,7 @@
 			}
 		} else {
 			static struct resource cga_console_resource =
-			    { "cga", 0x3D4, 0x3D5 };
+			    { .name = "cga", .start = 0x3D4, .end = 0x3D5 };
 			vga_video_type = VIDEO_TYPE_CGA;
 			vga_vram_end = 0xba000;
 			display_desc = "*CGA";

             reply	other threads:[~2005-01-13 23:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-13 23:28 Dave [this message]
2005-01-14  5:48 ` [PATCH 2/5] Convert resource to u64 from unsigned long Andreas Dilger

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=8746466a050113152843f32a2f@mail.gmail.com \
    --to=dave.jiang@gmail.com \
    --cc=akpm@osdl.org \
    --cc=drew.moseley@intel.com \
    --cc=dsaxena@plexity.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mporter@kernel.crashing.org \
    --cc=smaurer@teja.com \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox