From owner-FreeBSD-users-jp@jp.freebsd.org  Tue Oct 13 16:28:40 1998
Received: (from daemon@localhost)
	by jaz.jp.freebsd.org (8.9.1+3.1W/8.7.3) id QAA13408;
	Tue, 13 Oct 1998 16:28:40 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from mech-srv.mech.eng.osaka-u.ac.jp (mech-srv.mech.eng.osaka-u.ac.jp [133.1.88.1])
	by jaz.jp.freebsd.org (8.9.1+3.1W/8.7.3) with ESMTP id QAA13402
	for <FreeBSD-users-jp@jp.freebsd.org>; Tue, 13 Oct 1998 16:28:39 +0900 (JST)
	(envelope-from okada@cv.mech.eng.osaka-u.ac.jp)
Received: from slserver.mech.eng.osaka-u.ac.jp (slserver [133.1.245.92])
	by mech-srv.mech.eng.osaka-u.ac.jp (8.8.8/3.6W[Ver.3-E(V7.NIS)/mech-srv/07/07/98]) with SMTP id QAA21779
	for <FreeBSD-users-jp@jp.freebsd.org>; Tue, 13 Oct 1998 16:27:31 +0900 (JST)
Received: from localhost by slserver.mech.eng.osaka-u.ac.jp (SMI-8.6/3.5Wpl4-for-MECH-subdomain-nomx)
	id QAA16324; Tue, 13 Oct 1998 16:28:36 +0900
To: FreeBSD-users-jp@jp.freebsd.org
In-Reply-To: Your message of "Tue, 13 Oct 1998 14:33:53 +0900 (JST)"
	<199810130533.OAA25731@nazuna.bres.tsukuba.ac.jp>
References: <199810130533.OAA25731@nazuna.bres.tsukuba.ac.jp>
X-Mailer: Mew version 1.93b37 on Emacs 19.28 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
	boundary="--Next_Part(Tue_Oct_13_16:26:37_1998_945)--"
Content-Transfer-Encoding: 7bit
Message-Id: <19981013162649O.okada@cv.mech.eng.osaka-u.ac.jp>
Date: Tue, 13 Oct 1998 16:26:49 +0900
From: Ryuzo Okada <okada@cv.mech.eng.osaka-u.ac.jp>
X-Dispatcher: imput version 980522
Lines: 180
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+980914
X-Sequence: FreeBSD-users-jp 33947
Subject: [FreeBSD-users-jp 33947] Re: [Q] Wine-980927 make
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org

----Next_Part(Tue_Oct_13_16:26:37_1998_945)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit


$B2,ED!wBg:eBg3X$H?=$7$^$9!%(B

>> >./treeview.c:81: Undefined symbol `_test_bit' referenced from text segment
>> >./treeview.c:151: Undefined symbol `_set_bit' referenced from text segment
>>
>>  $B$3$l$i$NJ}$,CWL?E*$G$9$M!#(B

