mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 23:21:21 +00:00
Porting pice. Workaround for a bug in gcc. Some other small stuff.
svn path=/trunk/; revision=2578
This commit is contained in:
parent
87b5401bff
commit
23b672891b
2 changed files with 30 additions and 20 deletions
|
@ -39,23 +39,6 @@ void DeInstallTraceHook(void);
|
||||||
|
|
||||||
volatile ULONG OldInt1Handler=0;
|
volatile ULONG OldInt1Handler=0;
|
||||||
|
|
||||||
__asm__("
|
|
||||||
NewInt1Handler:
|
|
||||||
pushl %eax
|
|
||||||
movl %dr6,%eax
|
|
||||||
testl $(1<<14),%eax
|
|
||||||
jz exceptionnotsinglestep
|
|
||||||
|
|
||||||
popl %eax
|
|
||||||
pushl $" STR(REASON_SINGLESTEP) "
|
|
||||||
jmp NewInt31Handler
|
|
||||||
|
|
||||||
exceptionnotsinglestep:
|
|
||||||
popl %eax
|
|
||||||
pushl $" STR(REASON_HARDWARE_BP) "
|
|
||||||
jmp NewInt31Handler
|
|
||||||
");
|
|
||||||
|
|
||||||
BOOLEAN InstallTraceHook(void)
|
BOOLEAN InstallTraceHook(void)
|
||||||
{
|
{
|
||||||
ULONG LocalInt1Handler;
|
ULONG LocalInt1Handler;
|
||||||
|
@ -75,6 +58,26 @@ BOOLEAN InstallTraceHook(void)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//this asm function must be at least second in the file. otherwise gcc does not
|
||||||
|
//generate correct code.
|
||||||
|
__asm__("
|
||||||
|
NewInt1Handler:
|
||||||
|
pushl %eax
|
||||||
|
movl %dr6,%eax
|
||||||
|
testl $(1<<14),%eax
|
||||||
|
jz exceptionnotsinglestep
|
||||||
|
|
||||||
|
popl %eax
|
||||||
|
pushl $" STR(REASON_SINGLESTEP) "
|
||||||
|
//call _ping1
|
||||||
|
jmp NewInt31Handler
|
||||||
|
|
||||||
|
exceptionnotsinglestep:
|
||||||
|
popl %eax
|
||||||
|
pushl $" STR(REASON_HARDWARE_BP) "
|
||||||
|
jmp NewInt31Handler
|
||||||
|
");
|
||||||
|
|
||||||
void DeInstallTraceHook(void)
|
void DeInstallTraceHook(void)
|
||||||
{
|
{
|
||||||
DPRINT((0,"DeInstallTraceHook(OldInt1Handler=%0.8x)...\n",OldInt1Handler));
|
DPRINT((0,"DeInstallTraceHook(OldInt1Handler=%0.8x)...\n",OldInt1Handler));
|
||||||
|
|
|
@ -396,13 +396,20 @@ ULONG PICE_fnncmp(char* s1,char* s2, ULONG len)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wchar_t PICE_towlower(wchar_t c)
|
||||||
|
{
|
||||||
|
if ( c>=L'A' && c<=L'Z' )
|
||||||
|
return (c - (L'A' - L'a'));
|
||||||
|
return(c);
|
||||||
|
}
|
||||||
|
|
||||||
ULONG PICE_wcsicmp(WCHAR* s1, WCHAR* s2)
|
ULONG PICE_wcsicmp(WCHAR* s1, WCHAR* s2)
|
||||||
{
|
{
|
||||||
ULONG result=1;
|
ULONG result=1;
|
||||||
|
|
||||||
while(IsAddressValid((ULONG)s1) && *s1 && // not end of string
|
while(IsAddressValid((ULONG)s1) && *s1 && // not end of string
|
||||||
IsAddressValid((ULONG)s2) && *s2 && // not end of string
|
IsAddressValid((ULONG)s2) && *s2 && // not end of string
|
||||||
towlower(*s1)==towlower(*s2) ) // char are the same except case
|
PICE_towlower(*s1)==PICE_towlower(*s2) ) // char are the same except case
|
||||||
{
|
{
|
||||||
s1++;
|
s1++;
|
||||||
s2++;
|
s2++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue