|
Lines 104-118
Link Here
|
| 104 |
#endif |
104 |
#endif |
| 105 |
#include <linux/spinlock.h> |
105 |
#include <linux/spinlock.h> |
| 106 |
#include <asm/semaphore.h> |
106 |
#include <linux/semaphore.h> |
| 107 |
#include <linux/completion.h> |
107 |
#include <linux/completion.h> |
| 108 |
#include <linux/highmem.h> |
108 |
#include <linux/highmem.h> |
| 109 |
#ifdef CONFIG_XEN |
|
|
| 110 |
#include <asm/maddr.h> |
| 111 |
#include <xen/interface/memory.h> |
| 112 |
#endif |
| 113 |
|
| 114 |
#ifdef CONFIG_PROC_FS |
109 |
#ifdef CONFIG_PROC_FS |
| 115 |
#include <linux/proc_fs.h> |
110 |
#include <linux/proc_fs.h> |
| 116 |
#endif |
111 |
#endif |
|
Lines 144-150
Link Here
|
| 144 |
#include <linux/agpgart.h> |
139 |
#include <linux/agpgart.h> |
| 145 |
#endif |
140 |
#endif |
| 146 |
#if (defined(NVCPU_X86) || defined(NVCPU_X86_64)) && !defined(CONFIG_XEN) |
141 |
#if (defined(NVCPU_X86) || defined(NVCPU_X86_64)) |
| 147 |
#define NV_ENABLE_PAT_SUPPORT |
142 |
#define NV_ENABLE_PAT_SUPPORT |
| 148 |
#endif |
143 |
#endif |
|
Lines 656-661
Link Here
|
| 656 |
#endif /* !defined NVWATCH */ |
651 |
#endif /* !defined NVWATCH */ |
|
|
652 |
#if defined(NV_ON_EACH_CPU_PRESENT) |
| 653 |
#if (NV_ON_EACH_CPU_ARGUMENT_COUNT == 4) |
| 654 |
#define NV_ON_EACH_CPU(func, info, retry, wait) on_each_cpu(func, info, retry, wait) |
| 655 |
#define NV_SMP_CALL_FUNCTION(func, info, retry, wait) smp_call_function(func, info, retry, wait) |
| 656 |
#elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3) |
| 657 |
#define NV_ON_EACH_CPU(func, info, retry, wait) on_each_cpu(func, info, wait) |
| 658 |
#define NV_SMP_CALL_FUNCTION(func, info, retry, wait) smp_call_function(func, info, wait) |
| 659 |
#else |
| 660 |
#error "NV_ON_EACH_CPU_ARGUMENT_COUNT value unrecognized!" |
| 661 |
#endif |
| 662 |
#else |
| 663 |
#error "NV_ON_EACH_CPU() undefined (on_each_cpu() unavailable)!" |
| 664 |
#endif |
| 665 |
|
| 657 |
static inline int nv_execute_on_all_cpus(void (*func)(void *info), void *info) |
666 |
static inline int nv_execute_on_all_cpus(void (*func)(void *info), void *info) |
| 658 |
{ |
667 |
{ |
| 659 |
int ret = 0; |
668 |
int ret = 0; |
|
Lines 665-677
Link Here
|
| 665 |
#if defined(preempt_disable) |
674 |
#if defined(preempt_disable) |
| 666 |
preempt_disable(); |
675 |
preempt_disable(); |
| 667 |
#endif |
676 |
#endif |
| 668 |
ret = smp_call_function(func, info, 1, 1); |
677 |
ret = NV_SMP_CALL_FUNCTION(func, info, 1, 1); |
| 669 |
func(info); |
678 |
func(info); |
| 670 |
#if defined(preempt_enable) |
679 |
#if defined(preempt_enable) |
| 671 |
preempt_enable(); |
680 |
preempt_enable(); |
| 672 |
#endif |
681 |
#endif |
| 673 |
#else |
682 |
#else |
| 674 |
ret = on_each_cpu(func, info, 1, 1); |
683 |
ret = NV_ON_EACH_CPU(func, info, 1, 1); |
| 675 |
#endif |
684 |
#endif |
| 676 |
return ret; |
685 |
return ret; |
| 677 |
} |
686 |
} |
|
Lines 727-737
Link Here
|
| 727 |
#define NV_TASK_STRUCT_RLIM(current) ((current)->rlim) |
736 |
#define NV_TASK_STRUCT_RLIM(current) ((current)->rlim) |
| 728 |
#endif |
737 |
#endif |
| 729 |
#ifdef CONFIG_XEN |
|
|
| 730 |
#define NV_GET_DMA_ADDRESS(phys_addr) phys_to_machine(phys_addr) |
| 731 |
#else |
| 732 |
#define NV_GET_DMA_ADDRESS(phys_addr) (phys_addr) |
738 |
#define NV_GET_DMA_ADDRESS(phys_addr) (phys_addr) |
| 733 |
#endif |
|
|
| 734 |
#define NV_GET_PAGE_STRUCT(phys_page) virt_to_page(__va(phys_page)) |
739 |
#define NV_GET_PAGE_STRUCT(phys_page) virt_to_page(__va(phys_page)) |
| 735 |
#define NV_VMA_PGOFF(vma) ((vma)->vm_pgoff) |
740 |
#define NV_VMA_PGOFF(vma) ((vma)->vm_pgoff) |
|
Lines 884-890
Link Here
|
| 884 |
#else |
889 |
#else |
| 885 |
#error "NV_REMAP_PAGE_RANGE() undefined!" |
890 |
#error "NV_REMAP_PAGE_RANGE() undefined!" |
| 886 |
#endif |
891 |
#endif |
| 887 |
#if !defined(CONFIG_XEN) |
892 |
#if 1 |
| 888 |
#define NV_IO_REMAP_PAGE_RANGE(from, offset, x...) \ |
893 |
#define NV_IO_REMAP_PAGE_RANGE(from, offset, x...) \ |
| 889 |
NV_REMAP_PAGE_RANGE(from, offset, x) |
894 |
NV_REMAP_PAGE_RANGE(from, offset, x) |
| 890 |
#else |
895 |
#else |