void xen_map_cache_init(void)

{

    unsigned long size;

    struct rlimit rlimit_as;



    mapcache = g_malloc0(sizeof (MapCache));



    QTAILQ_INIT(&mapcache->locked_entries);

    mapcache->last_address_index = -1;



    getrlimit(RLIMIT_AS, &rlimit_as);

    if (rlimit_as.rlim_max < MCACHE_MAX_SIZE) {

        rlimit_as.rlim_cur = rlimit_as.rlim_max;

    } else {

        rlimit_as.rlim_cur = MCACHE_MAX_SIZE;

    }



    setrlimit(RLIMIT_AS, &rlimit_as);

    mapcache->max_mcache_size = rlimit_as.rlim_cur;



    mapcache->nr_buckets =

        (((mapcache->max_mcache_size >> XC_PAGE_SHIFT) +

          (1UL << (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)) - 1) >>

         (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT));



    size = mapcache->nr_buckets * sizeof (MapCacheEntry);

    size = (size + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1);

    DPRINTF("%s, nr_buckets = %lx size %lu\n", __func__,

            mapcache->nr_buckets, size);

    mapcache->entry = g_malloc0(size);

}

void xen_map_cache_init(void)

{

    unsigned long size;

    struct rlimit rlimit_as;



    mapcache = g_malloc0(sizeof (MapCache));



    QTAILQ_INIT(&mapcache->locked_entries);

    mapcache->last_address_index = -1;



    getrlimit(RLIMIT_AS, &rlimit_as);

    if (rlimit_as.rlim_max < MCACHE_MAX_SIZE) {

        rlimit_as.rlim_cur = rlimit_as.rlim_max;

    } else {

        rlimit_as.rlim_cur = MCACHE_MAX_SIZE;

    }



    setrlimit(RLIMIT_AS, &rlimit_as);

    mapcache->max_mcache_size = rlimit_as.rlim_cur;



    mapcache->nr_buckets =

        (((mapcache->max_mcache_size >> XC_PAGE_SHIFT) +

          (1UL << (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)) - 1) >>

         (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT));



    size = mapcache->nr_buckets * sizeof (MapCacheEntry);

    size = (size + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1);

    DPRINTF("%s, nr_buckets = %lx size %lu\n", __func__,

            mapcache->nr_buckets, size);

    mapcache->entry = g_malloc0(size);

}

    getrlimit(RLIMIT_AS, &rlimit_as);     if (rlimit_as.rlim_max < MCACHE_MAX_SIZE) {         rlimit_as.rlim_cur = rlimit_as.rlim_max;         rlimit_as.rlim_cur = MCACHE_MAX_SIZE;     mapcache->max_mcache_size = rlimit_as.rlim_cur;
void FUNC_0(void)

{

    unsigned long VAR_0;

    struct rlimit VAR_1;



    mapcache = g_malloc0(sizeof (MapCache));



    QTAILQ_INIT(&mapcache->locked_entries);

    mapcache->last_address_index = -1;



    getrlimit(RLIMIT_AS, &VAR_1);

    if (VAR_1.rlim_max < MCACHE_MAX_SIZE) {

        VAR_1.rlim_cur = VAR_1.rlim_max;

    } else {

        VAR_1.rlim_cur = MCACHE_MAX_SIZE;

    }



    setrlimit(RLIMIT_AS, &VAR_1);

    mapcache->max_mcache_size = VAR_1.rlim_cur;



    mapcache->nr_buckets =

        (((mapcache->max_mcache_size >> XC_PAGE_SHIFT) +

          (1UL << (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)) - 1) >>

         (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT));



    VAR_0 = mapcache->nr_buckets * sizeof (MapCacheEntry);

    VAR_0 = (VAR_0 + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1);

    DPRINTF("%s, nr_buckets = %lx VAR_0 %lu\n", __func__,

            mapcache->nr_buckets, VAR_0);

    mapcache->entry = g_malloc0(VAR_0);

}

void FUNC_0(void)
{ unsigned long VAR_0; struct rlimit VAR_1; mapcache = g_malloc0(sizeof (MapCache)); QTAILQ_INIT(&mapcache->locked_entries); mapcache->last_address_index = -1; getrlimit(RLIMIT_AS, &VAR_1); if (VAR_1.rlim_max < MCACHE_MAX_SIZE) { VAR_1.rlim_cur = VAR_1.rlim_max; } else { VAR_1.rlim_cur = MCACHE_MAX_SIZE; } setrlimit(RLIMIT_AS, &VAR_1); mapcache->max_mcache_size = VAR_1.rlim_cur; mapcache->nr_buckets =
(((mapcache->max_mcache_size >> XC_PAGE_SHIFT) +
(1UL << (MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)) - 1) >>
(MCACHE_BUCKET_SHIFT - XC_PAGE_SHIFT)); VAR_0 = mapcache->nr_buckets * sizeof (MapCacheEntry); VAR_0 = (VAR_0 + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1); DPRINTF("%s, nr_buckets = %lx VAR_0 %lu\n", __func__,
mapcache->nr_buckets, VAR_0); mapcache->entry = g_malloc0(VAR_0); }