[haiku-commits] haiku: hrev45925 - src/system/kernel/arch/x86 headers/private/kernel/arch/x86

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 29 Jul 2013 17:37:09 +0200 (CEST)

hrev45925 adds 1 changeset to branch 'master'
old head: e52af6a9e146b58b3a3bc522676d40b560e99a4c
new head: 46f7a54d8c545ff61d59d6b336232d2b65c3b1fd
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=46f7a54+%5Ee52af6a

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

46f7a54: MSI: Use the effective APIC id of the boot CPU for the address 
destination.
  
  * This should only affect systems where the CPU ids aren't sequential (mostly
  non Intel).
  * Fixes #9807.

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

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

Revision:    hrev45925
Commit:      46f7a54d8c545ff61d59d6b336232d2b65c3b1fd
URL:         http://cgit.haiku-os.org/haiku/commit/?id=46f7a54
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Fri Jul 26 15:58:55 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9807

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

4 files changed, 18 insertions(+), 5 deletions(-)
headers/private/kernel/arch/x86/msi.h      |  1 -
headers/private/kernel/arch/x86/msi_priv.h | 12 ++++++++++++
src/system/kernel/arch/x86/arch_int.cpp    |  4 ++--
src/system/kernel/arch/x86/msi.cpp         |  6 ++++--

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

diff --git a/headers/private/kernel/arch/x86/msi.h 
b/headers/private/kernel/arch/x86/msi.h
index d0cec5b..18685cb 100644
--- a/headers/private/kernel/arch/x86/msi.h
+++ b/headers/private/kernel/arch/x86/msi.h
@@ -24,7 +24,6 @@
 #define MSI_DELIVERY_MODE_EXT_INT              0x00000700
 
 
-void           msi_init();
 bool           msi_supported();
 status_t       msi_allocate_vectors(uint8 count, uint8 *startVector,
                                uint64 *address, uint16 *data);
diff --git a/headers/private/kernel/arch/x86/msi_priv.h 
b/headers/private/kernel/arch/x86/msi_priv.h
new file mode 100644
index 0000000..236c173
--- /dev/null
+++ b/headers/private/kernel/arch/x86/msi_priv.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2010-2011, Michael Lotz, mmlr@xxxxxxxx. All Rights Reserved.
+ * Distributed under the terms of the MIT license.
+ */
+#ifndef _KERNEL_ARCH_x86_MSI_PRIV_H
+#define _KERNEL_ARCH_x86_MSI_PRIV_H
+
+
+void msi_init(kernel_args* args);
+
+
+#endif // _KERNEL_ARCH_x86_MSI_PRIV_H
diff --git a/src/system/kernel/arch/x86/arch_int.cpp 
b/src/system/kernel/arch/x86/arch_int.cpp
index e183636..1fabe85 100644
--- a/src/system/kernel/arch/x86/arch_int.cpp
+++ b/src/system/kernel/arch/x86/arch_int.cpp
@@ -24,7 +24,7 @@
 
 #include <arch/x86/apic.h>
 #include <arch/x86/descriptors.h>
-#include <arch/x86/msi.h>
+#include <arch/x86/msi_priv.h>
 
 #include <stdio.h>
 
@@ -411,7 +411,7 @@ arch_int_init_post_vm(kernel_args* args)
 status_t
 arch_int_init_io(kernel_args* args)
 {
-       msi_init();
+       msi_init(args);
        ioapic_init(args);
        return B_OK;
 }
diff --git a/src/system/kernel/arch/x86/msi.cpp 
b/src/system/kernel/arch/x86/msi.cpp
index 67b2422..54f4cff 100644
--- a/src/system/kernel/arch/x86/msi.cpp
+++ b/src/system/kernel/arch/x86/msi.cpp
@@ -12,10 +12,11 @@
 
 
 static bool sMSISupported = false;
+static uint32 sBootCPUAPICId = 0;
 
 
 void
-msi_init()
+msi_init(kernel_args* args)
 {
        if (!apic_available()) {
                dprintf("disabling msi due to missing apic\n");
@@ -24,6 +25,7 @@ msi_init()
 
        dprintf("msi support enabled\n");
        sMSISupported = true;
+       sBootCPUAPICId = args->arch_args.cpu_apic_id[0];
 }
 
 
@@ -52,7 +54,7 @@ msi_allocate_vectors(uint8 count, uint8 *startVector, uint64 
*address,
        }
 
        *startVector = (uint8)vector;
-       *address = MSI_ADDRESS_BASE | (0 << MSI_DESTINATION_ID_SHIFT)
+       *address = MSI_ADDRESS_BASE | (sBootCPUAPICId << 
MSI_DESTINATION_ID_SHIFT)
                | MSI_NO_REDIRECTION | MSI_DESTINATION_MODE_PHYSICAL;
        *data = MSI_TRIGGER_MODE_EDGE | MSI_DELIVERY_MODE_FIXED
                | ((uint16)vector + ARCH_INTERRUPT_BASE);


Other related posts:

  • » [haiku-commits] haiku: hrev45925 - src/system/kernel/arch/x86 headers/private/kernel/arch/x86 - korli