Module capsules_extra::read_only_state

source ·
Expand description

Read Only State

This capsule provides read only state to userspace applications. This is similar to the Linux vDSO syscalls.

The benefit of using these is that applications can avoid the context switch overhead of traditional syscalls by just reading the value from memory.

The value will only be as accurate as the last time the application was switched to by the kernel.

The layout of the read only state in the allow region depends on the version. Userspace can use command 0 to get the version information.

Versions are backwards compatible, that is new versions will only add fields, not remove existing ones or change the order.

Version 1:
  |-------------------------|
  |    Switch Count (u32)   |
  |-------------------------|
  |   Pending Tasks (u32)   |
  |-------------------------|
  |                         |
  |     Time Ticks (u64)    |
  |-------------------------|

Structs§

Constants§