Skip to contentSkip to conversation

: [LIB]: Make PowerPC LMB code generic so sparc64 can use it too.

PATCH In review David Miller 1 participant 1 message Feb 14, 2008

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 : [LIB]: Make PowerPC LMB code generic so sparc64 can use it too.

[LIB]: Make PowerPC LMB code generic so sparc64 can use it too.

---
 arch/powerpc/Kconfig                    |    1 +
 arch/powerpc/kernel/btext.c             |    3 +-
 arch/powerpc/kernel/crash.c             |    3 +-
 arch/powerpc/kernel/crash_dump.c        |    3 +-
 arch/powerpc/kernel/machine_kexec.c     |    3 +-
 arch/powerpc/kernel/prom.c              |    2 +-
 arch/powerpc/kernel/rtas.c              |    2 +-
 arch/powerpc/kernel/setup-common.c      |    2 +-
 arch/powerpc/kernel/setup_64.c          |    2 +-
 arch/powerpc/kernel/vdso.c              |    3 +-
 arch/powerpc/mm/Makefile                |    2 +-
 arch/powerpc/mm/hash_utils_64.c         |    3 +-
 arch/powerpc/mm/init_32.c               |    2 +-
 arch/powerpc/mm/init_64.c               |    2 +-
 arch/powerpc/mm/lmb.c                   |  357 -------------------------------
 arch/powerpc/mm/mem.c                   |    2 +-
 arch/powerpc/mm/numa.c                  |    3 +-
 arch/powerpc/mm/ppc_mmu_32.c            |    2 +-
 arch/powerpc/mm/stab.c                  |    4 +-
 arch/powerpc/platforms/cell/iommu.c     |    2 +-
 arch/powerpc/platforms/maple/setup.c    |    2 +-
 arch/powerpc/platforms/powermac/setup.c |    2 +-
 arch/powerpc/platforms/ps3/htab.c       |    3 +-
 arch/powerpc/platforms/ps3/mm.c         |    3 +-
 arch/powerpc/platforms/ps3/os-area.c    |    3 +-
 arch/powerpc/sysdev/dart_iommu.c        |    2 +-
 arch/sparc64/Kconfig                    |    1 +
 include/asm-powerpc/abs_addr.h          |    3 +-
 include/asm-powerpc/lmb.h               |   82 +-------
 include/asm-sparc64/lmb.h               |   10 +
 include/linux/lmb.h                     |   83 +++++++
 lib/Kconfig                             |    3 +
 lib/Makefile                            |    2 +
 lib/lmb.c                               |  354 ++++++++++++++++++++++++++++++
 34 files changed, 500 insertions(+), 456 deletions(-)
 delete mode 100644 arch/powerpc/mm/lmb.c
 create mode 100644 include/asm-sparc64/lmb.h
 create mode 100644 include/linux/lmb.h
 create mode 100644 lib/lmb.c
arch/powerpc/Kconfig +1 -0
index 485513c..bd645f0 100644
@@ -90,6 +90,7 @@ config PPC
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_KPROBES
+	select HAVE_LMB
 
 config EARLY_PRINTK
 	bool
arch/powerpc/kernel/btext.c +2 -1
index 80e2eef..9f93777 100644
@@ -7,6 +7,7 @@
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/lmb.h>
 
 #include <asm/sections.h>
 #include <asm/prom.h>
@@ -15,7 +16,7 @@
 #include <asm/mmu.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/processor.h>
 #include <asm/udbg.h>
 
arch/powerpc/kernel/crash.c +2 -1
index 571132e..eae401d 100644
@@ -24,12 +24,13 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/types.h>
+#include <linux/lmb.h>
 
 #include <asm/processor.h>
 #include <asm/machdep.h>
 #include <asm/kexec.h>
 #include <asm/kdump.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/firmware.h>
 #include <asm/smp.h>
 #include <asm/system.h>
