Lines Matching refs:strtab

82     struct xc_core_strtab *strtab;  in xc_core_strtab_init()  local
84 strtab = malloc(sizeof(*strtab)); in xc_core_strtab_init()
85 if ( strtab == NULL ) in xc_core_strtab_init()
92 free(strtab); in xc_core_strtab_init()
95 strtab->strings = strings; in xc_core_strtab_init()
96 strtab->max = PAGE_SIZE; in xc_core_strtab_init()
99 strtab->strings[0] = '\0'; in xc_core_strtab_init()
100 strtab->length = 1; in xc_core_strtab_init()
102 return strtab; in xc_core_strtab_init()
106 xc_core_strtab_free(struct xc_core_strtab *strtab) in xc_core_strtab_free() argument
108 free(strtab->strings); in xc_core_strtab_free()
109 free(strtab); in xc_core_strtab_free()
113 xc_core_strtab_get(xc_interface *xch, struct xc_core_strtab *strtab, const char *name) in xc_core_strtab_get() argument
118 if ( strtab->length > UINT16_MAX - len ) in xc_core_strtab_get()
125 if ( strtab->length + len > strtab->max ) in xc_core_strtab_get()
128 if ( strtab->max > UINT16_MAX / 2 ) in xc_core_strtab_get()
135 tmp = realloc(strtab->strings, strtab->max * 2); in xc_core_strtab_get()
142 strtab->strings = tmp; in xc_core_strtab_get()
143 strtab->max *= 2; in xc_core_strtab_get()
146 ret = strtab->length; in xc_core_strtab_get()
147 strcpy(strtab->strings + strtab->length, name); in xc_core_strtab_get()
148 strtab->length += len; in xc_core_strtab_get()
220 struct xc_core_strtab *strtab, in xc_core_shdr_set() argument
225 uint64_t name_idx = xc_core_strtab_get(xch, strtab, name); in xc_core_shdr_set()
457 struct xc_core_strtab *strtab = NULL; in xc_domain_dumpcore_via_callback() local
566 strtab = xc_core_strtab_init(xch); in xc_domain_dumpcore_via_callback()
567 if ( strtab == NULL ) in xc_domain_dumpcore_via_callback()
597 sts = xc_core_shdr_set(xch, shdr, strtab, ELF_SHSTRTAB, SHT_STRTAB, 0, 0, 0, 0); in xc_domain_dumpcore_via_callback()
615 sts = xc_core_shdr_set(xch, shdr, strtab, XEN_DUMPCORE_SEC_NOTE, SHT_NOTE, in xc_domain_dumpcore_via_callback()
629 sts = xc_core_shdr_set(xch, shdr, strtab, XEN_DUMPCORE_SEC_PRSTATUS, in xc_domain_dumpcore_via_callback()
637 sts = xc_core_arch_context_get_shdr(xch, &arch_ctxt, sheaders, strtab, in xc_domain_dumpcore_via_callback()
653 sts = xc_core_shdr_set(xch, shdr, strtab, XEN_DUMPCORE_SEC_SHARED_INFO, in xc_domain_dumpcore_via_callback()
682 sts = xc_core_shdr_set(xch, shdr, strtab, XEN_DUMPCORE_SEC_PAGES, SHT_PROGBITS, in xc_domain_dumpcore_via_callback()
698 sts = xc_core_shdr_set(xch, shdr, strtab, XEN_DUMPCORE_SEC_P2M, in xc_domain_dumpcore_via_callback()
706 sts = xc_core_shdr_set(xch, shdr, strtab, XEN_DUMPCORE_SEC_PFN, in xc_domain_dumpcore_via_callback()
716 filesz = strtab->length; in xc_domain_dumpcore_via_callback()
889 sts = dump_rtn(xch, args, strtab->strings, strtab->length); in xc_domain_dumpcore_via_callback()
906 if ( strtab != NULL ) in xc_domain_dumpcore_via_callback()
907 xc_core_strtab_free(strtab); in xc_domain_dumpcore_via_callback()