Skip to content

Conversation

@pabigot
Copy link
Contributor

@pabigot pabigot commented Apr 20, 2020

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.

pabigot added 2 commits April 21, 2020 08:22
…evices

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.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
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.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
@pabigot
Copy link
Contributor Author

pabigot commented Apr 21, 2020

Not the appropriate solution to the underlying problem.

@pabigot pabigot closed this Apr 21, 2020
@pabigot pabigot deleted the nordic/20200420d branch April 27, 2020 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants