Changes in kernel/generic/src/console/kconsole.c [55b77d9:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
r55b77d9 r96b02eb9 84 84 85 85 SPINLOCK_INITIALIZE(cmd_lock); /**< Lock protecting command list. */ 86 LIST_INITIALIZE(cmd_ list); /**< Command list. */86 LIST_INITIALIZE(cmd_head); /**< 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 115 117 spinlock_lock(&cmd_lock); 116 118 … … 118 120 * Make sure the command is not already listed. 119 121 */ 120 list_foreach(cmd_list, cur) {122 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { 121 123 cmd_info_t *hlp = list_get_instance(cur, cmd_info_t, link); 122 124 … … 151 153 * Now the command can be added. 152 154 */ 153 list_append(&cmd->link, &cmd_ list);155 list_append(&cmd->link, &cmd_head); 154 156 155 157 spinlock_unlock(&cmd_lock); … … 174 176 175 177 if (*startpos == NULL) 176 *startpos = cmd_ list.head.next;177 178 for (; *startpos != &cmd_ list.head; *startpos = (*startpos)->next) {178 *startpos = cmd_head.next; 179 180 for (; *startpos != &cmd_head; *startpos = (*startpos)->next) { 179 181 cmd_info_t *hlp = list_get_instance(*startpos, cmd_info_t, link); 180 182 … … 557 559 558 560 cmd_info_t *cmd = NULL; 559 560 list_foreach(cmd_list, cur) { 561 link_t *cur; 562 563 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { 561 564 cmd_info_t *hlp = list_get_instance(cur, cmd_info_t, link); 562 565 spinlock_lock(&hlp->lock);
Note:
See TracChangeset
for help on using the changeset viewer.