mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Don't assume that pointer and cell size are identical, part 2
Do the double-dereference in two cell2pointer steps to avoid garbage in the high 32 address bits on ppc64. Signed-off-by: Andreas Färber <andreas.faerber@web.de> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@930 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Andreas Färber
parent
545998848f
commit
ead25906f6
@@ -329,10 +329,11 @@ static void doplusloop(void)
|
||||
#ifndef FCOMPILER
|
||||
static ucell get_myself(void)
|
||||
{
|
||||
static ucell **myself = NULL;
|
||||
if( !myself )
|
||||
myself = (ucell**)findword("my-self") + 1;
|
||||
return (*myself && **myself) ? (ucell)**myself : 0;
|
||||
static ucell *myselfptr = NULL;
|
||||
if (myselfptr == NULL)
|
||||
myselfptr = (ucell*)cell2pointer(findword("my-self")) + 1;
|
||||
ucell *myself = (ucell*)cell2pointer(*myselfptr);
|
||||
return (myself != NULL) ? *myself : 0;
|
||||
}
|
||||
|
||||
static void doivar(void)
|
||||
|
||||
Reference in New Issue
Block a user