⬢ DragonFlyBSD Kernel Audit
DF-2916 / sq16.c
← back to finding ↓ download raw
/*
 * DF-2916 consumer module: uses the documented sleepq_set_timeout() macro.
 * Build on stock kernel: MUST FAIL with tick_sbt / C_HARDCLOCK undeclared.
 */
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/module.h>
#include <sys/sleepqueue.h>

static int
sq16_modevent(module_t mod, int type, void *data)
{
	switch (type) {
	case MOD_LOAD: {
		int timo = 50;	/* caller means 500ms at hz=100 */
		sleepq_set_timeout((void *)0x1000, timo);
		return (0);
	}
	}
	return (EOPNOTSUPP);
}
static moduledata_t sq16_mod = { "sq16", sq16_modevent, 0 };
DECLARE_MODULE(sq16, sq16_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);