cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

test_dsp_r1_lwx.c (395B)


      1#include <stdio.h>
      2#include <assert.h>
      3
      4int main(void)
      5{
      6    int value, rd;
      7    int *p;
      8    unsigned long addr, index;
      9    int result;
     10
     11    value  = 0xBCDEF389;
     12    p = &value;
     13    addr = (unsigned long)p;
     14    index  = 0;
     15    result = 0xBCDEF389;
     16    __asm
     17        ("lwx %0, %1(%2)\n\t"
     18         : "=r"(rd)
     19         : "r"(index), "r"(addr)
     20        );
     21
     22    assert(rd == result);
     23
     24    return 0;
     25}