gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Re: gcl/maxima on hppa


From: Camm Maguire
Subject: Re: [Gcl-devel] Re: gcl/maxima on hppa
Date: 01 Aug 2002 22:34:16 -0400

Greetings!

LaMont Jones <address@hidden> writes:

> On Thu, Aug 01, 2002 at 06:48:58PM -0400, Camm Maguire wrote:
> > Greetings, and thank you for this!
> > At first glance, this appears to solve the gc issue on hppa!  There
> > may be a residual difficulty, but I won't be sure until the Debian
> > autobuilder finishes compiling the upload I just made.  
> > 
> > In any case, I would appreciate a version 'which foo can call' as you
> > mention below.  
> 
> Note that .end marks the end of file for the assembler, so you shouldn't
> include that if you're just doing inline assembly...  And the .import
> should not be needed if the function you're importing is in the same
> file.
> 

OK, thanks!

> As someone pointed out to me, the architecture neutral version 'which foo
> can call' is:
>     #include <setjmp.h>
>       jmp_buf registers;
>       setjmp(registers);
> and then use that.  But that would trash the application if it uses setjmp.
> So....
> 

1) This is what I thought.  But gcl does this already for gc, and it
definitely does not seem to be working on hppa.  This same setjmp
strategy is used successfully on all other Debian architectures to
flush the registers to stack.  Even the ia64 flushes its main stack
successfully this way -- we had to add another special flush only for
the ia64's *second* stack, which is unique to this arch, AFAICT.

Here is the default code snippet:
=============================================================================

...
#ifndef N_RECURSION_REQD
#define N_RECURSION_REQD 2
#endif
  mark_c_stack(0,N_RECURSION_REQD,mark_stack_carefully);
  
}

static long *c_stack_where;

void
mark_c_stack(jmp_buf env1, int n, void (*fn)(void *,void *,int)) {

  jmp_buf env;
  int where;
  if (n== N_RECURSION_REQD)
    c_stack_where = (long *) (void *) &env;
  if (n > 0 ) {  
    setjmp(env);
    mark_c_stack(env,n - 1,fn);
  } else {
      
    /* If the locals of type object in a C function could be
       aligned other than on multiples of sizeof (char *)
       then define this.  At the moment 2 is the only other
       legitimate value besides 0 */
    
#ifndef C_GC_OFFSET
#define C_GC_OFFSET 0
#endif
    if (&where > cs_org)
      (*fn)(0,cs_org,C_GC_OFFSET);
    else
      (*fn)(cs_org,0,C_GC_OFFSET);}
  
}

=============================================================================

2) OK, this is *very* helpful, and does seem to be making progress in
   the build.  Unfortunately, there are some residual issues which I
   am now chasing down.  I've noticed different errors produced when
   compiling with gcc 3.1 and the latest binutils vs. the standard 3.0
   in current Debian.  Is there a preferred (gcc) compiler on this
   platform? (I.e., the one with the fewest known bugs.) What about
   the instruction set options, 1.0, 1.1, and 2.0?

Take care,


> /* the calling sequence */
> struct regs {
>       void *callee_saves[16];
> };
> void hppa_save_regs(struct regs);
> 
> /* the code */
> 
>       .code
>       .export hppa_save_regs, entry
>       .proc
>       .callinfo
>       .label  hppa_save_regs
>       .entry
> 
>       stw     %r3,0(%arg0)
>       stw     %r4,4(%arg0)
>       stw     %r5,8(%arg0)
>       stw     %r6,12(%arg0)
>       stw     %r7,16(%arg0)
>       stw     %r8,20(%arg0)
>       stw     %r9,24(%arg0)
>       stw     %r10,28(%arg0)
>       stw     %r11,32(%arg0)
>       stw     %r12,36(%arg0)
>       stw     %r13,40(%arg0)
>       stw     %r14,44(%arg0)
>       stw     %r15,48(%arg0)
>       stw     %r16,52(%arg0)
>       stw     %r17,56(%arg0)
>       bv      0(%rp)
>       stw     %r18,60(%arg0)
> 
>       .exit
>       .procend
>       .end
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]