Lines Matching refs:pos
37 static uint64_t pt_pkt_read_value(const uint8_t *pos, int size) in pt_pkt_read_value() argument
43 uint64_t byte = *pos++; in pt_pkt_read_value()
52 int pt_pkt_read_unknown(struct pt_packet *packet, const uint8_t *pos, in pt_pkt_read_unknown() argument
59 if (!packet || !pos || !config) in pt_pkt_read_unknown()
67 packet->payload.unknown.packet = pos; in pt_pkt_read_unknown()
73 size = (*decode)(&packet->payload.unknown, config, pos, in pt_pkt_read_unknown()
84 if (config->end < pos + size) in pt_pkt_read_unknown()
90 int pt_pkt_read_psb(const uint8_t *pos, const struct pt_config *config) in pt_pkt_read_psb() argument
94 if (!pos || !config) in pt_pkt_read_psb()
97 if (config->end < pos + ptps_psb) in pt_pkt_read_psb()
100 pos += pt_opcs_psb; in pt_pkt_read_psb()
103 if (*pos++ != pt_psb_hi) in pt_pkt_read_psb()
105 if (*pos++ != pt_psb_lo) in pt_pkt_read_psb()
135 int pt_pkt_read_ip(struct pt_packet_ip *packet, const uint8_t *pos, in pt_pkt_read_ip() argument
142 if (!packet || !pos || !config) in pt_pkt_read_ip()
145 ipc = (*pos++ >> pt_opm_ipc_shr) & pt_opm_ipc_shr_mask; in pt_pkt_read_ip()
152 if (config->end < pos + ipsize) in pt_pkt_read_ip()
156 ip = pt_pkt_read_value(pos, ipsize); in pt_pkt_read_ip()
200 int pt_pkt_read_tnt_8(struct pt_packet_tnt *packet, const uint8_t *pos, in pt_pkt_read_tnt_8() argument
207 if (!pos) in pt_pkt_read_tnt_8()
210 errcode = pt_pkt_read_tnt(packet, pos[0] >> pt_opm_tnt_8_shr); in pt_pkt_read_tnt_8()
217 int pt_pkt_read_tnt_64(struct pt_packet_tnt *packet, const uint8_t *pos, in pt_pkt_read_tnt_64() argument
223 if (!pos || !config) in pt_pkt_read_tnt_64()
226 if (config->end < pos + ptps_tnt_64) in pt_pkt_read_tnt_64()
229 payload = pt_pkt_read_value(pos + pt_opcs_tnt_64, pt_pl_tnt_64_size); in pt_pkt_read_tnt_64()
238 int pt_pkt_read_pip(struct pt_packet_pip *packet, const uint8_t *pos, in pt_pkt_read_pip() argument
243 if (!packet || !pos || !config) in pt_pkt_read_pip()
246 if (config->end < pos + ptps_pip) in pt_pkt_read_pip()
250 payload = pt_pkt_read_value(pos + pt_opcs_pip, pt_pl_pip_size); in pt_pkt_read_pip()
287 int pt_pkt_read_mode(struct pt_packet_mode *packet, const uint8_t *pos, in pt_pkt_read_mode() argument
292 if (!packet || !pos || !config) in pt_pkt_read_mode()
295 if (config->end < pos + ptps_mode) in pt_pkt_read_mode()
298 payload = pos[pt_opcs_mode]; in pt_pkt_read_mode()
315 int pt_pkt_read_tsc(struct pt_packet_tsc *packet, const uint8_t *pos, in pt_pkt_read_tsc() argument
318 if (!packet || !pos || !config) in pt_pkt_read_tsc()
321 if (config->end < pos + ptps_tsc) in pt_pkt_read_tsc()
324 packet->tsc = pt_pkt_read_value(pos + pt_opcs_tsc, pt_pl_tsc_size); in pt_pkt_read_tsc()
329 int pt_pkt_read_cbr(struct pt_packet_cbr *packet, const uint8_t *pos, in pt_pkt_read_cbr() argument
332 if (!packet || !pos || !config) in pt_pkt_read_cbr()
335 if (config->end < pos + ptps_cbr) in pt_pkt_read_cbr()
338 packet->ratio = pos[2]; in pt_pkt_read_cbr()
343 int pt_pkt_read_tma(struct pt_packet_tma *packet, const uint8_t *pos, in pt_pkt_read_tma() argument
348 if (!packet || !pos || !config) in pt_pkt_read_tma()
351 if (config->end < pos + ptps_tma) in pt_pkt_read_tma()
354 ctc = pos[pt_pl_tma_ctc_0]; in pt_pkt_read_tma()
355 ctc |= pos[pt_pl_tma_ctc_1] << 8; in pt_pkt_read_tma()
357 fc = pos[pt_pl_tma_fc_0]; in pt_pkt_read_tma()
358 fc |= pos[pt_pl_tma_fc_1] << 8; in pt_pkt_read_tma()
369 int pt_pkt_read_mtc(struct pt_packet_mtc *packet, const uint8_t *pos, in pt_pkt_read_mtc() argument
372 if (!packet || !pos || !config) in pt_pkt_read_mtc()
375 if (config->end < pos + ptps_mtc) in pt_pkt_read_mtc()
378 packet->ctc = pos[pt_opcs_mtc]; in pt_pkt_read_mtc()
383 int pt_pkt_read_cyc(struct pt_packet_cyc *packet, const uint8_t *pos, in pt_pkt_read_cyc() argument
390 if (!packet || !pos || !config) in pt_pkt_read_cyc()
393 begin = pos; in pt_pkt_read_cyc()
399 cyc = *pos++; in pt_pkt_read_cyc()
410 if (end <= pos) in pt_pkt_read_cyc()
413 bits = *pos++; in pt_pkt_read_cyc()
428 return (int) (pos - begin); in pt_pkt_read_cyc()
431 int pt_pkt_read_vmcs(struct pt_packet_vmcs *packet, const uint8_t *pos, in pt_pkt_read_vmcs() argument
436 if (!packet || !pos || !config) in pt_pkt_read_vmcs()
439 if (config->end < pos + ptps_vmcs) in pt_pkt_read_vmcs()
442 payload = pt_pkt_read_value(pos + pt_opcs_vmcs, pt_pl_vmcs_size); in pt_pkt_read_vmcs()
449 int pt_pkt_read_mnt(struct pt_packet_mnt *packet, const uint8_t *pos, in pt_pkt_read_mnt() argument
452 if (!packet || !pos || !config) in pt_pkt_read_mnt()
455 if (config->end < pos + ptps_mnt) in pt_pkt_read_mnt()
458 packet->payload = pt_pkt_read_value(pos + pt_opcs_mnt, pt_pl_mnt_size); in pt_pkt_read_mnt()
463 int pt_pkt_read_exstop(struct pt_packet_exstop *packet, const uint8_t *pos, in pt_pkt_read_exstop() argument
466 if (!packet || !pos || !config) in pt_pkt_read_exstop()
469 if (config->end < pos + ptps_exstop) in pt_pkt_read_exstop()
472 packet->ip = pos[1] & pt_pl_exstop_ip_mask ? 1 : 0; in pt_pkt_read_exstop()
477 int pt_pkt_read_mwait(struct pt_packet_mwait *packet, const uint8_t *pos, in pt_pkt_read_mwait() argument
480 if (!packet || !pos || !config) in pt_pkt_read_mwait()
483 if (config->end < pos + ptps_mwait) in pt_pkt_read_mwait()
486 packet->hints = (uint32_t) pt_pkt_read_value(pos + pt_opcs_mwait, in pt_pkt_read_mwait()
488 packet->ext = (uint32_t) pt_pkt_read_value(pos + pt_opcs_mwait + in pt_pkt_read_mwait()
494 int pt_pkt_read_pwre(struct pt_packet_pwre *packet, const uint8_t *pos, in pt_pkt_read_pwre() argument
499 if (!packet || !pos || !config) in pt_pkt_read_pwre()
502 if (config->end < pos + ptps_pwre) in pt_pkt_read_pwre()
505 payload = pt_pkt_read_value(pos + pt_opcs_pwre, pt_pl_pwre_size); in pt_pkt_read_pwre()
518 int pt_pkt_read_pwrx(struct pt_packet_pwrx *packet, const uint8_t *pos, in pt_pkt_read_pwrx() argument
523 if (!packet || !pos || !config) in pt_pkt_read_pwrx()
526 if (config->end < pos + ptps_pwrx) in pt_pkt_read_pwrx()
529 payload = pt_pkt_read_value(pos + pt_opcs_pwrx, pt_pl_pwrx_size); in pt_pkt_read_pwrx()
546 int pt_pkt_read_ptw(struct pt_packet_ptw *packet, const uint8_t *pos, in pt_pkt_read_ptw() argument
552 if (!packet || !pos || !config) in pt_pkt_read_ptw()
556 pos++; in pt_pkt_read_ptw()
558 opc = *pos++; in pt_pkt_read_ptw()
565 if (config->end < pos + size) in pt_pkt_read_ptw()
568 packet->payload = pt_pkt_read_value(pos, size); in pt_pkt_read_ptw()