Lines 238-252
Link Here
|
238 |
|
238 |
|
239 |
// ============================================================ |
239 |
// ============================================================ |
240 |
/* global structures */ |
240 |
/* global structures */ |
|
|
241 |
int ip_firegl_open(struct inode* inode, struct file* filp) |
242 |
{ return firegl_open(inode, filp); } |
243 |
int ip_firegl_release(struct inode* inode, struct file* filp) |
244 |
{ return firegl_release(inode, filp); } |
245 |
int ip_firegl_ioctl(struct inode* inode, struct file* filp, unsigned int cmd, unsigned long arg) |
246 |
{ return firegl_ioctl(inode, filp, cmd, arg); } |
247 |
int ip_firegl_mmap(struct file* filp, struct vm_area_struct* vma) |
248 |
{ return firegl_mmap(filp, vma); } |
249 |
|
241 |
static struct file_operations firegl_fops = |
250 |
static struct file_operations firegl_fops = |
242 |
{ |
251 |
{ |
243 |
#ifdef THIS_MODULE |
252 |
#ifdef THIS_MODULE |
244 |
owner: THIS_MODULE, |
253 |
owner: THIS_MODULE, |
245 |
#endif |
254 |
#endif |
246 |
open: firegl_open, |
255 |
open: ip_firegl_open, |
247 |
release: firegl_release, |
256 |
release: ip_firegl_release, |
248 |
ioctl: firegl_ioctl, |
257 |
ioctl: ip_firegl_ioctl, |
249 |
mmap: firegl_mmap, |
258 |
mmap: ip_firegl_mmap, |
250 |
}; |
259 |
}; |
251 |
|
260 |
|
252 |
typedef struct { |
261 |
typedef struct { |
Lines 674-680
Link Here
|
674 |
typedef wait_queue_t* wait_queue_head_t; |
683 |
typedef wait_queue_t* wait_queue_head_t; |
675 |
#endif |
684 |
#endif |
676 |
|
685 |
|
677 |
__ke_wait_queue_head_t* __ke_alloc_wait_queue_head_struct(void) |
686 |
__ke_wait_queue_head_t* ATI_API_CALL __ke_alloc_wait_queue_head_struct(void) |
678 |
{ |
687 |
{ |
679 |
__ke_wait_queue_head_t* queue_head; |
688 |
__ke_wait_queue_head_t* queue_head; |
680 |
queue_head = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL); |
689 |
queue_head = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL); |
Lines 691-703
Link Here
|
691 |
return queue_head; |
700 |
return queue_head; |
692 |
} |
701 |
} |
693 |
|
702 |
|
694 |
void __ke_free_wait_queue_head_struct(__ke_wait_queue_head_t* queue_head) |
703 |
void ATI_API_CALL __ke_free_wait_queue_head_struct(__ke_wait_queue_head_t* queue_head) |
695 |
{ |
704 |
{ |
696 |
if (queue_head) |
705 |
if (queue_head) |
697 |
kfree(queue_head); |
706 |
kfree(queue_head); |
698 |
} |
707 |
} |
699 |
|
708 |
|
700 |
__ke_wait_queue_t* __ke_alloc_wait_queue_struct(void) |
709 |
__ke_wait_queue_t* ATI_API_CALL __ke_alloc_wait_queue_struct(void) |
701 |
{ |
710 |
{ |
702 |
__ke_wait_queue_t* queue; |
711 |
__ke_wait_queue_t* queue; |
703 |
queue = kmalloc(sizeof(wait_queue_t), GFP_KERNEL); |
712 |
queue = kmalloc(sizeof(wait_queue_t), GFP_KERNEL); |
Lines 705-722
Link Here
|
705 |
return queue; |
714 |
return queue; |
706 |
} |
715 |
} |
707 |
|
716 |
|
708 |
void __ke_free_wait_queue_struct(__ke_wait_queue_t* queue) |
717 |
void ATI_API_CALL __ke_free_wait_queue_struct(__ke_wait_queue_t* queue) |
709 |
{ |
718 |
{ |
710 |
if (queue) |
719 |
if (queue) |
711 |
kfree(queue); |
720 |
kfree(queue); |
712 |
} |
721 |
} |
713 |
|
722 |
|
714 |
void __ke_wake_up_interruptible(__ke_wait_queue_head_t* queue_head) |
723 |
void ATI_API_CALL __ke_wake_up_interruptible(__ke_wait_queue_head_t* queue_head) |
715 |
{ |
724 |
{ |
716 |
wake_up_interruptible((wait_queue_head_t*)(void *)queue_head); |
725 |
wake_up_interruptible((wait_queue_head_t*)(void *)queue_head); |
717 |
} |
726 |
} |
718 |
|
727 |
|
719 |
void __ke_add_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) |
728 |
void ATI_API_CALL __ke_add_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) |
720 |
{ |
729 |
{ |
721 |
// initialisation (delayed) |
730 |
// initialisation (delayed) |
722 |
#ifdef __WAITQUEUE_INITIALIZER |
731 |
#ifdef __WAITQUEUE_INITIALIZER |
Lines 744-750
Link Here
|
744 |
add_wait_queue((wait_queue_head_t*)(void *)queue_head, (wait_queue_t*)(void *)entry); |
753 |
add_wait_queue((wait_queue_head_t*)(void *)queue_head, (wait_queue_t*)(void *)entry); |
745 |
} |
754 |
} |
746 |
|
755 |
|
747 |
void __ke_remove_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) |
756 |
void ATI_API_CALL __ke_remove_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry) |
748 |
{ |
757 |
{ |
749 |
// current->state = TASK_RUNNING; |
758 |
// current->state = TASK_RUNNING; |
750 |
remove_wait_queue((wait_queue_head_t*)(void *)queue_head, |
759 |
remove_wait_queue((wait_queue_head_t*)(void *)queue_head, |
Lines 752-778
Link Here
|
752 |
} |
761 |
} |
753 |
|
762 |
|
754 |
// sheduler |
763 |
// sheduler |
755 |
void __ke_schedule(void) |
764 |
void ATI_API_CALL __ke_schedule(void) |
756 |
{ |
765 |
{ |
757 |
schedule(); |
766 |
schedule(); |
758 |
} |
767 |
} |
759 |
|
768 |
|
760 |
int __ke_signal_pending(void) |
769 |
int ATI_API_CALL __ke_signal_pending(void) |
761 |
{ |
770 |
{ |
762 |
return signal_pending(current); |
771 |
return signal_pending(current); |
763 |
} |
772 |
} |
764 |
|
773 |
|
765 |
void __ke_set_current_state_task_interruptible(void) |
774 |
void ATI_API_CALL __ke_set_current_state_task_interruptible(void) |
766 |
{ |
775 |
{ |
767 |
current->state = TASK_INTERRUPTIBLE; |
776 |
current->state = TASK_INTERRUPTIBLE; |
768 |
} |
777 |
} |
769 |
|
778 |
|
770 |
void __ke_set_current_state_task_running(void) |
779 |
void ATI_API_CALL __ke_set_current_state_task_running(void) |
771 |
{ |
780 |
{ |
772 |
current->state = TASK_RUNNING; |
781 |
current->state = TASK_RUNNING; |
773 |
} |
782 |
} |
774 |
|
783 |
|
775 |
void __ke_configure_sigmask(__ke_sigset_t *pSigMask) |
784 |
void ATI_API_CALL __ke_configure_sigmask(__ke_sigset_t *pSigMask) |
776 |
{ |
785 |
{ |
777 |
sigemptyset((sigset_t*)(void *)pSigMask); |
786 |
sigemptyset((sigset_t*)(void *)pSigMask); |
778 |
sigaddset((sigset_t*)(void *)pSigMask, SIGSTOP); |
787 |
sigaddset((sigset_t*)(void *)pSigMask, SIGSTOP); |
Lines 781-794
Link Here
|
781 |
sigaddset((sigset_t*)(void *)pSigMask, SIGTTOU); |
790 |
sigaddset((sigset_t*)(void *)pSigMask, SIGTTOU); |
782 |
} |
791 |
} |
783 |
|
792 |
|
784 |
void __ke_block_all_signals(int (*notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask) |
793 |
void ATI_API_CALL __ke_block_all_signals(int (*ATI_API_CALL notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask) |
785 |
{ |
794 |
{ |
786 |
#if LINUX_VERSION_CODE >= 0x020400 |
795 |
#if LINUX_VERSION_CODE >= 0x020400 |
787 |
block_all_signals(notifier,pPriv,(sigset_t*)(void *)pSigMask); |
796 |
block_all_signals(notifier,pPriv,(sigset_t*)(void *)pSigMask); |
788 |
#endif |
797 |
#endif |
789 |
} |
798 |
} |
790 |
|
799 |
|
791 |
void __ke_unblock_all_signals(void) |
800 |
void ATI_API_CALL __ke_unblock_all_signals(void) |
792 |
{ |
801 |
{ |
793 |
#if LINUX_VERSION_CODE >= 0x020400 |
802 |
#if LINUX_VERSION_CODE >= 0x020400 |
794 |
unblock_all_signals(); |
803 |
unblock_all_signals(); |
Lines 830-836
Link Here
|
830 |
#endif |
839 |
#endif |
831 |
|
840 |
|
832 |
#if !defined(__ia64__) |
841 |
#if !defined(__ia64__) |
833 |
unsigned long __ke__cmpxchg(volatile void *ptr, unsigned long old, |
842 |
unsigned long ATI_API_CALL __ke__cmpxchg(volatile void *ptr, unsigned long old, |
834 |
unsigned long new, int size) |
843 |
unsigned long new, int size) |
835 |
{ |
844 |
{ |
836 |
#ifndef __HAVE_ARCH_CMPXCHG |
845 |
#ifndef __HAVE_ARCH_CMPXCHG |
Lines 843-861
Link Here
|
843 |
|
852 |
|
844 |
/*****************************************************************************/ |
853 |
/*****************************************************************************/ |
845 |
|
854 |
|
846 |
__ke_dev_t __ke_getdevice(__ke_device_t *dev) |
855 |
__ke_dev_t ATI_API_CALL __ke_getdevice(__ke_device_t *dev) |
847 |
{ |
856 |
{ |
848 |
return ((device_t*)dev)->device; |
857 |
return ((device_t*)dev)->device; |
849 |
} |
858 |
} |
850 |
|
859 |
|
851 |
const char* __ke_module_parm(void) |
860 |
const char* ATI_API_CALL __ke_module_parm(void) |
852 |
{ |
861 |
{ |
853 |
return firegl; |
862 |
return firegl; |
854 |
} |
863 |
} |
855 |
|
864 |
|
856 |
/*****************************************************************************/ |
865 |
/*****************************************************************************/ |
857 |
|
866 |
|
858 |
int __ke_inode_rdev_minor(struct inode* inode) |
867 |
int ATI_API_CALL __ke_inode_rdev_minor(struct inode* inode) |
859 |
{ |
868 |
{ |
860 |
#ifndef MINOR |
869 |
#ifndef MINOR |
861 |
return minor(inode->i_rdev); |
870 |
return minor(inode->i_rdev); |
Lines 866-892
Link Here
|
866 |
|
875 |
|
867 |
/*****************************************************************************/ |
876 |
/*****************************************************************************/ |
868 |
|
877 |
|
869 |
void* __ke_get_file_priv(struct file* filp) |
878 |
void* ATI_API_CALL __ke_get_file_priv(struct file* filp) |
870 |
{ |
879 |
{ |
871 |
return filp->private_data; |
880 |
return filp->private_data; |
872 |
} |
881 |
} |
873 |
|
882 |
|
874 |
void __ke_set_file_priv(struct file* filp, void* private_data) |
883 |
void ATI_API_CALL __ke_set_file_priv(struct file* filp, void* private_data) |
875 |
{ |
884 |
{ |
876 |
filp->private_data = private_data; |
885 |
filp->private_data = private_data; |
877 |
} |
886 |
} |
878 |
|
887 |
|
879 |
int __ke_file_excl_open(struct file* filp) |
888 |
int ATI_API_CALL __ke_file_excl_open(struct file* filp) |
880 |
{ |
889 |
{ |
881 |
return (filp->f_flags & O_EXCL) != 0; |
890 |
return (filp->f_flags & O_EXCL) != 0; |
882 |
} |
891 |
} |
883 |
|
892 |
|
884 |
int __ke_file_rw_open(struct file* filp) |
893 |
int ATI_API_CALL __ke_file_rw_open(struct file* filp) |
885 |
{ |
894 |
{ |
886 |
return (filp->f_flags & 3) != 0; |
895 |
return (filp->f_flags & 3) != 0; |
887 |
} |
896 |
} |
888 |
|
897 |
|
889 |
unsigned int __ke_file_counter(struct file *filp) |
898 |
unsigned int ATI_API_CALL __ke_file_counter(struct file *filp) |
890 |
{ |
899 |
{ |
891 |
#if LINUX_VERSION_CODE >= 0x020400 |
900 |
#if LINUX_VERSION_CODE >= 0x020400 |
892 |
return filp->f_count.counter; |
901 |
return filp->f_count.counter; |
Lines 897-920
Link Here
|
897 |
|
906 |
|
898 |
/*****************************************************************************/ |
907 |
/*****************************************************************************/ |
899 |
|
908 |
|
900 |
int __ke_getpid(void) |
909 |
int ATI_API_CALL __ke_getpid(void) |
901 |
{ |
910 |
{ |
902 |
return current->pid; |
911 |
return current->pid; |
903 |
} |
912 |
} |
904 |
|
913 |
|
905 |
int __ke_geteuid(void) |
914 |
int ATI_API_CALL __ke_geteuid(void) |
906 |
{ |
915 |
{ |
907 |
return current->euid; |
916 |
return current->euid; |
908 |
} |
917 |
} |
909 |
|
918 |
|
910 |
/*****************************************************************************/ |
919 |
/*****************************************************************************/ |
911 |
|
920 |
|
912 |
unsigned long __ke_jiffies(void) |
921 |
unsigned long ATI_API_CALL __ke_jiffies(void) |
913 |
{ |
922 |
{ |
914 |
return jiffies; |
923 |
return jiffies; |
915 |
} |
924 |
} |
916 |
|
925 |
|
917 |
void __ke_udelay(unsigned long usecs) // delay in usec |
926 |
void ATI_API_CALL __ke_udelay(unsigned long usecs) // delay in usec |
918 |
{ |
927 |
{ |
919 |
unsigned long start; |
928 |
unsigned long start; |
920 |
unsigned long stop; |
929 |
unsigned long stop; |
Lines 950-956
Link Here
|
950 |
udelay(usecs); /* delay value might get checked once again */ |
959 |
udelay(usecs); /* delay value might get checked once again */ |
951 |
} |
960 |
} |
952 |
|
961 |
|
953 |
void __ke_mdelay(unsigned long msecs) // delay in msec |
962 |
void ATI_API_CALL __ke_mdelay(unsigned long msecs) // delay in msec |
954 |
{ |
963 |
{ |
955 |
mdelay(msecs); |
964 |
mdelay(msecs); |
956 |
} |
965 |
} |
Lines 958-990
Link Here
|
958 |
/*****************************************************************************/ |
967 |
/*****************************************************************************/ |
959 |
// TODO: These here get obsolete in future, use the ia64 code below |
968 |
// TODO: These here get obsolete in future, use the ia64 code below |
960 |
// Johannes |
969 |
// Johannes |
961 |
unsigned long __ke_virt_to_bus(void* address) |
970 |
unsigned long ATI_API_CALL __ke_virt_to_bus(void* address) |
962 |
{ |
971 |
{ |
963 |
return virt_to_bus(address); |
972 |
return virt_to_bus(address); |
964 |
} |
973 |
} |
965 |
|
974 |
|
966 |
unsigned long __ke_virt_to_phys(void* address) |
975 |
unsigned long ATI_API_CALL __ke_virt_to_phys(void* address) |
967 |
{ |
976 |
{ |
968 |
return virt_to_phys(address); |
977 |
return virt_to_phys(address); |
969 |
} |
978 |
} |
970 |
|
979 |
|
971 |
void* __ke_high_memory(void) |
980 |
void* ATI_API_CALL __ke_high_memory(void) |
972 |
{ |
981 |
{ |
973 |
return high_memory; |
982 |
return high_memory; |
974 |
} |
983 |
} |
975 |
|
984 |
|
976 |
int __ke_pci_enable_device(__ke_pci_dev_t* dev) |
985 |
int ATI_API_CALL __ke_pci_enable_device(__ke_pci_dev_t* dev) |
977 |
{ |
986 |
{ |
978 |
return (pci_enable_device( (struct pci_dev*)(void *)dev )); |
987 |
return (pci_enable_device( (struct pci_dev*)(void *)dev )); |
979 |
} |
988 |
} |
980 |
|
989 |
|
981 |
#if defined(__x86_64__) || defined(__ia64__) |
990 |
#if defined(__x86_64__) || defined(__ia64__) |
982 |
void* __ke_pci_alloc_consistent(__ke_pci_dev_t* dev, int size, void *dma_handle) |
991 |
void* ATI_API_CALL __ke_pci_alloc_consistent(__ke_pci_dev_t* dev, int size, void *dma_handle) |
983 |
{ |
992 |
{ |
984 |
return (pci_alloc_consistent( (struct pci_dev*)(void *)dev, size, dma_handle)); |
993 |
return (pci_alloc_consistent( (struct pci_dev*)(void *)dev, size, dma_handle)); |
985 |
} |
994 |
} |
986 |
|
995 |
|
987 |
void __ke_pci_free_consistent(__ke_pci_dev_t* dev, int size, unsigned long cpu_addr, |
996 |
void ATI_API_CALL __ke_pci_free_consistent(__ke_pci_dev_t* dev, int size, unsigned long cpu_addr, |
988 |
unsigned int dma_handle) |
997 |
unsigned int dma_handle) |
989 |
{ |
998 |
{ |
990 |
pci_free_consistent( (struct pci_dev*)(void *)dev, size, (void *)cpu_addr, |
999 |
pci_free_consistent( (struct pci_dev*)(void *)dev, size, (void *)cpu_addr, |
Lines 994-1000
Link Here
|
994 |
|
1003 |
|
995 |
/*****************************************************************************/ |
1004 |
/*****************************************************************************/ |
996 |
|
1005 |
|
997 |
int __ke_error_code(enum __ke_error_num errcode) |
1006 |
int ATI_API_CALL __ke_error_code(enum __ke_error_num errcode) |
998 |
{ |
1007 |
{ |
999 |
switch (errcode) |
1008 |
switch (errcode) |
1000 |
{ |
1009 |
{ |
Lines 1029-1035
Link Here
|
1029 |
|
1038 |
|
1030 |
/*****************************************************************************/ |
1039 |
/*****************************************************************************/ |
1031 |
|
1040 |
|
1032 |
void __ke_mod_inc_use_count(void) |
1041 |
void ATI_API_CALL __ke_mod_inc_use_count(void) |
1033 |
{ |
1042 |
{ |
1034 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) |
1043 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) |
1035 |
__module_get(THIS_MODULE); |
1044 |
__module_get(THIS_MODULE); |
Lines 1038-1044
Link Here
|
1038 |
#endif |
1047 |
#endif |
1039 |
} |
1048 |
} |
1040 |
|
1049 |
|
1041 |
void __ke_mod_dec_use_count(void) |
1050 |
void ATI_API_CALL __ke_mod_dec_use_count(void) |
1042 |
{ |
1051 |
{ |
1043 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) |
1052 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) |
1044 |
module_put(THIS_MODULE); |
1053 |
module_put(THIS_MODULE); |
Lines 1049-1134
Link Here
|
1049 |
|
1058 |
|
1050 |
/*****************************************************************************/ |
1059 |
/*****************************************************************************/ |
1051 |
|
1060 |
|
1052 |
void __ke_down_struct_sem(__ke_device_t *dev, int index) |
1061 |
void ATI_API_CALL __ke_down_struct_sem(__ke_device_t *dev, int index) |
1053 |
{ |
1062 |
{ |
1054 |
down(&(((device_t*)dev)->struct_sem[index])); |
1063 |
down(&(((device_t*)dev)->struct_sem[index])); |
1055 |
} |
1064 |
} |
1056 |
|
1065 |
|
1057 |
void __ke_up_struct_sem(__ke_device_t *dev, int index) |
1066 |
void ATI_API_CALL __ke_up_struct_sem(__ke_device_t *dev, int index) |
1058 |
{ |
1067 |
{ |
1059 |
up(&(((device_t*)dev)->struct_sem[index])); |
1068 |
up(&(((device_t*)dev)->struct_sem[index])); |
1060 |
} |
1069 |
} |
1061 |
|
1070 |
|
1062 |
void __ke_sema_init(struct semaphore* sem, int value) |
1071 |
void ATI_API_CALL __ke_sema_init(struct semaphore* sem, int value) |
1063 |
{ |
1072 |
{ |
1064 |
sema_init(sem, value); |
1073 |
sema_init(sem, value); |
1065 |
} |
1074 |
} |
1066 |
|
1075 |
|
1067 |
__ke_size_t __ke_sema_size(void) |
1076 |
__ke_size_t ATI_API_CALL __ke_sema_size(void) |
1068 |
{ |
1077 |
{ |
1069 |
return sizeof(struct semaphore); |
1078 |
return sizeof(struct semaphore); |
1070 |
} |
1079 |
} |
1071 |
|
1080 |
|
1072 |
void __ke_down(struct semaphore* sem) |
1081 |
void ATI_API_CALL __ke_down(struct semaphore* sem) |
1073 |
{ |
1082 |
{ |
1074 |
down(sem); |
1083 |
down(sem); |
1075 |
} |
1084 |
} |
1076 |
|
1085 |
|
1077 |
void __ke_up(struct semaphore* sem) |
1086 |
void ATI_API_CALL __ke_up(struct semaphore* sem) |
1078 |
{ |
1087 |
{ |
1079 |
up(sem); |
1088 |
up(sem); |
1080 |
} |
1089 |
} |
1081 |
|
1090 |
|
1082 |
/*****************************************************************************/ |
1091 |
/*****************************************************************************/ |
1083 |
|
1092 |
|
1084 |
void __ke_atomic_inc(void* v) |
1093 |
void ATI_API_CALL __ke_atomic_inc(void* v) |
1085 |
{ |
1094 |
{ |
1086 |
atomic_inc((atomic_t*)v); |
1095 |
atomic_inc((atomic_t*)v); |
1087 |
} |
1096 |
} |
1088 |
|
1097 |
|
1089 |
void __ke_atomic_dec(void* v) |
1098 |
void ATI_API_CALL __ke_atomic_dec(void* v) |
1090 |
{ |
1099 |
{ |
1091 |
atomic_dec((atomic_t*)v); |
1100 |
atomic_dec((atomic_t*)v); |
1092 |
} |
1101 |
} |
1093 |
|
1102 |
|
1094 |
void __ke_atomic_add(int val, void* v) |
1103 |
void ATI_API_CALL __ke_atomic_add(int val, void* v) |
1095 |
{ |
1104 |
{ |
1096 |
atomic_add(val, (atomic_t*)v); |
1105 |
atomic_add(val, (atomic_t*)v); |
1097 |
} |
1106 |
} |
1098 |
|
1107 |
|
1099 |
void __ke_atomic_sub(int val, void* v) |
1108 |
void ATI_API_CALL __ke_atomic_sub(int val, void* v) |
1100 |
{ |
1109 |
{ |
1101 |
atomic_sub(val, (atomic_t*)v); |
1110 |
atomic_sub(val, (atomic_t*)v); |
1102 |
} |
1111 |
} |
1103 |
|
1112 |
|
1104 |
int __ke_atomic_read(void* v) |
1113 |
int ATI_API_CALL __ke_atomic_read(void* v) |
1105 |
{ |
1114 |
{ |
1106 |
return atomic_read((atomic_t*)v); |
1115 |
return atomic_read((atomic_t*)v); |
1107 |
} |
1116 |
} |
1108 |
|
1117 |
|
1109 |
void __ke_atomic_set(void* v, int val) |
1118 |
void ATI_API_CALL __ke_atomic_set(void* v, int val) |
1110 |
{ |
1119 |
{ |
1111 |
atomic_set((atomic_t*)v, val); |
1120 |
atomic_set((atomic_t*)v, val); |
1112 |
} |
1121 |
} |
1113 |
|
1122 |
|
1114 |
/*****************************************************************************/ |
1123 |
/*****************************************************************************/ |
1115 |
|
1124 |
|
1116 |
void __ke_spin_lock(__ke_device_t *dev, int ndx) |
1125 |
void ATI_API_CALL __ke_spin_lock(__ke_device_t *dev, int ndx) |
1117 |
{ |
1126 |
{ |
1118 |
spin_lock(&(((device_t*)dev)->spinlock[ndx])); |
1127 |
spin_lock(&(((device_t*)dev)->spinlock[ndx])); |
1119 |
} |
1128 |
} |
1120 |
|
1129 |
|
1121 |
void __ke_spin_unlock(__ke_device_t *dev __attribute__((unused)), int ndx __attribute__((unused))) |
1130 |
void ATI_API_CALL __ke_spin_unlock(__ke_device_t *dev __attribute__((unused)), int ndx __attribute__((unused))) |
1122 |
{ |
1131 |
{ |
1123 |
spin_unlock(&(((device_t*)dev)->spinlock[ndx])); |
1132 |
spin_unlock(&(((device_t*)dev)->spinlock[ndx])); |
1124 |
} |
1133 |
} |
1125 |
|
1134 |
|
1126 |
void __ke_lock_kernel(void) |
1135 |
void ATI_API_CALL __ke_lock_kernel(void) |
1127 |
{ |
1136 |
{ |
1128 |
lock_kernel(); |
1137 |
lock_kernel(); |
1129 |
} |
1138 |
} |
1130 |
|
1139 |
|
1131 |
void __ke_unlock_kernel(void) |
1140 |
void ATI_API_CALL __ke_unlock_kernel(void) |
1132 |
{ |
1141 |
{ |
1133 |
unlock_kernel(); |
1142 |
unlock_kernel(); |
1134 |
} |
1143 |
} |
Lines 1143-1149
Link Here
|
1143 |
typedef int (*PFNMUNLOCK)(unsigned long start, __ke_size_t len); |
1152 |
typedef int (*PFNMUNLOCK)(unsigned long start, __ke_size_t len); |
1144 |
|
1153 |
|
1145 |
|
1154 |
|
1146 |
int __ke_sys_mlock(unsigned long start, __ke_size_t len) |
1155 |
int ATI_API_CALL __ke_sys_mlock(unsigned long start, __ke_size_t len) |
1147 |
{ |
1156 |
{ |
1148 |
#ifdef FGL_USE_SCT |
1157 |
#ifdef FGL_USE_SCT |
1149 |
PFNMLOCK sys_mlock = (PFNMLOCK)sys_call_table[__NR_mlock]; |
1158 |
PFNMLOCK sys_mlock = (PFNMLOCK)sys_call_table[__NR_mlock]; |
Lines 1158-1164
Link Here
|
1158 |
#endif |
1167 |
#endif |
1159 |
} |
1168 |
} |
1160 |
|
1169 |
|
1161 |
int __ke_sys_munlock(unsigned long start, __ke_size_t len) |
1170 |
int ATI_API_CALL __ke_sys_munlock(unsigned long start, __ke_size_t len) |
1162 |
{ |
1171 |
{ |
1163 |
#ifdef FGL_USE_SCT |
1172 |
#ifdef FGL_USE_SCT |
1164 |
PFNMUNLOCK sys_munlock = (PFNMUNLOCK)sys_call_table[__NR_munlock]; |
1173 |
PFNMUNLOCK sys_munlock = (PFNMUNLOCK)sys_call_table[__NR_munlock]; |
Lines 1176-1182
Link Here
|
1176 |
|
1185 |
|
1177 |
typedef int (*PFNMODIFYLDT)(int func, void *ptr, unsigned long bytecount); |
1186 |
typedef int (*PFNMODIFYLDT)(int func, void *ptr, unsigned long bytecount); |
1178 |
|
1187 |
|
1179 |
int __ke_sys_modify_ldt(int func, void *ptr, unsigned long bytecount) |
1188 |
int ATI_API_CALL __ke_sys_modify_ldt(int func, void *ptr, unsigned long bytecount) |
1180 |
{ |
1189 |
{ |
1181 |
#ifdef FGL_USE_SCT |
1190 |
#ifdef FGL_USE_SCT |
1182 |
PFNMODIFYLDT sys_modify_ldt = (PFNMODIFYLDT)sys_call_table[__NR_modify_ldt]; |
1191 |
PFNMODIFYLDT sys_modify_ldt = (PFNMODIFYLDT)sys_call_table[__NR_modify_ldt]; |
Lines 1201-1207
Link Here
|
1201 |
#ifdef __KE_NO_VSPRINTF |
1210 |
#ifdef __KE_NO_VSPRINTF |
1202 |
|
1211 |
|
1203 |
#if LINUX_VERSION_CODE >= 0x020400 |
1212 |
#if LINUX_VERSION_CODE >= 0x020400 |
1204 |
void __ke_printk(const char* fmt, ...) |
1213 |
void ATI_API_CALL __ke_printk(const char* fmt, ...) |
1205 |
{ |
1214 |
{ |
1206 |
char buffer[256]; |
1215 |
char buffer[256]; |
1207 |
va_list marker; |
1216 |
va_list marker; |
Lines 1232-1238
Link Here
|
1232 |
|
1241 |
|
1233 |
#else |
1242 |
#else |
1234 |
|
1243 |
|
1235 |
void __ke_print_info(const char* fmt, ...) |
1244 |
void ATI_API_CALL __ke_print_info(const char* fmt, ...) |
1236 |
{ |
1245 |
{ |
1237 |
char msg[256] = KERN_INFO;: |
1246 |
char msg[256] = KERN_INFO;: |
1238 |
va_list marker; |
1247 |
va_list marker; |
Lines 1242-1248
Link Here
|
1242 |
va_end(marker); |
1251 |
va_end(marker); |
1243 |
} |
1252 |
} |
1244 |
|
1253 |
|
1245 |
void __ke_print_error(const char* fmt, ...) |
1254 |
void ATI_API_CALL __ke_print_error(const char* fmt, ...) |
1246 |
{ |
1255 |
{ |
1247 |
char msg[256] = KERN_ERR; |
1256 |
char msg[256] = KERN_ERR; |
1248 |
va_list marker; |
1257 |
va_list marker; |
Lines 1252-1258
Link Here
|
1252 |
va_end(marker); |
1261 |
va_end(marker); |
1253 |
} |
1262 |
} |
1254 |
|
1263 |
|
1255 |
void __ke_print_debug(const char* fmt, ...) |
1264 |
void ATI_API_CALL __ke_print_debug(const char* fmt, ...) |
1256 |
{ |
1265 |
{ |
1257 |
char msg[256] = KERN_DEBUG; |
1266 |
char msg[256] = KERN_DEBUG; |
1258 |
va_list marker; |
1267 |
va_list marker; |
Lines 1266-1272
Link Here
|
1266 |
|
1275 |
|
1267 |
/*****************************************************************************/ |
1276 |
/*****************************************************************************/ |
1268 |
|
1277 |
|
1269 |
int __ke_capable(enum __ke_cap cap) |
1278 |
int ATI_API_CALL __ke_capable(enum __ke_cap cap) |
1270 |
{ |
1279 |
{ |
1271 |
switch (cap) |
1280 |
switch (cap) |
1272 |
{ |
1281 |
{ |
Lines 1282-1288
Link Here
|
1282 |
return capable(cap); |
1291 |
return capable(cap); |
1283 |
} |
1292 |
} |
1284 |
|
1293 |
|
1285 |
void __ke_cap_effective_raise(enum __ke_cap cap) |
1294 |
void ATI_API_CALL __ke_cap_effective_raise(enum __ke_cap cap) |
1286 |
{ |
1295 |
{ |
1287 |
switch (cap) |
1296 |
switch (cap) |
1288 |
{ |
1297 |
{ |
Lines 1298-1314
Link Here
|
1298 |
cap_raise(current->cap_effective, cap); |
1307 |
cap_raise(current->cap_effective, cap); |
1299 |
} |
1308 |
} |
1300 |
|
1309 |
|
1301 |
__ke_u32 __ke_get_cap_effective() |
1310 |
__ke_u32 ATI_API_CALL __ke_get_cap_effective() |
1302 |
{ |
1311 |
{ |
1303 |
return cap_t(current->cap_effective); |
1312 |
return cap_t(current->cap_effective); |
1304 |
} |
1313 |
} |
1305 |
|
1314 |
|
1306 |
void __ke_set_cap_effective(__ke_u32 cap) |
1315 |
void ATI_API_CALL __ke_set_cap_effective(__ke_u32 cap) |
1307 |
{ |
1316 |
{ |
1308 |
cap_t(current->cap_effective) = cap; |
1317 |
cap_t(current->cap_effective) = cap; |
1309 |
} |
1318 |
} |
1310 |
|
1319 |
|
1311 |
unsigned long __ke_ram_available(void) |
1320 |
unsigned long ATI_API_CALL __ke_ram_available(void) |
1312 |
{ |
1321 |
{ |
1313 |
struct sysinfo si; |
1322 |
struct sysinfo si; |
1314 |
|
1323 |
|
Lines 1321-1342
Link Here
|
1321 |
#endif |
1330 |
#endif |
1322 |
} |
1331 |
} |
1323 |
|
1332 |
|
1324 |
int __ke_copy_from_user(void* to, const void* from, __ke_size_t size) |
1333 |
int ATI_API_CALL __ke_copy_from_user(void* to, const void* from, __ke_size_t size) |
1325 |
{ |
1334 |
{ |
1326 |
return copy_from_user(to, from, size); |
1335 |
return copy_from_user(to, from, size); |
1327 |
} |
1336 |
} |
1328 |
|
1337 |
|
1329 |
int __ke_copy_to_user(void* to, const void* from, __ke_size_t size) |
1338 |
int ATI_API_CALL __ke_copy_to_user(void* to, const void* from, __ke_size_t size) |
1330 |
{ |
1339 |
{ |
1331 |
return copy_to_user(to, from, size); |
1340 |
return copy_to_user(to, from, size); |
1332 |
} |
1341 |
} |
1333 |
|
1342 |
|
1334 |
int __ke_verify_area(int type, const void * addr, unsigned long size) |
1343 |
int ATI_API_CALL __ke_verify_area(int type, const void * addr, unsigned long size) |
1335 |
{ |
1344 |
{ |
1336 |
return verify_area(type, addr, size); |
1345 |
return verify_area(type, addr, size); |
1337 |
} |
1346 |
} |
1338 |
|
1347 |
|
1339 |
int __ke_get_pci_device_info(__ke_pci_dev_t* dev, __ke_pci_device_info_t *pinfo) |
1348 |
int ATI_API_CALL __ke_get_pci_device_info(__ke_pci_dev_t* dev, __ke_pci_device_info_t *pinfo) |
1340 |
{ |
1349 |
{ |
1341 |
if ( dev ) |
1350 |
if ( dev ) |
1342 |
{ |
1351 |
{ |
Lines 1348-1354
Link Here
|
1348 |
return -EINVAL; |
1357 |
return -EINVAL; |
1349 |
} |
1358 |
} |
1350 |
|
1359 |
|
1351 |
int __ke_check_pci(int busnum, int devnum, int funcnum, __ke_u16* vendor, __ke_u16* device, unsigned int* irq) |
1360 |
int ATI_API_CALL __ke_check_pci(int busnum, int devnum, int funcnum, __ke_u16* vendor, __ke_u16* device, unsigned int* irq) |
1352 |
{ |
1361 |
{ |
1353 |
struct pci_dev* pci_dev; |
1362 |
struct pci_dev* pci_dev; |
1354 |
|
1363 |
|
Lines 1368-1374
Link Here
|
1368 |
return 1; |
1377 |
return 1; |
1369 |
} |
1378 |
} |
1370 |
|
1379 |
|
1371 |
int __ke_pci_get_irq(__ke_pci_dev_t *dev, unsigned int* irq) |
1380 |
int ATI_API_CALL __ke_pci_get_irq(__ke_pci_dev_t *dev, unsigned int* irq) |
1372 |
{ |
1381 |
{ |
1373 |
if (!dev) |
1382 |
if (!dev) |
1374 |
return 0; |
1383 |
return 0; |
Lines 1379-1430
Link Here
|
1379 |
return 1; |
1388 |
return 1; |
1380 |
} |
1389 |
} |
1381 |
|
1390 |
|
1382 |
__ke_pci_dev_t* __ke_pci_find_device (unsigned int vendor, unsigned int dev, __ke_pci_dev_t* from) |
1391 |
__ke_pci_dev_t* ATI_API_CALL __ke_pci_find_device (unsigned int vendor, unsigned int dev, __ke_pci_dev_t* from) |
1383 |
{ |
1392 |
{ |
1384 |
return (__ke_pci_dev_t*)pci_find_device( vendor, dev, (struct pci_dev *)(void *)from ); |
1393 |
return (__ke_pci_dev_t*)pci_find_device( vendor, dev, (struct pci_dev *)(void *)from ); |
1385 |
} |
1394 |
} |
1386 |
|
1395 |
|
1387 |
void* __ke_malloc(__ke_size_t size) |
1396 |
void* ATI_API_CALL __ke_malloc(__ke_size_t size) |
1388 |
{ |
1397 |
{ |
1389 |
return kmalloc(size, GFP_KERNEL); |
1398 |
return kmalloc(size, GFP_KERNEL); |
1390 |
} |
1399 |
} |
1391 |
|
1400 |
|
1392 |
void __ke_free_s(void* p, __ke_size_t size) |
1401 |
void ATI_API_CALL __ke_free_s(void* p, __ke_size_t size) |
1393 |
{ |
1402 |
{ |
1394 |
kfree(p); |
1403 |
kfree(p); |
1395 |
} |
1404 |
} |
1396 |
|
1405 |
|
1397 |
void* __ke_vmalloc(__ke_size_t size) |
1406 |
void* ATI_API_CALL __ke_vmalloc(__ke_size_t size) |
1398 |
{ |
1407 |
{ |
1399 |
return vmalloc(size); |
1408 |
return vmalloc(size); |
1400 |
} |
1409 |
} |
1401 |
|
1410 |
|
1402 |
void __ke_vfree(void* p) |
1411 |
void ATI_API_CALL __ke_vfree(void* p) |
1403 |
{ |
1412 |
{ |
1404 |
return vfree(p); |
1413 |
return vfree(p); |
1405 |
} |
1414 |
} |
1406 |
|
1415 |
|
1407 |
void* __ke_get_free_page(void) |
1416 |
void* ATI_API_CALL __ke_get_free_page(void) |
1408 |
{ |
1417 |
{ |
1409 |
return (void*)__get_free_page(GFP_KERNEL); |
1418 |
return (void*)__get_free_page(GFP_KERNEL); |
1410 |
} |
1419 |
} |
1411 |
|
1420 |
|
1412 |
void* __ke_get_free_pages(int order) |
1421 |
void* ATI_API_CALL __ke_get_free_pages(int order) |
1413 |
{ |
1422 |
{ |
1414 |
return (void*)__get_free_pages(GFP_KERNEL, order); |
1423 |
return (void*)__get_free_pages(GFP_KERNEL, order); |
1415 |
} |
1424 |
} |
1416 |
|
1425 |
|
1417 |
void __ke_free_page(void* pt) |
1426 |
void ATI_API_CALL __ke_free_page(void* pt) |
1418 |
{ |
1427 |
{ |
1419 |
free_page((unsigned long)pt); |
1428 |
free_page((unsigned long)pt); |
1420 |
} |
1429 |
} |
1421 |
|
1430 |
|
1422 |
void __ke_free_pages(void* pt, int order) |
1431 |
void ATI_API_CALL __ke_free_pages(void* pt, int order) |
1423 |
{ |
1432 |
{ |
1424 |
free_pages((unsigned long)pt, order); |
1433 |
free_pages((unsigned long)pt, order); |
1425 |
} |
1434 |
} |
1426 |
|
1435 |
|
1427 |
void __ke_mem_map_reserve(void* pt) |
1436 |
void ATI_API_CALL __ke_mem_map_reserve(void* pt) |
1428 |
{ |
1437 |
{ |
1429 |
#if LINUX_VERSION_CODE < 0x020400 |
1438 |
#if LINUX_VERSION_CODE < 0x020400 |
1430 |
mem_map_reserve(MAP_NR((unsigned long)pt)); |
1439 |
mem_map_reserve(MAP_NR((unsigned long)pt)); |
Lines 1437-1443
Link Here
|
1437 |
#endif |
1446 |
#endif |
1438 |
} |
1447 |
} |
1439 |
|
1448 |
|
1440 |
void __ke_mem_map_unreserve(void* pt) |
1449 |
void ATI_API_CALL __ke_mem_map_unreserve(void* pt) |
1441 |
{ |
1450 |
{ |
1442 |
#if LINUX_VERSION_CODE < 0x020400 |
1451 |
#if LINUX_VERSION_CODE < 0x020400 |
1443 |
mem_map_unreserve(MAP_NR((unsigned long)pt)); |
1452 |
mem_map_unreserve(MAP_NR((unsigned long)pt)); |
Lines 1450-1456
Link Here
|
1450 |
#endif |
1459 |
#endif |
1451 |
} |
1460 |
} |
1452 |
|
1461 |
|
1453 |
void __ke_virt_reserve(void* virt) |
1462 |
void ATI_API_CALL __ke_virt_reserve(void* virt) |
1454 |
{ |
1463 |
{ |
1455 |
#if LINUX_VERSION_CODE < 0x020400 |
1464 |
#if LINUX_VERSION_CODE < 0x020400 |
1456 |
set_bit(PG_reserved, |
1465 |
set_bit(PG_reserved, |
Lines 1461-1467
Link Here
|
1461 |
#endif |
1470 |
#endif |
1462 |
} |
1471 |
} |
1463 |
|
1472 |
|
1464 |
void __ke_virt_unreserve(void* virt) |
1473 |
void ATI_API_CALL __ke_virt_unreserve(void* virt) |
1465 |
{ |
1474 |
{ |
1466 |
#if LINUX_VERSION_CODE < 0x020400 |
1475 |
#if LINUX_VERSION_CODE < 0x020400 |
1467 |
clear_bit(PG_reserved, |
1476 |
clear_bit(PG_reserved, |
Lines 1473-1520
Link Here
|
1473 |
} |
1482 |
} |
1474 |
|
1483 |
|
1475 |
#ifdef __ia64__ |
1484 |
#ifdef __ia64__ |
1476 |
void* __ke_get_vmptr( struct _agp_memory* memory ) |
1485 |
void* ATI_API_CALL __ke_get_vmptr( struct _agp_memory* memory ) |
1477 |
{ |
1486 |
{ |
1478 |
return memory->vmptr; |
1487 |
return memory->vmptr; |
1479 |
} |
1488 |
} |
1480 |
#endif |
1489 |
#endif |
1481 |
|
1490 |
|
1482 |
void* __ke_ioremap(unsigned long offset, unsigned long size) |
1491 |
void* ATI_API_CALL __ke_ioremap(unsigned long offset, unsigned long size) |
1483 |
{ |
1492 |
{ |
1484 |
return ioremap(offset, size); |
1493 |
return ioremap(offset, size); |
1485 |
} |
1494 |
} |
1486 |
|
1495 |
|
1487 |
void* __ke_ioremap_nocache(unsigned long offset, unsigned long size) |
1496 |
void* ATI_API_CALL __ke_ioremap_nocache(unsigned long offset, unsigned long size) |
1488 |
{ |
1497 |
{ |
1489 |
return ioremap_nocache(offset, size); |
1498 |
return ioremap_nocache(offset, size); |
1490 |
} |
1499 |
} |
1491 |
|
1500 |
|
1492 |
void __ke_iounmap(void* pt) |
1501 |
void ATI_API_CALL __ke_iounmap(void* pt) |
1493 |
{ |
1502 |
{ |
1494 |
iounmap(pt); |
1503 |
iounmap(pt); |
1495 |
} |
1504 |
} |
1496 |
|
1505 |
|
1497 |
int __ke_verify_read_access(void* addr, __ke_size_t size) |
1506 |
int ATI_API_CALL __ke_verify_read_access(void* addr, __ke_size_t size) |
1498 |
{ |
1507 |
{ |
1499 |
return access_ok(VERIFY_READ, addr, size) ? 0 : -EFAULT; |
1508 |
return access_ok(VERIFY_READ, addr, size) ? 0 : -EFAULT; |
1500 |
} |
1509 |
} |
1501 |
|
1510 |
|
1502 |
int __ke_verify_write_access(void* addr, __ke_size_t size) |
1511 |
int ATI_API_CALL __ke_verify_write_access(void* addr, __ke_size_t size) |
1503 |
{ |
1512 |
{ |
1504 |
return access_ok(VERIFY_WRITE, addr, size) ? 0 : -EFAULT; |
1513 |
return access_ok(VERIFY_WRITE, addr, size) ? 0 : -EFAULT; |
1505 |
} |
1514 |
} |
1506 |
|
1515 |
|
1507 |
struct mm_struct* __ke_init_mm(void) |
1516 |
struct mm_struct* ATI_API_CALL __ke_init_mm(void) |
1508 |
{ |
1517 |
{ |
1509 |
return &init_mm; |
1518 |
return &init_mm; |
1510 |
} |
1519 |
} |
1511 |
|
1520 |
|
1512 |
struct mm_struct* __ke_current_mm(void) |
1521 |
struct mm_struct* ATI_API_CALL __ke_current_mm(void) |
1513 |
{ |
1522 |
{ |
1514 |
return current->mm; |
1523 |
return current->mm; |
1515 |
} |
1524 |
} |
1516 |
|
1525 |
|
1517 |
unsigned long __ke_get_vm_phys_addr(struct mm_struct* mm, unsigned long virtual_addr) |
1526 |
unsigned long ATI_API_CALL __ke_get_vm_phys_addr(struct mm_struct* mm, unsigned long virtual_addr) |
1518 |
{ |
1527 |
{ |
1519 |
unsigned long pte_linear; |
1528 |
unsigned long pte_linear; |
1520 |
pgd_t* pgd_p; |
1529 |
pgd_t* pgd_p; |
Lines 1549-1555
Link Here
|
1549 |
#endif /* LINUX_VERSION_CODE < 0x020400 */ |
1558 |
#endif /* LINUX_VERSION_CODE < 0x020400 */ |
1550 |
} |
1559 |
} |
1551 |
|
1560 |
|
1552 |
unsigned long* __ke_get_vm_phys_addr_list(struct mm_struct* mm, unsigned long virtual_addr, unsigned long pages) |
1561 |
unsigned long* ATI_API_CALL __ke_get_vm_phys_addr_list(struct mm_struct* mm, unsigned long virtual_addr, unsigned long pages) |
1553 |
{ |
1562 |
{ |
1554 |
unsigned long *phys_table, *pt; |
1563 |
unsigned long *phys_table, *pt; |
1555 |
unsigned long n, va; |
1564 |
unsigned long n, va; |
Lines 1571-1612
Link Here
|
1571 |
return phys_table; |
1580 |
return phys_table; |
1572 |
} |
1581 |
} |
1573 |
|
1582 |
|
1574 |
void* __ke_memset(void* s, int c, __ke_size_t count) |
1583 |
void* ATI_API_CALL __ke_memset(void* s, int c, __ke_size_t count) |
1575 |
{ |
1584 |
{ |
1576 |
return memset(s, c, count); |
1585 |
return memset(s, c, count); |
1577 |
} |
1586 |
} |
1578 |
|
1587 |
|
1579 |
void* __ke_memcpy(void* d, const void* s, __ke_size_t count) |
1588 |
void* ATI_API_CALL __ke_memcpy(void* d, const void* s, __ke_size_t count) |
1580 |
{ |
1589 |
{ |
1581 |
return memcpy(d, s, count); |
1590 |
return memcpy(d, s, count); |
1582 |
} |
1591 |
} |
1583 |
|
1592 |
|
1584 |
__ke_size_t __ke_strlen(const char *s) |
1593 |
__ke_size_t ATI_API_CALL __ke_strlen(const char *s) |
1585 |
{ |
1594 |
{ |
1586 |
return strlen(s); |
1595 |
return strlen(s); |
1587 |
} |
1596 |
} |
1588 |
|
1597 |
|
1589 |
char* __ke_strcpy(char* d, const char* s) |
1598 |
char* ATI_API_CALL __ke_strcpy(char* d, const char* s) |
1590 |
{ |
1599 |
{ |
1591 |
return strcpy(d, s); |
1600 |
return strcpy(d, s); |
1592 |
} |
1601 |
} |
1593 |
|
1602 |
|
1594 |
char* __ke_strncpy(char* d, const char* s, __ke_size_t count) |
1603 |
char* ATI_API_CALL __ke_strncpy(char* d, const char* s, __ke_size_t count) |
1595 |
{ |
1604 |
{ |
1596 |
return strncpy(d, s, count); |
1605 |
return strncpy(d, s, count); |
1597 |
} |
1606 |
} |
1598 |
|
1607 |
|
1599 |
int __ke_strcmp(const char* string1, const char* string2) |
1608 |
int ATI_API_CALL __ke_strcmp(const char* string1, const char* string2) |
1600 |
{ |
1609 |
{ |
1601 |
return strcmp(string1, string2); |
1610 |
return strcmp(string1, string2); |
1602 |
} |
1611 |
} |
1603 |
|
1612 |
|
1604 |
int __ke_strncmp(const char* string1, const char* string2, __ke_size_t count) |
1613 |
int ATI_API_CALL __ke_strncmp(const char* string1, const char* string2, __ke_size_t count) |
1605 |
{ |
1614 |
{ |
1606 |
return strncmp(string1, string2, count); |
1615 |
return strncmp(string1, string2, count); |
1607 |
} |
1616 |
} |
1608 |
|
1617 |
|
1609 |
int __ke_sprintf(char* buf, const char* fmt, ...) |
1618 |
int ATI_API_CALL __ke_sprintf(char* buf, const char* fmt, ...) |
1610 |
{ |
1619 |
{ |
1611 |
va_list marker; |
1620 |
va_list marker; |
1612 |
|
1621 |
|
Lines 1619-1630
Link Here
|
1619 |
|
1628 |
|
1620 |
/*****************************************************************************/ |
1629 |
/*****************************************************************************/ |
1621 |
|
1630 |
|
1622 |
void __ke_set_bit(int nr, volatile void * addr) |
1631 |
void ATI_API_CALL __ke_set_bit(int nr, volatile void * addr) |
1623 |
{ |
1632 |
{ |
1624 |
set_bit(nr, addr); |
1633 |
set_bit(nr, addr); |
1625 |
} |
1634 |
} |
1626 |
|
1635 |
|
1627 |
void __ke_clear_bit(int nr, volatile void * addr) |
1636 |
void ATI_API_CALL __ke_clear_bit(int nr, volatile void * addr) |
1628 |
{ |
1637 |
{ |
1629 |
clear_bit(nr, addr); |
1638 |
clear_bit(nr, addr); |
1630 |
} |
1639 |
} |
Lines 1649-1655
Link Here
|
1649 |
} |
1658 |
} |
1650 |
#endif /* __SMP__ */ |
1659 |
#endif /* __SMP__ */ |
1651 |
|
1660 |
|
1652 |
int __ke_flush_cache(void) |
1661 |
int ATI_API_CALL __ke_flush_cache(void) |
1653 |
{ |
1662 |
{ |
1654 |
#ifdef __SMP__ |
1663 |
#ifdef __SMP__ |
1655 |
#if LINUX_VERSION_CODE < 0x020501 |
1664 |
#if LINUX_VERSION_CODE < 0x020501 |
Lines 1685-1691
Link Here
|
1685 |
|
1694 |
|
1686 |
/*****************************************************************************/ |
1695 |
/*****************************************************************************/ |
1687 |
|
1696 |
|
1688 |
int __ke_config_mtrr(void) |
1697 |
int ATI_API_CALL __ke_config_mtrr(void) |
1689 |
{ |
1698 |
{ |
1690 |
#ifdef CONFIG_MTRR |
1699 |
#ifdef CONFIG_MTRR |
1691 |
return 1; |
1700 |
return 1; |
Lines 1694-1700
Link Here
|
1694 |
#endif /* !CONFIG_MTRR */ |
1703 |
#endif /* !CONFIG_MTRR */ |
1695 |
} |
1704 |
} |
1696 |
|
1705 |
|
1697 |
int __ke_mtrr_add_wc(unsigned long base, unsigned long size) |
1706 |
int ATI_API_CALL __ke_mtrr_add_wc(unsigned long base, unsigned long size) |
1698 |
{ |
1707 |
{ |
1699 |
#ifdef CONFIG_MTRR |
1708 |
#ifdef CONFIG_MTRR |
1700 |
return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); |
1709 |
return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); |
Lines 1703-1709
Link Here
|
1703 |
#endif /* !CONFIG_MTRR */ |
1712 |
#endif /* !CONFIG_MTRR */ |
1704 |
} |
1713 |
} |
1705 |
|
1714 |
|
1706 |
int __ke_mtrr_del(int reg, unsigned long base, unsigned long size) |
1715 |
int ATI_API_CALL __ke_mtrr_del(int reg, unsigned long base, unsigned long size) |
1707 |
{ |
1716 |
{ |
1708 |
#ifdef CONFIG_MTRR |
1717 |
#ifdef CONFIG_MTRR |
1709 |
return mtrr_del(reg, base, size); |
1718 |
return mtrr_del(reg, base, size); |
Lines 1714-1777
Link Here
|
1714 |
|
1723 |
|
1715 |
/*****************************************************************************/ |
1724 |
/*****************************************************************************/ |
1716 |
|
1725 |
|
1717 |
int __ke_pci_read_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 *val) |
1726 |
int ATI_API_CALL __ke_pci_read_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 *val) |
1718 |
{ |
1727 |
{ |
1719 |
return pci_read_config_byte((struct pci_dev*)(void *)dev, where, val); |
1728 |
return pci_read_config_byte((struct pci_dev*)(void *)dev, where, val); |
1720 |
} |
1729 |
} |
1721 |
|
1730 |
|
1722 |
int __ke_pci_read_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 *val) |
1731 |
int ATI_API_CALL __ke_pci_read_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 *val) |
1723 |
{ |
1732 |
{ |
1724 |
return pci_read_config_word((struct pci_dev*)(void *)dev, where, val); |
1733 |
return pci_read_config_word((struct pci_dev*)(void *)dev, where, val); |
1725 |
} |
1734 |
} |
1726 |
|
1735 |
|
1727 |
int __ke_pci_read_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 *val) |
1736 |
int ATI_API_CALL __ke_pci_read_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 *val) |
1728 |
{ |
1737 |
{ |
1729 |
return pci_read_config_dword((struct pci_dev*)(void *)dev, where, val); |
1738 |
return pci_read_config_dword((struct pci_dev*)(void *)dev, where, val); |
1730 |
} |
1739 |
} |
1731 |
|
1740 |
|
1732 |
int __ke_pci_write_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 val) |
1741 |
int ATI_API_CALL __ke_pci_write_config_byte(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u8 val) |
1733 |
{ |
1742 |
{ |
1734 |
return pci_write_config_byte((struct pci_dev*)(void *)dev, where, val); |
1743 |
return pci_write_config_byte((struct pci_dev*)(void *)dev, where, val); |
1735 |
} |
1744 |
} |
1736 |
|
1745 |
|
1737 |
int __ke_pci_write_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 val) |
1746 |
int ATI_API_CALL __ke_pci_write_config_word(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u16 val) |
1738 |
{ |
1747 |
{ |
1739 |
return pci_write_config_word((struct pci_dev*)(void *)dev, where, val); |
1748 |
return pci_write_config_word((struct pci_dev*)(void *)dev, where, val); |
1740 |
} |
1749 |
} |
1741 |
|
1750 |
|
1742 |
int __ke_pci_write_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 val) |
1751 |
int ATI_API_CALL __ke_pci_write_config_dword(__ke_pci_dev_t* dev, __ke_u8 where, __ke_u32 val) |
1743 |
{ |
1752 |
{ |
1744 |
return pci_write_config_dword((struct pci_dev*)(void *)dev, where, val); |
1753 |
return pci_write_config_dword((struct pci_dev*)(void *)dev, where, val); |
1745 |
} |
1754 |
} |
1746 |
|
1755 |
|
1747 |
/*****************************************************************************/ |
1756 |
/*****************************************************************************/ |
1748 |
|
1757 |
|
1749 |
void __ke_outb(unsigned char value, unsigned short port) |
1758 |
void ATI_API_CALL __ke_outb(unsigned char value, unsigned short port) |
1750 |
{ |
1759 |
{ |
1751 |
outb(value, port); |
1760 |
outb(value, port); |
1752 |
} |
1761 |
} |
1753 |
|
1762 |
|
1754 |
void __ke_outw(unsigned short value, unsigned short port) |
1763 |
void ATI_API_CALL __ke_outw(unsigned short value, unsigned short port) |
1755 |
{ |
1764 |
{ |
1756 |
outw(value, port); |
1765 |
outw(value, port); |
1757 |
} |
1766 |
} |
1758 |
|
1767 |
|
1759 |
void __ke_outl(unsigned int value, unsigned short port) |
1768 |
void ATI_API_CALL __ke_outl(unsigned int value, unsigned short port) |
1760 |
{ |
1769 |
{ |
1761 |
outl(value, port); |
1770 |
outl(value, port); |
1762 |
} |
1771 |
} |
1763 |
|
1772 |
|
1764 |
char __ke_inb(unsigned short port) |
1773 |
char ATI_API_CALL __ke_inb(unsigned short port) |
1765 |
{ |
1774 |
{ |
1766 |
return inb(port); |
1775 |
return inb(port); |
1767 |
} |
1776 |
} |
1768 |
|
1777 |
|
1769 |
short __ke_inw(unsigned short port) |
1778 |
short ATI_API_CALL __ke_inw(unsigned short port) |
1770 |
{ |
1779 |
{ |
1771 |
return inw(port); |
1780 |
return inw(port); |
1772 |
} |
1781 |
} |
1773 |
|
1782 |
|
1774 |
int __ke_inl(unsigned short port) |
1783 |
int ATI_API_CALL __ke_inl(unsigned short port) |
1775 |
{ |
1784 |
{ |
1776 |
return inl(port); |
1785 |
return inl(port); |
1777 |
} |
1786 |
} |
Lines 1779-1796
Link Here
|
1779 |
/*****************************************************************************/ |
1788 |
/*****************************************************************************/ |
1780 |
// Interrupt support |
1789 |
// Interrupt support |
1781 |
|
1790 |
|
1782 |
void __ke_enable_irq(int irq) |
1791 |
void ATI_API_CALL __ke_enable_irq(int irq) |
1783 |
{ |
1792 |
{ |
1784 |
enable_irq( irq ); |
1793 |
enable_irq( irq ); |
1785 |
} |
1794 |
} |
1786 |
|
1795 |
|
1787 |
void __ke_disable_irq(int irq) |
1796 |
void ATI_API_CALL __ke_disable_irq(int irq) |
1788 |
{ |
1797 |
{ |
1789 |
disable_irq( irq ); |
1798 |
disable_irq( irq ); |
1790 |
} |
1799 |
} |
1791 |
|
1800 |
|
1792 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) |
1801 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) |
1793 |
int __ke_request_irq(unsigned int irq, |
1802 |
int ATI_API_CALL __ke_request_irq(unsigned int irq, |
1794 |
void (*handler)(int, void *, void *), |
1803 |
void (*handler)(int, void *, void *), |
1795 |
const char *dev_name, void *dev_id) |
1804 |
const char *dev_name, void *dev_id) |
1796 |
{ |
1805 |
{ |
Lines 1799-1805
Link Here
|
1799 |
SA_SHIRQ, dev_name, dev_id); |
1808 |
SA_SHIRQ, dev_name, dev_id); |
1800 |
} |
1809 |
} |
1801 |
|
1810 |
|
1802 |
void __ke_free_irq(unsigned int irq, void *dev_id) |
1811 |
void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id) |
1803 |
{ |
1812 |
{ |
1804 |
free_irq(irq, dev_id); |
1813 |
free_irq(irq, dev_id); |
1805 |
} |
1814 |
} |
Lines 1812-1819
Link Here
|
1812 |
return IRQ_HANDLED; |
1821 |
return IRQ_HANDLED; |
1813 |
} |
1822 |
} |
1814 |
|
1823 |
|
1815 |
int __ke_request_irq(unsigned int irq, |
1824 |
int ATI_API_CALL __ke_request_irq(unsigned int irq, |
1816 |
void (*handler)(int, void *, void *), |
1825 |
void (*ATI_API_CALL handler)(int, void *, void *), |
1817 |
const char *dev_name, void *dev_id) |
1826 |
const char *dev_name, void *dev_id) |
1818 |
{ |
1827 |
{ |
1819 |
irq_handler_func = handler; |
1828 |
irq_handler_func = handler; |
Lines 1822-1828
Link Here
|
1822 |
SA_SHIRQ, dev_name, dev_id); |
1831 |
SA_SHIRQ, dev_name, dev_id); |
1823 |
} |
1832 |
} |
1824 |
|
1833 |
|
1825 |
void __ke_free_irq(unsigned int irq, void *dev_id) |
1834 |
void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id) |
1826 |
{ |
1835 |
{ |
1827 |
free_irq(irq, dev_id); |
1836 |
free_irq(irq, dev_id); |
1828 |
irq_handler_func = NULL; |
1837 |
irq_handler_func = NULL; |
Lines 2188-2209
Link Here
|
2188 |
|
2197 |
|
2189 |
#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) */ |
2198 |
#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) */ |
2190 |
|
2199 |
|
2191 |
void* __ke_vma_file_priv(struct vm_area_struct* vma) |
2200 |
void* ATI_API_CALL __ke_vma_file_priv(struct vm_area_struct* vma) |
2192 |
{ |
2201 |
{ |
2193 |
return vma->vm_file->private_data; |
2202 |
return vma->vm_file->private_data; |
2194 |
} |
2203 |
} |
2195 |
|
2204 |
|
2196 |
unsigned long __ke_vm_start(struct vm_area_struct* vma) |
2205 |
unsigned long ATI_API_CALL __ke_vm_start(struct vm_area_struct* vma) |
2197 |
{ |
2206 |
{ |
2198 |
return vma->vm_start; |
2207 |
return vma->vm_start; |
2199 |
} |
2208 |
} |
2200 |
|
2209 |
|
2201 |
unsigned long __ke_vm_end(struct vm_area_struct* vma) |
2210 |
unsigned long ATI_API_CALL __ke_vm_end(struct vm_area_struct* vma) |
2202 |
{ |
2211 |
{ |
2203 |
return vma->vm_end; |
2212 |
return vma->vm_end; |
2204 |
} |
2213 |
} |
2205 |
|
2214 |
|
2206 |
unsigned long __ke_vm_offset(struct vm_area_struct* vma) |
2215 |
unsigned long ATI_API_CALL __ke_vm_offset(struct vm_area_struct* vma) |
2207 |
{ |
2216 |
{ |
2208 |
#if LINUX_VERSION_CODE < 0x020319 |
2217 |
#if LINUX_VERSION_CODE < 0x020319 |
2209 |
return vma->vm_offset; |
2218 |
return vma->vm_offset; |
Lines 2212-2218
Link Here
|
2212 |
#endif/* LINUX_VERSION_CODE >= 0x020319 */ |
2221 |
#endif/* LINUX_VERSION_CODE >= 0x020319 */ |
2213 |
} |
2222 |
} |
2214 |
|
2223 |
|
2215 |
char* __ke_vm_flags_str(struct vm_area_struct* vma, char* buf) |
2224 |
char* ATI_API_CALL __ke_vm_flags_str(struct vm_area_struct* vma, char* buf) |
2216 |
{ |
2225 |
{ |
2217 |
*(buf + 0) = vma->vm_flags & VM_READ ? 'r' : '-'; |
2226 |
*(buf + 0) = vma->vm_flags & VM_READ ? 'r' : '-'; |
2218 |
*(buf + 1) = vma->vm_flags & VM_WRITE ? 'w' : '-'; |
2227 |
*(buf + 1) = vma->vm_flags & VM_WRITE ? 'w' : '-'; |
Lines 2224-2230
Link Here
|
2224 |
return buf; |
2233 |
return buf; |
2225 |
} |
2234 |
} |
2226 |
|
2235 |
|
2227 |
char* __ke_vm_page_prot_str(struct vm_area_struct* vma, char* buf) |
2236 |
char* ATI_API_CALL __ke_vm_page_prot_str(struct vm_area_struct* vma, char* buf) |
2228 |
{ |
2237 |
{ |
2229 |
int i = 0; |
2238 |
int i = 0; |
2230 |
|
2239 |
|
Lines 2251-2257
Link Here
|
2251 |
return buf; |
2260 |
return buf; |
2252 |
} |
2261 |
} |
2253 |
|
2262 |
|
2254 |
char* __ke_vm_phys_addr_str(struct vm_area_struct* vma, |
2263 |
char* ATI_API_CALL __ke_vm_phys_addr_str(struct vm_area_struct* vma, |
2255 |
char* buf, |
2264 |
char* buf, |
2256 |
unsigned long virtual_addr, |
2265 |
unsigned long virtual_addr, |
2257 |
unsigned long* phys_address) |
2266 |
unsigned long* phys_address) |
Lines 2304-2314
Link Here
|
2304 |
return buf; |
2313 |
return buf; |
2305 |
} |
2314 |
} |
2306 |
|
2315 |
|
|
|
2316 |
void ip_drm_vm_open(struct vm_area_struct* vma) |
2317 |
{ drm_vm_open(vma); } |
2318 |
void ip_drm_vm_close(struct vm_area_struct* vma) |
2319 |
{ drm_vm_close(vma); } |
2320 |
|
2307 |
static struct vm_operations_struct vm_ops = |
2321 |
static struct vm_operations_struct vm_ops = |
2308 |
{ |
2322 |
{ |
2309 |
nopage: vm_nopage, |
2323 |
nopage: vm_nopage, |
2310 |
open: drm_vm_open, |
2324 |
open: ip_drm_vm_open, |
2311 |
close: drm_vm_close, |
2325 |
close: ip_drm_vm_close, |
2312 |
}; |
2326 |
}; |
2313 |
|
2327 |
|
2314 |
#ifdef __AGP__BUILTIN__ |
2328 |
#ifdef __AGP__BUILTIN__ |
Lines 2316-2323
Link Here
|
2316 |
static struct vm_operations_struct vm_cant_ops = |
2330 |
static struct vm_operations_struct vm_cant_ops = |
2317 |
{ |
2331 |
{ |
2318 |
nopage: vm_cant_nopage, |
2332 |
nopage: vm_cant_nopage, |
2319 |
open: drm_vm_open, |
2333 |
open: ip_drm_vm_open, |
2320 |
close: drm_vm_close, |
2334 |
close: ip_drm_vm_close, |
2321 |
}; |
2335 |
}; |
2322 |
#endif /* __ia64_ */ |
2336 |
#endif /* __ia64_ */ |
2323 |
#endif /* __AGP__BUILTIN__ */ |
2337 |
#endif /* __AGP__BUILTIN__ */ |
Lines 2325-2346
Link Here
|
2325 |
static struct vm_operations_struct vm_shm_ops = |
2339 |
static struct vm_operations_struct vm_shm_ops = |
2326 |
{ |
2340 |
{ |
2327 |
nopage: vm_shm_nopage, |
2341 |
nopage: vm_shm_nopage, |
2328 |
open: drm_vm_open, |
2342 |
open: ip_drm_vm_open, |
2329 |
close: drm_vm_close, |
2343 |
close: ip_drm_vm_close, |
2330 |
}; |
2344 |
}; |
2331 |
|
2345 |
|
2332 |
static struct vm_operations_struct vm_pci_bq_ops = |
2346 |
static struct vm_operations_struct vm_pci_bq_ops = |
2333 |
{ |
2347 |
{ |
2334 |
nopage: vm_dma_nopage, |
2348 |
nopage: vm_dma_nopage, |
2335 |
open: drm_vm_open, |
2349 |
open: ip_drm_vm_open, |
2336 |
close: drm_vm_close, |
2350 |
close: ip_drm_vm_close, |
2337 |
}; |
2351 |
}; |
2338 |
|
2352 |
|
2339 |
static struct vm_operations_struct vm_ctx_ops = |
2353 |
static struct vm_operations_struct vm_ctx_ops = |
2340 |
{ |
2354 |
{ |
2341 |
nopage: vm_dma_nopage, |
2355 |
nopage: vm_dma_nopage, |
2342 |
open: drm_vm_open, |
2356 |
open: ip_drm_vm_open, |
2343 |
close: drm_vm_close, |
2357 |
close: ip_drm_vm_close, |
2344 |
}; |
2358 |
}; |
2345 |
|
2359 |
|
2346 |
#ifdef __AGP__BUILTIN__ |
2360 |
#ifdef __AGP__BUILTIN__ |
Lines 2348-2367
Link Here
|
2348 |
static struct vm_operations_struct vm_agp_bq_ops = |
2362 |
static struct vm_operations_struct vm_agp_bq_ops = |
2349 |
{ |
2363 |
{ |
2350 |
nopage: vm_nopage, |
2364 |
nopage: vm_nopage, |
2351 |
open: drm_vm_open, |
2365 |
open: ip_drm_vm_open, |
2352 |
close: drm_vm_close, |
2366 |
close: ip_drm_vm_close, |
2353 |
}; |
2367 |
}; |
2354 |
#else |
2368 |
#else |
2355 |
static struct vm_operations_struct vm_cant_agp_bq_ops = |
2369 |
static struct vm_operations_struct vm_cant_agp_bq_ops = |
2356 |
{ |
2370 |
{ |
2357 |
nopage: vm_cant_nopage, |
2371 |
nopage: vm_cant_nopage, |
2358 |
open: drm_vm_open, |
2372 |
open: ip_drm_vm_open, |
2359 |
close: drm_vm_close, |
2373 |
close: ip_drm_vm_close, |
2360 |
}; |
2374 |
}; |
2361 |
#endif /* __ia64_ */ |
2375 |
#endif /* __ia64_ */ |
2362 |
#endif /* __AGP__BUILTIN__ */ |
2376 |
#endif /* __AGP__BUILTIN__ */ |
2363 |
|
2377 |
|
2364 |
int __ke_vm_map(struct file* filp, |
2378 |
int ATI_API_CALL __ke_vm_map(struct file* filp, |
2365 |
struct vm_area_struct* vma, |
2379 |
struct vm_area_struct* vma, |
2366 |
enum __ke_vm_maptype type, |
2380 |
enum __ke_vm_maptype type, |
2367 |
int readonly) |
2381 |
int readonly) |
Lines 2640-2646
Link Here
|
2640 |
#endif // !USE_FIREGL_AGPGART_IMPLEMENTATION |
2654 |
#endif // !USE_FIREGL_AGPGART_IMPLEMENTATION |
2641 |
|
2655 |
|
2642 |
static |
2656 |
static |
2643 |
int __ke_firegl_agpgart_available(void) |
2657 |
int ATI_API_CALL __ke_firegl_agpgart_available(void) |
2644 |
{ |
2658 |
{ |
2645 |
int retval; |
2659 |
int retval; |
2646 |
|
2660 |
|
Lines 2663-2669
Link Here
|
2663 |
} |
2677 |
} |
2664 |
|
2678 |
|
2665 |
static |
2679 |
static |
2666 |
int __ke_agpgart_available(void) |
2680 |
int ATI_API_CALL __ke_agpgart_available(void) |
2667 |
{ |
2681 |
{ |
2668 |
#ifdef __AGP__ |
2682 |
#ifdef __AGP__ |
2669 |
unsigned int found = 0; |
2683 |
unsigned int found = 0; |
Lines 2771-2777
Link Here
|
2771 |
return 0; /* failed */ |
2785 |
return 0; /* failed */ |
2772 |
} |
2786 |
} |
2773 |
|
2787 |
|
2774 |
int __ke_agp_available(int use_internal) |
2788 |
int ATI_API_CALL __ke_agp_available(int use_internal) |
2775 |
{ |
2789 |
{ |
2776 |
int available = 0; |
2790 |
int available = 0; |
2777 |
|
2791 |
|
Lines 2787-2793
Link Here
|
2787 |
return available; |
2801 |
return available; |
2788 |
} |
2802 |
} |
2789 |
|
2803 |
|
2790 |
void __ke_agp_uninit(void) |
2804 |
void ATI_API_CALL __ke_agp_uninit(void) |
2791 |
{ |
2805 |
{ |
2792 |
if (firegl_agp) |
2806 |
if (firegl_agp) |
2793 |
{ |
2807 |
{ |
Lines 2816-2822
Link Here
|
2816 |
} |
2830 |
} |
2817 |
|
2831 |
|
2818 |
#ifdef FGL |
2832 |
#ifdef FGL |
2819 |
struct _agp_memory* __ke_agp_allocate_memory_phys_list(__ke_size_t pages, unsigned long type, unsigned long * phys_addr) |
2833 |
struct _agp_memory* ATI_API_CALL __ke_agp_allocate_memory_phys_list(__ke_size_t pages, unsigned long type, unsigned long * phys_addr) |
2820 |
{ |
2834 |
{ |
2821 |
#if 0 |
2835 |
#if 0 |
2822 |
#ifdef __AGP__ |
2836 |
#ifdef __AGP__ |
Lines 2830-2836
Link Here
|
2830 |
} |
2844 |
} |
2831 |
#endif |
2845 |
#endif |
2832 |
|
2846 |
|
2833 |
void __ke_agp_free_memory(struct _agp_memory* handle) |
2847 |
void ATI_API_CALL __ke_agp_free_memory(struct _agp_memory* handle) |
2834 |
{ |
2848 |
{ |
2835 |
#ifdef __AGP__ |
2849 |
#ifdef __AGP__ |
2836 |
if (AGP_AVAILABLE(free_memory)) |
2850 |
if (AGP_AVAILABLE(free_memory)) |
Lines 2840-2846
Link Here
|
2840 |
return FIREGL_agp_free_memory((FIREGL_agp_memory*)handle); |
2854 |
return FIREGL_agp_free_memory((FIREGL_agp_memory*)handle); |
2841 |
} |
2855 |
} |
2842 |
|
2856 |
|
2843 |
struct _agp_memory* __ke_agp_allocate_memory(__ke_size_t pages, unsigned long type) |
2857 |
struct _agp_memory* ATI_API_CALL __ke_agp_allocate_memory(__ke_size_t pages, unsigned long type) |
2844 |
{ |
2858 |
{ |
2845 |
#ifdef __AGP__ |
2859 |
#ifdef __AGP__ |
2846 |
if (AGP_AVAILABLE(allocate_memory)) |
2860 |
if (AGP_AVAILABLE(allocate_memory)) |
Lines 2851-2857
Link Here
|
2851 |
return NULL; |
2865 |
return NULL; |
2852 |
} |
2866 |
} |
2853 |
|
2867 |
|
2854 |
int __ke_agp_bind_memory(struct _agp_memory* handle, __ke_off_t start) |
2868 |
int ATI_API_CALL __ke_agp_bind_memory(struct _agp_memory* handle, __ke_off_t start) |
2855 |
{ |
2869 |
{ |
2856 |
#ifdef __AGP__ |
2870 |
#ifdef __AGP__ |
2857 |
if (AGP_AVAILABLE(bind_memory)) |
2871 |
if (AGP_AVAILABLE(bind_memory)) |
Lines 2862-2868
Link Here
|
2862 |
return -EINVAL; |
2876 |
return -EINVAL; |
2863 |
} |
2877 |
} |
2864 |
|
2878 |
|
2865 |
int __ke_agp_unbind_memory(struct _agp_memory* handle) |
2879 |
int ATI_API_CALL __ke_agp_unbind_memory(struct _agp_memory* handle) |
2866 |
{ |
2880 |
{ |
2867 |
#ifdef __AGP__ |
2881 |
#ifdef __AGP__ |
2868 |
if (AGP_AVAILABLE(unbind_memory)) |
2882 |
if (AGP_AVAILABLE(unbind_memory)) |
Lines 2873-2879
Link Here
|
2873 |
return -EINVAL; |
2887 |
return -EINVAL; |
2874 |
} |
2888 |
} |
2875 |
|
2889 |
|
2876 |
int __ke_agp_enable(unsigned long mode) |
2890 |
int ATI_API_CALL __ke_agp_enable(unsigned long mode) |
2877 |
{ |
2891 |
{ |
2878 |
#ifdef __AGP__ |
2892 |
#ifdef __AGP__ |
2879 |
if (AGP_AVAILABLE(enable)) |
2893 |
if (AGP_AVAILABLE(enable)) |
Lines 2890-2896
Link Here
|
2890 |
return -EINVAL; |
2904 |
return -EINVAL; |
2891 |
} |
2905 |
} |
2892 |
|
2906 |
|
2893 |
int __ke_read_agp_caps_registers(__ke_pci_dev_t* dev, unsigned int *caps) |
2907 |
int ATI_API_CALL __ke_read_agp_caps_registers(__ke_pci_dev_t* dev, unsigned int *caps) |
2894 |
{ |
2908 |
{ |
2895 |
u8 capndx; |
2909 |
u8 capndx; |
2896 |
u32 cap_id; |
2910 |
u32 cap_id; |
Lines 2921-2927
Link Here
|
2921 |
return -ENODATA; |
2935 |
return -ENODATA; |
2922 |
} |
2936 |
} |
2923 |
|
2937 |
|
2924 |
int __ke_agp_acquire(void) |
2938 |
int ATI_API_CALL __ke_agp_acquire(void) |
2925 |
{ |
2939 |
{ |
2926 |
#ifdef __AGP__ |
2940 |
#ifdef __AGP__ |
2927 |
if (AGP_AVAILABLE(acquire)) |
2941 |
if (AGP_AVAILABLE(acquire)) |
Lines 2932-2938
Link Here
|
2932 |
return -EINVAL; |
2946 |
return -EINVAL; |
2933 |
} |
2947 |
} |
2934 |
|
2948 |
|
2935 |
void __ke_agp_release(void) |
2949 |
void ATI_API_CALL __ke_agp_release(void) |
2936 |
{ |
2950 |
{ |
2937 |
#ifdef __AGP__ |
2951 |
#ifdef __AGP__ |
2938 |
if (AGP_AVAILABLE(release)) |
2952 |
if (AGP_AVAILABLE(release)) |
Lines 2942-2948
Link Here
|
2942 |
FIREGL_agp_backend_release(); |
2956 |
FIREGL_agp_backend_release(); |
2943 |
} |
2957 |
} |
2944 |
|
2958 |
|
2945 |
void __ke_agp_copy_info(__ke_agp_kern_info_t* info) |
2959 |
void ATI_API_CALL __ke_agp_copy_info(__ke_agp_kern_info_t* info) |
2946 |
{ |
2960 |
{ |
2947 |
struct pci_dev *device = NULL; |
2961 |
struct pci_dev *device = NULL; |
2948 |
|
2962 |
|
Lines 3029-3035
Link Here
|
3029 |
} |
3043 |
} |
3030 |
} |
3044 |
} |
3031 |
|
3045 |
|
3032 |
unsigned long __ke_agp_memory_handle(struct _agp_memory* handle) |
3046 |
unsigned long ATI_API_CALL __ke_agp_memory_handle(struct _agp_memory* handle) |
3033 |
{ |
3047 |
{ |
3034 |
if (firegl_agp) |
3048 |
if (firegl_agp) |
3035 |
#ifdef USE_FIREGL_AGPGART_IMPLEMENTATION |
3049 |
#ifdef USE_FIREGL_AGPGART_IMPLEMENTATION |
Lines 3045-3051
Link Here
|
3045 |
#endif /* !__AGP__ */ |
3059 |
#endif /* !__AGP__ */ |
3046 |
} |
3060 |
} |
3047 |
|
3061 |
|
3048 |
unsigned long __ke_agp_memory_page_count(struct _agp_memory* handle) |
3062 |
unsigned long ATI_API_CALL __ke_agp_memory_page_count(struct _agp_memory* handle) |
3049 |
{ |
3063 |
{ |
3050 |
if (firegl_agp) |
3064 |
if (firegl_agp) |
3051 |
#ifdef USE_FIREGL_AGPGART_IMPLEMENTATION |
3065 |
#ifdef USE_FIREGL_AGPGART_IMPLEMENTATION |
Lines 3061-3073
Link Here
|
3061 |
#endif /* !__AGP__ */ |
3075 |
#endif /* !__AGP__ */ |
3062 |
} |
3076 |
} |
3063 |
|
3077 |
|
3064 |
int __ke_smp_processor_id(void) |
3078 |
int ATI_API_CALL __ke_smp_processor_id(void) |
3065 |
{ |
3079 |
{ |
3066 |
return (int)(smp_processor_id()); |
3080 |
return (int)(smp_processor_id()); |
3067 |
} |
3081 |
} |
3068 |
|
3082 |
|
3069 |
|
3083 |
|
3070 |
void __ke_smp_call_function( void (*func)(void *info) ) |
3084 |
void ATI_API_CALL __ke_smp_call_function( void (*ATI_API_CALL func)(void *info) ) |
3071 |
{ |
3085 |
{ |
3072 |
smp_call_function( func, NULL, 0, 1 ); |
3086 |
smp_call_function( func, NULL, 0, 1 ); |
3073 |
} |
3087 |
} |
Lines 3097-3103
Link Here
|
3097 |
return 0; // does not match |
3111 |
return 0; // does not match |
3098 |
} |
3112 |
} |
3099 |
|
3113 |
|
3100 |
int __ke_is_athlon(void) |
3114 |
int ATI_API_CALL __ke_is_athlon(void) |
3101 |
{ |
3115 |
{ |
3102 |
register int bAthlon; |
3116 |
register int bAthlon; |
3103 |
__asm |
3117 |
__asm |
Lines 3184-3190
Link Here
|
3184 |
#endif |
3198 |
#endif |
3185 |
|
3199 |
|
3186 |
|
3200 |
|
3187 |
int __ke_amd_adv_spec_cache_feature(void) |
3201 |
int ATI_API_CALL __ke_amd_adv_spec_cache_feature(void) |
3188 |
{ |
3202 |
{ |
3189 |
#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)) ) |
3203 |
#if ( (PAGE_ATTR_FIX == 1) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)) ) |
3190 |
/* the kernel already does provide a fix for the AMD Athlon |
3204 |
/* the kernel already does provide a fix for the AMD Athlon |
Lines 3226-3232
Link Here
|
3226 |
return 0; |
3240 |
return 0; |
3227 |
} |
3241 |
} |
3228 |
|
3242 |
|
3229 |
int __ke_has_PSE(void) |
3243 |
int ATI_API_CALL __ke_has_PSE(void) |
3230 |
{ |
3244 |
{ |
3231 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) |
3245 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71) |
3232 |
if (test_bit(X86_FEATURE_PSE, &boot_cpu_data.x86_capability)) |
3246 |
if (test_bit(X86_FEATURE_PSE, &boot_cpu_data.x86_capability)) |