lkml.org 
[lkml]   [1999]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: stdcall in egcs
On Mon, 10 May 1999, Andrea Arcangeli wrote:

> On Sun, 9 May 1999, Mike Galbraith wrote:
>
> >egcs-2.93.21 -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fno-omit-frame-pointer -g1 -pg -pipe -DCPU=586 -mcpu=pentium -march=pentium
> > -c -o process.o process.c
> > process.c:718: conflicting types for `__switch_to'
> > /usr/src/linux/include/asm/system.h:15: previous declaration of `__switch_to'
> > make[1]: *** [process.o] Error 1

> Ah, but 2.2.8-pre4 has some switch_to changes that will almost sure break
> IKD.
>
> So now the point is: does the same happen with 2.2.7 ?

Yes, same thing has been happening for a while now. (6-10 egcs snapshots)

> In 2.2.8 switch_to get the third parameter. The third parameter basically
> is needed only to make sure to still have ebx pointing the "prev" task
> before exiting the switch_to asm.
>
> I have not yet tried but I am sure that to fix the asm of the IKD
> switch_to we only need to change the numeration of some register (because
> it changed their offset adding some additional variable in the
> input/output section of the asm).

I changed switch_to() to look like...
#define switch_to(prev,next,last) do { \
asm volatile("pushl %%esi\n\t" \
"pushl %%edi\n\t" \
"pushl %%ebp\n\t" \
"movl %%esp,%0\n\t" /* save ESP */ \
"movl %3,%%esp\n\t" /* restore ESP */ \
"movl $1f,%1\n\t" /* save EIP */ \
"pushl %4\n\t" /* restore EIP */ \
"jmp __switch_to\n" \
"1:\t" \
"popl %%ebp\n\t" \
"popl %%edi\n\t" \
"popl %%esi\n\t" \
:"=m" (prev->tss.esp),"=m" (prev->tss.eip), \
"=b" (last) \
:"m" (next->tss.esp),"m" (next->tss.eip), \
"a" (prev), "d" (next), \
"b" (prev)); \
} while (0)
...and am running with ktracer and gcc profiling. (egcs-1.1.2)

-Mike


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.049 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site