Files
qemu/system/memory-internal.h
Philippe Mathieu-Daudé 104e8391dd system/memory: Rename cpu_exec_init_all() -> machine_memory_init()
cpu_exec_init_all() is system specific: it initializes globals
for the memory subsystem. Rename it as machine_memory_init()
and restrict its declaration to 'system/' namespace.

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

61 lines
1.6 KiB
C

/*
* Declarations for functions which are internal to the memory subsystem.
*
* Copyright 2011 Red Hat, Inc. and/or its affiliates
*
* Authors:
* Avi Kivity <avi@redhat.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*
*/
#ifndef MEMORY_INTERNAL_H
#define MEMORY_INTERNAL_H
void machine_memory_init(void);
static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
{
return fv->dispatch;
}
static inline
AddressSpaceDispatch *address_space_to_dispatch(const AddressSpace *as)
{
return flatview_to_dispatch(address_space_to_flatview(as));
}
FlatView *address_space_get_flatview(const AddressSpace *as);
void flatview_unref(FlatView *view);
extern const MemoryRegionOps unassigned_mem_ops;
void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section);
AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv);
void address_space_dispatch_compact(AddressSpaceDispatch *d);
void address_space_dispatch_free(AddressSpaceDispatch *d);
void mtree_print_dispatch(struct AddressSpaceDispatch *d,
MemoryRegion *root);
/* returns true if end is big endian. */
static inline bool devend_big_endian(enum device_endian end)
{
#ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API
if (end == DEVICE_NATIVE_ENDIAN) {
return target_big_endian();
}
#endif
return end == DEVICE_BIG_ENDIAN;
}
/* enum device_endian to MemOp. */
static inline MemOp devend_memop(enum device_endian end)
{
return devend_big_endian(end) ? MO_BE : MO_LE;
}
#endif