| View previous topic :: View next topic |
| Author |
Message |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Feb 16, 2009 4:08 am Post subject: USBGDB Patch for Slim Memory |
|
|
I can't be arsed to find my password these days and don't even have a toolchain installed on this machine so someone else can commit this fix for psplinkusb/usbgdb/main.c which dynamically modifies its memory ranges if you are on a slim with large memory support.
| Code: | --- main.c (revision 2452)
+++ main.c (working copy)
@@ -34,12 +34,15 @@
DebugEventHandler g_handler;
struct GdbContext g_context;
SceUID g_thid = -1;
+unsigned int userbase = 0x08800000;
+unsigned int usertop = 0x0A000000;
int initialise(SceSize args, void *argp)
{
int len;
int fd;
Elf32_Ehdr hdr;
+ PspSysmemPartitionInfo info;
memset(&g_context, 0, sizeof(g_context));
if(argp == NULL)
@@ -58,6 +61,14 @@
g_context.argp = argp;
g_context.args = args;
+ memset(&info, 0, sizeof(info));
+ info.size = sizeof(info);
+ if(sceKernelQueryMemoryPartitionInfo(2, &info) == 0)
+ {
+ userbase = info.startaddr;
+ usertop = info.startaddr + info.memsize;
+ }
+
fd = sceIoOpen((char*) argp, PSP_O_RDONLY, 0777);
if(fd < 0)
{
@@ -125,7 +136,7 @@
nibble = addr >> 28;
addr &= 0x0FFFFFFF;
- if((addr >= 0x08800000) && (addr < 0x0A000000))
+ if((addr >= userbase) && (addr < usertop))
{
if((nibble == 0) || (nibble == 4) || (nibble == 8) || (nibble == 10))
{
@@ -160,7 +171,7 @@
nibble = addr >> 28;
addr &= 0x0FFFFFFF;
- if((addr >= 0x08800000) && (addr < 0x0A000000))
+ if((addr >= userbase) && (addr < usertop))
{
if((nibble == 0) || (nibble == 4) || (nibble == 8) || (nibble == 10))
{
|
|
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Thu Feb 26, 2009 4:33 pm Post subject: |
|
|
| Code: | Sending usbgdb/main.c
Transmitting file data .
Committed revision 2453. |
although I had to patch by hand, so no promises! |
|
| Back to top |
|
 |
hnaves
Joined: 03 Feb 2009 Posts: 30
|
Posted: Sat Feb 28, 2009 6:10 am Post subject: |
|
|
You forgot to include
| Code: | #include <pspsysmem_kernel.h>
|
|
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed Mar 04, 2009 8:01 am Post subject: |
|
|
| Fixed in rev 2455, thanks |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Wed Mar 04, 2009 3:50 pm Post subject: |
|
|
| Ooops, my bad obviously :) |
|
| Back to top |
|
 |
|