Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 97394 invoked from network); 4 Sep 2008 13:35:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2008 13:35:30 -0000 Received: (qmail 15057 invoked by uid 500); 4 Sep 2008 13:35:26 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 15023 invoked by uid 500); 4 Sep 2008 13:35:26 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 15012 invoked by uid 99); 4 Sep 2008 13:35:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 06:35:26 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ilya.berezhniuk@gmail.com designates 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 13:34:28 +0000 Received: by nf-out-0910.google.com with SMTP id c7so793413nfi.40 for ; Thu, 04 Sep 2008 06:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=j+4chDgrSWsvwAgyBdT4CWFyQBCPj+GZ6z0DQ/LukZI=; b=UIh9uQk+aJ+fDCxglNiIN9pyOHpvbloVu/l9/c5GhwnQ0/VsjV4Afsq7YRNDN+LqAw YxXqHibc1nFR6CAjit5Rn2HvsnEz5cWfmkll7wW7lauwTDBVCjWydb5m8KXtLwgt45ab 9plZCcJydmDx9W8H5UxLwRjJNjPbvZGQ2+ZAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=XFGV3iKSRiFStVxgC613vFSsW5UmcsiOAWE+5GA3iGkhLYV/kNnotdDOLf8xVJ+RHN CUVMBTX67QC6LvDqk+xg9haq20MB6UiwH+8fmcXrF1GcsM5ZXmpcbHrP6tUDzceCKl8m 0QhP5ac4yhwgrbwOkyW1AhWfI2JFHIlpXAsV8= Received: by 10.187.219.15 with SMTP id w15mr2386823faq.3.1220535280963; Thu, 04 Sep 2008 06:34:40 -0700 (PDT) Received: by 10.187.197.10 with HTTP; Thu, 4 Sep 2008 06:34:40 -0700 (PDT) Message-ID: <5ce835490809040634j82f9238of012ae5ad73cf097@mail.gmail.com> Date: Thu, 4 Sep 2008 17:34:40 +0400 From: "Ilya Berezhniuk" To: dev@harmony.apache.org Subject: Re: [classlib][build][freebsd] Fix Classlib build for FreeBSD 6.3 x86 In-Reply-To: <200809041214.m84CEumi001737@d06av01.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5ce835490809030854x30fc1502i27f5c3e1df2cc584@mail.gmail.com> <200809040921.m849LfBA031614@d06av04.portsmouth.uk.ibm.com> <48BFAB84.2090000@gmail.com> <200809041002.m84A2Inw015646@d12av01.megacenter.de.ibm.com> <48BFC49C.6010509@gmail.com> <200809041214.m84CEumi001737@d06av01.portsmouth.uk.ibm.com> X-Virus-Checked: Checked by ClamAV on apache.org Tim, Mark, Thanks a lot for your help! BTW, I'm already started porting to FreeBSD x86_64 (7.0 release), and also met mincore problem in OSMemoryLinux32.c; my patch looked like =================================================================== @@ -35,6 +35,13 @@ #define MAP_FAILED ((void *) -1) #endif +/* FreeBSD has 'char*' type for 'vec' argument */ +#if defined(FREEBSD) +typedef char* mincore_vec_type_t; +#else +typedef unsigned char* mincore_vec_type_t; +#endif + #define OS_JNI(func) JNICALL Java_org_apache_harmony_luni_platform_OSMemory_##func JNIEXPORT jboolean JNICALL Java_org_apache_harmony_luni_platform_OSMemory_isLittleEndianImpl(JNIEnv * env, jclass clazz) @@ -102,7 +109,7 @@ size += align_offset; page_count = (size+page_size-1)/page_size; vec = (char *) hymem_allocate_memory(page_count*sizeof(char)); - if(mincore((void *)m_addr, size , (unsigned char *)vec)==0) //or else there is error about the mincore and return false; + if(mincore((void *)m_addr, size , (mincore_vec_type_t)vec)==0) //or else there is error about the mincore and return false; { int i; for(i=0 ;i: > > In message <48BFC49C.6010509@gmail.com>, Tim Ellison writes: >> >> Mark Hindess wrote: >> > In message <48BFAB84.2090000@gmail.com>, Tim Ellison writes: >> >> Mark Hindess wrote: >> >>> +#if defined(FREEBSD) >> >>> +#define HY_VEC_T char >> >>> +#else >> >>> +#define HY_VEC_T unsigned char >> >>> +#endif >> >>> + HY_VEC_T* vec = NULL; >> >> Am I misreading this? It used to be char* on non-FREEBSD systems, and >> >> you needed to change it to be unsigned char* ? >> > >> > Not exactly. But your confusion is understandable. I should have explaine >> d >> > this change. I'm fixing two things: >> > >> > a) vec was a char* but the only place it was used as char* was in the >> > cast from the void* returned by hymem_allocate_memory. It was then >> > forced to unsigned char*. Logically it made more sense to just >> > change vec to unsigned char* and fix the cast. >> > >> > b) The type of the third parameter to mincore on freebsd needs to be cha >> r*. >> > >> > That should make more sense now? >> >> Yes, thanks. I had not figured out the 'double step'. >> >> > (Of course, if I'd committed it I would >> > have explained that in the commit message.) >> >> Of course ;-) > > I found an old Freebsd 6.2 qemu image and checked the change myself so > I've committed it as two trivial changes, rather than one complex change, > in r691981 and r691987. > > -Mark. > > > > >