zoukankan      html  css  js  c++  java
  • rtems floating poing switch

    https://lists.rtems.org/pipermail/users/2019-December/067321.html

    Hello, world
    
    
    I have a question about the use of trap 4 by RTEMS on Sparc32 (leon3).
    Since our app needs FP, we set the PSR[EF] bit during the boot process before RTEMS is invoked.
    Since we don't expect the fp_disabled trap (4) to occur, we install a fatal handler for it with
    rtems_interrupt_catch(&fatalTrapHandler, 4, &old);
    
    However, the fatalTrapHandler is invoked a short time after application start (we use the Init() task
    and start a handful of additional tasks, all of which have attribute RTEMS_FLOATING_POINT)
    and the PSR[EF] bit is indeed cleared. None of our tasks
    clears that bit, so we suspect RTEMS does it for some reason.
    
    Question: is an RTEMS/sparc application allowed to install a handler for trap 4? I could not find an
    answer in the docs for SPARC Specific Information.
    
    Thanks for any insight!
    Regards, 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
    #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

    源码目录下有sparc相关的内容:

    rtems-4.6.0csrcliblibbspsparcshared

    E:projectobsw tems-4.6.0cpukitscorecpusparccpu.c

    _CPU_Initialize

    _CPU_ISR_install_vector

    _CPU_Context_Initialize

  • 相关阅读:
    数据结构和算法学习笔记七:图的搜索
    数据结构和算法学习笔记六:图的相关实现
    Unity常用的3D数学知识
    Unity计时器--简版
    基于前缀树的红点系统
    数据结构和算法学习笔记五:图的基本概念
    C内存管理
    如何解决KEIL中文乱码问题
    C语言结构体变量作为函数形参
    C的结构体
  • 原文地址:https://www.cnblogs.com/yanhc/p/12640724.html
Copyright © 2011-2022 走看看