Fixes to place_instance_init so that ports work, config setup calls are made, and quick_stx is THREAD_LOCAL

svn: r11599
This commit is contained in:
Kevin Tew 2008-09-09 15:54:00 +00:00
parent 183ef9b926
commit 6157c3d4d0
5 changed files with 21 additions and 15 deletions

View File

@ -358,12 +358,22 @@ static void place_instance_init_pre_kernel(void *stack_base) {
static Scheme_Env *place_instance_init_post_kernel() {
Scheme_Env *env;
/* error handling and buffers */
scheme_init_error_escape_proc(NULL);
scheme_init_print_buffers_places();
scheme_init_eval_places();
env = scheme_make_empty_env();
scheme_set_param(scheme_current_config(), MZCONFIG_ENV, (Scheme_Object *)env);
/*initialize config */
scheme_init_port_config();
scheme_init_port_fun_config();
scheme_init_error_config();
#ifndef NO_SCHEME_EXNS
scheme_init_exn_config();
#endif
scheme_init_memtrace(env);
#ifndef NO_TCP_SUPPORT
scheme_init_network(env);
@ -384,7 +394,6 @@ static Scheme_Env *place_instance_init_post_kernel() {
scheme_save_initial_module_set(env);
scheme_init_error_escape_proc(NULL);
scheme_starting_up = 0;

View File

@ -3435,9 +3435,7 @@ void scheme_init_exn_config(void)
{
Scheme_Object *h;
h = scheme_make_prim_w_arity(def_exn_handler,
"default-exception-handler",
1, 1);
h = scheme_make_prim_w_arity(def_exn_handler, "default-exception-handler", 1, 1);
scheme_set_root_param(MZCONFIG_INIT_EXN_HANDLER, h);
}

View File

@ -157,7 +157,7 @@ void scheme_set_startup_use_jit(int v) { scheme_startup_use_jit = v; }
THREAD_LOCAL unsigned long scheme_stack_boundary;
THREAD_LOCAL unsigned long volatile scheme_jit_stack_boundary;
#endif
static Scheme_Object *quick_stx;
static THREAD_LOCAL Scheme_Object *quick_stx;
/* global counters */
/* FIXME needs to be atomically incremented */
@ -397,7 +397,10 @@ scheme_init_eval (Scheme_Env *env)
scheme_add_global_keyword("#%app", app_expander, env);
scheme_add_global_keyword("#%datum", datum_expander, env);
scheme_add_global_keyword("#%top", top_expander, env);
}
void scheme_init_eval_places()
{
REGISTER_SO(quick_stx);
}

View File

@ -564,8 +564,6 @@ scheme_init_port (Scheme_Env *env)
# endif
#endif
scheme_init_port_config();
register_port_wait();
scheme_add_global_constant("subprocess",
@ -621,12 +619,9 @@ void scheme_init_port_config(void)
config = scheme_current_config();
scheme_set_param(config, MZCONFIG_INPUT_PORT,
scheme_orig_stdin_port);
scheme_set_param(config, MZCONFIG_OUTPUT_PORT,
scheme_orig_stdout_port);
scheme_set_param(config, MZCONFIG_ERROR_PORT,
scheme_orig_stderr_port);
scheme_set_param(config, MZCONFIG_INPUT_PORT, scheme_orig_stdin_port);
scheme_set_param(config, MZCONFIG_OUTPUT_PORT, scheme_orig_stdout_port);
scheme_set_param(config, MZCONFIG_ERROR_PORT, scheme_orig_stderr_port);
}
Scheme_Object * scheme_make_eof (void)

View File

@ -211,6 +211,7 @@ void scheme_init_foreign(Scheme_Env *env);
void scheme_init_place(Scheme_Env *env);
void scheme_init_print_buffers_places(void);
void scheme_init_eval_places(void);
void scheme_free_dynamic_extensions(void);