PERFORCE change 28850 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sat Apr 12 17:31:26 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=28850
Change 28850 by marcel at 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);
More information about the p4-projects
mailing list