Lines Matching refs:entry

35 static int bios_linker_allocate(struct bios_linker_entry *entry, ulong *addr)  in bios_linker_allocate()  argument
41 align = le32_to_cpu(entry->alloc.align); in bios_linker_allocate()
48 file = qemu_fwcfg_find_file(entry->alloc.file); in bios_linker_allocate()
50 printf("error: can't find file %s\n", entry->alloc.file); in bios_linker_allocate()
62 if (entry->alloc.zone == BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH) { in bios_linker_allocate()
68 } else if (entry->alloc.zone == BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG) { in bios_linker_allocate()
76 file->cfg.name, size, entry->alloc.zone, align, aligned_addr); in bios_linker_allocate()
83 if (entry->alloc.zone == BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG) in bios_linker_allocate()
97 static int bios_linker_add_pointer(struct bios_linker_entry *entry) in bios_linker_add_pointer() argument
100 uint32_t offset = le32_to_cpu(entry->pointer.offset); in bios_linker_add_pointer()
103 dest = qemu_fwcfg_find_file(entry->pointer.dest_file); in bios_linker_add_pointer()
106 src = qemu_fwcfg_find_file(entry->pointer.src_file); in bios_linker_add_pointer()
111 dest->addr, src->addr, offset, entry->pointer.size, pointer); in bios_linker_add_pointer()
113 memcpy(&pointer, (char *)dest->addr + offset, entry->pointer.size); in bios_linker_add_pointer()
117 memcpy((char *)dest->addr + offset, &pointer, entry->pointer.size); in bios_linker_add_pointer()
130 static int bios_linker_add_checksum(struct bios_linker_entry *entry) in bios_linker_add_checksum() argument
136 file = qemu_fwcfg_find_file(entry->cksum.file); in bios_linker_add_checksum()
140 data = (uint8_t *)(file->addr + le32_to_cpu(entry->cksum.offset)); in bios_linker_add_checksum()
141 cksum_start = (uint8_t *)(file->addr + le32_to_cpu(entry->cksum.start)); in bios_linker_add_checksum()
143 le32_to_cpu(entry->cksum.length)); in bios_linker_add_checksum()
155 struct bios_linker_entry *entry; in write_acpi_tables() local
172 if ((size % sizeof(*entry)) != 0) { in write_acpi_tables()
186 for (i = 0; i < (size / sizeof(*entry)); i++) { in write_acpi_tables()
187 entry = table_loader + i; in write_acpi_tables()
188 switch (le32_to_cpu(entry->command)) { in write_acpi_tables()
190 ret = bios_linker_allocate(entry, &addr); in write_acpi_tables()
195 ret = bios_linker_add_pointer(entry); in write_acpi_tables()
200 ret = bios_linker_add_checksum(entry); in write_acpi_tables()
228 static void qemu_fwcfg_read_entry_pio(uint16_t entry, in qemu_fwcfg_read_entry_pio() argument
232 entry, size, address); in qemu_fwcfg_read_entry_pio()
234 return fwcfg_arch_ops->arch_read_pio(entry, size, address); in qemu_fwcfg_read_entry_pio()
238 static void qemu_fwcfg_read_entry_dma(uint16_t entry, in qemu_fwcfg_read_entry_dma() argument
251 if (entry != FW_CFG_INVALID) in qemu_fwcfg_read_entry_dma()
252 dma.control |= cpu_to_be32(FW_CFG_DMA_SELECT | (entry << 16)); in qemu_fwcfg_read_entry_dma()
257 entry, size, address, be32_to_cpu(dma.control)); in qemu_fwcfg_read_entry_dma()
272 void qemu_fwcfg_read_entry(uint16_t entry, uint32_t length, void *address) in qemu_fwcfg_read_entry() argument
275 qemu_fwcfg_read_entry_dma(entry, length, address); in qemu_fwcfg_read_entry()
277 qemu_fwcfg_read_entry_pio(entry, length, address); in qemu_fwcfg_read_entry()
297 struct list_head *entry; in qemu_fwcfg_read_firmware_list() local
323 list_for_each(entry, &fw_list) { in qemu_fwcfg_read_firmware_list()
324 file = list_entry(entry, struct fw_file, list); in qemu_fwcfg_read_firmware_list()
333 struct list_head *entry; in qemu_fwcfg_find_file() local
336 list_for_each(entry, &fw_list) { in qemu_fwcfg_find_file()
337 file = list_entry(entry, struct fw_file, list); in qemu_fwcfg_find_file()
347 iter->entry = fw_list.next; in qemu_fwcfg_file_iter_init()
348 return list_entry((struct list_head *)iter->entry, in qemu_fwcfg_file_iter_init()
354 iter->entry = ((struct list_head *)iter->entry)->next; in qemu_fwcfg_file_iter_next()
355 return list_entry((struct list_head *)iter->entry, in qemu_fwcfg_file_iter_next()
361 return iter->entry == &fw_list; in qemu_fwcfg_file_iter_end()