This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: [PATCH] Semihosting fix for AArch64 when heapinfo is not provided by debugger
- From: Tamar Christina <Tamar dot Christina at arm dot com>
- To: Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Alexander Fedotov <alfedotov at gmail dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Cc: nd <nd at arm dot com>
- Date: Tue, 24 Oct 2017 15:20:45 +0000
- Subject: RE: [PATCH] Semihosting fix for AArch64 when heapinfo is not provided by debugger
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar dot Christina at arm dot com;
- Nodisclaimer: True
- References: <CAN8C2Cr0d+on0L4pnfX16d=La4R6ViPoDnhQR-4ha_cO-gsdOQ@mail.gmail.com> <20171013091612.GE20139@calimero.vinschen.de> <CAN8C2CqWUx_gcO7LUv=xbaq0jJQoxCWJui9Vro5MnrjXy21hvA@mail.gmail.com> <DB6PR0802MB230921CD3401BB55439FA585FF460@DB6PR0802MB2309.eurprd08.prod.outlook.com> <dc7fdf43-3312-74b7-5045-2761d596df85@arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
> -----Original Message-----
> From: Richard Earnshaw (lists) [mailto:Richard.Earnshaw@arm.com]
> Sent: 24 October 2017 16:20
> To: Tamar Christina; Alexander Fedotov; newlib@sourceware.org
> Cc: nd
> Subject: Re: [PATCH] Semihosting fix for AArch64 when heapinfo is not
> provided by debugger
>
> On 23/10/17 18:23, Tamar Christina wrote:
> > Hi Alex,
> >
> > In principle nothing against the patch. Just a comment
> >
> >> diff --git a/libgloss/aarch64/crt0.S b/libgloss/aarch64/crt0.S index
> >> f670e03..f831be1 100644
> >> --- a/libgloss/aarch64/crt0.S
> >> +++ b/libgloss/aarch64/crt0.S
> >> @@ -102,33 +102,44 @@
> >> ldr x0, .LC0 /* point at returned values */
> >> ldr x1, [x0, #8] /* get heap_limit */
> >>
> >> + /* Set __heap_limit. */
> >> +#ifdef __ILP32__
> >> + /* Sanity check on the __heap_limit. */
> >> + tst x1, #0xffffffff00000000
> >> + bne .Linsanepar
> >> +#endif
> >
> > if x1 is 0 it won't pass the first test in ILP32 and takes the branch,
> > I assume you intended it to fall through in that case? So I think this
> > test should be re-ordered.
>
> Huh? zero & anything is zero, so the Z bit will be set and the branch will not
> be taken.
>
Yes, sorry, I flipped the mask. Disregard my earlier comment.
>
> >
> >> + cmp x1, xzr
> >> + beq .LC4
> >> + adrp x2, __heap_limit
> >> + add x2, x2, #:lo12:__heap_limit
> >> + str x1, [x2]
> >> +.LC4:
> >
> > Thanks,
> > Tamar
> >
>
> Looks basically OK to me.
>
> R.
>
> >
> >
> >> -----Original Message-----
> >> From: newlib-owner@sourceware.org [mailto:newlib-
> >> owner@sourceware.org] On Behalf Of Alexander Fedotov
> >> Sent: 19 October 2017 22:41
> >> To: newlib@sourceware.org
> >> Subject: Re: [PATCH] Semihosting fix for AArch64 when heapinfo is not
> >> provided by debugger
> >>
> >> Any comments/thoughts on this patch ?
> >> It would be great to have this feature in newlib release version.
> >>
> >> Alex
> >>
> >> On Fri, 13 Oct 2017 at 12:16, Corinna Vinschen <vinschen@redhat.com>
> >> wrote:
> >>
> >>> On Oct 11 14:57, Alexander Fedotov wrote:
> >>>> Use the same approach as in ARM port for case when Debugger not
> >>>> providing necessary info for semihosting.
> >>>
> >>> I'd like to see an ACK from some arm folks.
> >>>
> >>>
> >>> Thanks,
> >>> Corinna
> >>>
> >>> --
> >>> Corinna Vinschen
> >>> Cygwin Maintainer
> >>> Red Hat
> >>>
> >> --
> >> Best regards,
> >> AF