Lines Matching refs:ph

80 di_prop_reset_pos(prop_handle_t *ph)  in di_prop_reset_pos()  argument
82 ph->ph_cur_pos = ph->ph_data; in di_prop_reset_pos()
83 ph->ph_save_pos = ph->ph_data; in di_prop_reset_pos()
91 di_prop_save_pos(prop_handle_t *ph) in di_prop_save_pos() argument
93 ph->ph_save_pos = ph->ph_cur_pos; in di_prop_save_pos()
100 di_prop_restore_pos(prop_handle_t *ph) in di_prop_restore_pos() argument
102 ph->ph_cur_pos = ph->ph_save_pos; in di_prop_restore_pos()
113 di_prop_fm_decode_ints(prop_handle_t *ph, void *data, uint_t *nelements) in di_prop_fm_decode_ints() argument
126 i = DDI_PROP_INT(ph, DDI_PROP_CMD_SKIP, NULL); in di_prop_fm_decode_ints()
147 di_prop_reset_pos(ph); in di_prop_fm_decode_ints()
162 i = DDI_PROP_INT(ph, DDI_PROP_CMD_DECODE, tmp); in di_prop_fm_decode_ints()
189 di_prop_fm_decode_strings(prop_handle_t *ph, void *data, uint_t *nelements) in di_prop_fm_decode_strings() argument
208 size = DDI_PROP_STR(ph, DDI_PROP_CMD_GET_DSIZE, NULL); in di_prop_fm_decode_strings()
238 di_prop_reset_pos(ph); in di_prop_fm_decode_strings()
241 i = DDI_PROP_STR(ph, DDI_PROP_CMD_DECODE, tmp); in di_prop_fm_decode_strings()
269 di_prop_fm_decode_bytes(prop_handle_t *ph, void *data, uint_t *nelements) in di_prop_fm_decode_bytes() argument
278 if (ph->ph_size == 0) in di_prop_fm_decode_bytes()
284 nbytes = DDI_PROP_BYTES(ph, DDI_PROP_CMD_GET_DSIZE, in di_prop_fm_decode_bytes()
285 data, ph->ph_size); in di_prop_fm_decode_bytes()
306 i = DDI_PROP_BYTES(ph, DDI_PROP_CMD_DECODE, tmp, nbytes); in di_prop_fm_decode_bytes()
369 di_prop_1275_int(prop_handle_t *ph, uint_t cmd, int *data) in di_prop_1275_int() argument
378 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) in di_prop_1275_int()
380 if (ph->ph_flags & PH_FROM_PROM) { in di_prop_1275_int()
381 i = ph->ph_size < PROP_1275_INT_SIZE ? in di_prop_1275_int()
382 ph->ph_size : PROP_1275_INT_SIZE; in di_prop_1275_int()
383 if ((int *)ph->ph_cur_pos > ((int *)ph->ph_data + in di_prop_1275_int()
384 ph->ph_size - i)) in di_prop_1275_int()
386 } else if (ph->ph_size < sizeof (int) || in di_prop_1275_int()
387 ((int *)ph->ph_cur_pos > ((int *)ph->ph_data + in di_prop_1275_int()
388 ph->ph_size - sizeof (int)))) { in di_prop_1275_int()
396 if (ph->ph_flags & PH_FROM_PROM) { in di_prop_1275_int()
398 (uchar_t *)ph->ph_cur_pos, in di_prop_1275_int()
399 (ph->ph_size < PROP_1275_INT_SIZE) ? in di_prop_1275_int()
400 ph->ph_size : PROP_1275_INT_SIZE); in di_prop_1275_int()
402 bcopy(ph->ph_cur_pos, (caddr_t)data, sizeof (int)); in di_prop_1275_int()
409 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE; in di_prop_1275_int()
416 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_int()
417 ph->ph_size < PROP_1275_INT_SIZE || in di_prop_1275_int()
418 ((int *)ph->ph_cur_pos > ((int *)ph->ph_data + in di_prop_1275_int()
419 ph->ph_size - sizeof (int)))) in di_prop_1275_int()
426 bcopy((caddr_t)data, ph->ph_cur_pos, sizeof (int)); in di_prop_1275_int()
432 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE; in di_prop_1275_int()
439 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_int()
440 ph->ph_size < PROP_1275_INT_SIZE) in di_prop_1275_int()
444 if ((caddr_t)ph->ph_cur_pos == in di_prop_1275_int()
445 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_1275_int()
447 } else if ((caddr_t)ph->ph_cur_pos > in di_prop_1275_int()
448 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_1275_int()
456 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE; in di_prop_1275_int()
484 di_prop_int64_op(prop_handle_t *ph, uint_t cmd, int64_t *data) in di_prop_int64_op() argument
491 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) in di_prop_int64_op()
493 if (ph->ph_flags & PH_FROM_PROM) { in di_prop_int64_op()
495 } else if (ph->ph_size < sizeof (int64_t) || in di_prop_int64_op()
496 ((int64_t *)ph->ph_cur_pos > ((int64_t *)ph->ph_data + in di_prop_int64_op()
497 ph->ph_size - sizeof (int64_t)))) { in di_prop_int64_op()
505 bcopy(ph->ph_cur_pos, (caddr_t)data, sizeof (int64_t)); in di_prop_int64_op()
511 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + in di_prop_int64_op()
519 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_int64_op()
520 ph->ph_size < sizeof (int64_t) || in di_prop_int64_op()
521 ((int64_t *)ph->ph_cur_pos > ((int64_t *)ph->ph_data + in di_prop_int64_op()
522 ph->ph_size - sizeof (int64_t)))) in di_prop_int64_op()
529 bcopy((caddr_t)data, ph->ph_cur_pos, sizeof (int64_t)); in di_prop_int64_op()
535 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + in di_prop_int64_op()
543 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_int64_op()
544 ph->ph_size < sizeof (int64_t)) in di_prop_int64_op()
548 if ((caddr_t)ph->ph_cur_pos == in di_prop_int64_op()
549 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_int64_op()
551 } else if ((caddr_t)ph->ph_cur_pos > in di_prop_int64_op()
552 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_int64_op()
560 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + in di_prop_int64_op()
587 di_prop_1275_string(prop_handle_t *ph, uint_t cmd, char *data) in di_prop_1275_string() argument
598 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) { in di_prop_1275_string()
602 n = strlen((char *)ph->ph_cur_pos) + 1; in di_prop_1275_string()
603 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_string()
604 ph->ph_size - n)) { in di_prop_1275_string()
611 bcopy((char *)ph->ph_cur_pos, data, n); in di_prop_1275_string()
617 ph->ph_cur_pos = (char *)ph->ph_cur_pos + n; in di_prop_1275_string()
624 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) { in di_prop_1275_string()
629 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_string()
630 ph->ph_size - n)) { in di_prop_1275_string()
637 bcopy(data, (char *)ph->ph_cur_pos, n); in di_prop_1275_string()
643 ph->ph_cur_pos = (char *)ph->ph_cur_pos + n; in di_prop_1275_string()
650 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) { in di_prop_1275_string()
660 p = (char *)ph->ph_cur_pos; in di_prop_1275_string()
661 end = (char *)ph->ph_data + ph->ph_size; in di_prop_1275_string()
675 ph->ph_cur_pos = p + 1; in di_prop_1275_string()
694 p = (char *)ph->ph_cur_pos; in di_prop_1275_string()
695 end = (char *)ph->ph_data + ph->ph_size; in di_prop_1275_string()
698 ph->ph_cur_pos = p; in di_prop_1275_string()
724 di_prop_1275_bytes(prop_handle_t *ph, uint_t cmd, uchar_t *data, in di_prop_1275_bytes() argument
732 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_bytes()
733 ph->ph_size < nelements || in di_prop_1275_bytes()
734 ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_bytes()
735 ph->ph_size - nelements))) in di_prop_1275_bytes()
741 bcopy((char *)ph->ph_cur_pos, (char *)data, nelements); in di_prop_1275_bytes()
746 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements; in di_prop_1275_bytes()
753 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_bytes()
754 ph->ph_size < nelements || in di_prop_1275_bytes()
755 ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_bytes()
756 ph->ph_size - nelements))) in di_prop_1275_bytes()
762 bcopy((char *)data, (char *)ph->ph_cur_pos, nelements); in di_prop_1275_bytes()
768 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements; in di_prop_1275_bytes()
775 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_bytes()
776 ph->ph_size < nelements) in di_prop_1275_bytes()
779 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_bytes()
780 ph->ph_size - nelements)) in di_prop_1275_bytes()
786 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements; in di_prop_1275_bytes()
829 prop_handle_t ph; in di_prop_decode_common() local
894 bzero((caddr_t)&ph, sizeof (prop_handle_t)); in di_prop_decode_common()
895 ph.ph_data = *(uchar_t **)data; in di_prop_decode_common()
896 ph.ph_size = size; in di_prop_decode_common()
901 ph.ph_cur_pos = ph.ph_data; in di_prop_decode_common()
902 ph.ph_save_pos = ph.ph_data; in di_prop_decode_common()
903 ph.ph_ops = &prop_1275_ops; in di_prop_decode_common()
904 ph.ph_flags = PH_FROM_PROM; in di_prop_decode_common()
919 if ((*prop_decoder)(&ph, data, (uint_t *)&nelements) in di_prop_decode_common()
927 free(ph.ph_data); in di_prop_decode_common()