Changeset 7cd7a8d in mainline for kernel/arch/ia64/src/fpu_context.c


Ignore:
Timestamp:
2018-08-02T20:38:05Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b7adc38
Parents:
0c27956
git-author:
Jakub Jermar <jakub@…> (2018-08-01 22:48:10)
git-committer:
Jakub Jermar <jakub@…> (2018-08-02 20:38:05)
Message:

Preserve AR.FPSR in thread context

AR.FPSR is a preserved register so it should be part of the thread
context, leaving its extra copy in istate_t rather for debugging
purposes.

In this commit we also disable all IEEE FP traps and the
Denormal/Unnormal Operand Floating-Point Exception fault for each new
thread context, leaving the thread with the possibility to change this
setting later in uspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/fpu_context.c

    r0c27956 r7cd7a8d  
    462462void fpu_enable(void)
    463463{
    464         uint64_t a = 0;
    465 
    466464        asm volatile (
    467465            "rsm %0 ;;"
     
    471469            : "i" (PSR_DFH_MASK)
    472470        );
    473 
    474         asm volatile (
    475             "mov %0 = ar.fpsr ;;\n"
    476             "or %0 = %0,%1 ;;\n"
    477             "mov ar.fpsr = %0 ;;\n"
    478             : "+r" (a)
    479             : "r" (0x38)
    480         );
    481471}
    482472
    483473void fpu_disable(void)
    484474{
    485         uint64_t a = 0;
    486 
    487475        asm volatile (
    488476            "ssm %0 ;;\n"
     
    492480            : "i" (PSR_DFH_MASK)
    493481        );
     482}
     483
     484void fpu_init(void)
     485{
     486        uint64_t a = 0;
    494487
    495488        asm volatile (
     
    498491            "mov ar.fpsr = %0 ;;\n"
    499492            : "+r" (a)
    500             : "r" (0x38)
    501         );
    502 }
    503 
    504 void fpu_init(void)
    505 {
    506         uint64_t a = 0;
    507 
    508         asm volatile (
    509             "mov %0 = ar.fpsr ;;\n"
    510             "or %0 = %0,%1 ;;\n"
    511             "mov ar.fpsr = %0 ;;\n"
    512             : "+r" (a)
    513             : "r" (0x38)
     493            : "r" (FPSR_TRAPS_ALL)
    514494        );
    515495
Note: See TracChangeset for help on using the changeset viewer.