From owner-freebsd-hackers Thu Jul 26 13:58:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from sharmas.dhs.org (cpe-66-1-147-119.ca.sprintbbd.net [66.1.147.119]) by hub.freebsd.org (Postfix) with ESMTP id B33FB37B406 for ; Thu, 26 Jul 2001 13:58:53 -0700 (PDT) (envelope-from adsharma@sharmas.dhs.org) Received: by sharmas.dhs.org (Postfix, from userid 500) id 395A95DD97; Thu, 26 Jul 2001 13:59:13 -0700 (PDT) Date: Thu, 26 Jul 2001 13:59:13 -0700 From: Arun Sharma To: hackers@freebsd.org Subject: Need a clean room implementation of this function Message-ID: <20010726135913.A23052@sharmas.dhs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'm porting a BSD licensed Java VM from Linux to FreeBSD and ran into the following Linux function which is not implemented in BSDs. To avoid GPL contamination issues, can someone complete[1] the following method in inlined IA-32 assembly ? Intel instruction reference documents an instruction called BTS, which does just this. Thanks! -Arun [1] I've already looked at the Linux implementation - does that disqualify me ? Has anyone dealt with such issues in the past ? /** * test_and_set_bit - Set a bit and return its old value * @nr: Bit to set * @addr: Address to count from * * This operation is atomic and cannot be reordered. * It also implies a memory barrier. */ static __inline__ int test_and_set_bit(int nr, volatile void * addr); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message