Re: 2.5.4 Compile Error

From: John Weber (weber@nyc.rr.com)
Date: Mon Feb 11 2002 - 01:02:19 EST


Jeff Garzik wrote:
> John Weber wrote:
>
>>/usr/src/linux-2.5.4/include/asm/processor.h: In function `thread_saved_pc':
>>/usr/src/linux-2.5.4/include/asm/processor.h:444: dereferencing pointer
>>to incomplete type
>>make: *** [init/main.o] Error 1
>>
>
> since it's just for /usr/bin/ps, ie. not a fast path, I just un-inlined
> it in my alpha hacking. Same approach might work for here, too.
>
> The basic problem, I'm guessing, is that asm/processor.h wants to know
> about the internals of task struct, but it can't yet.
>
> Jeff
>

I don't know what the problem is, but un-inlining this function isn't
correcting it.

The function thread_saved_pc() is a mystery to me. It is declared with
a return type of unsigned long, and yet return this:

((unsigned long *)tsk->thread->esp)[3]

This is confusing to me in many ways:
- the "thread" member of task struct is not a pointer
- esp is of type unsigned long, so I don't understand the cast, and
I certainly don't understand the [3] here.

Can anyone explain this code to me?

I'm a kernelnewbie, so I'm inclined to return:
return (tsk->thread).esp
What is this function trying to do?

-
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/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:36 EST