pub unsafe extern "C" fn drreg_reserve_register(
drcontext: *mut c_void,
ilist: *mut instrlist_t,
where_: *mut instr_t,
reg_allowed: *mut drvector_t,
reg: *mut reg_id_t,
) -> drreg_status_tExpand description
Requests exclusive use of an application register, spilling the application value at \p where in \p ilist if necessary. The register chosen is returned in \p reg.
When used during drmgr’s insertion phase, optimizations such as keeping the application flags value in a register and eliding duplicate spills and restores will be automatically applied. If called during drmgr’s insertion phase, \p where must be the current application instruction.
If \p reg_allowed is non-NULL, only registers from the specified set will be considered, where \p reg_allowed must be a vector with one entry for each general-purpose register in [#DR_REG_START_GPR..#DR_REG_STOP_GPR] where a NULL entry indicates not allowed and any non-NULL entry indicates allowed. The drreg_init_and_fill_vector() routine can be used to set up \p reg_allowed.
@return whether successful or an error code on failure.