Rev 1946 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1946 | Rev 2054 | ||
|---|---|---|---|
| Line 63... | Line 63... | ||
| 63 | 63 | ||
| 64 | #define TLB_DEMAP_CONTEXT_SHIFT 4 |
64 | #define TLB_DEMAP_CONTEXT_SHIFT 4 |
| 65 | 65 | ||
| 66 | /* TLB Tag Access shifts */ |
66 | /* TLB Tag Access shifts */ |
| 67 | #define TLB_TAG_ACCESS_CONTEXT_SHIFT 0 |
67 | #define TLB_TAG_ACCESS_CONTEXT_SHIFT 0 |
| 68 | #define TLB_TAG_ACCESS_CONTEXT_MASK ((1<<13)-1) |
68 | #define TLB_TAG_ACCESS_CONTEXT_MASK ((1 << 13) - 1) |
| 69 | #define TLB_TAG_ACCESS_VPN_SHIFT 13 |
69 | #define TLB_TAG_ACCESS_VPN_SHIFT 13 |
| 70 | 70 | ||
| 71 | #ifndef __ASM__ |
71 | #ifndef __ASM__ |
| 72 | 72 | ||
| 73 | #include <arch/mm/tte.h> |
73 | #include <arch/mm/tte.h> |
| Line 104... | Line 104... | ||
| 104 | 104 | ||
| 105 | /** I-/D-TLB Tag Read Register. */ |
105 | /** I-/D-TLB Tag Read Register. */ |
| 106 | union tlb_tag_read_reg { |
106 | union tlb_tag_read_reg { |
| 107 | uint64_t value; |
107 | uint64_t value; |
| 108 | struct { |
108 | struct { |
| 109 | uint64_t vpn : 51; /**< Virtual Address bits 63:13. */ |
109 | uint64_t vpn : 51; /**< Virtual Address bits 63:13. */ |
| 110 | unsigned context : 13; /**< Context identifier. */ |
110 | unsigned context : 13; /**< Context identifier. */ |
| 111 | } __attribute__ ((packed)); |
111 | } __attribute__ ((packed)); |
| 112 | }; |
112 | }; |
| 113 | typedef union tlb_tag_read_reg tlb_tag_read_reg_t; |
113 | typedef union tlb_tag_read_reg tlb_tag_read_reg_t; |
| 114 | typedef union tlb_tag_read_reg tlb_tag_access_reg_t; |
114 | typedef union tlb_tag_read_reg tlb_tag_access_reg_t; |
| 115 | 115 | ||
| Line 380... | Line 380... | ||
| 380 | } |
380 | } |
| 381 | 381 | ||
| 382 | /** Perform IMMU TLB Demap Operation. |
382 | /** Perform IMMU TLB Demap Operation. |
| 383 | * |
383 | * |
| 384 | * @param type Selects between context and page demap. |
384 | * @param type Selects between context and page demap. |
| 385 | * @param context_encoding Specifies which Context register has Context ID for demap. |
385 | * @param context_encoding Specifies which Context register has Context ID for |
| - | 386 | * demap. |
|
| 386 | * @param page Address which is on the page to be demapped. |
387 | * @param page Address which is on the page to be demapped. |
| 387 | */ |
388 | */ |
| 388 | static inline void itlb_demap(int type, int context_encoding, uintptr_t page) |
389 | static inline void itlb_demap(int type, int context_encoding, uintptr_t page) |
| 389 | { |
390 | { |
| 390 | tlb_demap_addr_t da; |
391 | tlb_demap_addr_t da; |
| Line 395... | Line 396... | ||
| 395 | 396 | ||
| 396 | da.type = type; |
397 | da.type = type; |
| 397 | da.context = context_encoding; |
398 | da.context = context_encoding; |
| 398 | da.vpn = pg.vpn; |
399 | da.vpn = pg.vpn; |
| 399 | 400 | ||
| 400 | asi_u64_write(ASI_IMMU_DEMAP, da.value, 0); /* da.value is the address within the ASI */ |
401 | asi_u64_write(ASI_IMMU_DEMAP, da.value, 0); /* da.value is the |
| - | 402 | * address within the |
|
| - | 403 | * ASI */ |
|
| 401 | flush(); |
404 | flush(); |
| 402 | } |
405 | } |
| 403 | 406 | ||
| 404 | /** Perform DMMU TLB Demap Operation. |
407 | /** Perform DMMU TLB Demap Operation. |
| 405 | * |
408 | * |
| 406 | * @param type Selects between context and page demap. |
409 | * @param type Selects between context and page demap. |
| 407 | * @param context_encoding Specifies which Context register has Context ID for demap. |
410 | * @param context_encoding Specifies which Context register has Context ID for |
| - | 411 | * demap. |
|
| 408 | * @param page Address which is on the page to be demapped. |
412 | * @param page Address which is on the page to be demapped. |
| 409 | */ |
413 | */ |
| 410 | static inline void dtlb_demap(int type, int context_encoding, uintptr_t page) |
414 | static inline void dtlb_demap(int type, int context_encoding, uintptr_t page) |
| 411 | { |
415 | { |
| 412 | tlb_demap_addr_t da; |
416 | tlb_demap_addr_t da; |
| Line 417... | Line 421... | ||
| 417 | 421 | ||
| 418 | da.type = type; |
422 | da.type = type; |
| 419 | da.context = context_encoding; |
423 | da.context = context_encoding; |
| 420 | da.vpn = pg.vpn; |
424 | da.vpn = pg.vpn; |
| 421 | 425 | ||
| 422 | asi_u64_write(ASI_DMMU_DEMAP, da.value, 0); /* da.value is the address within the ASI */ |
426 | asi_u64_write(ASI_DMMU_DEMAP, da.value, 0); /* da.value is the |
| - | 427 | * address within the |
|
| - | 428 | * ASI */ |
|
| 423 | membar(); |
429 | membar(); |
| 424 | } |
430 | } |
| 425 | 431 | ||
| 426 | extern void fast_instruction_access_mmu_miss(int n, istate_t *istate); |
432 | extern void fast_instruction_access_mmu_miss(int n, istate_t *istate); |
| 427 | extern void fast_data_access_mmu_miss(int n, istate_t *istate); |
433 | extern void fast_data_access_mmu_miss(int n, istate_t *istate); |