Changeset 25eec4e in mainline for kernel/generic/src/console/console.c
- Timestamp:
- 2013-04-19T18:38:18Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6d717a4
- Parents:
- a1e2df13 (diff), 289cb7dd (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
ra1e2df13 r25eec4e 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.