linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@quark.didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] i386 boot pagetables cleanup part 1
Date: Sun, 04 Aug 2002 11:48:34 -0400	[thread overview]
Message-ID: <3D4D4CD2.4060105@quark.didntduck.org> (raw)

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

- New __PA() macro for physical address.
- Rename pg0 to more descriptive boot_pgtables.  Remove unused pg1.  Add 
boot_pgtables_end instead of relying on empty_zero_page.
- Don't hardcode pte entries in swapper_pg_dir.  Let the linker do its job.

This is in preparation to move empty_zero_page, swapper_pg_dir, and 
boot_pgtables to other data sections.

--
				Brian Gerst

[-- Attachment #2: boot_pte1-1 --]
[-- Type: text/plain, Size: 2115 bytes --]

diff -urN linux-bk/arch/i386/kernel/head.S linux/arch/i386/kernel/head.S
--- linux-bk/arch/i386/kernel/head.S	Tue Jul 30 10:27:05 2002
+++ linux/arch/i386/kernel/head.S	Sun Aug  4 11:01:52 2002
@@ -36,6 +36,8 @@
 #define X86_CAPABILITY	CPU_PARAMS+12
 #define X86_VENDOR_ID	CPU_PARAMS+28
 
+#define __PA(x) (x-__PAGE_OFFSET)
+
 /*
  * swapper_pg_dir is the main page directory, address 0x00101000
  *
@@ -69,11 +71,10 @@
  *	NOTE! We have to correct for the fact that we're
  *	not yet offset PAGE_OFFSET..
  */
-#define cr4_bits mmu_cr4_features-__PAGE_OFFSET
-	cmpl $0,cr4_bits
+	cmpl $0,__PA(mmu_cr4_features)
 	je 3f
 	movl %cr4,%eax		# Turn on paging options (PSE,PAE,..)
-	orl cr4_bits,%eax
+	orl __PA(mmu_cr4_features),%eax
 	movl %eax,%cr4
 	jmp 3f
 1:
@@ -81,19 +82,19 @@
 /*
  * Initialize page tables
  */
-	movl $pg0-__PAGE_OFFSET,%edi /* initialize page tables */
+	movl $__PA(boot_pgtables),%edi /* initialize page tables */
 	movl $007,%eax		/* "007" doesn't mean with right to kill, but
 				   PRESENT+RW+USER */
 2:	stosl
 	add $0x1000,%eax
-	cmp $empty_zero_page-__PAGE_OFFSET,%edi
+	cmp $__PA(boot_pgtables_end),%edi
 	jne 2b
 
 /*
  * Enable paging
  */
 3:
-	movl $swapper_pg_dir-__PAGE_OFFSET,%eax
+	movl $__PA(swapper_pg_dir),%eax
 	movl %eax,%cr3		/* set the page table pointer.. */
 	movl %cr0,%eax
 	orl $0x80000000,%eax
@@ -368,12 +369,12 @@
  */
 .org 0x1000
 ENTRY(swapper_pg_dir)
-	.long 0x00102007
-	.long 0x00103007
-	.fill BOOT_USER_PGD_PTRS-2,4,0
+	.long 0x0007 + __PA(boot_pgtables)
+	.long 0x1007 + __PA(boot_pgtables)
 	/* default: 766 entries */
-	.long 0x00102007
-	.long 0x00103007
+	.fill BOOT_USER_PGD_PTRS-2,4,0
+	.long 0x0007 + __PA(boot_pgtables)
+	.long 0x1007 + __PA(boot_pgtables)
 	/* default: 254 entries */
 	.fill BOOT_KERNEL_PGD_PTRS-2,4,0
 
@@ -382,10 +383,7 @@
  * tables are set up later depending on memory size.
  */
 .org 0x2000
-ENTRY(pg0)
-
-.org 0x3000
-ENTRY(pg1)
+boot_pgtables:
 
 /*
  * empty_zero_page must immediately follow the page tables ! (The
@@ -393,6 +391,7 @@
  */
 
 .org 0x4000
+boot_pgtables_end:
 ENTRY(empty_zero_page)
 
 .org 0x5000

                 reply	other threads:[~2002-08-04 15:50 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=3D4D4CD2.4060105@quark.didntduck.org \
    --to=bgerst@quark.didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).