Rev 1238 | Rev 1288 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1238 | Rev 1239 | ||
---|---|---|---|
Line 57... | Line 57... | ||
57 | #define AS_AREA_READ 1 |
57 | #define AS_AREA_READ 1 |
58 | #define AS_AREA_WRITE 2 |
58 | #define AS_AREA_WRITE 2 |
59 | #define AS_AREA_EXEC 4 |
59 | #define AS_AREA_EXEC 4 |
60 | #define AS_AREA_DEVICE 8 |
60 | #define AS_AREA_DEVICE 8 |
61 | 61 | ||
- | 62 | /** Address space area attributes. */ |
|
- | 63 | #define AS_AREA_ATTR_NONE 0 |
|
- | 64 | #define AS_AREA_ATTR_PARTIAL 1 /* Not fully initialized area. */ |
|
- | 65 | ||
62 | /** Address space area structure. |
66 | /** Address space area structure. |
63 | * |
67 | * |
64 | * Each as_area_t structure describes one contiguous area of virtual memory. |
68 | * Each as_area_t structure describes one contiguous area of virtual memory. |
65 | * In the future, it should not be difficult to support shared areas. |
69 | * In the future, it should not be difficult to support shared areas. |
66 | */ |
70 | */ |
67 | struct as_area { |
71 | struct as_area { |
68 | SPINLOCK_DECLARE(lock); |
72 | SPINLOCK_DECLARE(lock); |
69 | int flags; |
73 | int flags; /**< Flags related to the memory represented by the address space area. */ |
- | 74 | int attributes; /**< Attributes related to the address space area itself. */ |
|
70 | count_t pages; /**< Size of this area in multiples of PAGE_SIZE. */ |
75 | count_t pages; /**< Size of this area in multiples of PAGE_SIZE. */ |
71 | __address base; /**< Base address of this area. */ |
76 | __address base; /**< Base address of this area. */ |
72 | }; |
77 | }; |
73 | 78 | ||
74 | /** Address space structure. |
79 | /** Address space structure. |
Line 110... | Line 115... | ||
110 | extern spinlock_t as_lock; |
115 | extern spinlock_t as_lock; |
111 | extern link_t inactive_as_with_asid_head; |
116 | extern link_t inactive_as_with_asid_head; |
112 | 117 | ||
113 | extern void as_init(void); |
118 | extern void as_init(void); |
114 | extern as_t *as_create(int flags); |
119 | extern as_t *as_create(int flags); |
115 | extern as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base); |
120 | extern as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base, int attrs); |
116 | extern __address as_area_resize(as_t *as, __address address, size_t size, int flags); |
121 | extern __address as_area_resize(as_t *as, __address address, size_t size, int flags); |
117 | int as_area_send(task_id_t id, __address base); |
122 | int as_area_send(task_id_t dst_id, __address base); |
118 | extern void as_set_mapping(as_t *as, __address page, __address frame); |
123 | extern void as_set_mapping(as_t *as, __address page, __address frame); |
119 | extern int as_page_fault(__address page); |
124 | extern int as_page_fault(__address page); |
120 | extern void as_switch(as_t *old, as_t *new); |
125 | extern void as_switch(as_t *old, as_t *new); |
121 | extern void as_free(as_t *as); |
126 | extern void as_free(as_t *as); |
122 | 127 |