Rev 4148 | Rev 4180 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4148 | Rev 4173 | ||
---|---|---|---|
Line 85... | Line 85... | ||
85 | static cmd_info_t *parse_cmdline(char *cmdline, size_t len); |
85 | static cmd_info_t *parse_cmdline(char *cmdline, size_t len); |
86 | static bool parse_argument(char *cmdline, size_t len, index_t *start, |
86 | static bool parse_argument(char *cmdline, size_t len, index_t *start, |
87 | index_t *end); |
87 | index_t *end); |
88 | static char history[KCONSOLE_HISTORY][MAX_CMDLINE] = {}; |
88 | static char history[KCONSOLE_HISTORY][MAX_CMDLINE] = {}; |
89 | 89 | ||
90 | /* |
- | |
91 | * For now, we use 0 as INR. |
- | |
92 | * However, it is therefore desirable to have architecture specific |
- | |
93 | * definition of KCONSOLE_VIRT_INR in the future. |
- | |
94 | */ |
- | |
95 | #define KCONSOLE_VIRT_INR 0 |
- | |
96 | - | ||
97 | bool kconsole_notify = false; |
- | |
98 | irq_t kconsole_irq; |
- | |
99 | - | ||
100 | - | ||
101 | /** Allways refuse IRQ ownership. |
- | |
102 | * |
- | |
103 | * This is not a real IRQ, so we always decline. |
- | |
104 | * |
- | |
105 | * @return Always returns IRQ_DECLINE. |
- | |
106 | * |
- | |
107 | */ |
- | |
108 | static irq_ownership_t kconsole_claim(irq_t *irq) |
- | |
109 | { |
- | |
110 | return IRQ_DECLINE; |
- | |
111 | } |
- | |
112 | - | ||
113 | - | ||
114 | /** Initialize kconsole data structures |
90 | /** Initialize kconsole data structures |
115 | * |
91 | * |
116 | * This is the most basic initialization, almost no |
92 | * This is the most basic initialization, almost no |
117 | * other kernel subsystem is ready yet. |
93 | * other kernel subsystem is ready yet. |
118 | * |
94 | * |
Line 124... | Line 100... | ||
124 | cmd_init(); |
100 | cmd_init(); |
125 | for (i = 0; i < KCONSOLE_HISTORY; i++) |
101 | for (i = 0; i < KCONSOLE_HISTORY; i++) |
126 | history[i][0] = '\0'; |
102 | history[i][0] = '\0'; |
127 | } |
103 | } |
128 | 104 | ||
129 | - | ||
130 | /** Initialize kconsole notification mechanism |
- | |
131 | * |
- | |
132 | * Initialize the virtual IRQ notification mechanism. |
- | |
133 | * |
- | |
134 | */ |
- | |
135 | void kconsole_notify_init(void) |
- | |
136 | { |
- | |
137 | sysinfo_set_item_val("kconsole.present", NULL, true); |
- | |
138 | sysinfo_set_item_val("kconsole.inr", NULL, KCONSOLE_VIRT_INR); |
- | |
139 | - | ||
140 | irq_initialize(&kconsole_irq); |
- | |
141 | kconsole_irq.devno = device_assign_devno(); |
- | |
142 | kconsole_irq.inr = KCONSOLE_VIRT_INR; |
- | |
143 | kconsole_irq.claim = kconsole_claim; |
- | |
144 | irq_register(&kconsole_irq); |
- | |
145 | - | ||
146 | kconsole_notify = true; |
- | |
147 | } |
- | |
148 | - | ||
149 | - | ||
150 | /** Register kconsole command. |
105 | /** Register kconsole command. |
151 | * |
106 | * |
152 | * @param cmd Structure describing the command. |
107 | * @param cmd Structure describing the command. |
153 | * |
108 | * |
154 | * @return 0 on failure, 1 on success. |
109 | * @return 0 on failure, 1 on success. |