Rev 2049 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2049 | Rev 2055 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | #include <print.h> |
38 | #include <print.h> |
39 | #include <arch/register.h> |
39 | #include <arch/register.h> |
40 | #include <genarch/ofw/ofw_tree.h> |
40 | #include <genarch/ofw/ofw_tree.h> |
41 | #include <arch/types.h> |
41 | #include <arch/types.h> |
42 | #include <arch/drivers/tick.h> |
42 | #include <arch/drivers/tick.h> |
43 | #include <arch/mm/page.h> |
- | |
44 | #include <arch/mm/tlb.h> |
- | |
45 | #include <macros.h> |
- | |
46 | 43 | ||
47 | /** Perform sparc64 specific initialization of the processor structure for the |
44 | /** Perform sparc64 specific initialization of the processor structure for the |
48 | * current processor. |
45 | * current processor. |
49 | */ |
46 | */ |
50 | void cpu_arch_init(void) |
47 | void cpu_arch_init(void) |
Line 78... | Line 75... | ||
78 | node = ofw_tree_find_peer_by_device_type(node, "cpu"); |
75 | node = ofw_tree_find_peer_by_device_type(node, "cpu"); |
79 | } |
76 | } |
80 | 77 | ||
81 | CPU->arch.clock_frequency = clock_frequency; |
78 | CPU->arch.clock_frequency = clock_frequency; |
82 | tick_init(); |
79 | tick_init(); |
83 | - | ||
84 | /* |
- | |
85 | * Lock CPU stack in DTLB. |
- | |
86 | */ |
- | |
87 | uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH); |
- | |
88 | - | ||
89 | if (!overlaps((uintptr_t) CPU->stack, PAGE_SIZE, base, (1 << |
- | |
90 | KERNEL_PAGE_WIDTH))) { |
- | |
91 | /* |
- | |
92 | * Kernel stack of this processor is not locked in DTLB. |
- | |
93 | * First, demap any already existing mappings. |
- | |
94 | * Second, create a locked mapping for it. |
- | |
95 | */ |
- | |
96 | dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, (uintptr_t) |
- | |
97 | CPU->stack); |
- | |
98 | dtlb_insert_mapping((uintptr_t) CPU->stack, KA2PA(CPU->stack), |
- | |
99 | PAGESIZE_8K, true, true); |
- | |
100 | } |
- | |
101 | } |
80 | } |
102 | 81 | ||
103 | /** Read version information from the current processor. */ |
82 | /** Read version information from the current processor. */ |
104 | void cpu_identify(void) |
83 | void cpu_identify(void) |
105 | { |
84 | { |