Changeset e5ace7d7 in mainline


Ignore:
Timestamp:
2019-01-22T21:36:42Z (5 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
182487c6
Parents:
c3fa24e
git-author:
Vojtech Horky <vojtech.horky@…> (2019-01-09 13:10:03)
git-committer:
Vojtech Horky <vojtech.horky@…> (2019-01-22 21:36:42)
Message:

mips32: clobber memory on sycall (thx Adam Frey)

As the syscall may touch arbitrary memory, we need to prevent the
compiler to cache some values in registers.

Actual problem was demonstrated on Kalisto during school assignments but
HelenOS uses basically the same code, thus the issue applies here too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/mips32/src/syscall.c

    rc3fa24e re5ace7d7  
    5757              "r" (__mips_reg_t1),
    5858              "r" (__mips_reg_v0)
     59            :
    5960              /*
    6061               * We are a function call, although C
    6162               * does not know it.
    6263               */
    63             : "%ra"
     64              "%ra",
     65              /*
     66               * Clobber memory too as some arguments might be
     67               * actually pointers.
     68               */
     69              "memory"
    6470        );
    6571
Note: See TracChangeset for help on using the changeset viewer.