Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- Hi, Please try to preprocess the 'entry.S' with -E switch instead of -c, like
nios2-linux-uclibc-gcc -E -D __ASSEMBLY__ -D __KERNEL__ -I/home/developer/altera/nios2-linux/linux-2.6/include -I/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include -I/home/developer/altera/nios2-linux/uClinux-dist/linux-2.6.x/include /home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S > entry.txt
and check the output file by your editor whether the code 'rdctl r5,exception' and 'rdctl r6,badaddr' are transferd invariantly. Note that with the -E switch, the compiler uses the standard output for its output. If the preprocessing is normal, then make a test file like
// test.S
rdctl r5,exception
rdctl r6,badaddr
and compile it.
nios2-linux-uclibc-gcc -c test.S
Does it genarate errors? Kazu --- Quote End --- Yes, the file test.S generates the same errors. Using the -E switch generated output difficult for me to understand # 1 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S"# 1 "<built-in>"# 1 "<command line>"# 1 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S"# 35 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S"# 1 "/home/developer/altera/nios2-linux/linux-2.6/include/linux/sys.h" 1# 36 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S" 2# 1 "/home/developer/altera/nios2-linux/linux-2.6/include/linux/linkage.h" 1
# 1 "/home/developer/altera/nios2-linux/linux-2.6/include/linux/compiler.h" 1# 5 "/home/developer/altera/nios2-linux/linux-2.6/include/linux/linkage.h" 2# 1 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include/asm/linkage.h" 1# 6 "/home/developer/altera/nios2-linux/linux-2.6/include/linux/linkage.h" 2# 37 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S" 2# 1 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include/asm/asm-offsets.h" 1# 1 "/home/developer/altera/nios2-linux/uClinux-dist/linux-2.6.x/include/generated/asm-offsets.h" 1# 2 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include/asm/asm-offsets.h" 2# 38 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/kernel/entry.S" 2# 1 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include/asm/asm-macros.h" 1# 33 "/home/developer/altera/nios2-linux/linux-2.6/arch/nios2/include/asm/asm-macros.h"
.macro ANDI32 reg1,reg2,mask
.if \mask & 0xffff
.if \mask & 0xffff0000
movhi \reg1,%hi(\mask)
movui \reg1,%lo(\mask)
and \reg1,\reg1,\reg2
.else
andi \reg1,\reg2,%lo(\mask)
.endif
.else
andhi \reg1,\reg2,%hi(\mask)
.endif
.endm
.macro ORI32 reg1,reg2,mask
.if \mask & 0xffff
.if \mask & 0xffff0000
orhi \reg1,\reg2,%hi(\mask)
ori \reg1,\reg2,%lo(\mask)
.else
ori \reg1,\reg2,%lo(\mask)
.endif
.else
orhi \reg1,\reg2,%hi(\mask)
.endif
.endm