Edward Pilatowicz wrote:
On Wed, Dec 16, 2009 at 10:46:57AM -0700, Jerry Jelinek wrote:
I've posted an updated webrev to address your comments.
- i'd think the "is 0 <= syscall <= MAX" check would have to be
done after CHECK_FOR_NATIVE().
It is. I added it to the CHECK_FOR_INTERPOSITION macro which is
called after the CHECK_FOR_NATIVE in the CALLBACK_PROLOGUE.
- CALC_TABLE_ADDR() a little clunky. (it has seperate 32 and 64
versions, it assumes the syscall number is in eax/rax, and it has a
side effect of munging the syscall number.) how about defining just one
version of CALC_TABLE_ADDR() as:
#define CALC_TABLE_ADDR(sysnum, rv)
GET_P_BRAND_DATA(%rsp, 1, rv) /* get p_brand_data ptr */;
mov SPD_HANDLER(rv), rv /* get p_brand_data->spd_handler ptr
shl $4, sysnum /* syscall_num * 16 */;
add sysnum, result /* calc JMP table address */;
shr $4, sysnum /* syscall_num / 16 */
Since we don't care about preserving the syscall number that extra
instruction has no value. However, I'll take another shot at trying
to streamline this a bit.
zones-discuss mailing list