1/*
2 * Copyright 2002, Axel D��rfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include <OS.h>
8
9#include <libroot_private.h>
10
11#include "syscalls.h"
12
13
14area_id
15create_area(const char *name, void **address, uint32 addressSpec, size_t size,
16	uint32 lock, uint32 protection)
17{
18	if (__gABIVersion < B_HAIKU_ABI_GCC_2_HAIKU)
19		protection |= B_EXECUTE_AREA;
20	if (__gAPIVersion < B_HAIKU_VERSION_1_PRE_BETA_2)
21		protection |= B_CLONEABLE_AREA;
22	return _kern_create_area(name, address, addressSpec, size, lock, protection);
23}
24
25
26area_id
27clone_area(const char *name, void **address, uint32 addressSpec,
28	uint32 protection, area_id sourceArea)
29{
30	if (__gABIVersion < B_HAIKU_ABI_GCC_2_HAIKU)
31		protection |= B_EXECUTE_AREA | B_CLONEABLE_AREA;
32	return _kern_clone_area(name, address, addressSpec, protection, sourceArea);
33}
34
35
36area_id
37find_area(const char *name)
38{
39	return _kern_find_area(name);
40}
41
42
43area_id
44area_for(void *address)
45{
46	return _kern_area_for(address);
47}
48
49
50status_t
51delete_area(area_id id)
52{
53	return _kern_delete_area(id);
54}
55
56
57status_t
58resize_area(area_id id, size_t newSize)
59{
60	return _kern_resize_area(id, newSize);
61}
62
63
64status_t
65set_area_protection(area_id id, uint32 protection)
66{
67	if (__gABIVersion < B_HAIKU_ABI_GCC_2_HAIKU)
68		protection |= B_EXECUTE_AREA;
69	return _kern_set_area_protection(id, protection);
70}
71
72
73status_t
74_get_area_info(area_id id, area_info *areaInfo, size_t size)
75{
76	// size is not yet used, but may, if area_info changes
77	(void)size;
78
79	return _kern_get_area_info(id, areaInfo);
80}
81
82
83status_t
84_get_next_area_info(team_id team, ssize_t *cookie, area_info *areaInfo, size_t size)
85{
86	// size is not yet used, but may, if area_info changes
87	(void)size;
88
89	return _kern_get_next_area_info(team, cookie, areaInfo);
90}
91
92