Yeah, i'm pretty sure the values are correct, i even created another TypedBufferArg right after i do the copyOut and do a copyIn at the same address to verify that the values are correct. It's really strange, because in my test code, i am immediately printing the values of the file descriptors returned from this emulated system call, which i even verified with the second TypedBufferArg.
the values i see are 0 and -1, and i also set the file pointers in my test code to something else before the pipe call, so i know that the values are being changed. but not correctly. -----Original Message----- >From: Steve Reinhardt <[EMAIL PROTECTED]> >Sent: Feb 22, 2006 10:41 PM >To: Jeff <[EMAIL PROTECTED]> >Cc: m5 <[email protected]> >Subject: Re: [m5sim-users] implementing syscall, memory consistency > > >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
