Authors: Andreas Krall
Stefan Ring
- $Id: codegen.c 1138 2004-06-05 20:39:49Z twisti $
+ $Id: codegen.c 1156 2004-06-11 11:34:49Z stefan $
*/
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
void thread_restartcriticalsection(void *u)
{
+ /* XXX set pc to restart address */
}
#endif
mach_msg_type_number_t thread_state_count = PPC_THREAD_STATE_COUNT;
ppc_thread_state_t thread_state;
kern_return_t r;
+
+ if (checknull)
+ return 0;
r = thread_get_state(thread, flavor,
(natural_t*)&thread_state, &thread_state_count);
regs[REG_ITMP2_XPC] = crashpc;
regs[REG_ITMP1_XPTR] = (u4) xptr;
+ thread_state.srr0 = (u4) asm_handle_exception;
r = thread_set_state(thread, flavor,
(natural_t*)&thread_state, thread_state_count);
void init_exceptions(void)
{
+ GC_dirty_init(1);
}
void adjust_argvars(stackptr s, int d, int *fa, int *ia)
/* that it's not write protected by the virtual */
/* dirty bit implementation. */
-void GC_dirty_init GC_PROTO((void));
+void GC_dirty_init GC_PROTO((int gc_external));
/* Slow/general mark bit manipulation: */
GC_API GC_bool GC_is_marked GC_PROTO((ptr_t p));
# endif
# ifdef GC_SOLARIS_THREADS
/* We need dirty bits in order to find live stack sections. */
- GC_dirty_init();
+ GC_dirty_init(0);
# endif
# if !defined(THREADS) || defined(GC_PTHREADS) || defined(GC_WIN32_THREADS) \
|| defined(GC_SOLARIS_THREADS)
GC_ASSERT(!GC_incremental);
GC_setpagesize();
# ifndef GC_SOLARIS_THREADS
- GC_dirty_init();
+ GC_dirty_init(0);
# endif
GC_ASSERT(GC_words_allocd == 0)
GC_incremental = TRUE;
if (GC_no_win32_dlls) goto out;
# ifndef GC_SOLARIS_THREADS
maybe_install_looping_handler(); /* Before write fault handler! */
- GC_dirty_init();
+ GC_dirty_init(0);
# endif
if (!GC_is_initialized) {
GC_init_inner();
/* written. */
/* Initialize virtual dirty bit implementation. */
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
# ifdef PRINTSTATS
GC_printf0("Initializing DEFAULT_VDB...\n");
}
#if !defined(DARWIN)
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(LINUX) || \
defined(OSF1) || defined(HURD)
int GC_proc_fd;
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
int fd;
char buf[30];
ptr_t GC_vd_base; /* Address corresponding to GC_grungy_bits[0] */
/* HBLKSIZE aligned. */
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
GC_dirty_maintained = TRUE;
/* For the time being, we assume the heap generally grows up */
}
#endif /* BROKEN_EXCEPTION_HANDLING */
-void GC_dirty_init() {
+void GC_dirty_init(int gc_external) {
kern_return_t r;
mach_port_t me;
pthread_t thread;
pthread_attr_t attr;
exception_mask_t mask;
+ if (!gc_external) {
# ifdef PRINTSTATS
GC_printf0("Inititalizing mach/darwin mprotect virtual dirty bit "
"implementation\n");
GC_err_printf0("Page size not multiple of HBLKSIZE\n");
ABORT("Page size not multiple of HBLKSIZE");
}
+
+ } else {
GC_task_self = me = mach_task_self();
}
}
#endif /* BROKEN_EXCEPTION_HANDLING */
+ }
}
/* The source code for Apple's GDB was used as a reference for the exception
/* that it's not write protected by the virtual */
/* dirty bit implementation. */
-void GC_dirty_init GC_PROTO((void));
+void GC_dirty_init GC_PROTO((int gc_external));
/* Slow/general mark bit manipulation: */
GC_API GC_bool GC_is_marked GC_PROTO((ptr_t p));
# endif
# ifdef GC_SOLARIS_THREADS
/* We need dirty bits in order to find live stack sections. */
- GC_dirty_init();
+ GC_dirty_init(0);
# endif
# if !defined(THREADS) || defined(GC_PTHREADS) || defined(GC_WIN32_THREADS) \
|| defined(GC_SOLARIS_THREADS)
GC_ASSERT(!GC_incremental);
GC_setpagesize();
# ifndef GC_SOLARIS_THREADS
- GC_dirty_init();
+ GC_dirty_init(0);
# endif
GC_ASSERT(GC_words_allocd == 0)
GC_incremental = TRUE;
if (GC_no_win32_dlls) goto out;
# ifndef GC_SOLARIS_THREADS
maybe_install_looping_handler(); /* Before write fault handler! */
- GC_dirty_init();
+ GC_dirty_init(0);
# endif
if (!GC_is_initialized) {
GC_init_inner();
/* written. */
/* Initialize virtual dirty bit implementation. */
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
# ifdef PRINTSTATS
GC_printf0("Initializing DEFAULT_VDB...\n");
}
#if !defined(DARWIN)
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(LINUX) || \
defined(OSF1) || defined(HURD)
int GC_proc_fd;
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
int fd;
char buf[30];
ptr_t GC_vd_base; /* Address corresponding to GC_grungy_bits[0] */
/* HBLKSIZE aligned. */
-void GC_dirty_init()
+void GC_dirty_init(int gc_external)
{
GC_dirty_maintained = TRUE;
/* For the time being, we assume the heap generally grows up */
}
#endif /* BROKEN_EXCEPTION_HANDLING */
-void GC_dirty_init() {
+void GC_dirty_init(int gc_external) {
kern_return_t r;
mach_port_t me;
pthread_t thread;
pthread_attr_t attr;
exception_mask_t mask;
+ if (!gc_external) {
# ifdef PRINTSTATS
GC_printf0("Inititalizing mach/darwin mprotect virtual dirty bit "
"implementation\n");
GC_err_printf0("Page size not multiple of HBLKSIZE\n");
ABORT("Page size not multiple of HBLKSIZE");
}
+
+ } else {
GC_task_self = me = mach_task_self();
}
}
#endif /* BROKEN_EXCEPTION_HANDLING */
+ }
}
/* The source code for Apple's GDB was used as a reference for the exception
Authors: Andreas Krall
Stefan Ring
- $Id: codegen.c 1138 2004-06-05 20:39:49Z twisti $
+ $Id: codegen.c 1156 2004-06-11 11:34:49Z stefan $
*/
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
void thread_restartcriticalsection(void *u)
{
+ /* XXX set pc to restart address */
}
#endif
mach_msg_type_number_t thread_state_count = PPC_THREAD_STATE_COUNT;
ppc_thread_state_t thread_state;
kern_return_t r;
+
+ if (checknull)
+ return 0;
r = thread_get_state(thread, flavor,
(natural_t*)&thread_state, &thread_state_count);
regs[REG_ITMP2_XPC] = crashpc;
regs[REG_ITMP1_XPTR] = (u4) xptr;
+ thread_state.srr0 = (u4) asm_handle_exception;
r = thread_set_state(thread, flavor,
(natural_t*)&thread_state, thread_state_count);
void init_exceptions(void)
{
+ GC_dirty_init(1);
}
void adjust_argvars(stackptr s, int d, int *fa, int *ia)