* Pass an explicit thread argument to scavenge_interrupt_contexts()
instead of having it call arch_os_get_current_thread(), saving the
extra call on cheneygc and allowing multiple threads on gencgc.
* On gencgc, the same applies to scavenge_control_stack().
* On gencgc, don't scrub the control stack when scavenging, wait
until after the scavenging is done (it's done by the stop-for-gc
handler on other threads).
* On gencgc, scavenge interrupt contexts and control stacks for
all threads, not just the current thread.
* On a minor note, the code for scavenging interrupt contexts is
largely unchanged between cheneygc and gencgc. Perhaps it should
be re-unified in gc-common.c?
#ifdef PRINTNOISE
printf("Scavenging interrupt contexts ...\n");
#endif
#ifdef PRINTNOISE
printf("Scavenging interrupt contexts ...\n");
#endif
- scavenge_interrupt_contexts();
+ scavenge_interrupt_contexts(th);
#ifdef PRINTNOISE
printf("Scavenging interrupt handlers (%d bytes) ...\n",
#ifdef PRINTNOISE
printf("Scavenging interrupt handlers (%d bytes) ...\n",
-void scavenge_interrupt_contexts(void)
+void scavenge_interrupt_contexts(struct thread *th)
{
int i, index;
os_context_t *context;
{
int i, index;
os_context_t *context;
- struct thread *th=arch_os_get_current_thread();
-
index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,0));
index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,0));
#define _GC_INTERNAL_H_
#include <genesis/simple-fun.h>
#define _GC_INTERNAL_H_
#include <genesis/simple-fun.h>
/* disabling gc assertions made no discernable difference to GC speed,
* last I tried it - dan 2003.12.21
/* disabling gc assertions made no discernable difference to GC speed,
* last I tried it - dan 2003.12.21
extern struct hash_table *weak_hash_tables; /* in gc-common.c */
extern void scavenge(lispobj *start, long n_words);
extern struct hash_table *weak_hash_tables; /* in gc-common.c */
extern void scavenge(lispobj *start, long n_words);
-extern void scavenge_interrupt_contexts(void);
+extern void scavenge_interrupt_contexts(struct thread *thread);
extern void scav_weak_hash_tables(void);
extern void scan_weak_hash_tables(void);
extern void scan_weak_pointers(void);
extern void scav_weak_hash_tables(void);
extern void scan_weak_hash_tables(void);
extern void scan_weak_pointers(void);
#if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
static void
#if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
static void
-scavenge_control_stack()
+scavenge_control_stack(struct thread *th)
{
unsigned long control_stack_size;
/* This is going to be a big problem when we try to port threads
* to PPC... CLH */
{
unsigned long control_stack_size;
/* This is going to be a big problem when we try to port threads
* to PPC... CLH */
- struct thread *th = arch_os_get_current_thread();
lispobj *control_stack =
(lispobj *)(th->control_stack_start);
control_stack_size = current_control_stack_pointer - control_stack;
scavenge(control_stack, control_stack_size);
lispobj *control_stack =
(lispobj *)(th->control_stack_start);
control_stack_size = current_control_stack_pointer - control_stack;
scavenge(control_stack, control_stack_size);
-
- /* Scrub the unscavenged control stack space, so that we can't run
- * into any stale pointers in a later GC. */
- scrub_control_stack();
}
/* Scavenging Interrupt Contexts */
}
/* Scavenging Interrupt Contexts */
-scavenge_interrupt_contexts(void)
+scavenge_interrupt_contexts(struct thread *th)
{
int i, index;
os_context_t *context;
{
int i, index;
os_context_t *context;
- struct thread *th=arch_os_get_current_thread();
-
- index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,0));
+ index = fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,th));
#if defined(DEBUG_PRINT_CONTEXT_INDEX)
printf("Number of active contexts: %d\n", index);
#if defined(DEBUG_PRINT_CONTEXT_INDEX)
printf("Number of active contexts: %d\n", index);
* If not x86, we need to scavenge the interrupt context(s) and the
* control stack.
*/
* If not x86, we need to scavenge the interrupt context(s) and the
* control stack.
*/
- scavenge_interrupt_contexts();
- scavenge_control_stack();
+ {
+ struct thread *th;
+ for_each_thread(th) {
+ scavenge_interrupt_contexts(th);
+ scavenge_control_stack(th);
+ }
+
+ /* Scrub the unscavenged control stack space, so that we can't run
+ * into any stale pointers in a later GC (this is done by the
+ * stop-for-gc handler in the other threads). */
+ scrub_control_stack();
+ }
#endif
/* Scavenge the Lisp functions of the interrupt handlers, taking
#endif
/* Scavenge the Lisp functions of the interrupt handlers, taking
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)