|
@@ -508,6 +508,22 @@ OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
|
508
|
508
|
$(BIN)/%.flags :
|
509
|
509
|
@$(ECHO) $(OBJ_CFLAGS)
|
510
|
510
|
|
|
511
|
+# Device ID tables (using IDs extracted by parserom.pl)
|
|
512
|
+#
|
|
513
|
+define obj_pci_id_asm
|
|
514
|
+ .section ".pci_devlist.$(1)", "a", @progbits
|
|
515
|
+ .globl pci_devlist_$(1)
|
|
516
|
+pci_devlist_$(1):
|
|
517
|
+ .short ( 0x$(1) & 0xffff )
|
|
518
|
+
|
|
519
|
+endef
|
|
520
|
+define obj_isa_id_asm
|
|
521
|
+endef
|
|
522
|
+OBJ_IDS_ASM = $(foreach ROM,$(ROMS_$(OBJECT)),$(call obj_$(ROM_TYPE_$(ROM))_id_asm,$(ROM)))
|
|
523
|
+OBJ_IDS_ASM_NL = $(subst $(NEWLINE),\n,$(OBJ_IDS_ASM))
|
|
524
|
+$(BIN)/%.ids :
|
|
525
|
+ @$(ECHO_E) '$(OBJ_IDS_ASM_NL)'
|
|
526
|
+
|
511
|
527
|
# ICC requires postprocessing objects to fix up table alignments
|
512
|
528
|
#
|
513
|
529
|
ifeq ($(CCTYPE),icc)
|
|
@@ -522,6 +538,7 @@ endif
|
522
|
538
|
#
|
523
|
539
|
COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
|
524
|
540
|
RULE_c = $(Q)$(COMPILE_c) -c $< -o $@ $(POST_O)
|
|
541
|
+RULE_c_to_ids.o = $(Q)$(ECHO_E) '$(OBJ_IDS_ASM_NL)' | $(ASSEMBLE_S) -o $@
|
525
|
542
|
RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -DDBGLVL_MAX=$* -c $< -o $@ $(POST_O)
|
526
|
543
|
RULE_c_to_c = $(Q)$(COMPILE_c) -E -c $< > $@
|
527
|
544
|
RULE_c_to_s = $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
|
|
@@ -532,7 +549,7 @@ RULE_S = $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
|
532
|
549
|
RULE_S_to_dbg%.o = $(Q)$(PREPROCESS_S) -DDBGLVL_MAX=$* $< | $(ASSEMBLE_S) -o $@
|
533
|
550
|
RULE_S_to_s = $(Q)$(PREPROCESS_S) $< > $@
|
534
|
551
|
|
535
|
|
-DEBUG_TARGETS += dbg%.o c s
|
|
552
|
+GENERIC_TARGETS += ids.o dbg%.o c s
|
536
|
553
|
|
537
|
554
|
# List of embedded images included in the last build of embedded.o.
|
538
|
555
|
# This is needed in order to correctly rebuild embedded.o whenever the
|
|
@@ -784,8 +801,8 @@ define rules_template_parts
|
784
|
801
|
$$(BIN)/$(3).o : $(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(3)_DEPS)
|
785
|
802
|
$$(QM)$(ECHO) " [BUILD] $$@"
|
786
|
803
|
$$(RULE_$(2))
|
787
|
|
-BOBJS += $$(BIN)/$(3).o
|
788
|
|
-$(foreach TGT,$(DEBUG_TARGETS),$(if $(RULE_$(2)_to_$(TGT)),$(NEWLINE)$(call rules_template_target,$(1),$(2),$(3),$(TGT))))
|
|
804
|
+BOBJS += $$(BIN)/$(3).o $(if $(ROMS_$(3)),$$(BIN)/$(3).ids.o)
|
|
805
|
+$(foreach TGT,$(GENERIC_TARGETS),$(if $(RULE_$(2)_to_$(TGT)),$(NEWLINE)$(call rules_template_target,$(1),$(2),$(3),$(TGT))))
|
789
|
806
|
$$(BIN)/deps/$(1).d : $$($(3)_DEPS)
|
790
|
807
|
TAGS : $$($(3)_DEPS)
|
791
|
808
|
endef
|
|
@@ -930,6 +947,8 @@ TGT_PCI_DEVICE = $(PCI_DEVICE_$(TGT_ROM_NAME))
|
930
|
947
|
TGT_LD_DRIVERS = $(subst -,_,$(patsubst %,obj_%,$(TGT_DRIVERS)))
|
931
|
948
|
TGT_LD_IDS = pci_vendor_id=$(firstword $(TGT_PCI_VENDOR) 0) \
|
932
|
949
|
pci_device_id=$(firstword $(TGT_PCI_DEVICE) 0)
|
|
950
|
+TGT_LD_DEVLIST = $(foreach ELEM,$(TGT_ELEMENTS),$(if $(PCI_VENDOR_$(ELEM)),\
|
|
951
|
+ pci_devlist_$(patsubst 0x%,%,$(PCI_VENDOR_$(ELEM)))$(patsubst 0x%,%,$(PCI_DEVICE_$(ELEM)))))
|
933
|
952
|
TGT_LD_ENTRY = _$(TGT_PREFIX)_start
|
934
|
953
|
|
935
|
954
|
# Calculate linker flags based on link-time options for the current
|
|
@@ -940,7 +959,8 @@ TGT_LD_ENTRY = _$(TGT_PREFIX)_start
|
940
|
959
|
# "-u obj_zpciprefix -u obj_rtl8139 -u obj_prism2_pci
|
941
|
960
|
# --defsym pci_vendor=0x1186 --defsym pci_device=0x1300")
|
942
|
961
|
#
|
943
|
|
-TGT_LD_FLAGS = $(foreach SYM,$(TGT_LD_ENTRY) $(TGT_LD_DRIVERS) obj_config,\
|
|
962
|
+TGT_LD_FLAGS = $(foreach SYM,$(TGT_LD_ENTRY) $(TGT_LD_DRIVERS) \
|
|
963
|
+ $(TGT_LD_DEVLIST) obj_config,\
|
944
|
964
|
-u $(SYM) --defsym check_$(SYM)=$(SYM) ) \
|
945
|
965
|
$(patsubst %,--defsym %,$(TGT_LD_IDS)) \
|
946
|
966
|
-e $(TGT_LD_ENTRY)
|
|
@@ -970,6 +990,7 @@ $(BIN)/%.info :
|
970
|
990
|
@$(ECHO)
|
971
|
991
|
@$(ECHO) 'LD driver symbols : $(TGT_LD_DRIVERS)'
|
972
|
992
|
@$(ECHO) 'LD ID symbols : $(TGT_LD_IDS)'
|
|
993
|
+ @$(ECHO) 'LD devlist symbols : $(TGT_LD_DEVLIST)'
|
973
|
994
|
@$(ECHO) 'LD entry point : $(TGT_LD_ENTRY)'
|
974
|
995
|
@$(ECHO)
|
975
|
996
|
@$(ECHO) 'LD target flags : $(TGT_LD_FLAGS)'
|