Changeset 6aeca0d in mainline


Ignore:
Timestamp:
2016-08-28T11:27:42Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f2c3fed
Parents:
1e5d01b
Message:

Make as_area_create() accept phone to external pager

Files:
14 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/as.h

    r1e5d01b r6aeca0d  
    298298
    299299/* Address space area related syscalls. */
    300 extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t);
     300extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t,
     301    int);
    301302extern sysarg_t sys_as_area_resize(uintptr_t, size_t, unsigned int);
    302303extern sysarg_t sys_as_area_change_flags(uintptr_t, unsigned int);
  • kernel/generic/src/mm/as.c

    r1e5d01b r6aeca0d  
    21822182
    21832183sysarg_t sys_as_area_create(uintptr_t base, size_t size, unsigned int flags,
    2184     uintptr_t bound)
     2184    uintptr_t bound, int pager)
    21852185{
    21862186        uintptr_t virt = base;
  • uspace/app/tester/mm/common.c

    r1e5d01b r6aeca0d  
    341341       
    342342        area->addr = as_area_create(AS_AREA_ANY, size,
    343             AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE);
     343            AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE,
     344            AS_AREA_UNPAGED);
    344345        if (area->addr == AS_MAP_FAILED) {
    345346                free(area);
  • uspace/app/tester/mm/mapping1.c

    r1e5d01b r6aeca0d  
    4343       
    4444        void *result = as_area_create(AS_AREA_ANY, size,
    45             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
     45            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED);
    4646        if (result == AS_MAP_FAILED)
    4747                return NULL;
  • uspace/lib/c/generic/as.c

    r1e5d01b r6aeca0d  
    5050 * @param size  Size of the area.
    5151 * @param flags Flags describing type of the area.
     52 * @param pager If non-negative, phone to the external pager backing the area.
     53 *              If AS_AREA_UNPAGED (-1), the area is anonymous.
    5254 *
    5355 * @return Starting virtual address of the created area on success.
     
    5557 *
    5658 */
    57 void *as_area_create(void *base, size_t size, unsigned int flags)
     59void *as_area_create(void *base, size_t size, unsigned int flags, int pager)
    5860{
    59         return (void *) __SYSCALL4(SYS_AS_AREA_CREATE, (sysarg_t) base,
    60             (sysarg_t) size, (sysarg_t) flags, (sysarg_t) __entry);
     61        return (void *) __SYSCALL5(SYS_AS_AREA_CREATE, (sysarg_t) base,
     62            (sysarg_t) size, (sysarg_t) flags, (sysarg_t) __entry,
     63            (sysarg_t) pager);
    6164}
    6265
  • uspace/lib/c/generic/elf/elf_mod.c

    r1e5d01b r6aeca0d  
    370370         */
    371371        a = as_area_create((uint8_t *) base + bias, mem_sz,
    372             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
     372            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE,
     373            AS_AREA_UNPAGED);
    373374        if (a == AS_MAP_FAILED) {
    374375                DPRINTF("memory mapping failed (%p, %zu)\n",
  • uspace/lib/c/generic/fibril.c

    r1e5d01b r6aeca0d  
    279279        size_t stack_size = (stksz == FIBRIL_DFLT_STK_SIZE) ?
    280280            stack_size_get() : stksz;
    281         fibril->stack = as_area_create((void *) -1, stack_size,
     281        fibril->stack = as_area_create(AS_AREA_ANY, stack_size,
    282282            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD |
    283             AS_AREA_LATE_RESERVE);
     283            AS_AREA_LATE_RESERVE, AS_AREA_UNPAGED);
    284284        if (fibril->stack == (void *) -1) {
    285285                fibril_teardown(fibril, false);
  • uspace/lib/c/generic/io/chargrid.c

    r1e5d01b r6aeca0d  
    6060        if ((flags & CHARGRID_FLAG_SHARED) == CHARGRID_FLAG_SHARED) {
    6161                scrbuf = (chargrid_t *) as_area_create(AS_AREA_ANY, size,
    62                     AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
     62                    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE,
     63                    AS_AREA_UNPAGED);
    6364                if (scrbuf == AS_MAP_FAILED)
    6465                        return NULL;
  • uspace/lib/c/generic/malloc.c

    r1e5d01b r6aeca0d  
    354354        size_t asize = ALIGN_UP(size, PAGE_SIZE);
    355355        void *astart = as_area_create(AS_AREA_ANY, asize,
    356             AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE);
     356            AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE, AS_AREA_UNPAGED);
    357357        if (astart == AS_MAP_FAILED)
    358358                return false;
  • uspace/lib/c/generic/thread.c

    r1e5d01b r6aeca0d  
    116116        void *stack = as_area_create(AS_AREA_ANY, stack_size,
    117117            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD |
    118             AS_AREA_LATE_RESERVE);
     118            AS_AREA_LATE_RESERVE, AS_AREA_UNPAGED);
    119119        if (stack == AS_MAP_FAILED) {
    120120                free(uarg);
  • uspace/lib/c/include/as.h

    r1e5d01b r6aeca0d  
    4444#define AS_MAP_FAILED  ((void *) -1)
    4545
     46#define AS_AREA_UNPAGED -1
     47
    4648static inline size_t SIZE2PAGES(size_t size)
    4749{
     
    5759}
    5860
    59 extern void *as_area_create(void *, size_t, unsigned int);
     61extern void *as_area_create(void *, size_t, unsigned int, int);
    6062extern int as_area_resize(void *, size_t, unsigned int);
    6163extern int as_area_change_flags(void *, unsigned int);
  • uspace/lib/draw/surface.c

    r1e5d01b r6aeca0d  
    6464        if (!pixbuf) {
    6565                if ((flags & SURFACE_FLAG_SHARED) == SURFACE_FLAG_SHARED) {
    66                         pixbuf = (pixel_t *) as_area_create(AS_AREA_ANY, pixbuf_size,
    67                             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
     66                        pixbuf = (pixel_t *) as_area_create(AS_AREA_ANY,
     67                            pixbuf_size,
     68                            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE,
     69                            AS_AREA_UNPAGED);
    6870                        if (pixbuf == AS_MAP_FAILED) {
    6971                                free(surface);
  • uspace/lib/posix/source/sys/mman.c

    r1e5d01b r6aeca0d  
    5454                return MAP_FAILED;
    5555       
    56         return as_area_create(start, length, prot);
     56        return as_area_create(start, length, prot, AS_AREA_UNPAGED);
    5757}
    5858
  • uspace/srv/vfs/vfs.c

    r1e5d01b r6aeca0d  
    165165         */
    166166        plb = as_area_create(AS_AREA_ANY, PLB_SIZE,
    167             AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
     167            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED);
    168168        if (plb == AS_MAP_FAILED) {
    169169                printf("%s: Cannot create address space area\n", NAME);
Note: See TracChangeset for help on using the changeset viewer.