mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
Fix OpenBSD linker warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
c93e7817ee
commit
363a37d520
17 changed files with 170 additions and 137 deletions
15
hw/sun4m.c
15
hw/sun4m.c
|
@ -159,7 +159,8 @@ static int nvram_boot_set(void *opaque, const char *boot_device)
|
|||
for (i = 0; i < sizeof(image); i++)
|
||||
image[i] = m48t59_read(nvram, i) & 0xff;
|
||||
|
||||
strcpy((char *)header->boot_devices, boot_device);
|
||||
pstrcpy((char *)header->boot_devices, sizeof(header->boot_devices),
|
||||
boot_device);
|
||||
header->nboot_devices = strlen(boot_device) & 0xff;
|
||||
header->crc = cpu_to_be16(OHW_compute_crc(header, 0x00, 0xF8));
|
||||
|
||||
|
@ -187,17 +188,19 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
|
|||
memset(image, '\0', sizeof(image));
|
||||
|
||||
// Try to match PPC NVRAM
|
||||
strcpy((char *)header->struct_ident, "QEMU_BIOS");
|
||||
pstrcpy((char *)header->struct_ident, sizeof(header->struct_ident),
|
||||
"QEMU_BIOS");
|
||||
header->struct_version = cpu_to_be32(3); /* structure v3 */
|
||||
|
||||
header->nvram_size = cpu_to_be16(0x2000);
|
||||
header->nvram_arch_ptr = cpu_to_be16(sizeof(ohwcfg_v3_t));
|
||||
header->nvram_arch_size = cpu_to_be16(sizeof(struct sparc_arch_cfg));
|
||||
strcpy((char *)header->arch, arch);
|
||||
pstrcpy((char *)header->arch, sizeof(header->arch), arch);
|
||||
header->nb_cpus = smp_cpus & 0xff;
|
||||
header->RAM0_base = 0;
|
||||
header->RAM0_size = cpu_to_be64((uint64_t)RAM_size);
|
||||
strcpy((char *)header->boot_devices, boot_devices);
|
||||
pstrcpy((char *)header->boot_devices, sizeof(header->boot_devices),
|
||||
boot_devices);
|
||||
header->nboot_devices = strlen(boot_devices) & 0xff;
|
||||
header->kernel_image = cpu_to_be64((uint64_t)KERNEL_LOAD_ADDR);
|
||||
header->kernel_size = cpu_to_be64((uint64_t)kernel_size);
|
||||
|
@ -225,7 +228,7 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
|
|||
// Variable partition
|
||||
part_header = (struct OpenBIOS_nvpart_v1 *)&image[start];
|
||||
part_header->signature = OPENBIOS_PART_SYSTEM;
|
||||
strcpy(part_header->name, "system");
|
||||
pstrcpy(part_header->name, sizeof(part_header->name), "system");
|
||||
|
||||
end = start + sizeof(struct OpenBIOS_nvpart_v1);
|
||||
for (i = 0; i < nb_prom_envs; i++)
|
||||
|
@ -241,7 +244,7 @@ static void nvram_init(m48t59_t *nvram, uint8_t *macaddr, const char *cmdline,
|
|||
start = end;
|
||||
part_header = (struct OpenBIOS_nvpart_v1 *)&image[start];
|
||||
part_header->signature = OPENBIOS_PART_FREE;
|
||||
strcpy(part_header->name, "free");
|
||||
pstrcpy(part_header->name, sizeof(part_header->name), "free");
|
||||
|
||||
end = 0x1fd0;
|
||||
OpenBIOS_finish_partition(part_header, end - start);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue