Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 1999 17:36:00 +0000 (GMT)
From:      Doug Rabson <dfr@nlsystems.com>
To:        current@FreeBSD.ORG
Subject:   Dynamic sysctl registration
Message-ID:  <Pine.BSF.4.01.9901251726100.59627-100000@herring.nlsystems.com>

next in thread | raw e-mail | index | archive | help
I've made some changes to sysctl to allow nodes to be declared dynamically
either by loading kld modules which contain SYSCTL declarations or, in
theory, by generating oids from some other kernel data such as the device
tree.

To recap for those that are interested, the existing scheme uses linker
sets to represent interior nodes of the tree.  Each child node has a
pointer in its parent's linker set (contained in the parent's oid_arg1
field).  This is hard to make dynamic because linker sets can't easily be
extended without wastefully allocating and reallocating memory.

I have changed the code to use an SLIST to store the list of children for
an interior node.  This has the advantage that nodes can be easily added
and removed.  There is an associated cost (about 8 bytes per node on i386)
which I think is reasonable.  All the oids in the kernel (or kld module)
are collected together in a single linker set from which the tree is
constructed by threading the oids onto their parent's list.

The kernel-user interface is completely unchanged.

If anyone is interested in seeing diffs (approx 23k), please contact me.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 442 9037



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.9901251726100.59627-100000>