From owner-p4-projects@FreeBSD.ORG Sat Apr 12 17:31:25 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EF05437B404; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F37937B401 for ; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 365FF43FAF for ; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3D0VO0U079066 for ; Sat, 12 Apr 2003 17:31:24 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3D0VNSe079063 for perforce@freebsd.org; Sat, 12 Apr 2003 17:31:23 -0700 (PDT) Date: Sat, 12 Apr 2003 17:31:23 -0700 (PDT) Message-Id: <200304130031.h3D0VNSe079063@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 28850 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2003 00:31:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=28850 Change 28850 by marcel@marcel_nfs on 2003/04/12 17:31:00 AARRGGHH.. GCC checks the code for calls to "special" functions, such as setjmp(), longjmp() and alloca(). It also checks for savectx() and marks the function as having a call that can return twice. I don't particularly have a problem with that, but it also means that the function has a large prologue and epilogue in which most of the context is saved and restore. Since cpu_switch() is in C and uses savectx() and restorectx() to handle the register contexts, we're doing most of it twice. That sucks :-( For some reason GCC continues to make assumptions about functions even though we compile with -ffreestanding. Stop GCC's interference by renaming savectx to savectx__ with a preprocessor define. We may want to make the define dependent on the compiler, but I didn't bother doing that now... Affected files ... .. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#10 edit .. //depot/projects/ia64_epc/sys/ia64/include/pcb.h#6 edit Differences ... ==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#10 (text+ko) ==== @@ -163,11 +163,11 @@ END(restorectx) /* - * void savectx(struct pcb *) + * void savectx__(struct pcb *) * void swapctx(struct pcb *old, struct pcb *new) */ -ENTRY(savectx,1) +ENTRY(savectx__,1) { .mmi alloc r16=ar.pfs,1,1,0,0 ;; ==== //depot/projects/ia64_epc/sys/ia64/include/pcb.h#6 (text+ko) ==== @@ -49,6 +49,7 @@ }; #ifdef _KERNEL +#define savectx savectx__ void restorectx(struct pcb *) __dead2; int savectx(struct pcb *); void swapctx(struct pcb *old, struct pcb *new);