mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-24 04:45:35 +00:00
56d213f16c
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Backports commit aafd758410015e08b1aa8964d739ba8587ce58dc from qemu
59 lines
1.1 KiB
C
59 lines
1.1 KiB
C
/*
|
|
* QEMU Module Infrastructure
|
|
*
|
|
* Copyright IBM, Corp. 2009
|
|
*
|
|
* Authors:
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
|
*
|
|
* 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/osdep.h"
|
|
#include "qemu-common.h"
|
|
#include "qemu/queue.h"
|
|
|
|
#include "uc_priv.h"
|
|
|
|
static void init_lists(struct uc_struct *uc)
|
|
{
|
|
int i;
|
|
|
|
for (i = 0; i < MODULE_INIT_MAX; i++) {
|
|
QTAILQ_INIT(&uc->init_type_list[i]);
|
|
}
|
|
}
|
|
|
|
|
|
static ModuleTypeList *find_type(struct uc_struct *uc, module_init_type type)
|
|
{
|
|
ModuleTypeList *l;
|
|
|
|
init_lists(uc);
|
|
|
|
l = &uc->init_type_list[type];
|
|
|
|
return l;
|
|
}
|
|
|
|
static void module_load(module_init_type type)
|
|
{
|
|
}
|
|
|
|
void module_call_init(struct uc_struct *uc, module_init_type type)
|
|
{
|
|
ModuleTypeList *l;
|
|
ModuleEntry *e;
|
|
|
|
module_load(type);
|
|
l = find_type(uc, type);
|
|
|
|
QTAILQ_FOREACH(e, l, node) {
|
|
e->init();
|
|
}
|
|
}
|