> So we would get rid of all the 32-bit compat stuff from arch/sparc64?

Yes, but this has never been used, so no worries about it.

> Index: include/cpu.h
> ===================================================================
> RCS file: /cvs/src/sys/arch/sparc64/include/cpu.h,v
> retrieving revision 1.98
> diff -u -p -r1.98 cpu.h
> --- include/cpu.h     6 Jul 2021 09:34:07 -0000       1.98
> +++ include/cpu.h     29 Aug 2022 18:44:50 -0000
> @@ -144,7 +144,7 @@ struct cpu_info {
>       paddr_t                 ci_paddr;       /* Phys addr of this structure. 
> */
>  
>  #ifdef SUN4V
> -     struct rwindow64        ci_rw;
> +     struct rwindow          ci_rw;

Note that struct rwindow* used to be defined in <machine/reg.h>; if you
move it to <machine/frame.h> then cpu.h needs to include it now. And
since <machine/cpu.h> also gets included from assembler code, the struct
definitions you have moved there need to be protected with #ifndef
_LOCORE.


> Index: sparc64/machdep.c

> @@ -872,36 +872,24 @@ trapdump(tf)
>  void
>  stackdump(void)
>  {
> -     struct frame32 *fp = (struct frame32 *)getfp(), *sfp;
> -     struct frame64 *fp64;
> +     struct frame *fp64 = getfp(), *sfp;
>  
> -     sfp = fp;
> -     printf("Frame pointer is at %p\n", fp);
> +     sfp = fp64;
> +     printf("Frame pointer is at %p\n", fp64);
>       printf("Call traceback:\n");
> -     while (fp && ((u_long)fp >> PGSHIFT) == ((u_long)sfp >> PGSHIFT)) {
> -             if( ((long)fp) & 1 ) {
> -                     fp64 = (struct frame64*)(((char *)fp)+BIAS);
> -                     /* 64-bit frame */
> -                     printf("%llx(%llx, %llx, %llx, %llx, %llx, %llx, %llx) "
> -                         "fp = %llx\n",
> -                            (unsigned long long)fp64->fr_pc,
> -                            (unsigned long long)fp64->fr_arg[0],
> -                            (unsigned long long)fp64->fr_arg[1],
> -                            (unsigned long long)fp64->fr_arg[2],
> -                            (unsigned long long)fp64->fr_arg[3],
> -                            (unsigned long long)fp64->fr_arg[4],
> -                            (unsigned long long)fp64->fr_arg[5],     
> -                            (unsigned long long)fp64->fr_arg[6],
> -                            (unsigned long long)fp64->fr_fp);
> -                     fp = (struct frame32 *)(u_long)fp64->fr_fp;
> -             } else {
> -                     /* 32-bit frame */
> -                     printf("  pc = %x  args = (%x, %x, %x, %x, %x, %x) "
> -                         "fp = %x\n", fp->fr_pc, fp->fr_arg[0],
> -                         fp->fr_arg[1], fp->fr_arg[2], fp->fr_arg[3],
> -                         fp->fr_arg[4], fp->fr_arg[5], fp->fr_fp);
> -                     fp = (struct frame32*)(u_long)(u_short)fp->fr_fp;
> -             }
> +     while (fp64 && ((u_long)fp64 >> PGSHIFT) == ((u_long)sfp >> PGSHIFT)) {
> +             printf("%llx(%llx, %llx, %llx, %llx, %llx, %llx, %llx) "
> +                 "fp = %llx\n",
> +                    (unsigned long long)fp64->fr_pc,
> +                    (unsigned long long)fp64->fr_arg[0],
> +                    (unsigned long long)fp64->fr_arg[1],
> +                    (unsigned long long)fp64->fr_arg[2],
> +                    (unsigned long long)fp64->fr_arg[3],
> +                    (unsigned long long)fp64->fr_arg[4],
> +                    (unsigned long long)fp64->fr_arg[5],     
> +                    (unsigned long long)fp64->fr_arg[6],
> +                    (unsigned long long)fp64->fr_fp);
> +                     fp64 = v9next_frame(fp64);

This chunk is wrong. The 64-bit stack pointer is always odd (biased by
BIAS), so you need add something similar to
                        fp64 = (struct frame*)(((char *)fp64) + BIAS);
prior to the printf call. Also the next statement is incorrectly
indented.

Last, the removal of CCFSZ exposes a bug in locore.S where it is still
used instead of CC64FSZ (in an "everything went wrong" shouldn't-happen
scenario), so it should be replaced in there.

Reply via email to