openfirmware: more fixes for 64bit systems.

Gets call-method working for sparc, and fix more places where we
accidentally truncate 64bit values or sign-extend 32 bit ones.

Change-Id: Ic79c55ffa8d2b475858def1639004412f17dd0c1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1986
Reviewed-by: Alex von Gluck IV <[email protected]>
This commit is contained in:
PulkoMandy
2020-01-18 03:29:27 +00:00
committed by waddlesplash
parent 2f37766000
commit 959588394d
5 changed files with 8 additions and 8 deletions
@@ -39,7 +39,7 @@ platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
return B_ENTRY_NOT_FOUND;
printf("boot path = \"%s\"\n", sBootPath);
int node = of_finddevice(sBootPath);
intptr_t node = of_finddevice(sBootPath);
if (node != OF_FAILED) {
char type[16];
of_getprop(node, "device_type", type, sizeof(type));
@@ -65,7 +65,7 @@ platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
}
}
if (bootAddress == 0) {
int package = of_finddevice("/options");
intptr_t package = of_finddevice("/options");
char defaultServerIP[16];
int bytesRead = of_getprop(package, "default-server-ip",
defaultServerIP, sizeof(defaultServerIP) - 1);
@@ -44,7 +44,7 @@ public:
virtual ssize_t Receive(void *buffer, size_t size);
private:
int fHandle;
intptr_t fHandle;
mac_addr_t fMACAddress;
};
@@ -109,7 +109,7 @@ OFEthernetInterface::Init(const char *device, const char *parameters)
return B_ERROR;
}
int package = of_instance_to_package(fHandle);
intptr_t package = of_instance_to_package(fHandle);
// get MAC address
int bytesRead = of_getprop(package, "local-mac-address", &fMACAddress,
@@ -250,7 +250,7 @@ platform_net_stack_init()
*parameters = '\0';
// get device node
int node = of_finddevice(bootPath);
intptr_t node = of_finddevice(bootPath);
if (node == OF_FAILED)
return B_ERROR;
@@ -115,7 +115,7 @@ platform_init_video(void)
{
gKernelArgs.frame_buffer.enabled = false;
int screen = of_finddevice("screen");
intptr_t screen = of_finddevice("screen");
if (screen == OF_FAILED)
return B_NO_INIT;
edid1_raw edidRaw;
@@ -122,7 +122,7 @@ of_interpret(const char *command, intptr_t numArgs, intptr_t numReturns, ...)
intptr_t
of_call_method(intptr_t handle, const char *method, intptr_t numArgs,
of_call_method(uint32_t handle, const char *method, intptr_t numArgs,
intptr_t numReturns, ...)
{
struct {