]> git.proxmox.com Git - qemu.git/blobdiff - module.c
prep: Initialize PC speaker
[qemu.git] / module.c
index 3729283830b795609abdea0caf3481bdc2859a94..c3a6da7a86712cd141acfce06c08cabde80c2dbc 100644 (file)
--- 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();
     }
 }