zephyr/kernel
Andrew Boie 5bd891d3b6 gen_kobject_list.py: device driver support
Device drivers need to be treated like other kernel objects, with
thread-level permissions and validation of struct device pointers passed
in from userspace when making API calls.

However it's not sufficient to identify an object as a driver, we need
to know what subsystem it belongs to (if any) so that userspace cannot,
for example, make Ethernet driver API calls using a UART driver object.

Upon encountering a variable representing a device struct, we look at
the value of its driver_api member. If that corresponds to an instance
of a driver API struct belonging to a known subsystem, the proper
K_OBJ_DRIVER_* enumeration type will be associated with this device in
the generated gperf table.

If there is no API struct or it doesn't correspond to a known subsystem,
the device is omitted from the table; it's presumably used internally
by the kernel or is a singleton with specific APIs for it that do not
take a struct device parameter.

The list of kobjects and subsystems in the script is simplified since
the enumeration type name is strongly derived from the name of the data
structure.

A device object is marked as initialized after its init function has
been run at boot.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-29 13:25:58 -07:00
..
include syscalls: greatly simplify system call declaration 2017-09-29 13:02:20 -07:00
alert.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
atomic_c.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
compiler_stack_protect.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
device.c gen_kobject_list.py: device driver support 2017-09-29 13:25:58 -07:00
errno.c kernel: errno: Use per-thread accessor function compatible with Newlib 2017-05-10 20:54:56 -04:00
idle.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
init.c userspace: add thread-level permission tracking 2017-09-12 12:46:36 -07:00
int_latency_bench.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
Kconfig kernel: reorganize CONFIG_USERSPACE 2017-09-12 12:46:36 -07:00
Kconfig.event_logger kernel: Add thread events to kernel event logger 2017-04-25 02:16:36 +00:00
Kconfig.power_mgmt doc: spelling fixes in Kconfig files 2017-06-12 19:40:51 -04:00
mailbox.c kernel: Use SYS_DLIST_FOR_EACH_CONTAINER whenever possible 2017-08-25 09:08:50 -04:00
Makefile kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
mem_slab.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
mempool.c mem_pool: Don't check level_empty() before breaking a block 2017-07-31 09:14:59 -07:00
msg_q.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
mutex.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
pipes.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
poll.c poll: Enable multiple threads to use k_poll in the same object 2017-08-25 09:00:46 -04:00
pthread.c kernel: POSIX thread IPC support 2017-08-15 19:42:07 -04:00
queue.c poll: Enable multiple threads to use k_poll in the same object 2017-08-25 09:00:46 -04:00
sched.c kernel: Use SYS_DLIST_FOR_EACH_CONTAINER whenever possible 2017-08-25 09:08:50 -04:00
sem.c kernel: convert k_sem APIs to system calls 2017-09-28 08:56:20 -07:00
stack.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
sys_clock.c cleanup: Move #include directives 2017-09-11 12:41:07 -04:00
system_work_q.c kernel: introduce stack definition macros 2017-06-09 18:53:28 -04:00
thread_abort.c k_thread_abort(): assert if abort essential thread 2017-09-07 16:35:16 -07:00
thread.c kernel: add common functions for user mode 2017-09-12 12:46:36 -07:00
timer.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00
userspace.c gen_kobject_list.py: device driver support 2017-09-29 13:25:58 -07:00
version.c kernel: version: no need to store version in RAM 2017-09-07 16:34:50 -07:00
work_q.c kernel: introduce object validation mechanism 2017-09-07 16:33:33 -07:00