qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Memory on stellaris board


From: Peter Maydell
Subject: Re: [Qemu-devel] Memory on stellaris board
Date: Fri, 5 Feb 2016 17:00:09 +0000

On 5 February 2016 at 16:55, Aurelio Remonda
<address@hidden> wrote:
> Im making something like this:
>
>     if (ram_size == 0x8000000)  /* default value, means whitout -m flag */
>    {
>     sram_size = ((board->dc0 >> 18) + * 1024;
>     }
>   else if (ram_size >= UINT_MAX) /* more than 4GB */
>   sram_size = UINT_MAX;
>   else
>   sram_size = 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.

The right way to do this is to set the MachineClass default_ram_size
to what you want your default value to be. Then you should calculate
the dc0 etc values to expose to the guest based on the ram size
(which might be the default or might be user specified).
If the user asks for a value that you can't handle (eg it is too big)
then you should report the problem (via error_report()) and exit.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]