summaryrefslogtreecommitdiff
path: root/include/asm-ppc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 18:24:48 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 18:24:48 -0800
commitc9df1e203d7efe8c93d3cdc04093f44f040f8e83 (patch)
tree9bc86b9aeee5576677e5c8415ef5b757201dc2bc /include/asm-ppc
parent560e89962e32171585dd95af9ac9911ebc0e02ce (diff)
v2.4.4.5 -> v2.4.4.6
- Johannes Erdfelt: OHCI hash-chain corruption fix, USB updates - Richard Henderson, Ivan Kokshaysky: alpha PCI iommu fixes - Tim Waugh: parport changelogs and printk levels - Andrew Morton: vmalloc off-by-one (overly sensitive) test - Al Viro: VFS layer cleanups - Cort Dougan: PPC updates (big bootloader re-org) - Alan Cox: more merges, remove phillips camera conversion code - Andrea Arkangeli: alpha fixups - OGAWA Hirofumi: big-sector support with FAT - Neil Brown: more md fixes
Diffstat (limited to 'include/asm-ppc')
-rw-r--r--include/asm-ppc/bootinfo.h26
-rw-r--r--include/asm-ppc/processor.h27
2 files changed, 34 insertions, 19 deletions
diff --git a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h
index 2ce574d0b228..ce7650611398 100644
--- a/include/asm-ppc/bootinfo.h
+++ b/include/asm-ppc/bootinfo.h
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.bootinfo.h 1.5 05/17/01 18:14:24 cort
+ * BK Id: SCCS/s.bootinfo.h 1.7 05/23/01 00:38:42 cort
*/
/*
* Non-machine dependent bootinfo structure. Basic idea
@@ -8,7 +8,6 @@
* Copyright (C) 1999 Cort Dougan <cort@ppc.kernel.org>
*/
-
#ifdef __KERNEL__
#ifndef _PPC_BOOTINFO_H
#define _PPC_BOOTINFO_H
@@ -35,6 +34,27 @@ struct bi_record {
#endif /* CONFIG_APUS */
-#endif /* _PPC_BOOTINFO_H */
+/*
+ * prom_init() is called very early on, before the kernel text
+ * and data have been mapped to KERNELBASE. At this point the code
+ * is running at whatever address it has been loaded at, so
+ * references to extern and static variables must be relocated
+ * explicitly. The procedure reloc_offset() returns the address
+ * we're currently running at minus the address we were linked at.
+ * (Note that strings count as static variables.)
+ *
+ * Because OF may have mapped I/O devices into the area starting at
+ * KERNELBASE, particularly on CHRP machines, we can't safely call
+ * OF once the kernel has been mapped to KERNELBASE. Therefore all
+ * OF calls should be done within prom_init(), and prom_init()
+ * and all routines called within it must be careful to relocate
+ * references as necessary.
+ */
+#define PTRRELOC(x) ((typeof(x))((unsigned long)(x) + offset))
+#define PTRUNRELOC(x) ((typeof(x))((unsigned long)(x) - offset))
+#define RELOC(x) (*PTRRELOC(&(x)))
+#endif /* _PPC_BOOTINFO_H */
#endif /* __KERNEL__ */
+
+
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index fdc154d70687..3bd0b2a7e345 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -554,10 +554,10 @@ n:
#define SR15 15
#ifndef __ASSEMBLY__
-#ifndef CONFIG_MACH_SPECIFIC
+#if defined(CONFIG_ALL_PPC)
extern int _machine;
extern int have_of;
-#endif /* CONFIG_MACH_SPECIFIC */
+#endif /* CONFIG_ALL_PPC */
/* what kind of prep workstation we are */
extern int _prep_type;
@@ -681,29 +681,24 @@ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
#endif /* ndef ASSEMBLY*/
-#ifdef CONFIG_MACH_SPECIFIC
-#if defined(CONFIG_8xx)
-#define _machine _MACH_8xx
-#define have_of 0
+#ifndef CONFIG_ALL_PPC
+#if defined(CONFIG_APUS)
+#define _machine _MACH_apus
+#elif defined(CONFIG_GEMINI)
+#define _machine _MACH_gemini
#elif defined(CONFIG_OAK)
#define _machine _MACH_oak
-#define have_of 0
#elif defined(CONFIG_WALNUT)
#define _machine _MACH_walnut
-#define have_of 0
-#elif defined(CONFIG_APUS)
-#define _machine _MACH_apus
-#define have_of 0
-#elif defined(CONFIG_GEMINI)
-#define _machine _MACH_gemini
-#define have_of 0
+#elif defined(CONFIG_8xx)
+#define _machine _MACH_8xx
#elif defined(CONFIG_8260)
#define _machine _MACH_8260
-#define have_of 0
#else
#error "Machine not defined correctly"
#endif
-#endif /* CONFIG_MACH_SPECIFIC */
+#define have_of 0
+#endif /* !CONFIG_ALL_PPC */
#endif /* __ASM_PPC_PROCESSOR_H */
#endif /* __KERNEL__ */