mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
firmware_loader: formalize built-in firmware API
Formalize the built-in firmware with a proper API. This can later be used by other callers where all they need is built-in firmware. We export the firmware_request_builtin() call for now only under the TEST_FIRMWARE symbol namespace as there are no direct modular users for it. If they pop up they are free to export it generally. Built-in code always gets access to the callers and we'll demonstrate a hidden user which has been lurking in the kernel for a while and the reason why using a proper API was better long term. Reviewed-by: Borislav Petkov <bp@suse.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20211021155843.1969401-2-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c87761db21
commit
48d09e9787
@@ -1,11 +1,13 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
obj-y += main.o
|
||||
|
||||
# Create $(fwdir) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
|
||||
# leading /, it's relative to $(srctree).
|
||||
fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR))
|
||||
fwdir := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir))
|
||||
|
||||
obj-y := $(addsuffix .gen.o, $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE)))
|
||||
firmware := $(addsuffix .gen.o, $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE)))
|
||||
obj-y += $(firmware)
|
||||
|
||||
FWNAME = $(patsubst $(obj)/%.gen.S,%,$@)
|
||||
FWSTR = $(subst $(comma),_,$(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME)))))
|
||||
@@ -34,7 +36,7 @@ $(obj)/%.gen.S: FORCE
|
||||
$(call filechk,fwbin)
|
||||
|
||||
# The .o files depend on the binaries directly; the .S files don't.
|
||||
$(addprefix $(obj)/, $(obj-y)): $(obj)/%.gen.o: $(fwdir)/%
|
||||
$(addprefix $(obj)/, $(firmware)): $(obj)/%.gen.o: $(fwdir)/%
|
||||
|
||||
targets := $(patsubst $(obj)/%,%, \
|
||||
$(shell find $(obj) -name \*.gen.S 2>/dev/null))
|
||||
|
||||
Reference in New Issue
Block a user