Changeset add04f7 in mainline for kernel/arch/ia32/src/fpu_context.c


Ignore:
Timestamp:
2009-03-03T15:20:49Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f24d300
Parents:
deca67b
Message:

better inline assembler readability using the new symbolic syntax

File:
1 edited

Legend:

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

    rdeca67b radd04f7  
    4545{
    4646        asm volatile (
    47                 "fnsave %0"
    48                 : "=m"(*fctx)
    49                 );
     47                "fnsave %[fctx]"
     48                : [fctx] "=m" (*fctx)
     49        );
    5050}
    5151
     
    5353{
    5454        asm volatile (
    55                 "frstor %0"
    56                 : "=m"(*fctx)
    57                 );
     55                "frstor %[fctx]"
     56                : [fctx] "=m" (*fctx)
     57        );
    5858}
    5959
     
    6161{
    6262        asm volatile (
    63                 "fxsave %0"
    64                 : "=m"(*fctx)
    65                 );
     63                "fxsave %[fctx]"
     64                : [fctx] "=m" (*fctx)
     65        );
    6666}
    6767
     
    6969{
    7070        asm volatile (
    71                 "fxrstor %0"
    72                 : "=m"(*fctx)
    73                 );
     71                "fxrstor %[fctx]"
     72                : [fctx] "=m" (*fctx)
     73        );
    7474}
    7575
    76 /*
    77         Setup using fxsr instruction
    78 */
     76/* Setup using fxsr instruction */
    7977void fpu_fxsr(void)
    8078{
     
    8280        fpu_restore=fpu_context_fx_restore;
    8381}
    84 /*
    85         Setup using not fxsr instruction
    86 */
     82
     83/* Setup using not fxsr instruction */
    8784void fpu_fsr(void)
    8885{
     
    103100void fpu_init()
    104101{
    105         uint32_t help0 = 0, help1 = 0;
     102        uint32_t help0 = 0;
     103        uint32_t help1 = 0;
     104       
    106105        asm volatile (
    107                 "fninit;\n"
    108                 "stmxcsr %0\n"
    109                 "mov %0,%1;\n"
    110                 "or %2,%1;\n"
    111                 "mov %1,%0;\n"
    112                 "ldmxcsr %0;\n"
    113                 : "+m" (help0), "+r" (help1)
    114                 : "i" (0x1f80)
     106                "fninit\n"
     107                "stmxcsr %[help0]\n"
     108                "mov %[help0], %[help1]\n"
     109                "or %[magic], %[help1]\n"
     110                "mov %[help1], %[help0]\n"
     111                "ldmxcsr %[help0]\n"
     112                : [help0] "+m" (help0), [help1] "+r" (help1)
     113                : [magic] "i" (0x1f80)
    115114        );
    116115}
Note: See TracChangeset for help on using the changeset viewer.