Changeset 982f0fe in mainline


Ignore:
Timestamp:
2006-06-01T10:21:00Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd571f44
Parents:
80d31883
Message:

Added ability to process external interrupts to ppc.

Location:
arch/ppc32
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc32/Makefile.inc

    r80d31883 r982f0fe  
    7979        arch/$(ARCH)/src/mm/memory_init.c \
    8080        arch/$(ARCH)/src/mm/page.c \
    81         arch/$(ARCH)/src/mm/tlb.c
     81        arch/$(ARCH)/src/mm/tlb.c \
     82        arch/$(ARCH)/src/drivers/pic.c
  • arch/ppc32/include/drivers/cuda.h

    r80d31883 r982f0fe  
    3232#include <arch/types.h>
    3333
     34#define CUDA_IRQ 10
     35
    3436extern void cuda_init(void);
    3537extern void cuda_packet(const __u8 data);
  • arch/ppc32/include/interrupt.h

    r80d31883 r982f0fe  
    3232#include <arch/exception.h>
    3333
    34 #define IRQ_COUNT       1
    35 #define IVT_ITEMS   15
    36 #define INT_OFFSET  0
     34#define IRQ_COUNT       64
     35
     36
     37#define IVT_ITEMS   (16 + IRQ_COUNT)
     38#define INT_OFFSET  16
     39
     40#define int_register(it, name, handler) exc_register(((it)+INT_OFFSET),name,handler)
    3741
    3842#define VECTOR_DECREMENTER 10
     
    4044extern void start_decrementer(void);
    4145extern void interrupt_init(void);
     46extern void extint_handler(int n, istate_t *istate);
    4247
    4348#endif
  • arch/ppc32/src/drivers/cuda.c

    r80d31883 r982f0fe  
    3131#include <console/chardev.h>
    3232#include <console/console.h>
     33#include <arch/drivers/pic.h>
     34#include <interrupt.h>
    3335
    3436#define CUDA_PACKET 0x01
     
    4850static volatile __u8 *cuda = (__u8 *) 0xf2000000;
    4951
     52#include <print.h>
     53static void cuda_irq(int n, istate_t *istate)
     54{
     55        printf("Got cuda msg\n");
     56}
    5057
    5158void cuda_init(void)
    5259{
     60        int_register(CUDA_IRQ, "cuda", cuda_irq);
     61        pic_enable_interrupt(CUDA_IRQ);
    5362}
    5463
  • arch/ppc32/src/exception.S

    r80d31883 r982f0fe  
    186186.global exc_external
    187187exc_external:
    188         b exc_external
     188        CONTEXT_STORE
     189
     190        lis r12, extint_handler@ha
     191        addi r12, r12, extint_handler@l
     192        mtsrr0 r12
     193
     194        li r3, 0
     195        b jump_to_kernel
    189196
    190197.org 0x600
  • arch/ppc32/src/interrupt.c

    r80d31883 r982f0fe  
    3333#include <time/clock.h>
    3434#include <ipc/sysipc.h>
     35#include <arch/drivers/pic.h>
    3536
    3637
     
    6566        /* TODO */
    6667}
     68
     69#include <print.h>
     70/** Handler of externul interrupts */
     71void extint_handler(int n, istate_t *istate)
     72{
     73        int inum;
     74
     75        while ((inum = pic_get_pending()) != -1) {
     76                exc_dispatch(inum+INT_OFFSET, istate);
     77                pic_ack_interrupt(inum);
     78        }
     79}
  • arch/ppc32/src/ppc32.c

    r80d31883 r982f0fe  
    3636#include <proc/uarg.h>
    3737#include <console/console.h>
     38#include <arch/drivers/pic.h>
    3839
    3940bootinfo_t bootinfo;
     
    5657        /* Initialize dispatch table */
    5758        interrupt_init();
    58        
     59
    5960        /* Start decrementer */
    6061        start_decrementer();
    61         cuda_init();
    6262}
    6363
     
    6767                fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline);   
    6868       
     69                /* Initialize PIC */
     70                pic_init();
     71       
     72                cuda_init();
    6973                /* Merge all zones to 1 big zone */
    7074                zone_merge_all();
Note: See TracChangeset for help on using the changeset viewer.