[build] Construct driver lists for each bus type

Include the underlying bus type (e.g. "pci" or "isa") within the lists
constructed to describe the available drivers, to allow for the
possibility that platforms may want to define a platform-specific
subset of drivers to be present in the all-drivers build.  For
example, non-x86 platforms such as RISC-V SBI do not need to include
the ISA network drivers since the corresponding hardware cannot ever
be present on a RISC-V system.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-02-11 15:38:58 +00:00
parent 1523512198
commit e783adcfd4
3 changed files with 14 additions and 9 deletions
+6 -5
View File
@@ -131,8 +131,9 @@ sub process_pci_rom {
(my $image, $decl) = extract_quoted_string($decl, 'IMAGE');
(my $desc, $decl) = extract_quoted_string($decl, 'DESCRIPTION');
if ( $vendor and $device and $image and $desc ) {
print_make_rules( $state, "${vendor}${device}", $desc, $vendor, $device );
print_make_rules( $state, $image, $desc, $vendor, $device, 1 );
print_make_rules( $state, "pci", "${vendor}${device}", $desc,
$vendor, $device );
print_make_rules( $state, "pci", $image, $desc, $vendor, $device, 1 );
}
else {
log_debug("WARNING", "Malformed PCI_ROM macro on line $. of $state->{source_file}");
@@ -149,7 +150,7 @@ sub process_isa_rom {
(my $image, $decl) = extract_quoted_string($decl, 'IMAGE');
(my $desc, $decl) = extract_quoted_string($decl, 'DESCRIPTION');
if ( $image and $desc ) {
print_make_rules( $state, $image, $desc );
print_make_rules( $state, "isa", $image, $desc );
}
else {
log_debug("WARNING", "Malformed ISA_ROM macro on line $. of $state->{source_file}");
@@ -159,11 +160,11 @@ sub process_isa_rom {
# Output Makefile rules for the specified ROM declarations
sub print_make_rules {
my ( $state, $image, $desc, $vendor, $device, $dup ) = @_;
my ( $state, $bus, $image, $desc, $vendor, $device, $dup ) = @_;
unless ( $state->{'is_header_printed'} ) {
print "# NIC\t\n";
print "# NIC\tfamily\t$state->{family}\n";
print "DRIVERS_$state->{driver_class} += $state->{driver_name}\n";
print "DRIVERS_${bus}_$state->{driver_class} += $state->{driver_name}\n";
print "DRIVERS += $state->{driver_name}\n";
print "\n";
$state->{'is_header_printed'} = 1;