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

helper-tcg.h (2815B)


      1/* Helper file for declaring TCG helper functions.
      2   This one defines data structures private to tcg.c.  */
      3
      4#ifndef HELPER_TCG_H
      5#define HELPER_TCG_H
      6
      7#include "exec/helper-head.h"
      8
      9/* Need one more level of indirection before stringification
     10   to get all the macros expanded first.  */
     11#define str(s) #s
     12
     13#define DEF_HELPER_FLAGS_0(NAME, FLAGS, ret) \
     14  { .func = HELPER(NAME), .name = str(NAME), \
     15    .flags = FLAGS | dh_callflag(ret), \
     16    .typemask = dh_typemask(ret, 0) },
     17
     18#define DEF_HELPER_FLAGS_1(NAME, FLAGS, ret, t1) \
     19  { .func = HELPER(NAME), .name = str(NAME), \
     20    .flags = FLAGS | dh_callflag(ret), \
     21    .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) },
     22
     23#define DEF_HELPER_FLAGS_2(NAME, FLAGS, ret, t1, t2) \
     24  { .func = HELPER(NAME), .name = str(NAME), \
     25    .flags = FLAGS | dh_callflag(ret), \
     26    .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
     27    | dh_typemask(t2, 2) },
     28
     29#define DEF_HELPER_FLAGS_3(NAME, FLAGS, ret, t1, t2, t3) \
     30  { .func = HELPER(NAME), .name = str(NAME), \
     31    .flags = FLAGS | dh_callflag(ret), \
     32    .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
     33    | dh_typemask(t2, 2) | dh_typemask(t3, 3) },
     34
     35#define DEF_HELPER_FLAGS_4(NAME, FLAGS, ret, t1, t2, t3, t4) \
     36  { .func = HELPER(NAME), .name = str(NAME), \
     37    .flags = FLAGS | dh_callflag(ret), \
     38    .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
     39    | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) },
     40
     41#define DEF_HELPER_FLAGS_5(NAME, FLAGS, ret, t1, t2, t3, t4, t5) \
     42  { .func = HELPER(NAME), .name = str(NAME), \
     43    .flags = FLAGS | dh_callflag(ret), \
     44    .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
     45    | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) \
     46    | dh_typemask(t5, 5) },
     47
     48#define DEF_HELPER_FLAGS_6(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6) \
     49  { .func = HELPER(NAME), .name = str(NAME), \
     50    .flags = FLAGS | dh_callflag(ret), \
     51    .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
     52    | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) \
     53    | dh_typemask(t5, 5) | dh_typemask(t6, 6) },
     54
     55#define DEF_HELPER_FLAGS_7(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6, t7) \
     56  { .func = HELPER(NAME), .name = str(NAME), .flags = FLAGS, \
     57    .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
     58    | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) \
     59    | dh_typemask(t5, 5) | dh_typemask(t6, 6) | dh_typemask(t7, 7) },
     60
     61#include "helper.h"
     62#include "trace/generated-helpers.h"
     63#include "accel/tcg/tcg-runtime.h"
     64#include "accel/tcg/plugin-helpers.h"
     65
     66#undef str
     67#undef DEF_HELPER_FLAGS_0
     68#undef DEF_HELPER_FLAGS_1
     69#undef DEF_HELPER_FLAGS_2
     70#undef DEF_HELPER_FLAGS_3
     71#undef DEF_HELPER_FLAGS_4
     72#undef DEF_HELPER_FLAGS_5
     73#undef DEF_HELPER_FLAGS_6
     74#undef DEF_HELPER_FLAGS_7
     75
     76#endif /* HELPER_TCG_H */