Changeset 11fa83a in mainline
- Timestamp:
- 2006-04-26T16:43:44Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 07b3d93f
- Parents:
- 3214a20
- Location:
- libc
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
libc/Makefile
r3214a20 r11fa83a 45 45 generic/libc.c \ 46 46 generic/ddi.c \ 47 generic/ mmap.c \47 generic/as.c \ 48 48 generic/string.c \ 49 49 generic/thread.c \ -
libc/generic/as.c
r3214a20 r11fa83a 29 29 #include <libc.h> 30 30 #include <unistd.h> 31 #include <kernel/mm/as_arg.h> 32 #include <task.h> 31 33 32 34 /** Create address space area. … … 54 56 { 55 57 return (void *) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags); 58 } 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); 56 98 } 57 99 -
libc/include/unistd.h
r3214a20 r11fa83a 32 32 #include <types.h> 33 33 #include <arch/mm/page.h> 34 #include <task.h> 34 35 35 36 #define NULL 0 … … 38 39 extern ssize_t write(int fd, const void * buf, size_t count); 39 40 extern void _exit(int status); 40 void *as_area_create(void *address, size_t size, int flags); 41 void *as_area_resize(void *address, size_t size, int flags); 41 extern void *as_area_create(void *address, size_t size, int flags); 42 extern void *as_area_resize(void *address, size_t size, int flags); 43 extern int as_area_accept(task_id_t id, void *base, size_t size, int flags); 44 extern int as_area_send(task_id_t id, void *base); 42 45 void *sbrk(ssize_t incr); 43 46
Note:
See TracChangeset
for help on using the changeset viewer.