Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm/dist/bsd-core use a sysctllog structure...



details:   https://anonhg.NetBSD.org/src/rev/901d01dab2b8
branches:  trunk
changeset: 758595:901d01dab2b8
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Nov 10 05:22:55 2010 +0000

description:
use a sysctllog structure, and sysctl_teardown(), to destroy the drm data.

this should actually now fix PR#40029.

diffstat:

 sys/external/bsd/drm/dist/bsd-core/drm_sysctl.c |  24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diffs (63 lines):

diff -r b735665066d4 -r 901d01dab2b8 sys/external/bsd/drm/dist/bsd-core/drm_sysctl.c
--- a/sys/external/bsd/drm/dist/bsd-core/drm_sysctl.c   Wed Nov 10 04:08:56 2010 +0000
+++ b/sys/external/bsd/drm/dist/bsd-core/drm_sysctl.c   Wed Nov 10 05:22:55 2010 +0000
@@ -55,6 +55,7 @@
        const struct sysctlnode *dri, *dri_card, *dri_debug;
        const struct sysctlnode *dri_rest[DRM_SYSCTL_ENTRIES];
        char                   name[7];
+       struct sysctllog       *log;
 #endif
 };
 
@@ -112,17 +113,17 @@
            CTLFLAG_RW, &drm_debug_flag, sizeof(drm_debug_flag),
            "Enable debugging output");
 #elif   defined(__NetBSD__)
-       sysctl_createv(NULL, 0, NULL, &info->dri,
+       sysctl_createv(&info->log, 0, NULL, &info->dri,
                        CTLFLAG_READWRITE, CTLTYPE_NODE,
                        "dri", SYSCTL_DESCR("DRI Graphics"), NULL, 0, NULL, 0,
                        CTL_HW, CTL_CREATE);
        snprintf(info->name, 7, "card%d", minor(dev->kdev));
-       sysctl_createv(NULL, 0, NULL, &info->dri_card,
+       sysctl_createv(&info->log, 0, NULL, &info->dri_card,
                        CTLFLAG_READWRITE, CTLTYPE_NODE,
                        info->name, NULL, NULL, 0, NULL, 0,
                        CTL_HW, info->dri->sysctl_num, CTL_CREATE);
        for (i = 0; i < DRM_SYSCTL_ENTRIES; i++)
-               sysctl_createv(NULL, 0, NULL, &(info->dri_rest[i]),
+               sysctl_createv(&info->log, 0, NULL, &(info->dri_rest[i]),
                                CTLFLAG_READONLY, CTLTYPE_STRING,
                                drm_sysctl_list[i].name, NULL,
                                drm_sysctl_list[i].f, 0, dev,
@@ -130,7 +131,7 @@
                                CTL_HW,
                                info->dri->sysctl_num,
                                info->dri_card->sysctl_num, CTL_CREATE);
-       sysctl_createv(NULL, 0, NULL, &info->dri_debug,
+       sysctl_createv(&info->log, 0, NULL, &info->dri_debug,
                        CTLFLAG_READWRITE, CTLTYPE_INT,
                        "debug", SYSCTL_DESCR("Enable debugging output"),
                        NULL, 0,
@@ -152,20 +153,7 @@
 
        return error;
 #elif   defined(__NetBSD__)
-       int i;
-
-       sysctl_destroyv(NULL, CTL_HW, dev->sysctl->dri->sysctl_num,
-                                     dev->sysctl->dri_debug->sysctl_num,
-                                     CTL_DESTROY);
-       for (i = 0; i < DRM_SYSCTL_ENTRIES; i++)
-               sysctl_destroyv(NULL, CTL_HW, dev->sysctl->dri->sysctl_num,
-                                             dev->sysctl->dri_card->sysctl_num,
-                                          dev->sysctl->dri_rest[i]->sysctl_num,
-                                             CTL_DESTROY);
-       sysctl_destroyv(NULL, CTL_HW, dev->sysctl->dri->sysctl_num,
-                                     dev->sysctl->dri_card->sysctl_num,
-                                     CTL_DESTROY);
-       sysctl_destroyv(NULL, CTL_HW, dev->sysctl->dri->sysctl_num, CTL_DESTROY);
+       sysctl_teardown(&dev->sysctl->log);
 
        free(dev->sysctl, DRM_MEM_DRIVER);
        dev->sysctl = NULL;



Home | Main Index | Thread Index | Old Index