173 |
try some other addresses just like yaboot does. */ |
try some other addresses just like yaboot does. */ |
174 |
for (linux_addr = entry; linux_addr < entry + 200 * 0x100000; linux_addr += 0x100000) |
for (linux_addr = entry; linux_addr < entry + 200 * 0x100000; linux_addr += 0x100000) |
175 |
{ |
{ |
176 |
|
grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n", |
177 |
|
linux_addr, linux_size); |
178 |
found_addr = grub_claimmap (linux_addr, linux_size); |
found_addr = grub_claimmap (linux_addr, linux_size); |
179 |
if (found_addr != -1) |
if (found_addr != -1) |
180 |
break; |
break; |
263 |
{ |
{ |
264 |
grub_file_t file = 0; |
grub_file_t file = 0; |
265 |
grub_ssize_t size; |
grub_ssize_t size; |
266 |
|
grub_addr_t first_addr; |
267 |
grub_addr_t addr; |
grub_addr_t addr; |
268 |
|
int found_addr = 0; |
269 |
|
|
270 |
if (argc == 0) |
if (argc == 0) |
271 |
{ |
{ |
283 |
if (! file) |
if (! file) |
284 |
goto fail; |
goto fail; |
285 |
|
|
286 |
addr = linux_addr + linux_size; |
first_addr = linux_addr + linux_size; |
287 |
size = grub_file_size (file); |
size = grub_file_size (file); |
288 |
|
|
289 |
if (grub_claimmap (addr, size) == -1) |
/* Attempt to claim at a series of addresses until successful in |
290 |
|
the same way that grub_rescue_cmd_linux does. */ |
291 |
|
for (addr = first_addr; addr < first_addr + 200 * 0x100000; addr += 0x100000) |
292 |
|
{ |
293 |
|
grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n", |
294 |
|
addr, size); |
295 |
|
found_addr = grub_claimmap (addr, size); |
296 |
|
if (found_addr != -1) |
297 |
|
break; |
298 |
|
} |
299 |
|
|
300 |
|
if (found_addr == -1) |
301 |
{ |
{ |
302 |
grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not claim memory"); |
grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not claim memory"); |
303 |
goto fail; |
goto fail; |