Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 05cb995 in mainline


Ignore:
Timestamp:
2019-01-11T08:37:49Z (2 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Children:
3e40b4e
Parents:
d3e938c
git-author:
Vojtech Horky <vojtech.horky@…> (2019-01-09 13:10:03)
git-committer:
Vojtech Horky <vojtech.horky@…> (2019-01-11 08:37:49)
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

    rd3e938c r05cb995  
    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.