hrev51786 adds 1 changeset to branch 'master'
old head: 66fa3b18476b8b29d5d5b94bbb8949f823455207
new head: 0ae2a0c4d745eb68a8af8604752a28897451d524
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=0ae2a0c4d745+%5E66fa3b18476b
----------------------------------------------------------------------------
0ae2a0c4d745: Fix device type check
B_DEVICE_TYPE is a 16-bit numeric ID.
[ Andreas Faerber <andreas.faerber@xxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev51786
Commit: 0ae2a0c4d745eb68a8af8604752a28897451d524
URL: http://cgit.haiku-os.org/haiku/commit/?id=0ae2a0c4d745
Author: Andreas Faerber <andreas.faerber@xxxxxx>
Date: Sat Jun 12 23:55:12 2010 UTC
Committer: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Commit-Date: Wed Jan 31 20:26:11 2018 UTC
----------------------------------------------------------------------------
1 file changed, 8 insertions(+), 10 deletions(-)
src/system/kernel/arch/ppc/arch_int.cpp | 18 ++++++++----------
----------------------------------------------------------------------------
diff --git a/src/system/kernel/arch/ppc/arch_int.cpp
b/src/system/kernel/arch/ppc/arch_int.cpp
index b4c977819a..c6a25ad3a2 100644
--- a/src/system/kernel/arch/ppc/arch_int.cpp
+++ b/src/system/kernel/arch/ppc/arch_int.cpp
@@ -27,6 +27,7 @@
#include <vm/vm.h>
#include <vm/vm_priv.h>
#include <vm/VMAddressSpace.h>
+#include <PCI.h>
#include <string.h>
@@ -515,16 +516,13 @@ arch_int_init_post_device_manager(struct kernel_args
*args)
// iterate through the tree again and get an interrupt controller node
iterator.Rewind();
while (device_node *node = iterator.Next()) {
- const char *deviceType;
- if (deviceManager->get_attr_string(node, B_DEVICE_TYPE,
- &deviceType, false) == B_OK) {
- bool isPIC = false;
-
- /*
- bool isPIC
- = (strcmp(deviceType,
B_INTERRUPT_CONTROLLER_DRIVER_TYPE) == 0);
- free(deviceType);
- */
+ uint16 pciBaseClass, pciSubType;
+ if (deviceManager->get_attr_uint16(node, B_DEVICE_TYPE,
+ &pciBaseClass, false) == B_OK &&
+ deviceManager->get_attr_uint16(node, B_DEVICE_SUB_TYPE,
+ &pciSubType, false) == B_OK) {
+ bool isPIC = (pciBaseClass == PCI_base_peripheral)
+ && (pciSubType == PCI_pic);
if (isPIC) {
driver_module_info *driver;