/** * 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 { unsignedint cur; unsignedint nr_pages;
pid_t pid; unsignedlong offset;
local_t data_size; bool snapshot; void **data_pages;
};
staticinlinevoid coresight_insert_barrier_packet(void *buf)
{ if (buf)
memcpy(buf, coresight_barrier_pkt, CORESIGHT_BARRIER_PKT_SIZE);
}
staticinlinevoid CS_LOCK(void __iomem *addr)
{ do { /* Wait for things to settle */
mb();
writel_relaxed(0x0, addr + CORESIGHT_LAR);
} while (0);
}
staticinlinevoid CS_UNLOCK(void __iomem *addr)
{ do {
writel_relaxed(CORESIGHT_UNLOCK, addr + CORESIGHT_LAR); /* Make sure everyone has seen this */
mb();
} while (0);
}
/* coresight AMBA ID, full UCI structure: id table entry. */ #define __CS_AMBA_UCI_ID(pid, m, uci_ptr) \
{ \
.id = pid, \
.mask = m, \
.data = (void *)uci_ptr \
} #define CS_AMBA_UCI_ID(pid, uci) __CS_AMBA_UCI_ID(pid, 0x000fffff, uci) /* * PIDR2[JEDEC], BIT(3) must be 1 (Read As One) to indicate that rest of the * PIDR1, PIDR2 DES_* fields follow JEDEC encoding for the designer. Use that * as a match value for blanket matching all devices in the given CoreSight * device type and architecture.
*/ #define PIDR2_JEDEC BIT(3) #define PID_PIDR2_JEDEC (PIDR2_JEDEC << 16) /* * Match all PIDs in a given CoreSight device type and architecture, defined * by the uci.
*/ #define CS_AMBA_MATCH_ALL_UCI(uci) \
__CS_AMBA_UCI_ID(PID_PIDR2_JEDEC, PID_PIDR2_JEDEC, uci)
/* extract the data value from a UCI structure given amba_id pointer. */ staticinlinevoid *coresight_get_uci_data(conststruct amba_id *id)
{ struct amba_cs_uci_id *uci_id = id->data;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.