|
@@ -361,26 +361,33 @@ int15_e820:
|
361
|
361
|
pushl %edx
|
362
|
362
|
call split_e820
|
363
|
363
|
pushfw
|
364
|
|
- /* Skip empty region checking if we've reached the end of the
|
365
|
|
- * map or hit an error, to avoid a potential endless loop.
|
366
|
|
- */
|
367
|
|
- jc 1f
|
368
|
|
- testl %ebx, %ebx
|
369
|
|
- jz 1f
|
370
|
|
- /* Check for an empty region */
|
|
364
|
+ /* If we've hit an error, exit immediately */
|
|
365
|
+ jc 99f
|
|
366
|
+ /* If region is non-empty, return this region */
|
371
|
367
|
pushl %eax
|
372
|
368
|
movl %es:8(%di), %eax
|
373
|
369
|
orl %es:12(%di), %eax
|
374
|
370
|
popl %eax
|
375
|
|
- jnz 1f
|
376
|
|
- /* Strip empty regions out of the returned map */
|
|
371
|
+ jnz 99f
|
|
372
|
+ /* Region is empty. If this is not the end of the map,
|
|
373
|
+ * skip over this region.
|
|
374
|
+ */
|
|
375
|
+ testl %ebx, %ebx
|
|
376
|
+ jz 1f
|
377
|
377
|
popfw
|
378
|
378
|
popl %edx
|
379
|
379
|
popl %ecx
|
380
|
380
|
popl %eax
|
381
|
381
|
jmp int15_e820
|
382
|
|
- /* Restore flags from original INT 15,e820 call and return */
|
383
|
|
-1: popfw
|
|
382
|
+1: /* Region is empty and this is the end of the map. Return
|
|
383
|
+ * with CF set to avoid placing an empty region at the end of
|
|
384
|
+ * the map.
|
|
385
|
+ */
|
|
386
|
+ popfw
|
|
387
|
+ stc
|
|
388
|
+ pushfw
|
|
389
|
+99: /* Restore flags from original INT 15,e820 call and return */
|
|
390
|
+ popfw
|
384
|
391
|
addr32 leal 12(%esp), %esp /* avoid changing flags */
|
385
|
392
|
lret $2
|
386
|
393
|
.size int15_e820, . - int15_e820
|