On Fri, Feb 5, 2016 at 2:00 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 5 February 2016 at 16:55, Aurelio Remonda > <aurelio.remo...@tallertechnologies.com> 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).
But stellaris board has a hardcoded dc0 value, when you place the -m flag with for example 256M you shouldn't calculate any sram_size from dc0, you just assign that as your ram size. > 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. Fair enough. Thank you! -- Aurelio Remonda Software Engineer San Lorenzo 47, 3rd Floor, Office 5 Córdoba, Argentina Phone: +54-351-4217888 / 4218211