@@ -70,7 +70,7 @@ void m_munprotect(unsigned int addr, unsigned int len, unsigned char *eip)
7070 return ;
7171 // no need to invalidate the whole page here,
7272 // as the page does not need to be unprotected
73- InvalidateNodeRange_X (addr , len , eip );
73+ InvalidateNodeRange (addr , len , eip );
7474#if PROFILE
7575 CpatchInvalidates ++ ;
7676#endif
@@ -91,7 +91,7 @@ void m_munprotect(unsigned int addr, unsigned int len, unsigned char *eip)
9191struct rep_stack {
9292 unsigned char * esi , * edi ;
9393 unsigned long ecx , eflags , edx , eax ;
94- unsigned char * eip ;
94+ uintptr_t rip ;
9595 unsigned long cpatch_op ;
9696} __attribute__((packed ));
9797
@@ -118,7 +118,7 @@ void rep_movs_stos(struct rep_stack *stack)
118118{
119119 unsigned char * paddr = stack -> edi ;
120120 unsigned int ecx = stack -> ecx ;
121- unsigned char * eip = stack -> eip ;
121+ unsigned char * eip = GetGenCodeBuf ( stack -> rip ) ;
122122 dosaddr_t addr ;
123123 unsigned int len = ecx ;
124124 unsigned char * edi ;
@@ -260,7 +260,7 @@ void stk_32(dosaddr_t addr, Bit32u value)
260260static void wri8_slow (dosaddr_t addr , Bit8u value , unsigned char * eip )
261261{
262262 if (e_querymark (addr , 1 )) {
263- InvalidateNodeRange_X (addr , 1 , eip );
263+ InvalidateNodeRange (addr , 1 , eip );
264264#if PROFILE
265265 CpatchInvalidates ++ ;
266266#endif
@@ -271,7 +271,7 @@ static void wri8_slow(dosaddr_t addr, Bit8u value, unsigned char *eip)
271271static void wri16_slow (dosaddr_t addr , Bit16u value , unsigned char * eip )
272272{
273273 if (e_querymark (addr , 2 )) {
274- InvalidateNodeRange_X (addr , 2 , eip );
274+ InvalidateNodeRange (addr , 2 , eip );
275275#if PROFILE
276276 CpatchInvalidates ++ ;
277277#endif
@@ -282,7 +282,7 @@ static void wri16_slow(dosaddr_t addr, Bit16u value, unsigned char *eip)
282282static void wri32_slow (dosaddr_t addr , Bit32u value , unsigned char * eip )
283283{
284284 if (e_querymark (addr , 4 )) {
285- InvalidateNodeRange_X (addr , 4 , eip );
285+ InvalidateNodeRange (addr , 4 , eip );
286286#if PROFILE
287287 CpatchInvalidates ++ ;
288288#endif
@@ -319,8 +319,9 @@ static void UnCpatch_wri32(unsigned char *eip)
319319}
320320#endif
321321
322- void wri_8 (dosaddr_t addr , Bit8u value , unsigned char * eip )
322+ void wri_8 (dosaddr_t addr , Bit8u value , uintptr_t rip )
323323{
324+ unsigned char * eip = GetGenCodeBuf (rip );
324325#if PROFILE
325326 CpatchWrites ++ ;
326327#endif
@@ -347,8 +348,9 @@ void wri_8(dosaddr_t addr, Bit8u value, unsigned char *eip)
347348 InCompiledCode ++ ;
348349}
349350
350- void wri_16 (dosaddr_t addr , Bit16u value , unsigned char * eip )
351+ void wri_16 (dosaddr_t addr , Bit16u value , uintptr_t rip )
351352{
353+ unsigned char * eip = GetGenCodeBuf (rip );
352354#if PROFILE
353355 CpatchWrites ++ ;
354356#endif
@@ -375,8 +377,9 @@ void wri_16(dosaddr_t addr, Bit16u value, unsigned char *eip)
375377 InCompiledCode ++ ;
376378}
377379
378- void wri_32 (dosaddr_t addr , Bit32u value , unsigned char * eip )
380+ void wri_32 (dosaddr_t addr , Bit32u value , uintptr_t rip )
379381{
382+ unsigned char * eip = GetGenCodeBuf (rip );
380383#if PROFILE
381384 CpatchWrites ++ ;
382385#endif
@@ -601,7 +604,7 @@ int Cpatch(sigcontext_t *scp)
601604 unsigned char * p ;
602605 int w16 ;
603606 unsigned int v ;
604- unsigned char * eip = ( unsigned char * ) _scp_rip ;
607+ uintptr_t eip = _scp_rip ;
605608
606609#if PROFILE
607610 CpatchTotal ++ ;
@@ -697,10 +700,10 @@ int Cpatch(sigcontext_t *scp)
697700 return 0 ;
698701}
699702
700- int UnCpatch (unsigned char * eip )
703+ int UnCpatch (uintptr_t rip )
701704{
702705 unsigned char * p ;
703- p = GetGenCodeBuf (eip );
706+ p = GetGenCodeBuf (rip );
704707
705708 if (* p != 0xff ) return 1 ;
706709 if (debug_level ('e' )) {
0 commit comments