On 08/04/11 6:27 PM, Brad wrote:
On Thu, Apr 07, 2011 at 09:00:45PM -0400, Brad wrote:
Some _LP64 ifdef's leftover from rev 1.1. They appear to be unnecessary
since this code is only for amd64 anyway and thus a 64-bit arch.


Index: pmap.c
===================================================================
RCS file: /home/cvs/src/sys/arch/amd64/amd64/pmap.c,v
retrieving revision 1.61
diff -u -p -r1.61 pmap.c
--- pmap.c      14 Mar 2011 00:05:46 -0000      1.61
+++ pmap.c      8 Apr 2011 00:41:33 -0000
@@ -289,10 +289,8 @@ extern paddr_t msgbuf_paddr;
  extern vaddr_t idt_vaddr;                     /* we allocate IDT early */
  extern paddr_t idt_paddr;

-#ifdef _LP64
  extern vaddr_t lo32_vaddr;
  extern vaddr_t lo32_paddr;
-#endif

  vaddr_t virtual_avail;
  extern int end;
@@ -649,7 +647,6 @@ pmap_bootstrap(paddr_t first_avail, padd
        idt_paddr = first_avail;                        /* steal a page */
        first_avail += 2 * PAGE_SIZE;

-#ifdef _LP64
        /*
         * Grab a page below 4G for things that need it (i.e.
         * having an initial %cr3 for the MP trampoline).
@@ -658,7 +655,7 @@ pmap_bootstrap(paddr_t first_avail, padd
        virtual_avail += PAGE_SIZE;
        lo32_paddr = first_avail;
        first_avail += PAGE_SIZE;
-#endif
+
        /*
         * init the global lists.
         */

Actually using the same if defined checks as used in machdep.c for the 
trampoline
code where this is utilized looks like a better option.

Still looking for feedback on this..

Index: pmap.c
===================================================================
RCS file: /home/cvs/src/sys/arch/amd64/amd64/pmap.c,v
retrieving revision 1.61
diff -u -p -r1.61 pmap.c
--- pmap.c      14 Mar 2011 00:05:46 -0000      1.61
+++ pmap.c      8 Apr 2011 19:31:04 -0000
@@ -289,10 +289,8 @@ extern paddr_t msgbuf_paddr;
  extern vaddr_t idt_vaddr;                     /* we allocate IDT early */
  extern paddr_t idt_paddr;

-#ifdef _LP64
  extern vaddr_t lo32_vaddr;
  extern vaddr_t lo32_paddr;
-#endif

  vaddr_t virtual_avail;
  extern int end;
@@ -649,7 +647,8 @@ pmap_bootstrap(paddr_t first_avail, padd
        idt_paddr = first_avail;                        /* steal a page */
        first_avail += 2 * PAGE_SIZE;

-#ifdef _LP64
+#if defined(MULTIPROCESSOR) || \
+    (NACPI>  0&&  !defined(SMALL_KERNEL))
        /*
         * Grab a page below 4G for things that need it (i.e.
         * having an initial %cr3 for the MP trampoline).
@@ -659,6 +658,7 @@ pmap_bootstrap(paddr_t first_avail, padd
        lo32_paddr = first_avail;
        first_avail += PAGE_SIZE;
  #endif
+
        /*
         * init the global lists.
         */

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to