Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1329 → Rev 1330

//uspace/trunk/libc/include/as.h
26,16 → 26,15
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __AS_H__
#define __AS_H__
#ifndef __libc_AS_H__
#define __libc_AS_H__
 
#include <types.h>
#include <task.h>
#include <kernel/mm/as.h>
 
extern void *as_area_create(void *address, size_t size, int flags);
extern int as_area_resize(void *address, size_t size, int flags);
extern int as_area_destroy(void *address);
extern int as_area_accept(task_id_t id, void *base, size_t size, int flags);
extern int as_area_send(task_id_t id, void *base);
 
#endif
//uspace/trunk/libc/generic/as.c
69,46 → 69,6
return __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t ) address);
}
 
/** Prepare to accept address space area.
*
* @param id Task ID of the donor task.
* @param base Destination address for the new address space area.
* @param size Size of the new address space area.
* @param flags Flags of the area TASK is willing to accept.
*
* @return 0 on success or a code from errno.h.
*/
int as_area_accept(task_id_t id, void *base, size_t size, int flags)
{
as_area_acptsnd_arg_t arg;
arg.task_id = id;
arg.base = base;
arg.size = size;
arg.flags = flags;
return __SYSCALL1(SYS_AS_AREA_ACCEPT, (sysarg_t) &arg);
}
 
/** Send address space area to another task.
*
* @param id Task ID of the acceptor task.
* @param base Source address of the existing address space area.
*
* @return 0 on success or a code from errno.h.
*/
int as_area_send(task_id_t id, void *base)
{
as_area_acptsnd_arg_t arg;
arg.task_id = id;
arg.base = base;
arg.size = 0;
arg.flags = 0;
return __SYSCALL1(SYS_AS_AREA_SEND, (sysarg_t) &arg);
}
 
static size_t heapsize = 0;
/* Start of heap linker symbol */
extern char _heap;