]>
Commit | Line | Data |
---|---|---|
744d9859 SG |
1 | /* |
2 | * Copyright (c) 2011 The Chromium OS Authors. | |
3 | * | |
3765b3e7 | 4 | * SPDX-License-Identifier: GPL-2.0+ |
744d9859 SG |
5 | */ |
6 | ||
a733b06b SG |
7 | #ifndef __SANDBOX_ASM_IO_H |
8 | #define __SANDBOX_ASM_IO_H | |
9 | ||
744d9859 SG |
10 | /* |
11 | * Given a physical address and a length, return a virtual address | |
12 | * that can be used to access the memory range with the caching | |
13 | * properties specified by "flags". | |
14 | */ | |
15 | #define MAP_NOCACHE (0) | |
16 | #define MAP_WRCOMBINE (0) | |
17 | #define MAP_WRBACK (0) | |
18 | #define MAP_WRTHROUGH (0) | |
19 | ||
20 | void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags); | |
21 | ||
22 | /* | |
23 | * Take down a mapping set up by map_physmem(). | |
24 | */ | |
25 | static inline void unmap_physmem(void *vaddr, unsigned long flags) | |
26 | { | |
27 | ||
28 | } | |
4213fc29 SG |
29 | |
30 | /* For sandbox, we want addresses to point into our RAM buffer */ | |
31 | static inline void *map_sysmem(phys_addr_t paddr, unsigned long len) | |
32 | { | |
33 | return map_physmem(paddr, len, MAP_WRBACK); | |
34 | } | |
35 | ||
36 | static inline void unmap_sysmem(const void *vaddr) | |
37 | { | |
38 | } | |
781adb57 SG |
39 | |
40 | /* Map from a pointer to our RAM buffer */ | |
41 | phys_addr_t map_to_sysmem(void *ptr); | |
a733b06b SG |
42 | |
43 | #endif |