process.cc (10810:683ab55819fd) process.cc (10905:a6ca6831e775)
1/*
2 * Copyright (c) 2014 Advanced Micro Devices, Inc.
3 * Copyright (c) 2012 ARM Limited
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

254 ThreadContext *tc = system->getThreadContext(contextIds[0]);
255
256 // mark this context as active so it will start ticking.
257 tc->activate();
258
259 pTable->initState(tc);
260}
261
1/*
2 * Copyright (c) 2014 Advanced Micro Devices, Inc.
3 * Copyright (c) 2012 ARM Limited
4 * All rights reserved
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

254 ThreadContext *tc = system->getThreadContext(contextIds[0]);
255
256 // mark this context as active so it will start ticking.
257 tc->activate();
258
259 pTable->initState(tc);
260}
261
262unsigned int
263Process::drain(DrainManager *dm)
264{
265 find_file_offsets();
266 return 0;
267}
268
262// map simulator fd sim_fd to target fd tgt_fd
263void
264Process::dup_fd(int sim_fd, int tgt_fd)
265{
266 if (tgt_fd < 0 || tgt_fd > MAX_FD)
267 panic("Process::dup_fd tried to dup past MAX_FD (%d)", tgt_fd);
268
269 Process::FdMap *fdo = &fd_map[tgt_fd];

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

483void
484Process::setReadPipeSource(int read_pipe_fd, int source_fd)
485{
486 Process::FdMap *fdo = &fd_map[read_pipe_fd];
487 fdo->readPipeSource = source_fd;
488}
489
490void
269// map simulator fd sim_fd to target fd tgt_fd
270void
271Process::dup_fd(int sim_fd, int tgt_fd)
272{
273 if (tgt_fd < 0 || tgt_fd > MAX_FD)
274 panic("Process::dup_fd tried to dup past MAX_FD (%d)", tgt_fd);
275
276 Process::FdMap *fdo = &fd_map[tgt_fd];

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

490void
491Process::setReadPipeSource(int read_pipe_fd, int source_fd)
492{
493 Process::FdMap *fdo = &fd_map[read_pipe_fd];
494 fdo->readPipeSource = source_fd;
495}
496
497void
491Process::FdMap::serialize(std::ostream &os)
498Process::FdMap::serialize(CheckpointOut &cp) const
492{
493 SERIALIZE_SCALAR(fd);
494 SERIALIZE_SCALAR(isPipe);
495 SERIALIZE_SCALAR(filename);
496 SERIALIZE_SCALAR(flags);
497 SERIALIZE_SCALAR(readPipeSource);
498 SERIALIZE_SCALAR(fileOffset);
499}
500
501void
499{
500 SERIALIZE_SCALAR(fd);
501 SERIALIZE_SCALAR(isPipe);
502 SERIALIZE_SCALAR(filename);
503 SERIALIZE_SCALAR(flags);
504 SERIALIZE_SCALAR(readPipeSource);
505 SERIALIZE_SCALAR(fileOffset);
506}
507
508void
502Process::FdMap::unserialize(Checkpoint *cp, const std::string &section)
509Process::FdMap::unserialize(CheckpointIn &cp)
503{
504 UNSERIALIZE_SCALAR(fd);
505 UNSERIALIZE_SCALAR(isPipe);
506 UNSERIALIZE_SCALAR(filename);
507 UNSERIALIZE_SCALAR(flags);
508 UNSERIALIZE_SCALAR(readPipeSource);
509 UNSERIALIZE_SCALAR(fileOffset);
510}
511
512void
510{
511 UNSERIALIZE_SCALAR(fd);
512 UNSERIALIZE_SCALAR(isPipe);
513 UNSERIALIZE_SCALAR(filename);
514 UNSERIALIZE_SCALAR(flags);
515 UNSERIALIZE_SCALAR(readPipeSource);
516 UNSERIALIZE_SCALAR(fileOffset);
517}
518
519void
513Process::serialize(std::ostream &os)
520Process::serialize(CheckpointOut &cp) const
514{
515 SERIALIZE_SCALAR(brk_point);
516 SERIALIZE_SCALAR(stack_base);
517 SERIALIZE_SCALAR(stack_size);
518 SERIALIZE_SCALAR(stack_min);
519 SERIALIZE_SCALAR(next_thread_stack_base);
520 SERIALIZE_SCALAR(mmap_start);
521 SERIALIZE_SCALAR(mmap_end);
522 SERIALIZE_SCALAR(nxm_start);
523 SERIALIZE_SCALAR(nxm_end);
521{
522 SERIALIZE_SCALAR(brk_point);
523 SERIALIZE_SCALAR(stack_base);
524 SERIALIZE_SCALAR(stack_size);
525 SERIALIZE_SCALAR(stack_min);
526 SERIALIZE_SCALAR(next_thread_stack_base);
527 SERIALIZE_SCALAR(mmap_start);
528 SERIALIZE_SCALAR(mmap_end);
529 SERIALIZE_SCALAR(nxm_start);
530 SERIALIZE_SCALAR(nxm_end);
524 find_file_offsets();
525 pTable->serialize(os);
531 pTable->serialize(cp);
526 for (int x = 0; x <= MAX_FD; x++) {
532 for (int x = 0; x <= MAX_FD; x++) {
527 nameOut(os, csprintf("%s.FdMap%d", name(), x));
528 fd_map[x].serialize(os);
533 fd_map[x].serializeSection(cp, csprintf("FdMap%d", x));
529 }
530 SERIALIZE_SCALAR(M5_pid);
531
532}
533
534void
534 }
535 SERIALIZE_SCALAR(M5_pid);
536
537}
538
539void
535Process::unserialize(Checkpoint *cp, const std::string &section)
540Process::unserialize(CheckpointIn &cp)
536{
537 UNSERIALIZE_SCALAR(brk_point);
538 UNSERIALIZE_SCALAR(stack_base);
539 UNSERIALIZE_SCALAR(stack_size);
540 UNSERIALIZE_SCALAR(stack_min);
541 UNSERIALIZE_SCALAR(next_thread_stack_base);
542 UNSERIALIZE_SCALAR(mmap_start);
543 UNSERIALIZE_SCALAR(mmap_end);
544 UNSERIALIZE_SCALAR(nxm_start);
545 UNSERIALIZE_SCALAR(nxm_end);
541{
542 UNSERIALIZE_SCALAR(brk_point);
543 UNSERIALIZE_SCALAR(stack_base);
544 UNSERIALIZE_SCALAR(stack_size);
545 UNSERIALIZE_SCALAR(stack_min);
546 UNSERIALIZE_SCALAR(next_thread_stack_base);
547 UNSERIALIZE_SCALAR(mmap_start);
548 UNSERIALIZE_SCALAR(mmap_end);
549 UNSERIALIZE_SCALAR(nxm_start);
550 UNSERIALIZE_SCALAR(nxm_end);
546 pTable->unserialize(cp, section);
551 pTable->unserialize(cp);
547 for (int x = 0; x <= MAX_FD; x++) {
552 for (int x = 0; x <= MAX_FD; x++) {
548 fd_map[x].unserialize(cp, csprintf("%s.FdMap%d", section, x));
553 fd_map[x].unserializeSection(cp, csprintf("FdMap%d", x));
549 }
550 fix_file_offsets();
551 UNSERIALIZE_OPT_SCALAR(M5_pid);
552 // The above returns a bool so that you could do something if you don't
553 // find the param in the checkpoint if you wanted to, like set a default
554 // but in this case we'll just stick with the instantianted value if not
555 // found.
556}

--- 226 unchanged lines hidden ---
554 }
555 fix_file_offsets();
556 UNSERIALIZE_OPT_SCALAR(M5_pid);
557 // The above returns a bool so that you could do something if you don't
558 // find the param in the checkpoint if you wanted to, like set a default
559 // but in this case we'll just stick with the instantianted value if not
560 // found.
561}

--- 226 unchanged lines hidden ---