syscall_emul.cc (7680:f4eda002333b) | syscall_emul.cc (7720:65d338a8dba4) |
---|---|
1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 810 unchanged lines hidden (view full) --- 819 820 // In SPARC/Linux, clone returns 0 on pseudo-return register if 821 // parent, non-zero if child 822 #if THE_ISA == SPARC_ISA 823 tc->setIntReg(TheISA::SyscallPseudoReturnReg, 0); 824 ctc->setIntReg(TheISA::SyscallPseudoReturnReg, 1); 825 #endif 826 | 1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 810 unchanged lines hidden (view full) --- 819 820 // In SPARC/Linux, clone returns 0 on pseudo-return register if 821 // parent, non-zero if child 822 #if THE_ISA == SPARC_ISA 823 tc->setIntReg(TheISA::SyscallPseudoReturnReg, 0); 824 ctc->setIntReg(TheISA::SyscallPseudoReturnReg, 1); 825 #endif 826 |
827 ctc->setPC(tc->readNextPC()); 828 ctc->setNextPC(tc->readNextPC() + sizeof(TheISA::MachInst)); 829 ctc->setNextNPC(tc->readNextNPC() + sizeof(TheISA::MachInst)); | 827 ctc->pcState(tc->nextInstAddr()); |
830 831 ctc->activate(); 832 833 // Should return nonzero child TID in parent's syscall return register, 834 // but for our pthread library any non-zero value will work 835 return 1; 836 } else { 837 fatal("Called sys_clone, but no unallocated thread contexts found!\n"); 838 return 0; 839 } 840} 841 | 828 829 ctc->activate(); 830 831 // Should return nonzero child TID in parent's syscall return register, 832 // but for our pthread library any non-zero value will work 833 return 1; 834 } else { 835 fatal("Called sys_clone, but no unallocated thread contexts found!\n"); 836 return 0; 837 } 838} 839 |