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