MCPcopy Create free account
hub / github.com/ScaleX-IO/uGDS / nvm_queue_clear

Function nvm_queue_clear

src/libnvm/queue.cpp:11–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11int nvm_queue_clear(nvm_queue_t* queue, const nvm_ctrl_t* ctrl, bool cq, uint16_t no, uint32_t qs,
12 bool local, volatile void* vaddr, uint64_t ioaddr)
13{
14 if (qs < 2 || qs > 0x10000 || qs > ctrl->max_qs)
15 {
16 return EINVAL;
17 }
18
19 queue->no = no;
20 queue->qs = qs;
21 queue->es = cq ? sizeof(nvm_cpl_t) : sizeof(nvm_cmd_t);
22 queue->head = 0;
23 queue->tail = 0;
24 queue->last = 0;
25 queue->phase = 1;
26 queue->local = !!local;
27 queue->head_lock = 0;
28 queue->tail_lock = 0;
29 // queue->head_copy = 0;
30 // queue->tail_copy = 0;
31 queue->in_ticket = 0;
32 queue->cid_ticket = 0;
33
34 queue->db = (cq ? CQ_DBL(ctrl->mm_ptr, queue->no, ctrl->dstrd) : SQ_DBL(ctrl->mm_ptr, queue->no, ctrl->dstrd));
35 queue->vaddr = vaddr;
36 queue->ioaddr = ioaddr;
37
38 return 0;
39}
40
41
42

Callers 3

create_adminFunction · 0.85
nvm_admin_cq_createFunction · 0.85
nvm_admin_sq_createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected