Rev 29 | Rev 32 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 29 | Rev 30 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | #include <mm/page.h> |
44 | #include <mm/page.h> |
45 | #include <mm/frame.h> |
45 | #include <mm/frame.h> |
46 | #include <cpu.h> |
46 | #include <cpu.h> |
47 | #include <arch/i8259.h> |
47 | #include <arch/i8259.h> |
48 | #include <arch/asm.h> |
48 | #include <arch/asm.h> |
- | 49 | #include <arch/bios/bios.h> |
|
49 | #include <arch/acpi/madt.h> |
50 | #include <arch/acpi/madt.h> |
50 | 51 | ||
51 | /* |
52 | /* |
52 | * Multi-Processor Specification detection code. |
53 | * Multi-Processor Specification detection code. |
53 | */ |
54 | */ |
Line 130... | Line 131... | ||
130 | __address addr, frame; |
131 | __address addr, frame; |
131 | int cnt, n; |
132 | int cnt, n; |
132 | 133 | ||
133 | 134 | ||
134 | /* |
135 | /* |
135 | * First place to search the MP Floating Pointer Structure is the Extended |
- | |
136 | * BIOS Data Area. We have to read EBDA segment address from the BIOS Data |
- | |
137 | * Area. Unfortunatelly, this memory is in page 0, which has intentionally no |
- | |
138 | * mapping. |
- | |
139 | */ |
- | |
140 | frame = frame_alloc(FRAME_KA); |
- | |
141 | map_page_to_frame(frame,0,PAGE_CACHEABLE,0); |
- | |
142 | addr = *((__u16 *) (frame + 0x40e)) * 16; |
- | |
143 | map_page_to_frame(frame,frame,PAGE_CACHEABLE,0); |
- | |
144 | frame_free(frame); |
- | |
145 | - | ||
146 | /* |
- | |
147 | * EBDA can be undefined. In that case addr would be 0. |
136 | * EBDA can be undefined. In that case addr would be 0. |
148 | */ |
137 | */ |
- | 138 | addr = ebda; |
|
149 | if (addr >= 0x1000) { |
139 | if (addr) { |
150 | cnt = 1024; |
140 | cnt = 1024; |
151 | while (addr = __u32_search(addr,cnt,FS_SIGNATURE)) { |
141 | while (addr = __u32_search(addr,cnt,FS_SIGNATURE)) { |
152 | if (mp_fs_check((__u8 *) addr)) |
142 | if (mp_fs_check((__u8 *) addr)) |
153 | goto fs_found; |
143 | goto fs_found; |
154 | addr++; |
144 | addr++; |
155 | cnt--; |
145 | cnt--; |
156 | } |
146 | } |
157 | } |
147 | } |
158 | 148 | else { |
|
159 | /* |
149 | /* |
160 | * Second place where the MP Floating Pointer Structure may live is the last |
150 | * Second place where the MP Floating Pointer Structure may live is the last |
161 | * kilobyte of base memory. |
151 | * kilobyte of base memory. |
162 | */ |
152 | */ |
163 | addr = 639*1024; |
153 | addr = 639*1024; |
164 | cnt = 1024; |
154 | cnt = 1024; |
165 | while (addr = __u32_search(addr,cnt,FS_SIGNATURE)) { |
155 | while (addr = __u32_search(addr,cnt,FS_SIGNATURE)) { |
166 | if (mp_fs_check((__u8 *) addr)) |
156 | if (mp_fs_check((__u8 *) addr)) |
167 | goto fs_found; |
157 | goto fs_found; |
168 | addr++; |
158 | addr++; |
169 | cnt--; |
159 | cnt--; |
- | 160 | } |
|
170 | } |
161 | } |
171 | 162 | ||
172 | /* |
163 | /* |
173 | * As the last resort, MP Floating Pointer Structure is searched in the BIOS |
164 | * As the last resort, MP Floating Pointer Structure is searched in the BIOS |
174 | * ROM. |
165 | * ROM. |