[haiku-commits] haiku: hrev55686 - src/system/kernel headers/private/kernel/arch src/system/kernel/arch/arm src/system/kernel/arch/m68k src/system/kernel/arch/arm64

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 3 Dec 2021 22:36:50 +0000 (UTC)

hrev55686 adds 1 changeset to branch 'master'
old head: 3316cfc9afa6f3eee7d14ef7497484892ee6b916
new head: 3c2597393c090cf931c4c12de55c28bb5905b47b
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=3c2597393c09+%5E3316cfc9afa6

----------------------------------------------------------------------------

3c2597393c09: kernel/int: Allow arch_int_assign_to_cpu to make its own 
decisions.
  
  For now this is used on RISCV64 to indicate that interrupts will always
  be on CPU 0. However, in the future, some architectures may want
  or require interrupts to be "steered" in various ways, and this
  also paves the way for that.
  
  Change-Id: Iec79870cf5c4898d102d0e624de19602271ae772
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/4721
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
  Tested-by: Commit checker robot <no-reply+buildbot@xxxxxxxxxxxx>

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev55686
Commit:      3c2597393c090cf931c4c12de55c28bb5905b47b
URL:         https://git.haiku-os.org/haiku/commit/?id=3c2597393c09
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Dec  1 22:16:57 2021 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Fri Dec  3 22:36:47 2021 UTC

----------------------------------------------------------------------------

9 files changed, 25 insertions(+), 16 deletions(-)
headers/private/kernel/arch/int.h           | 2 +-
src/system/kernel/arch/arm/arch_int.cpp     | 6 ++++--
src/system/kernel/arch/arm64/arch_int.cpp   | 5 +++--
src/system/kernel/arch/m68k/arch_int.cpp    | 5 +++--
src/system/kernel/arch/ppc/arch_int.cpp     | 4 +++-
src/system/kernel/arch/riscv64/arch_int.cpp | 5 +++--
src/system/kernel/arch/sparc/arch_int.cpp   | 4 +++-
src/system/kernel/arch/x86/arch_int.cpp     | 3 ++-
src/system/kernel/int.cpp                   | 7 +++----

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/arch/int.h 
b/headers/private/kernel/arch/int.h
index 6d4afc6f67..0bfd94febb 100644
--- a/headers/private/kernel/arch/int.h
+++ b/headers/private/kernel/arch/int.h
@@ -34,7 +34,7 @@ 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);
 bool arch_int_are_interrupts_enabled(void);
-void arch_int_assign_to_cpu(int32 irq, int32 cpu);
+int32 arch_int_assign_to_cpu(int32 irq, int32 cpu);
 
 #ifdef __cplusplus
 }
diff --git a/src/system/kernel/arch/arm/arch_int.cpp 
b/src/system/kernel/arch/arm/arch_int.cpp
index 3bb5c2c80a..67aabe845e 100644
--- a/src/system/kernel/arch/arm/arch_int.cpp
+++ b/src/system/kernel/arch/arm/arch_int.cpp
@@ -84,12 +84,14 @@ arch_int_disable_io_interrupt(int irq)
 
 /* arch_int_*_interrupts() and friends are in arch_asm.S */
 
-void
+int32
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
-       // intentionally left blank; no SMP support (yet)
+       // Not yet supported.
+       return 0;
 }
 
+
 static void
 print_iframe(const char *event, struct iframe *frame)
 {
diff --git a/src/system/kernel/arch/arm64/arch_int.cpp 
b/src/system/kernel/arch/arm64/arch_int.cpp
index 23d5c7f8bf..34c452adeb 100644
--- a/src/system/kernel/arch/arm64/arch_int.cpp
+++ b/src/system/kernel/arch/arm64/arch_int.cpp
@@ -39,10 +39,11 @@ arch_int_disable_io_interrupt(int irq)
 }
 
 
-void
+int32
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
-       // intentionally left blank; no SMP support (yet)
+       // Not yet supported.
+       return 0;
 }
 
 
diff --git a/src/system/kernel/arch/m68k/arch_int.cpp 
b/src/system/kernel/arch/m68k/arch_int.cpp
index 6583b75253..e7c995b4e3 100644
--- a/src/system/kernel/arch/m68k/arch_int.cpp
+++ b/src/system/kernel/arch/m68k/arch_int.cpp
@@ -95,10 +95,11 @@ arch_int_disable_io_interrupt(int irq)
 /* arch_int_*_interrupts() and friends are in arch_asm.S */
 
 
