Date: Sun, 12 Aug 2012 15:25:04 GMT From: svn-freebsd-gecko@chruetertee.ch To: freebsd-gecko@freebsd.org Subject: [SVN-Commit] r927 - branches/experimental/devel/nspr/files Message-ID: <201208121525.q7CFP4NQ044174@trillian.chruetertee.ch>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Sun Aug 12 15:25:04 2012 New Revision: 927 Log: rename physmem patch and reuse already present code Added: branches/experimental/devel/nspr/files/patch-bug782124 Deleted: branches/experimental/devel/nspr/files/patch-.._pr_src_misc_prsystem.c Deleted: branches/experimental/devel/nspr/files/patch-.._pr_src_misc_prsystem.c ============================================================================== --- branches/experimental/devel/nspr/files/patch-.._pr_src_misc_prsystem.c Sun Aug 12 15:25:04 2012 (r926) +++ /dev/null 00:00:00 1970 (deleted) @@ -1,22 +0,0 @@ ---- ../pr/src/misc/prsystem.c.orig Fri May 6 20:35:58 2005 -+++ ../pr/src/misc/prsystem.c Sun Dec 4 22:09:51 2005 -@@ -352,6 +352,19 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMem - odm_terminate(); - } - -+#elif defined(__FreeBSD__) -+ -+ int mib[2]; -+ unsigned long physmem; -+ size_t len; -+ -+ mib[0] = CTL_HW; -+ mib[1] = HW_PHYSMEM; -+ len = sizeof(physmem); -+ if(sysctl(mib, 2, &physmem, &len, NULL, 0) == 0 -+ && len == sizeof(physmem)) -+ bytes = physmem; -+ - #else - - PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); Added: branches/experimental/devel/nspr/files/patch-bug782124 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/experimental/devel/nspr/files/patch-bug782124 Sun Aug 12 15:25:04 2012 (r927) @@ -0,0 +1,37 @@ +--- ../pr/src/misc/prsystem.c~ ++++ ../pr/src/misc/prsystem.c +@@ -24,7 +24,7 @@ + + /* BSD-derived systems use sysctl() to get the number of processors */ + #if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \ +- || defined(OPENBSD) || defined(DARWIN) ++ || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN) + #define _PR_HAVE_SYSCTL + #include <sys/param.h> + #include <sys/sysctl.h> +@@ -292,15 +292,23 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) + if (pageSize >= 0 && pageCount >= 0) + bytes = (PRUint64) pageSize * pageCount; + +-#elif defined(NETBSD) || defined(OPENBSD) +- ++#elif defined(NETBSD) || defined(OPENBSD) \ ++ || defined(FREEBSD) || defined(DRAGONFLY) + int mib[2]; + int rc; ++#if defined(NETBSD) || defined(OPENBSD) + uint64_t memSize; ++#else ++ unsigned long memSize; ++#endif + size_t len = sizeof(memSize); + + mib[0] = CTL_HW; ++#if defined(NETBSD) || defined(OPENBSD) + mib[1] = HW_PHYSMEM64; ++#else ++ mib[1] = HW_PHYSMEM; ++#endif + rc = sysctl(mib, 2, &memSize, &len, NULL, 0); + if (-1 != rc) { + bytes = memSize;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208121525.q7CFP4NQ044174>