Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
syscall function parameter
05-28-2013, 04:03 AM
Post: #1
syscall function parameter
const HLEFunction sceNetAdhocctl[] =
{
{...}, {...},
{0x20B317A0, WrapI_UU<sceNetAdhocctlAddHandler>, "sceNetAdhocctlAddHandler"},
...,
{...},
}
typedef void(* sceNetAdhocctlHandler)(int flag, int error, void *unknown);

int sceNetAdhocctlAddHandler(u32 handler, u32 unknown)
{
netActHandler = (sceNetAdhocctlHandler)Memory::GetPointer(handler);
netActParam=(void*)unknown;
// I know this function is not here call, just test
if (netActHandler)
netActHandler(3, 0, netActParam); // this will break when debug
return 0; //return Handler id on success, < 0 on error.
}

Parameter handler point to function is not compile???
How to make it run well?

My English is not good, don't dispute my grammar.
Find all posts by this user
Quote this message in a reply
05-28-2013, 06:04 AM
Post: #2
RE: syscall function parameter
It's a MIPS function, not a C function. You can't call it directly. It doesn't have ARM/Intel instructions at that memory address.

Instead, it needs to bail into emulation. For example, using __KernelCallAddress. But you probably need to do something after it is called too. Look for example at sceFont.cpp, which also calls handlers.

-[Unknown]
Find all posts by this user
Quote this message in a reply
05-28-2013, 02:29 PM (This post was last modified: 05-28-2013 02:55 PM by Denizen.)
Post: #3
RE: syscall function parameter
It seems the handler is used as a callback function whenever the network connection state of an adhoc connection has changed.

The state is obtained by calling sceNetAdhocctlGetState(int *event);

Possible connection states:

PSP_NET_APCTL_STATE_DISCONNECTED 0
PSP_NET_APCTL_STATE_SCANNING 1
PSP_NET_APCTL_STATE_JOINING 2
PSP_NET_APCTL_STATE_GETTING_IP 3
PSP_NET_APCTL_STATE_GOT_IP 4
PSP_NET_APCTL_STATE_EAP_AUTH 5
PSP_NET_APCTL_STATE_KEY_EXCHANGE 6
Find all posts by this user
Quote this message in a reply
05-30-2013, 11:41 AM
Post: #4
RE: syscall function parameter
(05-28-2013 06:04 AM)[Unknown] Wrote:  It's a MIPS function, not a C function. You can't call it directly. It doesn't have ARM/Intel instructions at that memory address.

Instead, it needs to bail into emulation. For example, using __KernelCallAddress. But you probably need to do something after it is called too. Look for example at sceFont.cpp, which also calls handlers.

-[Unknown]
Think you!Big Grin
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: