Subversion Repositories HelenOS

Rev

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

Rev 3659 Rev 3661
Line 117... Line 117...
117
{
117
{
118
 
118
 
119
    uint64_t IOSAPIC = PA2KA((unative_t)(iosapic_base))|FW_OFFSET;
119
    uint64_t IOSAPIC = PA2KA((unative_t)(iosapic_base))|FW_OFFSET;
120
    int i;
120
    int i;
121
   
121
   
-
 
122
    int myid,myeid;
122
   
123
   
-
 
124
    myid=ia64_get_cpu_id();
-
 
125
    myeid=ia64_get_cpu_eid();
-
 
126
 
123
    for(i=0;i<16;i++)
127
    for(i=0;i<16;i++)
124
    {
128
    {
125
   
129
   
126
        if(i==2) continue;   //Disable Cascade interrupt
130
        if(i==2) continue;   //Disable Cascade interrupt
127
        ((uint32_t*)(IOSAPIC+0x00))[0]=0x10+2*i;
131
        ((uint32_t*)(IOSAPIC+0x00))[0]=0x10+2*i;
128
        srlz_d();
132
        srlz_d();
129
        ((uint32_t*)(IOSAPIC+0x10))[0]=LAGACY_INTERRUPT_BASE+i;
133
        ((uint32_t*)(IOSAPIC+0x10))[0]=LAGACY_INTERRUPT_BASE+i;
130
        srlz_d();
134
        srlz_d();
131
        ((uint32_t*)(IOSAPIC+0x00))[0]=0x10+2*i+1;
135
        ((uint32_t*)(IOSAPIC+0x00))[0]=0x10+2*i+1;
132
        srlz_d();
136
        srlz_d();
133
        ((uint32_t*)(IOSAPIC+0x10))[0]=1<<(56-32);
137
        ((uint32_t*)(IOSAPIC+0x10))[0]=myid<<(56-32) | myeid<<(48-32);
134
        srlz_d();
138
        srlz_d();
135
    }
139
    }
136
 
140
 
137
}
141
}
138
 
142
 
Line 167... Line 171...
167
#define POLL_INTERVAL       50000       /* 50 ms */
171
#define POLL_INTERVAL       50000       /* 50 ms */
168
/** Kernel thread for polling keyboard. */
172
/** Kernel thread for polling keyboard. */
169
static void i8042_kkbdpoll(void *arg)
173
static void i8042_kkbdpoll(void *arg)
170
{
174
{
171
    while (1) {
175
    while (1) {
172
        i8042_poll();
-
 
173
#ifdef CONFIG_NS16550
176
#ifdef CONFIG_NS16550
174
    #ifndef CONFIG_NS16550_INTERRUPT_DRIVEN
177
    #ifndef CONFIG_NS16550_INTERRUPT_DRIVEN
175
        ns16550_poll();
178
        ns16550_poll();
176
    #endif  
179
    #endif  
-
 
180
#else
-
 
181
    #ifndef CONFIG_I8042_INTERRUPT_DRIVEN
-
 
182
        i8042_poll();
-
 
183
    #endif  
177
#endif
184
#endif
178
        thread_usleep(POLL_INTERVAL);
185
        thread_usleep(POLL_INTERVAL);
179
    }
186
    }
180
}
187
}
181
#endif
188
#endif
182
 
189
 
183
 
190
 
-
 
191
void end_of_irq_void(void *cir_arg __attribute__((unused)),inr_t inr __attribute__((unused)));
184
static void end_of_irq_void(void *cir_arg __attribute__((unused)),inr_t inr __attribute__((unused)))
192
void end_of_irq_void(void *cir_arg __attribute__((unused)),inr_t inr __attribute__((unused)))
185
{
193
{
186
    return;
194
    return;
187
}
195
}
188
 
196
 
189
 
197
 
Line 202... Line 210...
202
        thread_ready(t);
210
        thread_ready(t);
203
#endif      
211
#endif      
204
 
212
 
205
#ifdef I460GX
213
#ifdef I460GX
206
        devno_t kbd = device_assign_devno();
214
        devno_t kbd = device_assign_devno();
207
        devno_t mouse = device_assign_devno();
-
 
208
        /* keyboard controller */
215
        /* keyboard controller */
209
        i8042_init(kbd, IRQ_KBD, mouse, IRQ_MOUSE);
-
 
210
 
216
 
211
#ifdef CONFIG_NS16550
217
#ifdef CONFIG_NS16550
212
        ns16550_init(kbd, NS16550_PORT, NS16550_IRQ,end_of_irq_void,NULL); // as a COM 1
218
        ns16550_init(kbd, NS16550_PORT, NS16550_IRQ,end_of_irq_void,NULL); // as a COM 1
213
#else
219
#else
-
 
220
        devno_t mouse = device_assign_devno();
-
 
221
        i8042_init(kbd, IRQ_KBD, mouse, IRQ_MOUSE);
214
#endif
222
#endif
215
        thread_t *t;
223
        thread_t *t;
216
        t = thread_create(i8042_kkbdpoll, NULL, TASK, 0, "kkbdpoll", true);
224
        t = thread_create(i8042_kkbdpoll, NULL, TASK, 0, "kkbdpoll", true);
217
        if (!t)
225
        if (!t)
218
            panic("cannot create kkbdpoll\n");
226
            panic("cannot create kkbdpoll\n");
Line 278... Line 286...
278
void arch_grab_console(void)
286
void arch_grab_console(void)
279
{
287
{
280
#ifdef SKI
288
#ifdef SKI
281
    ski_kbd_grab();
289
    ski_kbd_grab();
282
#else
290
#else
283
    i8042_grab();
-
 
284
    #ifdef CONFIG_NS16550
291
    #ifdef CONFIG_NS16550
285
        ns16550_grab();
292
        ns16550_grab();
-
 
293
    #else
-
 
294
        i8042_grab();
286
    #endif  
295
    #endif  
287
       
-
 
288
#endif  
296
#endif  
289
}
297
}
290
/** Return console to userspace
298
/** Return console to userspace
291
 *
299
 *
292
 */
300
 */
293
void arch_release_console(void)
301
void arch_release_console(void)
294
{
302
{
295
#ifdef SKI
303
#ifdef SKI
296
    ski_kbd_release();
304
    ski_kbd_release();
297
    i8042_release();
-
 
298
#else   
305
#else   
299
    #ifdef CONFIG_NS16550
306
    #ifdef CONFIG_NS16550
300
        ns16550_release();
307
        ns16550_release();
-
 
308
    #else   
-
 
309
        i8042_release();
301
    #endif  
310
    #endif  
302
 
311
 
303
#endif
312
#endif
304
}
313
}
305
 
314