summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2004-06-02 18:50:43 +0000
committerLuca Barbato <lu_zero@gentoo.org>2004-06-02 18:50:43 +0000
commiteb4ec95ef2baafeef81fce6c8f07687c2e874748 (patch)
tree1fa50cc6bb25c238d9a2b923b36ab1b176f7a620 /media-video
parentVersion bumped. (Manifest recommit) (diff)
downloadgentoo-2-eb4ec95ef2baafeef81fce6c8f07687c2e874748.tar.gz
gentoo-2-eb4ec95ef2baafeef81fce6c8f07687c2e874748.tar.bz2
gentoo-2-eb4ec95ef2baafeef81fce6c8f07687c2e874748.zip
Various fixes
Diffstat (limited to 'media-video')
-rw-r--r--media-video/ati-drivers/ChangeLog11
-rw-r--r--media-video/ati-drivers/ati-drivers-3.9.0-r1.ebuild167
-rw-r--r--media-video/ati-drivers/files/digest-ati-drivers-3.9.0-r11
-rw-r--r--media-video/ati-drivers/files/fglrx-3.9.0-allocation.patch29
-rw-r--r--media-video/ati-drivers/files/fglrx-3.9.0-regparm.patch1698
5 files changed, 1905 insertions, 1 deletions
diff --git a/media-video/ati-drivers/ChangeLog b/media-video/ati-drivers/ChangeLog
index a3aaa3d53fbc..d5935c9bf2cf 100644
--- a/media-video/ati-drivers/ChangeLog
+++ b/media-video/ati-drivers/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for media-video/ati-drivers
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers/ChangeLog,v 1.38 2004/05/28 15:43:06 lu_zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers/ChangeLog,v 1.39 2004/06/02 18:50:42 lu_zero Exp $
+
+*ati-drivers-3.9.0-r1 (02 Jun 2004)
+
+ 02 Jun 2004; Luca Barbato <lu_zero@gentoo.org>
+ +files/fglrx-3.9.0-allocation.patch, +files/fglrx-3.9.0-regparm.patch,
+ +ati-drivers-3.9.0-r1.ebuild:
+ Various patches to solve different issues, thanks to Tarmo Tanav
+ <sn4ip3r@estprog.ee> for the regparm patch and Aric Cyr <acyr76@yahoo.ca> for
+ the memory allocation fix.
*ati-drivers-3.2.8-r2 (28 May 2004)
diff --git a/media-video/ati-drivers/ati-drivers-3.9.0-r1.ebuild b/media-video/ati-drivers/ati-drivers-3.9.0-r1.ebuild
new file mode 100644
index 000000000000..562a5eff9106
--- /dev/null
+++ b/media-video/ati-drivers/ati-drivers-3.9.0-r1.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers/ati-drivers-3.9.0-r1.ebuild,v 1.1 2004/06/02 18:50:42 lu_zero Exp $
+
+IUSE="qt kde gnome"
+
+inherit eutils rpm
+
+DESCRIPTION="Ati precompiled drivers for r350, r300, r250 and r200 chipsets"
+HOMEPAGE="http://www.ati.com"
+SRC_URI="http://www2.ati.com/drivers/linux/fglrx-4.3.0-${PV}.i386.rpm"
+SLOT="${KV}"
+LICENSE="ATI"
+KEYWORDS="-* ~x86"
+
+DEPEND=">=virtual/linux-sources-2.4
+ app-arch/rpm2targz
+ virtual/x11"
+
+RDEPEND="virtual/x11"
+PROVIDE="virtual/opengl"
+
+ATIBIN="${D}/opt/ati/bin"
+RESTRICT="nostrip"
+
+pkg_setup(){
+ check_KV || \
+ die "Please ensure /usr/src/linux points to your kernel symlink!"
+
+ if has_version "x11-base/xfree"
+ then
+ if ! has_version ">=x11-base/xfree-4.3.0"
+ then
+ die "You must upgrade to xfree-4.3.0 or greater to use this."
+ fi
+ fi
+
+ # Set up X11 implementation
+ X11_IMPLEM_P="$(best_version virtual/x11)"
+ X11_IMPLEM="${X11_IMPLEM_P%-[0-9]*}"
+ X11_IMPLEM="${X11_IMPLEM##*\/}"
+ einfo "X11 implementation is ${X11_IMPLEM}."
+}
+
+src_unpack() {
+ local OLDBIN="/usr/X11R6/bin"
+
+ cd ${WORKDIR}
+ rpm_src_unpack
+
+ cd ${WORKDIR}/lib/modules/fglrx/build_mod
+
+ epatch ${FILESDIR}/fglrx-3.9.0-allocation.patch
+
+ if [ "`echo ${KV}|grep 2.6`" ]
+ then
+ epatch ${FILESDIR}/fglrx-2.6-vmalloc-vmaddr.patch
+ epatch ${FILESDIR}/fglrx-2.6-get-page.patch
+ epatch ${FILESDIR}/fglrx-3.9.0-regparm.patch
+ fi
+}
+
+src_compile() {
+ local GENTOO_ARCH=
+
+ einfo "Building the DRM module..."
+ cd ${WORKDIR}/lib/modules/fglrx/build_mod
+ if [ "${KV}" != "${KV/2\.6}" ]
+ then
+ GENTOO_ARCH=${ARCH}
+ unset ARCH
+ addwrite "/usr/src/${FK}"
+ cp 2.6.x/Makefile .
+ export _POSIX2_VERSION="199209"
+ make -C /usr/src/linux SUBDIRS="`pwd`" modules || \
+ ewarn "DRM module not built"
+ ARCH=${GENTOO_ARCH}
+ else
+ export _POSIX2_VERSION="199209"
+ # That is the dirty way to avoid the id -u check
+ sed -e 's:`id -u`:0:' \
+ -e 's:`uname -r`:${KV}:' \
+ -i make.sh
+ chmod +x make.sh
+ ./make.sh || die "DRM module not built"
+ fi
+
+ # Removing unused stuff
+ rm -rf ${WORKDIR}/usr/X11R6/bin/{*.bz2,fgl_glxgears}
+}
+
+pkg_preinst() {
+ # Clean the dinamic libGL stuff's home to ensure
+ # we don't have stale libs floating around ...
+ if [ -d "${ROOT}/usr/lib/opengl/ati" ]
+ then
+ rm -rf ${ROOT}/usr/lib/opengl/ati/*
+ fi
+}
+
+src_install() {
+ local ATI_ROOT="/usr/lib/opengl/ati"
+
+ cd ${WORKDIR}
+
+ # DRM module
+ insinto /lib/modules/${KV}/video
+ if [ "${KV}" != "${KV/2\.6}" ]
+ then
+ doins ${WORKDIR}/lib/modules/fglrx/build_mod/fglrx.ko
+ else
+ doins ${WORKDIR}/lib/modules/fglrx/build_mod/fglrx.o
+ fi
+
+ # OpenGL libs
+ exeinto ${ATI_ROOT}/lib
+ doexe ${WORKDIR}/usr/X11R6/lib/libGL.so.1.2
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so.1
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libMesaGL.so
+ # This is the same as that of the X11 implementation ...
+ dosym ../../${X11_IMPLEM}/lib/libGL.la ${ATI_ROOT}/lib/libGL.la
+
+ # X and DRI driver
+ exeinto /usr/X11R6/lib/modules/drivers
+ doexe ${WORKDIR}/usr/X11R6/lib/modules/drivers/fglrx_drv.o
+ exeinto /usr/X11R6/lib/modules/dri
+ doexe ${WORKDIR}/usr/X11R6/lib/modules/dri/fglrx_dri.so
+ rm -f ${WORKDIR}/usr/X11R6/lib/modules/drivers/fglrx_drv.o \
+ ${WORKDIR}/usr/X11R6/lib/modules/dri/fglrx_dri.so
+
+ # Same as in the X11 implementation
+ exeinto ${ATI_ROOT}/
+ dosym ../${X11_IMPLEM}/include ${ATI_ROOT}/include
+ dosym ../${X11_IMPLEM}/extensions ${ATI_ROOT}/extensions
+ rm -f ${WORKDIR}/usr/X11R6/lib/libGL.so.1.2
+
+ dodoc ${WORKDIR}/usr/share/doc/fglrx/LICENSE.*
+
+ #apps
+ insinto /etc/env.d
+ doins ${FILESDIR}/09ati
+ exeinto /opt/ati/bin
+ doexe usr/X11R6/bin/*
+ rm usr/X11R6/bin/*
+
+ # Removing unused stuff
+ rm -rf ${WORKDIR}/usr/{src,share}
+ cp -R ${WORKDIR}/usr ${D}/
+}
+
+pkg_postinst() {
+# Ebuild shouldn't do this automatically, just tell the user to do it,
+# otherwise it messes up livecd/gamecd stuff ... (drobbins, 1 May 2003)
+# if [ "${ROOT}" = "/" ]
+# then
+# /usr/sbin/opengl-update ati
+# fi
+
+ echo
+ einfo "To switch to ATI OpenGL, run \"opengl-update ati\""
+ einfo "To change your XF86Config you can use the bundled \"fglrxconfig\""
+ echo
+
+ # DRM module
+ update-modules
+}
diff --git a/media-video/ati-drivers/files/digest-ati-drivers-3.9.0-r1 b/media-video/ati-drivers/files/digest-ati-drivers-3.9.0-r1
new file mode 100644
index 000000000000..6ebb92b4580e
--- /dev/null
+++ b/media-video/ati-drivers/files/digest-ati-drivers-3.9.0-r1
@@ -0,0 +1 @@
+MD5 9f7802ee0bbdeb5172673027056e789d fglrx-4.3.0-3.9.0.i386.rpm 4285357
diff --git a/media-video/ati-drivers/files/fglrx-3.9.0-allocation.patch b/media-video/ati-drivers/files/fglrx-3.9.0-allocation.patch
new file mode 100644
index 000000000000..b616033f16c5
--- /dev/null
+++ b/media-video/ati-drivers/files/fglrx-3.9.0-allocation.patch
@@ -0,0 +1,29 @@
+diff -ur build_mod.orig/firegl_public.c build_mod/firegl_public.c
+--- build_mod.orig/firegl_public.c 2004-03-18 07:00:29.000000000 +0900
++++ build_mod/firegl_public.c 2004-05-28 02:10:48.258677968 +0900
+@@ -2816,10 +2816,21 @@
+ #ifdef FGL
+ struct _agp_memory* __ke_agp_allocate_memory_phys_list(__ke_size_t pages, unsigned long type, unsigned long * phys_addr)
+ {
+-#if 0
++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,0)
+ #ifdef __AGP__
+- if (AGP_AVAILABLE(allocate_memory_phys_list))
+- return AGP_FUNC(allocate_memory_phys_list)(pages, type, phys_addr);
++ if (AGP_AVAILABLE(allocate_memory)) {
++ int i;
++ struct _agp_memory* newmem = AGP_FUNC(allocate_memory)(pages, type);
++
++ if (newmem) {
++ /* convert/copy the pysical adresses into the "new" agp_memory table */
++ for (i = 0; i < pages; i++) {
++ phys_addr[i] = newmem->memory[i];
++ }
++ }
++
++ return newmem;
++ }
+ #endif /* __AGP__ */
+ #endif
+ if (firegl_agp)
+
diff --git a/media-video/ati-drivers/files/fglrx-3.9.0-regparm.patch b/media-video/ati-drivers/files/fglrx-3.9.0-regparm.patch
new file mode 100644
index 000000000000..c217761a8ff3
--- /dev/null
+++ b/media-video/ati-drivers/files/fglrx-3.9.0-regparm.patch
@@ -0,0 +1,1698 @@
+diff -u --recursive build_mod.old/firegl_public.c build_mod/firegl_public.c
+--- build_mod.old/firegl_public.c 2004-05-28 17:37:27.247262000 +0300
++++ build_mod/firegl_public.c 2004-05-28 17:45:56.029817228 +0300
+@@ -238,15 +238,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 {
+@@ -674,7 +683,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);
+@@ -691,13 +700,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);
+@@ -705,18 +714,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
+@@ -744,7 +753,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,
+@@ -752,27 +761,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);
+@@ -781,14 +790,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 (*ATI_API_CALL 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();
+@@ -830,7 +839,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
+@@ -843,19 +852,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);
+@@ -866,27 +875,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;
+@@ -897,24 +906,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;
+@@ -950,7 +959,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);
+ }
+@@ -958,33 +967,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,
+@@ -994,7 +1003,7 @@
+
+ /*****************************************************************************/
+
+-int __ke_error_code(enum __ke_error_num errcode)
++int ATI_API_CALL __ke_error_code(enum __ke_error_num errcode)
+ {
+ switch (errcode)
+ {
+@@ -1029,7 +1038,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);
+@@ -1038,7 +1047,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);
+@@ -1049,86 +1058,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();
+ }
+@@ -1143,7 +1152,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];
+@@ -1158,7 +1167,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];
+@@ -1176,7 +1185,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];
+@@ -1201,7 +1210,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;
+@@ -1232,7 +1241,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;
+@@ -1242,7 +1251,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;
+@@ -1252,7 +1261,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;
+@@ -1266,7 +1275,7 @@
+
+ /*****************************************************************************/
+
+-int __ke_capable(enum __ke_cap cap)
++int ATI_API_CALL __ke_capable(enum __ke_cap cap)
+ {
+ switch (cap)
+ {
+@@ -1282,7 +1291,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)
+ {
+@@ -1298,17 +1307,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;
+
+@@ -1321,22 +1330,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 )
+ {
+@@ -1348,7 +1357,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;
+
+@@ -1368,7 +1377,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;
+@@ -1379,52 +1388,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));
+@@ -1437,7 +1446,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));
+@@ -1450,7 +1459,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,
+@@ -1461,7 +1470,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,
+@@ -1473,48 +1482,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;
+@@ -1549,7 +1558,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;
+@@ -1571,42 +1580,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;
+
+@@ -1619,12 +1628,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);
+ }
+@@ -1649,7 +1658,7 @@
+ }
+ #endif /* __SMP__ */
+
+-int __ke_flush_cache(void)
++int ATI_API_CALL __ke_flush_cache(void)
+ {
+ #ifdef __SMP__
+ #if LINUX_VERSION_CODE < 0x020501
+@@ -1685,7 +1694,7 @@
+
+ /*****************************************************************************/
+
+-int __ke_config_mtrr(void)
++int ATI_API_CALL __ke_config_mtrr(void)
+ {
+ #ifdef CONFIG_MTRR
+ return 1;
+@@ -1694,7 +1703,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);
+@@ -1703,7 +1712,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);
+@@ -1714,64 +1723,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);
+ }
+@@ -1779,18 +1788,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)
+ {
+@@ -1799,7 +1808,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);
+ }
+@@ -1812,8 +1821,8 @@
+ return IRQ_HANDLED;
+ }
+
+-int __ke_request_irq(unsigned int irq,
+- void (*handler)(int, void *, void *),
++int ATI_API_CALL __ke_request_irq(unsigned int irq,
++ void (*ATI_API_CALL handler)(int, void *, void *),
+ const char *dev_name, void *dev_id)
+ {
+ irq_handler_func = handler;
+@@ -1822,7 +1831,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;
+@@ -2188,22 +2197,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;
+@@ -2212,7 +2221,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' : '-';
+@@ -2224,7 +2233,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;
+
+@@ -2251,7 +2260,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)
+@@ -2304,11 +2313,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__
+@@ -2316,8 +2330,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__ */
+@@ -2325,22 +2339,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__
+@@ -2348,20 +2362,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)
+@@ -2640,7 +2654,7 @@
+ #endif // !USE_FIREGL_AGPGART_IMPLEMENTATION
+
+ static
+-int __ke_firegl_agpgart_available(void)
++int ATI_API_CALL __ke_firegl_agpgart_available(void)
+ {
+ int retval;
+
+@@ -2663,7 +2677,7 @@
+ }
+
+ static
+-int __ke_agpgart_available(void)
++int ATI_API_CALL __ke_agpgart_available(void)
+ {
+ #ifdef __AGP__
+ unsigned int found = 0;
+@@ -2771,7 +2785,7 @@
+ return 0; /* failed */
+ }
+
+-int __ke_agp_available(int use_internal)
++int ATI_API_CALL __ke_agp_available(int use_internal)
+ {
+ int available = 0;
+
+@@ -2787,7 +2801,7 @@
+ return available;
+ }
+
+-void __ke_agp_uninit(void)
++void ATI_API_CALL __ke_agp_uninit(void)
+ {
+ if (firegl_agp)
+ {
+@@ -2816,7 +2830,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__
+@@ -2830,7 +2844,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))
+@@ -2840,7 +2854,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))
+@@ -2851,7 +2865,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))
+@@ -2862,7 +2876,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))
+@@ -2873,7 +2887,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))
+@@ -2890,7 +2904,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;
+@@ -2921,7 +2935,7 @@
+ return -ENODATA;
+ }
+
+-int __ke_agp_acquire(void)
++int ATI_API_CALL __ke_agp_acquire(void)
+ {
+ #ifdef __AGP__
+ if (AGP_AVAILABLE(acquire))
+@@ -2932,7 +2946,7 @@
+ return -EINVAL;
+ }
+
+-void __ke_agp_release(void)
++void ATI_API_CALL __ke_agp_release(void)
+ {
+ #ifdef __AGP__
+ if (AGP_AVAILABLE(release))
+@@ -2942,7 +2956,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;
+
+@@ -3029,7 +3043,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
+@@ -3045,7 +3059,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
+@@ -3061,13 +3075,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 (*ATI_API_CALL func)(void *info) )
+ {
+ smp_call_function( func, NULL, 0, 1 );
+ }
+@@ -3097,7 +3111,7 @@
+ return 0; // does not match
+ }
+
+-int __ke_is_athlon(void)
++int ATI_API_CALL __ke_is_athlon(void)
+ {
+ register int bAthlon;
+ __asm
+@@ -3184,7 +3198,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
+@@ -3226,7 +3240,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 -u --recursive build_mod.old/firegl_public.h build_mod/firegl_public.h
+--- build_mod.old/firegl_public.h 2004-03-18 00:00:29.000000000 +0200
++++ build_mod/firegl_public.h 2004-05-28 17:45:19.923107330 +0300
+@@ -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 {
+@@ -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,38 @@
+ __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_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 +237,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 (*ATI_API_CALL 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 +338,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 +375,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);
+
+ /*****************************************************************************/
+
+