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