Changeset 92574f4 in mainline for uspace/lib/c/generic/as.c


Ignore:
Timestamp:
2011-02-24T12:03:27Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7b7ebd5
Parents:
4837092 (diff), a80849c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged development (changes in DDF, etc.).

Conflicts in uspace/drv/usbkbd/main.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/as.c

    r4837092 r92574f4  
    4141#include <bitops.h>
    4242#include <malloc.h>
    43 
    44 /** Last position allocated by as_get_mappable_page */
    45 static uintptr_t last_allocated = 0;
     43#include "private/libc.h"
    4644
    4745/** Create address space area.
     
    104102}
    105103
    106 /** Return pointer to some unmapped area, where fits new as_area
     104/** Return pointer to unmapped address space area
    107105 *
    108106 * @param size Requested size of the allocation.
    109107 *
    110  * @return pointer to the beginning
     108 * @return Pointer to the beginning of unmapped address space area.
    111109 *
    112110 */
    113111void *as_get_mappable_page(size_t size)
    114112{
    115         if (size == 0)
    116                 return NULL;
    117        
    118         size_t sz = 1 << (fnzb(size - 1) + 1);
    119         if (last_allocated == 0)
    120                 last_allocated = get_max_heap_addr();
    121        
    122         /*
    123          * Make sure we allocate from naturally aligned address.
    124          */
    125         uintptr_t res = ALIGN_UP(last_allocated, sz);
    126         last_allocated = res + ALIGN_UP(size, PAGE_SIZE);
    127        
    128         return ((void *) res);
     113        return (void *) __SYSCALL2(SYS_AS_GET_UNMAPPED_AREA,
     114            (sysarg_t) __entry, (sysarg_t) size);
    129115}
    130116
Note: See TracChangeset for help on using the changeset viewer.