diff options
Diffstat (limited to 'arch/frv/include/asm/virtconvert.h')
-rw-r--r-- | arch/frv/include/asm/virtconvert.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/frv/include/asm/virtconvert.h b/arch/frv/include/asm/virtconvert.h new file mode 100644 index 000000000000..59788fa2a813 --- /dev/null +++ b/arch/frv/include/asm/virtconvert.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* virtconvert.h: virtual/physical/page address convertion | ||
2 | * | ||
3 | * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | #ifndef _ASM_VIRTCONVERT_H | ||
12 | #define _ASM_VIRTCONVERT_H | ||
13 | |||
14 | /* | ||
15 | * Macros used for converting between virtual and physical mappings. | ||
16 | */ | ||
17 | |||
18 | #ifdef __KERNEL__ | ||
19 | |||
20 | #include <asm/setup.h> | ||
21 | |||
22 | #ifdef CONFIG_MMU | ||
23 | |||
24 | #define phys_to_virt(vaddr) ((void *) ((unsigned long)(vaddr) + PAGE_OFFSET)) | ||
25 | #define virt_to_phys(vaddr) ((unsigned long) (vaddr) - PAGE_OFFSET) | ||
26 | |||
27 | #else | ||
28 | |||
29 | #define phys_to_virt(vaddr) ((void *) (vaddr)) | ||
30 | #define virt_to_phys(vaddr) ((unsigned long) (vaddr)) | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define virt_to_bus virt_to_phys | ||
35 | #define bus_to_virt phys_to_virt | ||
36 | |||
37 | #define __page_address(page) (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT)) | ||
38 | #define page_to_phys(page) virt_to_phys((void *)__page_address(page)) | ||
39 | |||
40 | #endif | ||
41 | #endif | ||