aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.h
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-18 16:44:48 +0100
committerSverker Eriksson <[email protected]>2012-02-21 12:22:59 +0100
commitdab78e34dac11579cda578ffc6cf9293394456e4 (patch)
tree37bb3c0c882683051d6d514772daf7f2ae856e70 /erts/emulator/beam/beam_load.h
parentf3b2fc3db73e76323bff1a7f233a8914464b29aa (diff)
downloadotp-dab78e34dac11579cda578ffc6cf9293394456e4.tar.gz
otp-dab78e34dac11579cda578ffc6cf9293394456e4.tar.bz2
otp-dab78e34dac11579cda578ffc6cf9293394456e4.zip
BEAM loader: Break out handling of ranges into beam_ranges.c
Having the entire implementation of range handling (address table) in one source file will help when we'll need to update the ranges without stopping all schedulers in the next commit.
Diffstat (limited to 'erts/emulator/beam/beam_load.h')
-rw-r--r--erts/emulator/beam/beam_load.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h
index 997ba197db..9da692625b 100644
--- a/erts/emulator/beam/beam_load.h
+++ b/erts/emulator/beam/beam_load.h
@@ -61,11 +61,6 @@ typedef struct {
* instruction pointer.
*/
-extern Range* modules;
-extern int num_loaded_modules;
-extern int allocated_modules;
-extern Range* mid_module;
-
/* Total code size in bytes */
extern Uint erts_total_code_size;
/*
@@ -126,4 +121,26 @@ extern Uint erts_total_code_size;
*/
#define MI_FUNCTIONS 13
+
+/*
+ * Layout of the line table.
+ */
+
+#define MI_LINE_FNAME_PTR 0
+#define MI_LINE_LOC_TAB 1
+#define MI_LINE_LOC_SIZE 2
+#define MI_LINE_FUNC_TAB 3
+
+#define LINE_INVALID_LOCATION (0)
+
+/*
+ * Macros for manipulating locations.
+ */
+
+#define IS_VALID_LOCATION(File, Line) \
+ ((unsigned) (File) < 255 && (unsigned) (Line) < ((1 << 24) - 1))
+#define MAKE_LOCATION(File, Line) (((File) << 24) | (Line))
+#define LOC_FILE(Loc) ((Loc) >> 24)
+#define LOC_LINE(Loc) ((Loc) & ((1 << 24)-1))
+
#endif /* _BEAM_LOAD_H */