ia64/xen-unstable

view xen/include/asm-x86/fixmap.h @ 19848:5839491bbf20

[IA64] replace MAX_VCPUS with d->max_vcpus where necessary.

don't use MAX_VCPUS, and use vcpu::max_vcpus.
The changeset of 2f9e1348aa98 introduced max_vcpus to allow more vcpus
per guest. This patch is ia64 counter part.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:26:05 2009 +0900 (2009-06-29)
parents 2e6de0f50f3f
children
line source
1 /*
2 * fixmap.h: compile-time virtual memory allocation
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1998 Ingo Molnar
9 * Modifications for Xen are copyright (c) 2002-2004, K A Fraser
10 */
12 #ifndef _ASM_FIXMAP_H
13 #define _ASM_FIXMAP_H
15 #include <xen/config.h>
16 #include <asm/apicdef.h>
17 #include <asm/acpi.h>
18 #include <asm/page.h>
19 #include <xen/kexec.h>
20 #include <xen/iommu.h>
21 #include <asm/amd-iommu.h>
22 #include <asm/msi.h>
24 /*
25 * Here we define all the compile-time 'special' virtual
26 * addresses. The point is to have a constant address at
27 * compile time, but to set the physical address only
28 * in the boot process. We allocate these special addresses
29 * from the end of virtual memory backwards.
30 */
31 enum fixed_addresses {
32 FIX_RESERVED, /* Index 0 is reserved since fix_to_virt(0) > FIXADDR_TOP. */
33 #ifdef __i386__
34 FIX_PAE_HIGHMEM_0,
35 FIX_PAE_HIGHMEM_END = FIX_PAE_HIGHMEM_0 + NR_CPUS-1,
36 #endif
37 FIX_APIC_BASE,
38 FIX_IO_APIC_BASE_0,
39 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1,
40 FIX_ACPI_BEGIN,
41 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
42 FIX_HPET_BASE,
43 FIX_CYCLONE_TIMER,
44 FIX_KEXEC_BASE_0,
45 FIX_KEXEC_BASE_END = FIX_KEXEC_BASE_0 \
46 + ((KEXEC_XEN_NO_PAGES >> 1) * KEXEC_IMAGE_NR) - 1,
47 FIX_IOMMU_REGS_BASE_0,
48 FIX_IOMMU_REGS_END = FIX_IOMMU_REGS_BASE_0 + MAX_IOMMUS-1,
49 FIX_IOMMU_MMIO_BASE_0,
50 FIX_IOMMU_MMIO_END = FIX_IOMMU_MMIO_BASE_0 + IOMMU_PAGES -1,
51 FIX_TBOOT_SHARED_BASE,
52 FIX_MSIX_IO_RESERV_BASE,
53 FIX_MSIX_IO_RESERV_END = FIX_MSIX_IO_RESERV_BASE + FIX_MSIX_MAX_PAGES -1,
54 __end_of_fixed_addresses
55 };
57 #define FIXADDR_TOP (IOREMAP_VIRT_END - PAGE_SIZE)
58 #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
59 #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
61 extern void __set_fixmap(
62 enum fixed_addresses idx, unsigned long mfn, unsigned long flags);
64 #define set_fixmap(idx, phys) \
65 __set_fixmap(idx, (phys)>>PAGE_SHIFT, PAGE_HYPERVISOR)
67 #define set_fixmap_nocache(idx, phys) \
68 __set_fixmap(idx, (phys)>>PAGE_SHIFT, PAGE_HYPERVISOR_NOCACHE)
70 #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
71 #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
73 #define fix_to_virt(x) (__fix_to_virt(x))
75 static inline unsigned long virt_to_fix(const unsigned long vaddr)
76 {
77 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
78 return __virt_to_fix(vaddr);
79 }
81 #endif