2011-12-15 13:25:22 +00:00
|
|
|
/*
|
2017-11-21 15:08:08 +00:00
|
|
|
* Declarations for functions which are internal to the memory subsystem.
|
2011-12-15 13:25:22 +00:00
|
|
|
*
|
|
|
|
* Copyright 2011 Red Hat, Inc. and/or its affiliates
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Avi Kivity <avi@redhat.com>
|
|
|
|
*
|
2012-01-13 16:44:23 +00: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 13:25:22 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-11-21 15:08:08 +00: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 13:25:22 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 13:02:51 +00:00
|
|
|
#ifndef MEMORY_INTERNAL_H
|
|
|
|
#define MEMORY_INTERNAL_H
|
2011-12-15 13:25:22 +00:00
|
|
|
|
2019-08-12 05:23:31 +00:00
|
|
|
#include "cpu.h"
|
|
|
|
|
2011-12-15 13:25:22 +00:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2018-03-04 23:31:20 +00: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 14:22:53 +00:00
|
|
|
|
2018-03-18 17:26:36 +00:00
|
|
|
FlatView *address_space_get_flatview(AddressSpace *as);
|
|
|
|
void flatview_unref(FlatView *view);
|
|
|
|
|
2013-05-24 11:23:38 +00:00
|
|
|
extern const MemoryRegionOps unassigned_mem_ops;
|
|
|
|
|
2013-05-24 09:55:06 +00:00
|
|
|
bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
|
2018-05-31 13:50:52 +00:00
|
|
|
unsigned size, bool is_write,
|
|
|
|
MemTxAttrs attrs);
|
2013-05-24 09:55:06 +00:00
|
|
|
|
2017-09-21 08:51:00 +00: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 08:50:56 +00:00
|
|
|
void address_space_dispatch_free(AddressSpaceDispatch *d);
|
2017-09-21 08:50:54 +00:00
|
|
|
|
2019-04-17 19:17:56 +00:00
|
|
|
void mtree_print_dispatch(struct AddressSpaceDispatch *d,
|
2017-09-21 08:51:06 +00:00
|
|
|
MemoryRegion *root);
|
2011-12-15 13:25:22 +00:00
|
|
|
#endif
|
|
|
|
#endif
|