- Timestamp:
- May 4, 2012 2:24:42 PM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r41147 r41169 292 292 { "RTR0MemAreKrnlAndUsrDifferent", (void *)RTR0MemAreKrnlAndUsrDifferent }, 293 293 { "RTR0MemKernelIsValidAddr", (void *)RTR0MemKernelIsValidAddr }, 294 { "RTR0MemKernelCopyFrom", (void *)RTR0MemKernelCopyFrom }, 295 { "RTR0MemKernelCopyTo", (void *)RTR0MemKernelCopyTo }, 294 296 { "RTR0MemObjAddress", (void *)RTR0MemObjAddress }, 295 297 { "RTR0MemObjAddressR3", (void *)RTR0MemObjAddressR3 }, -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r41147 r41169 194 194 * - Remove RTSpinlockReleaseNoInts. 195 195 */ 196 #define SUPDRV_IOC_VERSION 0x001a000 3196 #define SUPDRV_IOC_VERSION 0x001a0004 197 197 198 198 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/Runtime/r0drv/darwin/memuserkernel-r0drv-darwin.cpp
r36540 r41169 99 99 } 100 100 101 102 RTR0DECL(int) RTR0MemKernelCopyFrom(void *pvDst, void const *pvSrc, size_t cb) 103 { 104 return VERR_NOT_SUPPORTED; 105 } 106 107 108 RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb) 109 { 110 return VERR_NOT_SUPPORTED; 111 } 112 113 -
trunk/src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c
r28800 r41169 70 70 } 71 71 72 73 RTR0DECL(int) RTR0MemKernelCopyFrom(void *pvDst, void const *pvSrc, size_t cb) 74 { 75 return VERR_NOT_SUPPORTED; 76 } 77 78 79 RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb) 80 { 81 return VERR_NOT_SUPPORTED; 82 } 83 84 -
trunk/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
r28800 r41169 101 101 RT_EXPORT_SYMBOL(RTR0MemAreKrnlAndUsrDifferent); 102 102 103 104 /** 105 * Treats both source and destination as unsafe buffers. 106 */ 107 static int rtR0MemKernelCopyLnxWorker(void *pvDst, void const *pvSrc, size_t cb) 108 { 109 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 55) 110 /* _ASM_EXTABLE was introduced in 2.6.25 from what I can tell. Using #ifndef 111 here since it has to be a macro and you never know what someone might have 112 backported to an earlier kernel release. */ 113 # ifndef _ASM_EXTABLE 114 # if ARCH_BITS == 32 115 # define _ASM_EXTABLE(a_Instr, a_Resume) \ 116 ".section __ex_table,\"a\"\n" \ 117 ".balign 4\n" \ 118 ".long " #a_Instr "\n" \ 119 ".long " #a_Resume "\n" \ 120 ".previous\n" 121 # else 122 # define _ASM_EXTABLE(a_Instr, a_Resume) \ 123 ".section __ex_table,\"a\"\n" \ 124 ".balign 8\n" \ 125 ".quad " #a_Instr "\n" \ 126 ".quad " #a_Resume "\n" \ 127 ".previous\n" 128 # endif 129 # endif /* !_ASM_EXTABLE */ 130 int rc; 131 if (!cb) 132 return VINF_SUCCESS; 133 134 __asm__ __volatile__ ("cld\n" 135 "1:\n\t" 136 "rep; movsb\n" 137 "2:\n\t" 138 ".section .fixup,\"ax\"\n" 139 "3:\n\t" 140 "movl %4, %0\n" 141 ".previous\n" 142 _ASM_EXTABLE(1b, 3b) 143 : "=r" (rc), 144 "=D" (pvDst), 145 "=S" (pvSrc), 146 "=c" (cb) 147 : "i" (VERR_ACCESS_DENIED), 148 "0" (VINF_SUCCESS), 149 "1" (pvDst), 150 "2" (pvSrc), 151 "3" (cb) 152 : "memory"); 153 return rc; 154 #else 155 return VERR_NOT_SUPPORTED; 156 #endif 157 } 158 159 160 RTR0DECL(int) RTR0MemKernelCopyFrom(void *pvDst, void const *pvSrc, size_t cb) 161 { 162 return rtR0MemKernelCopyLnxWorker(pvDst, pvSrc, cb); 163 } 164 RT_EXPORT_SYMBOL(RTR0MemKernelCopyFrom); 165 166 167 RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb) 168 { 169 return rtR0MemKernelCopyLnxWorker(pvDst, pvSrc, cb); 170 } 171 RT_EXPORT_SYMBOL(RTR0MemKernelCopyTo); 172 -
trunk/src/VBox/Runtime/r0drv/nt/memuserkernel-r0drv-nt.cpp
r29705 r41169 92 92 } 93 93 94 95 RTR0DECL(int) RTR0MemKernelCopyFrom(void *pvDst, void const *pvSrc, size_t cb) 96 { 97 __try 98 { 99 memcpy(pvDst, pvSrc, cb); 100 } 101 __except(EXCEPTION_EXECUTE_HANDLER) 102 { 103 return VERR_ACCESS_DENIED; 104 } 105 return VINF_SUCCESS; 106 } 107 108 109 RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb) 110 { 111 __try 112 { 113 memcpy(pvDst, pvSrc, cb); 114 } 115 __except(EXCEPTION_EXECUTE_HANDLER) 116 { 117 return VERR_ACCESS_DENIED; 118 } 119 return VINF_SUCCESS; 120 } 121 -
trunk/src/VBox/Runtime/r0drv/os2/memuserkernel-r0drv-os2.cpp
r40304 r41169 76 76 } 77 77 78 79 RTR0DECL(int) RTR0MemKernelCopyFrom(void *pvDst, void const *pvSrc, size_t cb) 80 { 81 return VERR_NOT_SUPPORTED; 82 } 83 84 85 RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb) 86 { 87 return VERR_NOT_SUPPORTED; 88 } 89 -
trunk/src/VBox/Runtime/r0drv/solaris/memuserkernel-r0drv-solaris.c
r29284 r41169 81 81 } 82 82 83 84 RTR0DECL(int) RTR0MemKernelCopyFrom(void *pvDst, void const *pvSrc, size_t cb) 85 { 86 int rc = kcopy(pvSrc, pvDst, cb); 87 if (RT_LIKELY(rc == 0)) 88 return VINF_SUCCESS; 89 return VERR_ACCESS_DENIED; 90 } 91 92 93 RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb) 94 { 95 int rc = kcopy(pvSrc, pvDst, cb); 96 if (RT_LIKELY(rc == 0)) 97 return VINF_SUCCESS; 98 return VERR_ACCESS_DENIED; 99 } 100
Note:
See TracChangeset
for help on using the changeset viewer.