openfirmware: fix of_seek for 64bit systems

The position is on 2 cells even on 64bit systems.

Change-Id: I97f4e3fc02734c548ed23445a917a894ff548379
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2351
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
PulkoMandy 2020-03-14 16:38:42 +01:00 committed by waddlesplash
parent ed7329a890
commit 5f86d837c0

View File

@ -472,14 +472,19 @@ of_write(intptr_t handle, const void *buffer, intptr_t bufferSize)
intptr_t
of_seek(intptr_t handle, off_t pos)
{
intptr_t pos_hi = 0;
if (sizeof(off_t) > sizeof(intptr_t))
pos_hi = pos >> ((sizeof(off_t) - sizeof(intptr_t)) * CHAR_BIT);
struct {
const char *name;
intptr_t num_args;
intptr_t num_returns;
intptr_t handle;
int64 pos;
intptr_t pos_hi;
intptr_t pos;
intptr_t status;
} args = {"seek", 3, 1, handle, pos, 0};
} args = {"seek", 3, 1, handle, pos_hi, pos, 0};
if (gCallOpenFirmware(&args) == OF_FAILED)
return OF_FAILED;