|
@@ -489,6 +489,18 @@ get_mangled_e820:
|
489
|
489
|
ret
|
490
|
490
|
.size get_mangled_e820, . - get_mangled_e820
|
491
|
491
|
|
|
492
|
+/****************************************************************************
|
|
493
|
+ * Set/clear CF on the stack as appropriate, assumes stack is as it should
|
|
494
|
+ * be immediately before IRET
|
|
495
|
+ ****************************************************************************
|
|
496
|
+ */
|
|
497
|
+patch_cf:
|
|
498
|
+ pushw %bp
|
|
499
|
+ movw %sp, %bp
|
|
500
|
+ setc 8(%bp) /* Set/reset CF; clears PF, AF, ZF, SF */
|
|
501
|
+ popw %bp
|
|
502
|
+ ret
|
|
503
|
+
|
492
|
504
|
/****************************************************************************
|
493
|
505
|
* INT 15,e820 handler
|
494
|
506
|
****************************************************************************
|
|
@@ -500,7 +512,8 @@ int15_e820:
|
500
|
512
|
popw %ds
|
501
|
513
|
call get_mangled_e820
|
502
|
514
|
popw %ds
|
503
|
|
- lret $2
|
|
515
|
+ call patch_cf
|
|
516
|
+ iret
|
504
|
517
|
.size int15_e820, . - int15_e820
|
505
|
518
|
|
506
|
519
|
/****************************************************************************
|
|
@@ -512,7 +525,7 @@ int15_e801:
|
512
|
525
|
/* Call previous handler */
|
513
|
526
|
pushfw
|
514
|
527
|
lcall *%cs:int15_vector
|
515
|
|
- pushfw
|
|
528
|
+ call patch_cf
|
516
|
529
|
/* Edit result */
|
517
|
530
|
pushw %ds
|
518
|
531
|
pushw %cs:rm_ds
|
|
@@ -524,9 +537,7 @@ int15_e801:
|
524
|
537
|
xchgw %ax, %cx
|
525
|
538
|
xchgw %bx, %dx
|
526
|
539
|
popw %ds
|
527
|
|
- /* Restore flags returned by previous handler and return */
|
528
|
|
- popfw
|
529
|
|
- lret $2
|
|
540
|
+ iret
|
530
|
541
|
.size int15_e801, . - int15_e801
|
531
|
542
|
|
532
|
543
|
/****************************************************************************
|
|
@@ -538,16 +549,14 @@ int15_88:
|
538
|
549
|
/* Call previous handler */
|
539
|
550
|
pushfw
|
540
|
551
|
lcall *%cs:int15_vector
|
541
|
|
- pushfw
|
|
552
|
+ call patch_cf
|
542
|
553
|
/* Edit result */
|
543
|
554
|
pushw %ds
|
544
|
555
|
pushw %cs:rm_ds
|
545
|
556
|
popw %ds
|
546
|
557
|
call patch_1m
|
547
|
558
|
popw %ds
|
548
|
|
- /* Restore flags returned by previous handler and return */
|
549
|
|
- popfw
|
550
|
|
- lret $2
|
|
559
|
+ iret
|
551
|
560
|
.size int15_88, . - int15_88
|
552
|
561
|
|
553
|
562
|
/****************************************************************************
|