Skip to content

Commit

Permalink
[util] Allow for CALL NEAR in the option ROM initialisation entry point
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Wyatt authored and mcb30 committed Aug 15, 2012
1 parent d0bd383 commit 37ac7a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util/Option/ROM.pm
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit 37ac7a6

Please sign in to comment.