drivers/staging/media/atomisp/pci/hive_isp_css_common/host/event_fifo_private.h

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/event_fifo_private.h

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/event_fifo_private.h
Extension
.h
Size
1726 bytes
Lines
69
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.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __EVENT_FIFO_PRIVATE_H
#define __EVENT_FIFO_PRIVATE_H

#include "event_fifo_public.h"

#include "device_access.h"

#include "assert_support.h"

#include <bits.h>			/* _hrt_get_bits() */

STORAGE_CLASS_EVENT_C void event_wait_for(const event_ID_t ID)
{
	assert(ID < N_EVENT_ID);
	assert(event_source_addr[ID] != ((hrt_address) - 1));
	(void)ia_css_device_load_uint32(event_source_addr[ID]);
	return;
}

STORAGE_CLASS_EVENT_C void cnd_event_wait_for(const event_ID_t ID,
	const bool cnd)
{
	if (cnd)
		event_wait_for(ID);
}

STORAGE_CLASS_EVENT_C hrt_data event_receive_token(const event_ID_t ID)
{
	assert(ID < N_EVENT_ID);
	assert(event_source_addr[ID] != ((hrt_address) - 1));
	return ia_css_device_load_uint32(event_source_addr[ID]);
}

STORAGE_CLASS_EVENT_C void event_send_token(const event_ID_t ID,
	const hrt_data token)
{
	assert(ID < N_EVENT_ID);
	assert(event_sink_addr[ID] != ((hrt_address) - 1));
	ia_css_device_store_uint32(event_sink_addr[ID], token);
}

STORAGE_CLASS_EVENT_C bool is_event_pending(const event_ID_t ID)
{
	hrt_data	value;

	assert(ID < N_EVENT_ID);
	assert(event_source_query_addr[ID] != ((hrt_address) - 1));
	value = ia_css_device_load_uint32(event_source_query_addr[ID]);
	return !_hrt_get_bit(value, EVENT_QUERY_BIT);
}

STORAGE_CLASS_EVENT_C bool can_event_send_token(const event_ID_t ID)
{
	hrt_data	value;

	assert(ID < N_EVENT_ID);
	assert(event_sink_query_addr[ID] != ((hrt_address) - 1));
	value = ia_css_device_load_uint32(event_sink_query_addr[ID]);
	return !_hrt_get_bit(value, EVENT_QUERY_BIT);
}

#endif /* __EVENT_FIFO_PRIVATE_H */

Annotation

Implementation Notes