Rev 324 | Rev 329 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 324 | Rev 326 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | #include <arch/asm/regname.h> |
32 | #include <arch/asm/regname.h> |
33 | #include <arch/asm.h> |
33 | #include <arch/asm.h> |
34 | #include <mm/vm.h> |
34 | #include <mm/vm.h> |
35 | #include <userspace.h> |
35 | #include <userspace.h> |
36 | #include <arch/console.h> |
36 | #include <arch/console.h> |
- | 37 | #include <memstr.h> |
|
- | 38 | ||
- | 39 | /* Size of the code jumping to the exception handler code |
|
- | 40 | * - J+NOP |
|
- | 41 | */ |
|
- | 42 | #define EXCEPTION_JUMP_SIZE 8 |
|
- | 43 | ||
- | 44 | #define TLB_EXC ((char *) 0x80000000) |
|
- | 45 | #define NORM_EXC ((char *) 0x80000180) |
|
- | 46 | #define CACHE_EXC ((char *) 0x80000100) |
|
- | 47 | ||
- | 48 | #include <arch/debug.h> |
|
37 | 49 | ||
38 | void arch_pre_mm_init(void) |
50 | void arch_pre_mm_init(void) |
39 | { |
51 | { |
- | 52 | /* Copy the exception vectors to the right places */ |
|
- | 53 | memcpy(TLB_EXC, (char *)tlb_refill_entry, EXCEPTION_JUMP_SIZE); |
|
- | 54 | memcpy(NORM_EXC, (char *)exception_entry, EXCEPTION_JUMP_SIZE); |
|
- | 55 | memcpy(CACHE_EXC, (char *)cache_error_entry, EXCEPTION_JUMP_SIZE); |
|
- | 56 | ||
- | 57 | ||
40 | /* |
58 | /* |
41 | * Switch to BEV normal level so that exception vectors point to the kernel. |
59 | * Switch to BEV normal level so that exception vectors point to the kernel. |
42 | * Clear the error level. |
60 | * Clear the error level. |
43 | */ |
61 | */ |
44 | cp0_status_write(cp0_status_read() & ~(cp0_status_bev_bootstrap_bit|cp0_status_erl_error_bit)); |
62 | cp0_status_write(cp0_status_read() & ~(cp0_status_bev_bootstrap_bit|cp0_status_erl_error_bit)); |