Subversion Repositories HelenOS-historic

Rev

Rev 1228 | Rev 1240 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1228 Rev 1237
Line 26... Line 26...
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
#include <libc.h>
29
#include <libc.h>
30
#include <unistd.h>
30
#include <unistd.h>
-
 
31
#include <kernel/mm/as_arg.h>
-
 
32
#include <task.h>
31
 
33
 
32
/** Create address space area.
34
/** Create address space area.
33
 *
35
 *
34
 * @param address Virtual address where to place new address space area.
36
 * @param address Virtual address where to place new address space area.
35
 * @param size Size of the area.
37
 * @param size Size of the area.
Line 53... Line 55...
53
void *as_area_resize(void *address, size_t size, int flags)
55
void *as_area_resize(void *address, size_t size, int flags)
54
{
56
{
55
    return (void *) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
57
    return (void *) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
56
}
58
}
57
 
59
 
-
 
60
/** Prepare to accept address space area.
-
 
61
 *
-
 
62
 * @param id Task ID of the donor task.
-
 
63
 * @param base Destination address for the new address space area.
-
 
64
 * @param size Size of the new address space area.
-
 
65
 * @param flags Flags of the area TASK is willing to accept.
-
 
66
 *
-
 
67
 * @return 0 on success or a code from errno.h.
-
 
68
 */
-
 
69
int as_area_accept(task_id_t id, void *base, size_t size, int flags)
-
 
70
{
-
 
71
    as_area_acptsnd_arg_t arg;
-
 
72
   
-
 
73
    arg.task_id = id;
-
 
74
    arg.base = base;
-
 
75
    arg.size = size;
-
 
76
    arg.flags = flags;
-
 
77
   
-
 
78
    return __SYSCALL1(SYS_AS_AREA_ACCEPT, (__native) &arg);
-
 
79
}
-
 
80
 
-
 
81
/** Send address space area to another task.
-
 
82
 *
-
 
83
 * @param id Task ID of the acceptor task.
-
 
84
 * @param base Source address of the existing address space area.
-
 
85
 *
-
 
86
 * @return 0 on success or a code from errno.h.
-
 
87
 */
-
 
88
int as_area_send(task_id_t id, void *base)
-
 
89
{
-
 
90
    as_area_acptsnd_arg_t arg;
-
 
91
   
-
 
92
    arg.task_id = id;
-
 
93
    arg.base = base;
-
 
94
    arg.size = 0;
-
 
95
    arg.flags = 0;
-
 
96
   
-
 
97
    return __SYSCALL1(SYS_AS_AREA_SEND, (__native) &arg);
-
 
98
}
-
 
99
 
58
static size_t heapsize = 0;
100
static size_t heapsize = 0;
59
/* Start of heap linker symbol */
101
/* Start of heap linker symbol */
60
extern char _heap;
102
extern char _heap;
61
 
103
 
62
/** Sbrk emulation
104
/** Sbrk emulation