Subject: kern/23708: missing machdep sysctl entries
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <Richard@www.netbsd.org, Earnshaw@www.netbsd.org>
List: netbsd-bugs
Date: 12/10/2003 10:47:16
>Number:         23708
>Category:       kern
>Synopsis:       missing machdep sysctl entries
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 10 10:48:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     rearnsha@arm.com
>Release:        NetBSD 1.6ZG
>Organization:
ARM
>Environment:
NetBSD shark2 1.6ZG NetBSD 1.6ZG (INTEGRATOR) #1: Tue Dec  9 18:31:09 GMT 2003  rearnsha@pc960.cambridge.arm.com:/work/rearnsha/netbsd/build/src/evbarm/sys/arch/evbarm/compile/INTEGRATOR evbarm

>Description:
The kernel is missing several sysctl entries after the sysctl rewrite.
>How-To-Repeat:
build and boot an arm kernel.  The source code has:

        sysctl_createv(SYSCTL_PERMANENT,
                       CTLTYPE_NODE, "machdep", NULL,
                       NULL, 0, NULL, 0,
                       CTL_MACHDEP, CTL_EOL);

        sysctl_createv(SYSCTL_PERMANENT|SYSCTL_READWRITE,
                       CTLTYPE_STRUCT, "debug", NULL,
                       NULL, 0, &kernel_debug, 0,
                       CTL_MACHDEP, CPU_CONSDEV, CTL_EOL);
        sysctl_createv(SYSCTL_PERMANENT,
                       CTLTYPE_STRING, "booted_device", NULL,
                       sysctl_machdep_booted_device, 0, NULL, 0,
                       CTL_MACHDEP, CPU_BOOTED_DEVICE, CTL_EOL);
        sysctl_createv(SYSCTL_PERMANENT,
                       CTLTYPE_STRING, "booted_kernel", NULL,
                       sysctl_machdep_booted_kernel, 0, NULL, 0,
                       CTL_MACHDEP, CPU_BOOTED_KERNEL, CTL_EOL);
        sysctl_createv(SYSCTL_PERMANENT,
                       CTLTYPE_STRUCT, "console_device", NULL,
                       sysctl_consdev, 0, NULL, sizeof(dev_t),
                       CTL_MACHDEP, CPU_CONSDEV, CTL_EOL);
        sysctl_createv(SYSCTL_PERMANENT|SYSCTL_READWRITE,
                       CTLTYPE_INT, "powersave", NULL,
                       sysctl_machdep_powersave, 0, &cpu_do_powersave, 0,
                       CTL_MACHDEP, CPU_POWERSAVE, CTL_EOL);


But the running kernel only shows:

shark2 [213] $ /sbin/sysctl machdep
machdep.console_device = (null)
machdep.powersave = 0
shark2 [214] $
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: