MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / its_cmd_alloc

Function its_cmd_alloc

components/drivers/pic/pic-gicv3-its.c:238–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238static struct its_command *its_cmd_alloc(struct gicv3_its *its)
239{
240 struct its_command *cmd = RT_NULL;
241
242 for (rt_uint32_t count = 0; count <= 10000; ++count)
243 {
244 if ((its->cmd_idx + 1) % ITS_CMD_QUEUE_NR != its_readl(its, GITS_CREADR) / sizeof(*cmd))
245 {
246 struct its_command *cmds = its->cmd_base;
247
248 cmd = &cmds[its->cmd_idx++];
249 its->cmd_idx %= ITS_CMD_QUEUE_NR;
250
251 rt_memset(cmd, 0, sizeof(*cmd));
252
253 break;
254 }
255
256 rt_hw_us_delay(10);
257 }
258
259 return cmd;
260}
261
262static rt_err_t its_cmd_submit_raw(struct gicv3_its *its, struct its_command *cmd)
263{

Callers 1

its_cmd_submit_nomapFunction · 0.85

Calls 3

its_readlFunction · 0.85
rt_memsetFunction · 0.85
rt_hw_us_delayFunction · 0.50

Tested by

no test coverage detected