From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id 2F65441C50 for ; Tue, 12 Nov 2002 19:04:04 -0500 (EST) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id gAD043f13074 for axp-list@listman.redhat.com; Tue, 12 Nov 2002 19:04:03 -0500 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id gAD043D13070 for ; Tue, 12 Nov 2002 19:04:03 -0500 Received: from technolust.cx (technolust.cx [66.92.82.226]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id gACNesw15906 for ; Tue, 12 Nov 2002 18:40:54 -0500 Received: from witchblade (pool-141-154-161-250.wma.east.verizon.net [141.154.161.250]) by technolust.cx (8.9.3/8.9.3) with SMTP id TAA15397 for ; Tue, 12 Nov 2002 19:04:01 -0500 From: "Peter Petrakis" To: "'Axp-List" Subject: GCC inline ASM is 'evil' Date: Tue, 12 Nov 2002 19:04:00 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: Hi Guys, There are some inline ASM bits I'm wrestling with in the EBSDK port which I just cant seem to figure out. Now I've read the gcc docs and looked at examples in the kernel and I still can't seem to get it right. I'm hoping someone here could shed some light on my errors. #define INLINE static #define ASM asm //#include #endif #ifndef _WIN32 #pragma inline (atomic_inc) #endif INLINE int atomic_inc(int source,volatile int *dest) { unsigned int temp=0,ret; asm ("mb;"); while (temp==0) { // ret= ASM("ldl_l %v0,(%a0);", dest); asm ( "ldl_l %0,(%16)": "=r" (ret): "p"(dest) ); temp= ASM("addl %a0,1,%v0;\ stl_c %v0,(%a1) ;",ret,dest); } ASM ("mb;"); return ret; } The ASM line that is commented out is DU inline ASM, which actually makes sense. On the next line is my attempt :). I 'seem' to have my operands correctly constrained, as best as I can figure. The error I get is. ../h/interlock.h:67: invalid `asm': operand number out of range What does that mean??? I've tried so many different combinations that even if I made the compiler error go away I wouldn't trust the code. What am I doing wrong here? Thanks in advance. Peter -- www.linuxalpha.org www.alphadriven.org Peter Petrakis Warrior/Engineer voodoo@alphadriven.org " Who the hell are you!? Name's Ash Housewares..."