On Mon, Oct 29, 2012 at 10:34 PM, Jiří Zárevúcky
<[email protected]> wrote:
> http://bazaar.launchpad.net/~zarevucky-jiri/helenos/golang/revision/1596
>

I'm curious if the guard pages can be created in a much more simpler
way in kernel/generic/mm/as.c
In the as_get_unmapped_area():

               for (btree_key_t i = 0; i < node->keys; i++) {
                        as_area_t *area = (as_area_t *) node->value[i];
                        
                        mutex_lock(&area->lock);
                        
        ------->        addr =
                            ALIGN_UP(area->base + P2SZ(area->pages), PAGE_SIZE);
                        bool avail =
                            ((addr >= bound) && (addr >= area->base) &&
                            (check_area_conflicts(as, addr, pages, area)));
                        
                        mutex_unlock(&area->lock);
                        
                        if (avail)
                                return addr;
                }

---------------------
addr = ALIGN_UP(area->base + P2SZ(area->pages) + PAGE_SIZE, PAGE_SIZE);

It should leave an unmapped page beetween a two adiacent areas

-- 
--------------------
Maurizio Lombardi

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to