Jun Nakajima | 432d268 | 2010-08-31 16:41:25 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 Citrix Ltd. |
| 3 | * |
| 4 | * This work is licensed under the terms of the GNU GPL, version 2. See |
| 5 | * the COPYING file in the top-level directory. |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | #ifndef XEN_MAPCACHE_H |
| 10 | #define XEN_MAPCACHE_H |
| 11 | |
Avi Kivity | fd2a9d2 | 2011-07-20 12:14:06 +0300 | [diff] [blame] | 12 | #include <stdlib.h> |
| 13 | |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 14 | typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr start_addr, |
Anthony PERARD | cd1ba7d | 2012-01-18 12:21:38 +0000 | [diff] [blame] | 15 | ram_addr_t size, |
| 16 | void *opaque); |
Avi Kivity | fd2a9d2 | 2011-07-20 12:14:06 +0300 | [diff] [blame] | 17 | #ifdef CONFIG_XEN |
| 18 | |
Anthony PERARD | cd1ba7d | 2012-01-18 12:21:38 +0000 | [diff] [blame] | 19 | void xen_map_cache_init(phys_offset_to_gaddr_t f, |
| 20 | void *opaque); |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 21 | uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, |
Jan Kiszka | e41d7c6 | 2011-06-21 22:59:08 +0200 | [diff] [blame] | 22 | uint8_t lock); |
| 23 | ram_addr_t xen_ram_addr_from_mapcache(void *ptr); |
| 24 | void xen_invalidate_map_cache_entry(uint8_t *buffer); |
| 25 | void xen_invalidate_map_cache(void); |
Jun Nakajima | 432d268 | 2010-08-31 16:41:25 +0100 | [diff] [blame] | 26 | |
Avi Kivity | fd2a9d2 | 2011-07-20 12:14:06 +0300 | [diff] [blame] | 27 | #else |
| 28 | |
Anthony PERARD | cd1ba7d | 2012-01-18 12:21:38 +0000 | [diff] [blame] | 29 | static inline void xen_map_cache_init(phys_offset_to_gaddr_t f, |
| 30 | void *opaque) |
Avi Kivity | fd2a9d2 | 2011-07-20 12:14:06 +0300 | [diff] [blame] | 31 | { |
| 32 | } |
| 33 | |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 34 | static inline uint8_t *xen_map_cache(hwaddr phys_addr, |
| 35 | hwaddr size, |
Avi Kivity | fd2a9d2 | 2011-07-20 12:14:06 +0300 | [diff] [blame] | 36 | uint8_t lock) |
| 37 | { |
| 38 | abort(); |
| 39 | } |
| 40 | |
| 41 | static inline ram_addr_t xen_ram_addr_from_mapcache(void *ptr) |
| 42 | { |
| 43 | abort(); |
| 44 | } |
| 45 | |
| 46 | static inline void xen_invalidate_map_cache_entry(uint8_t *buffer) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | static inline void xen_invalidate_map_cache(void) |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | #endif |
| 55 | |
Jun Nakajima | 432d268 | 2010-08-31 16:41:25 +0100 | [diff] [blame] | 56 | #endif /* !XEN_MAPCACHE_H */ |