skip to content
==> include/mesh/manifest_encode.h <==
1/* @ajax/mesh-manifest-encode: the bytes a manifest puts in the mailbox, shared
2 * by meshd and kcheck (mesh-host manifest.rs encode_entry, encode_ext). */
3#ifndef MESH_MANIFEST_ENCODE_H
4#define MESH_MANIFEST_ENCODE_H
5
6#include "mesh/manifest.h"
7
8#include "mesh/abi/ext.h"
9#include "mesh/abi/program_table.h"
10
11#include <stdint.h>
12
13/* What the loader learned, beside the manifest. */
14typedef struct {
15    uint32_t view_off;
16    uint32_t reads_mask;
17    uint64_t ptx_hash;
18    uint32_t regs;
19    uint32_t code_bytes;
20    uint32_t rt_abi;
21    uint32_t loads;
22} mesh_image;
23
24/* The program-table entry (PT_*), with PT_STATE and PT_GEN zero: the writer
25 * sets them under the seqlock. */
26void mesh_manifest_encode_entry(const mesh_manifest *m, const mesh_image *im, uint8_t out[MESH_PT_BYTES]);
27/* The manifest extension (PX_*): counter names and fields. */
28void mesh_manifest_encode_ext(const mesh_manifest *m, uint8_t out[MESH_PX_BYTES]);
29
30#endif