Loading...
Searching...
No Matches
Kernel Interface Page
Base API

Kernel Interface Page. More...

Collaboration diagram for Kernel Interface Page:

## Topics

| Memory descriptors (C version)
| C Interface for KIP memory descriptors.

## Data Structures

class | L4::Kip::Mem_desc
| Memory descriptors stored in the kernel interface page. More...
struct | l4_kernel_info_t
| L4 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.

## 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:

Include File
  #include <l4/sys/kip>
  kip

C interface for the Kernel Interface Page:

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

## Typedef Documentation

## l4_kernel_info_t

typedef struct l4_kernel_info_t l4_kernel_info_t

L4 Kernel Interface Page.

32-bit architecture may assume that the upper 32 bits of addresses is 0

## 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 95 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

  kip | Pointer to the kernel info page (KIP).

Returns
  offset of version_strings relative to the KIP base address, in bytes.

Definition at line 238 of file kip.h.

References L4_NOTHROW.

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 226 of file kip.h.

References L4_NOTHROW.

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

  kip | Pointer 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 242 of file kip.h.

References L4_KIP_OFFS_READ_US, and L4_NOTHROW.

Referenced by l4_kip_clock_lw(), 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

  kip | Pointer to the kernel info page (KIP).

Returns
  Lower machine word of clock value from the KIP.

Deprecated
  Use l4_kip_clock() instead.

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 261 of file kip.h.

References l4_kip_clock(), and L4_NOTHROW.

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

  kip | Pointer 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 252 of file kip.h.

References L4_KIP_OFFS_READ_NS, and L4_NOTHROW.

## l4_kip_version()

l4_umword_t l4_kip_version | ( | l4_kernel_info_t const * | kip | ) |

inline

Get the kernel version.

Parameters

  kip | Kernel Info Page.

Returns
  Kernel version string. 0 if KIP could not be mapped.

Definition at line 230 of file kip.h.

References L4_NOTHROW.

## l4_kip_version_string()

const char * l4_kip_version_string | ( | l4_kernel_info_t const * | kip | ) |

inline

Get the kernel version string.

Parameters

  kip | Kernel Info Page.

Returns
  Kernel version string.

Definition at line 234 of file kip.h.

References l4_kernel_info_version_offset(), and L4_NOTHROW.

Referenced by l4_kip_kernel_has_feature().

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