-void
+int32
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
-       // intentionally left blank; no SMP support (yet)
+       // Not yet supported.
+       return 0;
 }
 
 
diff --git a/src/system/kernel/arch/ppc/arch_int.cpp 
b/src/system/kernel/arch/ppc/arch_int.cpp
index 5e5ce87a9f..9c358d443d 100644
--- a/src/system/kernel/arch/ppc/arch_int.cpp
+++ b/src/system/kernel/arch/ppc/arch_int.cpp
@@ -571,7 +571,9 @@ ppc_set_current_cpu_exception_context(struct 
ppc_cpu_exception_context *context)
 }
 
 
-void
+int32
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
+       // Not yet supported.
+       return 0;
 }
diff --git a/src/system/kernel/arch/riscv64/arch_int.cpp 
b/src/system/kernel/arch/riscv64/arch_int.cpp
index cbcf90137e..de42b07532 100644
--- a/src/system/kernel/arch/riscv64/arch_int.cpp
+++ b/src/system/kernel/arch/riscv64/arch_int.cpp
@@ -549,8 +549,9 @@ arch_int_disable_io_interrupt(int irq)
 }
 
 
-void
+int32
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
-       // SMP not yet supported
+       // Not yet supported.
+       return 0;
 }
diff --git a/src/system/kernel/arch/sparc/arch_int.cpp 
b/src/system/kernel/arch/sparc/arch_int.cpp
index 885044d2aa..5abdffdd82 100644
--- a/src/system/kernel/arch/sparc/arch_int.cpp
+++ b/src/system/kernel/arch/sparc/arch_int.cpp
@@ -50,7 +50,9 @@ arch_int_disable_io_interrupt(int irq)
 }
 
 
-void
+int32
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
+       // Not yet supported.
+       return 0;
 }
diff --git a/src/system/kernel/arch/x86/arch_int.cpp 
b/src/system/kernel/arch/x86/arch_int.cpp
index 416e9d21c4..025d431dd6 100644
--- a/src/system/kernel/arch/x86/arch_int.cpp
+++ b/src/system/kernel/arch/x86/arch_int.cpp
@@ -424,7 +424,7 @@ arch_int_are_interrupts_enabled(void)
 }
 
 
-void
+int32
 arch_int_assign_to_cpu(int32 irq, int32 cpu)
 {
        switch (sVectorSources[irq]) {
@@ -440,6 +440,7 @@ arch_int_assign_to_cpu(int32 irq, int32 cpu)
                default:
                        break;
        }
+       return cpu;
 }
 
 
diff --git a/src/system/kernel/int.cpp b/src/system/kernel/int.cpp
index 1cd125538b..13c1569967 100644
--- a/src/system/kernel/int.cpp
+++ b/src/system/kernel/int.cpp
@@ -468,7 +468,7 @@ install_io_interrupt_handler(long vector, interrupt_handler 
handler, void *data,
                && sVectors[vector].assigned_cpu->cpu == -1) {
 
                int32 cpuID = assign_cpu();
-               arch_int_assign_to_cpu(vector, cpuID);
+               cpuID = arch_int_assign_to_cpu(vector, cpuID);
                sVectors[vector].assigned_cpu->cpu = cpuID;
 
                cpu_ent* cpu = &gCPU[cpuID];
@@ -743,10 +743,9 @@ void assign_io_interrupt_to_cpu(long vector, int32 newCPU)
        list_remove_item(&cpu->irqs, sVectors[vector].assigned_cpu);
        locker.Unlock();
 
+       newCPU = arch_int_assign_to_cpu(vector, newCPU);
+       sVectors[vector].assigned_cpu->cpu = newCPU;
        cpu = &gCPU[newCPU];
        locker.SetTo(cpu->irqs_lock, false);
-       sVectors[vector].assigned_cpu->cpu = newCPU;
-       arch_int_assign_to_cpu(vector, newCPU);
        list_add_item(&cpu->irqs, sVectors[vector].assigned_cpu);
 }
-


Other related posts:

  • » [haiku-commits] haiku: hrev55686 - src/system/kernel headers/private/kernel/arch src/system/kernel/arch/arm src/system/kernel/arch/m68k src/system/kernel/arch/arm64 - waddlesplash