Changeset faba839 in mainline for uspace/lib/c


Ignore:
Timestamp:
2012-06-13T13:16:19Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2902e1bb
Parents:
32d19f7
Message:

use symbolic values for address space constants

Location:
uspace/lib/c
Files:
6 edited

Legend:

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

    r32d19f7 rfaba839  
    4646 *
    4747 * @param base  Starting virtual address of the area.
    48  *              If set to (void *) -1, the kernel finds
    49  *              a mappable area.
     48 *              If set to AS_AREA_ANY ((void *) -1),
     49 *              the kernel finds a mappable area.
    5050 * @param size  Size of the area.
    5151 * @param flags Flags describing type of the area.
    5252 *
    5353 * @return Starting virtual address of the created area on success.
    54  * @return (void *) -1 otherwise.
     54 * @return AS_MAP_FAILED ((void *) -1) otherwise.
    5555 *
    5656 */
  • uspace/lib/c/generic/elf/elf_load.c

    r32d19f7 rfaba839  
    366366        a = as_area_create((uint8_t *) base + bias, mem_sz,
    367367            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    368         if (a == (void *) -1) {
     368        if (a == AS_MAP_FAILED) {
    369369                DPRINTF("memory mapping failed (0x%x, %d)\n",
    370370                    base + bias, mem_sz);
  • uspace/lib/c/generic/malloc.c

    r32d19f7 rfaba839  
    285285        /* Align the heap area size on page boundary */
    286286        size_t asize = ALIGN_UP(size, PAGE_SIZE);
    287         void *astart = as_area_create((void *) -1, asize,
     287        void *astart = as_area_create(AS_AREA_ANY, asize,
    288288            AS_AREA_WRITE | AS_AREA_READ);
    289         if (astart == (void *) -1)
     289        if (astart == AS_MAP_FAILED)
    290290                return false;
    291291       
  • uspace/lib/c/generic/mman.c

    r32d19f7 rfaba839  
    4242{
    4343        if (!start)
    44                 start = (void *) -1;
     44                start = AS_AREA_ANY;
    4545       
    4646//      if (!((flags & MAP_SHARED) ^ (flags & MAP_PRIVATE)))
  • uspace/lib/c/include/as.h

    r32d19f7 rfaba839  
    4141#include <libarch/config.h>
    4242
     43#define AS_AREA_ANY    ((void *) -1)
     44#define AS_MAP_FAILED  ((void *) -1)
     45
    4346static inline size_t SIZE2PAGES(size_t size)
    4447{
  • uspace/lib/c/include/sys/mman.h

    r32d19f7 rfaba839  
    3939#include <sys/types.h>
    4040
    41 #define MAP_FAILED  ((void *) -1)
     41#define MAP_FAILED  AS_MAP_FAILED
    4242
    4343#define MAP_SHARED     (1 << 0)
Note: See TracChangeset for help on using the changeset viewer.