Changeset 4800 in vbox for trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
- Timestamp:
- Sep 14, 2007 2:59:15 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 24502
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
r4071 r4800 96 96 97 97 98 /**99 * Installs anything required by the support library.100 *101 * @returns 0 on success.102 * @returns error code on failure.103 */104 98 int suplibOsInstall(void) 105 99 { 106 // int rc = mknod(DEVICE_NAME, S_IFCHR, );107 108 100 return VERR_NOT_IMPLEMENTED; 109 101 } 110 102 111 103 112 /**113 * Installs anything required by the support library.114 *115 * @returns 0 on success.116 * @returns error code on failure.117 */118 104 int suplibOsUninstall(void) 119 105 { 120 // int rc = unlink(DEVICE_NAME);121 122 106 return VERR_NOT_IMPLEMENTED; 123 107 } 124 108 125 109 126 /** 127 * Send a I/O Control request to the device. 128 * 129 * @returns 0 on success. 130 * @returns VBOX error code on failure. 131 * @param uFunction IO Control function. 132 * @param pvIn Input data buffer. 133 * @param cbIn Size of input data. 134 * @param pvOut Output data buffer. 135 * @param cbOut Size of output data. 136 */ 137 int suplibOsIOCtl(unsigned uFunction, void *pvIn, size_t cbIn, void *pvOut, size_t cbOut) 110 int suplibOsIOCtl(uintptr_t uFunction, void *pvReq, size_t cbReq) 138 111 { 139 112 AssertMsg(g_hDevice != -1, ("SUPLIB not initiated successfully!\n")); 140 /*141 * Issue device iocontrol.142 */143 SUPDRVIOCTLDATA Args;144 Args.pvIn = pvIn;145 Args.cbIn = cbIn;146 Args.pvOut = pvOut;147 Args.cbOut = cbOut;148 113 149 if (ioctl(g_hDevice, uFunction, &Args) >= 0) 150 return 0; 151 /* This is the reverse operation of the one found in SUPDrv-linux.c */ 152 switch (errno) 153 { 154 case EACCES: return VERR_GENERAL_FAILURE; 155 case EINVAL: return VERR_INVALID_PARAMETER; 156 case ENOSYS: return VERR_INVALID_MAGIC; 157 case ENXIO: return VERR_INVALID_HANDLE; 158 case EFAULT: return VERR_INVALID_POINTER; 159 case ENOLCK: return VERR_LOCK_FAILED; 160 case EEXIST: return VERR_ALREADY_LOADED; 161 } 162 114 if (RT_LIKELY(ioctl((g_hDevice, uFunction, pvReq) >= 0)) 115 return VINF_SUCCESS; 163 116 return RTErrConvertFromErrno(errno); 164 117 } 165 118 166 119 #ifdef VBOX_WITHOUT_IDT_PATCHING 167 int suplibOSIOCtlFast(u nsigneduFunction)120 int suplibOSIOCtlFast(uintptr_t uFunction) 168 121 { 169 122 int rc = ioctl(g_hDevice, uFunction, NULL); … … 175 128 176 129 177 /**178 * Allocate a number of zero-filled pages in user space.179 *180 * @returns VBox status code.181 * @param cPages Number of pages to allocate.182 * @param ppvPages Where to return the base pointer.183 */184 130 int suplibOsPageAlloc(size_t cPages, void **ppvPages) 185 131 { … … 191 137 192 138 193 /**194 * Frees pages allocated by suplibOsPageAlloc().195 *196 * @returns VBox status code.197 * @param pvPages Pointer to pages.198 */199 139 int suplibOsPageFree(void *pvPages, size_t /* cPages */) 200 140 {
Note:
See TracChangeset
for help on using the changeset viewer.