Changeset 0d107f31 in mainline for kernel/genarch


Ignore:
Timestamp:
2006-10-13T20:42:54Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7dcf22a
Parents:
8ce8499
Message:

Prototypical implementation of new IRQ redirector in sparc64.
The new code can support shared IRQs in kernel (and multiple IRQs per device).
Userspace support is yet to be written.
The only architecture that uses this code is actually sparc64 only.

Location:
kernel/genarch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/include/kbd/ns16550.h

    r8ce8499 r0d107f31  
    3939
    4040#include <typedefs.h>
     41#include <irq.h>
    4142
    4243extern void ns16550_init(void);
     
    4546extern void ns16550_release(void);
    4647extern char ns16550_key_read(chardev_t *d);
     48extern irq_ownership_t ns16550_claim(void);
     49extern void ns16550_irq_handler(irq_t *irq, void *arg, ...);
    4750
    4851#endif
  • kernel/genarch/include/kbd/z8530.h

    r8ce8499 r0d107f31  
    3838#define KERN_Z8530_H_
    3939
     40#include <irq.h>
    4041#include <typedefs.h>
    41 
    42 #define Z8530_INTRCV_DATA0      0x39    /* hardcoded for use in Simics */
    4342
    4443extern bool z8530_belongs_to_kernel;
     
    5049extern void z8530_interrupt(void);
    5150extern char z8530_key_read(chardev_t *d);
     51extern irq_ownership_t z8530_claim(void);
     52extern void z8530_irq_handler(irq_t *irq, void *arg, ...);
    5253
    5354#endif
  • kernel/genarch/src/kbd/ns16550.c

    r8ce8499 r0d107f31  
    4040#include <genarch/kbd/scanc_sun.h>
    4141#include <arch/drivers/ns16550.h>
     42#include <irq.h>
    4243#include <arch/interrupt.h>
    4344#include <cpu.h>
     
    161162}
    162163
     164irq_ownership_t ns16550_claim(void)
     165{
     166        /* TODO */
     167        return IRQ_ACCEPT;
     168}
     169
     170void ns16550_irq_handler(irq_t *irq, void *arg, ...)
     171{
     172        panic("Not yet implemented.\n");
     173}
     174
    163175/** @}
    164176 */
  • kernel/genarch/src/kbd/z8530.c

    r8ce8499 r0d107f31  
    4040#include <genarch/kbd/scanc_sun.h>
    4141#include <arch/drivers/z8530.h>
     42#include <irq.h>
    4243#include <arch/interrupt.h>
    4344#include <arch/drivers/kbd.h>
     45#include <arch/drivers/fhc.h>
    4446#include <cpu.h>
    4547#include <arch/asm.h>
     
    170172}
    171173
     174irq_ownership_t z8530_claim(void)
     175{
     176        return (z8530_read_a(RR0) & RR0_RCA);
     177}
     178
     179void z8530_irq_handler(irq_t *irq, void *arg, ...)
     180{
     181        /*
     182         * So far, we know we got this interrupt through the FHC.
     183         * Since we don't have enough information about the FHC and
     184         * because the interrupt looks like level sensitive,
     185         * we cannot handle it by scheduling one of the level
     186         * interrupt traps. Process the interrupt directly.
     187         */
     188        if (z8530_belongs_to_kernel)
     189                z8530_interrupt();
     190        else
     191                ipc_irq_send_notif(0);
     192        fhc_clear_interrupt(central_fhc, irq->inr);
     193}
     194
    172195/** @}
    173196 */
Note: See TracChangeset for help on using the changeset viewer.