Changeset f2c3fed in mainline


Ignore:
Timestamp:
2016-08-28T11:56:37Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
75b139f
Parents:
6aeca0d
Message:

Move AS_AREA_ANY, AS_MAP_FAILED and AS_AREA_UNPAGED to abi/

This way the macros can be also used in the kernel.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • abi/include/abi/mm/as.h

    r6aeca0d rf2c3fed  
    4444#define AS_AREA_LATE_RESERVE 0x20
    4545
     46#define AS_AREA_ANY    ((void *) -1)
     47#define AS_MAP_FAILED  ((void *) -1)
     48
     49#define AS_AREA_UNPAGED -1
     50
    4651/** Address space area info exported to uspace. */
    4752typedef struct {
  • kernel/generic/src/mm/as.c

    r6aeca0d rf2c3fed  
    574574 * @param backend_data NULL or a pointer to custom backend data.
    575575 * @param base         Starting virtual address of the area.
    576  *                     If set to -1, a suitable mappable area is found.
    577  * @param bound        Lowest address bound if base is set to -1.
     576 *                     If set to AS_AREA_ANY, a suitable mappable area is
     577 *                     found.
     578 * @param bound        Lowest address bound if base is set to AS_AREA_ANY.
    578579 *                     Otherwise ignored.
    579580 *
     
    585586    mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound)
    586587{
    587         if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE))
     588        if ((*base != (uintptr_t) AS_AREA_ANY) && !IS_ALIGNED(*base, PAGE_SIZE))
    588589                return NULL;
    589590       
     
    601602        mutex_lock(&as->lock);
    602603       
    603         if (*base == (uintptr_t) -1) {
     604        if (*base == (uintptr_t) AS_AREA_ANY) {
    604605                *base = as_get_unmapped_area(as, bound, size, guarded);
    605606                if (*base == (uintptr_t) -1) {
     
    21882189            AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound);
    21892190        if (area == NULL)
    2190                 return (sysarg_t) -1;
     2191                return (sysarg_t) AS_MAP_FAILED;
    21912192       
    21922193        return (sysarg_t) virt;
  • uspace/lib/c/include/as.h

    r6aeca0d rf2c3fed  
    4141#include <libarch/config.h>
    4242
    43 #define AS_AREA_ANY    ((void *) -1)
    44 #define AS_MAP_FAILED  ((void *) -1)
    45 
    46 #define AS_AREA_UNPAGED -1
    47 
    4843static inline size_t SIZE2PAGES(size_t size)
    4944{
Note: See TracChangeset for help on using the changeset viewer.