syscall_emul.hh (9202:5c8e92f3d6f7) syscall_emul.hh (9238:9fa13250abd8)
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;

--- 345 unchanged lines hidden (view full) ---

354 uint64_t timeout = process->getSyscallArg(tc, index_timeout);
355
356 std::map<uint64_t, std::list<ThreadContext *> * >
357 &futex_map = tc->getSystemPtr()->futexMap;
358
359 DPRINTF(SyscallVerbose, "In sys_futex: Address=%llx, op=%d, val=%d\n",
360 uaddr, op, val);
361
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;

--- 345 unchanged lines hidden (view full) ---

354 uint64_t timeout = process->getSyscallArg(tc, index_timeout);
355
356 std::map<uint64_t, std::list<ThreadContext *> * >
357 &futex_map = tc->getSystemPtr()->futexMap;
358
359 DPRINTF(SyscallVerbose, "In sys_futex: Address=%llx, op=%d, val=%d\n",
360 uaddr, op, val);
361
362 op &= ~OS::TGT_FUTEX_PRIVATE_FLAG;
362
363 if (op == OS::TGT_FUTEX_WAIT) {
364 if (timeout != 0) {
365 warn("sys_futex: FUTEX_WAIT with non-null timeout unimplemented;"
366 "we'll wait indefinitely");
367 }
368
369 uint8_t *buf = new uint8_t[sizeof(int)];

--- 35 unchanged lines hidden (view full) ---

405 futex_map.erase(uaddr);
406 delete tcWaitList;
407 }
408 }
409 DPRINTF(SyscallVerbose, "sys_futex: FUTEX_WAKE, activated %d waiting "
410 "thread contexts\n", wokenUp);
411 return wokenUp;
412 } else {
363
364 if (op == OS::TGT_FUTEX_WAIT) {
365 if (timeout != 0) {
366 warn("sys_futex: FUTEX_WAIT with non-null timeout unimplemented;"
367 "we'll wait indefinitely");
368 }
369
370 uint8_t *buf = new uint8_t[sizeof(int)];

--- 35 unchanged lines hidden (view full) ---

406 futex_map.erase(uaddr);
407 delete tcWaitList;
408 }
409 }
410 DPRINTF(SyscallVerbose, "sys_futex: FUTEX_WAKE, activated %d waiting "
411 "thread contexts\n", wokenUp);
412 return wokenUp;
413 } else {
413 warn("sys_futex: op %d is not implemented, just returning...");
414 warn("sys_futex: op %d is not implemented, just returning...", op);
414 return 0;
415 }
416
417}
418
419
420/// Pseudo Funcs - These functions use a different return convension,
421/// returning a second value in a register other than the normal return register

--- 926 unchanged lines hidden ---
415 return 0;
416 }
417
418}
419
420
421/// Pseudo Funcs - These functions use a different return convension,
422/// returning a second value in a register other than the normal return register

--- 926 unchanged lines hidden ---