Commit af955987 authored by Linus Torvalds's avatar Linus Torvalds
parents 4ad5bd25 9a94c579
...@@ -61,15 +61,17 @@ endif ...@@ -61,15 +61,17 @@ endif
LDFLAGS_vmlinux := -Bstatic LDFLAGS_vmlinux := -Bstatic
# The -Iarch/$(ARCH)/include is temporary while we are merging # The -Iarch/$(ARCH)/include is temporary while we are merging
CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -Iarch/$(ARCH)/include
AFLAGS += -Iarch/$(ARCH) AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe
CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc
CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
CFLAGS += $(CFLAGS-y) CPPFLAGS += $(CPPFLAGS-y)
AFLAGS += $(AFLAGS-y)
CFLAGS += -msoft-float -pipe $(CFLAGS-y)
CPP = $(CC) -E $(CFLAGS) CPP = $(CC) -E $(CFLAGS)
# Temporary hack until we have migrated to asm-powerpc # Temporary hack until we have migrated to asm-powerpc
LINUXINCLUDE += -Iarch/$(ARCH)/include LINUXINCLUDE-$(CONFIG_PPC32) := -Iarch/$(ARCH)/include
LINUXINCLUDE += $(LINUXINCLUDE-y)
CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__ CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__
...@@ -173,11 +175,13 @@ archclean: ...@@ -173,11 +175,13 @@ archclean:
archprepare: checkbin archprepare: checkbin
ifeq ($(CONFIG_PPC32),y)
# Temporary hack until we have migrated to asm-powerpc # Temporary hack until we have migrated to asm-powerpc
include/asm: arch/$(ARCH)/include/asm include/asm: arch/$(ARCH)/include/asm
arch/$(ARCH)/include/asm: FORCE arch/$(ARCH)/include/asm: FORCE
$(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
$(Q)ln -fsn $(srctree)/include/asm-$(OLDARCH) arch/$(ARCH)/include/asm $(Q)ln -fsn $(srctree)/include/asm-$(OLDARCH) arch/$(ARCH)/include/asm
endif
# Use the file '.tmp_gas_check' for binutils tests, as gas won't output # Use the file '.tmp_gas_check' for binutils tests, as gas won't output
# to stdout and these checks are run even on install targets. # to stdout and these checks are run even on install targets.
......
...@@ -295,7 +295,7 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len) ...@@ -295,7 +295,7 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len)
if (addr < 0x100000000UL) if (addr < 0x100000000UL)
err = open_low_hpage_areas(current->mm, err = open_low_hpage_areas(current->mm,
LOW_ESID_MASK(addr, len)); LOW_ESID_MASK(addr, len));
if ((addr + len) >= 0x100000000UL) if ((addr + len) > 0x100000000UL)
err = open_high_hpage_areas(current->mm, err = open_high_hpage_areas(current->mm,
HTLB_AREA_MASK(addr, len)); HTLB_AREA_MASK(addr, len));
if (err) { if (err) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Rewrite, cleanup: * Rewrite, cleanup:
* *
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
* *
* Dynamic DMA mapping support, iSeries-specific parts. * Dynamic DMA mapping support, iSeries-specific parts.
* *
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Rewrite, cleanup: * Rewrite, cleanup:
* *
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
* *
* Dynamic DMA mapping support, pSeries-specific parts, both SMP and LPAR. * Dynamic DMA mapping support, pSeries-specific parts, both SMP and LPAR.
* *
......
/* /*
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
/* /*
* arch/powerpc/sysdev/u3_iommu.c * arch/powerpc/sysdev/u3_iommu.c
* *
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
* *
* Based on pSeries_iommu.c: * Based on pSeries_iommu.c:
* Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
* *
* Dynamic DMA mapping support, Apple U3 & IBM CPC925 "DART" iommu. * Dynamic DMA mapping support, Apple U3 & IBM CPC925 "DART" iommu.
* *
......
/* /*
* Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
* Rewrite, cleanup: * Rewrite, cleanup:
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -103,8 +103,9 @@ extern unsigned int HPAGE_SHIFT; ...@@ -103,8 +103,9 @@ extern unsigned int HPAGE_SHIFT;
#define HTLB_AREA_SIZE (1UL << HTLB_AREA_SHIFT) #define HTLB_AREA_SIZE (1UL << HTLB_AREA_SHIFT)
#define GET_HTLB_AREA(x) ((x) >> HTLB_AREA_SHIFT) #define GET_HTLB_AREA(x) ((x) >> HTLB_AREA_SHIFT)
#define LOW_ESID_MASK(addr, len) (((1U << (GET_ESID(addr+len-1)+1)) \ #define LOW_ESID_MASK(addr, len) \
- (1U << GET_ESID(addr))) & 0xffff) (((1U << (GET_ESID(min((addr)+(len)-1, 0x100000000UL))+1)) \
- (1U << GET_ESID(min((addr), 0x100000000UL)))) & 0xffff)
#define HTLB_AREA_MASK(addr, len) (((1U << (GET_HTLB_AREA(addr+len-1)+1)) \ #define HTLB_AREA_MASK(addr, len) (((1U << (GET_HTLB_AREA(addr+len-1)+1)) \
- (1U << GET_HTLB_AREA(addr))) & 0xffff) - (1U << GET_HTLB_AREA(addr))) & 0xffff)
...@@ -113,17 +114,21 @@ extern unsigned int HPAGE_SHIFT; ...@@ -113,17 +114,21 @@ extern unsigned int HPAGE_SHIFT;
#define ARCH_HAS_SETCLEAR_HUGE_PTE #define ARCH_HAS_SETCLEAR_HUGE_PTE
#define touches_hugepage_low_range(mm, addr, len) \ #define touches_hugepage_low_range(mm, addr, len) \
(LOW_ESID_MASK((addr), (len)) & (mm)->context.low_htlb_areas) (((addr) < 0x100000000UL) \
&& (LOW_ESID_MASK((addr), (len)) & (mm)->context.low_htlb_areas))
#define touches_hugepage_high_range(mm, addr, len) \ #define touches_hugepage_high_range(mm, addr, len) \
(HTLB_AREA_MASK((addr), (len)) & (mm)->context.high_htlb_areas) ((((addr) + (len)) > 0x100000000UL) \
&& (HTLB_AREA_MASK((addr), (len)) & (mm)->context.high_htlb_areas))
#define __within_hugepage_low_range(addr, len, segmask) \ #define __within_hugepage_low_range(addr, len, segmask) \
((LOW_ESID_MASK((addr), (len)) | (segmask)) == (segmask)) ( (((addr)+(len)) <= 0x100000000UL) \
&& ((LOW_ESID_MASK((addr), (len)) | (segmask)) == (segmask)))
#define within_hugepage_low_range(addr, len) \ #define within_hugepage_low_range(addr, len) \
__within_hugepage_low_range((addr), (len), \ __within_hugepage_low_range((addr), (len), \
current->mm->context.low_htlb_areas) current->mm->context.low_htlb_areas)
#define __within_hugepage_high_range(addr, len, zonemask) \ #define __within_hugepage_high_range(addr, len, zonemask) \
((HTLB_AREA_MASK((addr), (len)) | (zonemask)) == (zonemask)) ( ((addr) >= 0x100000000UL) \
&& ((HTLB_AREA_MASK((addr), (len)) | (zonemask)) == (zonemask)))
#define within_hugepage_high_range(addr, len) \ #define within_hugepage_high_range(addr, len) \
__within_hugepage_high_range((addr), (len), \ __within_hugepage_high_range((addr), (len), \
current->mm->context.high_htlb_areas) current->mm->context.high_htlb_areas)
......
/* /*
* Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
* Rewrite, cleanup: * Rewrite, cleanup:
* Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment