2
0

memory-internal.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Declarations for functions which are internal to the memory subsystem.
  3. *
  4. * Copyright 2011 Red Hat, Inc. and/or its affiliates
  5. *
  6. * Authors:
  7. * Avi Kivity <avi@redhat.com>
  8. *
  9. * This work is licensed under the terms of the GNU GPL, version 2 or
  10. * later. See the COPYING file in the top-level directory.
  11. *
  12. */
  13. /*
  14. * This header is for use by exec.c, memory.c and accel/tcg/cputlb.c ONLY,
  15. * for declarations which are shared between the memory subsystem's
  16. * internals and the TCG TLB code. Do not include it from elsewhere.
  17. */
  18. #ifndef MEMORY_INTERNAL_H
  19. #define MEMORY_INTERNAL_H
  20. #include "cpu.h"
  21. #ifndef CONFIG_USER_ONLY
  22. static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
  23. {
  24. return fv->dispatch;
  25. }
  26. static inline AddressSpaceDispatch *address_space_to_dispatch(AddressSpace *as)
  27. {
  28. return flatview_to_dispatch(address_space_to_flatview(as));
  29. }
  30. FlatView *address_space_get_flatview(AddressSpace *as);
  31. void flatview_unref(FlatView *view);
  32. extern const MemoryRegionOps unassigned_mem_ops;
  33. void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section);
  34. AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv);
  35. void address_space_dispatch_compact(AddressSpaceDispatch *d);
  36. void address_space_dispatch_free(AddressSpaceDispatch *d);
  37. void mtree_print_dispatch(struct AddressSpaceDispatch *d,
  38. MemoryRegion *root);
  39. #endif
  40. #endif