summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/enable_execute_stack.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@auroraux.org>2009-08-05 04:02:56 +0000
committerEdward O'Callaghan <eocallaghan@auroraux.org>2009-08-05 04:02:56 +0000
commit4856eef437fd97876fa6b275060bc5666b3c1227 (patch)
treed2858c1bee9b505e898afd00e2550fbb29b5ec8e /compiler-rt/lib/enable_execute_stack.c
parent379429200e28892b1deaec0305f582b2d3903fbb (diff)
downloadbcm5719-llvm-4856eef437fd97876fa6b275060bc5666b3c1227.tar.gz
bcm5719-llvm-4856eef437fd97876fa6b275060bc5666b3c1227.zip
Fixup C++ style comments are not allowed in ISO C90 to classic C style.
llvm-svn: 78152
Diffstat (limited to 'compiler-rt/lib/enable_execute_stack.c')
-rw-r--r--compiler-rt/lib/enable_execute_stack.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/compiler-rt/lib/enable_execute_stack.c b/compiler-rt/lib/enable_execute_stack.c
index 15ab03fd73b..c2ebc30f893 100644
--- a/compiler-rt/lib/enable_execute_stack.c
+++ b/compiler-rt/lib/enable_execute_stack.c
@@ -1,11 +1,12 @@
-//===-- enable_execute_stack.c - Implement __enable_execute_stack ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
+/* ===-- enable_execute_stack.c - Implement __enable_execute_stack ---------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ */
#include <stdint.h>
#include <sys/mman.h>
@@ -14,20 +15,21 @@
#endif
-//
-// The compiler generates calls to __enable_execute_stack() when creating
-// trampoline functions on the stack for use with nested functions.
-// It is expected to mark the page(s) containing the address
-// and the next 48 bytes as executable. Since the stack is normally rw-
-// that means changing the protection on those page(s) to rwx.
-//
+/*
+ * The compiler generates calls to __enable_execute_stack() when creating
+ * trampoline functions on the stack for use with nested functions.
+ * It is expected to mark the page(s) containing the address
+ * and the next 48 bytes as executable. Since the stack is normally rw-
+ * that means changing the protection on those page(s) to rwx.
+ */
+
void __enable_execute_stack(void* addr)
{
#if __APPLE__
- // On Darwin, pagesize is always 4096 bytes
+ /* On Darwin, pagesize is always 4096 bytes */
const uintptr_t pageSize = 4096;
#else
- // FIXME: We should have a configure check for this.
+ /* FIXME: We should have a configure check for this. */
const uintptr_t pageSize = getpagesize();
#endif
const uintptr_t pageAlignMask = ~(pageSize-1);
OpenPOWER on IntegriCloud