Subversion Repositories HelenOS-historic

Rev

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

Rev 727 Rev 740
Line 52... Line 52...
52
 
52
 
53
    CPU->tlb_active = 0;
53
    CPU->tlb_active = 0;
54
    spinlock_lock(&tlblock);
54
    spinlock_lock(&tlblock);
55
   
55
   
56
    /*
56
    /*
57
     * TODO: assemble shootdown message.
57
     * TODO: wrap parameters into a message and
-
 
58
     * dispatch it to all CPUs excluding this one.
58
     */
59
     */
-
 
60
   
59
    tlb_shootdown_ipi_send();
61
    tlb_shootdown_ipi_send();
60
 
62
 
61
    switch (type) {
-
 
62
        case TLB_INVL_ALL:
-
 
63
        tlb_invalidate_all();
-
 
64
        break;
-
 
65
        case TLB_INVL_ASID:
-
 
66
        tlb_invalidate_asid(asid);
-
 
67
        break;
-
 
68
        case TLB_INVL_PAGES:
-
 
69
        tlb_invalidate_pages(asid, page, cnt);
-
 
70
        break;
-
 
71
        default:
-
 
72
        panic("unknown tlb_invalidate_type_t value: %d\n", type);
-
 
73
        break;
-
 
74
    }
-
 
75
   
-
 
76
busy_wait: 
63
busy_wait: 
77
    for (i = 0; i<config.cpu_count; i++)
64
    for (i = 0; i<config.cpu_count; i++)
78
        if (cpus[i].tlb_active)
65
        if (cpus[i].tlb_active)
79
            goto busy_wait;
66
            goto busy_wait;
80
}
67
}
Line 93... Line 80...
93
void tlb_shootdown_ipi_recv(void)
80
void tlb_shootdown_ipi_recv(void)
94
{
81
{
95
    CPU->tlb_active = 0;
82
    CPU->tlb_active = 0;
96
    spinlock_lock(&tlblock);
83
    spinlock_lock(&tlblock);
97
    spinlock_unlock(&tlblock);
84
    spinlock_unlock(&tlblock);
98
    tlb_invalidate_all();   /* TODO: use valid ASID */
85
    tlb_invalidate_all();   /* TODO: be more finer-grained in what to invalidate */
99
    CPU->tlb_active = 1;
86
    CPU->tlb_active = 1;
100
}
87
}
101
#endif /* CONFIG_SMP */
88
#endif /* CONFIG_SMP */