Subversion Repositories HelenOS

Rev

Rev 3675 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3675 Rev 4377
Line 37... Line 37...
37
 
37
 
38
#include <genarch/ofw/ofw_tree.h>
38
#include <genarch/ofw/ofw_tree.h>
39
#include <arch/drivers/pci.h>
39
#include <arch/drivers/pci.h>
40
#include <arch/trap/interrupt.h>
40
#include <arch/trap/interrupt.h>
41
#include <arch/memstr.h>
41
#include <arch/memstr.h>
42
#include <func.h>
42
#include <string.h>
43
#include <panic.h>
43
#include <panic.h>
44
#include <macros.h>
44
#include <macros.h>
45
 
45
 
46
#define PCI_SPACE_MASK      0x03000000
46
#define PCI_SPACE_MASK      0x03000000
47
#define PCI_ABS_MASK        0x80000000  
47
#define PCI_ABS_MASK        0x80000000  
Line 56... Line 56...
56
    ofw_pci_range_t *range;
56
    ofw_pci_range_t *range;
57
    count_t ranges;
57
    count_t ranges;
58
 
58
 
59
    prop = ofw_tree_getprop(node, "ranges");
59
    prop = ofw_tree_getprop(node, "ranges");
60
    if (!prop) {
60
    if (!prop) {
61
        if (strcmp(ofw_tree_node_name(node->parent), "pci") == 0)
61
        if (str_cmp(ofw_tree_node_name(node->parent), "pci") == 0)
62
            return ofw_pci_apply_ranges(node->parent, reg, pa);
62
            return ofw_pci_apply_ranges(node->parent, reg, pa);
63
        return false;
63
        return false;
64
    }
64
    }
65
       
65
       
66
    ranges = prop->size / sizeof(ofw_pci_range_t);
66
    ranges = prop->size / sizeof(ofw_pci_range_t);
Line 99... Line 99...
99
    ofw_pci_reg_t *assigned_address;
99
    ofw_pci_reg_t *assigned_address;
100
    count_t assigned_addresses;
100
    count_t assigned_addresses;
101
   
101
   
102
    prop = ofw_tree_getprop(node, "assigned-addresses");
102
    prop = ofw_tree_getprop(node, "assigned-addresses");
103
    if (!prop)
103
    if (!prop)
104
        panic("Can't find \"assigned-addresses\" property.\n");
104
        panic("Cannot find 'assigned-addresses' property.");
105
   
105
   
106
    assigned_addresses = prop->size / sizeof(ofw_pci_reg_t);
106
    assigned_addresses = prop->size / sizeof(ofw_pci_reg_t);
107
    assigned_address = prop->value;
107
    assigned_address = prop->value;
108
   
108
   
109
    unsigned int i;
109
    unsigned int i;