$B$3$l$O!$(BFreeBSD$B$K$O!$$3$l$i$N4X?t$,$J$$(B(Linux$B$K$O$"$k(B)$B$?$a$K5/$3$j$^$9!%(B

>> #include <asm/bitops.h>     /* FIXME: linux specific */ 
>> $B$r:o=|!#(B

$B$9$k$N$G$O$J$/!$(BLinux$B$+$i$3$N%X%C%@%U%!%$%k$r;}$C$F$-$F!$(Binclude$B$9$l$P(B
$BLdBj$J$/%3%s%Q%$%k$G$-$^$9!%$3$N%a!<%k$N:G8e$K(Bbitops.h$B$r$D$1$F$*$-$^$9!%(B
test_bit()$B!$(Bset_bit()$B$O!$(Bbitops.h$B$N$J$+$G!$Dj5A$5$l$F$$$^$9!%(B


gets --> fgets$B$NJQ99$O$9$kI,MW$O$J$$$G$9!%(B($B$7$F$b$$$$$s$G$7$g$&$1$I!%(B)


>> # ./configure --with-japanese --with-kinput
>> ...
>> *** Warning: non-reentrant libc detected. Wine will be build without
>> *** thread support. Consider upgrading libc to a more recent
>> *** reentrant version of libc.

$B!V(Blibc$B$,(Bthread$B$KBP1~$7$F$J$$$+$i!$(Bthread$B$J$7$G:n$k$h!W$H$$$C$F$$$k$h$&(B
$B$G$9$,!$$H$j$"$($:!$$3$N$^$^J|$C$F$*$$$F$bLdBj$J$/%3%s%Q%$%k$G$-$F!$<B(B
$B9T$b$G$-$^$9!%(B


----Next_Part(Tue_Oct_13_16:26:37_1998_945)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitops.h

#ifndef _I386_BITOPS_H
#define _I386_BITOPS_H

/*
 * Copyright 1992, Linus Torvalds.
 */

/*
 * These have to be done with inline assembly: that way the bit-setting
 * is guaranteed to be atomic. All bit operations return 0 if the bit
 * was cleared before the operation and != 0 if it was not.
 *
 * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
 */

#ifdef __SMP__
#define LOCK_PREFIX "lock ; "
#define SMPVOL volatile
#else
#define LOCK_PREFIX ""
#define SMPVOL
#endif

/*
 * Some hacks to defeat gcc over-optimizations..
 */
struct __dummy { unsigned long a[100]; };
#define ADDR (*(struct __dummy *) addr)
#define CONST_ADDR (*(const struct __dummy *) addr)

extern __inline__ int set_bit(int nr, SMPVOL void * addr)
{
	int oldbit;

	__asm__ __volatile__(LOCK_PREFIX
		"btsl %2,%1\n\tsbbl %0,%0"
		:"=r" (oldbit),"=m" (ADDR)
		:"ir" (nr));
	return oldbit;
}

extern __inline__ int clear_bit(int nr, SMPVOL void * addr)
{
	int oldbit;

	__asm__ __volatile__(LOCK_PREFIX
		"btrl %2,%1\n\tsbbl %0,%0"
		:"=r" (oldbit),"=m" (ADDR)
		:"ir" (nr));
	return oldbit;
}

extern __inline__ int change_bit(int nr, SMPVOL void * addr)
{
	int oldbit;

	__asm__ __volatile__(LOCK_PREFIX
		"btcl %2,%1\n\tsbbl %0,%0"
		:"=r" (oldbit),"=m" (ADDR)
		:"ir" (nr));
	return oldbit;
}

/*
 * This routine doesn't need to be atomic.
 */
extern __inline__ int test_bit(int nr, const SMPVOL void * addr)
{
	return ((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5])) != 0;
}

/*
 * Find-bit routines..
 */
extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
{
	int res;

	if (!size)
		return 0;
	__asm__("cld\n\t"
		"movl $-1,%%eax\n\t"
		"xorl %%edx,%%edx\n\t"
		"repe; scasl\n\t"
		"je 1f\n\t"
		"xorl -4(%%edi),%%eax\n\t"
		"subl $4,%%edi\n\t"
		"bsfl %%eax,%%edx\n"
		"1:\tsubl %%ebx,%%edi\n\t"
		"shll $3,%%edi\n\t"
		"addl %%edi,%%edx"
		:"=d" (res)
		:"c" ((size + 31) >> 5), "D" (addr), "b" (addr)
		:"ax", "cx", "di");
	return res;
}

extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{
	unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
	int set = 0, bit = offset & 31, res;
	
	if (bit) {
		/*
		 * Look for zero in first byte
		 */
		__asm__("bsfl %1,%0\n\t"
			"jne 1f\n\t"
			"movl $32, %0\n"
			"1:"
			: "=r" (set)
			: "r" (~(*p >> bit)));
		if (set < (32 - bit))
			return set + offset;
		set = 32 - bit;
		p++;
	}
	/*
	 * No zero yet, search remaining full bytes for a zero
	 */
	res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
	return (offset + set + res);
}

/*
 * ffz = Find First Zero in word. Undefined if no zero exists,
 * so code should check against ~0UL first..
 */
extern __inline__ unsigned long ffz(unsigned long word)
{
	__asm__("bsfl %1,%0"
		:"=r" (word)
		:"r" (~word));
	return word;
}

#endif /* _I386_BITOPS_H */

----Next_Part(Tue_Oct_13_16:26:37_1998_945)----
