ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/macos_util.cpp
(Generate patch)

Comparing SheepShaver/src/macos_util.cpp (file contents):
Revision 1.2 by gbeauche, 2003-09-29T20:30:19Z vs.
Revision 1.3 by gbeauche, 2003-09-29T22:47:39Z

# Line 182 | Line 182 | void *FindLibSymbol(char *lib, char *sym
182                  r.a[2] = (uint32)&main_addr;
183                  r.a[3] = (uint32)err;
184                  Execute68k((uint32)proc1, &r);
185 <                D(bug(" GetSharedLibrary: ret %d, connection ID %ld, main %p\n", (int16)r.d[0], conn_id, main_addr));
185 >                D(bug(" GetSharedLibrary: ret %d, connection ID %ld, main %p\n", (int16)r.d[0], ntohl(conn_id), ntohl((uintptr)main_addr)));
186                  if (r.d[0])
187                          return NULL;
188          
# Line 198 | Line 198 | void *FindLibSymbol(char *lib, char *sym
198                          0x30, 0x1f,                                     // move.w       (a7)+,d0
199                          M68K_RTS >> 8, M68K_RTS & 0xff
200                  };
201 <                r.d[0] = conn_id;
201 >                r.d[0] = ntohl(conn_id);
202                  r.a[0] = (uint32)sym;
203                  r.a[1] = (uint32)&sym_addr;
204                  r.a[2] = (uint32)&sym_class;
205                  Execute68k((uint32)proc2, &r);
206 <                D(bug(" FindSymbol: ret %d, sym_addr %p, sym_class %ld\n", (int16)r.d[0], sym_addr, sym_class));
206 >                D(bug(" FindSymbol1: ret %d, sym_addr %p, sym_class %ld\n", (int16)r.d[0], ntohl((uintptr)sym_addr), ntohl(sym_class)));
207   //!! CloseConnection()?
208                  if (r.d[0])
209                          return NULL;
210                  else
211 <                        return sym_addr;
211 >                        return (void *)ntohl((uintptr)sym_addr);
212  
213          } else {
214  
# Line 218 | Line 218 | void *FindLibSymbol(char *lib, char *sym
218                  }
219                  int16 res;
220                  res = GetSharedLibrary(lib, FOURCC('p','w','p','c'), 1, &conn_id, &main_addr, err);
221 <                D(bug(" GetSharedLibrary: ret %d, connection ID %ld, main %p\n", res, conn_id, main_addr));
221 >                D(bug(" GetSharedLibrary: ret %d, connection ID %ld, main %p\n", res, ntohl(conn_id), ntohl((uintptr)main_addr)));
222                  if (res)
223                          return NULL;
224 <                res = FindSymbol(conn_id, sym, (void **)&sym_addr, &sym_class);
225 <                D(bug(" FindSymbol: ret %d, sym_addr %p, sym_class %ld\n", res, sym_addr, sym_class));
224 >                res = FindSymbol(ntohl(conn_id), sym, (void **)&sym_addr, &sym_class);
225 >                D(bug(" FindSymbol: ret %d, sym_addr %p, sym_class %ld\n", res, ntohl((uintptr)sym_addr), ntohl(sym_class)));
226   //!!??          CloseConnection(&conn_id);
227                  if (res)
228                          return NULL;
229                  else
230 <                        return sym_addr;
230 >                        return (void *)ntohl((uintptr)sym_addr);
231          }
232   }
233  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines