[libbsd 21/22] libbsd.txt: Move system control hints

Sebastian Huber sebastian.huber at embedded-brains.de
Mon May 23 14:33:44 UTC 2022


Generalize hint.
---
 CONTRIBUTING.rst |  7 +++++++
 libbsd.txt       | 39 ---------------------------------------
 2 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 99c778f6..c7c35df9 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -592,3 +592,10 @@ Here you see that the SYSINIT(9) entries are no longer static.  The
 ``*_REFERENCE()`` macros will create references to the corresponding modules
 which are later resolved by the linker.  The application has to provide an
 object file with references to all required FreeBSD modules.
+
+System Control Hints
+====================
+
+If you get undefined references to ``_bsd_sysctl_*`` symbols, then you have to
+locate and add the associated system control node, see
+`SYSCTL(9) <http://www.freebsd.org/cgi/man.cgi?query=SYSCTL_DECL&sektion=9>`_.
diff --git a/libbsd.txt b/libbsd.txt
index 33033c4c..706faeb6 100644
--- a/libbsd.txt
+++ b/libbsd.txt
@@ -112,45 +112,6 @@ The devices form a tree with the Nexus device at a high-level.  This Nexus
 device is architecture specific in FreeBSD.  In RTEMS we have our own Nexus
 device, see `rtemsbsd/bsp/bsp-bsd-nexus-devices.c`.
 
-=== SYSCTL_NODE Example
-
-During development, we had an undefined reference to
-_bsd_sysctl__net_children that we had trouble tracking down. Thanks to
-Chris Johns, we located it. He explained how to read SYSCTL_NODE
-definitions. This line from freebsd/netinet/in_proto.c is attempting
-to add the "inet" node to the parent node "_net".
-
-----
-SYSCTL_NODE(_net,      PF_INET,         inet,   CTLFLAG_RW, 0,
-        "Internet Family");
-----
-
-Our problem was that we could not find where _bsd_sysctl__net_children
-was defined. Chris suggested that when in doubt compile with -save-temps
-and look at the preprocessed .i files. But he did not need that. He
-explained that this the symbol name _bsd_sysctl__net_children was
-automatically generated by a SYSCTL_NODE as follows:
-
-* _bsd_ - added by RTEMS modifications to SYSCTL_NODE macro
-* sysctl_ - boilerplace added by SYSCTL_NODE macro
-* "" - empty string for parent node
-* net - name of SYSCTL_NODE
-* children - added by SYSCTL macros
-
-This was all generated by a support macro declaring the node as this:
-
-----
-struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name);
-----
-
-Given this information, we located this SYSCTL_NODE declaration in
-kern/kern_mib.c
-
-----
-SYSCTL_NODE(, CTL_KERN,   kern,   CTLFLAG_RW, 0,
-        "High kernel, proc, limits &c");
-----
-
 === devfs (Device file system) ===
 
 There is a minimal implementation based on IMFS. The mount point is fixed to
-- 
2.35.3



More information about the devel mailing list