-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix for HDD size calculation, new poweroff processing mechanism, fixed PBUF allocation for Ethernet ARP request, new option for SMSTCPIP to save more RAM. #44
Conversation
… align with the official documentation; size is now in 512-byte HDD sectors).
…changed SMAPSendPacket to assume that all PBUFs are aligned. etharp_query requests PBUF_LINK from pbuf_alloc(), but does not reveal the Ethernet header. It is possible that this also writes beyond the end of the PBUF.
…before power off.
…s like the official option from newer LWIP versions.
Hi SP193, then you fixed the slight problem you mentioned before? all is ok? after this commit is needed update the PS2SDK? |
The "slight" problem that I saw, was in ps2ip_mem_realloc(). With its current design, it does not actually function in the same way as the standard realloc() function. Whereby it does not attempt to allocate new memory, if the specified region of memory cannot be resized. However, it seems like mem_realloc() - the function which ps2ip_mem_realloc() is used to implement, is only used by pbuf_realloc(). pbuf_realloc will only shrink the size of the allocated buffer with mem_realloc(), so I really don't think that ps2ip_mem_realloc() can possibly fail. Hence the only thing that I changed between these two commits, is to add a comment about this. There is actually no problem. :) There are no accompanying updates to the PS2SDK for this pull request. |
Thank you very much for the explanation and the work, and have a good weekend :) |
Thanks. Have a great weekend too! :D
|
Fix for HDD size calculation, new poweroff processing mechanism, fixed PBUF allocation for Ethernet ARP request, new option for SMSTCPIP to save more RAM. (ps2homebrew#44) * Corrected HDD partition size calculation (change in homebrew specs to align with the official documentation; size is now in 512-byte HDD sectors). * (ingame SMSTCPIP) Fixed pbuf allocation for Ethernet ARP request and changed SMAPSendPacket to assume that all PBUFs are aligned. etharp_query requests PBUF_LINK from pbuf_alloc(), but does not reveal the Ethernet header. It is possible that this also writes beyond the end of the PBUF. * Changed GUI power-off to deinitialize the UI and to switch off DEV9, before power off. * Added new MEM_LIBC_MALLOC option to mem.c and enabled it. It functions like the official option from newer LWIP versions.
…d PBUF allocation for Ethernet ARP request, new option for SMSTCPIP to save more RAM. (#44) * Corrected HDD partition size calculation (change in homebrew specs to align with the official documentation; size is now in 512-byte HDD sectors). * (ingame SMSTCPIP) Fixed pbuf allocation for Ethernet ARP request and changed SMAPSendPacket to assume that all PBUFs are aligned. etharp_query requests PBUF_LINK from pbuf_alloc(), but does not reveal the Ethernet header. It is possible that this also writes beyond the end of the PBUF. * Changed GUI power-off to deinitialize the UI and to switch off DEV9, before power off. * Added new MEM_LIBC_MALLOC option to mem.c and enabled it. It functions like the official option from newer LWIP versions.
…d PBUF allocation for Ethernet ARP request, new option for SMSTCPIP to save more RAM. (ps2homebrew#44) * Corrected HDD partition size calculation (change in homebrew specs to align with the official documentation; size is now in 512-byte HDD sectors). * (ingame SMSTCPIP) Fixed pbuf allocation for Ethernet ARP request and changed SMAPSendPacket to assume that all PBUFs are aligned. etharp_query requests PBUF_LINK from pbuf_alloc(), but does not reveal the Ethernet header. It is possible that this also writes beyond the end of the PBUF. * Changed GUI power-off to deinitialize the UI and to switch off DEV9, before power off. * Added new MEM_LIBC_MALLOC option to mem.c and enabled it. It functions like the official option from newer LWIP versions.
Pull Request checklist
Note: these are not necessarily requirements
Pull Request description
45e99f0 - Fixed HDD partition size calculation. Originally, our HDD.IRX module used to return the partition size in bytes. Eventually, that got changed to fit the official documentation, which returns in 512-byte sectors.
8cadeb4 - Corrected bug in PBUF allocation for Ethernet ARP requests and changed the SMAP output function to always assume that outgoing PBUFs are always aligned (for performance). Previously, the outgoing PBUFs were occasionally unaligned because of this glitch.
4a9a5a7 - As of the recent PS2SDK commit, poweroff no longer automatically switches off DEV9 as a safety measure. OPL will now deinitialize the GUI before switching off DEV9, before finally switching off the PS2.
13d1347 - Our SMSTCPIP module is based on an ancient version of LWIP, which always uses its own memory heap allocator (even though SYSMEM can fill that requirement). This patch adds and enables a new option (MEM_LIBC_MALLOC), which functions like the official version from the newer versions of LWIP.