Update of /cvsroot/alsa/alsa-driver/pci/rme9652
In directory sc8-pr-cvs1:/tmp/cvs-serv3465
Modified Files:
.cvsignore Makefile
Added Files:
hammerfall_mem.inc hammerfall_mem.patch
Removed Files:
hammerfall_mem.c
Log Message:
2.5 cleanups
--- NEW FILE: hammerfall_mem.inc ---
/*
* Hacks for compilation for ALSA BUILD
*/
#include <linux/config.h>
#include <linux/version.h>
#if defined(ALSA_BUILD) && defined(CONFIG_MODVERSIONS) && !defined(__GENKSYMS__) &&
!defined(__DEPEND__)
#define MODVERSIONS
#include <linux/modversions.h>
#include "sndversions.h"
#endif
#include <linux/module.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/malloc.h>
#include <linux/init.h>
#include <asm/io.h>
#include "config.h"
#ifndef CONFIG_HAVE_DMA_ADDR_T
typedef unsigned long dma_addr_t;
#endif
#ifndef __init
#define __init
#endif
#ifndef __exit
#define __exit
#endif
#ifndef module_init
#define module_init(x) int init_module(void) { return x(); }
#endif
#ifndef module_exit
#define module_exit(x) void cleanup_module(void) { x(); }
#endif
#ifndef THIS_MODULE
#define THIS_MODULE (&__this_module)
#endif
#define virt_to_page(x) (&mem_map[MAP_NR(x)])
#define pci_for_each_dev(dev) \
for(dev = pci_devices; dev; dev = dev->next)
static inline int try_inc_mod_count(struct module *module)
{
__MOD_INC_USE_COUNT(module);
return 1;
}
#endif /* < 2.3.0 */
#ifndef MODULE_LICENSE
#define MODULE_LICENSE(x)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
#define try_module_get(x) try_inc_mod_count(x)
static inline void module_put(struct module *module)
{
if (module)
__MOD_DEC_USE_COUNT(module);
}
#endif /* < 2.5.0 */
--- NEW FILE: hammerfall_mem.patch ---
--- hammerfall_mem.c 2003-05-31 13:28:32.000000000 +0200
+++ hammerfall_mem.c.old 2003-05-31 13:32:43.000000000 +0200
@@ -1,3 +1,4 @@
+#include "hammerfall_mem.inc"
/*
ALSA memory allocation module for the RME Digi9652
@@ -98,7 +99,15 @@
{
void *res;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 3, 0)
res = (void *) pci_alloc_consistent(pci, size, dmaaddr);
+#else
+ int pg;
+ for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);
+ res = (void *)__get_free_pages(GFP_KERNEL, pg);
+ if (res != NULL)
+ *dmaaddr = virt_to_bus(res);
+#endif
if (res != NULL) {
struct page *page = virt_to_page(res);
struct page *last_page = page + (size + PAGE_SIZE - 1) / PAGE_SIZE;
@@ -119,7 +128,19 @@
last_page = virt_to_page(ptr) + (size + PAGE_SIZE - 1) / PAGE_SIZE;
while (page < last_page)
clear_bit(PG_reserved, &(page++)->flags);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 3, 0)
pci_free_consistent(pci, size, ptr, dmaaddr);
+#else
+ {
+ int pg;
+ for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);
+ if (bus_to_virt(dmaaddr) != ptr) {
+ printk(KERN_ERR "hammerfall_free_pages: dmaaddr != ptr\n");
+ return;
+ }
+ free_pages((unsigned long)ptr, pg);
+ }
+#endif
}
void *snd_hammerfall_get_buffer (struct pci_dev *pcidev, dma_addr_t *dmaaddr)
Index: .cvsignore
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/rme9652/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 22 Dec 2001 20:46:15 -0000 1.1
+++ .cvsignore 31 May 2003 11:33:48 -0000 1.2
@@ -1 +1,2 @@
.depend
+hammerfall_mem.c
Index: Makefile
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/rme9652/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile 9 Feb 2003 18:35:58 -0000 1.3
+++ Makefile 31 May 2003 11:33:49 -0000 1.4
@@ -3,9 +3,13 @@
include $(TOPDIR)/toplevel.config
include $(TOPDIR)/Makefile.conf
+EXTRA_CLEAN = hammerfall_mem.c
+
export-objs := hammerfall_mem.o
TOPDIR = $(MAINSRCDIR)
include $(TOPDIR)/alsa-kernel/pci/rme9652/Makefile
include $(TOPDIR)/Rules.make
+
+hammerfall_mem.c: hammerfall_mem.patch
$(TOPDIR)/alsa-kernel/pci/rme9652/hammerfall_mem.c
--- hammerfall_mem.c DELETED ---
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog