2024-02-14 13:23:28 +01:00
|
|
|
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
|
2022-09-19 12:39:02 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2022-08-25 18:56:55 +02:00
|
|
|
#ifndef INSTR_NOSV_H
|
|
|
|
#define INSTR_NOSV_H
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2023-03-22 16:01:55 +01:00
|
|
|
#include "instr.h"
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2023-02-24 11:57:00 +01:00
|
|
|
#include "task.h"
|
|
|
|
|
2023-11-10 12:34:57 +01:00
|
|
|
static inline void
|
|
|
|
instr_nosv_init(void)
|
|
|
|
{
|
|
|
|
instr_require("nosv");
|
|
|
|
}
|
|
|
|
|
2023-02-24 11:57:00 +01:00
|
|
|
static inline uint32_t
|
2022-08-23 16:40:44 +02:00
|
|
|
instr_nosv_type_create(int32_t typeid)
|
|
|
|
{
|
|
|
|
struct ovni_ev ev = {0};
|
|
|
|
|
|
|
|
ovni_ev_set_mcv(&ev, "VYc");
|
2023-02-24 11:55:54 +01:00
|
|
|
ovni_ev_set_clock(&ev, get_clock());
|
2022-08-23 16:40:44 +02:00
|
|
|
|
|
|
|
char buf[256];
|
|
|
|
char *p = buf;
|
|
|
|
|
|
|
|
size_t nbytes = 0;
|
|
|
|
memcpy(buf, &typeid, sizeof(typeid));
|
|
|
|
p += sizeof(typeid);
|
|
|
|
nbytes += sizeof(typeid);
|
|
|
|
sprintf(p, "testtype%d", typeid);
|
|
|
|
nbytes += strlen(p) + 1;
|
|
|
|
|
|
|
|
ovni_ev_jumbo_emit(&ev, (uint8_t *) buf, nbytes);
|
2023-02-24 11:57:00 +01:00
|
|
|
|
|
|
|
return task_get_type_gid(p);
|
2022-08-23 16:40:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
INSTR_2ARG(instr_nosv_task_create, "VTc", int32_t, id, uint32_t, typeid)
|
|
|
|
INSTR_1ARG(instr_nosv_task_execute, "VTx", int32_t, id)
|
|
|
|
INSTR_1ARG(instr_nosv_task_pause, "VTp", int32_t, id)
|
|
|
|
INSTR_1ARG(instr_nosv_task_resume, "VTr", int32_t, id)
|
|
|
|
INSTR_1ARG(instr_nosv_task_end, "VTe", int32_t, id)
|
|
|
|
|
2023-02-16 16:07:19 +01:00
|
|
|
INSTR_0ARG(instr_nosv_submit_enter, "VAs")
|
|
|
|
INSTR_0ARG(instr_nosv_submit_exit, "VAS")
|
2024-02-14 13:23:28 +01:00
|
|
|
INSTR_0ARG(instr_nosv_attach_enter, "VAa")
|
|
|
|
INSTR_0ARG(instr_nosv_attach_exit, "VAA")
|
|
|
|
INSTR_0ARG(instr_nosv_detach_enter, "VAe")
|
|
|
|
INSTR_0ARG(instr_nosv_detach_exit, "VAE")
|
|
|
|
INSTR_0ARG(instr_nosv_attached, "VHa") /* deprecated */
|
|
|
|
INSTR_0ARG(instr_nosv_detached, "VHA") /* deprecated */
|
2023-02-16 16:07:19 +01:00
|
|
|
|
2022-08-23 16:40:44 +02:00
|
|
|
|
2022-08-25 18:56:55 +02:00
|
|
|
#endif /* INSTR_NOSV_H */
|