10 #include <semaphore.h> 13 #include <sys/resource.h> 15 #include <sys/types.h> 25 #include <sys/procfs.h> 33 #include "src/base/macros.h" 34 #include "src/base/platform/platform-posix-time.h" 35 #include "src/base/platform/platform-posix.h" 36 #include "src/base/platform/platform.h" 43 static const pthread_t kNoThread = (pthread_t) 0;
48 bool OS::ArmUsingHardFloat() {
57 #define GCC_VERSION (__GNUC__ * 10000 \ 58 + __GNUC_MINOR__ * 100 \ 59 + __GNUC_PATCHLEVEL__) 60 #if GCC_VERSION >= 40600 61 #if defined(__ARM_PCS_VFP) 67 #elif GCC_VERSION < 40500 71 #if defined(__ARM_PCS_VFP) 73 #elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \ 77 #error "Your version of GCC does not report the FP ABI compiled for." \ 78 "Please report it on this issue" \ 79 "http://code.google.com/p/v8/issues/detail?id=2140" 88 TimezoneCache* OS::CreateTimezoneCache() {
89 return new PosixDefaultTimezoneCache();
92 std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
93 std::vector<SharedLibraryAddress> result;
94 procfs_mapinfo *mapinfos =
nullptr, *mapinfo;
98 procfs_debuginfo info;
102 char buf[PATH_MAX + 1];
103 snprintf(buf, PATH_MAX + 1,
"/proc/%d/as", getpid());
105 if ((proc_fd = open(buf, O_RDONLY)) == -1) {
111 if (devctl(proc_fd, DCMD_PROC_MAPINFO,
nullptr, 0, &num) != EOK) {
117 reinterpret_cast<procfs_mapinfo*
>(malloc(num *
sizeof(procfs_mapinfo)));
118 if (mapinfos ==
nullptr) {
124 if (devctl(proc_fd, DCMD_PROC_PAGEDATA, mapinfos,
125 num *
sizeof(procfs_mapinfo), &num) != EOK) {
131 for (
i = 0;
i < num;
i++) {
132 mapinfo = mapinfos +
i;
133 if (mapinfo->flags & MAP_ELF) {
134 map.info.vaddr = mapinfo->vaddr;
135 if (devctl(proc_fd, DCMD_PROC_MAPDEBUG, &map,
sizeof(map), 0) != EOK) {
138 result.push_back(SharedLibraryAddress(map.info.path, mapinfo->vaddr,
139 mapinfo->vaddr + mapinfo->size));
147 void OS::SignalCodeMovingGC() {}