Permalink
Browse files

Conditionally moved some contextual C globals back out of the struct,…

… if they are accessed by the assembly runtime in some ports; this lets us keep existing assembly runtimes with no changes
  • Loading branch information...
luca
luca committed Sep 16, 2013
1 parent 0a0c1b3 commit 68c37b378209f12c4d9b319c0d7426dd8634077c
Showing with 312 additions and 257 deletions.
  1. +5 −0 asmrun/backtrace.c
  2. +6 −0 asmrun/fail.c
  3. +19 −19 asmrun/power-elf.S
  4. BIN boot/ocamlrun
  5. BIN boot/ocamlrun.boot
  6. +253 −237 byterun/context.c
  7. +29 −1 byterun/context.h
View
@@ -113,6 +113,11 @@ void caml_stash_backtrace_r(CAML_R, value exn, uintnat pc, char * sp, char * tra
}
}
+/* Compatibility version, called by the assembly runtime in some ports: */
+void caml_stash_backtrace(value exn, uintnat pc, char * sp, char * trapsp){
+ caml_stash_backtrace_r(caml_get_thread_local_context(), exn, pc, sp, trapsp);
+}
+
/* Extract location information for the given frame descriptor */
struct loc_info {
View
@@ -223,6 +223,12 @@ void caml_array_bound_error_r(CAML_R)
caml_raise_r(ctx, (value) &array_bound_error_bucket.exn);
}
+/* Compatibility version, called by the assembly runtime in some ports: */
+void caml_array_bound_error(void){
+ caml_array_bound_error_r(caml_get_thread_local_context());
+}
+
+
int caml_is_special_exception_r(CAML_R, value exn) {
return exn == (value) caml_exn_Match_failure
|| exn == (value) caml_exn_Assert_failure
View
@@ -11,25 +11,25 @@
/* */
/***********************************************************************/
-/* experimental hack: begin */
-/* This works and isn't too complicated, but has to be done by hand on
- each architecture (on all shitty asseblers, actually; with GNU as
- everywhere it wouldn't be that hard). Sadly, it will have to go.
- --L.S. */
-#define BYTES_PER_WORD 4
-.equiv caml_young_limit, the_one_and_only_context_struct + BYTES_PER_WORD*0
-.equiv caml_young_ptr, the_one_and_only_context_struct + BYTES_PER_WORD*1
-.equiv caml_last_return_address, the_one_and_only_context_struct + BYTES_PER_WORD*2
-.equiv caml_bottom_of_stack, the_one_and_only_context_struct + BYTES_PER_WORD*3
-.equiv caml_gc_regs, the_one_and_only_context_struct + BYTES_PER_WORD*4
-.equiv caml_exception_pointer, the_one_and_only_context_struct + BYTES_PER_WORD*5
-.equiv caml_backtrace_active, the_one_and_only_context_struct + BYTES_PER_WORD*6
-.section ".data"
- .globl caml_globals_inited
-/* .type caml_globals_inited, @object */
-caml_globals_inited:
- .long 1 /* one descriptor */
-/* experimental hack: end */
+;; /* experimental hack: begin */
+;; /* This works and isn't too complicated, but has to be done by hand on
+;; each architecture (on all shitty asseblers, actually; with GNU as
+;; everywhere it wouldn't be that hard). Sadly, it will have to go.
+;; --L.S. */
+;; #define BYTES_PER_WORD 4
+;; .equiv caml_young_limit, the_one_and_only_context_struct + BYTES_PER_WORD*0
+;; .equiv caml_young_ptr, the_one_and_only_context_struct + BYTES_PER_WORD*1
+;; .equiv caml_last_return_address, the_one_and_only_context_struct + BYTES_PER_WORD*2
+;; .equiv caml_bottom_of_stack, the_one_and_only_context_struct + BYTES_PER_WORD*3
+;; .equiv caml_gc_regs, the_one_and_only_context_struct + BYTES_PER_WORD*4
+;; .equiv caml_exception_pointer, the_one_and_only_context_struct + BYTES_PER_WORD*5
+;; .equiv caml_backtrace_active, the_one_and_only_context_struct + BYTES_PER_WORD*6
+;; .section ".data"
+;; .globl caml_globals_inited
+;; /* .type caml_globals_inited, @object */
+;; caml_globals_inited:
+;; .long 1 /* one descriptor */
+;; /* experimental hack: end */
/* $Id$ */
View
Binary file not shown.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 68c37b3

Please sign in to comment.