Source-Changes-HG archive

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

[src/trunk]: src Teach rump how to process __link_set_sysctl_funcs so it can ...



details:   https://anonhg.NetBSD.org/src/rev/0730a7adac4e
branches:  trunk
changeset: 1008370:0730a7adac4e
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Mar 21 04:48:37 2020 +0000

description:
Teach rump how to process __link_set_sysctl_funcs so it can handle
modules the same as a real kernel.

Partly addresses PR kern/55088 - __link_set_evcnts not yet handled
(that will happen later)

diffstat:

 lib/librumpuser/rumpuser_dl.c |  37 +++++++++++++++++++++++++++++++++++--
 sys/rump/ldscript.rump        |  16 +++++++++++++++-
 2 files changed, 50 insertions(+), 3 deletions(-)

diffs (98 lines):

diff -r 970f608ba080 -r 0730a7adac4e lib/librumpuser/rumpuser_dl.c
--- a/lib/librumpuser/rumpuser_dl.c     Sat Mar 21 04:35:20 2020 +0000
+++ b/lib/librumpuser/rumpuser_dl.c     Sat Mar 21 04:48:37 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpuser_dl.c,v 1.31 2019/12/26 04:53:11 msaitoh Exp $        */
+/*      $NetBSD: rumpuser_dl.c,v 1.32 2020/03/21 04:48:37 pgoyette Exp $       */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -40,11 +40,16 @@
 #include "rumpuser_port.h"
 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser_dl.c,v 1.31 2019/12/26 04:53:11 msaitoh Exp $");
+__RCSID("$NetBSD: rumpuser_dl.c,v 1.32 2020/03/21 04:48:37 pgoyette Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
 #include <sys/time.h>
+
+#ifdef NOTYET
+#include <sys/evcnt.h>
+#endif
+
 #include <assert.h>
 
 #include <dlfcn.h>
@@ -353,6 +358,14 @@
        const struct modinfo *const *mi_start, *const *mi_end;
        struct rump_component *const *rc, *const *rc_end;
 
+       struct sysctllog;
+       typedef void sysctl_setup_func(struct sysctllog **);
+       sysctl_setup_func *const *sfp, *const *sfp_end;
+
+#ifdef NOTYET  /* We don't yet handle link_set_evcnts */
+       struct evcnt *const *evp, *const *evp_end;
+#endif
+
        mi_start = dlsym(handle, "__start_link_set_modules");
        mi_end = dlsym(handle, "__stop_link_set_modules");
        if (mi_start && mi_end)
@@ -365,6 +378,26 @@
                        docompload(*rc);
                assert(rc == rc_end);
        }
+
+       /* handle link_set_sysctl_funcs */
+       sfp = dlsym(handle, "__start_link_set_sysctl_funcs");
+       sfp_end = dlsym(handle, "__stop_link_set_sysctl_funcs");
+       if (sfp && sfp_end) {
+               for (; sfp < sfp_end; sfp++)
+                       (**sfp)(NULL);
+               assert(sfp == sfp_end);
+       }
+
+#ifdef NOTYET
+       /* handle link_set_evcnts */
+       evp = dlsym(handle, "__start_link_set_evcnts");
+       evp_end = dlsym(handle, "__stop_link_set_evcnts");
+       if (evp && evp_end) {
+               for (; evp < evp_end; evp++)
+                       evcnt_attach_static(*evp);
+               assert(evp == evp_end);
+       }
+#endif
 }
 
 /*
diff -r 970f608ba080 -r 0730a7adac4e sys/rump/ldscript.rump
--- a/sys/rump/ldscript.rump    Sat Mar 21 04:35:20 2020 +0000
+++ b/sys/rump/ldscript.rump    Sat Mar 21 04:48:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldscript.rump,v 1.3 2014/04/23 17:05:18 pooka Exp $    */
+/*     $NetBSD: ldscript.rump,v 1.4 2020/03/21 04:48:38 pgoyette Exp $ */
 
 /*
  * From binutils 2.19 onwards (in NetBSD) binutils ld PROVIDEs
@@ -24,5 +24,19 @@
                *(link_set_rump_components);
                __stop_link_set_rump_components = .;
        }
+
+       link_set_sysctl_funcs :
+       {
+               __start_link_set_sysctl_funcs = .;
+               *(link_set_sysctl_funcs);
+               __stop_link_set_sysctl_funcs = .;
+       }
+
+       link_set_rump_components :
+       {
+               __start_link_set_evcnts = .;
+               *(link_set_evcnts);
+               __stop_link_set_evcnts = .;
+       }
 }
 INSERT AFTER .data;



Home | Main Index | Thread Index | Old Index