aboutsummaryrefslogtreecommitdiff
path: root/lib/utils/cppc
diff options
context:
space:
mode:
authorSamuel Holland <samuel.holland@sifive.com>2025-03-25 16:43:28 -0700
committerAnup Patel <anup@brainfault.org>2025-04-23 12:32:50 +0530
commit2489e1421d5bbb751d4779dc873bcbbb21e331c0 (patch)
treedd181b2ddedc53a7e3947ac6a9f603b249f0ba7e /lib/utils/cppc
parente78a0ebdc4b116f44f36df44386fd7093e5df4ca (diff)
downloadopensbi-2489e1421d5bbb751d4779dc873bcbbb21e331c0.zip
opensbi-2489e1421d5bbb751d4779dc873bcbbb21e331c0.tar.gz
opensbi-2489e1421d5bbb751d4779dc873bcbbb21e331c0.tar.bz2
platform: generic: Allow replacing platform operations
Currently the generic platform follows the middleware pattern: it implements the sbi_platform hooks, while providing its own set of hooks for further customization. This has a few disadvantages: each location where customization is needed requires a separate platform_override hook, including places where the generic function does nothing except forward to a platform_override hook, and the extra layer of function pointers adds runtime overhead. Let's restructure the generic platform to follow the helper pattern. Allow platform overrides to treat the generic platform as a template, adding or replacing the sbi_platform_operations as needed. Export the generic implementations, so they can be called as helpers from inside the override functions. With this pattern, the platform_override function pointers are replaced by direct calls, and the forwarding functions can be removed. The forwarding functions are not exported, since there is no reason for an override to call them. generic_vendor_ext_check() must be rewritten, since now there is a new way to override vendor_ext_provider. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20250325234342.711447-6-samuel.holland@sifive.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/cppc')
0 files changed, 0 insertions, 0 deletions