patch-2.1.118 linux/include/asm-i386/fixmap.h
Next file: linux/include/asm-i386/uaccess.h
Previous file: linux/include/asm-i386/fcntl.h
Back to the patch index
Back to the overall index
- Lines: 30
- Date:
Thu Aug 20 16:13:44 1998
- Orig file:
v2.1.117/linux/include/asm-i386/fixmap.h
- Orig date:
Sun Jul 26 11:57:19 1998
diff -u --recursive --new-file v2.1.117/linux/include/asm-i386/fixmap.h linux/include/asm-i386/fixmap.h
@@ -60,6 +60,10 @@
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
+#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
+
+extern void __this_fixmap_does_not_exist(void);
+
/*
* 'index to address' translation. If anyone tries to use the idx
* directly without tranlation, we catch the bug with a NULL-deference
@@ -71,12 +75,15 @@
* this branch gets completely eliminated after inlining,
* except when someone tries to use fixaddr indices in an
* illegal way. (such as mixing up address types or using
- * out-of-range indices)
+ * out-of-range indices).
+ *
+ * If it doesn't get removed, the linker will complain
+ * loudly with a reasonably clear error message..
*/
if (idx >= __end_of_fixed_addresses)
- panic("illegal fixaddr index!");
+ __this_fixmap_does_not_exist();
- return FIXADDR_TOP - (idx << PAGE_SHIFT);
+ return __fix_to_virt(idx);
}
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov