Software APIs
sw
device
lib
ujson
private_status.h
1
// Copyright lowRISC contributors (OpenTitan project).
2
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3
// SPDX-License-Identifier: Apache-2.0
4
5
#ifndef OPENTITAN_SW_DEVICE_LIB_UJSON_PRIVATE_STATUS_H_
6
#define OPENTITAN_SW_DEVICE_LIB_UJSON_PRIVATE_STATUS_H_
7
8
#include "sw/device/lib/ujson/ujson_derive.h"
9
10
#ifdef __cplusplus
11
extern
"C"
{
12
#endif
13
14
// Note: the PrivateStatus enum values must be in the same order as the
15
// values in //sw/device/lib/base/absl_status.h.
16
17
// clang-format off
18
#define ENUM_PRIVATE_STATUS(_, value) \
19
value(_, Ok) \
20
value(_, Cancelled) \
21
value(_, Unknown) \
22
value(_, InvalidArgument) \
23
value(_, DeadlineExceeded) \
24
value(_, NotFound) \
25
value(_, AlreadyExists) \
26
value(_, PermissionDenied) \
27
value(_, ResourceExhausted) \
28
value(_, FailedPrecondition) \
29
value(_, Aborted) \
30
value(_, OutOfRange) \
31
value(_, Unimplemented) \
32
value(_, Internal) \
33
value(_, Unavailable) \
34
value(_, DataLoss) \
35
value(_, Unauthenticated)
36
37
// We don't need a serialize implementation because the printf extension for
38
// status_t already serializes in a JSON-compatible form.
39
UJSON_DECLARE_ENUM(PrivateStatus, private_status_t, ENUM_PRIVATE_STATUS);
40
UJSON_DESERIALIZE_ENUM(PrivateStatus, private_status_t, ENUM_PRIVATE_STATUS);
41
42
#ifdef __cplusplus
43
}
44
#endif
45
#endif
// OPENTITAN_SW_DEVICE_LIB_UJSON_PRIVATE_STATUS_H_
Return to
OpenTitan Documentation