Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 214ec25c in mainline


Ignore:
Timestamp:
2010-06-11T16:07:21Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
b584cd4
Parents:
b3b7e14
Message:

use unsigned integers for exception and interrupt numbers

Location:
kernel
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/include/mm/page.h

    rb3b7e14 r214ec25c  
    170170
    171171extern void page_arch_init(void);
    172 extern void page_fault(int, istate_t *);
     172extern void page_fault(unsigned int, istate_t *);
    173173
    174174#endif /* KERNEL */
  • kernel/arch/abs32le/src/mm/page.c

    rb3b7e14 r214ec25c  
    6262}
    6363
    64 void page_fault(int n __attribute__((unused)), istate_t *istate)
     64void page_fault(unsigned int n __attribute__((unused)), istate_t *istate)
    6565{
    6666}
  • kernel/arch/amd64/include/interrupt.h

    rb3b7e14 r214ec25c  
    116116extern void trap_virtual_enable_irqs(uint16_t irqmask);
    117117extern void trap_virtual_disable_irqs(uint16_t irqmask);
     118
    118119/* AMD64 - specific page handler */
    119 extern void ident_page_fault(int n, istate_t *istate);
     120extern void ident_page_fault(unsigned int, istate_t *);
    120121
    121122#endif
  • kernel/arch/amd64/include/mm/page.h

    rb3b7e14 r214ec25c  
    234234
    235235extern void page_arch_init(void);
    236 extern void page_fault(int n, istate_t *istate);
     236extern void page_fault(unsigned int, istate_t *);
    237237
    238238#endif /* __ASM__ */
  • kernel/arch/amd64/src/debugger.c

    rb3b7e14 r214ec25c  
    268268}
    269269
    270 static void debug_exception(int n __attribute__((unused)), istate_t *istate)
     270static void debug_exception(unsigned int n __attribute__((unused)), istate_t *istate)
    271271{
    272272        /* Set RF to restart the instruction  */
     
    293293
    294294#ifdef CONFIG_SMP
    295 static void debug_ipi(int n __attribute__((unused)),
     295static void debug_ipi(unsigned int n __attribute__((unused)),
    296296    istate_t *istate __attribute__((unused)))
    297297{
  • kernel/arch/amd64/src/interrupt.c

    rb3b7e14 r214ec25c  
    9292}
    9393
    94 static void null_interrupt(int n, istate_t *istate)
    95 {
    96         fault_if_from_uspace(istate, "Unserviced interrupt: %d.", n);
     94static void null_interrupt(unsigned int n, istate_t *istate)
     95{
     96        fault_if_from_uspace(istate, "Unserviced interrupt: %u.", n);
    9797        decode_istate(n, istate);
    9898        panic("Unserviced interrupt.");
    9999}
    100100
    101 static void de_fault(int n, istate_t *istate)
     101static void de_fault(unsigned int n, istate_t *istate)
    102102{
    103103        fault_if_from_uspace(istate, "Divide error.");
     
    109109 *
    110110 */
    111 static void gp_fault(int n, istate_t *istate)
     111static void gp_fault(unsigned int n, istate_t *istate)
    112112{
    113113        if (TASK) {
     
    134134}
    135135
    136 static void ss_fault(int n, istate_t *istate)
     136static void ss_fault(unsigned int n, istate_t *istate)
    137137{
    138138        fault_if_from_uspace(istate, "Stack fault.");
     
    141141}
    142142
    143 static void nm_fault(int n, istate_t *istate)
     143static void nm_fault(unsigned int n, istate_t *istate)
    144144{
    145145#ifdef CONFIG_FPU_LAZY
     
    152152
    153153#ifdef CONFIG_SMP
    154 static void tlb_shootdown_ipi(int n, istate_t *istate)
     154static void tlb_shootdown_ipi(unsigned int n, istate_t *istate)
    155155{
    156156        trap_virtual_eoi();
     
    162162 *
    163163 */
    164 static void irq_interrupt(int n, istate_t *istate)
     164static void irq_interrupt(unsigned int n, istate_t *istate)
    165165{
    166166        ASSERT(n >= IVT_IRQBASE);
    167167       
    168         int inum = n - IVT_IRQBASE;
     168        unsigned int inum = n - IVT_IRQBASE;
    169169        bool ack = false;
    170170        ASSERT(inum < IRQ_COUNT);
     
    189189                 */
    190190#ifdef CONFIG_DEBUG
    191                 printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, inum);
     191                printf("cpu%u: spurious interrupt (inum=%u)\n", CPU->id, inum);
    192192#endif
    193193        }
  • kernel/arch/amd64/src/mm/page.c

    rb3b7e14 r214ec25c  
    129129 * items.
    130130 */
    131 void ident_page_fault(int n, istate_t *istate)
     131void ident_page_fault(unsigned int n, istate_t *istate)
    132132{
    133133        uintptr_t page;
     
    177177
    178178
    179 void page_fault(int n, istate_t *istate)
     179void page_fault(unsigned int n, istate_t *istate)
    180180{
    181181        uintptr_t page;
  • kernel/arch/arm32/include/mach/integratorcp/integratorcp.h

    rb3b7e14 r214ec25c  
    102102extern void icp_timer_irq_start(void);
    103103extern void icp_cpu_halt(void);
    104 extern void icp_irq_exception(int exc_no, istate_t *istate);
     104extern void icp_irq_exception(unsigned int, istate_t *);
    105105extern uintptr_t icp_get_memory_size(void);
    106106extern void icp_frame_init(void);
  • kernel/arch/arm32/include/mach/testarm/testarm.h

    rb3b7e14 r214ec25c  
    7272extern void gxemul_timer_irq_start(void);
    7373extern void gxemul_cpu_halt(void);
    74 extern void gxemul_irq_exception(int exc_no, istate_t *istate);
     74extern void gxemul_irq_exception(unsigned int, istate_t *);
    7575extern uintptr_t gxemul_get_memory_size(void);
    7676extern void gxemul_frame_init(void);
  • kernel/arch/arm32/include/machine_func.h

    rb3b7e14 r214ec25c  
    5353        void            (*machine_cpu_halt)(void);
    5454        uintptr_t       (*machine_get_memory_size)(void);
    55         void            (*machine_irq_exception)(int, istate_t*);
     55        void            (*machine_irq_exception)(unsigned int, istate_t*);
    5656        void            (*machine_frame_init)(void);
    5757        void            (*machine_output_init)(void);
     
    8686 * @param istate Saved processor state.
    8787 */
    88 extern void machine_irq_exception(int exc_no, istate_t *istate);
     88extern void machine_irq_exception(unsigned int exc_no, istate_t *istate);
    8989
    9090
  • kernel/arch/arm32/include/mm/page_fault.h

    rb3b7e14 r214ec25c  
    8181} instruction_union_t;
    8282
    83 extern void prefetch_abort(int n, istate_t *istate);
    84 extern void data_abort(int n, istate_t *istate);
     83extern void prefetch_abort(unsigned int, istate_t *);
     84extern void data_abort(unsigned int, istate_t *);
    8585
    8686#endif
  • kernel/arch/arm32/src/exception.c

    rb3b7e14 r214ec25c  
    9191 *
    9292 * Dispatches the syscall.
    93  */
    94 static void swi_exception(int exc_no, istate_t *istate)
     93 *
     94 */
     95static void swi_exception(unsigned int exc_no, istate_t *istate)
    9596{
    9697        istate->r0 = syscall_handler(istate->r0, istate->r1, istate->r2,
     
    148149 * Determines the sources of interrupt and calls their handlers.
    149150 */
    150 static void irq_exception(int exc_no, istate_t *istate)
     151static void irq_exception(unsigned int exc_no, istate_t *istate)
    151152{
    152153        machine_irq_exception(exc_no, istate);
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    rb3b7e14 r214ec25c  
    242242 * @param istate Saved processor state.
    243243 */
    244 void icp_irq_exception(int exc_no, istate_t *istate)
     244void icp_irq_exception(unsigned int exc_no, istate_t *istate)
    245245{
    246246        uint32_t sources = icp_irqc_get_sources();
    247         int i;
     247        unsigned int i;
    248248       
    249249        for (i = 0; i < ICP_IRQC_MAX_IRQ; i++) {
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    rb3b7e14 r214ec25c  
    205205 * Determines the sources of interrupt and calls their handlers.
    206206 */
    207 void gxemul_irq_exception(int exc_no, istate_t *istate)
     207void gxemul_irq_exception(unsigned int exc_no, istate_t *istate)
    208208{
    209209        uint32_t sources = gxemul_irqc_get_sources();
  • kernel/arch/arm32/src/machine_func.c

    rb3b7e14 r214ec25c  
    7676 * @param istate Saved processor state.
    7777 */
    78 void machine_irq_exception(int exc_no, istate_t *istate)
     78void machine_irq_exception(unsigned int exc_no, istate_t *istate)
    7979{
    8080        (machine_ops.machine_irq_exception)(exc_no, istate);
  • kernel/arch/arm32/src/mm/page_fault.c

    rb3b7e14 r214ec25c  
    167167/** Handles "data abort" exception (load or store at invalid address).
    168168 *
    169  * @param exc_no        Exception number.
    170  * @param istate        CPU state when exception occured.
    171  */
    172 void data_abort(int exc_no, istate_t *istate)
     169 * @param exc_no Exception number.
     170 * @param istate CPU state when exception occured.
     171 *
     172 */
     173void data_abort(unsigned int exc_no, istate_t *istate)
    173174{
    174175        fault_status_t fsr __attribute__ ((unused)) =
     
    193194/** Handles "prefetch abort" exception (instruction couldn't be executed).
    194195 *
    195  * @param exc_no        Exception number.
    196  * @param istate        CPU state when exception occured.
    197  */
    198 void prefetch_abort(int exc_no, istate_t *istate)
     196 * @param exc_no Exception number.
     197 * @param istate CPU state when exception occured.
     198 *
     199 */
     200void prefetch_abort(unsigned int exc_no, istate_t *istate)
    199201{
    200202        int ret = as_page_fault(istate->pc, PF_ACCESS_EXEC, istate);
  • kernel/arch/ia32/include/mm/page.h

    rb3b7e14 r214ec25c  
    192192
    193193extern void page_arch_init(void);
    194 extern void page_fault(int n, istate_t *istate);
     194extern void page_fault(unsigned int, istate_t *);
    195195
    196196#endif /* __ASM__ */
  • kernel/arch/ia32/src/drivers/i8259.c

    rb3b7e14 r214ec25c  
    4545#include <interrupt.h>
    4646
    47 static void pic_spurious(int n, istate_t *istate);
     47static void pic_spurious(unsigned int n, istate_t *istate);
    4848
    4949void i8259_init(void)
     
    125125}
    126126
    127 void pic_spurious(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
     127void pic_spurious(unsigned int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
    128128{
    129129#ifdef CONFIG_DEBUG
  • kernel/arch/ia32/src/interrupt.c

    rb3b7e14 r214ec25c  
    9191}
    9292
    93 static void null_interrupt(int n, istate_t *istate)
    94 {
    95         fault_if_from_uspace(istate, "Unserviced interrupt: %d.", n);
    96        
    97         decode_istate(istate);
    98         panic("Unserviced interrupt: %d.", n);
    99 }
    100 
    101 static void de_fault(int n, istate_t *istate)
     93static void null_interrupt(unsigned int n, istate_t *istate)
     94{
     95        fault_if_from_uspace(istate, "Unserviced interrupt: %u.", n);
     96       
     97        decode_istate(istate);
     98        panic("Unserviced interrupt: %u.", n);
     99}
     100
     101static void de_fault(unsigned int n, istate_t *istate)
    102102{
    103103        fault_if_from_uspace(istate, "Divide error.");
     
    108108
    109109/** General Protection Fault. */
    110 static void gp_fault(int n __attribute__((unused)), istate_t *istate)
     110static void gp_fault(unsigned int n __attribute__((unused)), istate_t *istate)
    111111{
    112112        if (TASK) {
     
    133133}
    134134
    135 static void ss_fault(int n __attribute__((unused)), istate_t *istate)
     135static void ss_fault(unsigned int n __attribute__((unused)), istate_t *istate)
    136136{
    137137        fault_if_from_uspace(istate, "Stack fault.");
     
    141141}
    142142
    143 static void simd_fp_exception(int n __attribute__((unused)), istate_t *istate)
     143static void simd_fp_exception(unsigned int n __attribute__((unused)), istate_t *istate)
    144144{
    145145        uint32_t mxcsr;
     
    157157}
    158158
    159 static void nm_fault(int n __attribute__((unused)),
     159static void nm_fault(unsigned int n __attribute__((unused)),
    160160    istate_t *istate __attribute__((unused)))
    161161{
     
    169169
    170170#ifdef CONFIG_SMP
    171 static void tlb_shootdown_ipi(int n __attribute__((unused)),
     171static void tlb_shootdown_ipi(unsigned int n __attribute__((unused)),
    172172    istate_t *istate __attribute__((unused)))
    173173{
     
    178178
    179179/** Handler of IRQ exceptions */
    180 static void irq_interrupt(int n, istate_t *istate __attribute__((unused)))
     180static void irq_interrupt(unsigned int n, istate_t *istate __attribute__((unused)))
    181181{
    182182        ASSERT(n >= IVT_IRQBASE);
    183183       
    184         int inum = n - IVT_IRQBASE;
     184        unsigned int inum = n - IVT_IRQBASE;
    185185        bool ack = false;
    186186        ASSERT(inum < IRQ_COUNT);
     
    205205                 */
    206206#ifdef CONFIG_DEBUG
    207                 printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, inum);
     207                printf("cpu%u: spurious interrupt (inum=%u)\n", CPU->id, inum);
    208208#endif
    209209        }
  • kernel/arch/ia32/src/mm/page.c

    rb3b7e14 r214ec25c  
    9898}
    9999
    100 void page_fault(int n __attribute__((unused)), istate_t *istate)
     100void page_fault(unsigned int n __attribute__((unused)), istate_t *istate)
    101101{
    102102        uintptr_t page;
  • kernel/arch/ia32/src/smp/apic.c

    rb3b7e14 r214ec25c  
    129129 *
    130130 */
    131 static void apic_spurious(int n __attribute__((unused)),
     131static void apic_spurious(unsigned int n __attribute__((unused)),
    132132    istate_t *istate __attribute__((unused)))
    133133{
  • kernel/arch/mips32/src/exception.c

    rb3b7e14 r214ec25c  
    7979}
    8080
    81 static void unhandled_exception(int n, istate_t *istate)
     81static void unhandled_exception(unsigned int n, istate_t *istate)
    8282{
    8383        fault_if_from_uspace(istate, "Unhandled exception %s.", exctable[n]);
     
    8787}
    8888
    89 static void reserved_instr_exception(int n, istate_t *istate)
     89static void reserved_instr_exception(unsigned int n, istate_t *istate)
    9090{
    9191        if (*((uint32_t *) istate->epc) == 0x7c03e83b) {
     
    9797}
    9898
    99 static void breakpoint_exception(int n, istate_t *istate)
     99static void breakpoint_exception(unsigned int n, istate_t *istate)
    100100{
    101101#ifdef CONFIG_DEBUG
     
    109109}
    110110
    111 static void tlbmod_exception(int n, istate_t *istate)
     111static void tlbmod_exception(unsigned int n, istate_t *istate)
    112112{
    113113        tlb_modified(istate);
    114114}
    115115
    116 static void tlbinv_exception(int n, istate_t *istate)
     116static void tlbinv_exception(unsigned int n, istate_t *istate)
    117117{
    118118        tlb_invalid(istate);
     
    120120
    121121#ifdef CONFIG_FPU_LAZY
    122 static void cpuns_exception(int n, istate_t *istate)
     122static void cpuns_exception(unsigned int n, istate_t *istate)
    123123{
    124124        if (cp0_cause_coperr(cp0_cause_read()) == fpu_cop_id)
     
    131131#endif
    132132
    133 static void interrupt_exception(int n, istate_t *istate)
     133static void interrupt_exception(unsigned int n, istate_t *istate)
    134134{
    135135        /* Decode interrupt number and process the interrupt */
     
    151151                                 */
    152152#ifdef CONFIG_DEBUG
    153                                 printf("cpu%u: spurious interrupt (inum=%d)\n",
     153                                printf("cpu%u: spurious interrupt (inum=%u)\n",
    154154                                    CPU->id, i);
    155155#endif
     
    160160
    161161/** Handle syscall userspace call */
    162 static void syscall_exception(int n, istate_t *istate)
     162static void syscall_exception(unsigned int n, istate_t *istate)
    163163{
    164164        panic("Syscall is handled through shortcut.");
  • kernel/arch/sparc64/src/trap/interrupt.c

    rb3b7e14 r214ec25c  
    5858void interrupt_register(unsigned int n, const char *name, iroutine_t handler)
    5959{
    60         ASSERT(n >= IVT_FIRST && n <= IVT_ITEMS);
     60        ASSERT(n >= IVT_FIRST);
     61        ASSERT(n <= IVT_ITEMS);
    6162       
    6263        exc_register(n - IVT_FIRST, name, true, handler);
  • kernel/generic/include/interrupt.h

    rb3b7e14 r214ec25c  
    4444#include <stacktrace.h>
    4545
    46 typedef void (* iroutine_t)(int, istate_t *);
     46typedef void (* iroutine_t)(unsigned int, istate_t *);
    4747
    4848typedef struct {
  • kernel/generic/src/interrupt/interrupt.c

    rb3b7e14 r214ec25c  
    144144 *
    145145 */
    146 static void exc_undef(int n, istate_t *istate)
    147 {
    148         fault_if_from_uspace(istate, "Unhandled exception %d.", n);
    149         panic("Unhandled exception %d.", n);
     146static void exc_undef(unsigned int n, istate_t *istate)
     147{
     148        fault_if_from_uspace(istate, "Unhandled exception %u.", n);
     149        panic("Unhandled exception %u.", n);
    150150}
    151151
Note: See TracChangeset for help on using the changeset viewer.