[OpenBIOS] [PATCH] ppc: force target CPU

BALATON Zoltan balaton at eik.bme.hu
Mon Jan 25 18:45:17 CET 2016


On Mon, 25 Jan 2016, Laurent Vivier wrote:
> There isn't more detail with V=1
>
> With gdb:
> Program received signal SIGSEGV, Segmentation fault.
> findword (s1=0x10007b80 "(semis)")
>    at /home/laurent/Projects/openbios/kernel/dict.c:118
> 118			tmplfa = read_ucell(cell2pointer(tmplfa));
>
> (gdb) whatis tmplfa
> type = ucell
> (gdb) whatis ucell
> type = uint32_t
>
> and in include/kernel/stack.h:
>
> #ifdef NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH
>
> static inline ucell pointer2cell(const void* x)
> {
>    return (ucell)(uintptr_t)x;
> }
>
> static inline void* cell2pointer(ucell x)
> {
>    return (void*)(uintptr_t)x;
> }
>
> #endif
>
> So I guess using an uint32_t to store a pointer on a 64bit machine can
> cause some troubles.
>
> I have no "include/arch/ppc64/types.h", is that normal ?

Sorry, no idea. I don't seem to have include/arch/ppc64 in my tree from 
svn either but I don't know if that's normal or not. Maybe it is. Just 
thought posting more details might help others to help you. For example 
what was the command that got you the above gdb output and what's the full 
stack trace?

Probably you are right that it should use 64 bit value for pointers 
instead of 32 bit but I have no idea why it doesn't. Recent changes in 
this area seem to be:

1f52358fed8fc785e26539a3efce816cf36ee61e bootstrap: don't include files 
from target/include as system includes

that remove some typedefs added earlier by

4415741789e3acd525c265c641041c4fd60c3541 PPC: Add kernel header style 
typedefs

but I don't know if that's related.

Regards,
BALATON Zoltan



More information about the OpenBIOS mailing list