Commit c2206235 by Bryce McKinlay

Initial revision

From-SVN: r49359
parent f5d09ce7
GC on EWS4800
-------------
1. About EWS4800
EWS4800 is 32bit/64bit workstation.
Vender: NEC Corporation
OS: UX/4800 R9.* - R13.* (SystemV R4.2)
CPU: R4000, R4400, R10000 (MIPS)
2. Compiler
32bit:
Use ANSI C compiler.
CC = /usr/abiccs/bin/cc
64bit:
Use 64bit ANSI C compiler.
CC = /usr/ccs64/bin/cc
AR = /usr/ccs64/bin/ar
3. ELF file format
*** Caution: The following infomation is empirical. ***
32bit:
ELF file has an unique format. (See a.out(4) and end(3C).)
&_start
: text segment
&etext
DATASTART
: data segment (initialized)
&edata
DATASTART2
: data segment (uninitialized)
&end
Here, DATASTART and DATASTART2 are macros of GC, and are defined as
the following equations. (See include/private/gcconfig.h.)
The algorithm for DATASTART is similar with the function
GC_SysVGetDataStart() in os_dep.c.
DATASTART = ((&etext + 0x3ffff) & ~0x3ffff) + (&etext & 0xffff)
Dynamically linked:
DATASTART2 = (&_gp + 0x8000 + 0x3ffff) & ~0x3ffff
Statically linked:
DATASTART2 = &edata
GC has to check addresses both between DATASTART and &edata, and
between DATASTART2 and &end. If a program accesses between &etext
and DATASTART, or between &edata and DATASTART2, the segmentation
error occurs and the program stops.
If a program is statically linked, there is not a gap between
&edata and DATASTART2. The global symbol &_DYNAMIC_LINKING is used
for the detection.
64bit:
ELF file has a simple format. (See end(3C).)
_ftext
: text segment
_etext
_fdata = DATASTART
: data segment (initialized)
_edata
_fbss
: data segment (uninitialized)
_end = DATAEND
--
Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
! SPARCompiler 3.0 and later apparently no longer handles
! asm outside functions. So we need a separate .s file
! This is only set up for SunOS 5, not SunOS 4.
! Assumes this is called before the stack contents are
! examined.
.seg "text"
.globl GC_save_regs_in_stack
.globl GC_push_regs
GC_save_regs_in_stack:
GC_push_regs:
#if defined(__arch64__) || defined(__sparcv9)
save %sp,-128,%sp
flushw
ret
restore %sp,2047+128,%o0
#else /* 32 bit SPARC */
ta 0x3 ! ST_FLUSH_WINDOWS
mov %sp,%o0
retl
nop
#endif /* 32 bit SPARC */
.GC_save_regs_in_stack_end:
.size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
.globl GC_clear_stack_inner
GC_clear_stack_inner:
#if defined(__arch64__) || defined(__sparcv9)
mov %sp,%o2 ! Save sp
add %sp,2047-8,%o3 ! p = sp+bias-8
add %o1,-2047-192,%sp ! Move sp out of the way,
! so that traps still work.
! Includes some extra words
! so we can be sloppy below.
loop:
stx %g0,[%o3] ! *(long *)p = 0
cmp %o3,%o1
bgu,pt %xcc, loop ! if (p > limit) goto loop
asm("add %o3,-8,%o3 ! p -= 8 (delay slot)
retl
mov %o2,%sp ! Restore sp., delay slot
#else /* 32 bit SPARC */
mov %sp,%o2 ! Save sp
add %sp,-8,%o3 ! p = sp-8
clr %g1 ! [g0,g1] = 0
add %o1,-0x60,%sp ! Move sp out of the way,
! so that traps still work.
! Includes some extra words
! so we can be sloppy below.
loop:
std %g0,[%o3] ! *(long long *)p = 0
cmp %o3,%o1
bgu loop ! if (p > limit) goto loop
add %o3,-8,%o3 ! p -= 8 (delay slot)
retl
mov %o2,%sp ! Restore sp., delay slot
#endif /* 32 bit SPARC */
.GC_clear_stack_inner_end:
.size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner
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