system.cc (9261:f795ce1feb5b) | system.cc (9290:90dd57ca9a7e) |
---|---|
1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 140 unchanged lines hidden (view full) --- 149 warn("Kernel supports device tree, but no DTB file specified\n"); 150 } 151 // Warn if the kernel doesn't support FDT and we have specified one 152 if (dtb_file_specified) { 153 assert(!kernel_has_fdt_support); 154 warn("DTB file specified, but no device tree support in kernel\n"); 155 } 156 | 1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 140 unchanged lines hidden (view full) --- 149 warn("Kernel supports device tree, but no DTB file specified\n"); 150 } 151 // Warn if the kernel doesn't support FDT and we have specified one 152 if (dtb_file_specified) { 153 assert(!kernel_has_fdt_support); 154 warn("DTB file specified, but no device tree support in kernel\n"); 155 } 156 |
157 AtagCore *ac = new AtagCore; 158 ac->flags(1); // read-only 159 ac->pagesize(8192); 160 ac->rootdev(0); | 157 AtagCore ac; 158 ac.flags(1); // read-only 159 ac.pagesize(8192); 160 ac.rootdev(0); |
161 162 AddrRangeList atagRanges = physmem.getConfAddrRanges(); 163 if (atagRanges.size() != 1) { 164 fatal("Expected a single ATAG memory entry but got %d\n", 165 atagRanges.size()); 166 } | 161 162 AddrRangeList atagRanges = physmem.getConfAddrRanges(); 163 if (atagRanges.size() != 1) { 164 fatal("Expected a single ATAG memory entry but got %d\n", 165 atagRanges.size()); 166 } |
167 AtagMem *am = new AtagMem; 168 am->memSize(atagRanges.begin()->size()); 169 am->memStart(atagRanges.begin()->start); | 167 AtagMem am; 168 am.memSize(atagRanges.begin()->size()); 169 am.memStart(atagRanges.begin()->start); |
170 | 170 |
171 AtagCmdline *ad = new AtagCmdline; 172 ad->cmdline(params()->boot_osflags); | 171 AtagCmdline ad; 172 ad.cmdline(params()->boot_osflags); |
173 | 173 |
174 DPRINTF(Loader, "boot command line %d bytes: %s\n", ad->size() <<2, params()->boot_osflags.c_str()); | 174 DPRINTF(Loader, "boot command line %d bytes: %s\n", 175 ad.size() <<2, params()->boot_osflags.c_str()); |
175 | 176 |
176 AtagNone *an = new AtagNone; | 177 AtagNone an; |
177 | 178 |
178 uint32_t size = ac->size() + am->size() + ad->size() + an->size(); | 179 uint32_t size = ac.size() + am.size() + ad.size() + an.size(); |
179 uint32_t offset = 0; 180 uint8_t *boot_data = new uint8_t[size << 2]; 181 | 180 uint32_t offset = 0; 181 uint8_t *boot_data = new uint8_t[size << 2]; 182 |
182 offset += ac->copyOut(boot_data + offset); 183 offset += am->copyOut(boot_data + offset); 184 offset += ad->copyOut(boot_data + offset); 185 offset += an->copyOut(boot_data + offset); | 183 offset += ac.copyOut(boot_data + offset); 184 offset += am.copyOut(boot_data + offset); 185 offset += ad.copyOut(boot_data + offset); 186 offset += an.copyOut(boot_data + offset); |
186 187 DPRINTF(Loader, "Boot atags was %d bytes in total\n", size << 2); 188 DDUMP(Loader, boot_data, size << 2); 189 190 physProxy.writeBlob(params()->atags_addr, boot_data, size << 2); | 187 188 DPRINTF(Loader, "Boot atags was %d bytes in total\n", size << 2); 189 DDUMP(Loader, boot_data, size << 2); 190 191 physProxy.writeBlob(params()->atags_addr, boot_data, size << 2); |
192 193 delete[] boot_data; |
|
191 } 192 193 for (int i = 0; i < threadContexts.size(); i++) { 194 threadContexts[i]->setIntReg(0, 0); 195 threadContexts[i]->setIntReg(1, params()->machine_type); 196 threadContexts[i]->setIntReg(2, params()->atags_addr); 197 } 198} --- 14 unchanged lines hidden --- | 194 } 195 196 for (int i = 0; i < threadContexts.size(); i++) { 197 threadContexts[i]->setIntReg(0, 0); 198 threadContexts[i]->setIntReg(1, params()->machine_type); 199 threadContexts[i]->setIntReg(2, params()->atags_addr); 200 } 201} --- 14 unchanged lines hidden --- |