X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/f7897430950ee94fb2dc4d6a5ca658d4909d9d85..fe1755cbb21c34a40234e2c380d049b9b031c4e2:/module.c diff --git a/module.c b/module.c index 3729283830..c3a6da7a86 100644 --- a/module.c +++ b/module.c @@ -9,20 +9,21 @@ * 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]; @@ -36,7 +37,7 @@ static void init_types(void) } for (i = 0; i < MODULE_INIT_MAX; i++) { - TAILQ_INIT(&init_type_list[i]); + QTAILQ_INIT(&init_type_list[i]); } inited = 1; @@ -59,12 +60,12 @@ void register_module_init(void (*fn)(void), module_init_type type) 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) @@ -74,7 +75,7 @@ void module_call_init(module_init_type type) l = find_type(type); - TAILQ_FOREACH(e, l, node) { + QTAILQ_FOREACH(e, l, node) { e->init(); } }