Compile fixes:

Remove duplicate "debug_ktr.mask" sysctl definition.
Remove now unused variable from "kern_ktr.c".
This fixes build of "ktr" which was broken by r267961.

Let the default value for "vm_kmem_size_scale" be zero. It is setup
after that the sysctl has been initialized from "getenv()" in the
"kmeminit()" function to equal the "VM_KMEM_SIZE_MAX" value, if
zero. On Sparc64 the "VM_KMEM_SIZE_MAX" macro is not a constant. This
fixes build of Sparc64 which was broken by r267961.

Add a special macro to dynamically create SYSCTL root nodes, because
root nodes have a special parent. This fixes build of existing OFED
module and CANBUS module for pc98 which was broken by r267961.

Add missing "sysctl.h" includes to get the needed sysctl header file
declarations. This is needed after r267961.

MFC after:	2 weeks
This commit is contained in:
Hans Petter Selasky 2014-06-28 17:36:18 +00:00
parent a88289fcb9
commit 4813ad54f8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268005
7 changed files with 11 additions and 10 deletions

View File

@ -102,13 +102,9 @@ int ktr_version = KTR_VERSION;
struct ktr_entry ktr_buf_init[KTR_BOOT_ENTRIES];
struct ktr_entry *ktr_buf = ktr_buf_init;
cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK);
static char ktr_cpumask_str[CPUSETBUFSIZ];
static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options");
SYSCTL_INT(_debug_ktr, OID_AUTO, mask, CTLFLAG_RDTUN,
&ktr_mask, 0, "KTR mask");
SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD,
&ktr_version, 0, "Version of the KTR interface");
@ -175,7 +171,7 @@ sysctl_debug_ktr_mask(SYSCTL_HANDLER_ARGS)
return (error);
}
SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, CTLTYPE_UINT|CTLFLAG_RW, 0, 0,
SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, CTLTYPE_UINT|CTLFLAG_RWTUN, 0, 0,
sysctl_debug_ktr_mask, "IU",
"Bitmask of KTR event classes for which logging is enabled");

View File

@ -191,7 +191,7 @@ static u_long vm_kmem_size_max;
SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RDTUN, &vm_kmem_size_max, 0,
"Maximum size of kernel memory");
static u_int vm_kmem_size_scale = VM_KMEM_SIZE_SCALE;
static u_int vm_kmem_size_scale;
SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0,
"Scale factor for kernel memory size");

View File

@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/route.h>
#include <net/vnet.h>
#include <sys/sysctl.h>
uma_zone_t sdp_zone;
struct rwlock sdp_lock;

View File

@ -42,6 +42,7 @@
#include <net/ethernet.h>
#include <net/if_vlan_var.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
static void mlx4_en_init_locked(struct mlx4_en_priv *priv);
static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv);

View File

@ -678,7 +678,7 @@ linux_compat_init(void)
struct sysctl_oid *rootoid;
int i;
rootoid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(),
rootoid = SYSCTL_ADD_ROOT_NODE(NULL,
OID_AUTO, "sys", CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, "sys");
kobject_init(&class_root, &class_ktype);
kobject_set_name(&class_root, "class");

View File

@ -188,9 +188,8 @@ canbus_attach(device_t dev)
/* Dynamic sysctl tree setup */
sysctl_ctx_init(&sc->canbus_sysctl_ctx);
canbus_sysctl_tree = SYSCTL_ADD_NODE(&sc->canbus_sysctl_ctx,
SYSCTL_STATIC_CHILDREN(/* tree top */), OID_AUTO,
"canbus", CTLFLAG_RD, 0, "CanBe I/O Bus");
canbus_sysctl_tree = SYSCTL_ADD_ROOT_NODE(&sc->canbus_sysctl_ctx,
OID_AUTO, "canbus", CTLFLAG_RD, 0, "CanBe I/O Bus");
SYSCTL_ADD_INT(&sc->canbus_sysctl_ctx,
SYSCTL_CHILDREN(canbus_sysctl_tree), OID_AUTO, "io_delay_time",
CTLFLAG_RW, &sc->io_delay_time, 0, "CanBe Bus I/O delay time");

View File

@ -325,6 +325,10 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a; unsigned long long *b; );
sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access), \
NULL, 0, handler, "N", __DESCR(descr))
#define SYSCTL_ADD_ROOT_NODE(ctx, nbr, name, access, handler, descr) \
sysctl_add_oid(ctx, &sysctl__children, nbr, name, \
CTLTYPE_NODE|(access), NULL, 0, handler, "N", __DESCR(descr))
/* Oid for a string. len can be 0 to indicate '\0' termination. */
#define SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \