Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Xen extended regions

Allocate, free, and map buffers from Xen extended memory regions. More...

Files

file  regions.h
 Xen extended region management.

Functions

bool xen_region_is_addr_extreg (void *ptr)
 Check whether an address belongs to a configured extended region.
void * xen_region_get_pages (size_t nr_pages)
 Allocate one or more contiguous pages from an extended region.
int xen_region_put_pages (void *ptr, size_t nr_pages)
 Release pages previously allocated from an extended region.
int xen_region_map (void *ptr, size_t nr_pages)
 Map an extended-region buffer into the kernel address space.
int xen_region_unmap (void *ptr, size_t nr_pages)
 Unmap an extended-region buffer from the kernel address space.

Detailed Description

Allocate, free, and map buffers from Xen extended memory regions.

Function Documentation

◆ xen_region_get_pages()

void * xen_region_get_pages ( size_t nr_pages)

#include <zephyr/xen/regions.h>

Allocate one or more contiguous pages from an extended region.

Attention
Available only when the following Kconfig option is enabled: CONFIG_XEN_REGIONS.
Parameters
nr_pagesNumber of Xen pages to allocate.
Returns
Base address of the allocated range, or NULL if no region can satisfy the request.

◆ xen_region_is_addr_extreg()

bool xen_region_is_addr_extreg ( void * ptr)

#include <zephyr/xen/regions.h>

Check whether an address belongs to a configured extended region.

Attention
Available only when the following Kconfig option is enabled: CONFIG_XEN_REGIONS.
Parameters
ptrAddress to test.
Return values
trueptr is inside one of the configured extended regions.
falseptr is NULL or outside all configured extended regions.

◆ xen_region_map()

int xen_region_map ( void * ptr,
size_t nr_pages )

#include <zephyr/xen/regions.h>

Map an extended-region buffer into the kernel address space.

Attention
Available only when the following Kconfig option is enabled: CONFIG_XEN_REGIONS.
Parameters
ptrBase address of the extended-region buffer.
nr_pagesNumber of pages to map.
Return values
0on success.
-EFAULTptr does not belong to an extended region.

◆ xen_region_put_pages()

int xen_region_put_pages ( void * ptr,
size_t nr_pages )

#include <zephyr/xen/regions.h>

Release pages previously allocated from an extended region.

Attention
Available only when the following Kconfig option is enabled: CONFIG_XEN_REGIONS.
Parameters
ptrBase address returned by xen_region_get_pages().
nr_pagesNumber of pages to release.
Returns
0 on success, negative errno value on failure.
Return values
-EIOptr does not belong to a known extended region.

◆ xen_region_unmap()

int xen_region_unmap ( void * ptr,
size_t nr_pages )

#include <zephyr/xen/regions.h>

Unmap an extended-region buffer from the kernel address space.

Attention
Available only when the following Kconfig option is enabled: CONFIG_XEN_REGIONS.
Parameters
ptrBase address of the extended-region buffer.
nr_pagesNumber of pages to unmap.
Return values
0on success.
-EFAULTptr does not belong to an extended region.