File tree Expand file tree Collapse file tree 3 files changed +43
-40
lines changed Expand file tree Collapse file tree 3 files changed +43
-40
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,39 @@ static int32_t npk_log_setup_ref;
9
9
static bool npk_log_enabled ;
10
10
static uint64_t base ;
11
11
12
+ #define HV_NPK_LOG_REF_SHIFT 2U
13
+ #define HV_NPK_LOG_REF_MASK ((1U << HV_NPK_LOG_REF_SHIFT) - 1U)
14
+
15
+ #define HV_NPK_LOG_MAX 1024U
16
+ #define HV_NPK_LOG_HDR 0x01000242U
17
+
18
+ enum {
19
+ HV_NPK_LOG_CMD_INVALID = 0U ,
20
+ HV_NPK_LOG_CMD_CONF ,
21
+ HV_NPK_LOG_CMD_ENABLE ,
22
+ HV_NPK_LOG_CMD_DISABLE ,
23
+ HV_NPK_LOG_CMD_QUERY ,
24
+ };
25
+
26
+ #define HV_NPK_LOG_RES_INVALID 0x0U
27
+ #define HV_NPK_LOG_RES_OK 0x1U
28
+ #define HV_NPK_LOG_RES_KO 0x2U
29
+ #define HV_NPK_LOG_RES_ENABLED 0x3U
30
+ #define HV_NPK_LOG_RES_DISABLED 0x4U
31
+
32
+ struct npk_chan {
33
+ uint64_t Dn ;
34
+ uint64_t DnM ;
35
+ uint64_t DnTS ;
36
+ uint64_t DnMTS ;
37
+ uint64_t USER ;
38
+ uint64_t USER_TS ;
39
+ uint32_t FLAG ;
40
+ uint32_t FLAG_TS ;
41
+ uint32_t MERR ;
42
+ uint32_t unused ;
43
+ } __packed ;
44
+
12
45
static inline int npk_write (const char * value , void * addr , size_t sz )
13
46
{
14
47
int ret = -1 ;
Original file line number Diff line number Diff line change 6
6
#ifndef NPK_LOG_H
7
7
#define NPK_LOG_H
8
8
9
- #define HV_NPK_LOG_REF_SHIFT 2U
10
- #define HV_NPK_LOG_REF_MASK ((1U << HV_NPK_LOG_REF_SHIFT) - 1U)
11
-
12
- #define HV_NPK_LOG_MAX 1024U
13
- #define HV_NPK_LOG_HDR 0x01000242U
14
-
15
- enum {
16
- HV_NPK_LOG_CMD_INVALID = 0U ,
17
- HV_NPK_LOG_CMD_CONF ,
18
- HV_NPK_LOG_CMD_ENABLE ,
19
- HV_NPK_LOG_CMD_DISABLE ,
20
- HV_NPK_LOG_CMD_QUERY ,
21
- };
22
-
23
- #define HV_NPK_LOG_RES_INVALID 0x0U
24
- #define HV_NPK_LOG_RES_OK 0x1U
25
- #define HV_NPK_LOG_RES_KO 0x2U
26
- #define HV_NPK_LOG_RES_ENABLED 0x3U
27
- #define HV_NPK_LOG_RES_DISABLED 0x4U
28
-
29
9
struct hv_npk_log_param ;
30
10
31
- struct npk_chan {
32
- uint64_t Dn ;
33
- uint64_t DnM ;
34
- uint64_t DnTS ;
35
- uint64_t DnMTS ;
36
- uint64_t USER ;
37
- uint64_t USER_TS ;
38
- uint32_t FLAG ;
39
- uint32_t FLAG_TS ;
40
- uint32_t MERR ;
41
- uint32_t unused ;
42
- } __packed ;
43
-
44
- #ifdef HV_DEBUG
45
11
void npk_log_setup (struct hv_npk_log_param * param );
46
12
void npk_log_write (const char * buf , size_t len );
47
- #else
48
- static inline void npk_log_setup (__unused struct hv_npk_log_param * param )
49
- {}
50
- static inline void npk_log_write (__unused const char * buf , __unused size_t len )
51
- {}
52
- #endif /* HV_DEBUG */
53
13
54
14
#endif /* NPK_LOG_H */
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (C) 2018 Intel Corporation. All rights reserved.
3
+ *
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+
7
+ #include <hypervisor.h>
8
+
9
+ void npk_log_setup (__unused struct hv_npk_log_param * param ) {}
10
+ void npk_log_write (__unused const char * buf , __unused size_t len ) {}
You can’t perform that action at this time.
0 commit comments