Rev 2071 | Rev 2106 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2089 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #ifndef KERN_TLB_H_ |
35 | #ifndef KERN_TLB_H_ |
36 | #define KERN_TLB_H_ |
36 | #define KERN_TLB_H_ |
37 | 37 | ||
38 | #include <arch/mm/asid.h> |
38 | #include <arch/mm/asid.h> |
39 | #include <arch/types.h> |
39 | #include <arch/types.h> |
40 | #include <typedefs.h> |
- | |
41 | 40 | ||
42 | /** |
41 | /** |
43 | * Number of TLB shootdown messages that can be queued in processor |
42 | * Number of TLB shootdown messages that can be queued in processor |
44 | * tlb_messages queue. |
43 | * tlb_messages queue. |
45 | */ |
44 | */ |
46 | #define TLB_MESSAGE_QUEUE_LEN 10 |
45 | #define TLB_MESSAGE_QUEUE_LEN 10 |
47 | 46 | ||
48 | /** Type of TLB shootdown message. */ |
47 | /** Type of TLB shootdown message. */ |
49 | enum tlb_invalidate_type { |
48 | typedef enum { |
50 | TLB_INVL_INVALID = 0, /**< Invalid type. */ |
49 | TLB_INVL_INVALID = 0, /**< Invalid type. */ |
51 | TLB_INVL_ALL, /**< Invalidate all entries in TLB. */ |
50 | TLB_INVL_ALL, /**< Invalidate all entries in TLB. */ |
52 | TLB_INVL_ASID, /**< Invalidate all entries belonging to one address space. */ |
51 | TLB_INVL_ASID, /**< Invalidate all entries belonging to one address space. */ |
53 | TLB_INVL_PAGES /**< Invalidate specified page range belonging to one address space. */ |
52 | TLB_INVL_PAGES /**< Invalidate specified page range belonging to one address space. */ |
54 | }; |
- | |
55 | typedef enum tlb_invalidate_type tlb_invalidate_type_t; |
53 | } tlb_invalidate_type_t; |
56 | 54 | ||
57 | /** TLB shootdown message. */ |
55 | /** TLB shootdown message. */ |
58 | struct tlb_shootdown_msg { |
56 | typedef struct { |
59 | tlb_invalidate_type_t type; /**< Message type. */ |
57 | tlb_invalidate_type_t type; /**< Message type. */ |
60 | asid_t asid; /**< Address space identifier. */ |
58 | asid_t asid; /**< Address space identifier. */ |
61 | uintptr_t page; /**< Page address. */ |
59 | uintptr_t page; /**< Page address. */ |
62 | count_t count; /**< Number of pages to invalidate. */ |
60 | count_t count; /**< Number of pages to invalidate. */ |
63 | }; |
- | |
64 | typedef struct tlb_shootdown_msg tlb_shootdown_msg_t; |
61 | } tlb_shootdown_msg_t; |
65 | 62 | ||
66 | extern void tlb_init(void); |
63 | extern void tlb_init(void); |
67 | 64 | ||
68 | #ifdef CONFIG_SMP |
65 | #ifdef CONFIG_SMP |
69 | extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, uintptr_t page, count_t count); |
66 | extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, uintptr_t page, count_t count); |