Subversion Repositories HelenOS

Rev

Rev 727 | Rev 755 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 727 Rev 754
Line 63... Line 63...
63
    SPINLOCK_DECLARE(lock);
63
    SPINLOCK_DECLARE(lock);
64
    link_t link;
64
    link_t link;
65
    as_area_type_t type;
65
    as_area_type_t type;
66
    size_t size;        /**< Size of this area in multiples of PAGE_SIZE. */
66
    size_t size;        /**< Size of this area in multiples of PAGE_SIZE. */
67
    __address base;     /**< Base address of this area. */
67
    __address base;     /**< Base address of this area. */
68
    index_t *mapping;   /**< Map of physical frame numbers mapped to virtual page numbers in this area. */
-
 
69
};
68
};
70
 
69
 
71
/** Address space structure.
70
/** Address space structure.
72
 *
71
 *
73
 * as_t contains the list of as_areas of userspace accessible
72
 * as_t contains the list of as_areas of userspace accessible
74
 * pages for one or more tasks. Ranges of kernel memory pages are not
73
 * pages for one or more tasks. Ranges of kernel memory pages are not
75
 * supposed to figure in the list as they are shared by all tasks and
74
 * supposed to figure in the list as they are shared by all tasks and
76
 * set up during system initialization.
75
 * set up during system initialization.
77
 */
76
 */
78
struct as {
77
struct as {
79
    /** Protected by asidlock. Must be acquired before as-> lock. */
78
    /** Protected by asidlock. Must be acquired before as->lock. */
80
    link_t as_with_asid_link;
79
    link_t as_with_asid_link;
81
 
80
 
82
    SPINLOCK_DECLARE(lock);
81
    SPINLOCK_DECLARE(lock);
83
    link_t as_area_head;
82
    link_t as_area_head;
84
    pte_t *ptl0;
83
    pte_t *ptl0;
85
    asid_t asid;            /**< Address space identifier. */
84
    asid_t asid;            /**< Address space identifier. */
86
};
85
};
87
 
86
 
88
extern as_t * as_create(pte_t *ptl0, int flags);
87
extern as_t * as_create(pte_t *ptl0, int flags);
89
extern as_area_t *as_area_create(as_t *as, as_area_type_t type, size_t size, __address base);
88
extern as_area_t *as_area_create(as_t *as, as_area_type_t type, size_t size, __address base);
90
extern void as_area_set_mapping(as_area_t *a, index_t vpn, index_t pfn);
89
extern void as_set_mapping(as_t *as, __address page, __address frame);
91
extern int as_page_fault(__address page);
90
extern int as_page_fault(__address page);
92
extern void as_install(as_t *m);
91
extern void as_install(as_t *m);
93
 
92
 
94
/* Interface to be implemented by architectures. */
93
/* Interface to be implemented by architectures. */
95
#ifndef as_install_arch
94
#ifndef as_install_arch