src/dpdk/lib/librte_eal/freebsd/eal_hugepage_info.c
int
eal_hugepage_info_read(void)
{
	struct internal_config *internal_conf =
		eal_get_internal_configuration();

	struct hugepage_info *hpi = &internal_conf->hugepage_info[0];
	struct hugepage_info *tmp_hpi;

	internal_conf->num_hugepage_sizes = 1;

	tmp_hpi = open_shared_memory(eal_hugepage_info_path(),
				  sizeof(internal_conf->hugepage_info));
	if (tmp_hpi == NULL) {
		RTE_LOG(ERR, EAL, "Failed to open shared memory!\n");
		return -1;
	}

	memcpy(hpi, tmp_hpi, sizeof(internal_conf->hugepage_info));

	if (munmap(tmp_hpi, sizeof(internal_conf->hugepage_info)) < 0) {
		RTE_LOG(ERR, EAL, "Failed to unmap shared memory!\n");
		return -1;
	}
	return 0;
}
/* copy stuff from shared info into internal config */
copy stuff from shared info into internal config
copy stuff from shared info into internal config
int
eal_hugepage_info_read(void)
{
	struct internal_config *internal_conf =
		eal_get_internal_configuration();
	struct hugepage_info *hpi = &internal_conf->hugepage_info[0];
	struct hugepage_info *tmp_hpi;
	internal_conf->num_hugepage_sizes = 1;
	tmp_hpi = open_shared_memory(eal_hugepage_info_path(),
				  sizeof(internal_conf->hugepage_info));
	if (tmp_hpi == NULL) {
		RTE_LOG(ERR, EAL, "Failed to open shared memory!\n");
		return -1;
	}
	memcpy(hpi, tmp_hpi, sizeof(internal_conf->hugepage_info));
	if (munmap(tmp_hpi, sizeof(internal_conf->hugepage_info)) < 0) {
		RTE_LOG(ERR, EAL, "Failed to unmap shared memory!\n");
		return -1;
	}
	return 0;
}
int eal_hugepage_info_read ( void ) { struct internal_config * internal_conf = eal_get_internal_configuration ( ) ; struct hugepage_info * hpi = & internal_conf -> hugepage_info [ 0 ] ; struct hugepage_info * tmp_hpi ; internal_conf -> num_hugepage_sizes = 1 ; tmp_hpi = open_shared_memory ( eal_hugepage_info_path ( ) , sizeof ( internal_conf -> hugepage_info ) ) ; if ( tmp_hpi == NULL ) { RTE_LOG ( ERR , EAL , " \n " ) ; return -1 ; } memcpy ( hpi , tmp_hpi , sizeof ( internal_conf -> hugepage_info ) ) ; if ( munmap ( tmp_hpi , sizeof ( internal_conf -> hugepage_info ) ) < 0 ) { RTE_LOG ( ERR , EAL , " \n " ) ; return -1 ; } return 0 ; }
copy stuff from shared info into internal config
copy stuff from shared info into internal config