drivers/staging/media/atomisp/pci/runtime/queue/src/queue_access.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/runtime/queue/src/queue_access.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/runtime/queue/src/queue_access.c- Extension
.c- Size
- 4930 bytes
- Lines
- 170
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
hmm.htype_support.hqueue_access.hia_css_circbuf.hsp.hassert_support.h
Detected Declarations
function Copyrightfunction ia_css_queue_storefunction ia_css_queue_item_loadfunction ia_css_queue_item_store
Annotated Snippet
if (0 == (ignore_desc_flags & QUEUE_IGNORE_SIZE_FLAG)) {
cb_desc->size = sp_dmem_load_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, size));
if (cb_desc->size == 0) {
/* Adding back the workaround which was removed
while refactoring queues. When reading size
through sp_dmem_load_*, sometimes we get back
the value as zero. This causes division by 0
exception as the size is used in a modular
division operation. */
return -EDOM;
}
}
if (0 == (ignore_desc_flags & QUEUE_IGNORE_START_FLAG))
cb_desc->start = sp_dmem_load_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, start));
if (0 == (ignore_desc_flags & QUEUE_IGNORE_END_FLAG))
cb_desc->end = sp_dmem_load_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, end));
if (0 == (ignore_desc_flags & QUEUE_IGNORE_STEP_FLAG))
cb_desc->step = sp_dmem_load_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, step));
} else if (rdesc->location == IA_CSS_QUEUE_LOC_HOST) {
/* doing DMA transfer of entire structure */
hmm_load(rdesc->desc.remote.cb_desc_addr,
(void *)cb_desc,
sizeof(ia_css_circbuf_desc_t));
} else if (rdesc->location == IA_CSS_QUEUE_LOC_ISP) {
/* Not supported yet */
return -ENOTSUPP;
}
return 0;
}
int ia_css_queue_store(
struct ia_css_queue *rdesc,
ia_css_circbuf_desc_t *cb_desc,
uint32_t ignore_desc_flags)
{
if (!rdesc || !cb_desc)
return -EINVAL;
if (rdesc->location == IA_CSS_QUEUE_LOC_SP) {
assert(ignore_desc_flags <= QUEUE_IGNORE_DESC_FLAGS_MAX);
if (0 == (ignore_desc_flags & QUEUE_IGNORE_SIZE_FLAG))
sp_dmem_store_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, size),
cb_desc->size);
if (0 == (ignore_desc_flags & QUEUE_IGNORE_START_FLAG))
sp_dmem_store_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, start),
cb_desc->start);
if (0 == (ignore_desc_flags & QUEUE_IGNORE_END_FLAG))
sp_dmem_store_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, end),
cb_desc->end);
if (0 == (ignore_desc_flags & QUEUE_IGNORE_STEP_FLAG))
sp_dmem_store_uint8(rdesc->proc_id,
rdesc->desc.remote.cb_desc_addr
+ offsetof(ia_css_circbuf_desc_t, step),
cb_desc->step);
} else if (rdesc->location == IA_CSS_QUEUE_LOC_HOST) {
/* doing DMA transfer of entire structure */
hmm_store(rdesc->desc.remote.cb_desc_addr,
(void *)cb_desc,
sizeof(ia_css_circbuf_desc_t));
} else if (rdesc->location == IA_CSS_QUEUE_LOC_ISP) {
/* Not supported yet */
return -ENOTSUPP;
}
return 0;
}
Annotation
- Immediate include surface: `hmm.h`, `type_support.h`, `queue_access.h`, `ia_css_circbuf.h`, `sp.h`, `assert_support.h`.
- Detected declarations: `function Copyright`, `function ia_css_queue_store`, `function ia_css_queue_item_load`, `function ia_css_queue_item_store`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.