Commit 24dc26f5 authored by eg's avatar eg

VM Modification

The VM doesn't use anymore globals. This is the first step toward
threads integration in STklos
parent 6648278c
/*
This file was automatically generated on Mon Jan 2 10:41:49 2006 by make-C-boot
This file was automatically generated on Sun Jan 22 19:52:02 2006 by make-C-boot
This is a dump of the image in file /mnt/users/eg/Projects/STklos/lib/boot.img3
***DO NOT EDIT BY HAND***
*/
......
This diff is collapsed.
/*
* l i b . c -- Scheme library
*
* Copyright © 2000-2005 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
* Copyright © 2000-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 5-Jan-2000 12:17 (eg)
* Last file update: 7-May-2005 15:50 (eg)
* Last file update: 20-Jan-2006 10:01 (eg)
*/
......@@ -49,7 +49,7 @@ static void init_library_path(void)
int
STk_init_library(int *argc, char ***argv)
STk_init_library(int *argc, char ***argv, int stack_size)
{
STk_get_stack_pointer(&STk_start_stack);
......@@ -74,7 +74,7 @@ STk_init_library(int *argc, char ***argv)
STk_init_boolean() &&
STk_init_reader() &&
STk_init_system() &&
STk_init_vm() &&
STk_init_vm(stack_size) &&
STk_init_hash() &&
STk_init_misc() &&
STk_init_signal() &&
......
/*
* stklos.c -- STklos interpreter main function
*
* Copyright 1999-2005 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
* Copyright 1999-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 28-Dec-1999 21:19 (eg)
* Last file update: 30-Dec-2005 17:06 (eg)
* Last file update: 20-Jan-2006 10:03 (eg)
*/
#include <stklos.h>
......@@ -159,11 +159,8 @@ int main(int argc, char *argv[])
/* Hack: to give the illusion that ther is no VM under the scene */
if (*program_file) argv0 = program_file;
/* Allocate a stack */
STk_allocate_stack(stack_size);
/* Initialize the library */
if (!STk_init_library(&argc, &argv)) {
if (!STk_init_library(&argc, &argv, stack_size)) {
fprintf(stderr, "cannot initialize the STklos library\nABORT\n");
exit(1);
}
......
/*
* stklos.h -- stklos.h
*
* Copyright 1999-2005 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
* Copyright 1999-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 28-Dec-1999 22:58 (eg)
* Last file update: 26-Dec-2005 18:28 (eg)
* Last file update: 20-Jan-2006 10:06 (eg)
*/
#ifndef STKLOS_H
......@@ -468,7 +468,7 @@ extern int STk_library_initialized; /* True when successfully initialized */
extern char *STk_library_path; /* The base directory where files are found */
extern void *STk_start_stack; /* An approx. of main thread stack addr */
int STk_init_library(int *argc, char ***argv);
int STk_init_library(int *argc, char ***argv, int stack_size);
/*
------------------------------------------------------------------------------
......@@ -1142,15 +1142,13 @@ SCM STk_C_apply(SCM func, int nargs, ...);
void STk_get_stack_pointer(void **addr);
SCM STk_n_values(int n, ...);
void STk_allocate_stack(long n);
EXTERN_PRIMITIVE("%vm-backtrace", vm_bt, subr0, (void));
SCM STk_load_bcode_file(SCM f);
int STk_load_boot(char *s);
int STk_boot_from_C(void);
int STk_init_vm(void);
int STk_init_vm(int stack_size);
/*****************************************************************************/
......
This diff is collapsed.
;;;;
;;;; do-test.stk -- The pilot of all tests
;;;;
;;;; Copyright © 2005 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;; Copyright © 2005-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 3-May-2005 12:28 (eg)
;;;; Last file update: 4-Aug-2005 11:15 (eg)
;;;; Last file update: 20-Jan-2006 10:48 (eg)
;;;;
(load "./test.stk")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment