Rev 567 | Rev 575 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 567 | Rev 573 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | #include <arch/drivers/arc.h> |
29 | #include <arch/drivers/arc.h> |
30 | #include <arch/mm/page.h> |
30 | #include <arch/mm/page.h> |
31 | #include <print.h> |
31 | #include <print.h> |
32 | #include <arch.h> |
32 | #include <arch.h> |
33 | #include <arch/byteorder.h> |
33 | #include <arch/byteorder.h> |
- | 34 | #include <arch/mm/frame.h> |
|
- | 35 | #include <mm/frame.h> |
|
34 | 36 | ||
35 | /* This is a good joke, SGI HAS different types than NT bioses... */ |
37 | /* This is a good joke, SGI HAS different types than NT bioses... */ |
36 | /* Here is the SGI type */ |
38 | /* Here is the SGI type */ |
37 | static char *basetypes[] = { |
39 | static char *basetypes[] = { |
38 | "ExceptionBlock", |
40 | "ExceptionBlock", |
Line 99... | Line 101... | ||
99 | 101 | ||
100 | /** Initialize ARC structure |
102 | /** Initialize ARC structure |
101 | * |
103 | * |
102 | * @return 0 - ARC OK, -1 - ARC does not exist |
104 | * @return 0 - ARC OK, -1 - ARC does not exist |
103 | */ |
105 | */ |
104 | int init_arc(void) |
106 | int arc_init(void) |
105 | { |
107 | { |
106 | if (sbp->signature != ARC_MAGIC) { |
108 | if (sbp->signature != ARC_MAGIC) { |
107 | sbp = NULL; |
109 | sbp = NULL; |
108 | return -1; |
110 | return -1; |
109 | } |
111 | } |
Line 163... | Line 165... | ||
163 | printf("Memory map:\n"); |
165 | printf("Memory map:\n"); |
164 | 166 | ||
165 | desc = arc_entry->getmemorydescriptor(NULL); |
167 | desc = arc_entry->getmemorydescriptor(NULL); |
166 | while (desc) { |
168 | while (desc) { |
167 | printf("%s: %d (size: %dKB)\n",basetypes[desc->type], |
169 | printf("%s: %d (size: %dKB)\n",basetypes[desc->type], |
168 | desc->basepage * 4096, |
170 | desc->basepage * ARC_FRAME, |
169 | desc->basecount*4); |
171 | desc->basecount*ARC_FRAME/1024); |
170 | desc = arc_entry->getmemorydescriptor(desc); |
172 | desc = arc_entry->getmemorydescriptor(desc); |
171 | } |
173 | } |
172 | } |
174 | } |
173 | 175 | ||
174 | /** Print charactor to console */ |
176 | /** Print charactor to console */ |
Line 200... | Line 202... | ||
200 | } |
202 | } |
201 | if (ch == '\r') |
203 | if (ch == '\r') |
202 | return '\n'; |
204 | return '\n'; |
203 | return ch; |
205 | return ch; |
204 | } |
206 | } |
- | 207 | ||
- | 208 | /* Initialize frame zones from ARC firmware. |
|
- | 209 | * In the future we may use even the FirmwareTemporary regions, |
|
- | 210 | * currently we use the FreeMemory (what about the LoadedProgram?) |
|
- | 211 | */ |
|
- | 212 | void arc_frame_init(void) |
|
- | 213 | { |
|
- | 214 | arc_memdescriptor_t *desc; |
|
- | 215 | int total = 0; |
|
- | 216 | ||
- | 217 | desc = arc_entry->getmemorydescriptor(NULL); |
|
- | 218 | while (desc) { |
|
- | 219 | if (desc->type == FreeMemory || |
|
- | 220 | desc->type == FreeContiguous) { |
|
- | 221 | total += desc->basecount*ARC_FRAME; |
|
- | 222 | zone_create_in_region(desc->basepage*ARC_FRAME, |
|
- | 223 | desc->basecount*ARC_FRAME); |
|
- | 224 | } |
|
- | 225 | desc = arc_entry->getmemorydescriptor(desc); |
|
- | 226 | } |
|
- | 227 | ||
- | 228 | config.memory_size = total; |
|
- | 229 | } |
|
- | 230 |