It's not obvious to me... looks like it should work. Did you verify that the memory at tbuf.bufPtr has the right values before the copyOut? There may be something subtle in the way operator[] is overloaded on TypedBufferArg.

Jeff wrote:
Hi,

I'm trying to implement the pipe system call in ALPHA_SE mode, by just calling 
pipe natively and writing the file descriptors into the array passed in by 
address.

this is the code snippet showing how i'm doing it.  for some reason, the values 
in memory aren't being updated correctly and the pipe-caller sees the wrong 
values in the file descriptor array.  is there something obvious that i'm 
missing here?

thanks, i really appreciate help with this... i've been stuck on it for the 
past couple days and am getting nowhere.

/// Target pipe() function.
template <class OS>
SyscallReturn
pipeFunc(SyscallDesc *desc, int callnum, Process *process,
         ExecContext *xc)
{
  TypedBufferArg<int> tbuf(xc->getSyscallArg(0), 8);

  int fds[2];
  int pipe_retval = pipe(fds);

  tbuf[0] = process->open_fd(fds[0]);
  tbuf[1] = process->open_fd(fds[1]);

  tbuf.copyOut(xc->mem);

  return pipe_retval;
}




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
m5sim-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/m5sim-users


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
m5sim-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/m5sim-users

Reply via email to