* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
*
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.
*/
#include "qemu-common.h"
-#include "sys-queue.h"
+#include "qemu-queue.h"
#include "module.h"
typedef struct ModuleEntry
{
- module_init_type type;
void (*init)(void);
- TAILQ_ENTRY(ModuleEntry) node;
+ QTAILQ_ENTRY(ModuleEntry) node;
} ModuleEntry;
-typedef TAILQ_HEAD(, ModuleEntry) ModuleTypeList;
+typedef QTAILQ_HEAD(, ModuleEntry) ModuleTypeList;
static ModuleTypeList init_type_list[MODULE_INIT_MAX];
}
for (i = 0; i < MODULE_INIT_MAX; i++) {
- TAILQ_INIT(&init_type_list[i]);
+ QTAILQ_INIT(&init_type_list[i]);
}
inited = 1;
ModuleEntry *e;
ModuleTypeList *l;
- e = qemu_mallocz(sizeof(*e));
+ e = g_malloc0(sizeof(*e));
e->init = fn;
l = find_type(type);
- TAILQ_INSERT_TAIL(l, e, node);
+ QTAILQ_INSERT_TAIL(l, e, node);
}
void module_call_init(module_init_type type)
l = find_type(type);
- TAILQ_FOREACH(e, l, node) {
+ QTAILQ_FOREACH(e, l, node) {
e->init();
}
}