Subversion Repositories HelenOS

Rev

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

Rev 1881 Rev 2067
Line 57... Line 57...
57
 *
57
 *
58
 */
58
 */
59
void cpu_init(void) {
59
void cpu_init(void) {
60
    int i, j;
60
    int i, j;
61
   
61
   
62
    #ifdef CONFIG_SMP
62
#ifdef CONFIG_SMP
63
    if (config.cpu_active == 1) {
63
    if (config.cpu_active == 1) {
64
    #endif /* CONFIG_SMP */
64
#endif /* CONFIG_SMP */
65
        cpus = (cpu_t *) malloc(sizeof(cpu_t) * config.cpu_count,
65
        cpus = (cpu_t *) malloc(sizeof(cpu_t) * config.cpu_count,
66
                    FRAME_ATOMIC);
66
                    FRAME_ATOMIC);
67
        if (!cpus)
67
        if (!cpus)
68
            panic("malloc/cpus");
68
            panic("malloc/cpus");
69
 
69
 
Line 81... Line 81...
81
                spinlock_initialize(&cpus[i].rq[j].lock, "rq_t.lock");
81
                spinlock_initialize(&cpus[i].rq[j].lock, "rq_t.lock");
82
                list_initialize(&cpus[i].rq[j].rq_head);
82
                list_initialize(&cpus[i].rq[j].rq_head);
83
            }
83
            }
84
        }
84
        }
85
       
85
       
86
    #ifdef CONFIG_SMP
86
#ifdef CONFIG_SMP
87
    }
87
    }
88
    #endif /* CONFIG_SMP */
88
#endif /* CONFIG_SMP */
89
 
89
 
90
    CPU = &cpus[config.cpu_active-1];
90
    CPU = &cpus[config.cpu_active-1];
91
   
91
   
92
    CPU->active = 1;
92
    CPU->active = 1;
93
    CPU->tlb_active = 1;
93
    CPU->tlb_active = 1;