Subversion Repositories HelenOS

Rev

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

Rev 3343 Rev 3467
Line 41... Line 41...
41
#include <macros.h>
41
#include <macros.h>
42
#include <arch/types.h>
42
#include <arch/types.h>
43
#include <synch/synch.h>
43
#include <synch/synch.h>
44
#include <synch/waitq.h>
44
#include <synch/waitq.h>
45
#include <print.h>
45
#include <print.h>
-
 
46
#include <arch/cpu_node.h>
46
 
47
 
47
/**
48
/**
48
 * This global variable is used to pick-up application processors
49
 * This global variable is used to pick-up application processors
49
 * from their active loop in start.S. When a processor looping in
50
 * from their active loop in start.S. When a processor looping in
50
 * start.S sees that this variable contains its MID, it can
51
 * start.S sees that this variable contains its MID, it can
Line 59... Line 60...
59
void smp_init(void)
60
void smp_init(void)
60
{
61
{
61
    ofw_tree_node_t *node;
62
    ofw_tree_node_t *node;
62
    count_t cnt = 0;
63
    count_t cnt = 0;
63
   
64
   
64
    node = ofw_tree_find_child_by_device_type(ofw_tree_lookup("/"), "cpu");
65
    node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu");
65
    while (node) {
66
    while (node) {
66
        cnt++;
67
        cnt++;
67
        node = ofw_tree_find_peer_by_device_type(node, "cpu");
68
        node = ofw_tree_find_peer_by_device_type(node, "cpu");
68
    }
69
    }
69
   
70
   
Line 74... Line 75...
74
void kmp(void *arg)
75
void kmp(void *arg)
75
{
76
{
76
    ofw_tree_node_t *node;
77
    ofw_tree_node_t *node;
77
    int i;
78
    int i;
78
   
79
   
79
    node = ofw_tree_find_child_by_device_type(ofw_tree_lookup("/"), "cpu");
80
    node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu");
80
    for (i = 0; node; node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++) {
81
    for (i = 0; node; node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++) {
81
        uint32_t mid;
82
        uint32_t mid;
82
        ofw_tree_property_t *prop;
83
        ofw_tree_property_t *prop;
83
       
84
       
84
        prop = ofw_tree_getprop(node, "upa-portid");
85
        prop = ofw_tree_getprop(node, PORTID_NAME);
85
        if (!prop || !prop->value)
86
        if (!prop || !prop->value)
86
            continue;
87
            continue;
87
       
88
       
88
        mid = *((uint32_t *) prop->value);
89
        mid = *((uint32_t *) prop->value);
89
        if (CPU->arch.mid == mid) {
90
        if (CPU->arch.mid == mid) {