Rev 972 | Rev 1151 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 972 | Rev 1132 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
- | 29 | #include <arch/boot/boot.h> |
|
29 | #include <arch/mm/frame.h> |
30 | #include <arch/mm/frame.h> |
30 | #include <arch/boot/memmap.h> |
- | |
31 | #include <arch/mm/memory_init.h> |
31 | #include <arch/mm/memory_init.h> |
32 | #include <mm/frame.h> |
32 | #include <mm/frame.h> |
33 | #include <align.h> |
33 | #include <align.h> |
34 | #include <macros.h> |
34 | #include <macros.h> |
35 | 35 | ||
Line 40... | Line 40... | ||
40 | pfn_t minconf = 2; |
40 | pfn_t minconf = 2; |
41 | count_t i; |
41 | count_t i; |
42 | pfn_t start, conf; |
42 | pfn_t start, conf; |
43 | size_t size; |
43 | size_t size; |
44 | 44 | ||
45 | for (i = 0; i < memmap.count; i++) { |
45 | for (i = 0; i < bootinfo.memmap.count; i++) { |
46 | start = ADDR2PFN(ALIGN_UP(memmap.zones[i].start, FRAME_SIZE)); |
46 | start = ADDR2PFN(ALIGN_UP(bootinfo.memmap.zones[i].start, FRAME_SIZE)); |
47 | size = SIZE2FRAMES(ALIGN_DOWN(memmap.zones[i].size, FRAME_SIZE)); |
47 | size = SIZE2FRAMES(ALIGN_DOWN(bootinfo.memmap.zones[i].size, FRAME_SIZE)); |
48 | 48 | ||
49 | if ((minconf < start) || (minconf >= start + size)) |
49 | if ((minconf < start) || (minconf >= start + size)) |
50 | conf = start; |
50 | conf = start; |
51 | else |
51 | else |
52 | conf = minconf; |
52 | conf = minconf; |
53 | 53 | ||
54 | zone_create(start, size, conf, 0); |
54 | zone_create(start, size, conf, 0); |
55 | if (last_frame < ALIGN_UP(memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE)) |
55 | if (last_frame < ALIGN_UP(bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE)) |
56 | last_frame = ALIGN_UP(memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE); |
56 | last_frame = ALIGN_UP(bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE); |
57 | } |
57 | } |
58 | 58 | ||
59 | /* First is exception vector, second is 'implementation specific' */ |
59 | /* First is exception vector, second is 'implementation specific' */ |
60 | frame_mark_unavailable(0, 2); |
60 | frame_mark_unavailable(0, 2); |
61 | 61 |