AW: sparc and trap 4 (floating point disabled)
Schweikhardt, Jens (TSPCE3-TL4)
Jens.Schweikhardt at tesat.de
Wed Dec 4 12:24:44 UTC 2019
Hello Sebastian et al.,
> Hello Jens,
> in uni-processor configurations a lazy floating-point context switch is done on SPARC. You can search for SPARC_USE_LAZY_FP_SWITCH in the sources.
This appears to be the reason for the observed behavior. Looking at the disassembled application code:
Disassembly of section .text:
40000000 <_text_start>:
*/
PUBLIC(trap_table)
SYM(trap_table):
RTRAP( 0, SYM(hard_reset) ); ! 00 reset trap
40000000:a0 10 00 00 mov %g0, %l0
40000004:29 10 00 04 sethi %hi(0x40001000), %l4
40000008:81 c5 20 00 jmp %l4
4000000c:a6 10 20 00 clr %l3
BAD_TRAP; ! 01 instruction access
40000010:91 d0 20 00 ta 0
40000014:01 00 00 00 nop
40000018:01 00 00 00 nop
4000001c:01 00 00 00 nop
! exception
BAD_TRAP; ! 02 illegal instruction
40000020:91 d0 20 00 ta 0
40000024:01 00 00 00 nop
40000028:01 00 00 00 nop
4000002c:01 00 00 00 nop
BAD_TRAP; ! 03 privileged instruction
40000030:91 d0 20 00 ta 0
40000034:01 00 00 00 nop
40000038:01 00 00 00 nop
4000003c:01 00 00 00 nop
#if defined(SPARC_USE_LAZY_FP_SWITCH)
FPDIS_TRAP(SYM(syscall_lazy_fp_switch)); ! 04 fp disabled
40000040:a1 48 00 00 rd %psr, %l0
40000044:29 10 00 bd sethi %hi(0x4002f400), %l4
40000048:81 c5 22 00 jmp %l4 + 0x200! 4002f600 <syscall_lazy_fp_switch>
4000004c:27 00 00 04 sethi %hi(0x1000), %l3
#else
BAD_TRAP; ! 04 fp disabled
#endif
If it isn't already, may I suggest adding some wording in the sparc-specific documentation?
It might save someone in the future a bit of head-scratching. :-) Thanks!
Jens
________________________________
Tesat-Spacecom GmbH & Co. KG
Sitz: Backnang; Registergericht: Amtsgericht Stuttgart HRA 270977
Persoenlich haftender Gesellschafter: Tesat-Spacecom Geschaeftsfuehrungs GmbH;
Sitz: Backnang; Registergericht: Amtsgericht Stuttgart HRB 271658;
Geschaeftsfuehrung: Dr. Marc Steckling, Kerstin Basche, Ralf Zimmermann
[banner]
More information about the users
mailing list