summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2003-01-24 12:26:47 +0000
committerHolger Waechtler <devnull@localhost>2003-01-24 12:26:47 +0000
commit79dbc09e09d48ebb4a087f003789a8bf22d2cc13 (patch)
tree053c6f658d2605ae95c10681f4fa3b1831a04797 /linux/drivers/media/dvb
parentc99558b6d7f0c8b7134eb15b0ed31e23d0b8c85c (diff)
downloadmediapointer-dvb-s2-79dbc09e09d48ebb4a087f003789a8bf22d2cc13.tar.gz
mediapointer-dvb-s2-79dbc09e09d48ebb4a087f003789a8bf22d2cc13.tar.bz2
implement vmalloc_to_page() again in order to maintain backward compatibility
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/dvb-core/compat.c23
-rw-r--r--linux/drivers/media/dvb/dvb-core/compat.h7
2 files changed, 30 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/compat.c b/linux/drivers/media/dvb/dvb-core/compat.c
index 40280c8aa..255d89616 100644
--- a/linux/drivers/media/dvb/dvb-core/compat.c
+++ b/linux/drivers/media/dvb/dvb-core/compat.c
@@ -128,3 +128,26 @@ EXPORT_SYMBOL(crc32_le);
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+struct page * vmalloc_to_page(void *vmalloc_addr)
+{
+ unsigned long addr = (unsigned long) vmalloc_addr;
+ struct page *page = NULL;
+ pgd_t *pgd = pgd_offset_k(addr);
+ pmd_t *pmd;
+ pte_t *ptep, pte;
+
+ if (!pgd_none(*pgd)) {
+ pmd = pmd_offset(pgd, addr);
+ if (!pmd_none(*pmd)) {
+ ptep = pte_offset(pmd, addr);
+ pte = *ptep;
+ if (pte_present(pte))
+ page = pte_page(pte);
+ }
+ }
+ return page;
+}
+EXPORT_SYMBOL(vmalloc_to_page);
+#endif
+
diff --git a/linux/drivers/media/dvb/dvb-core/compat.h b/linux/drivers/media/dvb/dvb-core/compat.h
index 2e38e0042..49f32ecbd 100644
--- a/linux/drivers/media/dvb/dvb-core/compat.h
+++ b/linux/drivers/media/dvb/dvb-core/compat.h
@@ -80,5 +80,12 @@ int try_module_get(struct module *mod)
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+
+extern struct page * vmalloc_to_page(void *addr);
+
+#endif
+
+
#endif