mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-16 15:11:52 +00:00
Move IVOR setup from assembler to C, decreasing required assumptions about
address formats for trap handlers.
This commit is contained in:
parent
6153d46515
commit
6df61aad0a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279623
@ -536,42 +536,6 @@ __boot_page_padding:
|
||||
/* locore subroutines */
|
||||
/************************************************************************/
|
||||
|
||||
ivor_setup:
|
||||
/* Set base address of interrupt handler routines */
|
||||
lis %r3, interrupt_vector_base@h
|
||||
mtspr SPR_IVPR, %r3
|
||||
|
||||
/* Assign interrupt handler routines offsets */
|
||||
li %r3, int_critical_input@l
|
||||
mtspr SPR_IVOR0, %r3
|
||||
li %r3, int_machine_check@l
|
||||
mtspr SPR_IVOR1, %r3
|
||||
li %r3, int_data_storage@l
|
||||
mtspr SPR_IVOR2, %r3
|
||||
li %r3, int_instr_storage@l
|
||||
mtspr SPR_IVOR3, %r3
|
||||
li %r3, int_external_input@l
|
||||
mtspr SPR_IVOR4, %r3
|
||||
li %r3, int_alignment@l
|
||||
mtspr SPR_IVOR5, %r3
|
||||
li %r3, int_program@l
|
||||
mtspr SPR_IVOR6, %r3
|
||||
li %r3, int_syscall@l
|
||||
mtspr SPR_IVOR8, %r3
|
||||
li %r3, int_decrementer@l
|
||||
mtspr SPR_IVOR10, %r3
|
||||
li %r3, int_fixed_interval_timer@l
|
||||
mtspr SPR_IVOR11, %r3
|
||||
li %r3, int_watchdog@l
|
||||
mtspr SPR_IVOR12, %r3
|
||||
li %r3, int_data_tlb_error@l
|
||||
mtspr SPR_IVOR13, %r3
|
||||
li %r3, int_inst_tlb_error@l
|
||||
mtspr SPR_IVOR14, %r3
|
||||
li %r3, int_debug@l
|
||||
mtspr SPR_IVOR15, %r3
|
||||
blr
|
||||
|
||||
/*
|
||||
* void tid_flush(tlbtid_t tid);
|
||||
*
|
||||
|
@ -187,6 +187,51 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_booke_startup, NULL);
|
||||
void print_kernel_section_addr(void);
|
||||
void print_kenv(void);
|
||||
u_int booke_init(uint32_t, uint32_t);
|
||||
void ivor_setup(void);
|
||||
|
||||
extern void *interrupt_vector_base;
|
||||
extern void *int_critical_input;
|
||||
extern void *int_machine_check;
|
||||
extern void *int_data_storage;
|
||||
extern void *int_instr_storage;
|
||||
extern void *int_external_input;
|
||||
extern void *int_alignment;
|
||||
extern void *int_program;
|
||||
extern void *int_syscall;
|
||||
extern void *int_decrementer;
|
||||
extern void *int_fixed_interval_timer;
|
||||
extern void *int_watchdog;
|
||||
extern void *int_data_tlb_error;
|
||||
extern void *int_inst_tlb_error;
|
||||
extern void *int_debug;
|
||||
|
||||
#define SET_TRAP(ivor, handler) \
|
||||
KASSERT(((uintptr_t)(&handler) & ~0xffffUL) == \
|
||||
((uintptr_t)(&interrupt_vector_base) & ~0xffffUL), \
|
||||
("Handler " #handler " too far from interrupt vector base")); \
|
||||
mtspr(ivor, (uintptr_t)(&handler) & 0xffffUL);
|
||||
|
||||
void
|
||||
ivor_setup(void)
|
||||
{
|
||||
|
||||
mtspr(SPR_IVPR, ((uintptr_t)&interrupt_vector_base) & 0xffff0000);
|
||||
|
||||
SET_TRAP(SPR_IVOR0, int_critical_input);
|
||||
SET_TRAP(SPR_IVOR1, int_machine_check);
|
||||
SET_TRAP(SPR_IVOR2, int_data_storage);
|
||||
SET_TRAP(SPR_IVOR3, int_instr_storage);
|
||||
SET_TRAP(SPR_IVOR4, int_external_input);
|
||||
SET_TRAP(SPR_IVOR5, int_alignment);
|
||||
SET_TRAP(SPR_IVOR6, int_program);
|
||||
SET_TRAP(SPR_IVOR8, int_syscall);
|
||||
SET_TRAP(SPR_IVOR10, int_decrementer);
|
||||
SET_TRAP(SPR_IVOR11, int_fixed_interval_timer);
|
||||
SET_TRAP(SPR_IVOR12, int_watchdog);
|
||||
SET_TRAP(SPR_IVOR13, int_data_tlb_error);
|
||||
SET_TRAP(SPR_IVOR14, int_inst_tlb_error);
|
||||
SET_TRAP(SPR_IVOR15, int_debug);
|
||||
}
|
||||
|
||||
static void
|
||||
cpu_booke_startup(void *dummy)
|
||||
|
Loading…
Reference in New Issue
Block a user