~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to asmrun/signals_asm.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2009-02-22 08:49:13 UTC
  • mfrom: (12.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222084913-3i0uw2bhd0lgw0ok
* Uploading to unstable
* debian/control: bump dh-ocaml to (>= 0.4) to avoid buggy ocamlinit.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
/*                                                                     */
12
12
/***********************************************************************/
13
13
 
14
 
/* $Id: signals_asm.c,v 1.2.2.1 2007/11/06 12:26:15 xleroy Exp $ */
 
14
/* $Id: signals_asm.c,v 1.6 2008/01/11 16:13:11 doligez Exp $ */
15
15
 
16
16
/* Signal handling, code specific to the native-code compiler */
17
17
 
47
47
 
48
48
extern char * caml_code_area_start, * caml_code_area_end;
49
49
 
50
 
#define In_code_area(pc) \
51
 
  ((char *)(pc) >= caml_code_area_start && \
52
 
   (char *)(pc) <= caml_code_area_end)
 
50
#define Is_in_code_area(pc) \
 
51
 ( ((char *)(pc) >= caml_code_area_start && \
 
52
    (char *)(pc) <= caml_code_area_end)     \
 
53
   || (Classify_addr(pc) & In_code_area) )
53
54
 
54
55
/* This routine is the common entry point for garbage collection
55
56
   and signal handling.  It can trigger a callback to Caml code.
84
85
     Use the signal context to modify that register too, but only if
85
86
     we are inside Caml code (not inside C code). */
86
87
#if defined(CONTEXT_PC) && defined(CONTEXT_YOUNG_LIMIT)
87
 
    if (In_code_area(CONTEXT_PC))
 
88
    if (Is_in_code_area(CONTEXT_PC))
88
89
      CONTEXT_YOUNG_LIMIT = (context_reg) caml_young_limit;
89
90
#endif
90
91
  }
190
191
      && fault_addr < system_stack_top
191
192
      && fault_addr >= system_stack_top - limit.rlim_cur - 0x2000
192
193
#ifdef CONTEXT_PC
193
 
      && In_code_area(CONTEXT_PC)
 
194
      && Is_in_code_area(CONTEXT_PC)
194
195
#endif
195
196
      ) {
196
197
    /* Turn this into a Stack_overflow exception */