From 1efece2e27b5ff87c9fe6a9c1d447d9808addf62 Mon Sep 17 00:00:00 2001
From: Andreas Faerber <andreas.faerber@web.de>
Date: Sun, 13 Jun 2010 01:55:12 +0200
Subject: [PATCH 2/2] Fix device type check
B_DEVICE_TYPE is a 16-bit numeric ID.
---
src/system/kernel/arch/ppc/arch_int.cpp | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/system/kernel/arch/ppc/arch_int.cpp b/src/system/kernel/arch/ppc/arch_int.cpp
index 8de2fb0..456d003 100644
a
|
b
|
|
26 | 26 | #include <vm/vm.h> |
27 | 27 | #include <vm/vm_priv.h> |
28 | 28 | #include <vm/VMAddressSpace.h> |
| 29 | #include <PCI.h> |
29 | 30 | |
30 | 31 | #include <string.h> |
31 | 32 | |
… |
… |
arch_int_init_post_device_manager(struct kernel_args *args)
|
511 | 512 | // iterate through the tree again and get an interrupt controller node |
512 | 513 | iterator.Rewind(); |
513 | 514 | while (device_node *node = iterator.Next()) { |
514 | | const char *deviceType; |
515 | | if (deviceManager->get_attr_string(node, B_DEVICE_TYPE, |
516 | | &deviceType, false) == B_OK) { |
517 | | bool isPIC = false; |
518 | | |
519 | | /* |
520 | | bool isPIC |
521 | | = (strcmp(deviceType, B_INTERRUPT_CONTROLLER_DRIVER_TYPE) == 0); |
522 | | free(deviceType); |
523 | | */ |
| 515 | uint16 pciBaseClass, pciSubType; |
| 516 | if (deviceManager->get_attr_uint16(node, B_DEVICE_TYPE, |
| 517 | &pciBaseClass, false) == B_OK && |
| 518 | deviceManager->get_attr_uint16(node, B_DEVICE_SUB_TYPE, |
| 519 | &pciSubType, false) == B_OK) { |
| 520 | bool isPIC = (pciBaseClass == PCI_base_peripheral) |
| 521 | && (pciSubType == PCI_pic); |
524 | 522 | |
525 | 523 | if (isPIC) { |
526 | 524 | driver_module_info *driver; |