Files
qemu/hw/xtensa/bootparam.h
Philippe Mathieu-Daudé cb30b8758d system: Move cpu_physical_memory_*() declarations to 'system/physmem.h'
The following cpu_physical_memory_*() methods do not involve any
vCPU but only access physical memory:

 - cpu_physical_memory_read()
 - cpu_physical_memory_write()
 - cpu_physical_memory_map()
 - cpu_physical_memory_unmap()

Rename them removing the 'cpu_' prefix, and move then to the
"system/physmem.h" header with the other methods involved in
global physical address space.

Mechanical change using sed, then adding missing headers manually.

No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020839.19104-7-philmd@oss.qualcomm.com>
2026-06-18 14:27:04 +02:00

53 lines
1.4 KiB
C

#ifndef HW_XTENSA_BOOTPARAM_H
#define HW_XTENSA_BOOTPARAM_H
#include "exec/tswap.h"
#include "system/physmem.h"
#define BP_TAG_COMMAND_LINE 0x1001 /* command line (0-terminated string)*/
#define BP_TAG_INITRD 0x1002 /* ramdisk addr and size (bp_meminfo) */
#define BP_TAG_MEMORY 0x1003 /* memory addr and size (bp_meminfo) */
#define BP_TAG_SERIAL_BAUDRATE 0x1004 /* baud rate of current console. */
#define BP_TAG_SERIAL_PORT 0x1005 /* serial device of current console */
#define BP_TAG_FDT 0x1006 /* flat device tree addr */
#define BP_TAG_FIRST 0x7B0B /* first tag with a version number */
#define BP_TAG_LAST 0x7E0B /* last tag */
typedef struct BpTag {
uint16_t tag;
uint16_t size;
} BpTag;
typedef struct BpMemInfo {
uint32_t type;
uint32_t start;
uint32_t end;
} BpMemInfo;
#define MEMORY_TYPE_CONVENTIONAL 0x1000
#define MEMORY_TYPE_NONE 0x2000
static inline size_t get_tag_size(size_t data_size)
{
return data_size + sizeof(BpTag) + 4;
}
static inline ram_addr_t put_tag(ram_addr_t addr, uint16_t tag,
size_t size, const void *data)
{
BpTag bp_tag = {
.tag = tswap16(tag),
.size = tswap16((size + 3) & ~3),
};
physical_memory_write(addr, &bp_tag, sizeof(bp_tag));
addr += sizeof(bp_tag);
physical_memory_write(addr, data, size);
addr += (size + 3) & ~3;
return addr;
}
#endif