public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	James Bottomley <James.Bottomley@steeleye.com>
Subject: [2.6.6-mm3] 2/3: small tweaks to standard resource stuff
Date: Tue, 18 May 2004 01:38:39 +0200	[thread overview]
Message-ID: <40A94CFF.2020005@keyaccess.nl> (raw)

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

Hi Andrew.

Various small tweaks. Compiled and booted.

1. add IORESOURCE_BUSY | IORESOURCE_MEM also for the kernel code and
     data resources. I don't believe this actually matters one bit, but
     they're hooked into a BUSY/MEM parent ("System RAM") and marking
     them busy seems to make sense.

2. delete the .start = 1M default for the kernel code resource. This
     isn't actually a change; it's set to virt_to_phys(_text) in
     setup_arch() overriding any default anyways.

3. s/vram_resource/video_ram_resource/. Lines up much nicer with
     video_rom_resource...

4. s/checksum/romchecksum/. setup.c is a fairly large file, and
     "checksum" pollutes the namespace.

If pc9800 doesn't go after all, I'll resubmit this against the current
setup once it's back.

Rene.


[-- Attachment #2: linux-2.6.6-mm3_resources-smallstuff.diff --]
[-- Type: text/plain, Size: 2466 bytes --]

diff -urN linux-2.6.6-mm3.orig/arch/i386/kernel/setup.c linux-2.6.6-mm3/arch/i386/kernel/setup.c
--- linux-2.6.6-mm3.orig/arch/i386/kernel/setup.c	2004-05-17 23:43:50.000000000 +0200
+++ linux-2.6.6-mm3/arch/i386/kernel/setup.c	2004-05-17 23:37:36.000000000 +0200
@@ -136,13 +136,15 @@
 static struct resource data_resource = {
 	.name	= "Kernel data",
 	.start	= 0,
-	.end	= 0
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
 };
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
-	.start	= 0x100000,
-	.end	= 0
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
 };
 
 static struct resource system_rom_resource = {
@@ -201,7 +203,7 @@
 	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
 };
 
-static struct resource vram_resource = {
+static struct resource video_ram_resource = {
 	.name	= "Video RAM area",
 	.start	= 0xa0000,
 	.end	= 0xbffff,
@@ -255,7 +257,7 @@
 
 #define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
 	
-static int __init checksum(unsigned char *rom, unsigned long length)
+static int __init romchecksum(unsigned char *rom, unsigned long length)
 {
 	unsigned char *p, sum = 0;
 
@@ -283,7 +285,7 @@
 		length = rom[2] * 512;
 
 		/* if checksum okay, trust length byte */
-		if (length && checksum(rom, length))
+		if (length && romchecksum(rom, length))
 			video_rom_resource.end = start + length - 1;
 
 		request_resource(&iomem_resource, &video_rom_resource);
@@ -302,7 +304,7 @@
 	rom = isa_bus_to_virt(extension_rom_resource.start);
 	if (romsignature(rom)) {
 		length = extension_rom_resource.end - extension_rom_resource.start + 1;
-		if (checksum(rom, length)) {
+		if (romchecksum(rom, length)) {
 			request_resource(&iomem_resource, &extension_rom_resource);
 			upper = extension_rom_resource.start;
 		}
@@ -318,7 +320,7 @@
 		length = rom[2] * 512;
 
 		/* but accept any length that fits if checksum okay */
-		if (!length || start + length > upper || !checksum(rom, length))
+		if (!length || start + length > upper || !romchecksum(rom, length))
 			continue;
 
 		adapter_rom_resources[i].start = start;
@@ -1149,7 +1151,7 @@
 		legacy_init_iomem_resources(&code_resource, &data_resource);
 
 	/* EFI systems may still have VGA */
-	request_resource(&iomem_resource, &vram_resource);
+	request_resource(&iomem_resource, &video_ram_resource);
 
 	/* request I/O space for devices used on all i[345]86 PCs */
 	for (i = 0; i < STANDARD_IO_RESOURCES; i++)

                 reply	other threads:[~2004-05-17 23:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=40A94CFF.2020005@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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