Loading...
Searching...
No Matches
Memory operations.
Base API

Operations for memory access. More...

Collaboration diagram for Memory operations.:

## Enumerations

enum | L4_mem_op_widths { L4_MEM_WIDTH_1BYTE = 0 , L4_MEM_WIDTH_2BYTE = 1 , L4_MEM_WIDTH_4BYTE = 2 }
| Memory access width definitions. More...

## Functions

unsigned long | l4_mem_read (unsigned long virtaddress, unsigned width)
| Read user task memory from kernel privilege level.
void | l4_mem_write (unsigned long virtaddress, unsigned width, unsigned long value)
| Write user task memory from kernel privilege level.

## Detailed Description

Operations for memory access.

This module provides functionality to access user task memory from the kernel. This is needed for some devices that are only accessible from privileged processor mode. Only use this when absolutely required. This functionality is only available on the ARM architecture.

`#include <l4/sys/mem_op.h>`

## Enumeration Type Documentation

## L4_mem_op_widths

enum L4_mem_op_widths

Memory access width definitions.

Enumerator
L4_MEM_WIDTH_1BYTE | Access one byte (8-bit width).
L4_MEM_WIDTH_2BYTE | Access two bytes (16-bit width).
L4_MEM_WIDTH_4BYTE | Access four bytes (32-bit width).

Definition at line 40 of file mem_op.h.

## Function Documentation

## l4_mem_read()

unsigned long l4_mem_read | ( | unsigned long | virtaddress,
|  | unsigned | width )

inline

Read user task memory from kernel privilege level.

Parameters

  virtaddress | Virtual address in the calling task.
  width | Width of access in bytes in log2,

See also
  L4_mem_op_widths

Returns
  Read value.

Upon an given invalid address or invalid width value the function does nothing.

Definition at line 130 of file mem_op.h.

References l4_mem_arm_op_call().

Here is the call graph for this function:

## l4_mem_write()

void l4_mem_write | ( | unsigned long | virtaddress,
|  | unsigned | width,
|  | unsigned long | value )

inline

Write user task memory from kernel privilege level.

Parameters

  virtaddress | Virtual address in the calling task.
  width | Width of access in bytes in log2 (i.e. allowed values: 0, 1, 2)
  value | Value to write.

Upon an given invalid address or invalid width value the function does nothing.

Definition at line 136 of file mem_op.h.

References l4_mem_arm_op_call().

Here is the call graph for this function: