Rev 614 | Rev 624 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 614 | Rev 623 | ||
---|---|---|---|
Line 63... | Line 63... | ||
63 | * cmd_lock must be acquired before any cmd_info lock. |
63 | * cmd_lock must be acquired before any cmd_info lock. |
64 | * When locking two cmd info structures, structure with |
64 | * When locking two cmd info structures, structure with |
65 | * lower address must be locked first. |
65 | * lower address must be locked first. |
66 | */ |
66 | */ |
67 | 67 | ||
68 | spinlock_t cmd_lock; /**< Lock protecting command list. */ |
68 | SPINLOCK_INITIALIZE(cmd_lock); /**< Lock protecting command list. */ |
69 | link_t cmd_head; /**< Command list. */ |
69 | link_t cmd_head; /**< Command list. */ |
70 | 70 | ||
71 | static cmd_info_t *parse_cmdline(char *cmdline, size_t len); |
71 | static cmd_info_t *parse_cmdline(char *cmdline, size_t len); |
72 | static bool parse_argument(char *cmdline, size_t len, index_t *start, index_t *end); |
72 | static bool parse_argument(char *cmdline, size_t len, index_t *start, index_t *end); |
73 | static char history[KCONSOLE_HISTORY][MAX_CMDLINE] = {}; |
73 | static char history[KCONSOLE_HISTORY][MAX_CMDLINE] = {}; |
74 | 74 | ||
75 | /** Initialize kconsole data structures. */ |
75 | /** Initialize kconsole data structures. */ |
76 | void kconsole_init(void) |
76 | void kconsole_init(void) |
77 | { |
77 | { |
78 | int i; |
78 | int i; |
79 | 79 | ||
80 | spinlock_initialize(&cmd_lock, "kconsole_cmd"); |
- | |
81 | list_initialize(&cmd_head); |
80 | list_initialize(&cmd_head); |
82 | 81 | ||
83 | cmd_init(); |
82 | cmd_init(); |
84 | for (i=0; i<KCONSOLE_HISTORY; i++) |
83 | for (i=0; i<KCONSOLE_HISTORY; i++) |
85 | history[i][0] = '\0'; |
84 | history[i][0] = '\0'; |