patch-2.4.0-test3 linux/include/asm-mips64/sn/mapped_kernel.h
Next file: linux/include/asm-mips64/sn/nmi.h
Previous file: linux/include/asm-mips64/sn/klkernvars.h
Back to the patch index
Back to the overall index
- Lines: 42
- Date:
Sun Jul 9 22:18:15 2000
- Orig file:
v2.4.0-test2/linux/include/asm-mips64/sn/mapped_kernel.h
- Orig date:
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.4.0-test2/linux/include/asm-mips64/sn/mapped_kernel.h linux/include/asm-mips64/sn/mapped_kernel.h
@@ -0,0 +1,41 @@
+/*
+ * File created by Kanoj Sarcar 06/06/00.
+ * Copyright 2000 Silicon Graphics, Inc.
+ */
+#ifndef __ASM_SN_MAPPED_KERNEL_H
+#define __ASM_SN_MAPPED_KERNEL_H
+
+/*
+ * Note on how mapped kernels work: the text and data section is
+ * compiled at cksseg segment (LOADADDR = 0xc001c000), and the
+ * init/setup/data section gets a 16M virtual address bump in the
+ * ld.script file (so that tlblo0 and tlblo1 maps the sections).
+ * The vmlinux.64 section addresses are put in the xkseg range
+ * using the change-addresses makefile option. Use elfdump -of
+ * on IRIX to see where the sections go. The Origin loader loads
+ * the two sections contiguously in physical memory. The loader
+ * sets the entry point into kernel_entry using a xkphys address,
+ * but instead of using 0xa800000001160000, it uses the address
+ * 0xa800000000160000, which is where it physically loaded that
+ * code. So no jumps can be done before we have switched to using
+ * cksseg addresses.
+ */
+#include <linux/config.h>
+#include <asm/addrspace.h>
+
+#ifdef CONFIG_MAPPED_KERNEL
+
+#define MAPPED_KERN_RO_TO_PHYS(x) (x - CKSSEG)
+#define MAPPED_KERN_RW_TO_PHYS(x) (x - CKSSEG - 16777216)
+
+#else /* CONFIG_MAPPED_KERNEL */
+
+#define MAPPED_KERN_RO_TO_PHYS(x) (x - CKSEG0)
+#define MAPPED_KERN_RW_TO_PHYS(x) (x - CKSEG0)
+
+#endif /* CONFIG_MAPPED_KERNEL */
+
+#define MAPPED_KERN_RO_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RO_TO_PHYS(x))
+#define MAPPED_KERN_RW_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RW_TO_PHYS(x))
+
+#endif __ASM_SN_MAPPED_KERNEL_H
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)