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<page_count;i++)
===================================================================
I also had some problems with hysigunix.c and hysignal_context.* that
disappeared at all now, and still have some problems with DRLVM build.
Also I was forced to build ICU for x86_64.
I'm going to finish DRLVM changes and suggest a patch for
FreeBSD/x86_64 (and I'll split it into small patches if it become too
large).
Thanks,
Ilya.
2008/9/4 Mark Hindess <[EMAIL PROTECTED]>:
>
> In message <[EMAIL PROTECTED]>, Tim Ellison writes:
>>
>> Mark Hindess wrote:
>> > In message <[EMAIL PROTECTED]>, 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.
>
>
>
>
>