Rev 3022 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3022 | Rev 4055 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | #include <arch/mm/page.h> |
45 | #include <arch/mm/page.h> |
46 | #include <arch/stack.h> |
46 | #include <arch/stack.h> |
47 | #include <genarch/ofw/ofw_tree.h> |
47 | #include <genarch/ofw/ofw_tree.h> |
48 | #include <userspace.h> |
48 | #include <userspace.h> |
49 | #include <ddi/irq.h> |
49 | #include <ddi/irq.h> |
- | 50 | #include <string.h> |
|
50 | 51 | ||
51 | bootinfo_t bootinfo; |
52 | bootinfo_t bootinfo; |
52 | 53 | ||
53 | /** Perform sparc64 specific initialization before main_bsp() is called. */ |
54 | /** Perform sparc64-specific initialization before main_bsp() is called. */ |
54 | void arch_pre_main(void) |
55 | void arch_pre_main(void) |
55 | { |
56 | { |
56 | /* Copy init task info. */ |
57 | /* Copy init task info. */ |
57 | init.cnt = bootinfo.taskmap.count; |
58 | init.cnt = bootinfo.taskmap.count; |
58 | 59 | ||
59 | uint32_t i; |
60 | uint32_t i; |
60 | 61 | ||
61 | for (i = 0; i < bootinfo.taskmap.count; i++) { |
62 | for (i = 0; i < bootinfo.taskmap.count; i++) { |
62 | init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr; |
63 | init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr; |
63 | init.tasks[i].size = bootinfo.taskmap.tasks[i].size; |
64 | init.tasks[i].size = bootinfo.taskmap.tasks[i].size; |
- | 65 | strncpy(init.tasks[i].name, bootinfo.taskmap.tasks[i].name, |
|
- | 66 | CONFIG_TASK_NAME_BUFLEN); |
|
64 | } |
67 | } |
65 | 68 | ||
66 | /* Copy boot allocations info. */ |
69 | /* Copy boot allocations info. */ |
67 | ballocs.base = bootinfo.ballocs.base; |
70 | ballocs.base = bootinfo.ballocs.base; |
68 | ballocs.size = bootinfo.ballocs.size; |
71 | ballocs.size = bootinfo.ballocs.size; |
Line 84... | Line 87... | ||
84 | /* |
87 | /* |
85 | * We have 2^11 different interrupt vectors. |
88 | * We have 2^11 different interrupt vectors. |
86 | * But we only create 128 buckets. |
89 | * But we only create 128 buckets. |
87 | */ |
90 | */ |
88 | irq_init(1 << 11, 128); |
91 | irq_init(1 << 11, 128); |
89 | - | ||
90 | standalone_sparc64_console_init(); |
- | |
91 | } |
92 | } |
92 | } |
93 | } |
93 | 94 | ||
94 | void arch_post_cpu_init(void) |
95 | void arch_post_cpu_init(void) |
95 | { |
96 | { |
Line 99... | Line 100... | ||
99 | { |
100 | { |
100 | } |
101 | } |
101 | 102 | ||
102 | void arch_post_smp_init(void) |
103 | void arch_post_smp_init(void) |
103 | { |
104 | { |
104 | static thread_t *t = NULL; |
105 | if (config.cpu_active == 1) { |
105 | - | ||
- | 106 | standalone_sparc64_console_init(); |
|
106 | 107 | ||
107 | if (!t) { |
- | |
108 | /* |
- | |
109 | * Create thread that polls keyboard. |
108 | /* Create thread that polls keyboard. |
- | 109 | * XXX: this is only used by sgcn now |
|
110 | */ |
110 | */ |
111 | t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll", true); |
111 | thread_t *t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll", |
- | 112 | true); |
|
112 | if (!t) |
113 | if (!t) |
113 | panic("cannot create kkbdpoll\n"); |
114 | panic("Cannot create kkbdpoll."); |
114 | thread_ready(t); |
115 | thread_ready(t); |
115 | } |
116 | } |
116 | } |
117 | } |
117 | 118 | ||
118 | /** Calibrate delay loop. |
119 | /** Calibrate delay loop. |
Line 159... | Line 160... | ||
159 | { |
160 | { |
160 | // TODO |
161 | // TODO |
161 | while (1); |
162 | while (1); |
162 | } |
163 | } |
163 | 164 | ||
- | 165 | /** Construct function pointer |
|
- | 166 | * |
|
- | 167 | * @param fptr function pointer structure |
|
- | 168 | * @param addr function address |
|
- | 169 | * @param caller calling function address |
|
- | 170 | * |
|
- | 171 | * @return address of the function pointer |
|
- | 172 | * |
|
- | 173 | */ |
|
- | 174 | void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller) |
|
- | 175 | { |
|
- | 176 | return addr; |
|
- | 177 | } |
|
- | 178 | ||
164 | /** @} |
179 | /** @} |
165 | */ |
180 | */ |