Changeset e1a27be in mainline for kernel/generic/src/console/console.c
- Timestamp:
- 2012-12-29T10:48:35Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 17cc8f4f
- Parents:
- 8f88beb (diff), c928bb7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
r8f88beb re1a27be 52 52 #include <errno.h> 53 53 #include <str.h> 54 #include <abi/klog.h> 54 55 55 56 #define KLOG_PAGES 8 … … 335 336 * 336 337 */ 337 sysarg_t sys_klog(int fd, const void *buf, size_t size)338 sysarg_t sys_klog(int cmd, const void *buf, size_t size) 338 339 { 339 340 char *data; 340 341 int rc; 341 342 343 switch (cmd) { 344 case KLOG_UPDATE: 345 klog_update(NULL); 346 return EOK; 347 case KLOG_WRITE: 348 case KLOG_COMMAND: 349 break; 350 default: 351 return ENOTSUP; 352 } 353 342 354 if (size > PAGE_SIZE) 343 355 return (sysarg_t) ELIMIT; … … 355 367 data[size] = 0; 356 368 357 printf("%s", data); 369 switch (cmd) { 370 case KLOG_WRITE: 371 printf("%s", data); 372 break; 373 case KLOG_COMMAND: 374 if (!stdin) 375 break; 376 for (unsigned int i = 0; i < size; i++) 377 indev_push_character(stdin, data[i]); 378 indev_push_character(stdin, '\n'); 379 break; 380 } 381 358 382 free(data); 359 } else 360 klog_update(NULL); 361 383 } 384 362 385 return size; 363 386 }
Note:
See TracChangeset
for help on using the changeset viewer.