(trampoline): Add getpagesize and mprotect for WINNT.

From-SVN: r10605
This commit is contained in:
Richard Kenner 1995-11-26 14:41:43 -05:00
parent 67933bafd7
commit f5ea9817c4

View File

@ -1919,6 +1919,39 @@ __clear_cache (beg, end)
/* Jump to a trampoline, loading the static chain address. */
#ifdef WINNT
long getpagesize()
{
#ifdef _ALPHA_
return 8192;
#else
return 4096;
#endif
}
int mprotect(addr, len, prot)
char *addr;
int len, prot;
{
int np, op;
if (prot == 7) np = 0x40;
else if (prot == 5) np = 0x20;
else if (prot == 4) np = 0x10;
else if (prot == 3) np = 0x04;
else if (prot == 1) np = 0x02;
else if (prot == 0) np = 0x01;
if (VirtualProtect (addr, len, np, &op))
return 0;
else
return -1;
}
#endif
#ifdef TRANSFER_FROM_TRAMPOLINE
TRANSFER_FROM_TRAMPOLINE
#endif