Add allocation subsystem
This commit is contained in:
parent
b60c6da764
commit
c846e03899
1
emu.h
1
emu.h
@ -36,6 +36,7 @@ enum nosv_thread_ss_state {
|
|||||||
ST_SCHED_HUNGRY = 6,
|
ST_SCHED_HUNGRY = 6,
|
||||||
ST_SCHED_SERVING = 7,
|
ST_SCHED_SERVING = 7,
|
||||||
ST_SCHED_SUBMITTING = 8,
|
ST_SCHED_SUBMITTING = 8,
|
||||||
|
ST_MEM_ALLOCATING = 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum nosv_thread_ss_event {
|
enum nosv_thread_ss_event {
|
||||||
|
@ -111,6 +111,21 @@ pre_submit(struct ovni_emu *emu)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
pre_memory(struct ovni_emu *emu)
|
||||||
|
{
|
||||||
|
struct ovni_ethread *th;
|
||||||
|
|
||||||
|
th = emu->cur_thread;
|
||||||
|
switch(emu->cur_ev->header.value)
|
||||||
|
{
|
||||||
|
case '[': ss_push(th, ST_MEM_ALLOCATING); break;
|
||||||
|
case ']': ss_pop(th); break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
hook_pre_nosv_ss(struct ovni_emu *emu)
|
hook_pre_nosv_ss(struct ovni_emu *emu)
|
||||||
{
|
{
|
||||||
@ -118,6 +133,7 @@ hook_pre_nosv_ss(struct ovni_emu *emu)
|
|||||||
{
|
{
|
||||||
case 'S': pre_sched(emu); break;
|
case 'S': pre_sched(emu); break;
|
||||||
case 'U': pre_submit(emu); break;
|
case 'U': pre_submit(emu); break;
|
||||||
|
case 'M': pre_memory(emu); break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
1
pcf.c
1
pcf.c
@ -122,6 +122,7 @@ struct event_value thread_ss_values[] = {
|
|||||||
{ EV_SCHED_SEND, "EV Scheduler: Send task" },
|
{ EV_SCHED_SEND, "EV Scheduler: Send task" },
|
||||||
{ EV_SCHED_RECV, "EV Scheduler: Recv task" },
|
{ EV_SCHED_RECV, "EV Scheduler: Recv task" },
|
||||||
{ EV_SCHED_SELF, "EV Scheduler: Self-assign task" },
|
{ EV_SCHED_SELF, "EV Scheduler: Self-assign task" },
|
||||||
|
{ ST_MEM_ALLOCATING, "Memory: Allocating" },
|
||||||
{ -1, NULL },
|
{ -1, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user