source: mainline/uspace/lib/c/include/as.h@ cd1e3fc0

Last change on this file since cd1e3fc0 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 952 bytes
Line 
1/*
2 * SPDX-FileCopyrightText: 2005 Martin Decky
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup libc
8 * @{
9 */
10/** @file
11 */
12
13#ifndef _LIBC_AS_H_
14#define _LIBC_AS_H_
15
16#include <types/common.h>
17#include <stddef.h>
18#include <stdint.h>
19#include <abi/mm/as.h>
20#include <libarch/config.h>
21
22static inline size_t SIZE2PAGES(size_t size)
23{
24 if (size == 0)
25 return 0;
26
27 return (size_t) ((size - 1) >> PAGE_WIDTH) + 1;
28}
29
30static inline size_t PAGES2SIZE(size_t pages)
31{
32 return (size_t) (pages << PAGE_WIDTH);
33}
34
35extern void *as_area_create(void *, size_t, unsigned int,
36 as_area_pager_info_t *);
37extern errno_t as_area_resize(void *, size_t, unsigned int);
38extern errno_t as_area_change_flags(void *, unsigned int);
39extern errno_t as_area_get_info(void *, as_area_info_t *);
40extern errno_t as_area_destroy(void *);
41extern void *set_maxheapsize(size_t);
42extern errno_t as_get_physical_mapping(const void *, uintptr_t *);
43
44#endif
45
46/** @}
47 */
Note: See TracBrowser for help on using the repository browser.