From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRjfj-0006ow-HL for qemu-devel@nongnu.org; Fri, 05 Feb 2016 11:55:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRjfh-0007zE-IV for qemu-devel@nongnu.org; Fri, 05 Feb 2016 11:55:51 -0500 Received: from mail-vk0-x22c.google.com ([2607:f8b0:400c:c05::22c]:32947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRjfh-0007zA-Af for qemu-devel@nongnu.org; Fri, 05 Feb 2016 11:55:49 -0500 Received: by mail-vk0-x22c.google.com with SMTP id e64so60664936vkg.0 for ; Fri, 05 Feb 2016 08:55:49 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 5 Feb 2016 13:55:48 -0300 Message-ID: From: Aurelio Remonda Content-Type: multipart/alternative; boundary=001a1145542e173f4e052b08b982 Subject: Re: [Qemu-devel] Memory on stellaris board List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers --001a1145542e173f4e052b08b982 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable El 5 feb. 2016 1:24 PM, "Peter Maydell" escribi= =C3=B3: > On 5 February 2016 at 16:09, Aurelio Remonda > wrote: > > Hello, im working on this feature right now. > > i have a working patch but maybe I can make some changes to make it loo= k > better: > > for example in some point i check ram_size like this: > > if (ram_size =3D=3D 0x8000000) > > Maybe if i make ram_addr_t default_ram_size global (is a local > > variable of set_memory_options function) > > i can use it instead of hardcoded 0x8000000. > > No, don't do that. > > Why do you care about whether the ram size is the default or not? > > thanks > -- PMM > Im making something like this: if (ram_size =3D=3D 0x8000000) /* default value, means whitout -m flag= */ { sram_size =3D ((board->dc0 >> 18) + * 1024; } else if (ram_size >=3D UINT_MAX) /* more than 4GB */ sram_size =3D UINT_MAX; else sram_size =3D ram_size So in case someone does not use the -m flag i want to be sure the ram is calculated like it was before. If the flag is indeed used you have a limit given by the size of sram_size (32 bits) in that case if you try using the -m option with a size greater than 4GB you will always get a 4GB (4294967296 to be precise). --001a1145542e173f4e052b08b982 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
El 5 feb. 2016 1:24 PM, "Peter Maydell" <peter.maydell@lin= aro.org> escribi=C3=B3:
On 5 February 2016= at 16:09, Aurelio Remonda
<aurelio.remonda@tallertechnologies.com> wrote:
> Hello, im working on this feature right now.
> i have a working patch but maybe I can make some changes to make it lo= ok better:
> for example in some point i check ram_size like this:
> if (ram_size =3D=3D 0x8000000)
> Maybe if i make ram_addr_t default_ram_size global (is a local
> variable of set_memory_options function)
> i can use it instead of hardcoded 0x8000000.

No, don't do that.

Why do you care about whether the ram size is the default or not?

thanks
-- PMM

Im making something like thi= s:

=C2=A0 =C2=A0 if (ram_size =3D=3D 0x8000000)=C2=A0 /* defaul= t value, means whitout -m flag */
=C2=A0=C2=A0 {
=C2=A0 =C2=A0 sram_size =3D ((board->dc0 >> 18) + * 1024;
=C2=A0 =C2=A0 }
=C2=A0 else if (ram_size >=3D UINT_MAX) /* more than 4GB */
=C2=A0 sram_size =3D UINT_MAX;
=C2=A0 else
=C2=A0 sram_size =3D ram_size

So in case someone does not use the -m flag i want to be sur= e the ram is

calculated like it was before.

If the flag is= indeed used you have a limit given by the size of sram_size (32 bits)

<= p>in that case if you try using the -m option with a size = greater than 4GB you will always get a

4GB (4294967296 to be p= recise).

--001a1145542e173f4e052b08b982--