Changeset 55b77d9 in mainline for kernel/generic/src/console
- Timestamp:
- 2011-06-17T20:39:16Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8f164724
- Parents:
- 98caf49
- Location:
- kernel/generic/src/console
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
r98caf49 r55b77d9 573 573 spinlock_lock(&cmd_lock); 574 574 575 link_t *cur;576 575 size_t len = 0; 577 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {576 list_foreach(cmd_list, cur) { 578 577 cmd_info_t *hlp; 579 578 hlp = list_get_instance(cur, cmd_info_t, link); … … 591 590 } 592 591 593 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {592 list_foreach(cmd_list, cur) { 594 593 cmd_info_t *hlp; 595 594 hlp = list_get_instance(cur, cmd_info_t, link); … … 646 645 int cmd_desc(cmd_arg_t *argv) 647 646 { 648 link_t *cur;649 650 647 spinlock_lock(&cmd_lock); 651 648 652 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {649 list_foreach(cmd_list, cur) { 653 650 cmd_info_t *hlp; 654 651 -
kernel/generic/src/console/console.c
r98caf49 r55b77d9 124 124 static void stdout_write(outdev_t *dev, wchar_t ch, bool silent) 125 125 { 126 link_t *cur; 127 128 for (cur = dev->list.next; cur != &dev->list; cur = cur->next) { 126 list_foreach(dev->list, cur) { 129 127 outdev_t *sink = list_get_instance(cur, outdev_t, link); 130 128 if ((sink) && (sink->op->write)) … … 135 133 static void stdout_redraw(outdev_t *dev) 136 134 { 137 link_t *cur; 138 139 for (cur = dev->list.next; cur != &dev->list; cur = cur->next) { 135 list_foreach(dev->list, cur) { 140 136 outdev_t *sink = list_get_instance(cur, outdev_t, link); 141 137 if ((sink) && (sink->op->redraw)) -
kernel/generic/src/console/kconsole.c
r98caf49 r55b77d9 84 84 85 85 SPINLOCK_INITIALIZE(cmd_lock); /**< Lock protecting command list. */ 86 LIST_INITIALIZE(cmd_ head); /**< Command list. */86 LIST_INITIALIZE(cmd_list); /**< Command list. */ 87 87 88 88 static wchar_t history[KCONSOLE_HISTORY][MAX_CMDLINE] = {}; … … 113 113 bool cmd_register(cmd_info_t *cmd) 114 114 { 115 link_t *cur;116 117 115 spinlock_lock(&cmd_lock); 118 116 … … 120 118 * Make sure the command is not already listed. 121 119 */ 122 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) {120 list_foreach(cmd_list, cur) { 123 121 cmd_info_t *hlp = list_get_instance(cur, cmd_info_t, link); 124 122 … … 153 151 * Now the command can be added. 154 152 */ 155 list_append(&cmd->link, &cmd_ head);153 list_append(&cmd->link, &cmd_list); 156 154 157 155 spinlock_unlock(&cmd_lock); … … 176 174 177 175 if (*startpos == NULL) 178 *startpos = cmd_ head.next;179 180 for (; *startpos != &cmd_ head; *startpos = (*startpos)->next) {176 *startpos = cmd_list.head.next; 177 178 for (; *startpos != &cmd_list.head; *startpos = (*startpos)->next) { 181 179 cmd_info_t *hlp = list_get_instance(*startpos, cmd_info_t, link); 182 180 … … 559 557 560 558 cmd_info_t *cmd = NULL; 561 link_t *cur; 562 563 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { 559 560 list_foreach(cmd_list, cur) { 564 561 cmd_info_t *hlp = list_get_instance(cur, cmd_info_t, link); 565 562 spinlock_lock(&hlp->lock);
Note:
See TracChangeset
for help on using the changeset viewer.