Rev 3386 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3386 | Rev 4153 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #include <arch.h> |
35 | #include <arch.h> |
36 | #include <debug.h> |
36 | #include <debug.h> |
37 | #include <config.h> |
37 | #include <config.h> |
38 | #include <arch/trap/trap.h> |
38 | #include <arch/trap/trap.h> |
39 | #include <arch/console.h> |
39 | #include <arch/console.h> |
40 | #include <proc/thread.h> |
- | |
41 | #include <console/console.h> |
40 | #include <console/console.h> |
42 | #include <arch/boot/boot.h> |
41 | #include <arch/boot/boot.h> |
43 | #include <arch/arch.h> |
42 | #include <arch/arch.h> |
44 | #include <arch/asm.h> |
43 | #include <arch/asm.h> |
45 | #include <arch/mm/page.h> |
44 | #include <arch/mm/page.h> |
46 | #include <arch/stack.h> |
45 | #include <arch/stack.h> |
47 | #include <genarch/ofw/ofw_tree.h> |
46 | #include <genarch/ofw/ofw_tree.h> |
48 | #include <userspace.h> |
47 | #include <userspace.h> |
49 | #include <ddi/irq.h> |
48 | #include <ddi/irq.h> |
- | 49 | #include <string.h> |
|
50 | 50 | ||
51 | bootinfo_t bootinfo; |
51 | bootinfo_t bootinfo; |
52 | 52 | ||
53 | /** Perform sparc64 specific initialization before main_bsp() is called. */ |
53 | /** Perform sparc64-specific initialization before main_bsp() is called. */ |
54 | void arch_pre_main(void) |
54 | void arch_pre_main(void) |
55 | { |
55 | { |
56 | /* Copy init task info. */ |
56 | /* Copy init task info. */ |
57 | init.cnt = bootinfo.taskmap.count; |
57 | init.cnt = bootinfo.taskmap.count; |
58 | 58 | ||
59 | uint32_t i; |
59 | uint32_t i; |
60 | 60 | ||
61 | for (i = 0; i < bootinfo.taskmap.count; i++) { |
61 | for (i = 0; i < bootinfo.taskmap.count; i++) { |
62 | init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr; |
62 | init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr; |
63 | init.tasks[i].size = bootinfo.taskmap.tasks[i].size; |
63 | init.tasks[i].size = bootinfo.taskmap.tasks[i].size; |
- | 64 | strncpy(init.tasks[i].name, bootinfo.taskmap.tasks[i].name, |
|
- | 65 | CONFIG_TASK_NAME_BUFLEN); |
|
64 | } |
66 | } |
65 | 67 | ||
66 | /* Copy boot allocations info. */ |
68 | /* Copy boot allocations info. */ |
67 | ballocs.base = bootinfo.ballocs.base; |
69 | ballocs.base = bootinfo.ballocs.base; |
68 | ballocs.size = bootinfo.ballocs.size; |
70 | ballocs.size = bootinfo.ballocs.size; |
Line 84... | Line 86... | ||
84 | /* |
86 | /* |
85 | * We have 2^11 different interrupt vectors. |
87 | * We have 2^11 different interrupt vectors. |
86 | * But we only create 128 buckets. |
88 | * But we only create 128 buckets. |
87 | */ |
89 | */ |
88 | irq_init(1 << 11, 128); |
90 | irq_init(1 << 11, 128); |
89 | - | ||
90 | standalone_sparc64_console_init(); |
- | |
91 | } |
91 | } |
92 | } |
92 | } |
93 | 93 | ||
94 | void arch_post_cpu_init(void) |
94 | void arch_post_cpu_init(void) |
95 | { |
95 | { |
Line 99... | Line 99... | ||
99 | { |
99 | { |
100 | } |
100 | } |
101 | 101 | ||
102 | void arch_post_smp_init(void) |
102 | void arch_post_smp_init(void) |
103 | { |
103 | { |
104 | static thread_t *t = NULL; |
- | |
105 | - | ||
106 | - | ||
107 | if (!t) { |
- | |
108 | /* |
- | |
109 | * Create thread that polls keyboard. |
- | |
110 | */ |
- | |
111 | t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll", true); |
- | |
112 | if (!t) |
- | |
113 | panic("cannot create kkbdpoll\n"); |
104 | standalone_sparc64_console_init(); |
114 | thread_ready(t); |
- | |
115 | } |
- | |
116 | } |
105 | } |
117 | 106 | ||
118 | /** Calibrate delay loop. |
107 | /** Calibrate delay loop. |
119 | * |
108 | * |
120 | * On sparc64, we implement delay() by waiting for the TICK register to |
109 | * On sparc64, we implement delay() by waiting for the TICK register to |
Line 159... | Line 148... | ||
159 | { |
148 | { |
160 | // TODO |
149 | // TODO |
161 | while (1); |
150 | while (1); |
162 | } |
151 | } |
163 | 152 | ||
- | 153 | /** Construct function pointer |
|
- | 154 | * |
|
- | 155 | * @param fptr function pointer structure |
|
- | 156 | * @param addr function address |
|
- | 157 | * @param caller calling function address |
|
- | 158 | * |
|
- | 159 | * @return address of the function pointer |
|
- | 160 | * |
|
- | 161 | */ |
|
- | 162 | void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller) |
|
- | 163 | { |
|
- | 164 | return addr; |
|
- | 165 | } |
|
- | 166 | ||
164 | /** @} |
167 | /** @} |
165 | */ |
168 | */ |