factor/vm/image.hpp

44 lines
987 B
C++
Raw Normal View History

2009-05-04 02:46:13 -04:00
namespace factor
{
static const cell image_magic = 0x0f0e0d0c;
static const cell image_version = 4;
2009-05-02 05:04:19 -04:00
2009-05-04 05:50:24 -04:00
struct image_header {
cell magic;
cell version;
/* base address of data heap when image was saved */
2009-05-04 05:50:24 -04:00
cell data_relocation_base;
2009-05-02 05:04:19 -04:00
/* size of heap */
2009-05-04 05:50:24 -04:00
cell data_size;
/* base address of code heap when image was saved */
2009-05-04 05:50:24 -04:00
cell code_relocation_base;
2009-05-02 05:04:19 -04:00
/* size of code heap */
2009-05-04 05:50:24 -04:00
cell code_size;
2009-05-02 05:04:19 -04:00
/* tagged pointer to t singleton */
cell true_object;
2009-05-02 05:04:19 -04:00
/* tagged pointer to bignum 0 */
2009-05-04 05:50:24 -04:00
cell bignum_zero;
2009-05-02 05:04:19 -04:00
/* tagged pointer to bignum 1 */
2009-05-04 05:50:24 -04:00
cell bignum_pos_one;
2009-05-02 05:04:19 -04:00
/* tagged pointer to bignum -1 */
2009-05-04 05:50:24 -04:00
cell bignum_neg_one;
2009-05-02 05:04:19 -04:00
/* Initial user environment */
2009-10-23 01:33:53 -04:00
cell special_objects[special_object_count];
2009-05-02 11:17:05 -04:00
};
2009-05-02 05:04:19 -04:00
2009-05-04 05:50:24 -04:00
struct vm_parameters {
const vm_char *image_path;
const vm_char *executable_path;
cell datastack_size, retainstack_size, callstack_size;
cell young_size, aging_size, tenured_size;
2009-05-04 05:50:24 -04:00
cell code_size;
2009-05-02 05:04:19 -04:00
bool fep;
bool console;
bool signals;
2009-05-04 05:50:24 -04:00
cell max_pic_size;
cell callback_size;
2009-05-02 11:17:05 -04:00
};
2009-05-02 05:04:19 -04:00
2009-05-04 02:46:13 -04:00
}