Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2019 11:32:24 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        adr <adr@SDF.ORG>
Cc:        Robert Crowston via freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: FreeBSD arm EABI5 documentation?
Message-ID:  <15BCB15A-6A7F-4070-A6CF-AEF8BBD2F0BE@yahoo.com>
In-Reply-To: <alpine.NEB.2.21.1907111727500.16650@sdf.lonestar.org>
References:  <alpine.NEB.2.21.1907101508370.22895@sdf.lonestar.org> <f2967859f68f1d40f260661791126956f48f4d12.camel@freebsd.org> <alpine.NEB.2.21.1907101735020.3201@sdf.lonestar.org> <da6a8f7e596da9bf9015f76798a5575908ad1be4.camel@freebsd.org> <alpine.NEB.2.21.1907101904570.15468@sdf.lonestar.org> <1788e13e706b9fdaf610e4ddd671a5ed715f9dfe.camel@freebsd.org> <alpine.NEB.2.21.1907102043040.9461@sdf.lonestar.org> <AFF6488F-B2F5-486E-8F14-FAF852DB2C3C@yahoo.com> <1CB61FE0-5665-424F-8B94-ABFC06906112@yahoo.com> <alpine.NEB.2.21.1907111727500.16650@sdf.lonestar.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2019-Jul-11, at 10:50, adr <adr at SDF.ORG> wrote:

>>>> Curious about 32-bit arm stack alignment requirements in netbsd
>>>> (based on a FreeBSD thread making claims that user space allows
>>>> 4-byte stack alignment), I went looking around some in NetBSD
> 
> Whooow... I don't know what on earth I'm missing, or what I said that
> make you contact NetBSD developers talking about "claims".
> 
> Just write some ugly assembler:
> ======================================
>        .arch armv7-a
>        .syntax unified
>        .data
> str1:
>        .string "1-6: %d, %d, %d, %d, %d, %d\n"
>        .align
>        .text
>        .global main
> main:
>        push {r0} @ stack is not 8byte align anymore
>        mov r8, 10
> loop:
>        ldr r0, =str1
>        mov r1, 1
>        mov r2, 2
>        mov r3, 3
>        mov r4, 4
>        mov r5, 5
>        mov r6, 6
>        push { r4-r6 } @ alignment will change in the loop
>        bl printf
>        subs r8, r8, 1
>        bne loop
> end:
>        b end
> =====================================================
> as -a -o test.o test.s > test.l
> cc -o test test.o
> 
> And it works. In fact it works in FreeBSD with clang.
> But a more complex code, as a said before, calling
> SDL2 to use graphics works without any problem on NetBSD
> and Linux, but not on FreeBSD.
> 
> In fact I like that it doesn't work in FreeBSD, because
> that made me correct my code.
> 
> That is all I was saying, and now I'm going to just shut the * up.

Sorry that I offended. I only contacted them because I ran into
the bug of masking by ~8 instead of by ~0x7 in one place. I took
the opportunity to check on the NetBSD alignment criteria as
long as I was in contact.

Maybe "claims" was a clumsy wording for a quick-summary. I've made
a fair number of my own claims about various things, various ones
turning out to be false in my case. So I have examples around of
definitely-falsely-claimed.

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15BCB15A-6A7F-4070-A6CF-AEF8BBD2F0BE>