Changeset 75b139f in mainline


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

Add skeleton of the user backend

Location:
kernel
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    rf2c3fed r75b139f  
    237237        generic/src/mm/backend_elf.c \
    238238        generic/src/mm/backend_phys.c \
     239        generic/src/mm/backend_user.c \
    239240        generic/src/mm/slab.c \
    240241        generic/src/lib/func.c \
  • kernel/generic/include/mm/as.h

    rf2c3fed r75b139f  
    169169/** Backend data stored in address space area. */
    170170typedef union mem_backend_data {
     171        /* anon_backend members */
     172        struct {
     173        };
     174
    171175        /** elf_backend members */
    172176        struct {
     
    181185                bool anonymous;
    182186        };
     187
     188        /** user_backend members */
     189        struct {
     190                int pager;      /**< Phone to the pager. */
     191        };
     192
    183193} mem_backend_data_t;
    184194
     
    296306extern mem_backend_t elf_backend;
    297307extern mem_backend_t phys_backend;
     308extern mem_backend_t user_backend;
    298309
    299310/* Address space area related syscalls. */
  • kernel/generic/src/mm/as.c

    rf2c3fed r75b139f  
    21862186{
    21872187        uintptr_t virt = base;
     2188        mem_backend_t *backend;
     2189        mem_backend_data_t backend_data;
     2190
     2191        if (pager == AS_AREA_UNPAGED)
     2192                backend = &anon_backend;
     2193        else {
     2194                backend = &user_backend;
     2195                backend_data.pager = pager;
     2196        }
    21882197        as_area_t *area = as_area_create(AS, flags, size,
    2189             AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound);
     2198            AS_AREA_ATTR_NONE, backend, &backend_data, &virt, bound);
    21902199        if (area == NULL)
    21912200                return (sysarg_t) AS_MAP_FAILED;
Note: See TracChangeset for help on using the changeset viewer.