syscall_emul.hh (5958:2d9737bf3c2f) | syscall_emul.hh (6109:083d8a76b7a6) |
---|---|
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; --- 169 unchanged lines hidden (view full) --- 178 179/// Handler for unimplemented syscalls that we never intend to 180/// implement (signal handling, etc.) and should not affect the correct 181/// behavior of the program. Print a warning only if the appropriate 182/// trace flag is enabled. Return success to the target program. 183SyscallReturn ignoreFunc(SyscallDesc *desc, int num, 184 LiveProcess *p, ThreadContext *tc); 185 | 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; --- 169 unchanged lines hidden (view full) --- 178 179/// Handler for unimplemented syscalls that we never intend to 180/// implement (signal handling, etc.) and should not affect the correct 181/// behavior of the program. Print a warning only if the appropriate 182/// trace flag is enabled. Return success to the target program. 183SyscallReturn ignoreFunc(SyscallDesc *desc, int num, 184 LiveProcess *p, ThreadContext *tc); 185 |
186/// Target exit() handler: terminate simulation. | 186/// Target exit() handler: terminate current context. |
187SyscallReturn exitFunc(SyscallDesc *desc, int num, 188 LiveProcess *p, ThreadContext *tc); 189 | 187SyscallReturn exitFunc(SyscallDesc *desc, int num, 188 LiveProcess *p, ThreadContext *tc); 189 |
190/// Target exit_group() handler: terminate simulation. (exit all threads) 191SyscallReturn exitGroupFunc(SyscallDesc *desc, int num, 192 LiveProcess *p, ThreadContext *tc); 193 |
|
190/// Target getpagesize() handler. 191SyscallReturn getpagesizeFunc(SyscallDesc *desc, int num, 192 LiveProcess *p, ThreadContext *tc); 193 194/// Target brk() handler: set brk address. 195SyscallReturn brkFunc(SyscallDesc *desc, int num, 196 LiveProcess *p, ThreadContext *tc); 197 --- 105 unchanged lines hidden (view full) --- 303/// Target geteuid() handler. 304SyscallReturn geteuidFunc(SyscallDesc *desc, int num, 305 LiveProcess *p, ThreadContext *tc); 306 307/// Target getegid() handler. 308SyscallReturn getegidFunc(SyscallDesc *desc, int num, 309 LiveProcess *p, ThreadContext *tc); 310 | 194/// Target getpagesize() handler. 195SyscallReturn getpagesizeFunc(SyscallDesc *desc, int num, 196 LiveProcess *p, ThreadContext *tc); 197 198/// Target brk() handler: set brk address. 199SyscallReturn brkFunc(SyscallDesc *desc, int num, 200 LiveProcess *p, ThreadContext *tc); 201 --- 105 unchanged lines hidden (view full) --- 307/// Target geteuid() handler. 308SyscallReturn geteuidFunc(SyscallDesc *desc, int num, 309 LiveProcess *p, ThreadContext *tc); 310 311/// Target getegid() handler. 312SyscallReturn getegidFunc(SyscallDesc *desc, int num, 313 LiveProcess *p, ThreadContext *tc); 314 |
315/// Target clone() handler. 316SyscallReturn cloneFunc(SyscallDesc *desc, int num, 317 LiveProcess *p, ThreadContext *tc); |
|
311 312 313/// Pseudo Funcs - These functions use a different return convension, 314/// returning a second value in a register other than the normal return register 315SyscallReturn pipePseudoFunc(SyscallDesc *desc, int num, 316 LiveProcess *process, ThreadContext *tc); 317 318/// Target getpidPseudo() handler. --- 689 unchanged lines hidden (view full) --- 1008SyscallReturn 1009gettimeofdayFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 1010 ThreadContext *tc) 1011{ 1012 TypedBufferArg<typename OS::timeval> tp(process->getSyscallArg(tc, 0)); 1013 1014 getElapsedTime(tp->tv_sec, tp->tv_usec); 1015 tp->tv_sec += seconds_since_epoch; | 318 319 320/// Pseudo Funcs - These functions use a different return convension, 321/// returning a second value in a register other than the normal return register 322SyscallReturn pipePseudoFunc(SyscallDesc *desc, int num, 323 LiveProcess *process, ThreadContext *tc); 324 325/// Target getpidPseudo() handler. --- 689 unchanged lines hidden (view full) --- 1015SyscallReturn 1016gettimeofdayFunc(SyscallDesc *desc, int callnum, LiveProcess *process, 1017 ThreadContext *tc) 1018{ 1019 TypedBufferArg<typename OS::timeval> tp(process->getSyscallArg(tc, 0)); 1020 1021 getElapsedTime(tp->tv_sec, tp->tv_usec); 1022 tp->tv_sec += seconds_since_epoch; |
1016 tp->tv_sec = htog(tp->tv_sec); 1017 tp->tv_usec = htog(tp->tv_usec); | 1023 tp->tv_sec = TheISA::htog(tp->tv_sec); 1024 tp->tv_usec = TheISA::htog(tp->tv_usec); |
1018 1019 tp.copyOut(tc->getMemPort()); 1020 1021 return 0; 1022} 1023 1024 1025/// Target utimes() handler. --- 85 unchanged lines hidden --- | 1025 1026 tp.copyOut(tc->getMemPort()); 1027 1028 return 0; 1029} 1030 1031 1032/// Target utimes() handler. --- 85 unchanged lines hidden --- |