/** * enum sys_t_message_sbd_subtype - SyS-T SBD message subtypes * @MIPI_SYST_SBD_ID32: SBD message with 32-bit message ID * @MIPI_SYST_SBD_ID64: SBD message with 64-bit message ID * * Structured Binary Data messages can send information of arbitrary length, * together with ID's that describe BLOB's content and layout.
*/ enum sys_t_message_sbd_subtype {
MIPI_SYST_SBD_ID32 = 0,
MIPI_SYST_SBD_ID64 = 1,
};
/* * SyS-T and ftrace headers are compatible to an extent that ftrace event ID * and args can be treated as SyS-T SBD message with 64-bit ID and arguments * BLOB right behind the header without modification. Bits [16:63] coming * together with message ID from ftrace aren't used by SBD and must be zeroed. * * 0 15 16 23 24 31 32 39 40 63 * ftrace: <event_id> <flags> <preempt> <-pid-> <----> <args> * SBD: <------- msg_id ------------------------------> <BLOB>
*/ #define SBD_HEADER (MIPI_SYST_TYPES(SBD, ID64) | \
MIPI_SYST_SEVERITY(INFO) | \
MIPI_SYST_OPT_GUID)
/* * Ftrace is zero-copy compatible with SyS-T SBD, but requires * special handling of first 64 bits. Trim and send them separately * to avoid damage on original ftrace buffer.
*/ if (source && source->type == STM_FTRACE) {
u64 compat_ftrace_header;
ssize_t header_sz;
ssize_t buf_sz;
if (count < sizeof(compat_ftrace_header)) return -EINVAL;
/* SBD only makes use of low 16 bits (event ID) from ftrace event */
compat_ftrace_header = *(u64 *)buf & 0xffff;
header_sz = stm_data_write(data, master, channel, false,
&compat_ftrace_header, sizeof(compat_ftrace_header)); if (header_sz != sizeof(compat_ftrace_header)) return header_sz;
/* We require an existing policy node to proceed */ if (!op) return -EINVAL;
if (sys_t_need_clock_sync(op)) {
sz = sys_t_clock_sync(data, m, c); if (sz <= 0) return sz;
}
if (op->node.do_len)
header |= MIPI_SYST_OPT_LEN; if (sys_t_need_ts(op))
header |= MIPI_SYST_OPT_TS;
/* * STP framing rules for SyS-T frames: * * the first packet of the SyS-T frame is timestamped; * * the last packet is a FLAG.
*/ /* Message layout: HEADER / GUID / [LENGTH /][TIMESTAMP /] DATA */ /* HEADER */
sz = data->packet(data, m, c, STP_PACKET_DATA, STP_PACKET_TIMESTAMPED,
4, (u8 *)&header); if (sz <= 0) return sz;
/* GUID */
export_uuid(uuid, &op->node.uuid);
sz = stm_data_write(data, m, c, false, uuid, sizeof(op->node.uuid)); if (sz <= 0) return sz;
/* [LENGTH] */ if (op->node.do_len) {
u16 length = count;
sz = data->packet(data, m, c, STP_PACKET_DATA, 0, 2,
(u8 *)&length); if (sz <= 0) return sz;
}
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.