2011-12-15 17:25:22 +04:00
|
|
|
/*
|
2017-11-21 18:08:08 +03:00
|
|
|
* Declarations for functions which are internal to the memory subsystem.
|
2011-12-15 17:25:22 +04:00
|
|
|
*
|
|
|
|
* Copyright 2011 Red Hat, Inc. and/or its affiliates
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Avi Kivity <avi@redhat.com>
|
|
|
|
*
|
2012-01-13 20:44:23 +04:00
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or
|
|
|
|
* later. See the COPYING file in the top-level directory.
|
2011-12-15 17:25:22 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-11-21 18:08:08 +03:00
|
|
|
* This header is for use by exec.c, memory.c and accel/tcg/cputlb.c ONLY,
|
|
|
|
* for declarations which are shared between the memory subsystem's
|
|
|
|
* internals and the TCG TLB code. Do not include it from elsewhere.
|
2011-12-15 17:25:22 +04:00
|
|
|
*/
|
|
|
|
|
2012-09-20 17:02:51 +04:00
|
|
|
#ifndef MEMORY_INTERNAL_H
|
|
|
|
#define MEMORY_INTERNAL_H
|
2011-12-15 17:25:22 +04:00
|
|
|
|
2019-08-12 08:23:31 +03:00
|
|
|
#include "cpu.h"
|
|
|
|
|
2011-12-15 17:25:22 +04:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2018-03-05 02:31:20 +03:00
|
|
|
static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
|
|
|
|
{
|
|
|
|
return fv->dispatch;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline AddressSpaceDispatch *address_space_to_dispatch(AddressSpace *as)
|
|
|
|
{
|
|
|
|
return flatview_to_dispatch(address_space_to_flatview(as));
|
|
|
|
}
|
2012-10-03 18:22:53 +04:00
|
|
|
|
2018-03-18 20:26:36 +03:00
|
|
|
FlatView *address_space_get_flatview(AddressSpace *as);
|
|
|
|
void flatview_unref(FlatView *view);
|
|
|
|
|
2013-05-24 15:23:38 +04:00
|
|
|
extern const MemoryRegionOps unassigned_mem_ops;
|
|
|
|
|
2013-05-24 13:55:06 +04:00
|
|
|
bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
|
2018-05-31 16:50:52 +03:00
|
|
|
unsigned size, bool is_write,
|
|
|
|
MemTxAttrs attrs);
|
2013-05-24 13:55:06 +04:00
|
|
|
|
2017-09-21 11:51:00 +03:00
|
|
|
void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section);
|
|
|
|
AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv);
|
|
|
|
void address_space_dispatch_compact(AddressSpaceDispatch *d);
|
2017-09-21 11:50:56 +03:00
|
|
|
void address_space_dispatch_free(AddressSpaceDispatch *d);
|
2017-09-21 11:50:54 +03:00
|
|
|
|
2019-04-17 22:17:56 +03:00
|
|
|
void mtree_print_dispatch(struct AddressSpaceDispatch *d,
|
2017-09-21 11:51:06 +03:00
|
|
|
MemoryRegion *root);
|
2011-12-15 17:25:22 +04:00
|
|
|
#endif
|
|
|
|
#endif
|