Skip to contentSkip to conversation

fix location of zap_low_mappings

TRIVIAL Jasper Spaans 2 participants 4 messages Jun 6, 2003

lore
Share & tools
lore
#0 lore raw

Hello list,

When compiling current BK 2.5, I get a warning about zap_low_mappings not being declared. Moving it from smp.h to pgtable.h fixes this (and doesn't break my setup).

Does anyone object to this fix?

[not Cc:-ed to the trivial patch monkey, as I'm not sure whether pgtable.h
is the right place to put this]

Bye,
Jasper

Index: linux-2.5/include/asm-i386/pgtable.h
===================================================================
RCS file: /home/cvs/linux-2.5/include/asm-i386/pgtable.h,v retrieving revision 1.33

include/asm-i386/pgtable.h +1 -0
diff -u -r1.33 pgtable.h
@@ -23,6 +23,7 @@
 
 extern pgd_t swapper_pg_dir[1024];
 extern void paging_init(void);
+extern void zap_low_mappings (void);
 
 /*
  * ZERO_PAGE is a global shared page that is always zero: used

Index: l/include/asm-i386//smp.h
===================================================================
RCS file: /home/cvs/linux-2.5/include/asm-i386/smp.h,v retrieving revision 1.24

include/asm-i386/smp.h +0 -1
diff -u -r1.24 smp.h
@@ -43,7 +43,6 @@
 extern void smp_send_reschedule(int cpu);
 extern void smp_invalidate_rcv(void);		/* Process an NMI */
 extern void (*mtrr_hook) (void);
-extern void zap_low_mappings (void);
 
 #define MAX_APICID 256
 
Signature · 4 lines
Jasper Spaans
http://jsp.vs19.net/contact/

``Got no clue? Too bad for you.''
#1 lore raw
Quoted 6 lines · Jasper Spaans

When compiling current BK 2.5, I get a warning about zap_low_mappings not being declared. Moving it from smp.h to pgtable.h fixes this (and doesn't break my setup).
Does anyone object to this fix?
[not Cc:-ed to the trivial patch monkey, as I'm not sure whether pgtable.h
is the right place to put this]

It's basically not supposed to be visible on UP. Perhaps a better approach would be declare it in pgtable.h as you did, stub out the UP case with an empty function, and un-#ifdef it from mem_init().

-- wli

#2 lore raw
Quoted 9 lines · William Lee Irwin III
Quoted 4 lines · Jasper Spaans

When compiling current BK 2.5, I get a warning about zap_low_mappings not being declared. Moving it from smp.h to pgtable.h fixes this (and doesn't break my setup).
Does anyone object to this fix?

It's basically not supposed to be visible on UP. Perhaps a better approach would be declare it in pgtable.h as you did, stub out the UP case with an empty function, and un-#ifdef it from mem_init().

That wouldn't seem right to me:

* in the UP-case, it is explicitly called in mem_init() [mm/init.c]:

void __init mem_init(void)
{
[...]

#ifndef CONFIG_SMP
        zap_low_mappings();

#endif
}

* in the SMP-case, this call is delayed until
smp_cpus_done() [kernel/smpboot.c]

These two cases are fine however, as the UP-case defines it in mm/init.c, and the SMP-case has CONFIG_SMP enabled and includes <smp.h>; the warning comes from this function being called from acpi_restore_state_mem() [kernel/acpi/sleep.c]) in the UP-case, in which case it isn't declared in <smp.h>.

Bye,

Jasper

Signature · 4 lines
Jasper Spaans
http://jsp.vs19.net/contact/

``Got no clue? Too bad for you.''
#3 lore raw
Quoted 3 lines · William Lee Irwin III
Quoted 3 lines

It's basically not supposed to be visible on UP. Perhaps a better approach would be declare it in pgtable.h as you did, stub out the UP case with an empty function, and un-#ifdef it from mem_init().

Quoted 1 line · Jasper Spaans

That wouldn't seem right to me:

Yeah. That suggestion was totally bogus. Fine as-is then.

-- wli