[CVS] km km.c,1.102,1.103 km_api_data.c,1.23,1.24
Status: Beta
Brought to you by:
volodya
From: <gat...@li...> - 2005-03-09 08:40:43
|
Update of /cvsroot/gatos/km In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3610 Modified Files: km.c km_api_data.c Log Message: remap_page_range is obsolete on current 2.6 kernels. Fix size_t related compiler warnings on AMD64. Index: km_api_data.c =================================================================== RCS file: /cvsroot/gatos/km/km_api_data.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- km_api_data.c 16 Dec 2004 14:30:56 -0000 1.23 +++ km_api_data.c 9 Mar 2005 08:40:32 -0000 1.24 @@ -247,7 +247,7 @@ return kdu->mmap(file, vma); } -static int km_fo_data_read(struct file *file, char *buf, size_t count, loff_t *ppos) +static ssize_t km_fo_data_read(struct file *file, char *buf, size_t count, loff_t *ppos) { KDU_FILE_PRIVATE_DATA *kdufpd=file->private_data; KM_DATA_UNIT *kdu=kdufpd->kdu; @@ -265,6 +265,7 @@ unsigned long size = vma->vm_end-vma->vm_start; unsigned long chunk_size; unsigned long page, start; +unsigned long pos; int i,j; if(kdu->type!=KDU_TYPE_VIRTUAL_BLOCK){ @@ -277,14 +278,23 @@ for(j=0;j<dvb->size;j+=PAGE_SIZE){ if(chunk_size*i+PAGE_SIZE*j<offset)continue; if(chunk_size*i+PAGE_SIZE*j>offset+size)return 0; - page=kvirt_to_pa((unsigned long)dvb->ptr[i]+j*PAGE_SIZE); + pos=(unsigned long)dvb->ptr[i]+j*PAGE_SIZE; start=vma->vm_start+chunk_size*i+PAGE_SIZE*j-offset; #ifdef LINUX_2_6 - if(remap_page_range(vma,start, page, PAGE_SIZE, PAGE_SHARED)) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + page=kvirt_to_pa(pos); + if(remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED)) + return -EAGAIN; #else - if(remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED)) + page=page_to_pfn(vmalloc_to_page((void *)pos)); + if(remap_pfn_range(vma, start, page, PAGE_SIZE, PAGE_SHARED)) + return -EAGAIN; #endif +#else + page=kvirt_to_pa(pos); + if(remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED)) return -EAGAIN; +#endif } return 0; } Index: km.c =================================================================== RCS file: /cvsroot/gatos/km/km.c,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- km.c 11 Jan 2005 09:12:42 -0000 1.102 +++ km.c 9 Mar 2005 08:40:32 -0000 1.103 @@ -713,7 +713,7 @@ pci_set_drvdata(dev, NULL); return -EIO; } - printk("sizeof(kmfl_template)=%d sizeof(KM_FIELD)=%d\n", sizeof(kmfl_template), sizeof(KM_FIELD)); + printk("sizeof(kmfl_template)=%ld sizeof(KM_FIELD)=%ld\n", (unsigned long)sizeof(kmfl_template), (unsigned long)sizeof(KM_FIELD)); kms->kmfl=kmalloc(sizeof(kmfl_template), GFP_KERNEL); memcpy(kms->kmfl, kmfl_template, sizeof(kmfl_template)); @@ -1081,7 +1081,7 @@ request_module("videodev"); printk(KERN_INFO "Kmultimedia module version %s loaded\n", KM_VERSION); - printk(KERN_DEBUG "Page size is %ld sizeof(bm_list_descriptor)=%d sizeof(KM_STRUCT)=%d\n", PAGE_SIZE, sizeof(bm_list_descriptor), sizeof(KM_STRUCT)); + printk(KERN_DEBUG "Page size is %ld sizeof(bm_list_descriptor)=%ld sizeof(KM_STRUCT)=%ld\n", PAGE_SIZE, (unsigned long)sizeof(bm_list_descriptor), (unsigned long)sizeof(KM_STRUCT)); num_devices=0; pci_module_init( &km_pci_driver ); |