Subversion Repositories HelenOS-historic

Rev

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

Rev 1428 Rev 1468
Line 73... Line 73...
73
    /** Protected by asidlock. */
73
    /** Protected by asidlock. */
74
    link_t inactive_as_with_asid_link;
74
    link_t inactive_as_with_asid_link;
75
 
75
 
76
    mutex_t lock;
76
    mutex_t lock;
77
 
77
 
-
 
78
    /** Number of references (i.e tasks that reference this as). */
-
 
79
    count_t refcount;
-
 
80
 
78
    /** Number of processors on wich is this address space active. */
81
    /** Number of processors on wich is this address space active. */
79
    count_t cpu_refcount;
82
    count_t cpu_refcount;
80
 
83
 
81
    /** B+tree of address space areas. */
84
    /** B+tree of address space areas. */
82
    btree_t as_area_btree;
85
    btree_t as_area_btree;
Line 88... Line 91...
88
    asid_t asid;
91
    asid_t asid;
89
};
92
};
90
 
93
 
91
struct as_operations {
94
struct as_operations {
92
    pte_t *(* page_table_create)(int flags);
95
    pte_t *(* page_table_create)(int flags);
-
 
96
    void (* page_table_destroy)(pte_t *page_table);
93
    void (* page_table_lock)(as_t *as, bool lock);
97
    void (* page_table_lock)(as_t *as, bool lock);
94
    void (* page_table_unlock)(as_t *as, bool unlock);
98
    void (* page_table_unlock)(as_t *as, bool unlock);
95
};
99
};
96
typedef struct as_operations as_operations_t;
100
typedef struct as_operations as_operations_t;
97
 
101
 
Line 156... Line 160...
156
 
160
 
157
extern spinlock_t inactive_as_with_asid_lock;
161
extern spinlock_t inactive_as_with_asid_lock;
158
extern link_t inactive_as_with_asid_head;
162
extern link_t inactive_as_with_asid_head;
159
 
163
 
160
extern void as_init(void);
164
extern void as_init(void);
-
 
165
 
161
extern as_t *as_create(int flags);
166
extern as_t *as_create(int flags);
-
 
167
extern void as_destroy(as_t *as);
-
 
168
extern void as_switch(as_t *old, as_t *new);
-
 
169
extern int as_page_fault(__address page, pf_access_t access, istate_t *istate);
-
 
170
 
162
extern as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base, int attrs,
171
extern as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base, int attrs,
163
    mem_backend_t *backend, mem_backend_data_t *backend_data);
172
    mem_backend_t *backend, mem_backend_data_t *backend_data);
-
 
173
extern int as_area_destroy(as_t *as, __address address);   
164
extern int as_area_resize(as_t *as, __address address, size_t size, int flags);
174
extern int as_area_resize(as_t *as, __address address, size_t size, int flags);
165
extern int as_area_destroy(as_t *as, __address address);
-
 
166
extern int as_area_get_flags(as_area_t *area);
-
 
167
extern bool as_area_check_access(as_area_t *area, pf_access_t access);
-
 
168
extern int as_page_fault(__address page, pf_access_t access, istate_t *istate);
-
 
169
extern void as_switch(as_t *old, as_t *new);
-
 
170
extern void as_free(as_t *as);
-
 
171
int as_area_share(as_t *src_as, __address src_base, size_t acc_size,
175
int as_area_share(as_t *src_as, __address src_base, size_t acc_size,
172
          as_t *dst_as, __address dst_base, int dst_flags_mask);
176
          as_t *dst_as, __address dst_base, int dst_flags_mask);
-
 
177
 
-
 
178
extern int as_area_get_flags(as_area_t *area);
-
 
179
extern bool as_area_check_access(as_area_t *area, pf_access_t access);
173
extern size_t as_get_size(__address base);
180
extern size_t as_get_size(__address base);
174
extern int used_space_insert(as_area_t *a, __address page, count_t count);
181
extern int used_space_insert(as_area_t *a, __address page, count_t count);
175
extern int used_space_remove(as_area_t *a, __address page, count_t count);
182
extern int used_space_remove(as_area_t *a, __address page, count_t count);
176
 
183
 
177
/* Interface to be implemented by architectures. */
184
/* Interface to be implemented by architectures. */