Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GNU vs C99 extern inline



On Sun, 17 Apr 2011, Joerg Sonnenberger wrote:

> On Sat, Apr 16, 2011 at 09:27:41PM +0100, Iain Hibbert wrote:
> > returning to GNUC vs C99 semantics for inline functions, this is now
> > partly handled with a __c99inline keyword but there are several files in
> > the kernel containing functions marked inline that yet require external
> > linkage as they are also called from other source modules..  this is
> > provided by the opposite of __c99inline in both the GNUC and C99 cases, as
> > per the patch below which adds an __extinline keyword for this usage
>
> Please don't add anything like this, but fix the corresponding users. It
> is not even sure if such use is correct under C99 use.

here is the first; x86 is the only pmap.c that provides an inline
attribute for pmap_reference().. options include just removing it, which
only affects calls from inside pmap.c (eg none of the uvm code gets the
inline benefit anyway) or the patch below replaces pmap_reference() with a
macro so that it is effectively always inlined..

any objections from x86 ports?

iain

Index: include/pmap.h
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/include/pmap.h,v
retrieving revision 1.35
diff -u -r1.35 pmap.h
--- include/pmap.h      11 Feb 2011 23:08:38 -0000      1.35
+++ include/pmap.h      19 Apr 2011 10:38:23 -0000
@@ -191,6 +191,7 @@

 #define        pmap_resident_count(pmap)       
((pmap)->pm_stats.resident_count)
 #define        pmap_wired_count(pmap)          ((pmap)->pm_stats.wired_count)
+#define        pmap_reference(pmap)            
atomic_inc_uint(&(pmap)->pm_obj[0].uo_refs)

 #define pmap_clear_modify(pg)          pmap_clear_attrs(pg, PG_M)
 #define pmap_clear_reference(pg)       pmap_clear_attrs(pg, PG_U)
Index: x86/pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/pmap.c,v
retrieving revision 1.118
diff -u -r1.118 pmap.c
--- x86/pmap.c  11 Feb 2011 23:08:38 -0000      1.118
+++ x86/pmap.c  19 Apr 2011 10:38:26 -0000
@@ -764,17 +764,6 @@
 }

 /*
- *     Add a reference to the specified pmap.
- */
-
-inline void
-pmap_reference(struct pmap *pmap)
-{
-
-       atomic_inc_uint(&pmap->pm_obj[0].uo_refs);
-}
-
-/*
  * pmap_map_ptes: map a pmap's PTEs into KVM and lock them in
  *
  * => we lock enough pmaps to keep things locked in


Home | Main Index | Thread Index | Old Index