From 02463fb461904c264e5d559f6ec1de92cf35e436 Mon Sep 17 00:00:00 2001 From: X512 Date: Wed, 6 Mar 2024 01:45:48 +0900 Subject: [PATCH] kernel/int: consolidate interrupt vector number to `int32` This is no-op for 32 bit platforms because `int32` is defined as `long` there. Change interrupt vector number from 64 bits to 32 bits for 64 bit platforms. Change-Id: I52d1ad616cab16488804e9733c7afaf772a670ba Reviewed-on: https://review.haiku-os.org/c/haiku/+/7507 Tested-by: Commit checker robot Reviewed-by: Alex von Gluck IV --- headers/os/drivers/KernelExport.h | 6 +-- headers/private/kernel/arch/int.h | 6 +-- headers/private/kernel/arch/x86/arch_int.h | 2 +- headers/private/kernel/int.h | 8 ++-- .../busses/pci/designware/DWPCIController.h | 2 +- .../pci/designware/MsiInterruptCtrlDW.cpp | 2 +- src/system/kernel/arch/arm/arch_int.cpp | 8 ++-- src/system/kernel/arch/arm/arch_int_gicv2.cpp | 4 +- src/system/kernel/arch/arm/arch_int_gicv2.h | 4 +- src/system/kernel/arch/arm/soc.h | 4 +- src/system/kernel/arch/arm/soc_omap3.cpp | 4 +- src/system/kernel/arch/arm/soc_omap3.h | 4 +- src/system/kernel/arch/arm/soc_pxa.cpp | 4 +- src/system/kernel/arch/arm/soc_pxa.h | 4 +- src/system/kernel/arch/arm/soc_sun4i.cpp | 2 +- src/system/kernel/arch/arm/soc_sun4i.h | 4 +- src/system/kernel/arch/arm64/arch_int.cpp | 4 +- src/system/kernel/arch/m68k/arch_int.cpp | 4 +- src/system/kernel/arch/mips/arch_int.cpp | 6 +-- src/system/kernel/arch/ppc/arch_int.cpp | 4 +- src/system/kernel/arch/riscv64/arch_int.cpp | 8 ++-- src/system/kernel/arch/sparc/arch_int.cpp | 4 +- src/system/kernel/arch/x86/arch_int.cpp | 8 ++-- src/system/kernel/arch/x86/msi.cpp | 2 +- src/system/kernel/int.cpp | 48 +++++++++---------- .../kernel/platform/atari_m68k/platform.cpp | 30 ++++++------ 26 files changed, 93 insertions(+), 93 deletions(-) mode change 100755 => 100644 src/system/kernel/arch/mips/arch_int.cpp diff --git a/headers/os/drivers/KernelExport.h b/headers/os/drivers/KernelExport.h index d767b4ade1..c9dcd4e320 100644 --- a/headers/os/drivers/KernelExport.h +++ b/headers/os/drivers/KernelExport.h @@ -168,9 +168,9 @@ extern void release_write_seqlock(seqlock* lock); extern uint32 acquire_read_seqlock(seqlock* lock); extern bool release_read_seqlock(seqlock* lock, uint32 count); -extern status_t install_io_interrupt_handler(long interrupt_number, - interrupt_handler handler, void *data, ulong flags); -extern status_t remove_io_interrupt_handler(long interrupt_number, +extern status_t install_io_interrupt_handler(int32 interrupt_number, + interrupt_handler handler, void *data, uint32 flags); +extern status_t remove_io_interrupt_handler(int32 interrupt_number, interrupt_handler handler, void *data); extern status_t add_timer(timer *t, timer_hook hook, bigtime_t period, diff --git a/headers/private/kernel/arch/int.h b/headers/private/kernel/arch/int.h index 0bfd94febb..b8e99858a3 100644 --- a/headers/private/kernel/arch/int.h +++ b/headers/private/kernel/arch/int.h @@ -30,9 +30,9 @@ status_t arch_int_init_post_device_manager(struct kernel_args* args); void arch_int_enable_interrupts(void); int arch_int_disable_interrupts(void); void arch_int_restore_interrupts(int oldState); -void arch_int_enable_io_interrupt(int irq); -void arch_int_disable_io_interrupt(int irq); -void arch_int_configure_io_interrupt(int irq, uint32 config); +void arch_int_enable_io_interrupt(int32 irq); +void arch_int_disable_io_interrupt(int32 irq); +void arch_int_configure_io_interrupt(int32 irq, uint32 config); bool arch_int_are_interrupts_enabled(void); int32 arch_int_assign_to_cpu(int32 irq, int32 cpu); diff --git a/headers/private/kernel/arch/x86/arch_int.h b/headers/private/kernel/arch/x86/arch_int.h index 5748a1da0a..27d0e8fc68 100644 --- a/headers/private/kernel/arch/x86/arch_int.h +++ b/headers/private/kernel/arch/x86/arch_int.h @@ -79,7 +79,7 @@ typedef struct interrupt_controller_s { } interrupt_controller; -void x86_set_irq_source(int irq, irq_source source); +void x86_set_irq_source(int32 irq, irq_source source); void arch_int_set_interrupt_controller(const interrupt_controller &controller); diff --git a/headers/private/kernel/int.h b/headers/private/kernel/int.h index 91608a4782..5f2cdf41b7 100644 --- a/headers/private/kernel/int.h +++ b/headers/private/kernel/int.h @@ -77,12 +77,12 @@ are_interrupts_enabled(void) #define restore_interrupts(status) arch_int_restore_interrupts(status) -status_t reserve_io_interrupt_vectors(long count, long startVector, +status_t reserve_io_interrupt_vectors(int32 count, int32 startVector, enum interrupt_type type); -status_t allocate_io_interrupt_vectors(long count, long *startVector, +status_t allocate_io_interrupt_vectors(int32 count, int32 *startVector, enum interrupt_type type); -void free_io_interrupt_vectors(long count, long startVector); +void free_io_interrupt_vectors(int32 count, int32 startVector); -void assign_io_interrupt_to_cpu(long vector, int32 cpu); +void assign_io_interrupt_to_cpu(int32 vector, int32 cpu); #endif /* _KERNEL_INT_H */ diff --git a/src/add-ons/kernel/busses/pci/designware/DWPCIController.h b/src/add-ons/kernel/busses/pci/designware/DWPCIController.h index c61934e69e..c284f85b50 100644 --- a/src/add-ons/kernel/busses/pci/designware/DWPCIController.h +++ b/src/add-ons/kernel/busses/pci/designware/DWPCIController.h @@ -179,7 +179,7 @@ private: uint32 fAllocatedMsiIrqs[1]; phys_addr_t fMsiPhysAddr {}; - long fMsiStartIrq {}; + int32 fMsiStartIrq {}; uint64 fMsiData {}; }; diff --git a/src/add-ons/kernel/busses/pci/designware/MsiInterruptCtrlDW.cpp b/src/add-ons/kernel/busses/pci/designware/MsiInterruptCtrlDW.cpp index 9b29f619ae..2457ba115a 100644 --- a/src/add-ons/kernel/busses/pci/designware/MsiInterruptCtrlDW.cpp +++ b/src/add-ons/kernel/busses/pci/designware/MsiInterruptCtrlDW.cpp @@ -46,7 +46,7 @@ MsiInterruptCtrlDW::Init(PciDbiRegs volatile* dbiRegs, int32 msiIrq) msi_set_interface(static_cast(this)); - dprintf(" fMsiStartIrq: %ld\n", fMsiStartIrq); + dprintf(" fMsiStartIrq: %" B_PRId32 "\n", fMsiStartIrq); return B_OK; } diff --git a/src/system/kernel/arch/arm/arch_int.cpp b/src/system/kernel/arch/arm/arch_int.cpp index 91f4434507..bd6c2fe8cb 100644 --- a/src/system/kernel/arch/arm/arch_int.cpp +++ b/src/system/kernel/arch/arm/arch_int.cpp @@ -70,9 +70,9 @@ struct iframe_stack gBootFrameStack; void -arch_int_enable_io_interrupt(int irq) +arch_int_enable_io_interrupt(int32 irq) { - TRACE("arch_int_enable_io_interrupt(%d)\n", irq); + TRACE("arch_int_enable_io_interrupt(%" B_PRId32 ")\n", irq); InterruptController *ic = InterruptController::Get(); if (ic != NULL) ic->EnableInterrupt(irq); @@ -80,9 +80,9 @@ arch_int_enable_io_interrupt(int irq) void -arch_int_disable_io_interrupt(int irq) +arch_int_disable_io_interrupt(int32 irq) { - TRACE("arch_int_disable_io_interrupt(%d)\n", irq); + TRACE("arch_int_disable_io_interrupt(%" B_PRId32 ")\n", irq); InterruptController *ic = InterruptController::Get(); if (ic != NULL) ic->DisableInterrupt(irq); diff --git a/src/system/kernel/arch/arm/arch_int_gicv2.cpp b/src/system/kernel/arch/arm/arch_int_gicv2.cpp index de925fcce4..fe87d82c87 100644 --- a/src/system/kernel/arch/arm/arch_int_gicv2.cpp +++ b/src/system/kernel/arch/arm/arch_int_gicv2.cpp @@ -54,7 +54,7 @@ GICv2InterruptController::GICv2InterruptController(uint32_t gicd_addr, uint32_t } -void GICv2InterruptController::EnableInterrupt(int irq) +void GICv2InterruptController::EnableInterrupt(int32 irq) { uint32_t ena_reg = GICD_REG_ISENABLER + irq / 32; uint32_t ena_val = 1 << (irq % 32); @@ -67,7 +67,7 @@ void GICv2InterruptController::EnableInterrupt(int irq) } -void GICv2InterruptController::DisableInterrupt(int irq) +void GICv2InterruptController::DisableInterrupt(int32 irq) { fGicdRegs[GICD_REG_ICENABLER + irq / 32] = 1 << (irq % 32); } diff --git a/src/system/kernel/arch/arm/arch_int_gicv2.h b/src/system/kernel/arch/arm/arch_int_gicv2.h index 49b57c538a..d257442320 100644 --- a/src/system/kernel/arch/arm/arch_int_gicv2.h +++ b/src/system/kernel/arch/arm/arch_int_gicv2.h @@ -12,8 +12,8 @@ class GICv2InterruptController : public InterruptController { public: GICv2InterruptController(uint32_t gicd_regs = 0, uint32_t gicc_regs = 0); - void EnableInterrupt(int irq); - void DisableInterrupt(int irq); + void EnableInterrupt(int32 irq); + void DisableInterrupt(int32 irq); void HandleInterrupt(); private: volatile uint32_t *fGicdRegs; diff --git a/src/system/kernel/arch/arm/soc.h b/src/system/kernel/arch/arm/soc.h index c3921b1223..4597bf2675 100644 --- a/src/system/kernel/arch/arm/soc.h +++ b/src/system/kernel/arch/arm/soc.h @@ -11,8 +11,8 @@ class InterruptController; class InterruptController { public: - virtual void EnableInterrupt(int irq) = 0; - virtual void DisableInterrupt(int irq) = 0; + virtual void EnableInterrupt(int32 irq) = 0; + virtual void DisableInterrupt(int32 irq) = 0; virtual void HandleInterrupt() = 0; diff --git a/src/system/kernel/arch/arm/soc_omap3.cpp b/src/system/kernel/arch/arm/soc_omap3.cpp index bac68da735..c57bf979f7 100644 --- a/src/system/kernel/arch/arm/soc_omap3.cpp +++ b/src/system/kernel/arch/arm/soc_omap3.cpp @@ -27,7 +27,7 @@ enum { void -OMAP3InterruptController::EnableInterrupt(int irq) +OMAP3InterruptController::EnableInterrupt(int32 irq) { uint32 bit = irq % 32, bank = irq / 32; fRegBase[INTCPS_MIR_CLEARn + (8 * bank)] = 1 << bit; @@ -35,7 +35,7 @@ OMAP3InterruptController::EnableInterrupt(int irq) void -OMAP3InterruptController::DisableInterrupt(int irq) +OMAP3InterruptController::DisableInterrupt(int32 irq) { uint32 bit = irq % 32, bank = irq / 32; fRegBase[INTCPS_MIR_SETn + (8 * bank)] = 1 << bit; diff --git a/src/system/kernel/arch/arm/soc_omap3.h b/src/system/kernel/arch/arm/soc_omap3.h index 5c55ecfd32..aa479ffac9 100644 --- a/src/system/kernel/arch/arm/soc_omap3.h +++ b/src/system/kernel/arch/arm/soc_omap3.h @@ -11,8 +11,8 @@ class OMAP3InterruptController; class OMAP3InterruptController : public InterruptController { public: OMAP3InterruptController(uint32_t reg_base); - void EnableInterrupt(int irq); - void DisableInterrupt(int irq); + void EnableInterrupt(int32 irq); + void DisableInterrupt(int32 irq); void HandleInterrupt(); protected: diff --git a/src/system/kernel/arch/arm/soc_pxa.cpp b/src/system/kernel/arch/arm/soc_pxa.cpp index 657ff56797..18d9c758fe 100644 --- a/src/system/kernel/arch/arm/soc_pxa.cpp +++ b/src/system/kernel/arch/arm/soc_pxa.cpp @@ -9,7 +9,7 @@ #define PXA_ICMR2 0x28 void -PXAInterruptController::EnableInterrupt(int irq) +PXAInterruptController::EnableInterrupt(int32 irq) { if (irq <= 31) { fRegBase[PXA_ICMR] |= 1 << irq; @@ -21,7 +21,7 @@ PXAInterruptController::EnableInterrupt(int irq) void -PXAInterruptController::DisableInterrupt(int irq) +PXAInterruptController::DisableInterrupt(int32 irq) { if (irq <= 31) { fRegBase[PXA_ICMR] &= ~(1 << irq); diff --git a/src/system/kernel/arch/arm/soc_pxa.h b/src/system/kernel/arch/arm/soc_pxa.h index 375d4c173a..e10ec33c53 100644 --- a/src/system/kernel/arch/arm/soc_pxa.h +++ b/src/system/kernel/arch/arm/soc_pxa.h @@ -11,8 +11,8 @@ class PXAInterruptController; class PXAInterruptController : public InterruptController { public: PXAInterruptController(uint32_t reg_base); - void EnableInterrupt(int irq); - void DisableInterrupt(int irq); + void EnableInterrupt(int32 irq); + void DisableInterrupt(int32 irq); void HandleInterrupt(); protected: diff --git a/src/system/kernel/arch/arm/soc_sun4i.cpp b/src/system/kernel/arch/arm/soc_sun4i.cpp index b16f37d60b..3e0739e503 100644 --- a/src/system/kernel/arch/arm/soc_sun4i.cpp +++ b/src/system/kernel/arch/arm/soc_sun4i.cpp @@ -17,7 +17,7 @@ void -Sun4iInterruptController::EnableInterrupt(int irq) +Sun4iInterruptController::EnableInterrupt(int32 irq) { if (irq <= 31) { fRegBase[SUN4I_INTC_MASK_REG0] |= 1 << irq; diff --git a/src/system/kernel/arch/arm/soc_sun4i.h b/src/system/kernel/arch/arm/soc_sun4i.h index 3ad1c99643..9fa32c761b 100644 --- a/src/system/kernel/arch/arm/soc_sun4i.h +++ b/src/system/kernel/arch/arm/soc_sun4i.h @@ -13,8 +13,8 @@ class Sun4iInterruptController : public InterruptController { public: Sun4iInterruptController(uint32_t reg_base); - void EnableInterrupt(int irq); - void DisableInterrupt(int irq); + void EnableInterrupt(int32 irq); + void DisableInterrupt(int32 irq); void HandleInterrupt(); protected: diff --git a/src/system/kernel/arch/arm64/arch_int.cpp b/src/system/kernel/arch/arm64/arch_int.cpp index e8a4be7142..2a13d59104 100644 --- a/src/system/kernel/arch/arm64/arch_int.cpp +++ b/src/system/kernel/arch/arm64/arch_int.cpp @@ -41,7 +41,7 @@ struct iframe_stack gBootFrameStack; void -arch_int_enable_io_interrupt(int irq) +arch_int_enable_io_interrupt(int32 irq) { InterruptController *ic = InterruptController::Get(); if (ic != NULL) @@ -50,7 +50,7 @@ arch_int_enable_io_interrupt(int irq) void -arch_int_disable_io_interrupt(int irq) +arch_int_disable_io_interrupt(int32 irq) { InterruptController *ic = InterruptController::Get(); if (ic != NULL) diff --git a/src/system/kernel/arch/m68k/arch_int.cpp b/src/system/kernel/arch/m68k/arch_int.cpp index e7c995b4e3..2854046a0c 100644 --- a/src/system/kernel/arch/m68k/arch_int.cpp +++ b/src/system/kernel/arch/m68k/arch_int.cpp @@ -70,7 +70,7 @@ struct iframe_stack gBootFrameStack; void -arch_int_enable_io_interrupt(int irq) +arch_int_enable_io_interrupt(int32 irq) { //if (!sPIC) // return; @@ -82,7 +82,7 @@ arch_int_enable_io_interrupt(int irq) void -arch_int_disable_io_interrupt(int irq) +arch_int_disable_io_interrupt(int32 irq) { //if (!sPIC) // return; diff --git a/src/system/kernel/arch/mips/arch_int.cpp b/src/system/kernel/arch/mips/arch_int.cpp old mode 100755 new mode 100644 index ab4febb53a..6af98d1e53 --- a/src/system/kernel/arch/mips/arch_int.cpp +++ b/src/system/kernel/arch/mips/arch_int.cpp @@ -1,4 +1,4 @@ -/* +/* ** Copyright 2001, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ @@ -9,12 +9,12 @@ struct vector *vector_table; -void arch_int_enable_io_interrupt(int irq) +void arch_int_enable_io_interrupt(int32 irq) { return; } -void arch_int_disable_io_interrupt(int irq) +void arch_int_disable_io_interrupt(int32 irq) { return; } diff --git a/src/system/kernel/arch/ppc/arch_int.cpp b/src/system/kernel/arch/ppc/arch_int.cpp index 9c358d443d..eb798d3dd3 100644 --- a/src/system/kernel/arch/ppc/arch_int.cpp +++ b/src/system/kernel/arch/ppc/arch_int.cpp @@ -54,7 +54,7 @@ static void *sPICCookie; void -arch_int_enable_io_interrupt(int irq) +arch_int_enable_io_interrupt(int32 irq) { if (!sPIC) return; @@ -65,7 +65,7 @@ arch_int_enable_io_interrupt(int irq) void -arch_int_disable_io_interrupt(int irq) +arch_int_disable_io_interrupt(int32 irq) { if (!sPIC) return; diff --git a/src/system/kernel/arch/riscv64/arch_int.cpp b/src/system/kernel/arch/riscv64/arch_int.cpp index e86fe34a60..1c487f3ccc 100644 --- a/src/system/kernel/arch/riscv64/arch_int.cpp +++ b/src/system/kernel/arch/riscv64/arch_int.cpp @@ -605,18 +605,18 @@ arch_int_init_io(kernel_args* args) void -arch_int_enable_io_interrupt(int irq) +arch_int_enable_io_interrupt(int32 irq) { - dprintf("arch_int_enable_io_interrupt(%d)\n", irq); + dprintf("arch_int_enable_io_interrupt(%" B_PRId32 ")\n", irq); gPlicRegs->priority[irq] = 1; gPlicRegs->enable[sPlicContexts[0]][irq / 32] |= 1 << (irq % 32); } void -arch_int_disable_io_interrupt(int irq) +arch_int_disable_io_interrupt(int32 irq) { - dprintf("arch_int_disable_io_interrupt(%d)\n", irq); + dprintf("arch_int_disable_io_interrupt(%" B_PRId32 ")\n", irq); gPlicRegs->priority[irq] = 0; gPlicRegs->enable[sPlicContexts[0]][irq / 32] &= ~(1 << (irq % 32)); } diff --git a/src/system/kernel/arch/sparc/arch_int.cpp b/src/system/kernel/arch/sparc/arch_int.cpp index 5abdffdd82..11d1d1bd14 100644 --- a/src/system/kernel/arch/sparc/arch_int.cpp +++ b/src/system/kernel/arch/sparc/arch_int.cpp @@ -39,13 +39,13 @@ arch_int_init_io(kernel_args* args) void -arch_int_enable_io_interrupt(int irq) +arch_int_enable_io_interrupt(int32 irq) { } void -arch_int_disable_io_interrupt(int irq) +arch_int_disable_io_interrupt(int32 irq) { } diff --git a/src/system/kernel/arch/x86/arch_int.cpp b/src/system/kernel/arch/x86/arch_int.cpp index 9281a5e71a..ddbf84fef4 100644 --- a/src/system/kernel/arch/x86/arch_int.cpp +++ b/src/system/kernel/arch/x86/arch_int.cpp @@ -360,7 +360,7 @@ x86_page_fault_exception(struct iframe* frame) void -x86_set_irq_source(int irq, irq_source source) +x86_set_irq_source(int32 irq, irq_source source) { sVectorSources[irq] = source; } @@ -370,21 +370,21 @@ x86_set_irq_source(int irq, irq_source source) void -arch_int_enable_io_interrupt(int irq) +arch_int_enable_io_interrupt(int32 irq) { sCurrentPIC->enable_io_interrupt(irq); } void -arch_int_disable_io_interrupt(int irq) +arch_int_disable_io_interrupt(int32 irq) { sCurrentPIC->disable_io_interrupt(irq); } void -arch_int_configure_io_interrupt(int irq, uint32 config) +arch_int_configure_io_interrupt(int32 irq, uint32 config) { sCurrentPIC->configure_io_interrupt(irq, config); } diff --git a/src/system/kernel/arch/x86/msi.cpp b/src/system/kernel/arch/x86/msi.cpp index 1f11b73de7..1d5fb76921 100644 --- a/src/system/kernel/arch/x86/msi.cpp +++ b/src/system/kernel/arch/x86/msi.cpp @@ -51,7 +51,7 @@ msi_allocate_vectors(uint32 count, uint32 *startVector, uint64 *address, if (!sMSISupported) return B_UNSUPPORTED; - long vector; + int32 vector; status_t result = allocate_io_interrupt_vectors(count, &vector, INTERRUPT_TYPE_IRQ); if (result != B_OK) diff --git a/src/system/kernel/int.cpp b/src/system/kernel/int.cpp index ce45cf19a1..56ad065f8c 100644 --- a/src/system/kernel/int.cpp +++ b/src/system/kernel/int.cpp @@ -430,8 +430,8 @@ uint32 assign_cpu(void) for the given interrupt number with \a data as the argument. */ status_t -install_io_interrupt_handler(long vector, interrupt_handler handler, void *data, - ulong flags) +install_io_interrupt_handler(int32 vector, interrupt_handler handler, void *data, + uint32 flags) { struct io_handler *io = NULL; cpu_status state; @@ -524,7 +524,7 @@ install_io_interrupt_handler(long vector, interrupt_handler handler, void *data, /*! Remove a previously installed interrupt handler */ status_t -remove_io_interrupt_handler(long vector, interrupt_handler handler, void *data) +remove_io_interrupt_handler(int32 vector, interrupt_handler handler, void *data) { status_t status = B_BAD_VALUE; struct io_handler *io = NULL; @@ -607,14 +607,14 @@ remove_io_interrupt_handler(long vector, interrupt_handler handler, void *data) vectors using allocate_io_interrupt_vectors() instead. */ status_t -reserve_io_interrupt_vectors(long count, long startVector, interrupt_type type) +reserve_io_interrupt_vectors(int32 count, int32 startVector, interrupt_type type) { MutexLocker locker(&sIOInterruptVectorAllocationLock); - for (long i = 0; i < count; i++) { + for (int32 i = 0; i < count; i++) { if (sAllocatedIOInterruptVectors[startVector + i]) { - panic("reserved interrupt vector range %ld-%ld overlaps already " - "allocated vector %ld", startVector, startVector + count - 1, + panic("reserved interrupt vector range %" B_PRId32 "-%" B_PRId32 " overlaps already " + "allocated vector %" B_PRId32, startVector, startVector + count - 1, startVector + i); free_io_interrupt_vectors(i, startVector); return B_BUSY; @@ -627,8 +627,8 @@ reserve_io_interrupt_vectors(long count, long startVector, interrupt_type type) sAllocatedIOInterruptVectors[startVector + i] = true; } - dprintf("reserve_io_interrupt_vectors: reserved %ld vectors starting " - "from %ld\n", count, startVector); + dprintf("reserve_io_interrupt_vectors: reserved %" B_PRId32 " vectors starting " + "from %" B_PRId32 "\n", count, startVector); return B_OK; } @@ -638,14 +638,14 @@ reserve_io_interrupt_vectors(long count, long startVector, interrupt_type type) The first vector to be used is returned in \a startVector on success. */ status_t -allocate_io_interrupt_vectors(long count, long *startVector, +allocate_io_interrupt_vectors(int32 count, int32 *startVector, interrupt_type type) { MutexLocker locker(&sIOInterruptVectorAllocationLock); - long vector = 0; + int32 vector = 0; bool runFound = true; - for (long i = 0; i < NUM_IO_VECTORS - (count - 1); i++) { + for (int32 i = 0; i < NUM_IO_VECTORS - (count - 1); i++) { if (sAllocatedIOInterruptVectors[i]) continue; @@ -664,11 +664,11 @@ allocate_io_interrupt_vectors(long count, long *startVector, } if (!runFound) { - dprintf("found no free vectors to allocate %ld io interrupts\n", count); + dprintf("found no free vectors to allocate %" B_PRId32 " io interrupts\n", count); return B_NO_MEMORY; } - for (long i = 0; i < count; i++) { + for (int32 i = 0; i < count; i++) { sVectors[vector + i].type = type; sVectors[vector + i].assigned_cpu = &sVectorCPUAssignments[vector]; sAllocatedIOInterruptVectors[vector + i] = true; @@ -678,8 +678,8 @@ allocate_io_interrupt_vectors(long count, long *startVector, sVectorCPUAssignments[vector].count = count; *startVector = vector; - dprintf("allocate_io_interrupt_vectors: allocated %ld vectors starting " - "from %ld\n", count, vector); + dprintf("allocate_io_interrupt_vectors: allocated %" B_PRId32 " vectors starting " + "from %" B_PRId32 "\n", count, vector); return B_OK; } @@ -690,28 +690,28 @@ allocate_io_interrupt_vectors(long count, long *startVector, a vector range. */ void -free_io_interrupt_vectors(long count, long startVector) +free_io_interrupt_vectors(int32 count, int32 startVector) { if (startVector + count > NUM_IO_VECTORS) { - panic("invalid start vector %ld or count %ld supplied to " + panic("invalid start vector %" B_PRId32 " or count %" B_PRId32 " supplied to " "free_io_interrupt_vectors\n", startVector, count); return; } - dprintf("free_io_interrupt_vectors: freeing %ld vectors starting " - "from %ld\n", count, startVector); + dprintf("free_io_interrupt_vectors: freeing %" B_PRId32 " vectors starting " + "from %" B_PRId32 "\n", count, startVector); MutexLocker locker(sIOInterruptVectorAllocationLock); - for (long i = 0; i < count; i++) { + for (int32 i = 0; i < count; i++) { if (!sAllocatedIOInterruptVectors[startVector + i]) { - panic("io interrupt vector %ld was not allocated\n", + panic("io interrupt vector %" B_PRId32 " was not allocated\n", startVector + i); } io_vector& vector = sVectors[startVector + i]; InterruptsSpinLocker vectorLocker(vector.vector_lock); if (vector.assigned_cpu != NULL && vector.assigned_cpu->cpu != -1) { - panic("freeing io interrupt vector %ld that is still asigned to a " + panic("freeing io interrupt vector %" B_PRId32 " that is still asigned to a " "cpu", startVector + i); continue; } @@ -722,7 +722,7 @@ free_io_interrupt_vectors(long count, long startVector) } -void assign_io_interrupt_to_cpu(long vector, int32 newCPU) +void assign_io_interrupt_to_cpu(int32 vector, int32 newCPU) { ASSERT(sVectors[vector].type == INTERRUPT_TYPE_IRQ); diff --git a/src/system/kernel/platform/atari_m68k/platform.cpp b/src/system/kernel/platform/atari_m68k/platform.cpp index fe6599c49e..a6ee318cfe 100644 --- a/src/system/kernel/platform/atari_m68k/platform.cpp +++ b/src/system/kernel/platform/atari_m68k/platform.cpp @@ -106,9 +106,9 @@ public: uint8 ReadReg(uint32 reg) { return in8(fBase + reg); }; void WriteReg(uint32 reg, uint8 v) { out8(v, fBase + reg); }; - void EnableIOInterrupt(int irq); - void DisableIOInterrupt(int irq); - bool AcknowledgeIOInterrupt(int irq); + void EnableIOInterrupt(int32 irq); + void DisableIOInterrupt(int32 irq); + bool AcknowledgeIOInterrupt(int32 irq); private: uint32 fBase; @@ -149,9 +149,9 @@ public: virtual char SerialDebugGetChar(); virtual void SerialDebugPutChar(char c); - virtual void EnableIOInterrupt(int irq); - virtual void DisableIOInterrupt(int irq); - virtual bool AcknowledgeIOInterrupt(int irq); + virtual void EnableIOInterrupt(int32 irq); + virtual void DisableIOInterrupt(int32 irq); + virtual bool AcknowledgeIOInterrupt(int32 irq); virtual uint8 ReadRTCReg(uint8 reg); virtual void WriteRTCReg(uint8 reg, uint8 val); @@ -176,7 +176,7 @@ private: int32 (*nfCall)(uint32 ID, ...); char *nfPage; uint32 nfDebugPrintfID; - + }; @@ -277,7 +277,7 @@ M68KAtari::RTC::ReadReg(uint32 reg) out8(0x0a, fBase+1); while((in8(fBase+3) & 0x80) && --waitTime); } - + out8((uint8)reg,fBase+1); return in8(fBase+3); } @@ -327,7 +327,7 @@ M68KAtari::Init(struct kernel_args *kernelArgs) // initialize ARAnyM NatFeatures nfGetID = kernelArgs->arch_args.plat_args.atari.nat_feat.nf_get_id; - nfCall = + nfCall = kernelArgs->arch_args.plat_args.atari.nat_feat.nf_call; nfPage = (char *) kernelArgs->arch_args.plat_args.atari.nat_feat.nf_page; @@ -338,7 +338,7 @@ M68KAtari::Init(struct kernel_args *kernelArgs) } else // won't really work anyway from here panic("You MUST have an ST MFP! Wait, is that *really* an Atari ???"); - + return B_OK; } @@ -395,7 +395,7 @@ M68KAtari::InitRTC(struct kernel_args *kernelArgs, status_t M68KAtari::InitTimer(struct kernel_args *kernelArgs) { - + fMFP[0]->WriteReg(MFP_TACR, 0); // stop it install_io_interrupt_handler(fMFP[0]->Vector()+13, &MFPTimerInterrupt, this, 0); return B_OK; @@ -553,7 +553,7 @@ M68KAtari::SerialDebugPutChar(char c) #if 0 static char buffer[2] = { '\0', '\0' }; buffer[0] = c; - + nfCall(nfDebugPrintfID /*| 0*/, buffer); #endif nfPage[0] = c; @@ -568,7 +568,7 @@ M68KAtari::SerialDebugPutChar(char c) void -M68KAtari::EnableIOInterrupt(int irq) +M68KAtari::EnableIOInterrupt(int32 irq) { MFP *mfp = MFPForIrq(irq); @@ -578,7 +578,7 @@ M68KAtari::EnableIOInterrupt(int irq) void -M68KAtari::DisableIOInterrupt(int irq) +M68KAtari::DisableIOInterrupt(int32 irq) { MFP *mfp = MFPForIrq(irq); @@ -588,7 +588,7 @@ M68KAtari::DisableIOInterrupt(int irq) bool -M68KAtari::AcknowledgeIOInterrupt(int irq) +M68KAtari::AcknowledgeIOInterrupt(int32 irq) { MFP *mfp = MFPForIrq(irq);