OLD | NEW |
1 /* ********************************************************** | 1 /* ********************************************************** |
2 * Copyright (c) 2014 Google, Inc. All rights reserved. | 2 * Copyright (c) 2014 Google, Inc. All rights reserved. |
3 * **********************************************************/ | 3 * **********************************************************/ |
4 | 4 |
5 /* | 5 /* |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: | 7 * modification, are permitted provided that the following conditions are met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright notice, | 9 * * Redistributions of source code must retain the above copyright notice, |
10 * this list of conditions and the following disclaimer. | 10 * this list of conditions and the following disclaimer. |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 #include "../globals.h" | 38 #include "../globals.h" |
39 #include "arch.h" | 39 #include "arch.h" |
40 #include "instr.h" | 40 #include "instr.h" |
41 #include "instr_create.h" | 41 #include "instr_create.h" |
42 #include "instrlist.h" | 42 #include "instrlist.h" |
43 #include "instrument.h" /* for dr_insert_call() */ | 43 #include "instrument.h" /* for dr_insert_call() */ |
44 | 44 |
45 #define APP instrlist_meta_append | 45 #define APP instrlist_meta_append |
46 | 46 |
| 47 /***************************************************************************/ |
| 48 /* EXIT STUB */ |
| 49 /***************************************************************************/ |
| 50 |
| 51 byte * |
| 52 insert_relative_target(byte *pc, cache_pc target, bool hot_patch) |
| 53 { |
| 54 /* FIXMED i#1551: NYI on ARM */ |
| 55 ASSERT_NOT_IMPLEMENTED(false); |
| 56 return NULL; |
| 57 } |
| 58 |
| 59 byte * |
| 60 insert_relative_jump(byte *pc, cache_pc target, bool hot_patch) |
| 61 { |
| 62 /* FIXMED i#1551: NYI on ARM */ |
| 63 ASSERT_NOT_IMPLEMENTED(false); |
| 64 return NULL; |
| 65 } |
| 66 |
| 67 /* inserts any nop padding needed to ensure patchable branch offsets don't |
| 68 * cross cache line boundaries. If emitting sets the offset field of all |
| 69 * instructions, else sets the translation for the added nops (for |
| 70 * recreating). If emitting and -pad_jmps_shift_{bb,trace} returns the number |
| 71 * of bytes to shift the start_pc by (this avoids putting a nop before the |
| 72 * first exit cti) else returns 0. |
| 73 */ |
| 74 uint |
| 75 nop_pad_ilist(dcontext_t *dcontext, fragment_t *f, instrlist_t *ilist, bool emit
ting) |
| 76 { |
| 77 /* FIXMED i#1551: NYI on ARM */ |
| 78 ASSERT_NOT_IMPLEMENTED(false); |
| 79 return 0; |
| 80 } |
| 81 |
| 82 /* Emit code for the exit stub at stub_pc. Return the size of the |
| 83 * emitted code in bytes. This routine assumes that the caller will |
| 84 * take care of any cache synchronization necessary (though none is |
| 85 * necessary on the Pentium). |
| 86 * The stub is unlinked initially, except coarse grain indirect exits, |
| 87 * which are always linked. |
| 88 */ |
| 89 int |
| 90 insert_exit_stub_other_flags(dcontext_t *dcontext, fragment_t *f, |
| 91 linkstub_t *l, cache_pc stub_pc, ushort l_flags) |
| 92 { |
| 93 /* FIXMED i#1551: NYI on ARM */ |
| 94 ASSERT_NOT_IMPLEMENTED(false); |
| 95 return 0; |
| 96 } |
| 97 |
| 98 void |
| 99 link_indirect_exit_arch(dcontext_t *dcontext, fragment_t *f, |
| 100 linkstub_t *l, bool hot_patch, |
| 101 app_pc target_tag) |
| 102 { |
| 103 /* FIXMED i#1551: NYI on ARM */ |
| 104 ASSERT_NOT_IMPLEMENTED(false); |
| 105 } |
| 106 |
| 107 cache_pc |
| 108 indirect_linkstub_stub_pc(dcontext_t *dcontext, fragment_t *f, linkstub_t *l) |
| 109 { |
| 110 /* FIXMED i#1551: NYI on ARM */ |
| 111 ASSERT_NOT_IMPLEMENTED(false); |
| 112 return NULL; |
| 113 } |
| 114 |
| 115 cache_pc |
| 116 cbr_fallthrough_exit_cti(cache_pc prev_cti_pc) |
| 117 { |
| 118 /* FIXMED i#1551: NYI on ARM */ |
| 119 ASSERT_NOT_IMPLEMENTED(false); |
| 120 return NULL; |
| 121 } |
| 122 |
| 123 /* This is an atomic operation with respect to a thread executing in the |
| 124 * cache (barring ifdef NATIVE_RETURN, which is now removed), for |
| 125 * inlined indirect exits the |
| 126 * unlinked path of the ibl routine detects the race condition between the |
| 127 * two patching writes and handles it appropriately unless using the |
| 128 * atomic_inlined_linking option in which case there is only one patching |
| 129 * write (since tail is duplicated) |
| 130 */ |
| 131 void |
| 132 unlink_indirect_exit(dcontext_t *dcontext, fragment_t *f, linkstub_t *l) |
| 133 { |
| 134 /* FIXMED i#1551: NYI on ARM */ |
| 135 ASSERT_NOT_IMPLEMENTED(false); |
| 136 } |
| 137 |
| 138 |
| 139 /******************************************************************************* |
| 140 * COARSE-GRAIN FRAGMENT SUPPORT |
| 141 */ |
| 142 |
| 143 cache_pc |
| 144 entrance_stub_jmp(cache_pc stub) |
| 145 { |
| 146 /* FIXMED i#1551: NYI on ARM */ |
| 147 ASSERT_NOT_IMPLEMENTED(false); |
| 148 return NULL; |
| 149 } |
| 150 |
| 151 /* Returns whether stub is an entrance stub as opposed to a fragment |
| 152 * or a coarse indirect stub. FIXME: if we separate coarse indirect |
| 153 * stubs from bodies we'll need to put them somewhere else, or fix up |
| 154 * decode_fragment() to be able to distinguish them in some other way |
| 155 * like first instruction tls slot. |
| 156 */ |
| 157 bool |
| 158 coarse_is_entrance_stub(cache_pc stub) |
| 159 { |
| 160 /* FIXMED i#1551: NYI on ARM */ |
| 161 ASSERT_NOT_IMPLEMENTED(false); |
| 162 return false; |
| 163 } |
| 164 |
| 165 /*########################################################################### |
| 166 * |
| 167 * fragment_t Prefixes |
| 168 * |
| 169 * Two types: indirect branch target, which restores eflags and xcx, and |
| 170 * normal prefix, which just restores xcx |
| 171 */ |
| 172 |
| 173 void |
| 174 insert_fragment_prefix(dcontext_t *dcontext, fragment_t *f) |
| 175 { |
| 176 /* FIXMED i#1551: NYI on ARM */ |
| 177 ASSERT_NOT_IMPLEMENTED(false); |
| 178 } |
| 179 |
| 180 /***************************************************************************/ |
| 181 /* THREAD-PRIVATE/SHARED ROUTINE GENERATION */ |
| 182 /***************************************************************************/ |
| 183 |
47 /* helper functions for emit_fcache_enter_common */ | 184 /* helper functions for emit_fcache_enter_common */ |
48 | 185 |
49 void | 186 void |
50 append_call_exit_dr_hook(dcontext_t *dcontext, instrlist_t *ilist, | 187 append_call_exit_dr_hook(dcontext_t *dcontext, instrlist_t *ilist, |
51 bool absolute, bool shared) | 188 bool absolute, bool shared) |
52 { | 189 { |
53 /* i#1551: DR_HOOK is not supported on ARM */ | 190 /* i#1551: DR_HOOK is not supported on ARM */ |
54 ASSERT_NOT_IMPLEMENTED(EXIT_DR_HOOK == NULL); | 191 ASSERT_NOT_IMPLEMENTED(EXIT_DR_HOOK == NULL); |
55 } | 192 } |
56 | 193 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 236 } |
100 | 237 |
101 bool | 238 bool |
102 append_call_enter_dr_hook(dcontext_t *dcontext, instrlist_t *ilist, | 239 append_call_enter_dr_hook(dcontext_t *dcontext, instrlist_t *ilist, |
103 bool ibl_end, bool absolute) | 240 bool ibl_end, bool absolute) |
104 { | 241 { |
105 /* i#1551: DR_HOOK is not supported on ARM */ | 242 /* i#1551: DR_HOOK is not supported on ARM */ |
106 ASSERT_NOT_IMPLEMENTED(EXIT_DR_HOOK == NULL); | 243 ASSERT_NOT_IMPLEMENTED(EXIT_DR_HOOK == NULL); |
107 return false; | 244 return false; |
108 } | 245 } |
| 246 |
| 247 void |
| 248 insert_save_eflags(dcontext_t *dcontext, instrlist_t *ilist, instr_t *where, |
| 249 uint flags, bool tls, bool absolute _IF_X64(bool x86_to_x64_i
bl_opt)) |
| 250 { |
| 251 /* FIXMED i#1551: NYI on ARM */ |
| 252 ASSERT_NOT_IMPLEMENTED(false); |
| 253 } |
| 254 |
| 255 void |
| 256 insert_restore_eflags(dcontext_t *dcontext, instrlist_t *ilist, instr_t *where, |
| 257 uint flags, bool tls, bool absolute |
| 258 _IF_X64(bool x86_to_x64_ibl_opt)) |
| 259 { |
| 260 /* FIXMED i#1551: NYI on ARM */ |
| 261 ASSERT_NOT_IMPLEMENTED(false); |
| 262 } |
| 263 |
| 264 |
| 265 /* create the inlined ibl exit stub template */ |
| 266 byte * |
| 267 emit_inline_ibl_stub(dcontext_t *dcontext, byte *pc, |
| 268 ibl_code_t *ibl_code, bool target_trace_table) |
| 269 { |
| 270 /* FIXMED i#1551: NYI on ARM */ |
| 271 ASSERT_NOT_IMPLEMENTED(false); |
| 272 return NULL; |
| 273 } |
| 274 |
| 275 byte * |
| 276 emit_indirect_branch_lookup(dcontext_t *dcontext, generated_code_t *code, byte *
pc, |
| 277 byte *fcache_return_pc, |
| 278 bool target_trace_table, |
| 279 bool inline_ibl_head, |
| 280 ibl_code_t *ibl_code /* IN/OUT */) |
| 281 { |
| 282 /* FIXMED i#1551: NYI on ARM */ |
| 283 ASSERT_NOT_IMPLEMENTED(false); |
| 284 return NULL; |
| 285 } |
| 286 |
| 287 bool |
| 288 is_jmp_rel32(byte *code_buf, app_pc app_loc, app_pc *jmp_target /* OUT */) |
| 289 { |
| 290 /* FIXMED i#1551: NYI on ARM */ |
| 291 ASSERT_NOT_IMPLEMENTED(false); |
| 292 return false; |
| 293 } |
| 294 |
| 295 |
| 296 bool |
| 297 is_jmp_rel8(byte *code_buf, app_pc app_loc, app_pc *jmp_target /* OUT */) |
| 298 { |
| 299 /* FIXMED i#1551: NYI on ARM */ |
| 300 ASSERT_NOT_IMPLEMENTED(false); |
| 301 return false; |
| 302 } |
OLD | NEW |