Rev 3763 | Rev 3776 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3763 | Rev 3765 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | #include <panic.h> |
38 | #include <panic.h> |
39 | #include <arch/bootinfo.h> |
39 | #include <arch/bootinfo.h> |
40 | #include <align.h> |
40 | #include <align.h> |
41 | #include <macros.h> |
41 | #include <macros.h> |
42 | 42 | ||
43 | #define KERNEL_RESERVED_AREA_BASE (0x4400000) |
43 | #define KERNEL_RESERVED_AREA_BASE (0x4400000) |
44 | #define KERNEL_RESERVED_AREA_SIZE (16*1024*1024) |
44 | #define KERNEL_RESERVED_AREA_SIZE (16 * 1024 * 1024) |
45 | 45 | ||
- | 46 | #define ROM_BASE 0xa0000 /* for simulators */ |
|
46 | #define ONE_TO_ONE_MAPPING_SIZE (256*1048576) // Mapped at start |
47 | #define ROM_SIZE (384 * 1024) /* for simulators */ |
47 | 48 | ||
48 | #define ROM_BASE 0xa0000 //For ski |
- | |
49 | #define ROM_SIZE (384 * 1024) //For ski |
49 | #define MIN_ZONE_SIZE (64 * 1024) |
50 | void poke_char(int x,int y,char ch, char c); |
- | |
51 | 50 | ||
52 | #define MIN_ZONE_SIZE (64*1024) |
51 | #define MINCONF 1 |
53 | 52 | ||
54 | uintptr_t last_frame; |
53 | uintptr_t last_frame; |
55 | #define MINCONF 1 |
- | |
56 | 54 | ||
57 | void frame_arch_init(void) |
55 | void frame_arch_init(void) |
58 | { |
56 | { |
59 | - | ||
60 | if(config.cpu_active==1){ |
57 | if (config.cpu_active == 1) { |
61 | - | ||
62 | - | ||
63 | - | ||
64 | unsigned int i; |
58 | unsigned int i; |
65 | for(i=0;i<bootinfo->memmap_items;i++){ |
59 | for (i = 0; i < bootinfo->memmap_items; i++) { |
66 | if (bootinfo->memmap[i].type==EFI_MEMMAP_FREE_MEM){ |
60 | if (bootinfo->memmap[i].type == EFI_MEMMAP_FREE_MEM) { |
67 | uint64_t base=bootinfo->memmap[i].base; |
61 | uint64_t base = bootinfo->memmap[i].base; |
68 | uint64_t size=bootinfo->memmap[i].size; |
62 | uint64_t size = bootinfo->memmap[i].size; |
69 | uint64_t abase=ALIGN_UP(base,FRAME_SIZE); |
63 | uint64_t abase = ALIGN_UP(base, FRAME_SIZE); |
- | 64 | ||
70 | if(size>FRAME_SIZE) size -=abase-base; |
65 | if (size > FRAME_SIZE) |
71 | 66 | size -= abase - base; |
|
72 | 67 | ||
73 | if(size>MIN_ZONE_SIZE) { |
68 | if (size > MIN_ZONE_SIZE) { |
- | 69 | zone_create(abase >> FRAME_WIDTH, |
|
- | 70 | size >> FRAME_WIDTH, |
|
74 | zone_create(abase >> FRAME_WIDTH, (size) >> FRAME_WIDTH, max(MINCONF,((abase) >> FRAME_WIDTH)), 0); |
71 | max(MINCONF, abase >> FRAME_WIDTH), |
- | 72 | 0); |
|
75 | } |
73 | } |
76 | } |
74 | } |
77 | } |
75 | } |
78 | 76 | ||
79 | /* |
77 | /* |
80 | * Blacklist ROM regions. |
78 | * Blacklist ROM regions. |
81 | */ |
79 | */ |
82 | frame_mark_unavailable(ADDR2PFN(ROM_BASE), SIZE2FRAMES(ROM_SIZE)); |
80 | frame_mark_unavailable(ADDR2PFN(ROM_BASE), |
- | 81 | SIZE2FRAMES(ROM_SIZE)); |
|
83 | 82 | ||
84 | frame_mark_unavailable(ADDR2PFN(KERNEL_RESERVED_AREA_BASE), SIZE2FRAMES(KERNEL_RESERVED_AREA_SIZE)); |
83 | frame_mark_unavailable(ADDR2PFN(KERNEL_RESERVED_AREA_BASE), |
- | 84 | SIZE2FRAMES(KERNEL_RESERVED_AREA_SIZE)); |
|
85 | } |
85 | } |
86 | } |
86 | } |
87 | 87 | ||
88 | /** @} |
88 | /** @} |
89 | */ |
89 | */ |