diff options
author | Eric Anholt <anholt@freebsd.org> | 2003-10-20 05:09:21 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2003-10-20 05:09:21 +0000 |
commit | ea7b4fdc225ebbbfd77f875fd3bfcfbdcfa9a1f7 (patch) | |
tree | a37f442a37d9e577110812486410c4c023bf43e6 /bsd/drm_memory_debug.h | |
parent | 6b0424fdcdec9d12943718e4542659c8bca019da (diff) |
Fix the possibility of sleeping with locks held in sysctls by copying the
data into temporary variables with the lock held then outputting to
sysctls with the lock released. Rearranged a little extra code to aid
this. Note that drm_memory_debug.h hasn't had this fix applied, but I
consider that code to be just about dead anyway.
Diffstat (limited to 'bsd/drm_memory_debug.h')
-rw-r--r-- | bsd/drm_memory_debug.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bsd/drm_memory_debug.h b/bsd/drm_memory_debug.h index c4bad089..d211b76b 100644 --- a/bsd/drm_memory_debug.h +++ b/bsd/drm_memory_debug.h @@ -32,6 +32,14 @@ #include "drmP.h" +#define DRM_SYSCTL_PRINT(fmt, arg...) \ +do { \ + snprintf(buf, sizeof(buf), fmt, ##arg); \ + error = SYSCTL_OUT(req, buf, strlen(buf)); \ + if (error) \ + return error; \ +} while (0) + typedef struct drm_mem_stats { const char *name; int succeed_count; |