Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262004AbTIHG0X (ORCPT ); Mon, 8 Sep 2003 02:26:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262020AbTIHG0X (ORCPT ); Mon, 8 Sep 2003 02:26:23 -0400 Received: from magic-mail.adaptec.com ([216.52.22.10]:24193 "EHLO magic.adaptec.com") by vger.kernel.org with ESMTP id S262004AbTIHG0W (ORCPT ); Mon, 8 Sep 2003 02:26:22 -0400 Date: Sun, 7 Sep 2003 23:54:59 +0530 (IST) From: Nagendra Singh Tomar X-X-Sender: tomar@localhost.localdomain Reply-To: nagendra_tomar@adaptec.com To: linux-kernel@vger.kernel.org Subject: [OT] caller-save/callee-save register styles Message-ID: Organization: Adaptec MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 23 I would like to know various people's experiences about the caller-save and callee-save style of preserving register values across procedure calls. I feel that the ABI specification should specify that but I was unable to figure that out in the ELF-ABI specification. What I have personally seen is only callee-save style in which the modified registers are PUSHed on the stack on entering the function and POPed on leaving the function. That means the caller can assume that all the regsiter values will be same just before and after the 'call' instruction. Can we assume one of these styles when writing assembly code that has to be linked with C code generated by the compiler or do we have to first ensure the style that the compiler follows and then use that. Comments on how other ABIs do it are highly welcome, though I am particularly interested about the ELF-ABI and x86 arch. Thanx, tomar - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/