mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
sys_fs/sys_usbd: add cpu_flag::wait
This commit is contained in:
parent
58adb6a1aa
commit
cb0431d960
3 changed files with 117 additions and 46 deletions
|
@ -526,6 +526,7 @@ lv2_file::open_result_t lv2_file::open(std::string_view vpath, s32 flags, s32 mo
|
|||
|
||||
error_code sys_fs_open(ppu_thread& ppu, vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode, vm::cptr<void> arg, u64 size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_open(path=%s, flags=%#o, fd=*0x%x, mode=%#o, arg=*0x%x, size=0x%llx)", path, flags, fd, mode, arg, size);
|
||||
|
@ -575,6 +576,7 @@ error_code sys_fs_open(ppu_thread& ppu, vm::cptr<char> path, s32 flags, vm::ptr<
|
|||
|
||||
error_code sys_fs_read(ppu_thread& ppu, u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_read(fd=%d, buf=*0x%x, nbytes=0x%llx, nread=*0x%x)", fd, buf, nbytes, nread);
|
||||
|
@ -613,6 +615,7 @@ error_code sys_fs_read(ppu_thread& ppu, u32 fd, vm::ptr<void> buf, u64 nbytes, v
|
|||
|
||||
error_code sys_fs_write(ppu_thread& ppu, u32 fd, vm::cptr<void> buf, u64 nbytes, vm::ptr<u64> nwrite)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_write(fd=%d, buf=*0x%x, nbytes=0x%llx, nwrite=*0x%x)", fd, buf, nbytes, nwrite);
|
||||
|
@ -668,6 +671,7 @@ error_code sys_fs_write(ppu_thread& ppu, u32 fd, vm::cptr<void> buf, u64 nbytes,
|
|||
|
||||
error_code sys_fs_close(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_close(fd=%d)", fd);
|
||||
|
@ -695,6 +699,7 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd)
|
|||
|
||||
error_code sys_fs_opendir(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u32> fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_opendir(path=%s, fd=*0x%x)", path, fd);
|
||||
|
@ -812,6 +817,7 @@ error_code sys_fs_opendir(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u32> fd)
|
|||
|
||||
error_code sys_fs_readdir(ppu_thread& ppu, u32 fd, vm::ptr<CellFsDirent> dir, vm::ptr<u64> nread)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_readdir(fd=%d, dir=*0x%x, nread=*0x%x)", fd, dir, nread);
|
||||
|
@ -840,6 +846,7 @@ error_code sys_fs_readdir(ppu_thread& ppu, u32 fd, vm::ptr<CellFsDirent> dir, vm
|
|||
|
||||
error_code sys_fs_closedir(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_closedir(fd=%d)", fd);
|
||||
|
@ -854,6 +861,7 @@ error_code sys_fs_closedir(ppu_thread& ppu, u32 fd)
|
|||
|
||||
error_code sys_fs_stat(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<CellFsStat> sb)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_stat(path=%s, sb=*0x%x)", path, sb);
|
||||
|
@ -950,6 +958,7 @@ error_code sys_fs_stat(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<CellFsStat>
|
|||
|
||||
error_code sys_fs_fstat(ppu_thread& ppu, u32 fd, vm::ptr<CellFsStat> sb)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_fstat(fd=%d, sb=*0x%x)", fd, sb);
|
||||
|
@ -997,6 +1006,7 @@ error_code sys_fs_link(ppu_thread& ppu, vm::cptr<char> from, vm::cptr<char> to)
|
|||
|
||||
error_code sys_fs_mkdir(ppu_thread& ppu, vm::cptr<char> path, s32 mode)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_mkdir(path=%s, mode=%#o)", path, mode);
|
||||
|
@ -1047,6 +1057,7 @@ error_code sys_fs_mkdir(ppu_thread& ppu, vm::cptr<char> path, s32 mode)
|
|||
|
||||
error_code sys_fs_rename(ppu_thread& ppu, vm::cptr<char> from, vm::cptr<char> to)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_rename(from=%s, to=%s)", from, to);
|
||||
|
@ -1101,6 +1112,7 @@ error_code sys_fs_rename(ppu_thread& ppu, vm::cptr<char> from, vm::cptr<char> to
|
|||
|
||||
error_code sys_fs_rmdir(ppu_thread& ppu, vm::cptr<char> path)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_rmdir(path=%s)", path);
|
||||
|
@ -1151,6 +1163,7 @@ error_code sys_fs_rmdir(ppu_thread& ppu, vm::cptr<char> path)
|
|||
|
||||
error_code sys_fs_unlink(ppu_thread& ppu, vm::cptr<char> path)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_unlink(path=%s)", path);
|
||||
|
@ -1213,6 +1226,8 @@ error_code sys_fs_access(ppu_thread& ppu, vm::cptr<char> path, s32 mode)
|
|||
|
||||
error_code sys_fs_fcntl(ppu_thread& ppu, u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_fs.trace("sys_fs_fcntl(fd=%d, op=0x%x, arg=*0x%x, size=0x%x)", fd, op, _arg, _size);
|
||||
|
||||
switch (op)
|
||||
|
@ -1633,6 +1648,7 @@ error_code sys_fs_fcntl(ppu_thread& ppu, u32 fd, u32 op, vm::ptr<void> _arg, u32
|
|||
|
||||
error_code sys_fs_lseek(ppu_thread& ppu, u32 fd, s64 offset, s32 whence, vm::ptr<u64> pos)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_lseek(fd=%d, offset=0x%llx, whence=0x%x, pos=*0x%x)", fd, offset, whence, pos);
|
||||
|
@ -1670,6 +1686,7 @@ error_code sys_fs_lseek(ppu_thread& ppu, u32 fd, s64 offset, s32 whence, vm::ptr
|
|||
|
||||
error_code sys_fs_fdatasync(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_fdadasync(fd=%d)", fd);
|
||||
|
@ -1688,6 +1705,7 @@ error_code sys_fs_fdatasync(ppu_thread& ppu, u32 fd)
|
|||
|
||||
error_code sys_fs_fsync(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_fsync(fd=%d)", fd);
|
||||
|
@ -1772,6 +1790,7 @@ error_code sys_fs_get_block_size(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u
|
|||
|
||||
error_code sys_fs_truncate(ppu_thread& ppu, vm::cptr<char> path, u64 size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_truncate(path=%s, size=0x%llx)", path, size);
|
||||
|
@ -1820,6 +1839,7 @@ error_code sys_fs_truncate(ppu_thread& ppu, vm::cptr<char> path, u64 size)
|
|||
|
||||
error_code sys_fs_ftruncate(ppu_thread& ppu, u32 fd, u64 size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_ftruncate(fd=%d, size=0x%llx)", fd, size);
|
||||
|
@ -1885,6 +1905,7 @@ error_code sys_fs_chown(ppu_thread& ppu, vm::cptr<char> path, s32 uid, s32 gid)
|
|||
|
||||
error_code sys_fs_disk_free(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u64> total_free, vm::ptr<u64> avail_free)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_disk_free(path=%s total_free=*0x%x avail_free=*0x%x)", path, total_free, avail_free);
|
||||
|
@ -1956,6 +1977,7 @@ error_code sys_fs_disk_free(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u64> t
|
|||
|
||||
error_code sys_fs_utime(ppu_thread& ppu, vm::cptr<char> path, vm::cptr<CellFsUtimbuf> timep)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_utime(path=%s, timep=*0x%x)", path, timep);
|
||||
|
|
|
@ -385,7 +385,7 @@ void usb_handler_thread::check_devices_vs_ldds()
|
|||
{
|
||||
if (dev->assigned_number)
|
||||
continue;
|
||||
|
||||
|
||||
for (const auto& ldd : ldds)
|
||||
{
|
||||
if (dev->device._device.idVendor == ldd.id_vendor && dev->device._device.idProduct >= ldd.id_product_min && dev->device._device.idProduct <= ldd.id_product_max)
|
||||
|
@ -458,8 +458,10 @@ UsbTransfer& usb_handler_thread::get_transfer(u32 transfer_id)
|
|||
return transfers[transfer_id];
|
||||
}
|
||||
|
||||
error_code sys_usbd_initialize(vm::ptr<u32> handle)
|
||||
error_code sys_usbd_initialize(ppu_thread& ppu, vm::ptr<u32> handle)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.warning("sys_usbd_initialize(handle=*0x%x)", handle);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -477,6 +479,8 @@ error_code sys_usbd_initialize(vm::ptr<u32> handle)
|
|||
|
||||
error_code sys_usbd_finalize(ppu_thread& ppu, u32 handle)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.warning("sys_usbd_finalize(handle=0x%x)", handle);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -498,8 +502,10 @@ error_code sys_usbd_finalize(ppu_thread& ppu, u32 handle)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_get_device_list(u32 handle, vm::ptr<UsbInternalDevice> device_list, u32 max_devices)
|
||||
error_code sys_usbd_get_device_list(ppu_thread& ppu, u32 handle, vm::ptr<UsbInternalDevice> device_list, u32 max_devices)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.warning("sys_usbd_get_device_list(handle=0x%x, device_list=*0x%x, max_devices=0x%x)", handle, device_list, max_devices);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -519,8 +525,10 @@ error_code sys_usbd_get_device_list(u32 handle, vm::ptr<UsbInternalDevice> devic
|
|||
return not_an_error(i_tocopy);
|
||||
}
|
||||
|
||||
error_code sys_usbd_register_extra_ldd(u32 handle, vm::ptr<char> s_product, u16 slen_product, u16 id_vendor, u16 id_product_min, u16 id_product_max)
|
||||
error_code sys_usbd_register_extra_ldd(ppu_thread& ppu, u32 handle, vm::ptr<char> s_product, u16 slen_product, u16 id_vendor, u16 id_product_min, u16 id_product_max)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.warning("sys_usbd_register_extra_ldd(handle=0x%x, s_product=%s, slen_product=0x%x, id_vendor=0x%x, id_product_min=0x%x, id_product_max=0x%x)", handle, s_product, slen_product, id_vendor,
|
||||
id_product_min, id_product_max);
|
||||
|
||||
|
@ -536,8 +544,10 @@ error_code sys_usbd_register_extra_ldd(u32 handle, vm::ptr<char> s_product, u16
|
|||
return not_an_error(res); // To check
|
||||
}
|
||||
|
||||
error_code sys_usbd_get_descriptor_size(u32 handle, u32 device_handle)
|
||||
error_code sys_usbd_get_descriptor_size(ppu_thread& ppu, u32 handle, u32 device_handle)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.trace("sys_usbd_get_descriptor_size(handle=0x%x, deviceNumber=0x%x)", handle, device_handle);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -552,8 +562,10 @@ error_code sys_usbd_get_descriptor_size(u32 handle, u32 device_handle)
|
|||
return not_an_error(usbh->handled_devices[device_handle].second->device.get_size());
|
||||
}
|
||||
|
||||
error_code sys_usbd_get_descriptor(u32 handle, u32 device_handle, vm::ptr<void> descriptor, u32 desc_size)
|
||||
error_code sys_usbd_get_descriptor(ppu_thread& ppu, u32 handle, u32 device_handle, vm::ptr<void> descriptor, u32 desc_size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.trace("sys_usbd_get_descriptor(handle=0x%x, deviceNumber=0x%x, descriptor=0x%x, desc_size=0x%x)", handle, device_handle, descriptor, desc_size);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -572,8 +584,10 @@ error_code sys_usbd_get_descriptor(u32 handle, u32 device_handle, vm::ptr<void>
|
|||
}
|
||||
|
||||
// This function is used for psp(cellUsbPspcm), dongles in ps3 arcade cabinets(PS3A-USJ), ps2 cam(eyetoy), generic usb camera?(sample_usb2cam)
|
||||
error_code sys_usbd_register_ldd(u32 handle, vm::ptr<char> s_product, u16 slen_product)
|
||||
error_code sys_usbd_register_ldd(ppu_thread& ppu, u32 handle, vm::ptr<char> s_product, u16 slen_product)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
// slightly hacky way of getting Namco GCon3 gun to work.
|
||||
// The register_ldd appears to be a more promiscuous mode function, where all device 'inserts' would be presented to the cellUsbd for Probing.
|
||||
// Unsure how many more devices might need similar treatment (i.e. just a compare and force VID/PID add), or if it's worth adding a full promiscuous
|
||||
|
@ -581,7 +595,7 @@ error_code sys_usbd_register_ldd(u32 handle, vm::ptr<char> s_product, u16 slen_p
|
|||
if (strcmp(s_product.get_ptr(), "guncon3") == 0)
|
||||
{
|
||||
sys_usbd.warning("sys_usbd_register_ldd(handle=0x%x, s_product=%s, slen_product=0x%x) -> Redirecting to sys_usbd_register_extra_ldd", handle, s_product, slen_product);
|
||||
sys_usbd_register_extra_ldd(handle, s_product, slen_product, 0x0B9A, 0x0800, 0x0800);
|
||||
sys_usbd_register_extra_ldd(ppu, handle, s_product, slen_product, 0x0B9A, 0x0800, 0x0800);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -590,15 +604,17 @@ error_code sys_usbd_register_ldd(u32 handle, vm::ptr<char> s_product, u16 slen_p
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_unregister_ldd()
|
||||
error_code sys_usbd_unregister_ldd(ppu_thread& ppu)
|
||||
{
|
||||
sys_usbd.todo("sys_usbd_unregister_ldd()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
// TODO: determine what the unknown params are
|
||||
error_code sys_usbd_open_pipe(u32 handle, u32 device_handle, u32 unk1, u64 unk2, u64 unk3, u32 endpoint, u64 unk4)
|
||||
error_code sys_usbd_open_pipe(ppu_thread& ppu, u32 handle, u32 device_handle, u32 unk1, u64 unk2, u64 unk3, u32 endpoint, u64 unk4)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.warning("sys_usbd_open_pipe(handle=0x%x, device_handle=0x%x, unk1=0x%x, unk2=0x%x, unk3=0x%x, endpoint=0x%x, unk4=0x%x)", handle, device_handle, unk1, unk2, unk3, endpoint, unk4);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -613,8 +629,10 @@ error_code sys_usbd_open_pipe(u32 handle, u32 device_handle, u32 unk1, u64 unk2,
|
|||
return not_an_error(usbh->open_pipe(device_handle, static_cast<u8>(endpoint)));
|
||||
}
|
||||
|
||||
error_code sys_usbd_open_default_pipe(u32 handle, u32 device_handle)
|
||||
error_code sys_usbd_open_default_pipe(ppu_thread& ppu, u32 handle, u32 device_handle)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.trace("sys_usbd_open_default_pipe(handle=0x%x, device_handle=0x%x)", handle, device_handle);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -629,8 +647,10 @@ error_code sys_usbd_open_default_pipe(u32 handle, u32 device_handle)
|
|||
return not_an_error(usbh->open_pipe(device_handle, 0));
|
||||
}
|
||||
|
||||
error_code sys_usbd_close_pipe(u32 handle, u32 pipe_handle)
|
||||
error_code sys_usbd_close_pipe(ppu_thread& ppu, u32 handle, u32 pipe_handle)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_close_pipe(handle=0x%x, pipe_handle=0x%x)", handle, pipe_handle);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -655,6 +675,8 @@ error_code sys_usbd_close_pipe(u32 handle, u32 pipe_handle)
|
|||
// *arg1 == 1 || *arg1 == 2 will send a sys_event to internal CellUsbd event queue with same parameters as received and loop(attach and detach event)
|
||||
error_code sys_usbd_receive_event(ppu_thread& ppu, u32 handle, vm::ptr<u64> arg1, vm::ptr<u64> arg2, vm::ptr<u64> arg3)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.trace("sys_usbd_receive_event(handle=%u, arg1=*0x%x, arg2=*0x%x, arg3=*0x%x)", handle, arg1, arg2, arg3);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -699,21 +721,28 @@ error_code sys_usbd_receive_event(ppu_thread& ppu, u32 handle, vm::ptr<u64> arg1
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_detect_event()
|
||||
error_code sys_usbd_detect_event(ppu_thread& ppu)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_detect_event()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_attach(u32 handle)
|
||||
error_code sys_usbd_attach(ppu_thread& ppu, u32 handle)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_attach(handle=0x%x)", handle);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_transfer_data(u32 handle, u32 id_pipe, vm::ptr<u8> buf, u32 buf_size, vm::ptr<UsbDeviceRequest> request, u32 type_transfer)
|
||||
error_code sys_usbd_transfer_data(ppu_thread& ppu, u32 handle, u32 id_pipe, vm::ptr<u8> buf, u32 buf_size, vm::ptr<UsbDeviceRequest> request, u32 type_transfer)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.trace("sys_usbd_transfer_data(handle=0x%x, id_pipe=0x%x, buf=*0x%x, buf_length=0x%x, request=*0x%x, type=0x%x)", handle, id_pipe, buf, buf_size, request, type_transfer);
|
||||
|
||||
if (sys_usbd.enabled == logs::level::trace && request)
|
||||
{
|
||||
sys_usbd.trace("RequestType:0x%x, Request:0x%x, wValue:0x%x, wIndex:0x%x, wLength:0x%x", request->bmRequestType, request->bRequest, request->wValue, request->wIndex, request->wLength);
|
||||
|
@ -778,8 +807,10 @@ error_code sys_usbd_transfer_data(u32 handle, u32 id_pipe, vm::ptr<u8> buf, u32
|
|||
return not_an_error(id_transfer);
|
||||
}
|
||||
|
||||
error_code sys_usbd_isochronous_transfer_data(u32 handle, u32 id_pipe, vm::ptr<UsbDeviceIsoRequest> iso_request)
|
||||
error_code sys_usbd_isochronous_transfer_data(ppu_thread& ppu, u32 handle, u32 id_pipe, vm::ptr<UsbDeviceIsoRequest> iso_request)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_isochronous_transfer_data(handle=0x%x, id_pipe=0x%x, iso_request=*0x%x)", handle, id_pipe, iso_request);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -802,8 +833,10 @@ error_code sys_usbd_isochronous_transfer_data(u32 handle, u32 id_pipe, vm::ptr<U
|
|||
return not_an_error(id_transfer);
|
||||
}
|
||||
|
||||
error_code sys_usbd_get_transfer_status(u32 handle, u32 id_transfer, u32 unk1, vm::ptr<u32> result, vm::ptr<u32> count)
|
||||
error_code sys_usbd_get_transfer_status(ppu_thread& ppu, u32 handle, u32 id_transfer, u32 unk1, vm::ptr<u32> result, vm::ptr<u32> count)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.trace("sys_usbd_get_transfer_status(handle=0x%x, id_transfer=0x%x, unk1=0x%x, result=*0x%x, count=*0x%x)", handle, id_transfer, unk1, result, count);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -821,8 +854,10 @@ error_code sys_usbd_get_transfer_status(u32 handle, u32 id_transfer, u32 unk1, v
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_get_isochronous_transfer_status(u32 handle, u32 id_transfer, u32 unk1, vm::ptr<UsbDeviceIsoRequest> request, vm::ptr<u32> result)
|
||||
error_code sys_usbd_get_isochronous_transfer_status(ppu_thread& ppu, u32 handle, u32 id_transfer, u32 unk1, vm::ptr<UsbDeviceIsoRequest> request, vm::ptr<u32> result)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_get_isochronous_transfer_status(handle=0x%x, id_transfer=0x%x, unk1=0x%x, request=*0x%x, result=*0x%x)", handle, id_transfer, unk1, request, result);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -840,20 +875,26 @@ error_code sys_usbd_get_isochronous_transfer_status(u32 handle, u32 id_transfer,
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_get_device_location()
|
||||
error_code sys_usbd_get_device_location(ppu_thread& ppu)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_get_device_location()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_send_event()
|
||||
error_code sys_usbd_send_event(ppu_thread& ppu)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_send_event()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_event_port_send(u32 handle, u64 arg1, u64 arg2, u64 arg3)
|
||||
error_code sys_usbd_event_port_send(ppu_thread& ppu, u32 handle, u64 arg1, u64 arg2, u64 arg3)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.warning("sys_usbd_event_port_send(handle=0x%x, arg1=0x%x, arg2=0x%x, arg3=0x%x)", handle, arg1, arg2, arg3);
|
||||
|
||||
const auto usbh = g_fxo->get<named_thread<usb_handler_thread>>();
|
||||
|
@ -868,20 +909,26 @@ error_code sys_usbd_event_port_send(u32 handle, u64 arg1, u64 arg2, u64 arg3)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_allocate_memory()
|
||||
error_code sys_usbd_allocate_memory(ppu_thread& ppu)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_allocate_memory()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_free_memory()
|
||||
error_code sys_usbd_free_memory(ppu_thread& ppu)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_free_memory()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_usbd_get_device_speed()
|
||||
error_code sys_usbd_get_device_speed(ppu_thread& ppu)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_usbd.todo("sys_usbd_get_device_speed()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "Emu/Memory/vm_ptr.h"
|
||||
|
||||
class ppu_thread;
|
||||
|
||||
#define MAX_SYS_USBD_TRANSFERS 0x44
|
||||
|
||||
// PS3 internal codes
|
||||
|
@ -58,27 +60,27 @@ struct UsbDeviceIsoRequest
|
|||
be_t<u16> packets[8];
|
||||
};
|
||||
|
||||
error_code sys_usbd_initialize(vm::ptr<u32> handle);
|
||||
error_code sys_usbd_initialize(ppu_thread& ppu, vm::ptr<u32> handle);
|
||||
error_code sys_usbd_finalize(ppu_thread& ppu, u32 handle);
|
||||
error_code sys_usbd_get_device_list(u32 handle, vm::ptr<UsbInternalDevice> device_list, u32 max_devices);
|
||||
error_code sys_usbd_get_descriptor_size(u32 handle, u32 device_handle);
|
||||
error_code sys_usbd_get_descriptor(u32 handle, u32 device_handle, vm::ptr<void> descriptor, u32 desc_size);
|
||||
error_code sys_usbd_register_ldd(u32 handle, vm::ptr<char> s_product, u16 slen_product);
|
||||
error_code sys_usbd_unregister_ldd();
|
||||
error_code sys_usbd_open_pipe(u32 handle, u32 device_handle, u32 unk1, u64 unk2, u64 unk3, u32 endpoint, u64 unk4);
|
||||
error_code sys_usbd_open_default_pipe(u32 handle, u32 device_handle);
|
||||
error_code sys_usbd_close_pipe(u32 handle, u32 pipe_handle);
|
||||
error_code sys_usbd_get_device_list(ppu_thread& ppu, u32 handle, vm::ptr<UsbInternalDevice> device_list, u32 max_devices);
|
||||
error_code sys_usbd_get_descriptor_size(ppu_thread& ppu, u32 handle, u32 device_handle);
|
||||
error_code sys_usbd_get_descriptor(ppu_thread& ppu, u32 handle, u32 device_handle, vm::ptr<void> descriptor, u32 desc_size);
|
||||
error_code sys_usbd_register_ldd(ppu_thread& ppu, u32 handle, vm::ptr<char> s_product, u16 slen_product);
|
||||
error_code sys_usbd_unregister_ldd(ppu_thread& ppu);
|
||||
error_code sys_usbd_open_pipe(ppu_thread& ppu, u32 handle, u32 device_handle, u32 unk1, u64 unk2, u64 unk3, u32 endpoint, u64 unk4);
|
||||
error_code sys_usbd_open_default_pipe(ppu_thread& ppu, u32 handle, u32 device_handle);
|
||||
error_code sys_usbd_close_pipe(ppu_thread& ppu, u32 handle, u32 pipe_handle);
|
||||
error_code sys_usbd_receive_event(ppu_thread& ppu, u32 handle, vm::ptr<u64> arg1, vm::ptr<u64> arg2, vm::ptr<u64> arg3);
|
||||
error_code sys_usbd_detect_event();
|
||||
error_code sys_usbd_attach(u32 handle);
|
||||
error_code sys_usbd_transfer_data(u32 handle, u32 id_pipe, vm::ptr<u8> buf, u32 buf_size, vm::ptr<UsbDeviceRequest> request, u32 type_transfer);
|
||||
error_code sys_usbd_isochronous_transfer_data(u32 handle, u32 id_pipe, vm::ptr<UsbDeviceIsoRequest> iso_request);
|
||||
error_code sys_usbd_get_transfer_status(u32 handle, u32 id_transfer, u32 unk1, vm::ptr<u32> result, vm::ptr<u32> count);
|
||||
error_code sys_usbd_get_isochronous_transfer_status(u32 handle, u32 id_transfer, u32 unk1, vm::ptr<UsbDeviceIsoRequest> request, vm::ptr<u32> result);
|
||||
error_code sys_usbd_get_device_location();
|
||||
error_code sys_usbd_send_event();
|
||||
error_code sys_usbd_event_port_send(u32 handle, u64 arg1, u64 arg2, u64 arg3);
|
||||
error_code sys_usbd_allocate_memory();
|
||||
error_code sys_usbd_free_memory();
|
||||
error_code sys_usbd_get_device_speed();
|
||||
error_code sys_usbd_register_extra_ldd(u32 handle, vm::ptr<char> s_product, u16 slen_product, u16 id_vendor, u16 id_product_min, u16 id_product_max);
|
||||
error_code sys_usbd_detect_event(ppu_thread& ppu);
|
||||
error_code sys_usbd_attach(ppu_thread& ppu, u32 handle);
|
||||
error_code sys_usbd_transfer_data(ppu_thread& ppu, u32 handle, u32 id_pipe, vm::ptr<u8> buf, u32 buf_size, vm::ptr<UsbDeviceRequest> request, u32 type_transfer);
|
||||
error_code sys_usbd_isochronous_transfer_data(ppu_thread& ppu, u32 handle, u32 id_pipe, vm::ptr<UsbDeviceIsoRequest> iso_request);
|
||||
error_code sys_usbd_get_transfer_status(ppu_thread& ppu, u32 handle, u32 id_transfer, u32 unk1, vm::ptr<u32> result, vm::ptr<u32> count);
|
||||
error_code sys_usbd_get_isochronous_transfer_status(ppu_thread& ppu, u32 handle, u32 id_transfer, u32 unk1, vm::ptr<UsbDeviceIsoRequest> request, vm::ptr<u32> result);
|
||||
error_code sys_usbd_get_device_location(ppu_thread& ppu);
|
||||
error_code sys_usbd_send_event(ppu_thread& ppu);
|
||||
error_code sys_usbd_event_port_send(ppu_thread& ppu, u32 handle, u64 arg1, u64 arg2, u64 arg3);
|
||||
error_code sys_usbd_allocate_memory(ppu_thread& ppu);
|
||||
error_code sys_usbd_free_memory(ppu_thread& ppu);
|
||||
error_code sys_usbd_get_device_speed(ppu_thread& ppu);
|
||||
error_code sys_usbd_register_extra_ldd(ppu_thread& ppu, u32 handle, vm::ptr<char> s_product, u16 slen_product, u16 id_vendor, u16 id_product_min, u16 id_product_max);
|
||||
|
|
Loading…
Add table
Reference in a new issue