Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Apr 2003 17:31:23 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28850 for review
Message-ID:  <200304130031.h3D0VNSe079063@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304130031.h3D0VNSe079063>