arch/powerpc/kernel/crash_dump.c +2 -1
index 29ff77c..9ee3c52 100644
@@ -13,8 +13,9 @@
 
 #include <linux/crash_dump.h>
 #include <linux/bootmem.h>
+#include <linux/lmb.h>
 #include <asm/kdump.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/firmware.h>
 #include <asm/uaccess.h>
 
arch/powerpc/kernel/machine_kexec.c +2 -1
index c0c8e8c..2d202f2 100644
@@ -12,8 +12,9 @@
 #include <linux/kexec.h>
 #include <linux/reboot.h>
 #include <linux/threads.h>
+#include <linux/lmb.h>
 #include <asm/machdep.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 
 void machine_crash_shutdown(struct pt_regs *regs)
 {
arch/powerpc/kernel/prom.c +1 -1
index 8b5efbc..c17a585 100644
@@ -31,10 +31,10 @@
 #include <linux/kexec.h>
 #include <linux/debugfs.h>
 #include <linux/irq.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
-#include <asm/lmb.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 #include <asm/irq.h>
arch/powerpc/kernel/rtas.c +1 -1
index 52e95c2..e2e78d9 100644
@@ -22,6 +22,7 @@
 #include <linux/smp.h>
 #include <linux/completion.h>
 #include <linux/cpumask.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
@@ -34,7 +35,6 @@
 #include <asm/system.h>
 #include <asm/delay.h>
 #include <asm/uaccess.h>
-#include <asm/lmb.h>
 #include <asm/udbg.h>
 #include <asm/syscalls.h>
 #include <asm/smp.h>
arch/powerpc/kernel/setup-common.c +1 -1
index 6adb5a1..12cc41c 100644
@@ -34,6 +34,7 @@
 #include <linux/serial_8250.h>
 #include <linux/debugfs.h>
 #include <linux/percpu.h>
+#include <linux/lmb.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
@@ -56,7 +57,6 @@
 #include <asm/cache.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/lmb.h>
 #include <asm/xmon.h>
 #include <asm/cputhreads.h>
 
arch/powerpc/kernel/setup_64.c +1 -1
index 3b1529c..2c2d831 100644
@@ -33,6 +33,7 @@
 #include <linux/serial_8250.h>
 #include <linux/bootmem.h>
 #include <linux/pci.h>
+#include <linux/lmb.h>
 #include <asm/io.h>
 #include <asm/kdump.h>
 #include <asm/prom.h>
@@ -55,7 +56,6 @@
 #include <asm/cache.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/lmb.h>
 #include <asm/firmware.h>
 #include <asm/xmon.h>
 #include <asm/udbg.h>
arch/powerpc/kernel/vdso.c +2 -1
index 3702df7..d715048 100644
@@ -21,13 +21,14 @@
 #include <linux/elf.h>
 #include <linux/security.h>
 #include <linux/bootmem.h>
+#include <linux/lmb.h>
 
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/cputable.h>
 #include <asm/sections.h>
arch/powerpc/mm/Makefile +1 -1
index 41649a5..1c00e01 100644
@@ -6,7 +6,7 @@ ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS	+= -mno-minimal-toc
 endif
 
-obj-y				:= fault.o mem.o lmb.o \
+obj-y				:= fault.o mem.o \
 				   init_$(CONFIG_WORD_SIZE).o \
 				   pgtable_$(CONFIG_WORD_SIZE).o \
 				   mmu_context_$(CONFIG_WORD_SIZE).o
arch/powerpc/mm/hash_utils_64.c +2 -1
index 32f4161..73b7848 100644
@@ -31,6 +31,7 @@
 #include <linux/cache.h>
 #include <linux/init.h>
 #include <linux/signal.h>
+#include <linux/lmb.h>
 
 #include <asm/processor.h>
 #include <asm/pgtable.h>
@@ -41,7 +42,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/machdep.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/abs_addr.h>
 #include <asm/tlbflush.h>
 #include <asm/io.h>
arch/powerpc/mm/init_32.c +1 -1
index 977cb1e..59a725b 100644
@@ -30,6 +30,7 @@
 #include <linux/highmem.h>
 #include <linux/initrd.h>
 #include <linux/pagemap.h>
+#include <linux/lmb.h>
 
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
@@ -41,7 +42,6 @@
 #include <asm/machdep.h>
 #include <asm/btext.h>
 #include <asm/tlb.h>
-#include <asm/lmb.h>
 #include <asm/sections.h>
 
 #include "mmu_decl.h"
arch/powerpc/mm/init_64.c +1 -1
index c0f5cff..abeb0eb 100644
@@ -38,11 +38,11 @@
 #include <linux/nodemask.h>
 #include <linux/module.h>
 #include <linux/poison.h>
+#include <linux/lmb.h>
 
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 #include <asm/prom.h>
-#include <asm/lmb.h>
 #include <asm/rtas.h>
 #include <asm/io.h>
 #include <asm/mmu_context.h>
arch/powerpc/mm/lmb.c deleted +0 -357

357 lines not on this page · raw message

arch/powerpc/mm/mem.c +1 -1
index be5c506..60c019c 100644
@@ -31,6 +31,7 @@
 #include <linux/initrd.h>
 #include <linux/pagemap.h>
 #include <linux/suspend.h>
+#include <linux/lmb.h>
 
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
@@ -42,7 +43,6 @@
 #include <asm/machdep.h>
 #include <asm/btext.h>
 #include <asm/tlb.h>
-#include <asm/lmb.h>
 #include <asm/sections.h>
 #include <asm/vdso.h>
 
arch/powerpc/mm/numa.c +2 -1
index a300d25..1efd631 100644
@@ -17,8 +17,9 @@
 #include <linux/nodemask.h>
 #include <linux/cpu.h>
 #include <linux/notifier.h>
+#include <linux/lmb.h>
 #include <asm/sparsemem.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/system.h>
 #include <asm/smp.h>
 
arch/powerpc/mm/ppc_mmu_32.c +1 -1
index 5c45d47..72de3c7 100644
@@ -26,11 +26,11 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/mmu.h>
 #include <asm/machdep.h>
-#include <asm/lmb.h>
 
 #include "mmu_decl.h"
 
arch/powerpc/mm/stab.c +3 -1
index 50448d5..efbbd13 100644
@@ -12,12 +12,14 @@
  *      2 of the License, or (at your option) any later version.
  */
 
+#include <linux/lmb.h>
+
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/paca.h>
 #include <asm/cputable.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/abs_addr.h>
 #include <asm/firmware.h>
 #include <asm/iseries/hv_call.h>
arch/powerpc/platforms/cell/iommu.c +1 -1
index edab631..6138158 100644
@@ -28,13 +28,13 @@
 #include <linux/notifier.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/iommu.h>
 #include <asm/machdep.h>
 #include <asm/pci-bridge.h>
 #include <asm/udbg.h>
-#include <asm/lmb.h>
 #include <asm/firmware.h>
 #include <asm/cell-regs.h>
 
arch/powerpc/platforms/maple/setup.c +1 -1
index 3ce2d73..dadf33b 100644
@@ -43,6 +43,7 @@
 #include <linux/smp.h>
 #include <linux/bitops.h>
 #include <linux/of_device.h>
+#include <linux/lmb.h>
 
 #include <asm/processor.h>
 #include <asm/sections.h>
@@ -57,7 +58,6 @@
 #include <asm/dma.h>
 #include <asm/cputable.h>
 #include <asm/time.h>
-#include <asm/lmb.h>
 #include <asm/mpic.h>
 #include <asm/rtas.h>
 #include <asm/udbg.h>
arch/powerpc/platforms/powermac/setup.c +1 -1
index 36ff1b6..59404ba 100644
@@ -53,6 +53,7 @@
 #include <linux/suspend.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/lmb.h>
 
 #include <asm/reg.h>
 #include <asm/sections.h>
@@ -74,7 +75,6 @@
 #include <asm/iommu.h>
 #include <asm/smu.h>
 #include <asm/pmc.h>
-#include <asm/lmb.h>
 #include <asm/udbg.h>
 
 #include "pmac.h"
arch/powerpc/platforms/ps3/htab.c +2 -1
index 7382f19..1cf901f 100644
@@ -19,9 +19,10 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/lmb.h>
 
 #include <asm/machdep.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/lv1call.h>
 #include <asm/ps3fb.h>
arch/powerpc/platforms/ps3/mm.c +2 -1
index 6890047..5b3fb2b 100644
@@ -21,9 +21,10 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/memory_hotplug.h>
+#include <linux/lmb.h>
 
 #include <asm/firmware.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/lv1call.h>
 
arch/powerpc/platforms/ps3/os-area.c +2 -1
index b9ea09d..c73379e 100644
@@ -24,8 +24,9 @@
 #include <linux/fs.h>
 #include <linux/syscalls.h>
 #include <linux/ctype.h>
+#include <linux/lmb.h>
 
-#include <asm/lmb.h>
+#include <asm/prom.h>
 
 #include "platform.h"
 
arch/powerpc/sysdev/dart_iommu.c +1 -1
index e0e24b0..005c2ec 100644
@@ -37,6 +37,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/vmalloc.h>
 #include <linux/suspend.h>
+#include <linux/lmb.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/iommu.h>
@@ -44,7 +45,6 @@
 #include <asm/machdep.h>
 #include <asm/abs_addr.h>
 #include <asm/cacheflush.h>
-#include <asm/lmb.h>
 #include <asm/ppc-pci.h>
 
 #include "dart.h"
arch/sparc64/Kconfig +1 -0
index 3af378d..b18d24d 100644
@@ -15,6 +15,7 @@ config SPARC64
 	bool
 	default y
 	select HAVE_IDE
+	select HAVE_LMB
 	help
 	  SPARC is a family of RISC microprocessors designed and marketed by
 	  Sun Microsystems, incorporated.  This port covers the newer 64-bit
include/asm-powerpc/abs_addr.h +2 -1
index 4aa2207..98324c5 100644
@@ -12,10 +12,11 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/lmb.h>
+
 #include <asm/types.h>
 #include <asm/page.h>
 #include <asm/prom.h>
-#include <asm/lmb.h>
 #include <asm/firmware.h>
 
 struct mschunks_map {
include/asm-powerpc/lmb.h +8 -74

89 lines not on this page · raw message

include/asm-sparc64/lmb.h new file +10 -0
new file mode 100644
index 0000000..6a352cb
@@ -0,0 +1,10 @@
+#ifndef _SPARC64_LMB_H
+#define _SPARC64_LMB_H
+
+#include <asm/oplib.h>
+
+#define LMB_DBG(fmt...) prom_printf(fmt)
+
+#define LMB_REAL_LIMIT	0
+
+#endif /* !(_SPARC64_LMB_H) */
include/linux/lmb.h new file +83 -0

83 lines not on this page · raw message

lib/Kconfig +3 -0
index ba3d104..2d53dc0 100644
@@ -141,4 +141,7 @@ config HAS_DMA
 config CHECK_SIGNATURE
 	bool
 
+config HAVE_LMB
+	boolean
+
 endmenu
lib/Makefile +2 -0
index 23de261..61bba16 100644
@@ -70,6 +70,8 @@ obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
 
 lib-$(CONFIG_GENERIC_BUG) += bug.o
 
+obj-$(CONFIG_HAVE_LMB) += lmb.o
+
 hostprogs-y	:= gen_crc32table
 clean-files	:= crc32table.h
 
lib/lmb.c new file +354 -0

354 lines not on this page · raw message

Signature · 1 line
1.5.4.29.gb828fe