]> gcc.gnu.org Git - gcc.git/commitdiff
(trampoline): Add getpagesize and mprotect for WINNT.
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 26 Nov 1995 19:41:43 +0000 (14:41 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 26 Nov 1995 19:41:43 +0000 (14:41 -0500)
From-SVN: r10605

gcc/libgcc2.c

index 921afef5de455f16c45eaa634635b2b493a14ba6..1e01e9139866d72748ed72ffe16fa6985dc6591c 100644 (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
This page took 0.062771 seconds and 5 git commands to generate.