Subversion Repositories HelenOS-historic

Rev

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

Rev 452 Rev 458
Line 41... Line 41...
41
#include <arch/mm/page.h>
41
#include <arch/mm/page.h>
42
#include <mm/vm.h>
42
#include <mm/vm.h>
43
#include <print.h>
43
#include <print.h>
44
#include <memstr.h>
44
#include <memstr.h>
45
 
45
 
46
#ifdef __SMP__
46
#ifdef CONFIG_SMP
47
#include <arch/smp/mps.h>
47
#include <arch/smp/mps.h>
48
#endif /* __SMP__ */
48
#endif /* CONFIG_SMP */
49
 
49
 
50
#include <synch/waitq.h>
50
#include <synch/waitq.h>
51
#include <synch/spinlock.h>
51
#include <synch/spinlock.h>
52
 
52
 
53
#ifdef __TEST__
53
#ifdef __TEST__
Line 64... Line 64...
64
    thread_t *t;
64
    thread_t *t;
65
    int i;
65
    int i;
66
 
66
 
67
    interrupts_disable();
67
    interrupts_disable();
68
 
68
 
69
#ifdef __SMP__          
69
#ifdef CONFIG_SMP           
70
    if (config.cpu_count > 1) {
70
    if (config.cpu_count > 1) {
71
        /*
71
        /*
72
         * Create the kmp thread and wait for its completion.
72
         * Create the kmp thread and wait for its completion.
73
         * cpu1 through cpuN-1 will come up consecutively and
73
         * cpu1 through cpuN-1 will come up consecutively and
74
         * not mess together with kcpulb threads.
74
         * not mess together with kcpulb threads.
Line 82... Line 82...
82
            thread_ready(t);
82
            thread_ready(t);
83
            waitq_sleep(&kmp_completion_wq);
83
            waitq_sleep(&kmp_completion_wq);
84
        }
84
        }
85
        else panic("thread_create/kmp");
85
        else panic("thread_create/kmp");
86
    }
86
    }
87
#endif /* __SMP__ */
87
#endif /* CONFIG_SMP */
88
    /*
88
    /*
89
     * Now that all CPUs are up, we can report what we've found.
89
     * Now that all CPUs are up, we can report what we've found.
90
     */
90
     */
91
    for (i = 0; i < config.cpu_count; i++) {
91
    for (i = 0; i < config.cpu_count; i++) {
92
        if (cpus[i].active)
92
        if (cpus[i].active)
93
            cpu_print_report(&cpus[i]);
93
            cpu_print_report(&cpus[i]);
94
        else
94
        else
95
            printf("cpu%d: not active\n", i);
95
            printf("cpu%d: not active\n", i);
96
    }
96
    }
97
 
97
 
98
#ifdef __SMP__
98
#ifdef CONFIG_SMP
99
    if (config.cpu_count > 1) {
99
    if (config.cpu_count > 1) {
100
        /*
100
        /*
101
         * For each CPU, create its load balancing thread.
101
         * For each CPU, create its load balancing thread.
102
         */
102
         */
103
        for (i = 0; i < config.cpu_count; i++) {
103
        for (i = 0; i < config.cpu_count; i++) {
Line 111... Line 111...
111
            }
111
            }
112
            else panic("thread_create/kcpulb");
112
            else panic("thread_create/kcpulb");
113
 
113
 
114
        }
114
        }
115
    }
115
    }
116
#endif /* __SMP__ */
116
#endif /* CONFIG_SMP */
117
 
117
 
118
    interrupts_enable();
118
    interrupts_enable();
119
 
119
 
120
#ifdef __USERSPACE__
120
#ifdef __USERSPACE__
121
    /*
121
    /*