Changeset 53657 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common
- Timestamp:
- Jan 2, 2015 12:28:56 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_create.c
r53656 r53657 26 26 */ 27 27 28 #ifndef VBOX 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 29 30 … … 31 32 #include <sys/param.h> 32 33 #include <sys/mman.h> 34 #else /* VBOX */ 35 #endif /* VBOX */ 33 36 #include <ctf_impl.h> 34 37 … … 94 97 if (dmd->dmd_name) { 95 98 ctm.ctm_name = soff; 96 soff += strlen(dmd->dmd_name) + 1;99 soff += VBDTCAST(uint_t)strlen(dmd->dmd_name) + 1; 97 100 } else 98 101 ctm.ctm_name = 0; … … 117 120 if (dmd->dmd_name) { 118 121 ctlm.ctlm_name = soff; 119 soff += strlen(dmd->dmd_name) + 1;122 soff += VBDTCAST(uint_t)strlen(dmd->dmd_name) + 1; 120 123 } else 121 124 ctlm.ctlm_name = 0; … … 142 145 cte.cte_name = soff; 143 146 cte.cte_value = dmd->dmd_value; 144 soff += strlen(dmd->dmd_name) + 1;147 soff += VBDTCAST(uint_t)strlen(dmd->dmd_name) + 1; 145 148 bcopy(&cte, t, sizeof (cte)); 146 149 t += sizeof (cte); … … 258 261 * bcopy the finished header to the start of the buffer. 259 262 */ 260 hdr.cth_stroff = hdr.cth_typeoff + size;261 hdr.cth_strlen = fp->ctf_dtstrlen;263 hdr.cth_stroff = hdr.cth_typeoff + VBDTCAST(uint_t)size; 264 hdr.cth_strlen = VBDTCAST(uint_t)fp->ctf_dtstrlen; 262 265 size = sizeof (ctf_header_t) + hdr.cth_stroff + hdr.cth_strlen; 263 266 … … 597 600 598 601 dtd->dtd_data.ctt_info = CTF_TYPE_INFO(kind, flag, 0); 599 dtd->dtd_data.ctt_size = clp2(P2ROUNDUP(ep->cte_bits, NBBY) / NBBY);602 dtd->dtd_data.ctt_size = VBDTCAST(ushort_t)clp2(P2ROUNDUP(ep->cte_bits, NBBY) / NBBY); 600 603 dtd->dtd_u.dtu_enc = *ep; 601 604 … … 777 780 778 781 dtd->dtd_data.ctt_info = CTF_TYPE_INFO(CTF_K_ENUM, flag, 0); 779 dtd->dtd_data.ctt_size = fp->ctf_dmodel->ctd_int;782 dtd->dtd_data.ctt_size = VBDTCAST(ushort_t)fp->ctf_dmodel->ctd_int; 780 783 781 784 return (type); -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_decl.c
r53656 r53657 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 29 #endif 28 30 29 31 /* … … 177 179 178 180 va_start(ap, format); 181 #ifndef VBOX 179 182 n = vsnprintf(cd->cd_ptr, len, format, ap); 183 #else 184 n = RTStrPrintfV(cd->cd_ptr, len, format, ap); 185 #endif 180 186 va_end(ap); 181 187 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_error.c
r53656 r53657 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 29 #endif 28 30 29 31 #include <ctf_impl.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_hash.c
r53656 r53657 26 26 */ 27 27 28 #ifndef VBOX 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 30 #endif 29 31 30 32 #include <ctf_impl.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_impl.h
r53656 r53657 29 29 #define _CTF_IMPL_H 30 30 31 #ifndef VBOX 31 32 #pragma ident "%Z%%M% %I% %E% SMI" 32 33 … … 34 35 #include <sys/errno.h> 35 36 #include <sys/sysmacros.h> 37 #else /* VBOX */ 38 # include "../../../../../Runtime/include/internal/ldrELF32.h" 39 # include "../../../../../Runtime/include/internal/ldrELF64.h" 40 # include <errno.h> 41 #endif /* VBOX */ 36 42 #include <sys/ctf_api.h> 37 43 38 44 #ifdef _KERNEL 39 45 46 #ifndef VBOX 40 47 #include <sys/systm.h> 41 48 #include <sys/cmn_err.h> 42 49 #include <sys/varargs.h> 50 #endif 43 51 44 52 #define isspace(c) \ … … 50 58 #else /* _KERNEL */ 51 59 60 #ifndef VBOX 52 61 #include <strings.h> 53 62 #include <stdlib.h> … … 56 65 #include <limits.h> 57 66 #include <ctype.h> 67 #endif 58 68 59 69 #endif /* _KERNEL */ … … 330 340 extern int _libctf_debug; /* debugging messages enabled */ 331 341 342 #ifdef VBOX 343 # ifndef MAP_FAILED /* returned by ctf_data_alloc on failure. */ 344 # define MAP_FAILED ((void *)~(uintptr_t)0) 345 # endif 346 #endif 347 332 348 #ifdef __cplusplus 333 349 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_labels.c
r53656 r53657 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 29 #endif 28 30 29 31 #include <ctf_impl.h> -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_lookup.c
r53656 r53657 26 26 */ 27 27 28 #ifndef VBOX 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 29 30 30 31 #include <sys/sysmacros.h> 32 #else /* VBOX */ 33 # include <ctype.h> 34 #endif /* VBOX */ 31 35 #include <ctf_impl.h> 32 36 … … 198 202 } 199 203 200 if (fp->ctf_sxlate[symidx] == -1u)204 if (fp->ctf_sxlate[symidx] == ~0u /*VBOX: -1u*/) 201 205 return (ctf_set_errno(fp, ECTF_NOTYPEDAT)); 202 206 … … 261 265 } 262 266 263 if (fp->ctf_sxlate[symidx] == -1u)267 if (fp->ctf_sxlate[symidx] == ~0u /*VBOX: -1u*/) 264 268 return (ctf_set_errno(fp, ECTF_NOFUNCDAT)); 265 269 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_open.c
r53656 r53657 26 26 */ 27 27 28 #ifndef VBOX 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 29 30 #endif 31 32 #ifndef VBOX 30 33 #include <ctf_impl.h> 31 34 #include <sys/mman.h> 32 35 #include <sys/zmod.h> 36 #else /* VBOX */ 37 # define CTF_OLD_VERSIONS 38 # include <ctf_impl.h> 39 # include <zlib.h> 40 # define z_compress compress 41 # define z_uncompress uncompress 42 # define z_strerror zError 43 #endif /* VBOX */ 33 44 34 45 static const ctf_dmodel_t _libctf_models[] = { … … 143 154 strcmp(name, "_START_") == 0 || 144 155 strcmp(name, "_END_") == 0) { 145 *xp = -1u;156 *xp = ~0u /*VBOX: -1u*/; 146 157 continue; 147 158 } … … 151 162 if (objtoff >= hp->cth_funcoff || 152 163 (gsp->st_shndx == SHN_ABS && gsp->st_value == 0)) { 153 *xp = -1u;164 *xp = ~0u /*VBOX: -1u*/; 154 165 break; 155 166 } … … 161 172 case STT_FUNC: 162 173 if (funcoff >= hp->cth_typeoff) { 163 *xp = -1u;174 *xp = ~0u /*VBOX: -1u*/; 164 175 break; 165 176 } … … 183 194 184 195 default: 185 *xp = -1u;196 *xp = ~0u /*VBOX: -1u*/; 186 197 break; 187 198 } … … 632 643 */ 633 644 if (hp.cth_flags & CTF_F_COMPRESS) { 645 #ifndef VBOX 634 646 size_t srclen, dstlen; 647 #else 648 uLong srclen; 649 uLong dstlen; 650 #endif 635 651 const void *src; 636 652 int rc = Z_OK; 637 653 654 #ifndef VBOX 638 655 if (ctf_zopen(errp) == NULL) 639 656 return (NULL); /* errp is set for us */ 657 #endif 640 658 641 659 if ((base = ctf_data_alloc(size + hdrsz)) == MAP_FAILED) … … 647 665 648 666 src = (uchar_t *)ctfsect->cts_data + hdrsz; 649 srclen = ctfsect->cts_size - hdrsz;650 dstlen = size;667 srclen = VBDTCAST(uLong)(ctfsect->cts_size - hdrsz); 668 dstlen = VBDTCAST(uLong)size; 651 669 652 670 if ((rc = z_uncompress(buf, &dstlen, src, srclen)) != Z_OK) { -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_types.c
r53656 r53657 26 26 */ 27 27 28 #ifndef VBOX 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 30 #endif 29 31 30 32 #include <ctf_impl.h> … … 310 312 { 311 313 ssize_t rv = ctf_type_lname(fp, type, buf, len); 312 return (rv >= 0 && rv < len ? buf : NULL);314 return (rv >= 0 && VBDTCAST(size_t)rv < len ? buf : NULL); 313 315 } 314 316 … … 406 408 for (; n != 0; n--, mp++) { 407 409 ssize_t am = ctf_type_align(fp, mp->ctm_type); 408 align = MAX( align, am);410 align = MAX(VBDTCAST(ssize_t)align, am); 409 411 } 410 412 } else { … … 412 414 for (; n != 0; n--, lmp++) { 413 415 ssize_t am = ctf_type_align(fp, lmp->ctlm_type); 414 align = MAX( align, am);416 align = MAX(VBDTCAST(ssize_t)align, am); 415 417 } 416 418 } -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/common/ctf/ctf_util.c
r53656 r53657 25 25 */ 26 26 27 #ifndef VBOX 27 28 #pragma ident "%Z%%M% %I% %E% SMI" 29 #endif 28 30 29 31 #include <ctf_impl.h>
Note:
See TracChangeset
for help on using the changeset viewer.