ARM64: Fix exit stub patching.

Contributed by Javier Guerra Giraldez.
This commit is contained in:
Mike Pall
2018-06-24 14:08:59 +02:00
parent c785131ca5
commit 9da0653509
3 changed files with 51 additions and 38 deletions

View File

@@ -132,9 +132,9 @@ static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno)
#define A64F_IMMR(x) ((x) << 16)
#define A64F_U16(x) ((x) << 5)
#define A64F_U12(x) ((x) << 10)
#define A64F_S26(x) (x)
#define A64F_S26(x) (((uint32_t)(x) & 0x03ffffffu))
#define A64F_S19(x) (((uint32_t)(x) & 0x7ffffu) << 5)
#define A64F_S14(x) ((x) << 5)
#define A64F_S14(x) (((uint32_t)(x) & 0x3fffu) << 5)
#define A64F_S9(x) ((x) << 12)
#define A64F_BIT(x) ((x) << 19)
#define A64F_SH(sh, x) (((sh) << 22) | ((x) << 10))
@@ -145,6 +145,9 @@ static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno)
#define A64F_LSL16(x) (((x) / 16) << 21)
#define A64F_BSH(sh) ((sh) << 10)
/* Check for valid field range. */
#define A64F_S_OK(x, b) ((((x) + (1 << (b-1))) >> (b)) == 0)
typedef enum A64Ins {
A64I_S = 0x20000000,
A64I_X = 0x80000000,