Changeset 0e796cc in mainline


Ignore:
Timestamp:
2010-07-15T09:01:49Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
41ce4d9
Parents:
bd11d3e
Message:

Allow different number of IRQs for each arm machine.

Location:
kernel/arch/arm32
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/mach/gta02/gta02.h

    rbd11d3e r0e796cc  
    4343extern struct arm_machine_ops gta02_machine_ops;
    4444
     45/** Size of GTA02 IRQ number range (starting from 0) */
     46#define GTA02_IRQ_COUNT 32
     47
    4548#endif
    4649
  • kernel/arch/arm32/include/mach/integratorcp/integratorcp.h

    rbd11d3e r0e796cc  
    108108extern struct arm_machine_ops icp_machine_ops;
    109109
     110/** Size of IntegratorCP IRQ number range (starting from 0) */
     111#define ICP_IRQ_COUNT 8
     112
    110113#endif
    111114
  • kernel/arch/arm32/include/mach/testarm/testarm.h

    rbd11d3e r0e796cc  
    4242#include <arch/machine_func.h>
    4343
    44 /** Last interrupt number (beginning from 0) whose status is probed
    45  * from interrupt controller
    46  */
    47 #define GXEMUL_IRQC_MAX_IRQ  8
    48 #define GXEMUL_KBD_IRQ       2
    49 #define GXEMUL_TIMER_IRQ     4
     44/** Size of GXemul IRQ number range (starting from 0) */
     45#define GXEMUL_IRQ_COUNT        32
     46#define GXEMUL_KBD_IRQ          2
     47#define GXEMUL_TIMER_IRQ        4
    5048
    5149/** Timer frequency */
  • kernel/arch/arm32/include/machine_func.h

    rbd11d3e r0e796cc  
    104104extern void machine_input_init(void);
    105105
     106extern size_t machine_get_irq_count(void);
     107
    106108#endif
    107109
  • kernel/arch/arm32/src/interrupt.c

    rbd11d3e r0e796cc  
    4040#include <ddi/device.h>
    4141#include <interrupt.h>
    42 
    43 /** Initial size of a table holding interrupt handlers. */
    44 #define IRQ_COUNT 8
    4542
    4643/** Disable interrupts.
     
    105102void interrupt_init(void)
    106103{
    107         irq_init(IRQ_COUNT, IRQ_COUNT);
     104        size_t irq_count;
     105
     106        irq_count = machine_get_irq_count();
     107        irq_init(irq_count, irq_count);
     108
    108109        machine_timer_irq_start();
    109110}
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    rbd11d3e r0e796cc  
    211211        unsigned int i;
    212212
    213         for (i = 0; i < GXEMUL_IRQC_MAX_IRQ; i++) {
     213        for (i = 0; i < GXEMUL_IRQ_COUNT; i++) {
    214214                if (sources & (1 << i)) {
    215215                        irq_t *irq = irq_dispatch_and_lock(i);
  • kernel/arch/arm32/src/machine_func.c

    rbd11d3e r0e796cc  
    125125}
    126126
     127/** Get IRQ number range used by machine. */
     128size_t machine_get_irq_count(void)
     129{
     130        size_t irq_count;
     131 
     132#if defined(MACHINE_gta02)
     133        irq_count = GTA02_IRQ_COUNT;
     134#elif defined(MACHINE_testarm)
     135        irq_count = GXEMUL_IRQ_COUNT;
     136#elif defined(MACHINE_integratorcp)
     137        irq_count = ICP_IRQ_COUNT;
     138#else
     139#error Machine type not defined.
     140#endif
     141        return irq_count;
     142}
     143
    127144/** @}
    128145 */
Note: See TracChangeset for help on using the changeset viewer.