Changeset a46da63 in mainline
- Timestamp:
- 2006-06-16T20:50:51Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 153a209
- Parents:
- b34fab6
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/sysio.c
rb34fab6 ra46da63 121 121 return; 122 122 } 123 123 124 client_connected = 1; 124 125 ipc_answer_fast(iid, 0, 0, 0); /* Accept connection */ 125 126 while (1) { 126 127 callid = async_get_call(&call); 127 switch (IPC_GET_METHOD(call)) { 128 case IPC_M_PHONE_HUNGUP: 129 client_connected = 0; 130 ipc_answer_fast(callid,0,0,0); 131 return; /* Exit thread */ 132 case FB_PUTCHAR: 133 c = IPC_GET_ARG1(call); 134 newrow = IPC_GET_ARG2(call); 135 newcol = IPC_GET_ARG3(call); 136 if (lastcol != newcol || lastrow!=newrow) 128 switch (IPC_GET_METHOD(call)) { 129 case IPC_M_PHONE_HUNGUP: 130 client_connected = 0; 131 ipc_answer_fast(callid, 0, 0, 0); 132 return; /* Exit thread */ 133 case FB_PUTCHAR: 134 c = IPC_GET_ARG1(call); 135 newrow = IPC_GET_ARG2(call); 136 newcol = IPC_GET_ARG3(call); 137 if ((lastcol != newcol) || (lastrow != newrow)) 138 curs_goto(newrow, newcol); 139 lastcol = newcol + 1; 140 lastrow = newrow; 141 sysput(c); 142 retval = 0; 143 break; 144 case FB_CURSOR_GOTO: 145 newrow = IPC_GET_ARG1(call); 146 newcol = IPC_GET_ARG2(call); 137 147 curs_goto(newrow, newcol); 138 lastcol = newcol + 1; 139 lastrow = newrow; 140 sysput(c); 141 retval = 0; 142 break; 143 case FB_CURSOR_GOTO: 144 newrow = IPC_GET_ARG1(call); 145 newcol = IPC_GET_ARG2(call); 146 curs_goto(newrow, newcol); 147 lastrow = newrow; 148 lastcol = newcol; 149 break; 150 case FB_GET_CSIZE: 151 ipc_answer_fast(callid, 0, HEIGHT, WIDTH); 152 continue; 153 case FB_CLEAR: 154 clrscr(); 155 retval = 0; 156 break; 157 case FB_SET_STYLE: 158 fgcolor = IPC_GET_ARG1(call); 159 bgcolor = IPC_GET_ARG2(call); 160 if (fgcolor < bgcolor) 161 set_style(0); 162 else 163 set_style(7); 164 retval = 0; 165 break; 166 case FB_SCROLL: 167 i = IPC_GET_ARG1(call); 168 if (i > HEIGHT || i < -HEIGHT) { 169 retval = EINVAL; 148 lastrow = newrow; 149 lastcol = newcol; 150 retval = 0; 170 151 break; 171 } 172 scroll(i); 173 curs_goto(lastrow, lastcol); 174 retval = 0; 175 break; 176 177 default: 178 retval = ENOENT; 152 case FB_GET_CSIZE: 153 ipc_answer_fast(callid, 0, HEIGHT, WIDTH); 154 continue; 155 case FB_CLEAR: 156 clrscr(); 157 retval = 0; 158 break; 159 case FB_SET_STYLE: 160 fgcolor = IPC_GET_ARG1(call); 161 bgcolor = IPC_GET_ARG2(call); 162 if (fgcolor < bgcolor) 163 set_style(0); 164 else 165 set_style(7); 166 retval = 0; 167 break; 168 case FB_SCROLL: 169 i = IPC_GET_ARG1(call); 170 if ((i > HEIGHT) || (i < -HEIGHT)) { 171 retval = EINVAL; 172 break; 173 } 174 scroll(i); 175 curs_goto(lastrow, lastcol); 176 retval = 0; 177 break; 178 default: 179 retval = ENOENT; 179 180 } 180 ipc_answer_fast(callid,retval,0,0); 181 182 ipc_answer_fast(callid, retval, 0, 0); 181 183 } 182 184 } … … 194 196 /** 195 197 * @} 196 */ 197 198 */ -
libc/Makefile.toolchain
rb34fab6 ra46da63 28 28 29 29 DEFS = -DARCH=$(ARCH) 30 CFLAGS = -fno-builtin -W error-implicit-function-declaration -Wmissing-prototypes-O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include30 CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include 31 31 LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a 32 32 AFLAGS = -
libc/generic/as.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 76 76 77 77 static size_t heapsize = 0; 78 static size_t maxheapsize = (size_t) (-1);78 static size_t maxheapsize = (size_t) (-1); 79 79 80 80 static void * last_allocated = 0; … … 93 93 int rc; 94 94 void *res; 95 95 96 /* Check for invalid values */ 96 97 if (incr < 0 && -incr > heapsize) 97 98 return NULL; 99 98 100 /* Check for too large value */ 99 101 if (incr > 0 && incr+heapsize < heapsize) 100 102 return NULL; 103 101 104 /* Check for too small values */ 102 105 if (incr < 0 && incr+heapsize > heapsize) 103 106 return NULL; 107 104 108 /* Check for user limit */ 105 if ((maxheapsize!=(size_t)(-1)) && (heapsize + incr)>maxheapsize) return NULL; 106 107 rc = as_area_resize(&_heap, heapsize + incr,0); 109 if ((maxheapsize != (size_t) (-1)) && (heapsize + incr) > maxheapsize) 110 return NULL; 111 112 rc = as_area_resize(&_heap, heapsize + incr, 0); 108 113 if (rc != 0) 109 114 return NULL; 110 115 111 116 /* Compute start of new area */ 112 res = (void *) &_heap + heapsize;117 res = (void *) &_heap + heapsize; 113 118 114 119 heapsize += incr; … … 120 125 void *set_maxheapsize(size_t mhs) 121 126 { 122 maxheapsize =mhs;127 maxheapsize = mhs; 123 128 /* Return pointer to area not managed by sbrk */ 124 return ( void *)&_heap + maxheapsize;129 return ((void *) &_heap + maxheapsize); 125 130 126 131 } … … 137 142 /* Set heapsize to some meaningful value */ 138 143 if (maxheapsize == -1) 139 set_maxheapsize(ALIGN_UP(USER_ADDRESS_SPACE_SIZE_ARCH>>1,PAGE_SIZE)); 144 set_maxheapsize(ALIGN_UP(USER_ADDRESS_SPACE_SIZE_ARCH >> 1, PAGE_SIZE)); 145 140 146 if (!last_allocated) 141 last_allocated = ALIGN_UP((void *)&_heap + maxheapsize, PAGE_SIZE);147 last_allocated = (void *) ALIGN_UP((void *) &_heap + maxheapsize, PAGE_SIZE); 142 148 143 149 sz = ALIGN_UP(sz, PAGE_SIZE); … … 148 154 } 149 155 150 151 /** @} 156 /** @} 152 157 */ 153 154 -
libc/generic/async.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 374 374 PS_connection = (connection_t *)arg; 375 375 PS_connection->cthread(PS_connection->callid, &PS_connection->call); 376 376 377 /* Remove myself from connection hash table */ 377 378 futex_down(&async_futex); … … 379 380 hash_table_remove(&conn_hash_table, &key, 1); 380 381 futex_up(&async_futex); 382 381 383 /* Answer all remaining messages with ehangup */ 382 384 while (!list_empty(&PS_connection->msg_queue)) { … … 390 392 if (PS_connection->close_callid) 391 393 ipc_answer_fast(PS_connection->close_callid, 0, 0, 0); 394 395 return 0; 392 396 } 393 397 … … 406 410 * @return New thread id 407 411 */ 408 pstid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid, 409 ipc_call_t *call, 410 void (*cthread)(ipc_callid_t,ipc_call_t *)) 411 { 412 pstid_t ptid; 412 pstid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid, ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *)) 413 { 413 414 connection_t *conn; 414 415 unsigned long key; … … 515 516 while (1) { 516 517 if (psthread_schedule_next_adv(PS_FROM_MANAGER)) { 517 futex_up(&async_futex); /* async_futex is always held 518 * when entering manager thread 519 */ 518 futex_up(&async_futex); 519 /* async_futex is always held 520 * when entering manager thread 521 */ 520 522 continue; 521 523 } … … 547 549 handle_call(callid, &call); 548 550 } 551 552 return 0; 549 553 } 550 554 … … 558 562 static int async_manager_thread(void *arg) 559 563 { 560 futex_up(&async_futex); /* async_futex is always locked when entering 561 * manager */ 564 futex_up(&async_futex); 565 /* async_futex is always locked when entering 566 * manager */ 562 567 async_manager_worker(); 568 569 return 0; 563 570 } 564 571 … … 586 593 } 587 594 595 return 0; 588 596 } 589 597 … … 680 688 { 681 689 amsg_t *msg = (amsg_t *) amsgid; 682 connection_t *conn;683 690 684 691 futex_down(&async_futex); … … 712 719 { 713 720 amsg_t *msg = (amsg_t *) amsgid; 714 connection_t *conn;715 721 716 722 /* TODO: Let it go through the event read at least once */ … … 803 809 804 810 805 /** @} 806 */ 807 808 811 /** @} 812 */ -
libc/generic/cap.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 53 53 arg.value = (unsigned long long) id; 54 54 55 __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps);55 return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps); 56 56 } 57 57 … … 69 69 arg.value = (unsigned long long) id; 70 70 71 __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps);71 return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps); 72 72 } 73 73 74 74 75 75 /** @} 76 76 */ 77 78 -
libc/generic/ddi.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 70 70 int iospace_enable(task_id_t id, void *ioaddr, unsigned long size) 71 71 { 72 task_id_t task_id;73 72 ddi_ioarg_t arg; 74 73 … … 90 89 91 90 92 91 /** @} 93 92 */ 94 95 -
libc/generic/err.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 36 36 #include <stdlib.h> 37 37 38 void errx (int __status, __const char *__format, ...) 38 /* TODO 39 void errx(int __status, __const char *__format, ...) 39 40 { 40 printf("TODO...errx\n");41 41 _exit(0); 42 42 } 43 */ 43 44 44 45 45 46 /** @} 46 47 */ 47 48 -
libc/generic/io/stream.c
rb34fab6 ra46da63 28 28 */ 29 29 30 30 /** @addtogroup libc 31 31 * @{ 32 32 */ … … 74 74 return -1; 75 75 } 76 ((char *) buf)[i++] = r0;76 ((char *) buf)[i++] = r0; 77 77 } 78 78 return i; … … 82 82 { 83 83 int i; 84 ipcarg_t r0,r1;85 84 86 85 for (i = 0; i < count; i++) 87 async_msg(streams[1].phone, CONSOLE_PUTCHAR, ((const char *) buf)[i]);86 async_msg(streams[1].phone, CONSOLE_PUTCHAR, ((const char *) buf)[i]); 88 87 89 88 return count; … … 91 90 92 91 93 94 92 static stream_t open_stdin(void) 95 93 { 96 94 stream_t stream; 97 int phoneid;98 int res;99 95 100 96 if (console_phone < 0) { … … 105 101 106 102 stream.r = read_stdin; 103 stream.w = NULL; 107 104 stream.param = 0; 108 105 stream.phone = console_phone; … … 114 111 { 115 112 stream_t stream; 116 int res;117 113 118 114 if (console_phone < 0) { … … 122 118 } 123 119 120 stream.r = NULL; 124 121 stream.w = write_stdout; 125 122 stream.phone = console_phone; 126 123 stream.param = 0; 124 127 125 return stream; 128 126 } … … 140 138 while (((streams[c].w) || (streams[c].r)) && (c < FDS)) 141 139 c++; 140 142 141 if (c == FDS) 143 142 return EMFILE; … … 157 156 return c; 158 157 } 158 159 159 if (!strcmp(fname, "null")) { 160 160 streams[c].w = write_null; 161 161 return c; 162 162 } 163 164 return -1; 163 165 } 164 166 … … 190 192 191 193 192 194 /** @} 193 195 */ 194 195 -
libc/generic/libc.c
rb34fab6 ra46da63 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup lc Libc 29 * @brief HelenOS C library 30 * @{ 31 * @} 32 */ 33 /** @addtogroup libc generic 34 * @ingroup lc 28 29 /** @addtogroup lc Libc 30 * @brief HelenOS C library 31 * @{ 32 * @} 33 */ 34 /** @addtogroup libc generic 35 * @ingroup lc 35 36 * @{ 36 37 */ … … 50 51 extern char _heap; 51 52 52 void _exit(int status) { 53 void _exit(int status) 54 { 53 55 thread_exit(status); 54 56 } 55 57 56 void __main(void) { 58 void __main(void) 59 { 57 60 psthread_data_t *pt; 58 61 … … 63 66 } 64 67 65 void __io_init(void) { 68 void __io_init(void) 69 { 66 70 open("stdin", 0); 67 71 open("stdout", 0); … … 69 73 } 70 74 71 void __exit(void) { 75 void __exit(void) 76 { 72 77 psthread_teardown(__tcb_get()->pst_data); 73 78 _exit(0); 74 79 } 75 80 76 77 /** @} 81 /** @} 78 82 */ 79 80 -
libc/generic/mmap.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 37 37 #include <unistd.h> 38 38 39 void *mmap(void *start, size_t length, int prot, int flags, int fd, 40 off_t offset) 39 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) 41 40 { 42 int rc;43 44 41 if (!start) 45 42 start = as_get_mappable_page(length); … … 59 56 60 57 61 58 /** @} 62 59 */ 63 64 -
libc/generic/psthread.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 52 52 static LIST_INITIALIZE(manager_list); 53 53 54 static void psthread_exit(void) __attribute__ ((noinline));55 54 static void psthread_main(void); 56 55 … … 192 191 int psthread_join(pstid_t psthrid) 193 192 { 194 volatile psthread_data_t *pt , *mypt;193 volatile psthread_data_t *pt; 195 194 volatile int retval; 196 195 … … 239 238 240 239 context_save(&pt->ctx); 241 context_set(&pt->ctx, FADDR(psthread_main), pt->stack, PSTHREAD_INITIAL_STACK_PAGES_NO*getpagesize(), 242 pt->tcb); 240 context_set(&pt->ctx, FADDR(psthread_main), pt->stack, PSTHREAD_INITIAL_STACK_PAGES_NO*getpagesize(), pt->tcb); 243 241 244 242 return (pstid_t )pt; … … 308 306 309 307 310 /** @} 311 */ 312 313 308 /** @} 309 */ -
libc/generic/string.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 42 42 /* Dummy implementation of mem/ functions */ 43 43 44 void * 44 void *memset(void *s, int c, size_t n) 45 45 { 46 46 char *os = s; 47 47 48 while (n--) 48 49 *(os++) = c; 50 49 51 return s; 50 52 } 51 53 52 struct along {unsigned long n; } __attribute__ ((packed)); 53 54 static void * unaligned_memcpy(void *dst, const void *src, size_t n) 54 struct along { 55 unsigned long n; 56 } __attribute__ ((packed)); 57 58 static void *unaligned_memcpy(void *dst, const void *src, size_t n) 55 59 { 56 60 int i, j; … … 58 62 const struct along *asrc = src; 59 63 60 for (i = 0; i < n /sizeof(unsigned long); i++)64 for (i = 0; i < n / sizeof(unsigned long); i++) 61 65 adst[i].n = asrc[i].n; 62 66 63 for (j = 0; j < n %sizeof(unsigned long); j++)64 ((unsigned char *) (((unsigned long *) dst) + i))[j] = ((unsigned char *)(((unsigned long *) src) + i))[j];65 66 return (char *) src;67 } 68 69 void * 67 for (j = 0; j < n % sizeof(unsigned long); j++) 68 ((unsigned char *) (((unsigned long *) dst) + i))[j] = ((unsigned char *) (((unsigned long *) src) + i))[j]; 69 70 return (char *) src; 71 } 72 73 void *memcpy(void *dst, const void *src, size_t n) 70 74 { 71 75 int i, j; 72 76 73 if (((long) dst & (sizeof(long)-1)) || ((long)src & (sizeof(long)-1)))77 if (((long) dst & (sizeof(long) - 1)) || ((long) src & (sizeof(long) - 1))) 74 78 return unaligned_memcpy(dst, src, n); 75 79 76 for (i = 0; i < n /sizeof(unsigned long); i++)80 for (i = 0; i < n / sizeof(unsigned long); i++) 77 81 ((unsigned long *) dst)[i] = ((unsigned long *) src)[i]; 78 82 79 for (j = 0; j < n %sizeof(unsigned long); j++)80 ((unsigned char *) (((unsigned long *) dst) + i))[j] = ((unsigned char *)(((unsigned long *) src) + i))[j];81 82 return (char *) src;83 } 84 85 void * 83 for (j = 0; j < n % sizeof(unsigned long); j++) 84 ((unsigned char *) (((unsigned long *) dst) + i))[j] = ((unsigned char *) (((unsigned long *) src) + i))[j]; 85 86 return (char *) src; 87 } 88 89 void *memmove(void *dst, const void *src, size_t n) 86 90 { 87 91 int i, j; … … 90 94 return memcpy(dst, src, n); 91 95 92 for (j = (n %sizeof(unsigned long))-1; j >= 0; j--)93 ((unsigned char *) (((unsigned long *) dst) + i))[j] = ((unsigned char *)(((unsigned long *) src) + i))[j];94 95 for (i = n /sizeof(unsigned long)-1; i >=0 ; i--)96 for (j = (n % sizeof(unsigned long)) - 1; j >= 0; j--) 97 ((unsigned char *) ((unsigned long *) dst))[j] = ((unsigned char *) ((unsigned long *) src))[j]; 98 99 for (i = n / sizeof(unsigned long) - 1; i >=0 ; i--) 96 100 ((unsigned long *) dst)[i] = ((unsigned long *) src)[i]; 97 101 98 return (char *) src;102 return (char *) src; 99 103 } 100 104 … … 108 112 size_t counter = 0; 109 113 110 while (str[counter] != 0) {114 while (str[counter] != 0) 111 115 counter++; 112 }113 116 114 117 return counter; 115 118 } 116 119 117 int strcmp(const char *a, const char *b)118 { 119 int c =0;120 121 while (a[c]&&b[c]&&(!(a[c]-b[c]))) c++;122 123 return a[c]-b[c];124 125 } 126 120 int strcmp(const char *a, const char *b) 121 { 122 int c = 0; 123 124 while (a[c] && b[c] && (!(a[c] - b[c]))) 125 c++; 126 127 return (a[c] - b[c]); 128 129 } 127 130 128 131 … … 135 138 { 136 139 while (*str != '\0') { 137 if (*str == (char) c)138 return (char *) str;140 if (*str == (char) c) 141 return (char *) str; 139 142 str++; 140 143 } … … 153 156 154 157 while (*str != '\0') { 155 if (*str == (char) c)156 retval = (char *) str;158 if (*str == (char) c) 159 retval = (char *) str; 157 160 str++; 158 161 } 159 162 160 return (char *) retval;163 return (char *) retval; 161 164 } 162 165 … … 210 213 while (*str) { 211 214 c = *str; 212 c = ( c >= 'a'? c-'a'+10:(c >= 'A'?c-'A'+10:(c <= '9'?c-'0':0xff)));215 c = (c >= 'a' ? c - 'a' + 10 : (c >= 'A' ? c - 'A' + 10 : (c <= '9' ? c - '0' : 0xff))); 213 216 if (c > base) { 214 217 break; … … 236 239 237 240 if (endptr) 238 *endptr = (char *) str;241 *endptr = (char *) str; 239 242 240 243 if (nptr == str) { … … 264 267 265 268 if (number > LONG_MAX) { 266 if ((sgn) && (number == (unsigned long) (LONG_MAX) + 1)) {269 if ((sgn) && (number == (unsigned long) (LONG_MAX) + 1)) { 267 270 /* FIXME: set 0 to errno */ 268 271 return number; 269 272 } 270 273 /* FIXME: set ERANGE to errno */ 271 return (sgn ?LONG_MIN:LONG_MAX);272 } 273 274 return (sgn ?-number:number);274 return (sgn ? LONG_MIN : LONG_MAX); 275 } 276 277 return (sgn ? -number : number); 275 278 } 276 279 … … 293 296 number = _strtoul(nptr, endptr, base, &sgn); 294 297 295 return (sgn ?-number:number);298 return (sgn ? -number : number); 296 299 } 297 300 298 301 char *strcpy(char *dest, const char *src) 299 302 { 300 while (*(dest++) = *(src++)) 301 ; 303 char *orig = dest; 304 305 while ((*(dest++) = *(src++))); 306 return orig; 302 307 } 303 308 304 309 char *strncpy(char *dest, const char *src, size_t n) 305 310 { 306 while ((*(dest++) = *(src++)) && --n)307 ;308 } 309 310 311 /** @} 312 */ 313 314 311 char *orig = dest; 312 313 while ((*(dest++) = *(src++)) && --n); 314 return orig; 315 } 316 317 318 /** @} 319 */ -
libc/generic/time.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 74 74 mapping = as_get_mappable_page(PAGE_SIZE); 75 75 /* Get the mapping of kernel clock */ 76 res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, 77 mapping, PAGE_SIZE, SERVICE_MEM_REALTIME, 78 NULL,&rights,NULL); 76 res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, (sysarg_t) mapping, PAGE_SIZE, SERVICE_MEM_REALTIME, NULL, &rights, NULL); 79 77 if (res) { 80 78 printf("Failed to initialize timeofday memarea\n"); … … 118 116 119 117 120 118 /** @} 121 119 */ 122 123 -
libc/include/err.h
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 36 36 #define _libc__ERR_H_ 37 37 38 #define errx(status,fmt,...) { printf((fmt),##__VA_ARGS__);_exit(status);} 38 #define errx(status, fmt, ...) { \ 39 printf((fmt), ##__VA_ARGS__); \ 40 _exit(status); \ 41 } 39 42 40 43 #endif 41 44 42 45 43 46 /** @} 44 47 */ 45 46 -
libc/include/libc.h
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 42 42 #define __SYSCALL1(id, p1) __syscall(p1, 0, 0, 0, id) 43 43 #define __SYSCALL2(id, p1, p2) __syscall(p1, p2, 0, 0, id) 44 #define __SYSCALL3(id, p1, p2, p3) __syscall(p1, p2,p3, 0, id)45 #define __SYSCALL4(id, p1, p2, p3, p4) __syscall(p1, p2,p3,p4,id)44 #define __SYSCALL3(id, p1, p2, p3) __syscall(p1, p2, p3, 0, id) 45 #define __SYSCALL4(id, p1, p2, p3, p4) __syscall(p1, p2, p3, p4, id) 46 46 47 47 extern void __main(void); 48 extern void __io_init(void); 48 49 extern void __exit(void); 49 extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, 50 const sysarg_t p3, const sysarg_t p4, 51 const syscall_t id); 50 extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, const sysarg_t p4, const syscall_t id); 52 51 53 52 54 53 #endif 55 54 56 57 /** @} 55 /** @} 58 56 */ 59 60 -
libc/malloc/malloc.c
rb34fab6 ra46da63 2931 2931 sp->size >= extra && 2932 2932 !has_segment_link(m, sp)) { /* can't shrink if pinned */ 2933 size_t newsize = sp->size - extra;2934 2933 /* Prefer mremap, fall back to munmap */ 2935 if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) ||2936 (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {2934 if ((CALL_MREMAP(sp->base, sp->size, sp->size - extra, 0) != MFAIL) || 2935 (CALL_MUNMAP(sp->base + sp->size - extra, extra) == 0)) { 2937 2936 released = extra; 2938 2937 } -
ns/ns.c
rb34fab6 ra46da63 82 82 } hashed_service_t; 83 83 84 int static ping_phone;85 86 84 static void *clockaddr = NULL; 87 85 static void *klogaddr = NULL; … … 107 105 ipc_call_t call; 108 106 ipc_callid_t callid; 109 char *as_area;110 107 111 ipcarg_t retval , arg1, arg2;108 ipcarg_t retval; 112 109 113 110 if (!hash_table_create(&ns_hash_table, NS_HASH_TABLE_CHAINS, 3, &ns_hash_table_ops)) { … … 150 147 } 151 148 if (! (callid & IPC_CALLID_NOTIFICATION)) { 152 ipc_answer_fast(callid, retval, arg1, arg2);149 ipc_answer_fast(callid, retval, 0, 0); 153 150 } 154 151 } … … 258 255 free(hash_table_get_instance(item, hashed_service_t, link)); 259 256 } 257 260 258 /** 261 259 * @}
Note:
See TracChangeset
for help on using the changeset viewer.