Forum Discussion
Altera_Forum
Honored Contributor
16 years agoHi,
--- Quote Start --- The other problem I'm having trying to implement this is that the SSRAM seems to be used for something already. There is data there, and if I try to write to it, whether it's the buffer or running a program that uses code with its text section there (I tried modifying vmlinux.lds.S), the system freezes. As far as I can tell the hardware doesn't use the SSRAM for anything and I haven't previously modified uClinux to use it in any way. --- Quote End --- I forgot to mention this. Where did you locate the exception hook codes? In the file '/home/***/nios2-linux/linux-2.6/arch/nios2/kernel/head.S',
/* This is the default location for the exception
* handler. Code in jump to our handler
*/
exc_hook:
movia r24,inthandler
jmp r24
1:
/*
* After flushing the instruction cache, we must flush the data
* cache.
*/
movia r1,NIOS2_DCACHE_SIZE
movi r2,NIOS2_DCACHE_LINE_SIZE
data_flush:
flushd 0(r1)
sub r1,r1,r2
bgt r1,r0,data_flush
# ifdef CONFIG_BREAK_ON_START
break# endif //CONFIG_BREAK_ON_START
# if defined(CPU_EXCEPT_ADDRESS_ASM) && (CPU_EXCEPT_ADDRESS_ASM != (LINUX_SDRAM_START + 0x20))
/* Copy an instruction sequence to put at the exception address */
movia r2,exc_hook
movia r3,CPU_EXCEPT_ADDRESS_ASM
ldw r1,0(r2)
stw r1,0(r3)
ldw r1,4(r2)
stw r1,4(r3)
ldw r1,8(r2)
stw r1,8(r3)
flushd 0(r3)
flushd 4(r3)
flushd 8(r3)
flushi r3
addi r3,r3,4
flushi r3
addi r3,r3,4
flushi r3# endif
the code 'exc_hook' is copied to the new location. Kazu