Commit b6459d9a by Anthony Green Committed by Anthony Green

xscale-elf support

From-SVN: r49626
parent 85aa876c
2001-02-08 Anthony Green <green@redhat.com>
* include/private/gcconfig.h: Add XSCALE NOSYS support for bare
board embedded targets.
* os_dep.c: Avoid signal handling code for NOSYS/ECOS targets.
Use GC_get_stack_base for NOSYS/ECOS targets. Clean up some
redundant uses of ECOS.
* misc.c: Use NOSYS where ECOS is being used.
Don't define GC_write twice for ECOS systems.
(GC_write): New function for NOSYS targets.
2002-02-06 Adam Megacz <adam@xwt.org> 2002-02-06 Adam Megacz <adam@xwt.org>
* boehm-gc/include/gc.h: (GC_CreateThread) This function is * boehm-gc/include/gc.h: (GC_CreateThread) This function is
......
...@@ -39,6 +39,13 @@ ...@@ -39,6 +39,13 @@
# endif # endif
/* Determine the machine type: */ /* Determine the machine type: */
# if defined(__XSCALE__)
# define ARM32
# if !defined(LINUX)
# define NOSYS
# define mach_type_known
# endif
# endif
# if defined(sun) && defined(mc68000) # if defined(sun) && defined(mc68000)
# define M68K # define M68K
# define SUNOS4 # define SUNOS4
...@@ -1495,6 +1502,15 @@ ...@@ -1495,6 +1502,15 @@
# define OS_TYPE "MSWINCE" # define OS_TYPE "MSWINCE"
# define DATAEND /* not needed */ # define DATAEND /* not needed */
# endif # endif
# ifdef NOSYS
/* __data_start is usually defined in the target linker script. */
extern int __data_start;
# define DATASTART (ptr_t)(&__data_start)
# define USE_GENERIC_PUSH_REGS
/* __stack_base__ is set in newlib/libc/sys/arm/crt0.S */
extern void *__stack_base__;
# define STACKBOTTOM ((ptr_t) (__stack_base__))
# endif
#endif #endif
# ifdef SH # ifdef SH
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
# endif # endif
# endif # endif
#ifdef ECOS #if defined(NOSYS) || defined(ECOS)
#undef STACKBASE #undef STACKBASE
#endif #endif
...@@ -744,7 +744,8 @@ int GC_tmp; /* Should really be local ... */ ...@@ -744,7 +744,8 @@ int GC_tmp; /* Should really be local ... */
# endif # endif
#endif #endif
#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(OS2) && !defined(MACOS) #if !defined(MSWIN32) && !defined(MSWINCE) && !defined(OS2) \
&& !defined(MACOS) && !defined(ECOS) && !defined(NOSYS)
int GC_write(fd, buf, len) int GC_write(fd, buf, len)
int fd; int fd;
GC_CONST char *buf; GC_CONST char *buf;
...@@ -767,7 +768,7 @@ size_t len; ...@@ -767,7 +768,7 @@ size_t len;
} }
#endif /* UN*X */ #endif /* UN*X */
#if defined(ECOS) #ifdef ECOS
int GC_write(fd, buf, len) int GC_write(fd, buf, len)
{ {
_Jv_diag_write (buf, len); _Jv_diag_write (buf, len);
...@@ -775,6 +776,14 @@ int GC_write(fd, buf, len) ...@@ -775,6 +776,14 @@ int GC_write(fd, buf, len)
} }
#endif #endif
#ifdef NOSYS
int GC_write(fd, buf, len)
{
/* No writing. */
return len;
}
#endif
#if defined(MSWIN32) || defined(MSWINCE) #if defined(MSWIN32) || defined(MSWINCE)
# define WRITE(f, buf, len) GC_write(buf, len) # define WRITE(f, buf, len) GC_write(buf, len)
......
...@@ -333,7 +333,8 @@ void GC_enable_signals(void) ...@@ -333,7 +333,8 @@ void GC_enable_signals(void)
# if !defined(PCR) && !defined(AMIGA) && !defined(MSWIN32) \ # if !defined(PCR) && !defined(AMIGA) && !defined(MSWIN32) \
&& !defined(MSWINCE) \ && !defined(MSWINCE) \
&& !defined(MACOS) && !defined(DJGPP) && !defined(DOS4GW) && !defined(MACOS) && !defined(DJGPP) && !defined(DOS4GW) \
&& !defined(NOSYS) && !defined(ECOS)
# if defined(sigmask) && !defined(UTS4) && !defined(HURD) # if defined(sigmask) && !defined(UTS4) && !defined(HURD)
/* Use the traditional BSD interface */ /* Use the traditional BSD interface */
...@@ -516,7 +517,7 @@ ptr_t GC_get_stack_base() ...@@ -516,7 +517,7 @@ ptr_t GC_get_stack_base()
# undef GC_AMIGA_SB # undef GC_AMIGA_SB
# endif /* AMIGA */ # endif /* AMIGA */
# if defined(NEED_FIND_LIMIT) || (defined(UNIX_LIKE) && !defined(ECOS)) # if defined(NEED_FIND_LIMIT) || defined(UNIX_LIKE)
# ifdef __STDC__ # ifdef __STDC__
typedef void (*handler)(int); typedef void (*handler)(int);
...@@ -540,8 +541,7 @@ ptr_t GC_get_stack_base() ...@@ -540,8 +541,7 @@ ptr_t GC_get_stack_base()
handler h; handler h;
# endif # endif
{ {
# ifndef ECOS # if defined(SUNOS5SIGS) || defined(IRIX5) \
# if defined(SUNOS5SIGS) || defined(IRIX5) \
|| defined(OSF1) || defined(HURD) || defined(OSF1) || defined(HURD)
struct sigaction act; struct sigaction act;
...@@ -579,7 +579,6 @@ ptr_t GC_get_stack_base() ...@@ -579,7 +579,6 @@ ptr_t GC_get_stack_base()
old_bus_handler = signal(SIGBUS, h); old_bus_handler = signal(SIGBUS, h);
# endif # endif
# endif # endif
# endif /* ECOS */
} }
# endif /* NEED_FIND_LIMIT || UNIX_LIKE */ # endif /* NEED_FIND_LIMIT || UNIX_LIKE */
...@@ -602,21 +601,19 @@ ptr_t GC_get_stack_base() ...@@ -602,21 +601,19 @@ ptr_t GC_get_stack_base()
void GC_reset_fault_handler() void GC_reset_fault_handler()
{ {
# ifndef ECOS # if defined(SUNOS5SIGS) || defined(IRIX5) \
# if defined(SUNOS5SIGS) || defined(IRIX5) \ || defined(OSF1) || defined(HURD)
|| defined(OSF1) || defined(HURD) (void) sigaction(SIGSEGV, &old_segv_act, 0);
(void) sigaction(SIGSEGV, &old_segv_act, 0); # if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \ || defined(HPUX) || defined(HURD)
|| defined(HPUX) || defined(HURD) (void) sigaction(SIGBUS, &old_bus_act, 0);
(void) sigaction(SIGBUS, &old_bus_act, 0); # endif
# endif # else
# else (void) signal(SIGSEGV, old_segv_handler);
(void) signal(SIGSEGV, old_segv_handler); # ifdef SIGBUS
# ifdef SIGBUS (void) signal(SIGBUS, old_bus_handler);
(void) signal(SIGBUS, old_bus_handler); # endif
# endif # endif
# endif
# endif /* ECOS */
} }
/* Return the first nonaddressible location > p (up) or */ /* Return the first nonaddressible location > p (up) or */
...@@ -625,39 +622,41 @@ ptr_t GC_get_stack_base() ...@@ -625,39 +622,41 @@ ptr_t GC_get_stack_base()
ptr_t p; ptr_t p;
GC_bool up; GC_bool up;
{ {
# ifndef ECOS static VOLATILE ptr_t result;
static VOLATILE ptr_t result; /* Needs to be static, since otherwise it may not be */
/* Needs to be static, since otherwise it may not be */ /* preserved across the longjmp. Can safely be */
/* preserved across the longjmp. Can safely be */ /* static since it's only called once, with the */
/* static since it's only called once, with the */ /* allocation lock held. */
/* allocation lock held. */
GC_setup_temporary_fault_handler();
GC_setup_temporary_fault_handler(); if (setjmp(GC_jmp_buf) == 0) {
if (setjmp(GC_jmp_buf) == 0) { result = (ptr_t)(((word)(p))
result = (ptr_t)(((word)(p)) & ~(MIN_PAGE_SIZE-1));
& ~(MIN_PAGE_SIZE-1)); for (;;) {
for (;;) { if (up) {
if (up) {
result += MIN_PAGE_SIZE;
} else {
result -= MIN_PAGE_SIZE;
}
GC_noop1((word)(*result));
}
}
GC_reset_fault_handler();
if (!up) {
result += MIN_PAGE_SIZE; result += MIN_PAGE_SIZE;
} } else {
return(result); result -= MIN_PAGE_SIZE;
# else /* ECOS */ }
abort(); GC_noop1((word)(*result));
# endif /* ECOS */ }
}
GC_reset_fault_handler();
if (!up) {
result += MIN_PAGE_SIZE;
}
return(result);
} }
# endif # endif
# ifndef ECOS # if defined(ECOS) || defined(NOSYS)
ptr_t GC_get_stack_base()
{
return STACKBOTTOM;
}
#else
#ifdef LINUX_STACKBOTTOM #ifdef LINUX_STACKBOTTOM
...@@ -761,7 +760,7 @@ ptr_t GC_get_stack_base() ...@@ -761,7 +760,7 @@ ptr_t GC_get_stack_base()
#endif /* FREEBSD_STACKBOTTOM */ #endif /* FREEBSD_STACKBOTTOM */
#if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \ #if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \
&& !defined(MSWINCE) && !defined(OS2) && !defined(ECOS) && !defined(MSWINCE) && !defined(OS2)
ptr_t GC_get_stack_base() ptr_t GC_get_stack_base()
{ {
...@@ -815,7 +814,7 @@ ptr_t GC_get_stack_base() ...@@ -815,7 +814,7 @@ ptr_t GC_get_stack_base()
return(result); return(result);
# endif /* STACKBOTTOM */ # endif /* STACKBOTTOM */
} }
# endif /* ECOS */ # endif /* NOSYS ECOS */
# endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS */ # endif /* ! AMIGA, !OS 2, ! MS Windows, !BEOS */
......
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