Lines Matching defs:ph

79 di_prop_reset_pos(prop_handle_t *ph)
81 ph->ph_cur_pos = ph->ph_data;
82 ph->ph_save_pos = ph->ph_data;
90 di_prop_save_pos(prop_handle_t *ph)
92 ph->ph_save_pos = ph->ph_cur_pos;
99 di_prop_restore_pos(prop_handle_t *ph)
101 ph->ph_cur_pos = ph->ph_save_pos;
112 di_prop_fm_decode_ints(prop_handle_t *ph, void *data, uint_t *nelements)
125 i = DDI_PROP_INT(ph, DDI_PROP_CMD_SKIP, NULL);
146 di_prop_reset_pos(ph);
161 i = DDI_PROP_INT(ph, DDI_PROP_CMD_DECODE, tmp);
188 di_prop_fm_decode_strings(prop_handle_t *ph, void *data, uint_t *nelements)
207 size = DDI_PROP_STR(ph, DDI_PROP_CMD_GET_DSIZE, NULL);
237 di_prop_reset_pos(ph);
240 i = DDI_PROP_STR(ph, DDI_PROP_CMD_DECODE, tmp);
268 di_prop_fm_decode_bytes(prop_handle_t *ph, void *data, uint_t *nelements)
277 if (ph->ph_size == 0)
283 nbytes = DDI_PROP_BYTES(ph, DDI_PROP_CMD_GET_DSIZE,
284 data, ph->ph_size);
305 i = DDI_PROP_BYTES(ph, DDI_PROP_CMD_DECODE, tmp, nbytes);
368 di_prop_1275_int(prop_handle_t *ph, uint_t cmd, int *data)
377 if (ph->ph_cur_pos == NULL || ph->ph_size == 0)
379 if (ph->ph_flags & PH_FROM_PROM) {
380 i = ph->ph_size < PROP_1275_INT_SIZE ?
381 ph->ph_size : PROP_1275_INT_SIZE;
382 if ((int *)ph->ph_cur_pos > ((int *)ph->ph_data +
383 ph->ph_size - i))
385 } else if (ph->ph_size < sizeof (int) ||
386 ((int *)ph->ph_cur_pos > ((int *)ph->ph_data +
387 ph->ph_size - sizeof (int)))) {
395 if (ph->ph_flags & PH_FROM_PROM) {
397 (uchar_t *)ph->ph_cur_pos,
398 (ph->ph_size < PROP_1275_INT_SIZE) ?
399 ph->ph_size : PROP_1275_INT_SIZE);
401 bcopy(ph->ph_cur_pos, (caddr_t)data, sizeof (int));
408 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE;
415 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 ||
416 ph->ph_size < PROP_1275_INT_SIZE ||
417 ((int *)ph->ph_cur_pos > ((int *)ph->ph_data +
418 ph->ph_size - sizeof (int))))
425 bcopy((caddr_t)data, ph->ph_cur_pos, sizeof (int));
431 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE;
438 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 ||
439 ph->ph_size < PROP_1275_INT_SIZE)
443 if ((caddr_t)ph->ph_cur_pos ==
444 (caddr_t)ph->ph_data + ph->ph_size) {
446 } else if ((caddr_t)ph->ph_cur_pos >
447 (caddr_t)ph->ph_data + ph->ph_size) {
455 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos + PROP_1275_INT_SIZE;
483 di_prop_int64_op(prop_handle_t *ph, uint_t cmd, int64_t *data)
490 if (ph->ph_cur_pos == NULL || ph->ph_size == 0)
492 if (ph->ph_flags & PH_FROM_PROM) {
494 } else if (ph->ph_size < sizeof (int64_t) ||
495 ((int64_t *)ph->ph_cur_pos > ((int64_t *)ph->ph_data +
496 ph->ph_size - sizeof (int64_t)))) {
504 bcopy(ph->ph_cur_pos, (caddr_t)data, sizeof (int64_t));
510 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos +
518 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 ||
519 ph->ph_size < sizeof (int64_t) ||
520 ((int64_t *)ph->ph_cur_pos > ((int64_t *)ph->ph_data +
521 ph->ph_size - sizeof (int64_t))))
528 bcopy((caddr_t)data, ph->ph_cur_pos, sizeof (int64_t));
534 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos +
542 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 ||
543 ph->ph_size < sizeof (int64_t))
547 if ((caddr_t)ph->ph_cur_pos ==
548 (caddr_t)ph->ph_data + ph->ph_size) {
550 } else if ((caddr_t)ph->ph_cur_pos >
551 (caddr_t)ph->ph_data + ph->ph_size) {
559 ph->ph_cur_pos = (uchar_t *)ph->ph_cur_pos +
586 di_prop_1275_string(prop_handle_t *ph, uint_t cmd, char *data)
597 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) {
601 n = strlen((char *)ph->ph_cur_pos) + 1;
602 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data +
603 ph->ph_size - n)) {
610 bcopy((char *)ph->ph_cur_pos, data, n);
616 ph->ph_cur_pos = (char *)ph->ph_cur_pos + n;
623 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) {
628 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data +
629 ph->ph_size - n)) {
636 bcopy(data, (char *)ph->ph_cur_pos, n);
642 ph->ph_cur_pos = (char *)ph->ph_cur_pos + n;
649 if (ph->ph_cur_pos == NULL || ph->ph_size == 0) {
659 p = (char *)ph->ph_cur_pos;
660 end = (char *)ph->ph_data + ph->ph_size;
674 ph->ph_cur_pos = p + 1;
693 p = (char *)ph->ph_cur_pos;
694 end = (char *)ph->ph_data + ph->ph_size;
697 ph->ph_cur_pos = p;
723 di_prop_1275_bytes(prop_handle_t *ph, uint_t cmd, uchar_t *data,
731 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 ||
732 ph->ph_size < nelements ||
733 ((char *)ph->ph_cur_pos > ((char *)ph->ph_data +
734 ph->ph_size - nelements)))
740 bcopy((char *)ph->ph_cur_pos, (char *)data, nelements);
745 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements;
752 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 ||
753 ph->ph_size < nelements ||
754 ((char *)ph->ph_cur_pos > ((char *)ph->ph_data +
755 ph->ph_size - nelements)))
761 bcopy((char *)data, (char *)ph->ph_cur_pos, nelements);
767 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements;
774 if (ph->ph_cur_pos == NULL || ph->ph_size == 0 ||
775 ph->ph_size < nelements)
778 if ((char *)ph->ph_cur_pos > ((char *)ph->ph_data +
779 ph->ph_size - nelements))
785 ph->ph_cur_pos = (char *)ph->ph_cur_pos + nelements;
828 prop_handle_t ph;
893 bzero((caddr_t)&ph, sizeof (prop_handle_t));
894 ph.ph_data = *(uchar_t **)data;
895 ph.ph_size = size;
900 ph.ph_cur_pos = ph.ph_data;
901 ph.ph_save_pos = ph.ph_data;
902 ph.ph_ops = &prop_1275_ops;
903 ph.ph_flags = PH_FROM_PROM;
918 if ((*prop_decoder)(&ph, data, (uint_t *)&nelements)
926 free(ph.ph_data);