This source file includes following definitions.
- tlb_wire_entry
- tlb_unwire_entry
1
2
3
4
5
6
7
8
9
10
11
12 #include <linux/mm.h>
13 #include <linux/io.h>
14 #include <asm/tlb.h>
15 #include <asm/mmu_context.h>
16
17
18
19
20 void tlb_wire_entry(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
21 {
22 unsigned long status, flags;
23 int urb;
24
25 local_irq_save(flags);
26
27 status = __raw_readl(MMUCR);
28 urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT;
29 status &= ~MMUCR_URC;
30
31
32
33
34 BUG_ON(!--urb);
35
36 urb = urb % MMUCR_URB_NENTRIES;
37
38
39
40
41
42 status |= (urb << MMUCR_URC_SHIFT);
43 __raw_writel(status, MMUCR);
44 ctrl_barrier();
45
46
47 __update_tlb(vma, addr, pte);
48
49
50 status = __raw_readl(MMUCR);
51
52 status &= ~MMUCR_URB;
53 status |= (urb << MMUCR_URB_SHIFT);
54
55 __raw_writel(status, MMUCR);
56 ctrl_barrier();
57
58 local_irq_restore(flags);
59 }
60
61
62
63
64
65
66
67
68
69 void tlb_unwire_entry(void)
70 {
71 unsigned long status, flags;
72 int urb;
73
74 local_irq_save(flags);
75
76 status = __raw_readl(MMUCR);
77 urb = (status & MMUCR_URB) >> MMUCR_URB_SHIFT;
78 status &= ~MMUCR_URB;
79
80
81
82
83
84 BUG_ON(urb++ == MMUCR_URB_NENTRIES);
85
86 urb = urb % MMUCR_URB_NENTRIES;
87
88 status |= (urb << MMUCR_URB_SHIFT);
89 __raw_writel(status, MMUCR);
90 ctrl_barrier();
91
92 local_irq_restore(flags);
93 }