Add API function to restore flags outline.
Both drreg and drbbdup require restoring flag registers outline, as shown below:
reg_t val
uint sahf;
reg_t newval = mcontext->xflags;
val = (reg_t)drbbdup_get_tls_raw_slot_val(DRBBDUP_FLAG_REG_SLOT);
sahf = (val & 0xff00) >> 8;
newval &= ~(EFLAGS_ARITH);
newval |= sahf;
if (TEST(1, val)) /* seto */
newval |= EFLAGS_OF;
mcontext->xflags = newval;
This is a feature request to create an API function to conveniently perform this restoration.