Subversion Repositories HelenOS

Rev

Rev 1901 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1901 Rev 1958
Line 59... Line 59...
59
#include <interrupt.h>
59
#include <interrupt.h>
60
#include <arch/syscall.h>
60
#include <arch/syscall.h>
61
#include <arch/debugger.h>
61
#include <arch/debugger.h>
62
#include <syscall/syscall.h>
62
#include <syscall/syscall.h>
63
#include <console/console.h>
63
#include <console/console.h>
-
 
64
#include <ddi/irq.h>
-
 
65
#include <ddi/device.h>
64
 
66
 
65
 
67
 
66
/** Disable I/O on non-privileged levels
68
/** Disable I/O on non-privileged levels
67
 *
69
 *
68
 * Clean IOPL(12,13) and NT(14) flags in EFLAGS register
70
 * Clean IOPL(12,13) and NT(14) flags in EFLAGS register
Line 128... Line 130...
128
    clean_IOPL_NT_flags();
130
    clean_IOPL_NT_flags();
129
    /* Disable alignment check */
131
    /* Disable alignment check */
130
    clean_AM_flag();
132
    clean_AM_flag();
131
 
133
 
132
    if (config.cpu_active == 1) {
134
    if (config.cpu_active == 1) {
-
 
135
        interrupt_init();
133
        bios_init();
136
        bios_init();
134
        i8259_init();   /* PIC */
-
 
135
        i8254_init();   /* hard clock */
-
 
136
 
137
       
137
        #ifdef CONFIG_SMP
138
        /* PIC */
138
        exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown",
-
 
139
                 tlb_shootdown_ipi);
139
        i8259_init();
140
        #endif /* CONFIG_SMP */
-
 
141
    }
140
    }
142
}
141
}
143
 
142
 
144
void arch_post_mm_init(void)
143
void arch_post_mm_init(void)
145
{
144
{
146
    if (config.cpu_active == 1) {
145
    if (config.cpu_active == 1) {
-
 
146
        /* Initialize IRQ routing */
-
 
147
        irq_init(IRQ_COUNT, IRQ_COUNT);
-
 
148
       
-
 
149
        /* hard clock */
-
 
150
        i8254_init();
-
 
151
 
147
#ifdef CONFIG_FB
152
#ifdef CONFIG_FB
148
        if (vesa_present())
153
        if (vesa_present())
149
            vesa_init();
154
            vesa_init();
150
        else
155
        else
151
#endif
156
#endif
152
            ega_init(); /* video */
157
            ega_init(); /* video */
-
 
158
       
153
        /* Enable debugger */
159
        /* Enable debugger */
154
        debugger_init();
160
        debugger_init();
155
        /* Merge all memory zones to 1 big zone */
161
        /* Merge all memory zones to 1 big zone */
156
        zone_merge_all();
162
        zone_merge_all();
157
    }
163
    }
Line 181... Line 187...
181
    }
187
    }
182
}
188
}
183
 
189
 
184
void arch_post_smp_init(void)
190
void arch_post_smp_init(void)
185
{
191
{
186
    i8042_init();   /* keyboard controller */
192
    /* keyboard controller */
-
 
193
    i8042_init(device_assign_devno(), IRQ_KBD, device_assign_devno(), IRQ_MOUSE);
187
}
194
}
188
 
195
 
189
void calibrate_delay_loop(void)
196
void calibrate_delay_loop(void)
190
{
197
{
191
    i8254_calibrate_delay_loop();
198
    i8254_calibrate_delay_loop();
-
 
199
    if (config.cpu_active == 1) {
-
 
200
        /*
-
 
201
         * This has to be done only on UP.
-
 
202
         * On SMP, i8254 is not used for time keeping and its interrupt pin remains masked.
-
 
203
         */
192
    i8254_normal_operation();
204
        i8254_normal_operation();
-
 
205
    }
193
}
206
}
194
 
207
 
195
/** Set thread-local-storage pointer
208
/** Set thread-local-storage pointer
196
 *
209
 *
197
 * TLS pointer is set in FS register. Unfortunately the 64-bit
210
 * TLS pointer is set in FS register. Unfortunately the 64-bit