Skip to contentSkip to conversation

UML - Fix inlines

PATCH In review Jeff Dike 3 participants 3 messages Aug 18, 2007 – Aug 20, 2007 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/6 UML - Fix inlines

"extern inline" will have different semantics with gcc 4.3.

--

 include/asm-um/pgalloc.h          |    2 +-
 include/asm-um/pgtable-3level.h   |    2 +-
 include/asm-um/processor-x86_64.h |    2 +-
 include/asm-um/smp.h              |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
include/asm-um/pgalloc.h +1 -1
Index: linux-2.6.22/include/asm-um/pgalloc.h
===================================================================
@@ -42,7 +42,7 @@ static inline void pte_free(struct page 
 
 #ifdef CONFIG_3_LEVEL_PGTABLES
 
-extern __inline__ void pmd_free(pmd_t *pmd)
+static inline void pmd_free(pmd_t *pmd)
 {
 	free_page((unsigned long)pmd);
 }
include/asm-um/pgtable-3level.h +1 -1
Index: linux-2.6.22/include/asm-um/pgtable-3level.h
===================================================================
@@ -69,7 +69,7 @@ static inline pmd_t *pmd_alloc_one(struc
         return pmd;
 }
 
-extern inline void pud_clear (pud_t *pud)
+static inline void pud_clear (pud_t *pud)
 {
         set_pud(pud, __pud(0));
 }
include/asm-um/processor-x86_64.h +1 -1
Index: linux-2.6.22/include/asm-um/processor-x86_64.h
===================================================================
@@ -18,7 +18,7 @@ struct arch_thread {
 };
 
 /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
-extern inline void rep_nop(void)
+static inline void rep_nop(void)
 {
 	__asm__ __volatile__("rep;nop": : :"memory");
 }
include/asm-um/smp.h +1 -1
Index: linux-2.6.22/include/asm-um/smp.h
===================================================================
@@ -18,7 +18,7 @@ extern int hard_smp_processor_id(void);
 extern int ncpus;
 
 
-extern inline void smp_cpus_done(unsigned int maxcpus)
+static inline void smp_cpus_done(unsigned int maxcpus)
 {
 }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 1 line · On Fri, 17 Aug 2007 15:43:40 -0400 Jeff Dike <[email protected]> wrote:

"extern inline" will have different semantics with gcc 4.3.

What are these different semantics?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw
Quoted 6 lines · Andrew Morton
Quoted 1 line · On Fri, 17 Aug 2007 15:43:40 -0400 Jeff Dike <[email protected]> wrote:

"extern inline" will have different semantics with gcc 4.3.

What are these different semantics?

With gcc <= 4.2, when using "extern inline" in no case the function is compiled on its own, not even if you refer to its address explicitly. Such an address becomes an external reference, as if you had only declared the function, and had not defined it.

In C99 (and therefore in gcc >= 4.3), "extern inline" means that the function should be compiled inline where the inline definition is seen, and that the compiler should also emit a copy of the function body with an externally visible symbol.

Except for the Alpha port all users in the kernel used "extern inline" only for getting "static inline" semantics (older gcc versions didn't offer the always_inline function attribute).

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed