<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Raymond Toy pushed to branch rtoy-mmap-anon-control-and-binding-stacks at <a href="https://gitlab.common-lisp.net/cmucl/cmucl">cmucl / cmucl</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/cf1990dc7629de805e04d813bebc187e5fddd220">cf1990dc</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-10-04T12:42:34Z</i>
</div>
<pre class='commit-message'>Don't define a SIGNAL_STACK mapped region.  Use altstack, like on
other platforms.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/b2dc0b2cefa5d86f01900fce0c3ad85de51bf510">b2dc0b2c</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-10-04T12:42:55Z</i>
</div>
<pre class='commit-message'>Don't define a SIGNAL_STACK mapped region.  Use altstack, like on
other platforms.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/316d2279f682fd45345ae30fbd13eb2806bfc2d6">316d2279</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-10-04T12:43:26Z</i>
</div>
<pre class='commit-message'>Use control_stack, not CONTROL_STACK_START.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/bdb299d3cd4506c5a882cc4caf7c531e91c33cb9">bdb299d3</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-10-04T12:44:04Z</i>
</div>
<pre class='commit-message'>Put -O2 on it's own line to make switching this off and on slightly
easier.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/9de8cd8839dad91bed0ddb059af7e2521a35e40d">9de8cd88</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-10-04T12:47:42Z</i>
</div>
<pre class='commit-message'>Remove definitions of BINDING_STACK_START and CONTROL_STACK_START.</pre>
</li>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/e4553e8ac0bda154575cb4e4a60ae274772d27a5">e4553e8a</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2015-10-04T12:54:25Z</i>
</div>
<pre class='commit-message'>Replace BINDING_STACK_START and CONTROL_STACK_START appropriately.</pre>
</li>
</ul>
<h4>9 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/lisp/Config.x86_common
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
src/lisp/Darwin-os.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
src/lisp/gencgc.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
src/lisp/interrupt.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
src/lisp/ppc-validate.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
src/lisp/sparc-validate.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
src/lisp/x86-assem.S
</a>
</li>
<li class='file-stats'>
<a href='#diff-7'>
src/lisp/x86-validate-darwin.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-8'>
src/lisp/x86-validate-linux.h
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-0'>
<strong>
src/lisp/Config.x86_common
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/Config.x86_common
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/Config.x86_common
</span><span style="color: #aaaaaa">@@ -43,7 +43,8 @@ CPP_INCLUDE_OPTIONS := -I. -I$(PATH1) -I-
</span> endif
 
 CPPFLAGS := $(CPP_DEFINE_OPTIONS) $(CPP_INCLUDE_OPTIONS) 
<span style="color: #000000;background-color: #ffdddd">-CFLAGS += -Wstrict-prototypes -Wall -O2 -g -fno-omit-frame-pointer
</span><span style="color: #000000;background-color: #ddffdd">+CFLAGS += -Wstrict-prototypes -Wall -g -fno-omit-frame-pointer
+CFLAGS += -O2
</span> ASFLAGS = -g 
 
 ASSEM_SRC = x86-assem.S
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-1'>
<strong>
src/lisp/Darwin-os.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/Darwin-os.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/Darwin-os.c
</span><span style="color: #aaaaaa">@@ -464,8 +464,8 @@ valid_addr(os_vm_address_t addr)
</span> #ifndef GENCGC
        || in_range_p(addr, DYNAMIC_1_SPACE_START, dynamic_space_size)
 #endif
<span style="color: #000000;background-color: #ffdddd">-        || in_range_p(addr, CONTROL_STACK_START, control_stack_size)
-       || in_range_p(addr, BINDING_STACK_START, binding_stack_size))
</span><span style="color: #000000;background-color: #ddffdd">+   || in_range_p(addr, (lispobj)control_stack, control_stack_size)
+       || in_range_p(addr, (lispobj)binding_stack, binding_stack_size))
</span>   return TRUE;
     return FALSE;
 }
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-2'>
<strong>
src/lisp/gencgc.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/gencgc.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/gencgc.c
</span><span style="color: #aaaaaa">@@ -166,7 +166,7 @@ check_escaped_stack_object(lispobj * where, lispobj obj)
</span> 
     if (Pointerp(obj)
        && (p = (void *) PTR(obj),
<span style="color: #000000;background-color: #ffdddd">-            (p >= (void *) CONTROL_STACK_START
</span><span style="color: #000000;background-color: #ddffdd">+       (p >= (void *) control_stack
</span>        && p < (void *) control_stack_end))) {
        char *space;
 
<span style="color: #aaaaaa">@@ -195,7 +195,7 @@ check_escaped_stack_object(lispobj * where, lispobj obj)
</span>       lose("Escaped stack-allocated object 0x%08lx at %p in %s\n",
                 (unsigned long) obj, where, space);
 #ifndef i386
<span style="color: #000000;background-color: #ffdddd">-        else if ((where >= (lispobj *) CONTROL_STACK_START
</span><span style="color: #000000;background-color: #ddffdd">+   else if ((where >= (lispobj *) control_stack
</span>             && where < (lispobj *) (control_stack_end))
                 || (space == NULL)) {
            /* Do nothing if it the reference is from the control stack,
<span style="color: #aaaaaa">@@ -2136,17 +2136,19 @@ read_only_space_p(lispobj obj)
</span> static inline boolean
 control_stack_space_p(lispobj obj)
 {
<span style="color: #000000;background-color: #ffdddd">-    lispobj end = CONTROL_STACK_START + control_stack_size;
</span><span style="color: #000000;background-color: #ddffdd">+    char *object = (char *) obj;
+    char *end = (char *)control_stack + control_stack_size;
</span> 
<span style="color: #000000;background-color: #ffdddd">-    return (obj >= CONTROL_STACK_START) && (obj < end);
</span><span style="color: #000000;background-color: #ddffdd">+    return (object >= (char *) control_stack) && (object < end);
</span> }
 
 static inline boolean
 binding_stack_space_p(lispobj obj)
 {
<span style="color: #000000;background-color: #ffdddd">-    lispobj end = BINDING_STACK_START + binding_stack_size;
</span><span style="color: #000000;background-color: #ddffdd">+    char *object = (char *) obj;
+    char *end = (char *)binding_stack + binding_stack_size;
</span> 
<span style="color: #000000;background-color: #ffdddd">-    return (obj >= BINDING_STACK_START) && (obj < end);
</span><span style="color: #000000;background-color: #ddffdd">+    return (object >= (char *) binding_stack) && (object < end);
</span> }
     
 static inline boolean
<span style="color: #aaaaaa">@@ -2157,7 +2159,12 @@ signal_space_p(lispobj obj)
</span> 
     return (obj >= SIGNAL_STACK_START) && (obj < end);
 #else
<span style="color: #000000;background-color: #ffdddd">-    return FALSE;
</span><span style="color: #000000;background-color: #ddffdd">+    extern char altstack[];
+    
+    char* object = (char*) obj;
+    char* end = altstack + SIGNAL_STACK_SIZE;
+    
+    return (object >= altstack && object < end);
</span> #endif    
 }
 
<span style="color: #aaaaaa">@@ -7322,11 +7329,11 @@ verify_gc(void)
</span>     int static_space_size = (lispobj *) SymbolValue(STATIC_SPACE_FREE_POINTER)
        - (lispobj *) static_space;
     int binding_stack_size = (lispobj *) get_binding_stack_pointer()
<span style="color: #000000;background-color: #ffdddd">-        - (lispobj *) BINDING_STACK_START;
</span><span style="color: #000000;background-color: #ddffdd">+   - (lispobj *) binding_stack;
</span> 
     verify_space((lispobj *) READ_ONLY_SPACE_START, read_only_space_size);
     verify_space((lispobj *) static_space, static_space_size);
<span style="color: #000000;background-color: #ffdddd">-    verify_space((lispobj *) BINDING_STACK_START, binding_stack_size);
</span><span style="color: #000000;background-color: #ddffdd">+    verify_space((lispobj *) binding_stack, binding_stack_size);
</span>     verify_space((lispobj *) (void *) &scavenger_hooks, 1);
 }
 
<span style="color: #aaaaaa">@@ -7523,7 +7530,7 @@ garbage_collect_generation(int generation, int raise)
</span> 
 #ifdef GC_ASSERTIONS
 #if defined(i386) || defined(__x86_64)
<span style="color: #000000;background-color: #ffdddd">-    invalid_stack_start = (void *) CONTROL_STACK_START;
</span><span style="color: #000000;background-color: #ddffdd">+    invalid_stack_start = (void *) control_stack;
</span>     invalid_stack_end = (void *) &raise;
 #else /* not i386 */
     invalid_stack_start = (void *) &raise;
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-3'>
<strong>
src/lisp/interrupt.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/interrupt.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/interrupt.c
</span><span style="color: #aaaaaa">@@ -408,10 +408,10 @@ interrupt_maybe_gc(HANDLER_ARGS)
</span> * Noise to install handlers.                                     *
 \****************************************************************/
 
<span style="color: #000000;background-color: #ffdddd">-#if !(defined(i386) || defined(__x86_64))
-#define SIGNAL_STACK_SIZE SIGSTKSZ
-static char altstack[SIGNAL_STACK_SIZE];
-#endif
</span><span style="color: #000000;background-color: #ddffdd">+//#if !(defined(i386) || defined(__x86_64))
+//#define SIGNAL_STACK_SIZE SIGSTKSZ
+char altstack[SIGNAL_STACK_SIZE];
+//#endif
</span> 
 void
 interrupt_install_low_level_handler(int signal, void handler(HANDLER_ARGS))
<span style="color: #aaaaaa">@@ -434,7 +434,7 @@ interrupt_install_low_level_handler(int signal, void handler(HANDLER_ARGS))
</span>     if (signal == PROTECTION_VIOLATION_SIGNAL) {
        stack_t sigstack;
 
<span style="color: #000000;background-color: #ffdddd">-#if (defined( i386 ) || defined(__x86_64))
</span><span style="color: #000000;background-color: #ddffdd">+#if defined(SIGNAL_STACK_START)
</span>   sigstack.ss_sp = (void *) SIGNAL_STACK_START;
 #else
        sigstack.ss_sp = (void *) altstack;
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-4'>
<strong>
src/lisp/ppc-validate.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/ppc-validate.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/ppc-validate.h
</span><span style="color: #aaaaaa">@@ -41,11 +41,17 @@
</span> #define STATIC_SPACE_START        (0x10000000)
 #define STATIC_SPACE_SIZE      (0x07ff8000)    /* 128 MB, almost */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define CONTROL_STACK_START       (0x30000000)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define CONTROL_STACK_SIZE        (0x07ff8000)    /* 128 MB, almost */
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define CONTROL_STACK_END       (CONTROL_STACK_START + control_stack_size)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define BINDING_STACK_START       (0x38000000)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define BINDING_STACK_SIZE        (0x07ff8000)    /* 128 MB, almost */
 
 #if 0
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-5'>
<strong>
src/lisp/sparc-validate.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/sparc-validate.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/sparc-validate.h
</span><span style="color: #aaaaaa">@@ -92,15 +92,22 @@
</span> #define READ_ONLY_SPACE_START     (SpaceStart_TargetReadOnly)
 #define READ_ONLY_SPACE_SIZE   ((2*MB_128) - SPARSE_BLOCK_SIZE)        /* 256 MB - 32 KB, 256 MB max */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define BINDING_STACK_START       (0x20000000)
<span style="color: #000000;background-color: #ddffdd">+#endif
+
</span> #define BINDING_STACK_SIZE        (MB_128 - SPARSE_BLOCK_SIZE)    /* 128 MB - 32 KB, 128 MB max */
 
 #define STATIC_SPACE_START     (SpaceStart_TargetStatic)
 #define STATIC_SPACE_SIZE      ((2*MB_128) - SPARSE_BLOCK_SIZE)        /* 256 MB - 32 KB, 256 MB max */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define CONTROL_STACK_START       (0x38000000)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define CONTROL_STACK_SIZE        (MB_128 - SPARSE_BLOCK_SIZE)    /* 128 MB - 32 KB, 128 MB max */
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define CONTROL_STACK_END       (CONTROL_STACK_START + control_stack_size)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> 
 #define DYNAMIC_0_SPACE_START  (SpaceStart_TargetDynamic)
 
</code></pre>

<br>
</li>
<li id='diff-6'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-6'>
<strong>
src/lisp/x86-assem.S
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/x86-assem.S
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/x86-assem.S
</span><span style="color: #aaaaaa">@@ -143,7 +143,8 @@ FUNCDEF(call_into_lisp)
</span>   movl    %eax, GNAME(foreign_function_call_active)
 
        movl    %esp,%ebx       # remember current stack
<span style="color: #000000;background-color: #ffdddd">-        cmpl    $CONTROL_STACK_START,%esp
</span><span style="color: #000000;background-color: #ddffdd">+   cmpl    GNAME(control_stack), %esp
+
</span>   jbe     ChangeToLispStack
        cmpl    GNAME(control_stack_end), %esp
        jbe     OnLispStack
</code></pre>

<br>
</li>
<li id='diff-7'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-7'>
<strong>
src/lisp/x86-validate-darwin.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/x86-validate-darwin.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/x86-validate-darwin.h
</span><span style="color: #aaaaaa">@@ -18,10 +18,14 @@
</span> #define STATIC_SPACE_START        (SpaceStart_TargetStatic)
 #define STATIC_SPACE_SIZE      (0x0ffff000)    /* 256MB - 1 page */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define BINDING_STACK_START       (0x38000000)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define BINDING_STACK_SIZE        (0x07fff000)    /* 128MB - 1 page */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define CONTROL_STACK_START       (0x40000000)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> 
 /*
  * According to /usr/include/sys/signal.h, MINSIGSTKSZ is 32K and
<span style="color: #aaaaaa">@@ -29,7 +33,9 @@
</span>  */
 #define CONTROL_STACK_SIZE     (0x07fdf000)    /* 128MB - SIGSTKSZ - 1 page */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define SIGNAL_STACK_START        (0x47fe0000)    /* One page past the end of the control stack */
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define SIGNAL_STACK_SIZE SIGSTKSZ
 
 #define DYNAMIC_0_SPACE_START  (SpaceStart_TargetDynamic)
</code></pre>

<br>
</li>
<li id='diff-8'>
<a href='https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5#diff-8'>
<strong>
src/lisp/x86-validate-linux.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/lisp/x86-validate-linux.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/lisp/x86-validate-linux.h
</span><span style="color: #aaaaaa">@@ -36,13 +36,19 @@
</span> #define STATIC_SPACE_START        (SpaceStart_TargetStatic)
 #define STATIC_SPACE_SIZE      (0x0ffff000)    /* 256MB - 1 page */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define BINDING_STACK_START       (0x20000000)
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define BINDING_STACK_SIZE        (0x07fff000)    /* 128MB - 1 page */
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define CONTROL_STACK_START       0x38000000
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define CONTROL_STACK_SIZE        (0x07fff000 - 8192)
 
<span style="color: #000000;background-color: #ddffdd">+#if 0
</span> #define SIGNAL_STACK_START        CONTROL_STACK_END
<span style="color: #000000;background-color: #ddffdd">+#endif
</span> #define SIGNAL_STACK_SIZE SIGSTKSZ
 
 #define DYNAMIC_0_SPACE_START  (SpaceStart_TargetDynamic)
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5">View it on GitLab</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":["merge_requests","issues","commit"],"url":"https://gitlab.common-lisp.net/cmucl/cmucl/compare/32ae8b143a2c6caa09d8c97ae6ce6c49623a2978...e4553e8ac0bda154575cb4e4a60ae274772d27a5"}}</script>
</p>
</div>
</body>
</html>