Subversion Repositories HelenOS

Rev

Rev 3240 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3240 Rev 4490
Line 92... Line 92...
92
    link_t inactive_as_with_asid_link;
92
    link_t inactive_as_with_asid_link;
93
    /**
93
    /**
94
     * Number of processors on wich is this address space active.
94
     * Number of processors on wich is this address space active.
95
     * Protected by asidlock.
95
     * Protected by asidlock.
96
     */
96
     */
97
    count_t cpu_refcount;
97
    size_t cpu_refcount;
98
    /**
98
    /**
99
     * Address space identifier.
99
     * Address space identifier.
100
     * Constant on architectures that do not support ASIDs.
100
     * Constant on architectures that do not support ASIDs.
101
     * Protected by asidlock.
101
     * Protected by asidlock.
102
     */
102
     */
Line 130... Line 130...
130
 */
130
 */
131
typedef struct {
131
typedef struct {
132
    /** This lock must be acquired only when the as_area lock is held. */
132
    /** This lock must be acquired only when the as_area lock is held. */
133
    mutex_t lock;      
133
    mutex_t lock;      
134
    /** This structure can be deallocated if refcount drops to 0. */
134
    /** This structure can be deallocated if refcount drops to 0. */
135
    count_t refcount;
135
    size_t refcount;
136
    /**
136
    /**
137
     * B+tree containing complete map of anonymous pages of the shared area.
137
     * B+tree containing complete map of anonymous pages of the shared area.
138
     */
138
     */
139
    btree_t pagemap;
139
    btree_t pagemap;
140
} share_info_t;
140
} share_info_t;
Line 154... Line 154...
154
        elf_header_t *elf;
154
        elf_header_t *elf;
155
        elf_segment_header_t *segment;
155
        elf_segment_header_t *segment;
156
    };
156
    };
157
    struct {    /**< phys_backend members */
157
    struct {    /**< phys_backend members */
158
        uintptr_t base;
158
        uintptr_t base;
159
        count_t frames;
159
        size_t frames;
160
    };
160
    };
161
} mem_backend_data_t;
161
} mem_backend_data_t;
162
 
162
 
163
/** Address space area structure.
163
/** Address space area structure.
164
 *
164
 *
Line 173... Line 173...
173
     */
173
     */
174
    int flags;
174
    int flags;
175
    /** Attributes related to the address space area itself. */
175
    /** Attributes related to the address space area itself. */
176
    int attributes;
176
    int attributes;
177
    /** Size of this area in multiples of PAGE_SIZE. */
177
    /** Size of this area in multiples of PAGE_SIZE. */
178
    count_t pages;
178
    size_t pages;
179
    /** Base address of this area. */
179
    /** Base address of this area. */
180
    uintptr_t base;
180
    uintptr_t base;
181
    /** Map of used space. */
181
    /** Map of used space. */
182
    btree_t used_space;
182
    btree_t used_space;
183
 
183
 
Line 223... Line 223...
223
extern int as_area_change_flags(as_t *as, int flags, uintptr_t address);
223
extern int as_area_change_flags(as_t *as, int flags, uintptr_t address);
224
 
224
 
225
extern int as_area_get_flags(as_area_t *area);
225
extern int as_area_get_flags(as_area_t *area);
226
extern bool as_area_check_access(as_area_t *area, pf_access_t access);
226
extern bool as_area_check_access(as_area_t *area, pf_access_t access);
227
extern size_t as_area_get_size(uintptr_t base);
227
extern size_t as_area_get_size(uintptr_t base);
228
extern int used_space_insert(as_area_t *a, uintptr_t page, count_t count);
228
extern int used_space_insert(as_area_t *a, uintptr_t page, size_t count);
229
extern int used_space_remove(as_area_t *a, uintptr_t page, count_t count);
229
extern int used_space_remove(as_area_t *a, uintptr_t page, size_t count);
230
 
230
 
231
 
231
 
232
/* Interface to be implemented by architectures. */
232
/* Interface to be implemented by architectures. */
233
#ifndef as_constructor_arch
233
#ifndef as_constructor_arch
234
extern int as_constructor_arch(as_t *as, int flags);
234
extern int as_constructor_arch(as_t *as, int flags);