]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[util] Allow for CALL NEAR in the option ROM initialisation entry point
authorDaniel Wyatt <daniel.wyatt@gmail.com>
Wed, 15 Aug 2012 11:50:01 +0000 (12:50 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 15 Aug 2012 11:51:47 +0000 (12:51 +0100)
Option::ROM currently understands only JMP NEAR and JMP SHORT
instructions in the initialisation entry point.  At least one Broadcom
option ROM has been observed to use a CALL NEAR instruction.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/util/Option/ROM.pm

index 82d654261cef891aa120c9532081525f82bad245..bf704cad69ad0264470bc8251e5cd0fb388f24c2 100644 (file)
@@ -180,6 +180,7 @@ our %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
 
 use constant JMP_SHORT => 0xeb;
 use constant JMP_NEAR => 0xe9;
+use constant CALL_NEAR => 0xe8;
 
 sub pack_init {
   my $dest = shift;
@@ -203,6 +204,9 @@ sub unpack_init {
   } elsif ( $jump == JMP_NEAR ) {
     my $offset = unpack ( "xS", $instr );
     return ( $offset + 6 );
+  } elsif ( $jump == CALL_NEAR ) {
+    my $offset = unpack ( "xS", $instr );
+    return ( $offset + 6 );
   } elsif ( $jump == 0 ) {
     return 0;
   } else {