Subversion Repositories HelenOS

Rev

Rev 4296 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4296 Rev 4420
Line 31... Line 31...
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#include <arch.h>
35
#include <arch.h>
36
#include <arch/ski/ski.h>
36
#include <arch/drivers/ski.h>
37
#include <arch/drivers/it.h>
37
#include <arch/drivers/it.h>
38
#include <arch/interrupt.h>
38
#include <arch/interrupt.h>
39
#include <arch/barrier.h>
39
#include <arch/barrier.h>
40
#include <arch/asm.h>
40
#include <arch/asm.h>
41
#include <arch/register.h>
41
#include <arch/register.h>
Line 146... Line 146...
146
{
146
{
147
}
147
}
148
 
148
 
149
void arch_post_smp_init(void)
149
void arch_post_smp_init(void)
150
{
150
{
151
#ifdef SKI
151
#ifdef MACHINE_ski
152
    indev_t *in;
152
    ski_instance_t *ski_instance = skiin_init();
153
    in = skiin_init();
153
    if (ski_instance) {
-
 
154
        srln_instance_t *srln_instance = srln_init();
154
    if (in)
155
        if (srln_instance) {
155
        srln_init(in);
156
            indev_t *sink = stdin_wire();
-
 
157
            indev_t *srln = srln_wire(srln_instance, sink);
-
 
158
            skiin_wire(ski_instance, srln);
-
 
159
        }
-
 
160
    }
-
 
161
   
156
    skiout_init();
162
    skiout_init();
157
#endif
163
#endif
158
   
164
   
159
#ifdef CONFIG_EGA
165
#ifdef CONFIG_EGA
160
    ega_init(EGA_BASE, EGA_VIDEORAM);
166
    ega_init(EGA_BASE, EGA_VIDEORAM);
161
#endif
167
#endif
162
   
168
   
163
#ifdef CONFIG_NS16550
169
#ifdef CONFIG_NS16550
164
    indev_t *kbrdin_ns16550
170
    ns16550_instance_t *ns16550_instance
165
        = ns16550_init((ns16550_t *) NS16550_BASE, NS16550_IRQ, NULL, NULL);
171
        = ns16550_init((ns16550_t *) NS16550_BASE, NS16550_IRQ, NULL, NULL);
-
 
172
    if (ns16550_instance) {
-
 
173
        srln_instance_t *srln_instance = srln_init();
166
    if (kbrdin_ns16550)
174
        if (srln_instance) {
167
        srln_init(kbrdin_ns16550);
175
            indev_t *sink = stdin_wire();
-
 
176
            indev_t *srln = srln_wire(srln_instance, sink);
-
 
177
            ns16550_wire(ns16550_instance, srln);
-
 
178
        }
-
 
179
    }
168
   
180
   
169
    sysinfo_set_item_val("kbd", NULL, true);
181
    sysinfo_set_item_val("kbd", NULL, true);
170
    sysinfo_set_item_val("kbd.inr", NULL, NS16550_IRQ);
182
    sysinfo_set_item_val("kbd.inr", NULL, NS16550_IRQ);
171
    sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
183
    sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
172
    sysinfo_set_item_val("kbd.address.physical", NULL,
184
    sysinfo_set_item_val("kbd.address.physical", NULL,
Line 174... Line 186...
174
    sysinfo_set_item_val("kbd.address.kernel", NULL,
186
    sysinfo_set_item_val("kbd.address.kernel", NULL,
175
        (uintptr_t) NS16550_BASE);
187
        (uintptr_t) NS16550_BASE);
176
#endif
188
#endif
177
   
189
   
178
#ifdef CONFIG_I8042
190
#ifdef CONFIG_I8042
179
    indev_t *kbrdin_i8042 = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
191
    i8042_instance_t *i8042_instance = i8042_init((i8042_t *) I8042_BASE, IRQ_KBD);
-
 
192
    if (i8042_instance) {
-
 
193
        kbrd_instance_t *kbrd_instance = kbrd_init();
180
    if (kbrdin_i8042)
194
        if (kbrd_instance) {
181
        kbrd_init(kbrdin_i8042);
195
            indev_t *sink = stdin_wire();
-
 
196
            indev_t *kbrd = kbrd_wire(kbrd_instance, sink);
-
 
197
            i8042_wire(i8042_instance, kbrd);
-
 
198
        }
-
 
199
    }
182
   
200
   
183
    sysinfo_set_item_val("kbd", NULL, true);
201
    sysinfo_set_item_val("kbd", NULL, true);
184
    sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
202
    sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
185
    sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
203
    sysinfo_set_item_val("kbd.type", NULL, KBD_LEGACY);
186
    sysinfo_set_item_val("kbd.address.physical", NULL,
204
    sysinfo_set_item_val("kbd.address.physical", NULL,
Line 236... Line 254...
236
/** Acquire console back for kernel
254
/** Acquire console back for kernel
237
 *
255
 *
238
 */
256
 */
239
void arch_grab_console(void)
257
void arch_grab_console(void)
240
{
258
{
241
#ifdef SKI
259
#ifdef MACHINE_ski
242
    ski_kbd_grab();
260
    ski_kbd_grab();
243
#endif
261
#endif
244
}
262
}
245
 
263
 
246
/** Return console to userspace
264
/** Return console to userspace
247
 *
265
 *
248
 */
266
 */
249
void arch_release_console(void)
267
void arch_release_console(void)
250
{
268
{
251
#ifdef SKI
269
#ifdef MACHINE_ski
252
    ski_kbd_release();
270
    ski_kbd_release();
253
#endif
271
#endif
254
}
272
}
255
 
273
 
256
void arch_reboot(void)
274
void arch_reboot(void)