Rev 2282 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2282 | Rev 2284 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | #include <arch/debug_print/print.h> |
45 | #include <arch/debug_print/print.h> |
46 | #include <print.h> |
46 | #include <print.h> |
47 | #include <config.h> |
47 | #include <config.h> |
48 | #include <interrupt.h> |
48 | #include <interrupt.h> |
49 | #include <arch/regutils.h> |
49 | #include <arch/regutils.h> |
50 | //#include <arch/drivers/init.h> |
50 | #include <arch/drivers/gxemul.h> |
51 | #include <userspace.h> |
51 | #include <userspace.h> |
52 | bootinfo_t bootinfo; |
52 | bootinfo_t bootinfo; |
- | 53 | uintptr_t supervisor_sp /*__attribute__ ((section (".text")))*/; |
|
53 | 54 | ||
54 | //TODO: Remove include and move into exceptio.c |
55 | //TODO: Remove include and move into exceptio.c |
55 | #include <arch/exception.h> |
56 | #include <arch/exception.h> |
56 | 57 | ||
57 | #include <syscall/syscall.h> |
58 | #include <syscall/syscall.h> |
Line 94... | Line 95... | ||
94 | 95 | ||
95 | for (i = 0; i < bootinfo.cnt; ++i) { |
96 | for (i = 0; i < bootinfo.cnt; ++i) { |
96 | init.tasks[i].addr = bootinfo.tasks[i].addr; |
97 | init.tasks[i].addr = bootinfo.tasks[i].addr; |
97 | init.tasks[i].size = bootinfo.tasks[i].size; |
98 | init.tasks[i].size = bootinfo.tasks[i].size; |
98 | } |
99 | } |
99 | - | ||
100 | /* TODO this code just setups irq testing bed */ |
- | |
101 | setup_exception_stacks(); |
- | |
102 | } |
100 | } |
103 | 101 | ||
104 | void arch_pre_mm_init(void) |
102 | void arch_pre_mm_init(void) |
105 | { |
103 | { |
106 | dprintf("arch_pre_mm_init\n"); |
104 | dprintf("arch_pre_mm_init\n"); |
107 | 105 | ||
108 | /* It is not assumed by default */ |
106 | /* It is not assumed by default */ |
109 | interrupts_disable(); |
107 | interrupts_disable(); |
- | 108 | ||
- | 109 | setup_exception_stacks(); |
|
- | 110 | ||
110 | 111 | ||
111 | } |
112 | } |
112 | 113 | ||
113 | void prefetch_exception_generator(void); |
114 | void prefetch_exception_generator(void); |
114 | 115 | ||
115 | void arch_post_mm_init(void) |
116 | void arch_post_mm_init(void) |
116 | { |
117 | { |
117 | dprintf("arch_post_mm_init start()\n"); |
118 | // dprintf("arch_post_mm_init start()\n"); |
118 | /* Initialize dispatch table |
119 | gxemul_hw_map_init(); |
- | 120 | ||
119 | Note: Have to be after page_init() */ |
121 | /* Initialize dispatch table */ |
120 | exception_init(); |
122 | exception_init(); |
121 | 123 | ||
122 | // drivers_init(); |
124 | // drivers_init(); |
123 | interrupt_init(); |
125 | interrupt_init(); |
124 | 126 | ||
125 | // console_init(device_assign_devno()); |
127 | console_init(device_assign_devno()); |
126 | //fb_init(0x12000000, 640, 480, 1920, VISUAL_RGB_8_8_8); |
128 | //fb_init(0x12000000, 640, 480, 1920, VISUAL_RGB_8_8_8); |
127 | 129 | ||
128 | // interrupts_enable(); |
130 | interrupts_enable(); |
129 | // asm __volatile__ ("ldr pc, =0x70000000"); // prefetch exception |
- | |
130 | //while(1); |
- | |
131 | /* |
- | |
132 | uspace_arg_t uspace; |
- | |
133 | uspace.uspace_entry = (void*)prefetch_exception_generator; |
- | |
134 | uspace.uspace_stack = (void*)0x6000000; |
- | |
135 | uspace.uspace_uarg = &uspace; |
- | |
136 | |
- | |
137 | userspace(&uspace); |
- | |
138 | */ |
- | |
139 | dprintf("arch_post_mm_init end()\n"); |
131 | dprintf("arch_post_mm_init end()\n"); |
- | 132 | // while(1); |
|
- | 133 | ||
140 | } |
134 | } |
141 | 135 | ||
142 | void arch_post_cpu_init(void) |
136 | void arch_post_cpu_init(void) |
143 | { |
137 | { |
144 | /* TODO */ |
138 | /* TODO */ |
Line 161... | Line 155... | ||
161 | } |
155 | } |
162 | 156 | ||
163 | /** Perform arm32 specific tasks needed before the new thread is scheduled. */ |
157 | /** Perform arm32 specific tasks needed before the new thread is scheduled. */ |
164 | void before_thread_runs_arch(void) |
158 | void before_thread_runs_arch(void) |
165 | { |
159 | { |
166 | /* TODO */ |
160 | supervisor_sp = (uintptr_t) &THREAD->kstack/*[THREAD_STACK_SIZE-SP_DELTA]*/; |
167 | } |
161 | } |
168 | 162 | ||
169 | void after_thread_ran_arch(void) |
163 | void after_thread_ran_arch(void) |
170 | { |
164 | { |
171 | /* TODO */ |
165 | /* TODO */ |