aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/i8259.c
diff options
context:
space:
mode:
authorJacob Pan <jacob.jun.pan@intel.com>2009-11-09 14:24:14 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-19 19:25:17 -0500
commitef3548668c02cc8c3922f4423f32b53e662811c6 (patch)
treec9f2b35d0614185bcecd31c94a564ca7e03ca53f /arch/x86/kernel/i8259.c
parent35f720c5930f689647d51ad77e2a8d6f0abf66c8 (diff)
x86, pic: Introduce legacy_pic abstraction
This patch makes i8259A like legacy programmable interrupt controller code into a driver so that legacy pic functions can be selected at runtime based on platform information, such as HW subarchitecure ID. Default structure of legacy_pic maintains the current code path for x86pc. Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com> LKML-Reference: <43F901BD926A4E43B106BF17856F07559FB80D03@orsmsx508.amr.corp.intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/i8259.c')
-rw-r--r--arch/x86/kernel/i8259.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index df89102bef80..b80987ca33ea 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -358,3 +358,46 @@ void init_8259A(int auto_eoi)
358 358
359 spin_unlock_irqrestore(&i8259A_lock, flags); 359 spin_unlock_irqrestore(&i8259A_lock, flags);
360} 360}
361/*
362 * make i8259 a driver so that we can select pic functions at run time. the goal
363 * is to make x86 binary compatible among pc compatible and non-pc compatible
364 * platforms, such as x86 MID.
365 */
366
367static void __init legacy_pic_noop(void) { };
368static void __init legacy_pic_uint_noop(unsigned int unused) { };
369static void __init legacy_pic_int_noop(int unused) { };
370
371static struct irq_chip dummy_pic_chip = {
372 .name = "dummy pic",
373 .mask = legacy_pic_uint_noop,
374 .unmask = legacy_pic_uint_noop,
375 .disable = legacy_pic_uint_noop,
376 .mask_ack = legacy_pic_uint_noop,
377};
378static int legacy_pic_irq_pending_noop(unsigned int irq)
379{
380 return 0;
381}
382
383struct legacy_pic null_legacy_pic = {
384 .nr_legacy_irqs = 0,
385 .chip = &dummy_pic_chip,
386 .mask_all = legacy_pic_noop,
387 .restore_mask = legacy_pic_noop,
388 .init = legacy_pic_int_noop,
389 .irq_pending = legacy_pic_irq_pending_noop,
390 .make_irq = legacy_pic_uint_noop,
391};
392
393struct legacy_pic default_legacy_pic = {
394 .nr_legacy_irqs = NR_IRQS_LEGACY,
395 .chip = &i8259A_chip,
396 .mask_all = mask_8259A,
397 .restore_mask = unmask_8259A,
398 .init = init_8259A,
399 .irq_pending = i8259A_irq_pending,
400 .make_irq = make_8259A_irq,
401};
402
403struct legacy_pic *legacy_pic = &default_legacy_pic;