drivers/staging/media/atomisp/pci/base/circbuf/interface/ia_css_circbuf_desc.h
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/base/circbuf/interface/ia_css_circbuf_desc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/base/circbuf/interface/ia_css_circbuf_desc.h- Extension
.h- Size
- 3722 bytes
- Lines
- 161
- 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.
Dependency Surface
type_support.hmath_support.hplatform_support.hsp.hia_css_circbuf_comm.h
Detected Declarations
function Copyrightfunction ia_css_circbuf_desc_is_fullfunction ia_css_circbuf_desc_initfunction ia_css_circbuf_desc_get_pos_at_offsetfunction ia_css_circbuf_desc_get_offsetfunction ia_css_circbuf_desc_get_num_elemsfunction ia_css_circbuf_desc_get_free_elems
Annotated Snippet
#ifndef _IA_CSS_CIRCBUF_DESC_H_
#define _IA_CSS_CIRCBUF_DESC_H_
#include <type_support.h>
#include <math_support.h>
#include <platform_support.h>
#include <sp.h>
#include "ia_css_circbuf_comm.h"
/****************************************************************
*
* Inline functions.
*
****************************************************************/
/**
* @brief Test if the circular buffer is empty.
*
* @param cb_desc The pointer to the circular buffer descriptor.
*
* @return
* - true when it is empty.
* - false when it is not empty.
*/
static inline bool ia_css_circbuf_desc_is_empty(
ia_css_circbuf_desc_t *cb_desc)
{
OP___assert(cb_desc);
return (cb_desc->end == cb_desc->start);
}
/**
* @brief Test if the circular buffer descriptor is full.
*
* @param cb_desc The pointer to the circular buffer
* descriptor.
*
* @return
* - true when it is full.
* - false when it is not full.
*/
static inline bool ia_css_circbuf_desc_is_full(
ia_css_circbuf_desc_t *cb_desc)
{
OP___assert(cb_desc);
return ((cb_desc->end + 1) % cb_desc->size) == cb_desc->start;
}
/**
* @brief Initialize the circular buffer descriptor
*
* @param cb_desc The pointer circular buffer descriptor
* @param size The size of the circular buffer
*/
static inline void ia_css_circbuf_desc_init(
ia_css_circbuf_desc_t *cb_desc,
int8_t size)
{
OP___assert(cb_desc);
cb_desc->size = size;
}
/**
* @brief Get a position in the circular buffer descriptor.
*
* @param cb The pointer to the circular buffer descriptor.
* @param base The base position.
* @param offset The offset.
*
* @return the position in the circular buffer descriptor.
*/
static inline uint8_t ia_css_circbuf_desc_get_pos_at_offset(
ia_css_circbuf_desc_t *cb_desc,
u32 base,
int offset)
{
OP___assert(cb_desc);
OP___assert(cb_desc->size > 0);
/* step 1: adjust the offset */
while (offset < 0)
offset += cb_desc->size;
/* step 2: shift and round by the upper limit */
return (base + offset) % cb_desc->size;
}
/**
* @brief Get the offset between two positions in the circular buffer
* descriptor.
* Get the offset from the source position to the terminal position,
* along the direction in which the new elements come in.
Annotation
- Immediate include surface: `type_support.h`, `math_support.h`, `platform_support.h`, `sp.h`, `ia_css_circbuf_comm.h`.
- Detected declarations: `function Copyright`, `function ia_css_circbuf_desc_is_full`, `function ia_css_circbuf_desc_init`, `function ia_css_circbuf_desc_get_pos_at_offset`, `function ia_css_circbuf_desc_get_offset`, `function ia_css_circbuf_desc_get_num_elems`, `function ia_css_circbuf_desc_get_free_elems`.
- 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.