updates to support driver-specific API in userspace #24537
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed solution to #24539
syscalls: correct Z_SYSCALL_SPECIFIC_DRIVER
The condition required to validate an extended API system call is that the device be associated with the base API, and that the device be associated with the extended driver implementing the calls. Neither one alone is sufficient.
scripts: syscalls: support using base subsystem for extended driver devices
Driver-specific API requires that the base API functions like
counter_get_value()work on a device that is defined with an extended API. Validation of APIs involves checking that the device api table is associated with a subsystem-tagged API structure. Since the base table for an extended API is embedded in a structure that has a different type with additional members, either no kernel object or the wrong kernel object will be associated with the driver.Recognize
__subsystem/*base_driver_api*/in parse_syscalls as identifying an extended API that should cause drivers using it to be marked as K_OBJ_DRIVER_BASE instances. Change the representation of known subsystems from a list to a map so that the base subsystem can be inferred from the extended subsystem. Associate the correct base subsystem kernel object type with the extended driver instances.