Prefix model functions to prevent clashes
This commit is contained in:
parent
4aebe81940
commit
17a0d241f6
@ -50,12 +50,12 @@ process_ev(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
kernel_event(struct emu *emu)
|
model_kernel_event(struct emu *emu)
|
||||||
{
|
{
|
||||||
static int enabled = 0;
|
static int enabled = 0;
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
if (kernel_connect(emu) != 0) {
|
if (model_kernel_connect(emu) != 0) {
|
||||||
err("kernel_connect failed");
|
err("kernel_connect failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,10 @@ struct kernel_cpu {
|
|||||||
struct model_cpu m;
|
struct model_cpu m;
|
||||||
};
|
};
|
||||||
|
|
||||||
int kernel_probe(struct emu *emu);
|
int model_kernel_probe(struct emu *emu);
|
||||||
int kernel_create(struct emu *emu);
|
int model_kernel_create(struct emu *emu);
|
||||||
int kernel_connect(struct emu *emu);
|
int model_kernel_connect(struct emu *emu);
|
||||||
int kernel_event(struct emu *emu);
|
int model_kernel_event(struct emu *emu);
|
||||||
int kernel_finish(struct emu *emu);
|
int model_kernel_finish(struct emu *emu);
|
||||||
|
|
||||||
#endif /* KERNEL_PRIV_H */
|
#endif /* KERNEL_PRIV_H */
|
||||||
|
@ -8,10 +8,10 @@ enum { model_id = 'K' };
|
|||||||
struct model_spec model_kernel = {
|
struct model_spec model_kernel = {
|
||||||
.name = model_name,
|
.name = model_name,
|
||||||
.model = model_id,
|
.model = model_id,
|
||||||
.create = kernel_create,
|
.create = model_kernel_create,
|
||||||
// .connect = kernel_connect,
|
// .connect = model_kernel_connect,
|
||||||
.event = kernel_event,
|
.event = model_kernel_event,
|
||||||
.probe = kernel_probe,
|
.probe = model_kernel_probe,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- channels ------------------ */
|
/* ----------------- channels ------------------ */
|
||||||
@ -101,7 +101,7 @@ static const struct model_thread_spec th_spec = {
|
|||||||
/* ----------------------------------------------------- */
|
/* ----------------------------------------------------- */
|
||||||
|
|
||||||
int
|
int
|
||||||
kernel_probe(struct emu *emu)
|
model_kernel_probe(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (emu->system.nthreads == 0)
|
if (emu->system.nthreads == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -110,7 +110,7 @@ kernel_probe(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
kernel_create(struct emu *emu)
|
model_kernel_create(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_create(emu, &th_spec) != 0) {
|
if (model_thread_create(emu, &th_spec) != 0) {
|
||||||
err("model_thread_init failed");
|
err("model_thread_init failed");
|
||||||
@ -126,7 +126,7 @@ kernel_create(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
kernel_connect(struct emu *emu)
|
model_kernel_connect(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_connect(emu, &th_spec) != 0) {
|
if (model_thread_connect(emu, &th_spec) != 0) {
|
||||||
err("model_thread_connect failed");
|
err("model_thread_connect failed");
|
||||||
|
@ -506,12 +506,12 @@ process_ev(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nanos6_event(struct emu *emu)
|
model_nanos6_event(struct emu *emu)
|
||||||
{
|
{
|
||||||
static int enabled = 0;
|
static int enabled = 0;
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
if (nanos6_connect(emu) != 0) {
|
if (model_nanos6_connect(emu) != 0) {
|
||||||
err("nanos6_connect failed");
|
err("nanos6_connect failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -73,10 +73,10 @@ struct nanos6_proc {
|
|||||||
struct task_info task_info;
|
struct task_info task_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
int nanos6_probe(struct emu *emu);
|
int model_nanos6_probe(struct emu *emu);
|
||||||
int nanos6_create(struct emu *emu);
|
int model_nanos6_create(struct emu *emu);
|
||||||
int nanos6_connect(struct emu *emu);
|
int model_nanos6_connect(struct emu *emu);
|
||||||
int nanos6_event(struct emu *emu);
|
int model_nanos6_event(struct emu *emu);
|
||||||
int nanos6_finish(struct emu *emu);
|
int model_nanos6_finish(struct emu *emu);
|
||||||
|
|
||||||
#endif /* NANOS6_PRIV_H */
|
#endif /* NANOS6_PRIV_H */
|
||||||
|
@ -8,11 +8,11 @@ enum { model_id = '6' };
|
|||||||
struct model_spec model_nanos6 = {
|
struct model_spec model_nanos6 = {
|
||||||
.name = model_name,
|
.name = model_name,
|
||||||
.model = model_id,
|
.model = model_id,
|
||||||
.create = nanos6_create,
|
.create = model_nanos6_create,
|
||||||
// .connect = nanos6_connect,
|
// .connect = model_nanos6_connect,
|
||||||
.event = nanos6_event,
|
.event = model_nanos6_event,
|
||||||
.probe = nanos6_probe,
|
.probe = model_nanos6_probe,
|
||||||
.finish = nanos6_finish,
|
.finish = model_nanos6_finish,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- channels ------------------ */
|
/* ----------------- channels ------------------ */
|
||||||
@ -164,7 +164,7 @@ static const struct model_thread_spec th_spec = {
|
|||||||
/* ----------------------------------------------------- */
|
/* ----------------------------------------------------- */
|
||||||
|
|
||||||
int
|
int
|
||||||
nanos6_probe(struct emu *emu)
|
model_nanos6_probe(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (emu->system.nthreads == 0)
|
if (emu->system.nthreads == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -187,7 +187,7 @@ init_proc(struct proc *sysproc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nanos6_create(struct emu *emu)
|
model_nanos6_create(struct emu *emu)
|
||||||
{
|
{
|
||||||
struct system *sys = &emu->system;
|
struct system *sys = &emu->system;
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ nanos6_create(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nanos6_connect(struct emu *emu)
|
model_nanos6_connect(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_connect(emu, &th_spec) != 0) {
|
if (model_thread_connect(emu, &th_spec) != 0) {
|
||||||
err("model_thread_connect failed");
|
err("model_thread_connect failed");
|
||||||
@ -292,7 +292,7 @@ finish_pvt(struct emu *emu, const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nanos6_finish(struct emu *emu)
|
model_nanos6_finish(struct emu *emu)
|
||||||
{
|
{
|
||||||
/* Fill task types */
|
/* Fill task types */
|
||||||
if (finish_pvt(emu, "thread") != 0) {
|
if (finish_pvt(emu, "thread") != 0) {
|
||||||
|
@ -92,12 +92,12 @@ process_ev(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nodes_event(struct emu *emu)
|
model_nodes_event(struct emu *emu)
|
||||||
{
|
{
|
||||||
static int enabled = 0;
|
static int enabled = 0;
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
if (nodes_connect(emu) != 0) {
|
if (model_nodes_connect(emu) != 0) {
|
||||||
err("nodes_connect failed");
|
err("nodes_connect failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,10 @@ struct nodes_cpu {
|
|||||||
struct model_cpu m;
|
struct model_cpu m;
|
||||||
};
|
};
|
||||||
|
|
||||||
int nodes_probe(struct emu *emu);
|
int model_nodes_probe(struct emu *emu);
|
||||||
int nodes_create(struct emu *emu);
|
int model_nodes_create(struct emu *emu);
|
||||||
int nodes_connect(struct emu *emu);
|
int model_nodes_connect(struct emu *emu);
|
||||||
int nodes_event(struct emu *emu);
|
int model_nodes_event(struct emu *emu);
|
||||||
int nodes_finish(struct emu *emu);
|
int model_nodes_finish(struct emu *emu);
|
||||||
|
|
||||||
#endif /* NODES_PRIV_H */
|
#endif /* NODES_PRIV_H */
|
||||||
|
@ -8,11 +8,11 @@ enum { model_id = 'D' };
|
|||||||
struct model_spec model_nodes = {
|
struct model_spec model_nodes = {
|
||||||
.name = model_name,
|
.name = model_name,
|
||||||
.model = model_id,
|
.model = model_id,
|
||||||
.create = nodes_create,
|
.create = model_nodes_create,
|
||||||
// .connect = nodes_connect,
|
// .connect = model_nodes_connect,
|
||||||
.event = nodes_event,
|
.event = model_nodes_event,
|
||||||
.probe = nodes_probe,
|
.probe = model_nodes_probe,
|
||||||
.finish = nodes_finish,
|
.finish = model_nodes_finish,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- channels ------------------ */
|
/* ----------------- channels ------------------ */
|
||||||
@ -109,7 +109,7 @@ static const struct model_thread_spec th_spec = {
|
|||||||
/* ----------------------------------------------------- */
|
/* ----------------------------------------------------- */
|
||||||
|
|
||||||
int
|
int
|
||||||
nodes_probe(struct emu *emu)
|
model_nodes_probe(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (emu->system.nthreads == 0)
|
if (emu->system.nthreads == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -118,7 +118,7 @@ nodes_probe(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nodes_create(struct emu *emu)
|
model_nodes_create(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_create(emu, &th_spec) != 0) {
|
if (model_thread_create(emu, &th_spec) != 0) {
|
||||||
err("model_thread_init failed");
|
err("model_thread_init failed");
|
||||||
@ -134,7 +134,7 @@ nodes_create(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nodes_connect(struct emu *emu)
|
model_nodes_connect(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_connect(emu, &th_spec) != 0) {
|
if (model_thread_connect(emu, &th_spec) != 0) {
|
||||||
err("model_thread_connect failed");
|
err("model_thread_connect failed");
|
||||||
@ -180,7 +180,7 @@ end_lint(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nodes_finish(struct emu *emu)
|
model_nodes_finish(struct emu *emu)
|
||||||
{
|
{
|
||||||
/* When running in linter mode perform additional checks */
|
/* When running in linter mode perform additional checks */
|
||||||
if (emu->args.linter_mode && end_lint(emu) != 0) {
|
if (emu->args.linter_mode && end_lint(emu) != 0) {
|
||||||
|
@ -505,12 +505,12 @@ process_ev(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nosv_event(struct emu *emu)
|
model_nosv_event(struct emu *emu)
|
||||||
{
|
{
|
||||||
static int enabled = 0;
|
static int enabled = 0;
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
if (nosv_connect(emu) != 0) {
|
if (model_nosv_connect(emu) != 0) {
|
||||||
err("nosv_connect failed");
|
err("nosv_connect failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -54,10 +54,10 @@ struct nosv_proc {
|
|||||||
struct task_info task_info;
|
struct task_info task_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
int nosv_probe(struct emu *emu);
|
int model_nosv_probe(struct emu *emu);
|
||||||
int nosv_create(struct emu *emu);
|
int model_nosv_create(struct emu *emu);
|
||||||
int nosv_connect(struct emu *emu);
|
int model_nosv_connect(struct emu *emu);
|
||||||
int nosv_event(struct emu *emu);
|
int model_nosv_event(struct emu *emu);
|
||||||
int nosv_finish(struct emu *emu);
|
int model_nosv_finish(struct emu *emu);
|
||||||
|
|
||||||
#endif /* NOSV_PRIV_H */
|
#endif /* NOSV_PRIV_H */
|
||||||
|
@ -8,11 +8,11 @@ enum { model_id = 'V' };
|
|||||||
struct model_spec model_nosv = {
|
struct model_spec model_nosv = {
|
||||||
.name = model_name,
|
.name = model_name,
|
||||||
.model = model_id,
|
.model = model_id,
|
||||||
.create = nosv_create,
|
.create = model_nosv_create,
|
||||||
// .connect = nosv_connect,
|
// .connect = model_nosv_connect,
|
||||||
.event = nosv_event,
|
.event = model_nosv_event,
|
||||||
.probe = nosv_probe,
|
.probe = model_nosv_probe,
|
||||||
.finish = nosv_finish,
|
.finish = model_nosv_finish,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- channels ------------------ */
|
/* ----------------- channels ------------------ */
|
||||||
@ -166,7 +166,7 @@ static const struct model_cpu_spec cpu_spec = {
|
|||||||
/* ----------------------------------------------------- */
|
/* ----------------------------------------------------- */
|
||||||
|
|
||||||
int
|
int
|
||||||
nosv_probe(struct emu *emu)
|
model_nosv_probe(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (emu->system.nthreads == 0)
|
if (emu->system.nthreads == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -189,7 +189,7 @@ init_proc(struct proc *sysproc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nosv_create(struct emu *emu)
|
model_nosv_create(struct emu *emu)
|
||||||
{
|
{
|
||||||
struct system *sys = &emu->system;
|
struct system *sys = &emu->system;
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ nosv_create(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nosv_connect(struct emu *emu)
|
model_nosv_connect(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_connect(emu, &th_spec) != 0) {
|
if (model_thread_connect(emu, &th_spec) != 0) {
|
||||||
err("model_thread_connect failed");
|
err("model_thread_connect failed");
|
||||||
@ -294,7 +294,7 @@ finish_pvt(struct emu *emu, const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nosv_finish(struct emu *emu)
|
model_nosv_finish(struct emu *emu)
|
||||||
{
|
{
|
||||||
/* Fill task types */
|
/* Fill task types */
|
||||||
if (finish_pvt(emu, "thread") != 0) {
|
if (finish_pvt(emu, "thread") != 0) {
|
||||||
|
@ -453,7 +453,7 @@ process_ev(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ovni_event(struct emu *emu)
|
model_ovni_event(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (emu->ev->m != 'O') {
|
if (emu->ev->m != 'O') {
|
||||||
err("unexpected event model %c\n", emu->ev->m);
|
err("unexpected event model %c\n", emu->ev->m);
|
||||||
|
@ -39,10 +39,10 @@ struct ovni_cpu {
|
|||||||
struct model_cpu m;
|
struct model_cpu m;
|
||||||
};
|
};
|
||||||
|
|
||||||
int ovni_probe(struct emu *emu);
|
int model_ovni_probe(struct emu *emu);
|
||||||
int ovni_create(struct emu *emu);
|
int model_ovni_create(struct emu *emu);
|
||||||
int ovni_connect(struct emu *emu);
|
int model_ovni_connect(struct emu *emu);
|
||||||
int ovni_event(struct emu *emu);
|
int model_ovni_event(struct emu *emu);
|
||||||
int ovni_finish(struct emu *emu);
|
int model_ovni_finish(struct emu *emu);
|
||||||
|
|
||||||
#endif /* OVNI_PRIV_H */
|
#endif /* OVNI_PRIV_H */
|
||||||
|
@ -8,11 +8,11 @@ enum { model_id = 'O' };
|
|||||||
struct model_spec model_ovni = {
|
struct model_spec model_ovni = {
|
||||||
.name = model_name,
|
.name = model_name,
|
||||||
.model = model_id,
|
.model = model_id,
|
||||||
.create = ovni_create,
|
.create = model_ovni_create,
|
||||||
.connect = ovni_connect,
|
.connect = model_ovni_connect,
|
||||||
.event = ovni_event,
|
.event = model_ovni_event,
|
||||||
.probe = ovni_probe,
|
.probe = model_ovni_probe,
|
||||||
.finish = ovni_finish,
|
.finish = model_ovni_finish,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- channels ------------------ */
|
/* ----------------- channels ------------------ */
|
||||||
@ -100,7 +100,7 @@ static const struct model_thread_spec th_spec = {
|
|||||||
/* ----------------------------------------------------- */
|
/* ----------------------------------------------------- */
|
||||||
|
|
||||||
int
|
int
|
||||||
ovni_probe(struct emu *emu)
|
model_ovni_probe(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (emu->system.nthreads == 0)
|
if (emu->system.nthreads == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -109,7 +109,7 @@ ovni_probe(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ovni_create(struct emu *emu)
|
model_ovni_create(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_create(emu, &th_spec) != 0) {
|
if (model_thread_create(emu, &th_spec) != 0) {
|
||||||
err("model_thread_init failed");
|
err("model_thread_init failed");
|
||||||
@ -125,7 +125,7 @@ ovni_create(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ovni_connect(struct emu *emu)
|
model_ovni_connect(struct emu *emu)
|
||||||
{
|
{
|
||||||
if (model_thread_connect(emu, &th_spec) != 0) {
|
if (model_thread_connect(emu, &th_spec) != 0) {
|
||||||
err("model_thread_connect failed");
|
err("model_thread_connect failed");
|
||||||
@ -141,7 +141,7 @@ ovni_connect(struct emu *emu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ovni_finish(struct emu *emu)
|
model_ovni_finish(struct emu *emu)
|
||||||
{
|
{
|
||||||
/* Skip the check if the we are stopping prematurely */
|
/* Skip the check if the we are stopping prematurely */
|
||||||
if (!emu->finished)
|
if (!emu->finished)
|
||||||
|
Loading…
Reference in New Issue
Block a user