L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
Kernel Interface Page

Kernel Interface Page. More...

+ Collaboration diagram for Kernel Interface Page:

Modules

 Fiasco-UX Virtual devices
 Virtual hardware devices, provided by Fiasco-UX.
 
 Memory descriptors (C version)
 C Interface for KIP memory descriptors.
 

Data Structures

struct  l4_kernel_info_t
 L4 Kernel Interface Page. More...
 
class  L4::Kip::Mem_desc
 Memory descriptors stored in the kernel interface page. More...
 

Macros

#define L4_KERNEL_INFO_MAGIC   (0x4BE6344CL) /* "L4µK" */
 Kernel Info Page identifier ("L4µK").
 

Typedefs

typedef struct l4_kernel_info_t l4_kernel_info_t
 L4 Kernel Interface Page.
 
typedef struct l4_kernel_info_t l4_kernel_info_t
 L4 Kernel Interface Page.
 

Enumerations

enum  { L4_KIP_OFFS_READ_US = 0x900 , L4_KIP_OFFS_READ_NS = 0x980 }
 

Functions

l4_kernel_info_t const * l4_kip (void) L4_NOTHROW
 Get Kernel Info Page.
 
l4_umword_t l4_kip_version (l4_kernel_info_t const *kip) L4_NOTHROW
 Get the kernel version.
 
const char * l4_kip_version_string (l4_kernel_info_t const *kip) L4_NOTHROW
 Get the kernel version string.
 
int l4_kernel_info_version_offset (l4_kernel_info_t const *kip) L4_NOTHROW
 Return offset in bytes of version_strings relative to the KIP base.
 
l4_cpu_time_t l4_kip_clock (l4_kernel_info_t const *kip) L4_NOTHROW
 Return clock value from the KIP.
 
l4_umword_t l4_kip_clock_lw (l4_kernel_info_t const *kip) L4_NOTHROW
 Return least significant machine word of clock value from the KIP.
 
l4_uint64_t l4_kip_clock_ns (l4_kernel_info_t const *kip) L4_NOTHROW
 Return current clock using the KIP in nanoseconds.
 

Detailed Description

Kernel Interface Page.

C interface for the Kernel Interface Page:

C++ interface for the Kernel Interface Page:

Include File
#include <l4/sys/kip>
Include File
#include <l4/sys/kip.h>
Kernel Info Page access functions.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
L4_KIP_OFFS_READ_US 

Offset of KIP code (provided by the kernel) for reading the KIP clock in microseconds.

If the kernel is configured for a fine-grained KIP clock (CONFIG_SYNC_TSC enabled for IA32, ARM_SYNC_CLOCK for ARM), this code provides the KIP clock with microseconds granularity and accuracy by reading the hardware clock used by the kernel and transforming this value into microseconds. Otherwise this code just reads the KIP clock value.

L4_KIP_OFFS_READ_NS 

Offset of KIP code (provided by the kernel) for reading the time stamp counter and transforming this value into nanoseconds.

If the kernel is configured for fine-grained KIP clock (CONFIG_SYNC enabled for IA32, ARM_SYNC_CLOCK for ARM), this code provides the KIP clock with nanoseconds granularity and accuracy by reading the hardware clock used by the kernel and transforming this value into nanoseconds. Otherwise this code just reads the KIP clock value and multiplies it by 1000.

Definition at line 64 of file kip.h.

Function Documentation

◆ l4_kernel_info_version_offset()

int l4_kernel_info_version_offset ( l4_kernel_info_t const *  kip)
inline

Return offset in bytes of version_strings relative to the KIP base.

Parameters
kipPointer to the kernel info page (KIP).
Returns
offset of version_strings relative to the KIP base address, in bytes.

Definition at line 211 of file kip.h.

Referenced by l4_kip_version_string().

+ Here is the caller graph for this function:

◆ l4_kip()

l4_kernel_info_t const * l4_kip ( void  )
inline

Get Kernel Info Page.

Returns
Pointer to Kernel Info Page (KIP) structure.

Definition at line 192 of file kip.h.

Referenced by l4re_kip().

+ Here is the caller graph for this function:

◆ l4_kip_clock()

l4_cpu_time_t l4_kip_clock ( l4_kernel_info_t const *  kip)
inline

Return clock value from the KIP.

Parameters
kipPointer to the kernel info page (KIP).
Returns
Value of the clock field in the KIP.

The KIP clock always contains the current (relative) time in micro seconds independently of the CPU frequency. The clock is only guaranteed to be accurate within the scheduling granularity announced in the KIP.

This function basically calls the KIP code for reading the KIP clock with microseconds resolution. The accuracy depends on the platform and the kernel configuration.

See also
L4_KIP_OFFS_READ_US.
Examples
examples/libs/shmc/prodcons.c.

Definition at line 215 of file kip.h.

References L4_KIP_OFFS_READ_US.

Referenced by L4::Poll_timeout_kipclock::set(), and L4::Poll_timeout_kipclock::test().

+ Here is the caller graph for this function:

◆ l4_kip_clock_lw()

l4_umword_t l4_kip_clock_lw ( l4_kernel_info_t const *  kip)
inline

Return least significant machine word of clock value from the KIP.

Parameters
kipPointer to the kernel info page (KIP).
Returns
Lower machine word of clock value from the KIP.

This function will always provide the least significant machine word of the clock value from the KIP, regardless of the kernel configuration.

Definition at line 234 of file kip.h.

References l4_mb().

+ Here is the call graph for this function:

◆ l4_kip_clock_ns()

l4_cpu_time_t l4_kip_clock_ns ( l4_kernel_info_t const *  kip)
inline

Return current clock using the KIP in nanoseconds.

Parameters
kipPointer to the kernel info page (KIP).
Returns
Value of the current clock in nanoseconds.

This function basically calls the KIP code for reading the KIP clock with nanoseconds resolution. The accuracy depends on the platform and the kernel configuration.

See also
L4_KIP_OFFS_READ_NS.

Definition at line 225 of file kip.h.

References L4_KIP_OFFS_READ_NS.

◆ l4_kip_version()

l4_umword_t l4_kip_version ( l4_kernel_info_t const *  kip)
inline

Get the kernel version.

Parameters
kipKernel Info Page.
Returns
Kernel version string. 0 if KIP could not be mapped.

Definition at line 203 of file kip.h.

References l4_kernel_info_t::version.

◆ l4_kip_version_string()

const char * l4_kip_version_string ( l4_kernel_info_t const *  kip)
inline

Get the kernel version string.

Parameters
kipKernel Info Page.
Returns
Kernel version string.

Definition at line 207 of file kip.h.

References l4_kernel_info_version_offset().

Referenced by l4_kip_kernel_has_feature().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: