Skip to content

Commit 14f30a2

Browse files
shiqingglijinxia
authored andcommitted
hv: clean up function definitions in npk_log.h
seperate the function definitions into debug/release directories to better distinguish debug/release libraries Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 0795660 commit 14f30a2

File tree

3 files changed

+43
-40
lines changed

3 files changed

+43
-40
lines changed

hypervisor/debug/npk_log.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,39 @@ static int32_t npk_log_setup_ref;
99
static bool npk_log_enabled;
1010
static uint64_t base;
1111

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+
1245
static inline int npk_write(const char *value, void *addr, size_t sz)
1346
{
1447
int ret = -1;

hypervisor/include/debug/npk_log.h

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,9 @@
66
#ifndef NPK_LOG_H
77
#define NPK_LOG_H
88

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-
299
struct hv_npk_log_param;
3010

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
4511
void npk_log_setup(struct hv_npk_log_param *param);
4612
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 */
5313

5414
#endif /* NPK_LOG_H */

hypervisor/release/npk_log.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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) {}

0 commit comments

Comments
 (0)