Lines Matching full:entry

27  * @entry : BIOS linker command entry which tells where to allocate memory
34 static int bios_linker_allocate(struct bios_linker_entry *entry, ulong *addr) in bios_linker_allocate() argument
40 align = le32_to_cpu(entry->alloc.align); in bios_linker_allocate()
47 file = qemu_fwcfg_find_file(entry->alloc.file); in bios_linker_allocate()
49 printf("error: can't find file %s\n", entry->alloc.file); in bios_linker_allocate()
61 if (entry->alloc.zone == BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH) { in bios_linker_allocate()
67 } else if (entry->alloc.zone == BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG) { in bios_linker_allocate()
75 file->cfg.name, size, entry->alloc.zone, align, aligned_addr); in bios_linker_allocate()
82 if (entry->alloc.zone == BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG) in bios_linker_allocate()
92 * @entry : BIOS linker command entry which tells how to patch
96 static int bios_linker_add_pointer(struct bios_linker_entry *entry) in bios_linker_add_pointer() argument
99 uint32_t offset = le32_to_cpu(entry->pointer.offset); in bios_linker_add_pointer()
102 dest = qemu_fwcfg_find_file(entry->pointer.dest_file); in bios_linker_add_pointer()
105 src = qemu_fwcfg_find_file(entry->pointer.src_file); in bios_linker_add_pointer()
110 dest->addr, src->addr, offset, entry->pointer.size, pointer); in bios_linker_add_pointer()
112 memcpy(&pointer, (char *)dest->addr + offset, entry->pointer.size); in bios_linker_add_pointer()
116 memcpy((char *)dest->addr + offset, &pointer, entry->pointer.size); in bios_linker_add_pointer()
125 * @entry : BIOS linker command entry which tells where to update ACPI table
129 static int bios_linker_add_checksum(struct bios_linker_entry *entry) in bios_linker_add_checksum() argument
135 file = qemu_fwcfg_find_file(entry->cksum.file); in bios_linker_add_checksum()
139 data = (uint8_t *)(file->addr + le32_to_cpu(entry->cksum.offset)); in bios_linker_add_checksum()
140 cksum_start = (uint8_t *)(file->addr + le32_to_cpu(entry->cksum.start)); in bios_linker_add_checksum()
142 le32_to_cpu(entry->cksum.length)); in bios_linker_add_checksum()
154 struct bios_linker_entry *entry; in write_acpi_tables() local
171 if ((size % sizeof(*entry)) != 0) { in write_acpi_tables()
185 for (i = 0; i < (size / sizeof(*entry)); i++) { in write_acpi_tables()
186 entry = table_loader + i; in write_acpi_tables()
187 switch (le32_to_cpu(entry->command)) { in write_acpi_tables()
189 ret = bios_linker_allocate(entry, &addr); in write_acpi_tables()
194 ret = bios_linker_add_pointer(entry); in write_acpi_tables()
199 ret = bios_linker_add_checksum(entry); in write_acpi_tables()
235 static void qemu_fwcfg_read_entry_pio(uint16_t entry, in qemu_fwcfg_read_entry_pio() argument
238 debug("qemu_fwcfg_read_entry_pio: entry 0x%x, size %u address %p\n", in qemu_fwcfg_read_entry_pio()
239 entry, size, address); in qemu_fwcfg_read_entry_pio()
241 return fwcfg_arch_ops->arch_read_pio(entry, size, address); in qemu_fwcfg_read_entry_pio()
245 static void qemu_fwcfg_read_entry_dma(uint16_t entry, in qemu_fwcfg_read_entry_dma() argument
258 if (entry != FW_CFG_INVALID) in qemu_fwcfg_read_entry_dma()
259 dma.control |= cpu_to_be32(FW_CFG_DMA_SELECT | (entry << 16)); in qemu_fwcfg_read_entry_dma()
263 debug("qemu_fwcfg_read_entry_dma: entry 0x%x, size %u address %p, control 0x%x\n", in qemu_fwcfg_read_entry_dma()
264 entry, size, address, be32_to_cpu(dma.control)); in qemu_fwcfg_read_entry_dma()
279 void qemu_fwcfg_read_entry(uint16_t entry, uint32_t length, void *address) in qemu_fwcfg_read_entry() argument
282 qemu_fwcfg_read_entry_dma(entry, length, address); in qemu_fwcfg_read_entry()
284 qemu_fwcfg_read_entry_pio(entry, length, address); in qemu_fwcfg_read_entry()
304 struct list_head *entry; in qemu_fwcfg_read_firmware_list() local
330 list_for_each(entry, &fw_list) { in qemu_fwcfg_read_firmware_list()
331 file = list_entry(entry, struct fw_file, list); in qemu_fwcfg_read_firmware_list()
340 struct list_head *entry; in qemu_fwcfg_find_file() local
343 list_for_each(entry, &fw_list) { in qemu_fwcfg_find_file()
344 file = list_entry(entry, struct fw_file, list); in qemu_fwcfg_find_file()
354 iter->entry = fw_list.next; in qemu_fwcfg_file_iter_init()
355 return list_entry((struct list_head *)iter->entry, in qemu_fwcfg_file_iter_init()
361 iter->entry = ((struct list_head *)iter->entry)->next; in qemu_fwcfg_file_iter_next()
362 return list_entry((struct list_head *)iter->entry, in qemu_fwcfg_file_iter_next()
368 return iter->entry == &fw_list; in qemu_fwcfg_file_iter_end()