Changeset 55095 in vbox
- Timestamp:
- Apr 2, 2015 4:52:46 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99390
- Location:
- trunk
- Files:
-
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r55080 r55095 727 727 #VBOX_WITH_DTRACE_GST = 1 728 728 # Set this to indicate that the host ships with DTrace. 729 if1of ($(KBUILD_TARGET), darwin solaris freebsd)729 if1of ($(KBUILD_TARGET), darwin solaris) 730 730 VBOX_WITH_NATIVE_DTRACE = 1 731 731 endif … … 3697 3697 -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes \ 3698 3698 -Wimplicit-function-declaration -Werror-implicit-function-declaration \ 3699 -O2 -ff ormat-extensions -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \3699 -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ 3700 3700 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ 3701 3701 -nostdinc -std=c99 … … 3706 3706 TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \ 3707 3707 $(VBOX_GCC_WARN) -Wpointer-arith -Winline \ 3708 -O2 -fno- format-extensions -fno-strict-aliasing -fno-common -finline-limit=8000 \3708 -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \ 3709 3709 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ 3710 3710 -nostdinc -
trunk/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
r53624 r55095 22 22 #include <iprt/stream.h> 23 23 #include <iprt/thread.h> 24 25 #ifdef RT_OS_FREEBSD 26 # include <sys/socket.h> 27 #endif 24 28 25 29 #include <arpa/inet.h> -
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r54886 r55095 191 191 VirtualBox_LIBS = $(LIB_DDU) 192 192 193 if1of ($(KBUILD_TARGET), linux freebsdnetbsd openbsd)193 if1of ($(KBUILD_TARGET), linux netbsd openbsd) 194 194 VirtualBox_LIBS += dl 195 195 endif -
trunk/src/VBox/HostDrivers/Support/freebsd/Makefile
r54419 r55095 83 83 handletablectx.c \ 84 84 once.c \ 85 term.c \ 85 86 thread.c 86 87 … … 90 91 RTStrNLen.c \ 91 92 RTStrCopy.c \ 93 RTStrCopyEx.c \ 92 94 RTStrCopyP.c \ 93 95 strformat.c \ … … 173 175 semspinmutex-r0drv-generic.c \ 174 176 mpnotification-r0drv-generic.c \ 177 threadctxhooks-r0drv-generic.c \ 175 178 RTMpIsCpuWorkPending-r0drv-generic.c 176 179 -
trunk/src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
r54419 r55095 116 116 ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ 117 117 ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ 118 ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ 118 119 ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ 119 120 ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyP.cpp=>common/string/RTStrCopyP.c \ 120 121 ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopy.cpp=>common/string/RTStrCopy.c \ 122 ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \ 121 123 ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \ 122 124 ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \ -
trunk/src/VBox/Main/Makefile.kmk
r54344 r55095 440 440 441 441 VBoxSVC_SOURCES.freebsd = \ 442 src-server/freebsd/HostHardwareFreeBSD.cpp 442 src-server/freebsd/HostHardwareFreeBSD.cpp \ 443 src-server/HostDnsServiceResolvConf.cpp 443 444 444 445 -
trunk/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
r51092 r55095 39 39 # include <sys/stat.h> 40 40 # include <unistd.h> 41 # include <stdio.h> 41 42 # include <sys/ioctl.h> 42 43 # include <fcntl.h> -
trunk/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
r51092 r55095 115 115 116 116 AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 117 LogFlowThisFunc(("aDevice=%s\n", aDevice-> getName().c_str()));117 LogFlowThisFunc(("aDevice=%s\n", aDevice->i_getName().c_str())); 118 118 119 119 /* 120 120 * Don't think we need to do anything when the device is held... fake it. 121 121 */ 122 Assert(aDevice-> getUnistate() == kHostUSBDeviceState_Capturing);122 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_Capturing); 123 123 devLock.release(); 124 124 interruptWait(); … … 134 134 135 135 AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 136 LogFlowThisFunc(("aDevice=%s\n", aDevice-> getName().c_str()));136 LogFlowThisFunc(("aDevice=%s\n", aDevice->i_getName().c_str())); 137 137 138 138 /* 139 139 * We're not really holding it atm., just fake it. 140 140 */ 141 Assert(aDevice-> getUnistate() == kHostUSBDeviceState_ReleasingToHost);141 Assert(aDevice->i_getUnistate() == kHostUSBDeviceState_ReleasingToHost); 142 142 devLock.release(); 143 143 interruptWait(); -
trunk/src/VBox/RDP/client/Makefile.kmk
r54856 r55095 122 122 rdesktop-vrdp_LIBS.solaris = \ 123 123 nsl 124 rdesktop-vrdp_LIBS.freebsd = \ 125 iconv 124 126 125 127 # -
trunk/src/VBox/Runtime/Makefile.kmk
r55047 r55095 1026 1026 generic/RTThreadGetNativeState-generic.cpp \ 1027 1027 r3/freebsd/mp-freebsd.cpp \ 1028 r3/freebsd/systemmem-freebsd.cpp \ 1028 1029 r3/freebsd/rtProcInitExePath-freebsd.cpp \ 1029 1030 r3/generic/allocex-r3-generic.cpp \ … … 1033 1034 r3/posix/RTPathUserHome-posix.cpp \ 1034 1035 r3/posix/RTSystemQueryOSInfo-posix.cpp \ 1035 r3/posix/RTSystemQueryTotalRam-posix.cpp \1036 1036 r3/posix/RTTimeNow-posix.cpp \ 1037 1037 r3/posix/RTTimeSet-posix.cpp \ -
trunk/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
r49718 r55095 169 169 #endif 170 170 vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0); 171 #if __FreeBSD_version < 1000000 171 172 vm_page_lock_queues(); 173 #endif 172 174 for (vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0); 173 175 pPage != NULL; … … 176 178 vm_page_unwire(pPage, 0); 177 179 } 180 #if __FreeBSD_version < 1000000 178 181 vm_page_unlock_queues(); 182 #endif 179 183 #if __FreeBSD_version >= 1000030 180 184 VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject); … … 292 296 { 293 297 pPage = vm_page_lookup(pObject, iPage); 298 #if __FreeBSD_version < 1000000 294 299 vm_page_lock_queues(); 300 #endif 295 301 if (fWire) 296 302 vm_page_unwire(pPage, 0); 297 303 vm_page_free(pPage); 304 #if __FreeBSD_version < 1000000 298 305 vm_page_unlock_queues(); 306 #endif 299 307 } 300 308 #if __FreeBSD_version >= 1000030 -
trunk/src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp
r55093 r55095 36 36 #include <iprt/string.h> 37 37 38 #include <stdio.h> 38 #include <sys/types.h> 39 #include <sys/sysctl.h> 39 40 #include <errno.h> 40 41 /* Satisfy compiller warning */42 #define __EXPORTED_HEADERS__43 #include <sys/sysinfo.h>44 #undef __EXPORTED_HEADERS__45 41 46 42 47 43 RTDECL(int) RTSystemQueryTotalRam(uint64_t *pcb) 48 44 { 45 int rc = VINF_SUCCESS; 46 u_long cbMemPhys = 0; 47 size_t cbParameter = sizeof(cbMemPhys); 48 49 49 AssertPtrReturn(pcb, VERR_INVALID_POINTER); 50 50 51 struct sysinfo info; 52 int rc = sysinfo(&info); 53 if (rc == 0) 51 if (!sysctlbyname("hw.physmem", &cbMemPhys, &cbParameter, NULL, 0)) 54 52 { 55 *pcb = (uint64_t)info.totalram * info.mem_unit;53 *pcb = cbMemPhys; 56 54 return VINF_SUCCESS; 57 55 } … … 64 62 AssertPtrReturn(pcb, VERR_INVALID_POINTER); 65 63 66 FILE *pFile = fopen("/proc/meminfo", "r"); 67 if (pFile) 68 { 69 int rc = VERR_NOT_FOUND; 70 uint64_t cbTotal = 0; 71 uint64_t cbFree = 0; 72 uint64_t cbBuffers = 0; 73 uint64_t cbCached = 0; 74 char sz[256]; 75 while (fgets(sz, sizeof(sz), pFile)) 76 { 77 if (!strncmp(sz, RT_STR_TUPLE("MemTotal:"))) 78 rc = RTStrToUInt64Ex(RTStrStripL(&sz[sizeof("MemTotal:")]), NULL, 0, &cbTotal); 79 else if (!strncmp(sz, RT_STR_TUPLE("MemFree:"))) 80 rc = RTStrToUInt64Ex(RTStrStripL(&sz[sizeof("MemFree:")]), NULL, 0, &cbFree); 81 else if (!strncmp(sz, RT_STR_TUPLE("Buffers:"))) 82 rc = RTStrToUInt64Ex(RTStrStripL(&sz[sizeof("Buffers:")]), NULL, 0, &cbBuffers); 83 else if (!strncmp(sz, RT_STR_TUPLE("Cached:"))) 84 rc = RTStrToUInt64Ex(RTStrStripL(&sz[sizeof("Cached:")]), NULL, 0, &cbCached); 85 if (RT_FAILURE(rc)) 86 break; 87 } 88 fclose(pFile); 89 if (RT_SUCCESS(rc)) 90 { 91 *pcb = (cbFree + cbBuffers + cbCached) * _1K; 92 return VINF_SUCCESS; 93 } 94 } 95 /* 96 * Fallback (e.g. /proc not mapped) to sysinfo. Less accurat because there 97 * is no information about the cached memory. 'Cached:' from above is only 98 * accessible through proc :-( 99 */ 100 struct sysinfo info; 101 int rc = sysinfo(&info); 102 if (rc == 0) 103 { 104 *pcb = ((uint64_t)info.freeram + info.bufferram) * info.mem_unit; 105 return VINF_SUCCESS; 106 } 107 return RTErrConvertFromErrno(errno); 64 int rc = VINF_SUCCESS; 65 u_int cPagesMemFree = 0; 66 u_int cPagesMemInactive = 0; 67 u_int cPagesMemCached = 0; 68 u_int cPagesMemUsed = 0; 69 int cbPage = 0; 70 size_t cbParameter; 71 int cProcessed = 0; 72 73 cbParameter = sizeof(cPagesMemFree); 74 if (sysctlbyname("vm.stats.vm.v_free_count", &cPagesMemFree, &cbParameter, NULL, 0)) 75 rc = RTErrConvertFromErrno(errno); 76 cbParameter = sizeof(cPagesMemUsed); 77 if ( RT_SUCCESS(rc) 78 && sysctlbyname("vm.stats.vm.v_active_count", &cPagesMemUsed, &cbParameter, NULL, 0)) 79 rc = RTErrConvertFromErrno(errno); 80 cbParameter = sizeof(cPagesMemInactive); 81 if ( RT_SUCCESS(rc) 82 && sysctlbyname("vm.stats.vm.v_inactive_count", &cPagesMemInactive, &cbParameter, NULL, 0)) 83 rc = RTErrConvertFromErrno(errno); 84 cbParameter = sizeof(cPagesMemCached); 85 if ( RT_SUCCESS(rc) 86 && sysctlbyname("vm.stats.vm.v_cache_count", &cPagesMemCached, &cbParameter, NULL, 0)) 87 rc = RTErrConvertFromErrno(errno); 88 cbParameter = sizeof(cbPage); 89 if ( RT_SUCCESS(rc) 90 && sysctlbyname("hw.pagesize", &cbPage, &cbParameter, NULL, 0)) 91 rc = RTErrConvertFromErrno(errno); 92 93 if (RT_SUCCESS(rc)) 94 *pcb = (cPagesMemFree + cPagesMemInactive + cPagesMemCached ) * cbPage; 95 96 return rc; 108 97 } 109 98 -
trunk/src/VBox/ValidationKit/utils/cpu/cidet-app.cpp
r53608 r55095 1309 1309 g_AltStack.ss_size = _128K; 1310 1310 # endif 1311 #ifdef RT_OS_FREEBSD 1312 g_AltStack.ss_sp = (char *)RTMemPageAlloc(g_AltStack.ss_size); 1313 #else 1311 1314 g_AltStack.ss_sp = RTMemPageAlloc(g_AltStack.ss_size); 1315 #endif 1312 1316 RTTESTI_CHECK_RET(g_AltStack.ss_sp != NULL, RTEXITCODE_FAILURE); 1313 1317 RTTESTI_CHECK_RC_RET(sigaltstack(&g_AltStack, NULL), 0, RTEXITCODE_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.