[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Question about next_module() function


  • To: xen-devel@xxxxxxxxxxxxx
  • From: 조현권 <chkwon91@xxxxxxxxx>
  • Date: Sat, 24 Sep 2016 09:36:35 +0900
  • Delivery-date: Sat, 24 Sep 2016 00:36:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hi

I am experimenting Xen with my embedded system environment and got a question in next_module() function.

static paddr_t __init next_module(paddr_t s, paddr_t *end)
{
    struct bootmodules *mi = &bootinfo.modules;
    paddr_t lowest = ~(paddr_t)0;
    int i;

    for ( i = 0; i < mi->nr_mods; i++ )
    {
        paddr_t mod_s = mi->module[i].start;
        paddr_t mod_e = mod_s + mi->module[i].size;

        if ( !mi->module[i].size )
            continue;

        if ( mod_s < s )
            continue;
        if ( mod_s > lowest )
            continue;
        if ( mod_s > *end )
            continue;
        lowest = mod_s;
        *end = min(*end, mod_e);
    }
    return lowest;
}

The job of next_module() function is excluding module exist RAM range between s and *end and finding empty space which can be heap space.

But Its function does not work if module range is bigger than s and *end range. 
(Case when module range is mod_s <= s and mod_e >= *end)

        if ( mod_s < s )
            continue;

Above condition passes the case and xen consider range s and *end is free space.

Is it expected result or mistake?

Thank you.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.