drivers/hwtracing/coresight/coresight-trbe.h
Source file repositories/reference/linux-study-clean/drivers/hwtracing/coresight/coresight-trbe.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwtracing/coresight/coresight-trbe.h- Extension
.h- Size
- 3125 bytes
- Lines
- 140
- 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.
Dependency Surface
linux/acpi.hlinux/coresight.hlinux/device.hlinux/irq.hlinux/kernel.hlinux/of.hlinux/perf/arm_pmu.hlinux/platform_device.hlinux/smp.hcoresight-etm-perf.h
Detected Declarations
function Extensionfunction is_trbe_enabledfunction get_trbe_ecfunction get_trbe_bscfunction clr_trbe_irqfunction is_trbe_irqfunction is_trbe_trgfunction is_trbe_wrapfunction is_trbe_abortfunction is_trbe_runningfunction get_trbe_flag_updatefunction is_trbe_programmablefunction get_trbe_address_alignfunction get_trbe_write_pointerfunction set_trbe_write_pointerfunction get_trbe_limit_pointerfunction get_trbe_base_pointerfunction set_trbe_base_pointer
Annotated Snippet
#include <linux/acpi.h>
#include <linux/coresight.h>
#include <linux/device.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/perf/arm_pmu.h>
#include <linux/platform_device.h>
#include <linux/smp.h>
#include "coresight-etm-perf.h"
static inline bool is_trbe_available(void)
{
u64 aa64dfr0 = read_sysreg_s(SYS_ID_AA64DFR0_EL1);
unsigned int trbe = cpuid_feature_extract_unsigned_field(aa64dfr0,
ID_AA64DFR0_EL1_TraceBuffer_SHIFT);
return trbe >= ID_AA64DFR0_EL1_TraceBuffer_IMP;
}
static inline bool is_trbe_enabled(void)
{
u64 trblimitr = read_sysreg_s(SYS_TRBLIMITR_EL1);
return trblimitr & TRBLIMITR_EL1_E;
}
#define TRBE_EC_OTHERS 0
#define TRBE_EC_STAGE1_ABORT 36
#define TRBE_EC_STAGE2_ABORT 37
static inline int get_trbe_ec(u64 trbsr)
{
return (trbsr & TRBSR_EL1_EC_MASK) >> TRBSR_EL1_EC_SHIFT;
}
#define TRBE_BSC_NOT_STOPPED 0
#define TRBE_BSC_FILLED 1
#define TRBE_BSC_TRIGGERED 2
static inline int get_trbe_bsc(u64 trbsr)
{
return (trbsr & TRBSR_EL1_BSC_MASK) >> TRBSR_EL1_BSC_SHIFT;
}
static inline void clr_trbe_irq(void)
{
u64 trbsr = read_sysreg_s(SYS_TRBSR_EL1);
trbsr &= ~TRBSR_EL1_IRQ;
write_sysreg_s(trbsr, SYS_TRBSR_EL1);
}
static inline bool is_trbe_irq(u64 trbsr)
{
return trbsr & TRBSR_EL1_IRQ;
}
static inline bool is_trbe_trg(u64 trbsr)
{
return trbsr & TRBSR_EL1_TRG;
}
static inline bool is_trbe_wrap(u64 trbsr)
{
return trbsr & TRBSR_EL1_WRAP;
}
static inline bool is_trbe_abort(u64 trbsr)
{
return trbsr & TRBSR_EL1_EA;
}
static inline bool is_trbe_running(u64 trbsr)
{
return !(trbsr & TRBSR_EL1_S);
}
static inline bool get_trbe_flag_update(u64 trbidr)
{
return trbidr & TRBIDR_EL1_F;
}
static inline bool is_trbe_programmable(u64 trbidr)
{
return !(trbidr & TRBIDR_EL1_P);
}
static inline int get_trbe_address_align(u64 trbidr)
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/coresight.h`, `linux/device.h`, `linux/irq.h`, `linux/kernel.h`, `linux/of.h`, `linux/perf/arm_pmu.h`, `linux/platform_device.h`.
- Detected declarations: `function Extension`, `function is_trbe_enabled`, `function get_trbe_ec`, `function get_trbe_bsc`, `function clr_trbe_irq`, `function is_trbe_irq`, `function is_trbe_trg`, `function is_trbe_wrap`, `function is_trbe_abort`, `function is_trbe_running`.
- 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.