mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/ppc: Use the IEC binary prefix definitions
It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20180625124238.25339-33-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
be01029e5d
commit
ab3dd74924
20 changed files with 84 additions and 70 deletions
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "cpu.h"
|
||||
|
@ -47,9 +48,9 @@ typedef struct sPAPRNVRAM {
|
|||
#define VIO_SPAPR_NVRAM(obj) \
|
||||
OBJECT_CHECK(sPAPRNVRAM, (obj), TYPE_VIO_SPAPR_NVRAM)
|
||||
|
||||
#define MIN_NVRAM_SIZE 8192
|
||||
#define DEFAULT_NVRAM_SIZE 65536
|
||||
#define MAX_NVRAM_SIZE 1048576
|
||||
#define MIN_NVRAM_SIZE (8 * KiB)
|
||||
#define DEFAULT_NVRAM_SIZE (64 * KiB)
|
||||
#define MAX_NVRAM_SIZE (1 * MiB)
|
||||
|
||||
static void rtas_nvram_fetch(PowerPCCPU *cpu, sPAPRMachineState *spapr,
|
||||
uint32_t token, uint32_t nargs,
|
||||
|
@ -167,7 +168,9 @@ static void spapr_nvram_realize(VIOsPAPRDevice *dev, Error **errp)
|
|||
nvram->buf = g_malloc0(nvram->size);
|
||||
|
||||
if ((nvram->size < MIN_NVRAM_SIZE) || (nvram->size > MAX_NVRAM_SIZE)) {
|
||||
error_setg(errp, "spapr-nvram must be between %d and %d bytes in size",
|
||||
error_setg(errp,
|
||||
"spapr-nvram must be between %" PRId64
|
||||
" and %" PRId64 " bytes in size",
|
||||
MIN_NVRAM_SIZE, MAX_NVRAM_SIZE);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue