Rev 2009 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2009 | Rev 2048 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | #include <arch/types.h> |
39 | #include <arch/types.h> |
40 | #include <typedefs.h> |
40 | #include <typedefs.h> |
41 | #include <macros.h> |
41 | #include <macros.h> |
42 | #include <debug.h> |
42 | #include <debug.h> |
43 | 43 | ||
44 | #define TSB_INDEX_MASK ((1<<(21+1+TSB_SIZE-PAGE_WIDTH))-1) |
44 | #define TSB_INDEX_MASK ((1 << (21 + 1 + TSB_SIZE - PAGE_WIDTH)) - 1) |
45 | 45 | ||
46 | /** Invalidate portion of TSB. |
46 | /** Invalidate portion of TSB. |
47 | * |
47 | * |
48 | * We assume that the address space is already locked. |
48 | * We assume that the address space is already locked. Note that respective |
49 | * Note that respective portions of both TSBs |
- | |
50 | * are invalidated at a time. |
49 | * portions of both TSBs are invalidated at a time. |
51 | * |
50 | * |
52 | * @param as Address space. |
51 | * @param as Address space. |
53 | * @param page First page to invalidate in TSB. |
52 | * @param page First page to invalidate in TSB. |
54 | * @param pages Number of pages to invalidate. |
53 | * @param pages Number of pages to invalidate. Value of (count_t) -1 means the |
55 | * Value of (count_t) -1 means the whole TSB. |
54 | * whole TSB. |
56 | */ |
55 | */ |
57 | void tsb_invalidate(as_t *as, uintptr_t page, count_t pages) |
56 | void tsb_invalidate(as_t *as, uintptr_t page, count_t pages) |
58 | { |
57 | { |
59 | index_t i0, i; |
58 | index_t i0, i; |
60 | count_t cnt; |
59 | count_t cnt; |
Line 63... | Line 62... | ||
63 | 62 | ||
64 | i0 = (page >> PAGE_WIDTH) & TSB_INDEX_MASK; |
63 | i0 = (page >> PAGE_WIDTH) & TSB_INDEX_MASK; |
65 | cnt = min(pages, ITSB_ENTRY_COUNT); |
64 | cnt = min(pages, ITSB_ENTRY_COUNT); |
66 | 65 | ||
67 | for (i = 0; i < cnt; i++) { |
66 | for (i = 0; i < cnt; i++) { |
68 | as->arch.itsb[(i0 + i) & (ITSB_ENTRY_COUNT-1)].tag.invalid = true; |
67 | as->arch.itsb[(i0 + i) & (ITSB_ENTRY_COUNT - 1)].tag.invalid = |
- | 68 | true; |
|
69 | as->arch.dtsb[(i0 + i) & (DTSB_ENTRY_COUNT-1)].tag.invalid = true; |
69 | as->arch.dtsb[(i0 + i) & (DTSB_ENTRY_COUNT - 1)].tag.invalid = |
- | 70 | true; |
|
70 | } |
71 | } |
71 | } |
72 | } |
72 | 73 | ||
73 | /** Copy software PTE to ITSB. |
74 | /** Copy software PTE to ITSB. |
74 | * |
75 | * |