drivers/hwtracing/coresight/coresight-priv.h
Source file repositories/reference/linux-study-clean/drivers/hwtracing/coresight/coresight-priv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwtracing/coresight/coresight-priv.h- Extension
.h- Size
- 7586 bytes
- Lines
- 256
- Domain
- Driver Families
- Bucket
- drivers/hwtracing
- 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
linux/amba/bus.hlinux/bitops.hlinux/io.hlinux/coresight.hlinux/pm_runtime.h
Detected Declarations
struct cs_pair_attributestruct cs_off_attributestruct cs_buffersstruct cti_assoc_openum etm_addr_typefunction __ATTRfunction coresight_insert_barrier_packetfunction CS_LOCKfunction CS_UNLOCKfunction etm_readl_cp14function etm_writel_cp14
Annotated Snippet
struct cs_pair_attribute {
struct device_attribute attr;
u32 lo_off;
u32 hi_off;
};
struct cs_off_attribute {
struct device_attribute attr;
u32 off;
};
ssize_t coresight_simple_show32(struct device *_dev, struct device_attribute *attr, char *buf);
ssize_t coresight_simple_show_pair(struct device *_dev, struct device_attribute *attr, char *buf);
#define coresight_simple_reg32(name, offset) \
(&((struct cs_off_attribute[]) { \
{ \
__ATTR(name, 0444, coresight_simple_show32, NULL), \
offset \
} \
})[0].attr.attr)
#define coresight_simple_reg64(name, lo_off, hi_off) \
(&((struct cs_pair_attribute[]) { \
{ \
__ATTR(name, 0444, coresight_simple_show_pair, NULL), \
lo_off, hi_off \
} \
})[0].attr.attr)
extern const u32 coresight_barrier_pkt[4];
#define CORESIGHT_BARRIER_PKT_SIZE (sizeof(coresight_barrier_pkt))
enum etm_addr_type {
ETM_ADDR_TYPE_NONE,
ETM_ADDR_TYPE_SINGLE,
ETM_ADDR_TYPE_RANGE,
ETM_ADDR_TYPE_START,
ETM_ADDR_TYPE_STOP,
};
/**
* struct cs_buffer - keep track of a recording session' specifics
* @cur: index of the current buffer
* @nr_pages: max number of pages granted to us
* @pid: PID this cs_buffer belongs to
* @offset: offset within the current buffer
* @data_size: how much we collected in this run
* @snapshot: is this run in snapshot mode
* @data_pages: a handle the ring buffer
*/
struct cs_buffers {
unsigned int cur;
unsigned int nr_pages;
pid_t pid;
unsigned long offset;
local_t data_size;
bool snapshot;
void **data_pages;
};
static inline void coresight_insert_barrier_packet(void *buf)
{
if (buf)
memcpy(buf, coresight_barrier_pkt, CORESIGHT_BARRIER_PKT_SIZE);
}
static inline void CS_LOCK(void __iomem *addr)
{
do {
/* Wait for things to settle */
mb();
writel_relaxed(0x0, addr + CORESIGHT_LAR);
} while (0);
}
static inline void CS_UNLOCK(void __iomem *addr)
{
do {
writel_relaxed(CORESIGHT_UNLOCK, addr + CORESIGHT_LAR);
/* Make sure everyone has seen this */
mb();
} while (0);
}
void coresight_disable_path(struct coresight_path *path);
int coresight_enable_path(struct coresight_path *path, enum cs_mode mode);
struct coresight_device *coresight_get_sink(struct coresight_path *path);
struct coresight_device *coresight_get_sink_by_id(u32 id);
struct coresight_device *
Annotation
- Immediate include surface: `linux/amba/bus.h`, `linux/bitops.h`, `linux/io.h`, `linux/coresight.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct cs_pair_attribute`, `struct cs_off_attribute`, `struct cs_buffers`, `struct cti_assoc_op`, `enum etm_addr_type`, `function __ATTR`, `function coresight_insert_barrier_packet`, `function CS_LOCK`, `function CS_UNLOCK`, `function etm_readl_cp14`.
- Atlas domain: Driver Families / drivers/hwtracing.
- 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.