From owner-freebsd-hackers Tue Apr 15 11:42:35 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA28921 for hackers-outgoing; Tue, 15 Apr 1997 11:42:35 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id LAA28911 for ; Tue, 15 Apr 1997 11:42:30 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA22852; Tue, 15 Apr 1997 11:19:57 -0700 From: Terry Lambert Message-Id: <199704151819.LAA22852@phaeton.artisoft.com> Subject: Re: inline asm question.. To: ccsanady@nyx.pr.mcs.net (Chris Csanady) Date: Tue, 15 Apr 1997 11:19:57 -0700 (MST) Cc: hackers@FreeBSD.ORG In-Reply-To: <199704150943.EAA03061@nyx.pr.mcs.net> from "Chris Csanady" at Apr 15, 97 04:43:37 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I am trying to create an inline asm function, and was wondering if someone > might help. I am getting quite frustrated with all of the cryptic gcc/as > commands, and still have no clue as to how it translates into instructions. > > All I wanted to do was to make the below inline function generate the > following code. (It is a piece from one of Van Jacobsons mails..) I > realize this is for sparc, but it really doesnt matter.. > > /* NB - ocadd is an inline gcc assembler function */ > cksum = ocadd(ocadd(ocadd(ocadd(cksum, seq), ack), flg), sum); Is it an inline function, or is it a function which has been inlined? I belive you can't inline (using the "inline" keyword) a function with asm statements. Use a macro definition instead to cause the asm statements to be expanded "in line" by the preprocessor. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.