forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvpage.h
More file actions
38 lines (31 loc) · 846 Bytes
/
vpage.h
File metadata and controls
38 lines (31 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: BSD-3-Clause
// Copyright(c) 2025 Intel Corporation.
/* Virtual Page Allocator API */
#ifndef __SOF_LIB_VPAGE_H__
#define __SOF_LIB_VPAGE_H__
#include <zephyr/kernel.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Allocate virtual pages
* Allocates a specified number of contiguous virtual memory pages by mapping
* physical pages.
*
* @param[in] pages Number of pages (usually 4kB large) to allocate.
*
* @return Pointer to the allocated virtual memory region, or NULL on failure.
*/
void *vpage_alloc(unsigned int pages);
/**
* @brief Free virtual pages
* Frees previously allocated virtual memory pages and unmaps them.
*
* @param[in] ptr Pointer to the memory pages to free.
*/
void vpage_free(void *ptr);
#ifdef __cplusplus
}
#endif
#endif /* __SOF_LIB_VPAGE_H__ */