diff -ur build_mod.old/2.6.x/Makefile build_mod/2.6.x/Makefile --- build_mod.old/2.6.x/Makefile 2004-03-17 23:00:29.000000000 +0100 +++ build_mod/2.6.x/Makefile 2004-05-29 21:17:58.684389712 +0200 @@ -11,7 +11,7 @@ endif EXTRA_CFLAGS += \ - -Idrivers/char/drm/ \ + -I$(DRMINCLUDES) \ -D__AGP__ \ -DFGL \ -DFGL_LINUX \ diff -ur build_mod.old/firegl_public.c build_mod/firegl_public.c --- build_mod.old/firegl_public.c 2004-03-17 23:00:29.000000000 +0100 +++ build_mod/firegl_public.c 2004-05-29 20:47:10.140411112 +0200 @@ -236,15 +236,24 @@ // ============================================================ /* global structures */ +int ip_firegl_open(struct inode* inode, struct file* filp) +{ return firegl_open(inode, filp); } +int ip_firegl_release(struct inode* inode, struct file* filp) +{ return firegl_release(inode, filp); } +int ip_firegl_ioctl(struct inode* inode, struct file* filp, unsigned int cmd, unsigned long arg) +{ return firegl_ioctl(inode, filp, cmd, arg); } +int ip_firegl_mmap(struct file* filp, struct vm_area_struct* vma) +{ return firegl_mmap(filp, vma); } + static struct file_operations firegl_fops = { #ifdef THIS_MODULE owner: THIS_MODULE, #endif - open: firegl_open, - release: firegl_release, - ioctl: firegl_ioctl, - mmap: firegl_mmap, + open: ip_firegl_open, + release: ip_firegl_release, + ioctl: ip_firegl_ioctl, + mmap: ip_firegl_mmap, }; typedef struct { @@ -672,7 +681,7 @@ typedef wait_queue_t* wait_queue_head_t; #endif -__ke_wait_queue_head_t* __ke_alloc_wait_queue_head_struct(void) +__ke_wait_queue_head_t* ATI_API_CALL __ke_alloc_wait_queue_head_struct(void) { __ke_wait_queue_head_t* queue_head; queue_head = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL); @@ -689,13 +698,13 @@ return queue_head; } -void __ke_free_wait_queue_head_struct(__ke_wait_queue_head_t* queue_head) +void ATI_API_CALL __ke_free_wait_queue_head_struct(__ke_wait_queue_head_t* queue_head) { if (queue_head) kfree(queue_head); } -__ke_wait_queue_t* __ke_alloc_wait_queue_struct(void) +__ke_wait_queue_t* ATI_API_CALL __ke_alloc_wait_queue_struct(void) { __ke_wait_queue_t* queue; queue = kmalloc(sizeof(wait_queue_t), GFP_KERNEL); @@ -703,18 +712,18 @@ return queue; } -void __ke_free_wait_queue_struct(__ke_wait_queue_t* queue) +void ATI_API_CALL __ke_free_wait_queue_struct(__ke_wait_queue_t* queue) { if (queue) kfree(queue); } -void __ke_wake_up_interruptible(__ke_wait_queue_head_t* queue_head) +void ATI_API_CALL __ke_wake_up_interruptible(__ke_wait_queue_head_t* queue_head) { wake_up_interruptible((wait_queue_head_t*)(void *)queue_head); } -void __ke_add_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) +void ATI_API_CALL __ke_add_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) { // initialisation (delayed) #ifdef __WAITQUEUE_INITIALIZER @@ -742,7 +751,7 @@ add_wait_queue((wait_queue_head_t*)(void *)queue_head, (wait_queue_t*)(void *)entry); } -void __ke_remove_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) +void ATI_API_CALL __ke_remove_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) { // current->state = TASK_RUNNING; remove_wait_queue((wait_queue_head_t*)(void *)queue_head, @@ -750,27 +759,27 @@ } // sheduler -void __ke_schedule(void) +void ATI_API_CALL __ke_schedule(void) { schedule(); } -int __ke_signal_pending(void) +int ATI_API_CALL __ke_signal_pending(void) { return signal_pending(current); } -void __ke_set_current_state_task_interruptible(void) +void ATI_API_CALL __ke_set_current_state_task_interruptible(void) { current->state = TASK_INTERRUPTIBLE; } -void __ke_set_current_state_task_running(void) +void ATI_API_CALL __ke_set_current_state_task_running(void) { current->state = TASK_RUNNING; } -void __ke_configure_sigmask(__ke_sigset_t *pSigMask) +void ATI_API_CALL __ke_configure_sigmask(__ke_sigset_t *pSigMask) { sigemptyset((sigset_t*)(void *)pSigMask); sigaddset((sigset_t*)(void *)pSigMask, SIGSTOP); @@ -779,14 +788,14 @@ sigaddset((sigset_t*)(void *)pSigMask, SIGTTOU); } -void __ke_block_all_signals(int (*notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask) +void ATI_API_CALL __ke_block_all_signals(int (*notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask) { #if LINUX_VERSION_CODE >= 0x020400 block_all_signals(notifier,pPriv,(sigset_t*)(void *)pSigMask); #endif } -void __ke_unblock_all_signals(void) +void ATI_API_CALL __ke_unblock_all_signals(void) { #if LINUX_VERSION_CODE >= 0x020400 unblock_all_signals(); @@ -828,7 +837,7 @@ #endif #if !defined(__ia64__) -unsigned long __ke__cmpxchg(volatile void *ptr, unsigned long old, +unsigned long ATI_API_CALL __ke__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) { #ifndef __HAVE_ARCH_CMPXCHG @@ -841,19 +850,19 @@ /*****************************************************************************/ -__ke_dev_t __ke_getdevice(__ke_device_t *dev) +__ke_dev_t ATI_API_CALL __ke_getdevice(__ke_device_t *dev) { return ((device_t*)dev)->device; } -const char* __ke_module_parm(void) +const char* ATI_API_CALL __ke_module_parm(void) { return firegl; } /*****************************************************************************/ -int __ke_inode_rdev_minor(struct inode* inode) +int ATI_API_CALL __ke_inode_rdev_minor(struct inode* inode) { #ifndef MINOR return minor(inode->i_rdev); @@ -864,27 +873,27 @@ /*****************************************************************************/ -void* __ke_get_file_priv(struct file* filp) +void* ATI_API_CALL __ke_get_file_priv(struct file* filp) { return filp->private_data; } -void __ke_set_file_priv(struct file* filp, void* private_data) +void ATI_API_CALL __ke_set_file_priv(struct file* filp, void* private_data) { filp->private_data = private_data; } -int __ke_file_excl_open(struct file* filp) +int ATI_API_CALL __ke_file_excl_open(struct file* filp) { return (filp->f_flags & O_EXCL) != 0; } -int __ke_file_rw_open(struct file* filp) +int ATI_API_CALL __ke_file_rw_open(struct file* filp) { return (filp->f_flags & 3) != 0; } -unsigned int __ke_file_counter(struct file *filp) +unsigned int ATI_API_CALL __ke_file_counter(struct file *filp) { #if LINUX_VERSION_CODE >= 0x020400 return filp->f_count.counter; @@ -895,24 +904,24 @@ /*****************************************************************************/ -int __ke_getpid(void) +int ATI_API_CALL __ke_getpid(void) { return current->pid; } -int __ke_geteuid(void) +int ATI_API_CALL __ke_geteuid(void) { return current->euid; } /*****************************************************************************/ -unsigned long __ke_jiffies(void) +unsigned long ATI_API_CALL __ke_jiffies(void) { return jiffies; } -void __ke_udelay(unsigned long usecs) // delay in usec +void ATI_API_CALL __ke_udelay(unsigned long usecs) // delay in usec { unsigned long start; unsigned long stop; @@ -948,7 +957,7 @@ udelay(usecs); /* delay value might get checked once again */ } -void __ke_mdelay(unsigned long msecs) // delay in msec +void ATI_API_CALL __ke_mdelay(unsigned long msecs) // delay in msec { mdelay(msecs); } @@ -956,33 +965,33 @@ /*****************************************************************************/ // TODO: These here get obsolete in future, use the ia64 code below // Johannes -unsigned long __ke_virt_to_bus(void* address) +unsigned long ATI_API_CALL __ke_virt_to_bus(void* address) { return virt_to_bus(address); } -unsigned long __ke_virt_to_phys(void* address) +unsigned long ATI_API_CALL __ke_virt_to_phys(void* address) { return virt_to_phys(address); } -void* __ke_high_memory(void) +void* ATI_API_CALL __ke_high_memory(void) { return high_memory; } -int __ke_pci_enable_device(__ke_pci_dev_t* dev) +int ATI_API_CALL __ke_pci_enable_device(__ke_pci_dev_t* dev) { return (pci_enable_device( (struct pci_dev*)(void *)dev )); } #if defined(__x86_64__) || defined(__ia64__) -void* __ke_pci_alloc_consistent(__ke_pci_dev_t* dev, int size, void *dma_handle) +void* ATI_API_CALL __ke_pci_alloc_consistent(__ke_pci_dev_t* dev, int size, void *dma_handle) { return (pci_alloc_consistent( (struct pci_dev*)(void *)dev, size, dma_handle)); } -void __ke_pci_free_consistent(__ke_pci_dev_t* dev, int size, unsigned long cpu_addr, +void ATI_API_CALL __ke_pci_free_consistent(__ke_pci_dev_t* dev, int size, unsigned long cpu_addr, unsigned int dma_handle) { pci_free_consistent( (struct pci_dev*)(void *)dev, size, (void *)cpu_addr, @@ -992,7 +1001,7 @@ /*****************************************************************************/ -int __ke_error_code(enum __ke_error_num errcode) +int ATI_API_CALL __ke_error_code(enum __ke_error_num errcode) { switch (errcode) { @@ -1027,7 +1036,7 @@ /*****************************************************************************/ -void __ke_mod_inc_use_count(void) +void ATI_API_CALL __ke_mod_inc_use_count(void) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) __module_get(THIS_MODULE); @@ -1036,7 +1045,7 @@ #endif } -void __ke_mod_dec_use_count(void) +void ATI_API_CALL __ke_mod_dec_use_count(void) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) module_put(THIS_MODULE); @@ -1047,86 +1056,86 @@ /*****************************************************************************/ -void __ke_down_struct_sem(__ke_device_t *dev, int index) +void ATI_API_CALL __ke_down_struct_sem(__ke_device_t *dev, int index) { down(&(((device_t*)dev)->struct_sem[index])); } -void __ke_up_struct_sem(__ke_device_t *dev, int index) +void ATI_API_CALL __ke_up_struct_sem(__ke_device_t *dev, int index) { up(&(((device_t*)dev)->struct_sem[index])); } -void __ke_sema_init(struct semaphore* sem, int value) +void ATI_API_CALL __ke_sema_init(struct semaphore* sem, int value) { sema_init(sem, value); } -__ke_size_t __ke_sema_size(void) +__ke_size_t ATI_API_CALL __ke_sema_size(void) { return sizeof(struct semaphore); } -void __ke_down(struct semaphore* sem) +void ATI_API_CALL __ke_down(struct semaphore* sem) { down(sem); } -void __ke_up(struct semaphore* sem) +void ATI_API_CALL __ke_up(struct semaphore* sem) { up(sem); } /*****************************************************************************/ -void __ke_atomic_inc(void* v) +void ATI_API_CALL __ke_atomic_inc(void* v) { atomic_inc((atomic_t*)v); } -void __ke_atomic_dec(void* v) +void ATI_API_CALL __ke_atomic_dec(void* v) { atomic_dec((atomic_t*)v); } -void __ke_atomic_add(int val, void* v) +void ATI_API_CALL __ke_atomic_add(int val, void* v) { atomic_add(val, (atomic_t*)v); } -void __ke_atomic_sub(int val, void* v) +void ATI_API_CALL __ke_atomic_sub(int val, void* v) { atomic_sub(val, (atomic_t*)v); } -int __ke_atomic_read(void* v) +int ATI_API_CALL __ke_atomic_read(void* v) { return atomic_read((atomic_t*)v); } -void __ke_atomic_set(void* v, int val) +void ATI_API_CALL __ke_atomic_set(void* v, int val) { atomic_set((atomic_t*)v, val); } /*****************************************************************************/ -void __ke_spin_lock(__ke_device_t *dev, int ndx) +void ATI_API_CALL __ke_spin_lock(__ke_device_t *dev, int ndx) { spin_lock(&(((device_t*)dev)->spinlock[ndx])); } -void __ke_spin_unlock(__ke_device_t *dev __attribute__((unused)), int ndx __attribute__((unused))) +void ATI_API_CALL __ke_spin_unlock(__ke_device_t *dev __attribute__((unused)), int ndx __attribute__((unused))) { spin_unlock(&(((device_t*)dev)->spinlock[ndx])); } -void __ke_lock_kernel(void) +void ATI_API_CALL __ke_lock_kernel(void) { lock_kernel(); } -void __ke_unlock_kernel(void) +void ATI_API_CALL __ke_unlock_kernel(void) { unlock_kernel(); } @@ -1141,7 +1150,7 @@ typedef int (*PFNMUNLOCK)(unsigned long start, __ke_size_t len); -int __ke_sys_mlock(unsigned long start, __ke_size_t len) +int ATI_API_CALL __ke_sys_mlock(unsigned long start, __ke_size_t len) { #ifdef FGL_USE_SCT PFNMLOCK sys_mlock = (PFNMLOCK)sys_call_table[__NR_mlock]; @@ -1156,7 +1165,7 @@ #endif } -int __ke_sys_munlock(unsigned long start, __ke_size_t len) +int ATI_API_CALL __ke_sys_munlock(unsigned long start, __ke_size_t len) { #ifdef FGL_USE_SCT PFNMUNLOCK sys_munlock = (PFNMUNLOCK)sys_call_table[__NR_munlock]; @@ -1174,7 +1183,7 @@ typedef int (*PFNMODIFYLDT)(int func, void *ptr, unsigned long bytecount); -int __ke_sys_modify_ldt(int func, void *ptr, unsigned long bytecount) +int ATI_API_CALL __ke_sys_modify_ldt(int func, void *ptr, unsigned long bytecount) { #ifdef FGL_USE_SCT PFNMODIFYLDT sys_modify_ldt = (PFNMODIFYLDT)sys_call_table[__NR_modify_ldt]; @@ -1199,7 +1208,7 @@ #ifdef __KE_NO_VSPRINTF #if LINUX_VERSION_CODE >= 0x020400 -void __ke_printk(const char* fmt, ...) +void ATI_API_CALL __ke_printk(const char* fmt, ...) { char buffer[256]; va_list marker; @@ -1230,7 +1239,7 @@ #else -void __ke_print_info(const char* fmt, ...) +void ATI_API_CALL __ke_print_info(const char* fmt, ...) { char msg[256] = KERN_INFO;: va_list marker; @@ -1240,7 +1249,7 @@ va_end(marker); } -void __ke_print_error(const char* fmt, ...) +void ATI_API_CALL __ke_print_error(const char* fmt, ...) { char msg[256] = KERN_ERR; va_list marker; @@ -1250,7 +1259,7 @@ va_end(marker); } -void __ke_print_debug(const char* fmt, ...) +void ATI_API_CALL __ke_print_debug(const char* fmt, ...) { char msg[256] = KERN_DEBUG; va_list marker; @@ -1264,7 +1273,7 @@ /*****************************************************************************/ -int __ke_capable(enum __ke_cap cap) +int ATI_API_CALL __ke_capable(enum __ke_cap cap) { switch (cap) { @@ -1280,7 +1289,7 @@ return capable(cap); } -void __ke_cap_effective_raise(enum __ke_cap cap) +void ATI_API_CALL __ke_cap_effective_raise(enum __ke_cap cap) { switch (cap) { @@ -1296,17 +1305,17 @@ cap_raise(current->cap_effective, cap); } -__ke_u32 __ke_get_cap_effective() +__ke_u32 ATI_API_CALL __ke_get_cap_effective() { return cap_t(current->cap_effective); } -void __ke_set_cap_effective(__ke_u32 cap) +void ATI_API_CALL __ke_set_cap_effective(__ke_u32 cap) { cap_t(current->cap_effective) = cap; } -unsigned long __ke_ram_available(void) +unsigned long ATI_API_CALL __ke_ram_available(void) { struct sysinfo si; @@ -1319,22 +1328,22 @@ #endif } -int __ke_copy_from_user(void* to, const void* from, __ke_size_t size) +int ATI_API_CALL __ke_copy_from_user(void* to, const void* from, __ke_size_t size) { return copy_from_user(to, from, size); } -int __ke_copy_to_user(void* to, const void* from, __ke_size_t size) +int ATI_API_CALL __ke_copy_to_user(void* to, const void* from, __ke_size_t size) { return copy_to_user(to, from, size); } -int __ke_verify_area(int type, const void * addr, unsigned long size) +int ATI_API_CALL __ke_verify_area(int type, const void * addr, unsigned long size) { return verify_area(type, addr, size); } -int __ke_get_pci_device_info(__ke_pci_dev_t* dev, __ke_pci_device_info_t *pinfo) +int ATI_API_CALL __ke_get_pci_device_info(__ke_pci_dev_t* dev, __ke_pci_device_info_t *pinfo) { if ( dev ) { @@ -1346,7 +1355,7 @@ return -EINVAL; } -int __ke_check_pci(int busnum, int devnum, int funcnum, __ke_u16* vendor, __ke_u16* device, unsigned int* irq) +int ATI_API_CALL __ke_check_pci(int busnum, int devnum, int funcnum, __ke_u16* vendor, __ke_u16* device, unsigned int* irq) { struct pci_dev* pci_dev; @@ -1366,7 +1375,7 @@ return 1; } -int __ke_pci_get_irq(__ke_pci_dev_t *dev, unsigned int* irq) +int ATI_API_CALL __ke_pci_get_irq(__ke_pci_dev_t *dev, unsigned int* irq) { if (!dev) return 0; @@ -1377,52 +1386,52 @@ return 1; } -__ke_pci_dev_t* __ke_pci_find_device (unsigned int vendor, unsigned int dev, __ke_pci_dev_t* from) +__ke_pci_dev_t* ATI_API_CALL __ke_pci_find_device (unsigned int vendor, unsigned int dev, __ke_pci_dev_t* from) { return (__ke_pci_dev_t*)pci_find_device( vendor, dev, (struct pci_dev *)(void *)from ); } -void* __ke_malloc(__ke_size_t size) +void* ATI_API_CALL __ke_malloc(__ke_size_t size) { return kmalloc(size, GFP_KERNEL); } -void __ke_free_s(void* p, __ke_size_t size) +void ATI_API_CALL __ke_free_s(void* p, __ke_size_t size) { kfree(p); } -void* __ke_vmalloc(__ke_size_t size) +void* ATI_API_CALL __ke_vmalloc(__ke_size_t size) { return vmalloc(size); } -void __ke_vfree(void* p) +void ATI_API_CALL __ke_vfree(void* p) { return vfree(p); } -void* __ke_get_free_page(void) +void* ATI_API_CALL __ke_get_free_page(void) { return (void*)__get_free_page(GFP_KERNEL); } -void* __ke_get_free_pages(int order) +void* ATI_API_CALL __ke_get_free_pages(int order) { return (void*)__get_free_pages(GFP_KERNEL, order); } -void __ke_free_page(void* pt) +void ATI_API_CALL __ke_free_page(void* pt) { free_page((unsigned long)pt); } -void __ke_free_pages(void* pt, int order) +void ATI_API_CALL __ke_free_pages(void* pt, int order) { free_pages((unsigned long)pt, order); } -void __ke_mem_map_reserve(void* pt) +void ATI_API_CALL __ke_mem_map_reserve(void* pt) { #if LINUX_VERSION_CODE < 0x020400 mem_map_reserve(MAP_NR((unsigned long)pt)); @@ -1435,7 +1444,7 @@ #endif } -void __ke_mem_map_unreserve(void* pt) +void ATI_API_CALL __ke_mem_map_unreserve(void* pt) { #if LINUX_VERSION_CODE < 0x020400 mem_map_unreserve(MAP_NR((unsigned long)pt)); @@ -1448,7 +1457,7 @@ #endif } -void __ke_virt_reserve(void* virt) +void ATI_API_CALL __ke_virt_reserve(void* virt) { #if LINUX_VERSION_CODE < 0x020400 set_bit(PG_reserved, @@ -1459,7 +1468,7 @@ #endif } -void __ke_virt_unreserve(void* virt) +void ATI_API_CALL __ke_virt_unreserve(void* virt) { #if LINUX_VERSION_CODE < 0x020400 clear_bit(PG_reserved, @@ -1471,48 +1480,48 @@ } #ifdef __ia64__ -void* __ke_get_vmptr( struct _agp_memory* memory ) +void* ATI_API_CALL __ke_get_vmptr( struct _agp_memory* memory ) { return memory->vmptr; } #endif -void* __ke_ioremap(unsigned long offset, unsigned long size) +void* ATI_API_CALL __ke_ioremap(unsigned long offset, unsigned long size) { return ioremap(offset, size); } -void* __ke_ioremap_nocache(unsigned long offset, unsigned long size) +void* ATI_API_CALL __ke_ioremap_nocache(unsigned long offset, unsigned long size) { return ioremap_nocache(offset, size); } -void __ke_iounmap(void* pt) +void ATI_API_CALL __ke_iounmap(void* pt) { iounmap(pt); } -int __ke_verify_read_access(void* addr, __ke_size_t size) +int ATI_API_CALL __ke_verify_read_access(void* addr, __ke_size_t size) { return access_ok(VERIFY_READ, addr, size) ? 0 : -EFAULT; } -int __ke_verify_write_access(void* addr, __ke_size_t size) +int ATI_API_CALL __ke_verify_write_access(void* addr, __ke_size_t size) { return access_ok(VERIFY_WRITE, addr, size) ? 0 : -EFAULT; } -struct mm_struct* __ke_init_mm(void) +struct mm_struct* ATI_API_CALL __ke_init_mm(void) { return &init_mm; } -struct mm_struct* __ke_current_mm(void) +struct mm_struct* ATI_API_CALL __ke_current_mm(void) { return current->mm; } -unsigned long __ke_get_vm_phys_addr(struct mm_struct* mm, unsigned long virtual_addr) +unsigned long ATI_API_CALL __ke_get_vm_phys_addr(struct mm_struct* mm, unsigned long virtual_addr) { unsigned long pte_linear; pgd_t* pgd_p; @@ -1547,7 +1556,7 @@ #endif /* LINUX_VERSION_CODE < 0x020400 */ } -unsigned long* __ke_get_vm_phys_addr_list(struct mm_struct* mm, unsigned long virtual_addr, unsigned long pages) +unsigned long* ATI_API_CALL __ke_get_vm_phys_addr_list(struct mm_struct* mm, unsigned long virtual_addr, unsigned long pages) { unsigned long *phys_table, *pt; unsigned long n, va; @@ -1569,42 +1578,42 @@ return phys_table; } -void* __ke_memset(void* s, int c, __ke_size_t count) +void* ATI_API_CALL __ke_memset(void* s, int c, __ke_size_t count) { return memset(s, c, count); } -void* __ke_memcpy(void* d, const void* s, __ke_size_t count) +void* ATI_API_CALL __ke_memcpy(void* d, const void* s, __ke_size_t count) { return memcpy(d, s, count); } -__ke_size_t __ke_strlen(const char *s) +__ke_size_t ATI_API_CALL __ke_strlen(const char *s) { return strlen(s); } -char* __ke_strcpy(char* d, const char* s) +char* ATI_API_CALL __ke_strcpy(char* d, const char* s) { return strcpy(d, s); } -char* __ke_strncpy(char* d, const char* s, __ke_size_t count) +char* ATI_API_CALL __ke_strncpy(char* d, const char* s, __ke_size_t count) { return strncpy(d, s, count); } -int __ke_strcmp(const char* string1, const char* string2) +int ATI_API_CALL __ke_strcmp(const char* string1, const char* string2) { return strcmp(string1, string2); } -int __ke_strncmp(const char* string1, const char* string2, __ke_size_t count) +int ATI_API_CALL __ke_strncmp(const char* string1, const char* string2, __ke_size_t count) { return strncmp(string1, string2, count); } -int __ke_sprintf(char* buf, const char* fmt, ...) +int ATI_API_CALL __ke_sprintf(char* buf, const char* fmt, ...) { va_list marker; @@ -1617,12 +1626,12 @@ /*****************************************************************************/ -void __ke_set_bit(int nr, volatile void * addr) +void ATI_API_CALL __ke_set_bit(int nr, volatile void * addr) { set_bit(nr, addr); } -void __ke_clear_bit(int nr, volatile void * addr) +void ATI_API_CALL __ke_clear_bit(int nr, volatile void * addr) { clear_bit(nr, addr); } @@ -1647,7 +1656,7 @@ } #endif /* __SMP__ */ -int __ke_flush_cache(void) +int ATI_API_CALL __ke_flush_cache(void) { #ifdef __SMP__ #if LINUX_VERSION_CODE < 0x020501 @@ -1683,7 +1692,7 @@ /*****************************************************************************/ -int __ke_config_mtrr(void) +int ATI_API_CALL __ke_config_mtrr(void) { #ifdef CONFIG_MTRR return 1; @@ -1692,7 +1701,7 @@ #endif /* !CONFIG_MTRR */ } -int __ke_mtrr_add_wc(unsigned long base, unsigned long size) +int ATI_API_CALL __ke_mtrr_add_wc(unsigned long base, unsigned long size) { #ifdef CONFIG_MTRR return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); @@ -1701,7 +1710,7 @@ #endif /* !CONFIG_MTRR */ } -int __ke_mtrr_del(int reg, unsigned long base, unsigned long size) +int ATI_API_CALL __ke_mtrr_del(int reg, unsigned long base, unsigned long size) { #ifdef CONFIG_MTRR return mtrr_del(reg, base, size); @@ -1712,64 +1721,64 @@ /*****************************************************************************/ -int __ke_pci_read_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 *val) +int ATI_API_CALL __ke_pci_read_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 *val) { return pci_read_config_byte((struct pci_dev*)(void *)dev, where, val); } -int __ke_pci_read_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 *val) +int ATI_API_CALL __ke_pci_read_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 *val) { return pci_read_config_word((struct pci_dev*)(void *)dev, where, val); } -int __ke_pci_read_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 *val) +int ATI_API_CALL __ke_pci_read_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 *val) { return pci_read_config_dword((struct pci_dev*)(void *)dev, where, val); } -int __ke_pci_write_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 val) +int ATI_API_CALL __ke_pci_write_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 val) { return pci_write_config_byte((struct pci_dev*)(void *)dev, where, val); } -int __ke_pci_write_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 val) +int ATI_API_CALL __ke_pci_write_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 val) { return pci_write_config_word((struct pci_dev*)(void *)dev, where, val); } -int __ke_pci_write_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 val) +int ATI_API_CALL __ke_pci_write_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 val) { return pci_write_config_dword((struct pci_dev*)(void *)dev, where, val); } /*****************************************************************************/ -void __ke_outb(unsigned char value, unsigned short port) +void ATI_API_CALL __ke_outb(unsigned char value, unsigned short port) { outb(value, port); } -void __ke_outw(unsigned short value, unsigned short port) +void ATI_API_CALL __ke_outw(unsigned short value, unsigned short port) { outw(value, port); } -void __ke_outl(unsigned int value, unsigned short port) +void ATI_API_CALL __ke_outl(unsigned int value, unsigned short port) { outl(value, port); } -char __ke_inb(unsigned short port) +char ATI_API_CALL __ke_inb(unsigned short port) { return inb(port); } -short __ke_inw(unsigned short port) +short ATI_API_CALL __ke_inw(unsigned short port) { return inw(port); } -int __ke_inl(unsigned short port) +int ATI_API_CALL __ke_inl(unsigned short port) { return inl(port); } @@ -1777,18 +1786,18 @@ /*****************************************************************************/ // Interrupt support -void __ke_enable_irq(int irq) +void ATI_API_CALL __ke_enable_irq(int irq) { enable_irq( irq ); } -void __ke_disable_irq(int irq) +void ATI_API_CALL __ke_disable_irq(int irq) { disable_irq( irq ); } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) -int __ke_request_irq(unsigned int irq, +int ATI_API_CALL __ke_request_irq(unsigned int irq, void (*handler)(int, void *, void *), const char *dev_name, void *dev_id) { @@ -1797,7 +1806,7 @@ SA_SHIRQ, dev_name, dev_id); } -void __ke_free_irq(unsigned int irq, void *dev_id) +void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id) { free_irq(irq, dev_id); } @@ -1810,7 +1819,7 @@ return IRQ_HANDLED; } -int __ke_request_irq(unsigned int irq, +int ATI_API_CALL __ke_request_irq(unsigned int irq, void (*handler)(int, void *, void *), const char *dev_name, void *dev_id) { @@ -1820,7 +1829,7 @@ SA_SHIRQ, dev_name, dev_id); } -void __ke_free_irq(unsigned int irq, void *dev_id) +void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id) { free_irq(irq, dev_id); irq_handler_func = NULL; @@ -2186,22 +2195,22 @@ #endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) */ -void* __ke_vma_file_priv(struct vm_area_struct* vma) +void* ATI_API_CALL __ke_vma_file_priv(struct vm_area_struct* vma) { return vma->vm_file->private_data; } -unsigned long __ke_vm_start(struct vm_area_struct* vma) +unsigned long ATI_API_CALL __ke_vm_start(struct vm_area_struct* vma) { return vma->vm_start; } -unsigned long __ke_vm_end(struct vm_area_struct* vma) +unsigned long ATI_API_CALL __ke_vm_end(struct vm_area_struct* vma) { return vma->vm_end; } -unsigned long __ke_vm_offset(struct vm_area_struct* vma) +unsigned long ATI_API_CALL __ke_vm_offset(struct vm_area_struct* vma) { #if LINUX_VERSION_CODE < 0x020319 return vma->vm_offset; @@ -2210,7 +2219,7 @@ #endif/* LINUX_VERSION_CODE >= 0x020319 */ } -char* __ke_vm_flags_str(struct vm_area_struct* vma, char* buf) +char* ATI_API_CALL __ke_vm_flags_str(struct vm_area_struct* vma, char* buf) { *(buf + 0) = vma->vm_flags & VM_READ ? 'r' : '-'; *(buf + 1) = vma->vm_flags & VM_WRITE ? 'w' : '-'; @@ -2222,7 +2231,7 @@ return buf; } -char* __ke_vm_page_prot_str(struct vm_area_struct* vma, char* buf) +char* ATI_API_CALL __ke_vm_page_prot_str(struct vm_area_struct* vma, char* buf) { int i = 0; @@ -2249,7 +2258,7 @@ return buf; } -char* __ke_vm_phys_addr_str(struct vm_area_struct* vma, +char* ATI_API_CALL __ke_vm_phys_addr_str(struct vm_area_struct* vma, char* buf, unsigned long virtual_addr, unsigned long* phys_address) @@ -2302,11 +2311,16 @@ return buf; } +void ip_drm_vm_open(struct vm_area_struct* vma) +{ drm_vm_open(vma); } +void ip_drm_vm_close(struct vm_area_struct* vma) +{ drm_vm_close(vma); } + static struct vm_operations_struct vm_ops = { nopage: vm_nopage, - open: drm_vm_open, - close: drm_vm_close, + open: ip_drm_vm_open, + close: ip_drm_vm_close, }; #ifdef __AGP__BUILTIN__ @@ -2314,8 +2328,8 @@ static struct vm_operations_struct vm_cant_ops = { nopage: vm_cant_nopage, - open: drm_vm_open, - close: drm_vm_close, + open: ip_drm_vm_open, + close: ip_drm_vm_close, }; #endif /* __ia64_ */ #endif /* __AGP__BUILTIN__ */ @@ -2323,22 +2337,22 @@ static struct vm_operations_struct vm_shm_ops = { nopage: vm_shm_nopage, - open: drm_vm_open, - close: drm_vm_close, + open: ip_drm_vm_open, + close: ip_drm_vm_close, }; static struct vm_operations_struct vm_pci_bq_ops = { nopage: vm_dma_nopage, - open: drm_vm_open, - close: drm_vm_close, + open: ip_drm_vm_open, + close: ip_drm_vm_close, }; static struct vm_operations_struct vm_ctx_ops = { nopage: vm_dma_nopage, - open: drm_vm_open, - close: drm_vm_close, + open: ip_drm_vm_open, + close: ip_drm_vm_close, }; #ifdef __AGP__BUILTIN__ @@ -2346,20 +2360,20 @@ static struct vm_operations_struct vm_agp_bq_ops = { nopage: vm_nopage, - open: drm_vm_open, - close: drm_vm_close, + open: ip_drm_vm_open, + close: ip_drm_vm_close, }; #else static struct vm_operations_struct vm_cant_agp_bq_ops = { nopage: vm_cant_nopage, - open: drm_vm_open, - close: drm_vm_close, + open: ip_drm_vm_open, + close: ip_drm_vm_close, }; #endif /* __ia64_ */ #endif /* __AGP__BUILTIN__ */ -int __ke_vm_map(struct file* filp, +int ATI_API_CALL __ke_vm_map(struct file* filp, struct vm_area_struct* vma, enum __ke_vm_maptype type, int readonly) @@ -2638,7 +2652,7 @@ #endif // !USE_FIREGL_AGPGART_IMPLEMENTATION static -int __ke_firegl_agpgart_available(void) +int ATI_API_CALL __ke_firegl_agpgart_available(void) { int retval; @@ -2661,7 +2675,7 @@ } static -int __ke_agpgart_available(void) +int ATI_API_CALL __ke_agpgart_available(void) { #ifdef __AGP__ unsigned int found = 0; @@ -2769,7 +2783,7 @@ return 0; /* failed */ } -int __ke_agp_available(int use_internal) +int ATI_API_CALL __ke_agp_available(int use_internal) { int available = 0; @@ -2785,7 +2799,7 @@ return available; } -void __ke_agp_uninit(void) +void ATI_API_CALL __ke_agp_uninit(void) { if (firegl_agp) { @@ -2814,7 +2828,7 @@ } #ifdef FGL -struct _agp_memory* __ke_agp_allocate_memory_phys_list(__ke_size_t pages, unsigned long type, unsigned long * phys_addr) +struct _agp_memory* ATI_API_CALL __ke_agp_allocate_memory_phys_list(__ke_size_t pages, unsigned long type, unsigned long * phys_addr) { #if 0 #ifdef __AGP__ @@ -2828,7 +2842,7 @@ } #endif -void __ke_agp_free_memory(struct _agp_memory* handle) +void ATI_API_CALL __ke_agp_free_memory(struct _agp_memory* handle) { #ifdef __AGP__ if (AGP_AVAILABLE(free_memory)) @@ -2838,7 +2852,7 @@ return FIREGL_agp_free_memory((FIREGL_agp_memory*)handle); } -struct _agp_memory* __ke_agp_allocate_memory(__ke_size_t pages, unsigned long type) +struct _agp_memory* ATI_API_CALL __ke_agp_allocate_memory(__ke_size_t pages, unsigned long type) { #ifdef __AGP__ if (AGP_AVAILABLE(allocate_memory)) @@ -2849,7 +2863,7 @@ return NULL; } -int __ke_agp_bind_memory(struct _agp_memory* handle, __ke_off_t start) +int ATI_API_CALL __ke_agp_bind_memory(struct _agp_memory* handle, __ke_off_t start) { #ifdef __AGP__ if (AGP_AVAILABLE(bind_memory)) @@ -2860,7 +2874,7 @@ return -EINVAL; } -int __ke_agp_unbind_memory(struct _agp_memory* handle) +int ATI_API_CALL __ke_agp_unbind_memory(struct _agp_memory* handle) { #ifdef __AGP__ if (AGP_AVAILABLE(unbind_memory)) @@ -2871,7 +2885,7 @@ return -EINVAL; } -int __ke_agp_enable(unsigned long mode) +int ATI_API_CALL __ke_agp_enable(unsigned long mode) { #ifdef __AGP__ if (AGP_AVAILABLE(enable)) @@ -2888,7 +2902,7 @@ return -EINVAL; } -int __ke_read_agp_caps_registers(__ke_pci_dev_t* dev, unsigned int *caps) +int ATI_API_CALL __ke_read_agp_caps_registers(__ke_pci_dev_t* dev, unsigned int *caps) { u8 capndx; u32 cap_id; @@ -2919,7 +2933,7 @@ return -ENODATA; } -int __ke_agp_acquire(void) +int ATI_API_CALL __ke_agp_acquire(void) { #ifdef __AGP__ if (AGP_AVAILABLE(acquire)) @@ -2930,7 +2944,7 @@ return -EINVAL; } -void __ke_agp_release(void) +void ATI_API_CALL __ke_agp_release(void) { #ifdef __AGP__ if (AGP_AVAILABLE(release)) @@ -2940,7 +2954,7 @@ FIREGL_agp_backend_release(); } -void __ke_agp_copy_info(__ke_agp_kern_info_t* info) +void ATI_API_CALL __ke_agp_copy_info(__ke_agp_kern_info_t* info) { struct pci_dev *device = NULL; @@ -3027,7 +3041,7 @@ } } -unsigned long __ke_agp_memory_handle(struct _agp_memory* handle) +unsigned long ATI_API_CALL __ke_agp_memory_handle(struct _agp_memory* handle) { if (firegl_agp) #ifdef USE_FIREGL_AGPGART_IMPLEMENTATION @@ -3043,7 +3057,7 @@ #endif /* !__AGP__ */ } -unsigned long __ke_agp_memory_page_count(struct _agp_memory* handle) +unsigned long ATI_API_CALL __ke_agp_memory_page_count(struct _agp_memory* handle) { if (firegl_agp) #ifdef USE_FIREGL_AGPGART_IMPLEMENTATION @@ -3059,13 +3073,13 @@ #endif /* !__AGP__ */ } -int __ke_smp_processor_id(void) +int ATI_API_CALL __ke_smp_processor_id(void) { return (int)(smp_processor_id()); } -void __ke_smp_call_function( void (*func)(void *info) ) +void ATI_API_CALL __ke_smp_call_function( void (*func)(void *info) ) { smp_call_function( func, NULL, 0, 1 ); } @@ -3095,7 +3109,7 @@ return 0; // does not match } -int __ke_is_athlon(void) +int ATI_API_CALL __ke_is_athlon(void) { register int bAthlon; __asm @@ -3182,7 +3196,7 @@ #endif -int __ke_amd_adv_spec_cache_feature(void) +int ATI_API_CALL __ke_amd_adv_spec_cache_feature(void) { #if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)) ) /* the kernel already does provide a fix for the AMD Athlon @@ -3224,7 +3238,7 @@ return 0; } -int __ke_has_PSE(void) +int ATI_API_CALL __ke_has_PSE(void) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) if (test_bit(X86_FEATURE_PSE, &boot_cpu_data.x86_capability)) diff -ur build_mod.old/firegl_public.h build_mod/firegl_public.h --- build_mod.old/firegl_public.h 2004-03-17 23:00:29.000000000 +0100 +++ build_mod/firegl_public.h 2004-05-29 20:51:19.698472520 +0200 @@ -75,7 +75,7 @@ typedef struct { int uniqe4; } __ke_pci_dev_t; typedef struct { int uniqe5; } __ke_priv_device_t; -typedef int (*__ke_read_proc_t)( +typedef int (*ATI_API_CALL __ke_read_proc_t)( char* page, char** start, __ke_off_t off, int count, int* eof, void* data); typedef struct { @@ -123,7 +123,7 @@ extern unsigned long ATI_API_CALL firegl_get_virt_agp_mem( void *pt, unsigned long baddr, struct vm_area_struct* vma ); -extern struct ATI_API_CALL drm_agp_mem* firegl_get_agpmem_from_drmmap(struct drm_device* dev, +extern struct drm_agp_mem* ATI_API_CALL firegl_get_agpmem_from_drmmap(struct drm_device* dev, struct drm_map *p_drmmap, unsigned long baddr); extern int ATI_API_CALL firegl_cant_use_agp(void *pt); @@ -133,25 +133,25 @@ /*****************************************************************************/ -extern __ke_wait_queue_head_t* __ke_alloc_wait_queue_head_struct(void); -extern void __ke_free_wait_queue_head_struct(__ke_wait_queue_head_t* queue_head); -extern __ke_wait_queue_t* __ke_alloc_wait_queue_struct(void); -extern void __ke_free_wait_queue_struct(__ke_wait_queue_t* queue); - -extern void __ke_wake_up_interruptible(__ke_wait_queue_head_t* queue_head); -extern void __ke_add_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry); -extern void __ke_remove_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry); - -extern void __ke_schedule(void); -extern int __ke_signal_pending(void); - -extern void __ke_set_current_state_task_interruptible(void); -extern void __ke_set_current_state_task_running(void); -extern void __ke_configure_sigmask(__ke_sigset_t *pSigMask); -extern void __ke_block_all_signals(int (*notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask); -extern void __ke_unblock_all_signals(void); +extern __ke_wait_queue_head_t* ATI_API_CALL __ke_alloc_wait_queue_head_struct(void); +extern void ATI_API_CALL __ke_free_wait_queue_head_struct(__ke_wait_queue_head_t* queue_head); +extern __ke_wait_queue_t* ATI_API_CALL __ke_alloc_wait_queue_struct(void); +extern void ATI_API_CALL __ke_free_wait_queue_struct(__ke_wait_queue_t* queue); + +extern void ATI_API_CALL __ke_wake_up_interruptible(__ke_wait_queue_head_t* queue_head); +extern void ATI_API_CALL __ke_add_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry); +extern void ATI_API_CALL __ke_remove_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry); + +extern void ATI_API_CALL __ke_schedule(void); +extern int ATI_API_CALL __ke_signal_pending(void); + +extern void ATI_API_CALL __ke_set_current_state_task_interruptible(void); +extern void ATI_API_CALL __ke_set_current_state_task_running(void); +extern void ATI_API_CALL __ke_configure_sigmask(__ke_sigset_t *pSigMask); +extern void ATI_API_CALL __ke_block_all_signals(int (*notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask); +extern void ATI_API_CALL __ke_unblock_all_signals(void); -extern unsigned long __ke__cmpxchg(volatile void *ptr, unsigned long old, +extern unsigned long ATI_API_CALL __ke__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size); #define __ke_cmpxchg(ptr,o,n) \ @@ -160,25 +160,25 @@ /*****************************************************************************/ -extern __ke_dev_t __ke_getdevice(__ke_device_t *dev); -extern const char* __ke_module_parm(void); -extern int __ke_inode_rdev_minor(struct inode* inode); -extern void* __ke_get_file_priv(struct file* filp); -extern void __ke_set_file_priv(struct file* filp, void* private_data); -extern int __ke_file_excl_open(struct file* filp); -extern int __ke_file_rw_open(struct file* filp); -extern unsigned int __ke_file_counter(struct file* filp); -extern int __ke_getpid(void); -extern int __ke_geteuid(void); -extern unsigned long __ke_jiffies(void); -extern void __ke_udelay(unsigned long usecs); -extern void __ke_mdelay(unsigned long msecs); -extern unsigned long __ke_virt_to_bus(void* address); -extern unsigned long __ke_virt_to_phys(void* address); -extern void* __ke_high_memory(void); +extern __ke_dev_t ATI_API_CALL __ke_getdevice(__ke_device_t *dev); +extern const char* ATI_API_CALL __ke_module_parm(void); +extern int ATI_API_CALL __ke_inode_rdev_minor(struct inode* inode); +extern void* ATI_API_CALL __ke_get_file_priv(struct file* filp); +extern void ATI_API_CALL __ke_set_file_priv(struct file* filp, void* private_data); +extern int ATI_API_CALL __ke_file_excl_open(struct file* filp); +extern int ATI_API_CALL __ke_file_rw_open(struct file* filp); +extern unsigned int ATI_API_CALL __ke_file_counter(struct file* filp); +extern int ATI_API_CALL __ke_getpid(void); +extern int ATI_API_CALL __ke_geteuid(void); +extern unsigned long ATI_API_CALL __ke_jiffies(void); +extern void ATI_API_CALL __ke_udelay(unsigned long usecs); +extern void ATI_API_CALL __ke_mdelay(unsigned long msecs); +extern unsigned long ATI_API_CALL __ke_virt_to_bus(void* address); +extern unsigned long ATI_API_CALL __ke_virt_to_phys(void* address); +extern void* ATI_API_CALL __ke_high_memory(void); #if defined(__x86_64__) || defined(__ia64__) -void* __ke_pci_alloc_consistent(__ke_pci_dev_t* dev, int size, void *dma_handle); -void __ke_pci_free_consistent(__ke_pci_dev_t* dev, int size, unsigned long cpu_addr, +void* ATI_API_CALL __ke_pci_alloc_consistent(__ke_pci_dev_t* dev, int size, void *dma_handle); +void ATI_API_CALL __ke_pci_free_consistent(__ke_pci_dev_t* dev, int size, unsigned long cpu_addr, unsigned int dma_handle); #endif @@ -198,39 +198,39 @@ __KE_ERESTARTSYS, __KE_ELIBBAD, }; -extern int __ke_error_code(enum __ke_error_num errcode); +extern int ATI_API_CALL __ke_error_code(enum __ke_error_num errcode); -extern void __ke_mod_inc_use_count(void); -extern void __ke_mod_dec_use_count(void); +extern void ATI_API_CALL __ke_mod_inc_use_count(void); +extern void ATI_API_CALL __ke_mod_dec_use_count(void); -extern void __ke_down_struct_sem(__ke_device_t *dev, int idx); -extern void __ke_up_struct_sem(__ke_device_t *dev, int idx); +extern void ATI_API_CALL __ke_down_struct_sem(__ke_device_t *dev, int idx); +extern void ATI_API_CALL __ke_up_struct_sem(__ke_device_t *dev, int idx); #define __KE_MAX_SEMAPHORES 2 -extern void __ke_sema_init(struct semaphore* sem, int value); -extern __ke_size_t __ke_sema_size(void); -extern void __ke_down(struct semaphore* sem); -extern void __ke_up(struct semaphore* sem); -extern void __ke_atomic_inc(void* v); -extern void __ke_atomic_dec(void* v); -extern void __ke_atomic_add(int val, void* v); -extern void __ke_atomic_sub(int val, void* v); -extern int __ke_atomic_read(void* v); -extern void __ke_atomic_set(void* v, int val); -extern void __ke_spin_lock(__ke_device_t *dev, int ndx); -extern void __ke_spin_unlock(__ke_device_t *dev, int ndx); +extern void ATI_API_CALL __ke_sema_init(struct semaphore* sem, int value); +extern __ke_size_t ATI_API_CALL __ke_sema_size(void); +extern void ATI_API_CALL __ke_down(struct semaphore* sem); +extern void ATI_API_CALL __ke_up(struct semaphore* sem); +extern void ATI_API_CALL __ke_atomic_inc(void* v); +extern void ATI_API_CALL __ke_atomic_dec(void* v); +extern void ATI_API_CALL __ke_atomic_add(int val, void* v); +extern void ATI_API_CALL __ke_atomic_sub(int val, void* v); +extern int ATI_API_CALL __ke_atomic_read(void* v); +extern void ATI_API_CALL __ke_atomic_set(void* v, int val); +extern void ATI_API_CALL __ke_spin_lock(__ke_device_t *dev, int ndx); +extern void ATI_API_CALL __ke_spin_unlock(__ke_device_t *dev, int ndx); #define __KE_MAX_SPINLOCKS 6 -extern void __ke_lock_kernel(void); -extern void __ke_unlock_kernel(void); -extern int __ke_sys_mlock(unsigned long start, __ke_size_t len); -extern int __ke_sys_mlock(unsigned long start, __ke_size_t len); -extern int __ke_sys_munlock(unsigned long start, __ke_size_t len); -extern int __ke_sys_modify_ldt(int func, void *ptr, unsigned long bytecount); +extern void ATI_API_CALL __ke_lock_kernel(void); +extern void ATI_API_CALL __ke_unlock_kernel(void); +extern int ATI_API_CALL __ke_sys_mlock(unsigned long start, __ke_size_t len); +extern int ATI_API_CALL __ke_sys_mlock(unsigned long start, __ke_size_t len); +extern int ATI_API_CALL __ke_sys_munlock(unsigned long start, __ke_size_t len); +extern int ATI_API_CALL __ke_sys_modify_ldt(int func, void *ptr, unsigned long bytecount); #ifdef __KE_NO_VSPRINTF -extern void __ke_printk(const char* fmt, ...); +extern void ATI_API_CALL __ke_printk(const char* fmt, ...); #else // !__KE_NO_VSPRINTF -extern void __ke_print_info(const char* fmt, ...); -extern void __ke_print_error(const char* fmt, ...); -extern void __ke_print_debug(const char* fmt, ...); +extern void ATI_API_CALL __ke_print_info(const char* fmt, ...); +extern void ATI_API_CALL __ke_print_error(const char* fmt, ...); +extern void ATI_API_CALL __ke_print_debug(const char* fmt, ...); #endif // !__KE_NO_VSPRINTF enum __ke_cap @@ -238,98 +238,98 @@ __KE_CAP_SYS_ADMIN, __KE_CAP_IPC_LOCK, }; -extern int __ke_capable(enum __ke_cap cap); -extern void __ke_cap_effective_raise(enum __ke_cap cap); -extern __ke_u32 __ke_get_cap_effective(void); -extern void __ke_set_cap_effective(__ke_u32 cap); -extern unsigned long __ke_ram_available(void); - -extern int __ke_copy_from_user(void* to, const void* from, __ke_size_t size); -extern int __ke_copy_to_user(void* to, const void* from, __ke_size_t size); -extern int __ke_verify_area(int type, const void * addr, unsigned long size); - -extern void* __ke_malloc(__ke_size_t size); -extern void __ke_free_s(void* p, __ke_size_t size); -extern void* __ke_vmalloc(__ke_size_t size); -extern void __ke_vfree(void* p); -extern void* __ke_get_free_page(void); -extern void* __ke_get_free_pages(int order); -extern void __ke_free_page(void* pt); -extern void __ke_free_pages(void* pt, int order); -extern void __ke_mem_map_reserve(void* pt); -extern void __ke_mem_map_unreserve(void* pt); -extern void __ke_virt_reserve(void* pt); -extern void __ke_virt_unreserve(void* pt); -extern void* __ke_get_vmptr( struct _agp_memory* memory ); -extern void* __ke_ioremap(unsigned long offset, unsigned long size); -extern void* __ke_ioremap_nocache(unsigned long offset, unsigned long size); -extern void __ke_iounmap(void* pt); -extern int __ke_verify_read_access(void* addr, __ke_size_t size); -extern int __ke_verify_write_access(void* addr, __ke_size_t size); -extern struct mm_struct* __ke_init_mm(void); -extern struct mm_struct* __ke_current_mm(void); -extern unsigned long __ke_get_vm_phys_addr(struct mm_struct* mm, unsigned long virtual_addr); -extern unsigned long* __ke_get_vm_phys_addr_list(struct mm_struct* mm, unsigned long virtual_addr, unsigned long pages); -extern void* __ke_memset(void* s, int c, __ke_size_t count); -extern void* __ke_memcpy(void* d, const void* s, __ke_size_t count); -extern __ke_size_t __ke_strlen(const char *s); -extern char* __ke_strcpy(char* d, const char* s); -extern char* __ke_strncpy(char* d, const char* s, __ke_size_t count); -extern int __ke_strcmp(const char *s1, const char *s2); -extern int __ke_strncmp(const char* str1, const char* str2, __ke_size_t count); -extern int __ke_sprintf(char* buf, const char* fmt, ...); - -/*****************************************************************************/ - -extern void __ke_set_bit(int nr, volatile void * addr); -extern void __ke_clear_bit(int nr, volatile void * addr); - -/*****************************************************************************/ - -extern int __ke_flush_cache(void); - -/*****************************************************************************/ - -extern int __ke_config_mtrr(void); -extern int __ke_mtrr_add_wc(unsigned long base, unsigned long size); -extern int __ke_mtrr_del(int reg, unsigned long base, unsigned long size); - -/*****************************************************************************/ - -extern int __ke_get_pci_device_info(__ke_pci_dev_t* dev, __ke_pci_device_info_t *pinfo); -extern int __ke_check_pci(int busnum, int devnum, int funcnum, __ke_u16* vendor, __ke_u16* device, unsigned int* irq); -extern int __ke_pci_get_irq(__ke_pci_dev_t *dev, unsigned int* irq); -extern __ke_pci_dev_t* __ke_pci_find_device (unsigned int vendor, unsigned int dev, __ke_pci_dev_t* from); -extern int __ke_pci_read_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 *val); -extern int __ke_pci_read_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 *val); -extern int __ke_pci_read_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 *val); -extern int __ke_pci_write_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 val); -extern int __ke_pci_write_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 val); -extern int __ke_pci_write_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 val); -extern int __ke_pci_enable_device(__ke_pci_dev_t* dev); - -/*****************************************************************************/ - -extern void __ke_outb(unsigned char value, unsigned short port); -extern void __ke_outw(unsigned short value, unsigned short port); -extern void __ke_out(unsigned int value, unsigned short port); -extern char __ke_inb(unsigned short port); -extern short __ke_inw(unsigned short port); -extern int __ke_in(unsigned short port); - -/*****************************************************************************/ - -extern void __ke_enable_irq(int irq); -extern void __ke_disable_irq(int irq); -extern int __ke_request_irq(unsigned int irq, void (*handler)(int, void *, void *), const char *dev_name, void *dev_id); -extern void __ke_free_irq(unsigned int irq, void *dev_id); - -/*****************************************************************************/ - -extern void* __ke_vma_file_priv(struct vm_area_struct* vma); -extern unsigned long __ke_vm_start(struct vm_area_struct* vma); -extern unsigned long __ke_vm_end(struct vm_area_struct* vma); -extern unsigned long __ke_vm_offset(struct vm_area_struct* vma); +extern int ATI_API_CALL __ke_capable(enum __ke_cap cap); +extern void ATI_API_CALL __ke_cap_effective_raise(enum __ke_cap cap); +extern __ke_u32 ATI_API_CALL __ke_get_cap_effective(void); +extern void ATI_API_CALL __ke_set_cap_effective(__ke_u32 cap); +extern unsigned long ATI_API_CALL __ke_ram_available(void); + +extern int ATI_API_CALL __ke_copy_from_user(void* to, const void* from, __ke_size_t size); +extern int ATI_API_CALL __ke_copy_to_user(void* to, const void* from, __ke_size_t size); +extern int ATI_API_CALL __ke_verify_area(int type, const void * addr, unsigned long size); + +extern void* ATI_API_CALL __ke_malloc(__ke_size_t size); +extern void ATI_API_CALL __ke_free_s(void* p, __ke_size_t size); +extern void* ATI_API_CALL __ke_vmalloc(__ke_size_t size); +extern void ATI_API_CALL __ke_vfree(void* p); +extern void* ATI_API_CALL __ke_get_free_page(void); +extern void* ATI_API_CALL __ke_get_free_pages(int order); +extern void ATI_API_CALL __ke_free_page(void* pt); +extern void ATI_API_CALL __ke_free_pages(void* pt, int order); +extern void ATI_API_CALL __ke_mem_map_reserve(void* pt); +extern void ATI_API_CALL __ke_mem_map_unreserve(void* pt); +extern void ATI_API_CALL __ke_virt_reserve(void* pt); +extern void ATI_API_CALL __ke_virt_unreserve(void* pt); +extern void* ATI_API_CALL __ke_get_vmptr( struct _agp_memory* memory ); +extern void* ATI_API_CALL __ke_ioremap(unsigned long offset, unsigned long size); +extern void* ATI_API_CALL __ke_ioremap_nocache(unsigned long offset, unsigned long size); +extern void ATI_API_CALL __ke_iounmap(void* pt); +extern int ATI_API_CALL __ke_verify_read_access(void* addr, __ke_size_t size); +extern int ATI_API_CALL __ke_verify_write_access(void* addr, __ke_size_t size); +extern struct mm_struct* ATI_API_CALL __ke_init_mm(void); +extern struct mm_struct* ATI_API_CALL __ke_current_mm(void); +extern unsigned long ATI_API_CALL __ke_get_vm_phys_addr(struct mm_struct* mm, unsigned long virtual_addr); +extern unsigned long* ATI_API_CALL __ke_get_vm_phys_addr_list(struct mm_struct* mm, unsigned long virtual_addr, unsigned long pages); +extern void* ATI_API_CALL __ke_memset(void* s, int c, __ke_size_t count); +extern void* ATI_API_CALL __ke_memcpy(void* d, const void* s, __ke_size_t count); +extern __ke_size_t ATI_API_CALL __ke_strlen(const char *s); +extern char* ATI_API_CALL __ke_strcpy(char* d, const char* s); +extern char* ATI_API_CALL __ke_strncpy(char* d, const char* s, __ke_size_t count); +extern int ATI_API_CALL __ke_strcmp(const char *s1, const char *s2); +extern int ATI_API_CALL __ke_strncmp(const char* str1, const char* str2, __ke_size_t count); +extern int ATI_API_CALL __ke_sprintf(char* buf, const char* fmt, ...); + +/*****************************************************************************/ + +extern void ATI_API_CALL __ke_set_bit(int nr, volatile void * addr); +extern void ATI_API_CALL __ke_clear_bit(int nr, volatile void * addr); + +/*****************************************************************************/ + +extern int ATI_API_CALL __ke_flush_cache(void); + +/*****************************************************************************/ + +extern int ATI_API_CALL __ke_config_mtrr(void); +extern int ATI_API_CALL __ke_mtrr_add_wc(unsigned long base, unsigned long size); +extern int ATI_API_CALL __ke_mtrr_del(int reg, unsigned long base, unsigned long size); + +/*****************************************************************************/ + +extern int ATI_API_CALL __ke_get_pci_device_info(__ke_pci_dev_t* dev, __ke_pci_device_info_t *pinfo); +extern int ATI_API_CALL __ke_check_pci(int busnum, int devnum, int funcnum, __ke_u16* vendor, __ke_u16* device, unsigned int* irq); +extern int ATI_API_CALL __ke_pci_get_irq(__ke_pci_dev_t *dev, unsigned int* irq); +extern __ke_pci_dev_t* ATI_API_CALL __ke_pci_find_device (unsigned int vendor, unsigned int dev, __ke_pci_dev_t* from); +extern int ATI_API_CALL __ke_pci_read_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 *val); +extern int ATI_API_CALL __ke_pci_read_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 *val); +extern int ATI_API_CALL __ke_pci_read_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 *val); +extern int ATI_API_CALL __ke_pci_write_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 val); +extern int ATI_API_CALL __ke_pci_write_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 val); +extern int ATI_API_CALL __ke_pci_write_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 val); +extern int ATI_API_CALL __ke_pci_enable_device(__ke_pci_dev_t* dev); + +/*****************************************************************************/ + +extern void ATI_API_CALL __ke_outb(unsigned char value, unsigned short port); +extern void ATI_API_CALL __ke_outw(unsigned short value, unsigned short port); +extern void ATI_API_CALL __ke_out(unsigned int value, unsigned short port); +extern char ATI_API_CALL __ke_inb(unsigned short port); +extern short ATI_API_CALL __ke_inw(unsigned short port); +extern int ATI_API_CALL __ke_in(unsigned short port); + +/*****************************************************************************/ + +extern void ATI_API_CALL __ke_enable_irq(int irq); +extern void ATI_API_CALL __ke_disable_irq(int irq); +extern int ATI_API_CALL __ke_request_irq(unsigned int irq, void (*handler)(int, void *, void *), const char *dev_name, void *dev_id); +extern void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id); + +/*****************************************************************************/ + +extern void* ATI_API_CALL __ke_vma_file_priv(struct vm_area_struct* vma); +extern unsigned long ATI_API_CALL __ke_vm_start(struct vm_area_struct* vma); +extern unsigned long ATI_API_CALL __ke_vm_end(struct vm_area_struct* vma); +extern unsigned long ATI_API_CALL __ke_vm_offset(struct vm_area_struct* vma); enum __ke_vm_maptype { __KE_ADPT, @@ -339,13 +339,13 @@ __KE_AGP_BQS, __KE_AGP, }; -extern char* __ke_vm_flags_str(struct vm_area_struct* vma, char* buf); -extern char* __ke_vm_page_prot_str(struct vm_area_struct* vma, char* buf); -extern char* __ke_vm_phys_addr_str(struct vm_area_struct* vma, +extern char* ATI_API_CALL __ke_vm_flags_str(struct vm_area_struct* vma, char* buf); +extern char* ATI_API_CALL __ke_vm_page_prot_str(struct vm_area_struct* vma, char* buf); +extern char* ATI_API_CALL __ke_vm_phys_addr_str(struct vm_area_struct* vma, char* buf, unsigned long linear_address, unsigned long* phys_address); -extern int __ke_vm_map(struct file* filp, +extern int ATI_API_CALL __ke_vm_map(struct file* filp, struct vm_area_struct* vma, enum __ke_vm_maptype type, int readonly); @@ -376,30 +376,30 @@ extern int __ke_agp_try_unsupported; -int __ke_agp_available(int use_internal); -void __ke_agp_uninit(void); +int ATI_API_CALL __ke_agp_available(int use_internal); +void ATI_API_CALL __ke_agp_uninit(void); #ifdef FGL -struct _agp_memory* __ke_agp_allocate_memory_phys_list( +struct _agp_memory* ATI_API_CALL __ke_agp_allocate_memory_phys_list( __ke_size_t pages, unsigned long type, unsigned long * phys_addr); #endif -void __ke_agp_free_memory(struct _agp_memory* handle); -struct _agp_memory* __ke_agp_allocate_memory(__ke_size_t pages, +void ATI_API_CALL __ke_agp_free_memory(struct _agp_memory* handle); +struct _agp_memory* ATI_API_CALL __ke_agp_allocate_memory(__ke_size_t pages, unsigned long type); -int __ke_agp_bind_memory(struct _agp_memory* handle, __ke_off_t start); -int __ke_agp_unbind_memory(struct _agp_memory* handle); -int __ke_agp_enable(unsigned long mode); -int __ke_read_agp_caps_registers(__ke_pci_dev_t* dev, unsigned int *caps); -int __ke_agp_acquire(void); -void __ke_agp_release(void); -void __ke_agp_copy_info(__ke_agp_kern_info_t* info); -unsigned long __ke_agp_memory_handle(struct _agp_memory* handle); -unsigned long __ke_agp_memory_page_count(struct _agp_memory* handle); - -int __ke_is_athlon(void); -int __ke_has_PSE(void); -int __ke_amd_adv_spec_cache_feature(void); -void __ke_smp_call_function( void (*func)(void *info) ); -int __ke_smp_processor_id(void); +int ATI_API_CALL __ke_agp_bind_memory(struct _agp_memory* handle, __ke_off_t start); +int ATI_API_CALL __ke_agp_unbind_memory(struct _agp_memory* handle); +int ATI_API_CALL __ke_agp_enable(unsigned long mode); +int ATI_API_CALL __ke_read_agp_caps_registers(__ke_pci_dev_t* dev, unsigned int *caps); +int ATI_API_CALL __ke_agp_acquire(void); +void ATI_API_CALL __ke_agp_release(void); +void ATI_API_CALL __ke_agp_copy_info(__ke_agp_kern_info_t* info); +unsigned long ATI_API_CALL __ke_agp_memory_handle(struct _agp_memory* handle); +unsigned long ATI_API_CALL __ke_agp_memory_page_count(struct _agp_memory* handle); + +int ATI_API_CALL __ke_is_athlon(void); +int ATI_API_CALL __ke_has_PSE(void); +int ATI_API_CALL __ke_amd_adv_spec_cache_feature(void); +void ATI_API_CALL __ke_smp_call_function( void (*func)(void *info) ); +int ATI_API_CALL __ke_smp_processor_id(void); /*****************************************************************************/ diff -ur build_mod.old/make.sh build_mod/make.sh --- build_mod.old/make.sh 2004-03-17 23:00:29.000000000 +0100 +++ build_mod/make.sh 2004-05-29 21:16:59.708355432 +0200 @@ -176,6 +176,11 @@ drmincludes=${linuxincludes}/../drivers/char/drm #drmincludes=/usr/local/src/dripkg/drm +# Fedora Core 2 work around +if [ ! -e "/usr/src/linux" ] && [ -d "/usr/src/linux-${uname_r}" ]; then + drmincludes_2=/usr/src/linux-${uname_r}/drivers/char/drm +fi + # since kernel 2.4.8 the X4.1.0 drm kernel module headers are part # of the kernel build environment - check dir and expected files. @@ -992,7 +997,7 @@ if [ $kernel_is_26x -gt 0 ]; then echo "doing Makefile based build for kernel 2.6.x and higher" | tee -a $logfile cd 2.6.x - make PAGE_ATTR_FIX=$PAGE_ATTR_FIX 2>&1 | tee -a $logfile + make PAGE_ATTR_FIX=$PAGE_ATTR_FIX DRMINCLUDES=$drmincludes 2>&1 | tee -a $logfile res=$? cd .. if [ $res -eq 0 ]; then