Lines Matching refs:ph
82 di_prop_reset_pos(prop_handle_t *ph) in di_prop_reset_pos() argument
84 ph->ph_cur_pos = ph->ph_data; in di_prop_reset_pos()
85 ph->ph_save_pos = ph->ph_data; in di_prop_reset_pos()
93 di_prop_save_pos(prop_handle_t *ph) in di_prop_save_pos() argument
95 ph->ph_save_pos = ph->ph_cur_pos; in di_prop_save_pos()
102 di_prop_restore_pos(prop_handle_t *ph) in di_prop_restore_pos() argument
104 ph->ph_cur_pos = ph->ph_save_pos; in di_prop_restore_pos()
115 di_prop_fm_decode_ints(prop_handle_t *ph, void *data, uint_t *nelements) in di_prop_fm_decode_ints() argument
128 i = DDI_PROP_INT(ph, DDI_PROP_CMD_SKIP, NULL); in di_prop_fm_decode_ints()
149 di_prop_reset_pos(ph); in di_prop_fm_decode_ints()
164 i = DDI_PROP_INT(ph, DDI_PROP_CMD_DECODE, tmp); in di_prop_fm_decode_ints()
191 di_prop_fm_decode_strings(prop_handle_t *ph, void *data, uint_t *nelements) in di_prop_fm_decode_strings() argument
210 size = DDI_PROP_STR(ph, DDI_PROP_CMD_GET_DSIZE, NULL); in di_prop_fm_decode_strings()
240 di_prop_reset_pos(ph); in di_prop_fm_decode_strings()
243 i = DDI_PROP_STR(ph, DDI_PROP_CMD_DECODE, tmp); in di_prop_fm_decode_strings()
271 di_prop_fm_decode_bytes(prop_handle_t *ph, void *data, uint_t *nelements) in di_prop_fm_decode_bytes() argument
280 if (ph->ph_size == 0) in di_prop_fm_decode_bytes()
286 nbytes = DDI_PROP_BYTES(ph, DDI_PROP_CMD_GET_DSIZE, in di_prop_fm_decode_bytes()
287 data, ph->ph_size); in di_prop_fm_decode_bytes()
308 i = DDI_PROP_BYTES(ph, DDI_PROP_CMD_DECODE, tmp, nbytes); in di_prop_fm_decode_bytes()
371 di_prop_1275_int(prop_handle_t *ph, uint_t cmd, int *data) in di_prop_1275_int() argument
380 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) in di_prop_1275_int()
382 if (ph->ph_flags & PH_FROM_PROM) { in di_prop_1275_int()
383 i = ph->ph_size < PROP_1275_INT_SIZE ? in di_prop_1275_int()
384 ph->ph_size : PROP_1275_INT_SIZE; in di_prop_1275_int()
385 if ((int *)ph->ph_cur_pos > ((int *)ph->ph_data + in di_prop_1275_int()
386 ph->ph_size - i)) in di_prop_1275_int()
388 } else if (ph->ph_size < sizeof (int) || in di_prop_1275_int()
389 ((int *)ph->ph_cur_pos > ((int *)ph->ph_data + in di_prop_1275_int()
390 ph->ph_size - sizeof (int)))) { in di_prop_1275_int()
398 if (ph->ph_flags & PH_FROM_PROM) { in di_prop_1275_int()
400 (uchar_t *)ph->ph_cur_pos, in di_prop_1275_int()
401 (ph->ph_size < PROP_1275_INT_SIZE) ? in di_prop_1275_int()
402 ph->ph_size : PROP_1275_INT_SIZE); in di_prop_1275_int()
404 bcopy(ph->ph_cur_pos, (caddr_t)data, sizeof (int)); in di_prop_1275_int()
411 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE; in di_prop_1275_int()
418 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_int()
419 ph->ph_size < PROP_1275_INT_SIZE || in di_prop_1275_int()
420 ((int *)ph->ph_cur_pos > ((int *)ph->ph_data + in di_prop_1275_int()
421 ph->ph_size - sizeof (int)))) in di_prop_1275_int()
428 bcopy((caddr_t)data, ph->ph_cur_pos, sizeof (int)); in di_prop_1275_int()
434 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE; in di_prop_1275_int()
441 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_int()
442 ph->ph_size < PROP_1275_INT_SIZE) in di_prop_1275_int()
446 if ((caddr_t)ph->ph_cur_pos == in di_prop_1275_int()
447 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_1275_int()
449 } else if ((caddr_t)ph->ph_cur_pos > in di_prop_1275_int()
450 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_1275_int()
458 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE; in di_prop_1275_int()
486 di_prop_int64_op(prop_handle_t *ph, uint_t cmd, int64_t *data) in di_prop_int64_op() argument
493 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) in di_prop_int64_op()
495 if (ph->ph_flags & PH_FROM_PROM) { in di_prop_int64_op()
497 } else if (ph->ph_size < sizeof (int64_t) || in di_prop_int64_op()
498 ((int64_t *)ph->ph_cur_pos > ((int64_t *)ph->ph_data + in di_prop_int64_op()
499 ph->ph_size - sizeof (int64_t)))) { in di_prop_int64_op()
507 bcopy(ph->ph_cur_pos, (caddr_t)data, sizeof (int64_t)); in di_prop_int64_op()
513 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + in di_prop_int64_op()
521 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_int64_op()
522 ph->ph_size < sizeof (int64_t) || in di_prop_int64_op()
523 ((int64_t *)ph->ph_cur_pos > ((int64_t *)ph->ph_data + in di_prop_int64_op()
524 ph->ph_size - sizeof (int64_t)))) in di_prop_int64_op()
531 bcopy((caddr_t)data, ph->ph_cur_pos, sizeof (int64_t)); in di_prop_int64_op()
537 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + in di_prop_int64_op()
545 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_int64_op()
546 ph->ph_size < sizeof (int64_t)) in di_prop_int64_op()
550 if ((caddr_t)ph->ph_cur_pos == in di_prop_int64_op()
551 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_int64_op()
553 } else if ((caddr_t)ph->ph_cur_pos > in di_prop_int64_op()
554 (caddr_t)ph->ph_data + ph->ph_size) { in di_prop_int64_op()
562 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + in di_prop_int64_op()
589 di_prop_1275_string(prop_handle_t *ph, uint_t cmd, char *data) in di_prop_1275_string() argument
600 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) { in di_prop_1275_string()
604 n = strlen((char *)ph->ph_cur_pos) + 1; in di_prop_1275_string()
605 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_string()
606 ph->ph_size - n)) { in di_prop_1275_string()
613 bcopy((char *)ph->ph_cur_pos, data, n); in di_prop_1275_string()
619 ph->ph_cur_pos = (char *)ph->ph_cur_pos + n; in di_prop_1275_string()
626 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) { in di_prop_1275_string()
631 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_string()
632 ph->ph_size - n)) { in di_prop_1275_string()
639 bcopy(data, (char *)ph->ph_cur_pos, n); in di_prop_1275_string()
645 ph->ph_cur_pos = (char *)ph->ph_cur_pos + n; in di_prop_1275_string()
652 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) { in di_prop_1275_string()
662 p = (char *)ph->ph_cur_pos; in di_prop_1275_string()
663 end = (char *)ph->ph_data + ph->ph_size; in di_prop_1275_string()
677 ph->ph_cur_pos = p + 1; in di_prop_1275_string()
696 p = (char *)ph->ph_cur_pos; in di_prop_1275_string()
697 end = (char *)ph->ph_data + ph->ph_size; in di_prop_1275_string()
700 ph->ph_cur_pos = p; in di_prop_1275_string()
726 di_prop_1275_bytes(prop_handle_t *ph, uint_t cmd, uchar_t *data, in di_prop_1275_bytes() argument
734 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_bytes()
735 ph->ph_size < nelements || in di_prop_1275_bytes()
736 ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_bytes()
737 ph->ph_size - nelements))) in di_prop_1275_bytes()
743 bcopy((char *)ph->ph_cur_pos, (char *)data, nelements); in di_prop_1275_bytes()
748 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements; in di_prop_1275_bytes()
755 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_bytes()
756 ph->ph_size < nelements || in di_prop_1275_bytes()
757 ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_bytes()
758 ph->ph_size - nelements))) in di_prop_1275_bytes()
764 bcopy((char *)data, (char *)ph->ph_cur_pos, nelements); in di_prop_1275_bytes()
770 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements; in di_prop_1275_bytes()
777 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 || in di_prop_1275_bytes()
778 ph->ph_size < nelements) in di_prop_1275_bytes()
781 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data + in di_prop_1275_bytes()
782 ph->ph_size - nelements)) in di_prop_1275_bytes()
788 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements; in di_prop_1275_bytes()
831 prop_handle_t ph; in di_prop_decode_common() local
896 bzero((caddr_t)&ph, sizeof (prop_handle_t)); in di_prop_decode_common()
897 ph.ph_data = *(uchar_t **)data; in di_prop_decode_common()
898 ph.ph_size = size; in di_prop_decode_common()
903 ph.ph_cur_pos = ph.ph_data; in di_prop_decode_common()
904 ph.ph_save_pos = ph.ph_data; in di_prop_decode_common()
905 ph.ph_ops = &prop_1275_ops; in di_prop_decode_common()
906 ph.ph_flags = PH_FROM_PROM; in di_prop_decode_common()
921 if ((*prop_decoder)(&ph, data, (uint_t *)&nelements) in di_prop_decode_common()
929 free(ph.ph_data); in di_prop_decode_common()