Subversion Repositories HelenOS-historic

Rev

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

Rev 623 Rev 727
Line 44... Line 44...
44
    tlb_arch_init();
44
    tlb_arch_init();
45
}
45
}
46
 
46
 
47
#ifdef CONFIG_SMP
47
#ifdef CONFIG_SMP
48
/* must be called with interrupts disabled */
48
/* must be called with interrupts disabled */
49
void tlb_shootdown_start(void)
49
void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, __address page, count_t cnt)
50
{
50
{
51
    int i;
51
    int i;
52
 
52
 
53
    CPU->tlb_active = 0;
53
    CPU->tlb_active = 0;
54
    spinlock_lock(&tlblock);
54
    spinlock_lock(&tlblock);
-
 
55
   
-
 
56
    /*
-
 
57
     * TODO: assemble shootdown message.
-
 
58
     */
55
    tlb_shootdown_ipi_send();
59
    tlb_shootdown_ipi_send();
-
 
60
 
-
 
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:
56
    tlb_invalidate(0); /* TODO: use valid ASID */
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
    }
57
   
75
   
58
busy_wait: 
76
busy_wait: 
59
    for (i = 0; i<config.cpu_count; i++)
77
    for (i = 0; i<config.cpu_count; i++)
60
        if (cpus[i].tlb_active)
78
        if (cpus[i].tlb_active)
61
            goto busy_wait;
79
            goto busy_wait;
Line 75... Line 93...
75
void tlb_shootdown_ipi_recv(void)
93
void tlb_shootdown_ipi_recv(void)
76
{
94
{
77
    CPU->tlb_active = 0;
95
    CPU->tlb_active = 0;
78
    spinlock_lock(&tlblock);
96
    spinlock_lock(&tlblock);
79
    spinlock_unlock(&tlblock);
97
    spinlock_unlock(&tlblock);
80
    tlb_invalidate(0);  /* TODO: use valid ASID */
98
    tlb_invalidate_all();   /* TODO: use valid ASID */
81
    CPU->tlb_active = 1;
99
    CPU->tlb_active = 1;
82
}
100
}
83
#endif /* CONFIG_SMP */
101
#endif /* CONFIG_SMP */