From 9269dd7202406255a016efa065af49692ab8cf4c Mon Sep 17 00:00:00 2001 From: Kevin Sala Date: Thu, 3 Aug 2023 12:44:57 +0200 Subject: [PATCH] Add nosv create and destroy API subsystem states --- CHANGELOG.md | 1 + doc/user/emulation/events.md | 4 ++++ src/emu/nosv/event.c | 4 ++++ src/emu/nosv/nosv_priv.h | 2 ++ src/emu/nosv/setup.c | 2 ++ 5 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1093a4..47ee4d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `ovni_version_get()` function. - Add the `ovniver` program to report the libovni version and commit. +- Add nOS-V API subsystem events for `nosv_create()` and `nosv_destroy()`. ## [1.2.2] - 2022-07-26 diff --git a/doc/user/emulation/events.md b/doc/user/emulation/events.md index 550d1ee..5338d2f 100644 --- a/doc/user/emulation/events.md +++ b/doc/user/emulation/events.md @@ -58,6 +58,10 @@ VMA Ends allocating memory VMf Starts freeing memory VMF Ends freeing memory +VAr Enters nosv_create() +VAR Exits nosv_create() +VAd Enters nosv_destroy() +VAD Exits nosv_destroy() VAs Enters nosv_submit() VAS Exits nosv_submit() VAp Enters nosv_pause() diff --git a/src/emu/nosv/event.c b/src/emu/nosv/event.c index e3691eb..01c7197 100644 --- a/src/emu/nosv/event.c +++ b/src/emu/nosv/event.c @@ -41,6 +41,10 @@ static const int ss_table[256][256][3] = { ['F'] = { CHSS, POP, ST_MEM_FREEING }, }, ['A'] = { + ['r'] = { CHSS, PUSH, ST_API_CREATE }, + ['R'] = { CHSS, POP, ST_API_CREATE }, + ['d'] = { CHSS, PUSH, ST_API_DESTROY }, + ['D'] = { CHSS, POP, ST_API_DESTROY }, ['s'] = { CHSS, PUSH, ST_API_SUBMIT }, ['S'] = { CHSS, POP, ST_API_SUBMIT }, ['p'] = { CHSS, PUSH, ST_API_PAUSE }, diff --git a/src/emu/nosv/nosv_priv.h b/src/emu/nosv/nosv_priv.h index 677ace4..7d1e7c5 100644 --- a/src/emu/nosv/nosv_priv.h +++ b/src/emu/nosv/nosv_priv.h @@ -27,6 +27,8 @@ enum nosv_ss_values { ST_MEM_ALLOCATING, ST_MEM_FREEING, ST_TASK_RUNNING, + ST_API_CREATE, + ST_API_DESTROY, ST_API_SUBMIT, ST_API_PAUSE, ST_API_YIELD, diff --git a/src/emu/nosv/setup.c b/src/emu/nosv/setup.c index 7485e80..bae4fc7 100644 --- a/src/emu/nosv/setup.c +++ b/src/emu/nosv/setup.c @@ -84,6 +84,8 @@ static const struct pcf_value_label nosv_ss_values[] = { { ST_MEM_ALLOCATING, "Memory: Allocating" }, { ST_MEM_FREEING, "Memory: Freeing" }, { ST_TASK_RUNNING, "Task: Running" }, + { ST_API_CREATE, "API: Create" }, + { ST_API_DESTROY, "API: Destroy" }, { ST_API_SUBMIT, "API: Submit" }, { ST_API_PAUSE, "API: Pause" }, { ST_API_YIELD, "API: Yield" },