From owner-freebsd-current Fri Dec 8 10: 8:15 2000 From owner-freebsd-current@FreeBSD.ORG Fri Dec 8 10:08:12 2000 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mail.interware.hu (mail.interware.hu [195.70.32.130]) by hub.freebsd.org (Postfix) with ESMTP id E46EC37B401 for ; Fri, 8 Dec 2000 10:08:11 -0800 (PST) Received: from nairobi-22.budapest.interware.hu ([195.70.50.214] helo=elischer.org) by mail.interware.hu with esmtp (Exim 3.16 #1 (Debian)) id 144RwH-0006V5-00 for ; Fri, 08 Dec 2000 19:08:10 +0100 Sender: julian@FreeBSD.ORG Message-ID: <3A31236B.23501A47@elischer.org> Date: Fri, 08 Dec 2000 10:07:39 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: current@freebsd.org Subject: __asm help.. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm trying to write some experimental mutex operations similar to those in -current, but to do differnt things (e.g. a read/write lock) however, I am having some problems with the __asm stuff. What I want to do is to define some operations that will assemble down to: pushfl cli [stuff] popfl I can generate the code, but it seems to me that there should be a way of telling gcc that you have just pushed an item onto the stack, so that if you were to have some C code between the push and po (of the flags reg) the compiler has a correct idea of where the SP is. I can imagine that it doesn't matter so it may be that there is no constaint for that purpose (I read the gcc asm info pages) but I wanted to make sure that that is the case because if it does turn out to be important, it may manifest itself as a wierd bug sometime in 2002. The current pushfl code in the kernel has the following: __asm __volatile("pushfl; popl %0" : "=r" (ef)); which has no long term effect on the stack pointer so I cannot use it as a guide. -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ presently in: Budapest v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message