Re: powerpc64 context: aim/locore64.S __start TMPSTKSZ-48 vs. TMPSTKSZ-96 (-r277392 and later) vs. modern aim/trap_subr64.S cpu_reset_handler: (TMPSTKSZ-48)?

Mark Millard via freebsd-ppc <[email protected]>
Newsgroups gmane.os.freebsd.devel.ppc
Message-ID <[email protected]>
[I found yet another one, an implicit example: PC_SLBSTACK-48+1024.]

On 2019-May-8, at 15:10, Mark Millard <marklmi at yahoo.com> wrote:

> On 2019-May-8, at 13:53, Mark Millard <marklmi at yahoo.com> wrote:
> 
>> Should cpu_reset_handler have been updated to use (TMPSTKSZ-96) when
>> __start was changed to use TMPSTKSZ-96, back in 2015-Jan-19?
>> 
> 
> Looks like I should have listed more context: there is both
> (TMPSTKSZ-48) and (TRAPSTKSZ-48) for powerpc64:
> 
> /mnt/usr/src/sys/powerpc/aim/trap_subr32.S:     addi    %r1,%r1,TRAPSTKSZ-16
> /mnt/usr/src/sys/powerpc/aim/trap_subr64.S:     addi    %r1,%r1,(TMPSTKSZ-48)
> /mnt/usr/src/sys/powerpc/aim/trap_subr64.S:     addi    %r1,%r1,(TRAPSTKSZ-48)
> /mnt/usr/src/sys/powerpc/aim/locore32.S:#define TMPSTKSZ        8192            /* 8K temporary stack */
> /mnt/usr/src/sys/powerpc/aim/locore32.S:        .space  TMPSTKSZ
> /mnt/usr/src/sys/powerpc/aim/locore32.S:#define TRAPSTKSZ       4096            /* 4k trap stack */
> /mnt/usr/src/sys/powerpc/aim/locore32.S:        .space        TRAPSTKSZ
> /mnt/usr/src/sys/powerpc/aim/locore32.S:        addi    %r1,%r1,(8+TMPSTKSZ-40)
> /mnt/usr/src/sys/powerpc/aim/locore64.S:#define TMPSTKSZ        16384           /* 16K temporary stack */
> /mnt/usr/src/sys/powerpc/aim/locore64.S:        .space  TMPSTKSZ
> /mnt/usr/src/sys/powerpc/aim/locore64.S:#define TRAPSTKSZ       4096            /* 4k trap stack */
> /mnt/usr/src/sys/powerpc/aim/locore64.S:        .space        TRAPSTKSZ
> /mnt/usr/src/sys/powerpc/aim/locore64.S:        .llong  tmpstk + TMPSTKSZ - 96 - .
> /mnt/usr/src/sys/powerpc/ofw/ofwcall64.S:#define        OFWSTKSZ        4096            /* 4K Open Firmware stack */
> /mnt/usr/src/sys/powerpc/ofw/ofwcall64.S:       .space  OFWSTKSZ
> /mnt/usr/src/sys/powerpc/ofw/ofwcall64.S:       addi    %r7,%r7,OFWSTKSZ-40
> /mnt/usr/src/sys/powerpc/ofw/ofwcall32.S:#define        OFWSTKSZ        4096            /* 4K Open Firmware stack */
> /mnt/usr/src/sys/powerpc/ofw/ofwcall32.S:       .space  OFWSTKSZ
> /mnt/usr/src/sys/powerpc/ofw/ofwcall32.S:       addi    %r1,%r1,(OFWSTKSZ-32)
> 
> 
> It is not obvious what justifies the figures for
> powerpc64:
> 
> TMPSTKSZ - 96
> TMPSTKSZ-48
> TRAPSTKSZ-48
> 
> Magic constants with no notes about how to figure out
> the correct (minimum?) figure to subtract.
> 
> My question about the 48 vs. 96 may apply to more
> than the TMPSTKSZ-48 usage.

There is also:

       addi    %r1,%r1,PC_SLBSTACK-48+1024

with 1024 being the ???STKSZ and having another
magic 48 that I wonder about if it should be
96.



===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)


===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.