root / hw / mips_addr.c @ 0534163f
History | View | Annotate | Download (1.3 kB)
1 | 409dbce5 | Aurelien Jarno | /*
|
---|---|---|---|
2 | 409dbce5 | Aurelien Jarno | * QEMU MIPS address translation support
|
3 | 409dbce5 | Aurelien Jarno | *
|
4 | 409dbce5 | Aurelien Jarno | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 | 409dbce5 | Aurelien Jarno | * of this software and associated documentation files (the "Software"), to deal
|
6 | 409dbce5 | Aurelien Jarno | * in the Software without restriction, including without limitation the rights
|
7 | 409dbce5 | Aurelien Jarno | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 | 409dbce5 | Aurelien Jarno | * copies of the Software, and to permit persons to whom the Software is
|
9 | 409dbce5 | Aurelien Jarno | * furnished to do so, subject to the following conditions:
|
10 | 409dbce5 | Aurelien Jarno | *
|
11 | 409dbce5 | Aurelien Jarno | * The above copyright notice and this permission notice shall be included in
|
12 | 409dbce5 | Aurelien Jarno | * all copies or substantial portions of the Software.
|
13 | 409dbce5 | Aurelien Jarno | *
|
14 | 409dbce5 | Aurelien Jarno | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 | 409dbce5 | Aurelien Jarno | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 | 409dbce5 | Aurelien Jarno | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
17 | 409dbce5 | Aurelien Jarno | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18 | 409dbce5 | Aurelien Jarno | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19 | 409dbce5 | Aurelien Jarno | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20 | 409dbce5 | Aurelien Jarno | * THE SOFTWARE.
|
21 | 409dbce5 | Aurelien Jarno | */
|
22 | 409dbce5 | Aurelien Jarno | |
23 | 409dbce5 | Aurelien Jarno | #include "hw.h" |
24 | b970ea8f | Blue Swirl | #include "mips_cpudevs.h" |
25 | 409dbce5 | Aurelien Jarno | |
26 | 409dbce5 | Aurelien Jarno | uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr)
|
27 | 409dbce5 | Aurelien Jarno | { |
28 | 409dbce5 | Aurelien Jarno | return addr & 0x7fffffffll; |
29 | 409dbce5 | Aurelien Jarno | } |
30 | 409dbce5 | Aurelien Jarno | |
31 | 409dbce5 | Aurelien Jarno | uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr)
|
32 | 409dbce5 | Aurelien Jarno | { |
33 | 409dbce5 | Aurelien Jarno | return addr | ~0x7fffffffll; |
34 | 409dbce5 | Aurelien Jarno | } |