Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 :
11 : #include "task_queue.h"
12 : #include "tdt/status.h"
13 : #include "ascend_hal.h"
14 :
15 1 : int SetQueueWorkMode(unsigned int devid, unsigned int qid, int mode)
16 : {
17 : (void)devid;
18 : (void)qid;
19 : (void)mode;
20 1 : return DRV_ERROR_NONE;
21 : }
22 :
23 1 : drvError_t halQueueInit(unsigned int devid)
24 : {
25 : (void)devid;
26 1 : return DRV_ERROR_NONE;
27 : }
28 :
29 1 : drvError_t halQueueSubscribe(unsigned int devid, unsigned int qid, unsigned int groupId, int type)
30 : {
31 : (void)devid;
32 : (void)qid;
33 : (void)groupId;
34 : (void)type;
35 1 : return DRV_ERROR_NONE;
36 : }
37 :
38 1 : drvError_t halQueueUnsubscribe(unsigned int devid, unsigned int qid)
39 : {
40 : (void)devid;
41 : (void)qid;
42 1 : return DRV_ERROR_NONE;
43 : }
44 :
45 1 : drvError_t halQueueSubF2NFEvent(unsigned int devid, unsigned int qid, unsigned int groupid)
46 : {
47 : (void)devid;
48 : (void)qid;
49 : (void)groupid;
50 1 : return DRV_ERROR_NONE;
51 : }
52 :
53 1 : drvError_t halQueueUnsubF2NFEvent(unsigned int devid, unsigned int qid)
54 : {
55 : (void)devid;
56 : (void)qid;
57 1 : return DRV_ERROR_NONE;
58 : }
59 :
60 1 : drvError_t halQueueDeQueue(unsigned int devId, unsigned int qid, void **mbuf)
61 : {
62 : (void)devId;
63 : (void)qid;
64 : (void)mbuf;
65 1 : return DRV_ERROR_NONE;
66 : }
67 :
68 1 : drvError_t halQueueEnQueue(unsigned int devId, unsigned int qid, void *mbuf)
69 : {
70 : (void)devId;
71 : (void)qid;
72 : (void)mbuf;
73 1 : return DRV_ERROR_NONE;
74 : }
75 :
76 0 : int halMbufAlloc(unsigned int size, Mbuf **mbuf)
77 : {
78 : (void)size;
79 : (void)mbuf;
80 0 : return DRV_ERROR_NONE;
81 : }
82 :
83 1 : int halMbufFree(Mbuf *mbuf)
84 : {
85 : (void)mbuf;
86 1 : return DRV_ERROR_NONE;
87 : }
88 :
89 1 : int halMbufGetPrivInfo (Mbuf *mbuf, void **priv, unsigned int *size)
90 : {
91 : (void)mbuf;
92 : (void)priv;
93 : (void)size;
94 1 : return DRV_ERROR_NONE;
95 : }
96 :
97 1 : int buff_get_phy_addr (void *buf, unsigned long long *phyAddr)
98 : {
99 : (void)buf;
100 : (void)phyAddr;
101 1 : return 0;
102 : }
103 :
104 1 : int halGrpQuery(GroupQueryCmdType cmd,
105 : void *inBuff, unsigned int inLen, void *outBuff, unsigned int *outLen)
106 : {
107 : (void)cmd;
108 : (void)inBuff;
109 : (void)inLen;
110 : (void)outBuff;
111 1 : *outLen = 0;
112 1 : return DRV_ERROR_NONE;
113 : }
114 :
115 1 : int halGrpAddProc(const char *name, int pid, GroupShareAttr attr)
116 : {
117 : (void)name;
118 : (void)pid;
119 : (void)attr;
120 1 : return DRV_ERROR_NONE;
121 : }
122 :
123 1 : int halGrpAttach(const char *name, int timeout)
124 : {
125 : (void)name;
126 : (void)timeout;
127 1 : return DRV_ERROR_NONE;
128 : }
129 :
130 1 : int halBuffInit(BuffCfg *cfg)
131 : {
132 : (void)cfg;
133 1 : return DRV_ERROR_NONE;
134 : }
135 : namespace DataPreprocess {
136 2 : TaskQueueMgr& TaskQueueMgr::GetInstance()
137 : {
138 2 : static TaskQueueMgr instance;
139 2 : return instance;
140 : }
141 :
142 3 : TaskQueueMgr::TaskQueueMgr()
143 : {
144 3 : for (int32_t i = TASK_QUEUE_LOW_PRIORITY; i < TASK_QUEUE_MAX_PRIORITY; ++i) {
145 2 : preprocessEventfds_[i] = -1; // initialize fd
146 : }
147 1 : }
148 3 : TaskQueueMgr::~TaskQueueMgr() {}
149 1 : void TaskQueueMgr::OnPreprocessEvent(uint32_t eventId) {}
150 : }
151 : #ifdef __cplusplus
152 : namespace tdt {
153 1 : int32_t TDTServerInit(const uint32_t deviceID, const std::list<uint32_t>& bindCoreList)
154 : {
155 : (void)deviceID;
156 : (void)bindCoreList;
157 1 : return 0;
158 : }
159 :
160 1 : int32_t TDTServerStop()
161 : {
162 1 : return 0;
163 : }
164 :
165 506 : StatusFactory* StatusFactory::GetInstance()
166 : {
167 506 : static StatusFactory instance_;
168 506 : return &instance_;
169 : }
170 :
171 504 : void StatusFactory::RegisterErrorNo(const uint32_t err, const std::string& desc) {}
172 :
173 1 : std::string StatusFactory::GetErrDesc(const uint32_t err)
174 : {
175 : (void)err;
176 2 : return "";
177 : }
178 :
179 1 : std::string StatusFactory::GetErrCodeDesc(uint32_t errCode)
180 : {
181 : (void)errCode;
182 2 : return "";
183 : }
184 :
185 1 : StatusFactory::StatusFactory() {}
186 : }
187 : #endif
|