9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] spim syscall stack adjustment
@ 2023-01-27  2:46 Anthony Martin
  2023-01-27 21:10 ` adventures in9
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony Martin @ 2023-01-27  2:46 UTC (permalink / raw)
  To: 9fans

Does anyone know why the libc system call functions for
spim add four to the stack pointer (R29) before issuing
the SYSCALL instruction?

        /sys/src/libc/9syscall/mkfile:/spim

It was introduced in the third edition but there were
never any spim kernels released so I wasn't able to
compare the libc additions to the trap code.

I was watching one of adventuresin9's videos about his
ongoing port to the MediaTek MT7688 and he mentioned
having to modify the stack offsets in the syscall trap
handler just as cherry9 had done for the loongson port.

Is there any reason not to simply get rid of that ADD $4?

Cheers,
  Anthony

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T589fa55313abbdb4-Mc96c7cb218c2b6a69a83b8e8
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] spim syscall stack adjustment
  2023-01-27  2:46 [9fans] spim syscall stack adjustment Anthony Martin
@ 2023-01-27 21:10 ` adventures in9
  0 siblings, 0 replies; 2+ messages in thread
From: adventures in9 @ 2023-01-27 21:10 UTC (permalink / raw)
  To: 9fans

I could try and build a spim world without the ADD in syscall to see
what happens.  It might be a week or 2 before I can find the time.

As for why it does it.  I never really looked into it.  I figured it
was just another endian issue.  I had enough bugs that when I got past
that one I just moved on to the next.  But I do need to set up a fresh
9 Front install to go through and get patches for all the mips and
spim stuff.

I also have a big-endian Atheros/Qualcomm chip that I need to get
around to building a kernel for, and then there will be a close to 1
to 1 chip to compare mips and spim stuff.

On Thu, Jan 26, 2023 at 6:47 PM Anthony Martin <ality@pbrane.org> wrote:
> 
> Does anyone know why the libc system call functions for
> spim add four to the stack pointer (R29) before issuing
> the SYSCALL instruction?
> 
> /sys/src/libc/9syscall/mkfile:/spim
> 
> It was introduced in the third edition but there were
> never any spim kernels released so I wasn't able to
> compare the libc additions to the trap code.
> 
> I was watching one of adventuresin9's videos about his
> ongoing port to the MediaTek MT7688 and he mentioned
> having to modify the stack offsets in the syscall trap
> handler just as cherry9 had done for the loongson port.
> 
> Is there any reason not to simply get rid of that ADD $4?
> 
> Cheers,
>   Anthony

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T589fa55313abbdb4-M3df698a73959945f954ae172
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-27 21:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27  2:46 [9fans] spim syscall stack adjustment Anthony Martin
2023-01-27 21:10 ` adventures in9

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).