Changeset 68f11ddc in mainline for kernel/generic/include/mm/as.h


Ignore:
Timestamp:
2018-12-03T16:54:22Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Parents:
a0765f6
git-author:
Jiri Svoboda <jiri@…> (2018-12-03 16:53:27)
git-committer:
Jiri Svoboda <jiri@…> (2018-12-03 16:54:22)
Message:

Use ordered dictionary for pagemap instead of B+tree

At the same time we add a little bit more abstraction around the pagemap.

File:
1 edited

Legend:

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

    ra0765f6 r68f11ddc  
    137137} as_operations_t;
    138138
     139/** Single anonymous page mapping. */
     140typedef struct {
     141        /** Containing pagemap structure */
     142        struct as_pagemap *pagemap;
     143        /** Link to @c shinfo->pagemap ordered dictionary */
     144        odlink_t lpagemap;
     145        /** Virtual address */
     146        uintptr_t vaddr;
     147        /** Physical frame address */
     148        uintptr_t frame;
     149} as_page_mapping_t;
     150
     151/** Map of anonymous pages in a shared area. */
     152typedef struct as_pagemap {
     153        /**
     154         * Dictionary ordered by virtual address. Members are of type
     155         * as_page_mapping_t
     156         */
     157        odict_t map;
     158} as_pagemap_t;
     159
    139160/**
    140161 * This structure contains information associated with the shared address space
     
    150171        bool shared;
    151172
    152         /**
    153          * B+tree containing complete map of anonymous pages of the shared area.
    154          */
    155         btree_t pagemap;
     173        /** Complete map of anonymous pages of the shared area. */
     174        as_pagemap_t pagemap;
    156175
    157176        /** Address space area backend. */
     
    283302extern as_area_t *as_area_next(as_area_t *);
    284303
     304extern void as_pagemap_initialize(as_pagemap_t *);
     305extern void as_pagemap_finalize(as_pagemap_t *);
     306extern as_page_mapping_t *as_pagemap_first(as_pagemap_t *);
     307extern as_page_mapping_t *as_pagemap_next(as_page_mapping_t *);
     308extern errno_t as_pagemap_find(as_pagemap_t *, uintptr_t, uintptr_t *);
     309extern void as_pagemap_insert(as_pagemap_t *, uintptr_t, uintptr_t);
     310extern void as_pagemap_remove(as_page_mapping_t *);
     311
    285312extern unsigned int as_area_get_flags(as_area_t *);
    286313extern bool as_area_check_access(as_area_t *, pf_access_t);
Note: See TracChangeset for help on using the changeset viewer.