Lines Matching full:packet

21 #define SPE_HEADER0_ADDRESS		0x30 /* address packet (short) */
23 #define SPE_HEADER0_COUNTER 0x18 /* counter packet (short) */
36 #define SPE_HEADER1_ADDRESS 0xb0 /* address packet (extended) */
38 #define SPE_HEADER1_COUNTER 0x98 /* counter packet (extended) */
86 struct arm_spe_pkt *packet) in arm_spe_get_payload() argument
96 case 1: packet->payload = *(uint8_t *)buf; break; in arm_spe_get_payload()
97 case 2: packet->payload = le16_to_cpu(*(uint16_t *)buf); break; in arm_spe_get_payload()
98 case 4: packet->payload = le32_to_cpu(*(uint32_t *)buf); break; in arm_spe_get_payload()
99 case 8: packet->payload = le64_to_cpu(*(uint64_t *)buf); break; in arm_spe_get_payload()
106 static int arm_spe_get_pad(struct arm_spe_pkt *packet) in arm_spe_get_pad() argument
108 packet->type = ARM_SPE_PAD; in arm_spe_get_pad()
113 struct arm_spe_pkt *packet) in arm_spe_get_alignment() argument
120 packet->type = ARM_SPE_PAD; in arm_spe_get_alignment()
124 static int arm_spe_get_end(struct arm_spe_pkt *packet) in arm_spe_get_end() argument
126 packet->type = ARM_SPE_END; in arm_spe_get_end()
131 struct arm_spe_pkt *packet) in arm_spe_get_timestamp() argument
133 packet->type = ARM_SPE_TIMESTAMP; in arm_spe_get_timestamp()
134 return arm_spe_get_payload(buf, len, packet); in arm_spe_get_timestamp()
138 struct arm_spe_pkt *packet) in arm_spe_get_events() argument
140 int ret = arm_spe_get_payload(buf, len, packet); in arm_spe_get_events()
142 packet->type = ARM_SPE_EVENTS; in arm_spe_get_events()
149 packet->index = ret - 1; in arm_spe_get_events()
155 struct arm_spe_pkt *packet) in arm_spe_get_data_source() argument
157 packet->type = ARM_SPE_DATA_SOURCE; in arm_spe_get_data_source()
158 return arm_spe_get_payload(buf, len, packet); in arm_spe_get_data_source()
162 struct arm_spe_pkt *packet) in arm_spe_get_context() argument
164 packet->type = ARM_SPE_CONTEXT; in arm_spe_get_context()
165 packet->index = buf[0] & 0x3; in arm_spe_get_context()
167 return arm_spe_get_payload(buf, len, packet); in arm_spe_get_context()
171 struct arm_spe_pkt *packet) in arm_spe_get_op_type() argument
173 packet->type = ARM_SPE_OP_TYPE; in arm_spe_get_op_type()
174 packet->index = buf[0] & 0x3; in arm_spe_get_op_type()
175 return arm_spe_get_payload(buf, len, packet); in arm_spe_get_op_type()
179 const unsigned char ext_hdr, struct arm_spe_pkt *packet) in arm_spe_get_counter() argument
184 packet->type = ARM_SPE_COUNTER; in arm_spe_get_counter()
186 packet->index = ((buf[0] & 0x3) << 3) | (buf[1] & 0x7); in arm_spe_get_counter()
188 packet->index = buf[0] & 0x7; in arm_spe_get_counter()
190 packet->payload = le16_to_cpu(*(uint16_t *)(buf + 1)); in arm_spe_get_counter()
196 const unsigned char ext_hdr, struct arm_spe_pkt *packet) in arm_spe_get_addr() argument
201 packet->type = ARM_SPE_ADDRESS; in arm_spe_get_addr()
203 packet->index = ((buf[0] & 0x3) << 3) | (buf[1] & 0x7); in arm_spe_get_addr()
205 packet->index = buf[0] & 0x7; in arm_spe_get_addr()
207 memcpy_le64(&packet->payload, buf + 1, 8); in arm_spe_get_addr()
213 struct arm_spe_pkt *packet) in arm_spe_do_get_packet() argument
217 memset(packet, 0, sizeof(struct arm_spe_pkt)); in arm_spe_do_get_packet()
224 return arm_spe_get_pad(packet); in arm_spe_do_get_packet()
226 return arm_spe_get_end(packet); in arm_spe_do_get_packet()
230 return arm_spe_get_addr(buf, len, 0, packet); in arm_spe_do_get_packet()
232 return arm_spe_get_counter(buf, len, 0, packet); in arm_spe_do_get_packet()
235 return arm_spe_get_timestamp(buf, len, packet); in arm_spe_do_get_packet()
237 return arm_spe_get_events(buf, len, packet); in arm_spe_do_get_packet()
239 return arm_spe_get_data_source(buf, len, packet); in arm_spe_do_get_packet()
241 return arm_spe_get_context(buf, len, packet); in arm_spe_do_get_packet()
243 return arm_spe_get_op_type(buf, len, packet); in arm_spe_do_get_packet()
248 return arm_spe_get_alignment(buf, len, packet); in arm_spe_do_get_packet()
250 return arm_spe_get_addr(buf, len, 1, packet); in arm_spe_do_get_packet()
252 return arm_spe_get_counter(buf, len, 1, packet); in arm_spe_do_get_packet()
259 struct arm_spe_pkt *packet) in arm_spe_get_packet() argument
263 ret = arm_spe_do_get_packet(buf, len, packet); in arm_spe_get_packet()
267 if (ret > 0 && packet->type == ARM_SPE_PAD) { in arm_spe_get_packet()
274 int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, in arm_spe_pkt_desc() argument
277 int ret, ns, el, idx = packet->index; in arm_spe_pkt_desc()
278 unsigned long long payload = packet->payload; in arm_spe_pkt_desc()
279 const char *name = arm_spe_pkt_name(packet->type); in arm_spe_pkt_desc()
281 switch (packet->type) { in arm_spe_pkt_desc()
423 case 1: ns = !!(packet->payload & NS_FLAG); in arm_spe_pkt_desc()
424 el = (packet->payload & EL_FLAG) >> 61; in arm_spe_pkt_desc()
429 case 3: ns = !!(packet->payload & NS_FLAG); in arm_spe_pkt_desc()
461 name, payload, packet->index); in arm_spe_pkt_desc()