fd_entry.cc revision 12697
110930Sbrandon.potter@amd.com/*
211856Sbrandon.potter@amd.com * Copyright (c) 2016 Advanced Micro Devices, Inc.
311856Sbrandon.potter@amd.com * All rights reserved.
411856Sbrandon.potter@amd.com *
511856Sbrandon.potter@amd.com * For use for simulation and test purposes only
610930Sbrandon.potter@amd.com *
710930Sbrandon.potter@amd.com * Redistribution and use in source and binary forms, with or without
811856Sbrandon.potter@amd.com * modification, are permitted provided that the following conditions are met:
910930Sbrandon.potter@amd.com *
1011856Sbrandon.potter@amd.com * 1. Redistributions of source code must retain the above copyright notice,
1111856Sbrandon.potter@amd.com * this list of conditions and the following disclaimer.
1210930Sbrandon.potter@amd.com *
1311856Sbrandon.potter@amd.com * 2. Redistributions in binary form must reproduce the above copyright notice,
1411856Sbrandon.potter@amd.com * this list of conditions and the following disclaimer in the documentation
1511856Sbrandon.potter@amd.com * and/or other materials provided with the distribution.
1611856Sbrandon.potter@amd.com *
1711856Sbrandon.potter@amd.com * 3. Neither the name of the copyright holder nor the names of its
1811856Sbrandon.potter@amd.com * contributors may be used to endorse or promote products derived from this
1911856Sbrandon.potter@amd.com * software without specific prior written permission.
2011856Sbrandon.potter@amd.com *
2111856Sbrandon.potter@amd.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2211856Sbrandon.potter@amd.com * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2311856Sbrandon.potter@amd.com * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2411856Sbrandon.potter@amd.com * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2511856Sbrandon.potter@amd.com * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2611856Sbrandon.potter@amd.com * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2711856Sbrandon.potter@amd.com * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2811856Sbrandon.potter@amd.com * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2911856Sbrandon.potter@amd.com * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3011856Sbrandon.potter@amd.com * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3111856Sbrandon.potter@amd.com * POSSIBILITY OF SUCH DAMAGE.
3211856Sbrandon.potter@amd.com *
3312697Santhony.gutierrez@amd.com * Authors: Brandon Potter
3410930Sbrandon.potter@amd.com */
3510930Sbrandon.potter@amd.com
3611856Sbrandon.potter@amd.com#include "sim/fd_entry.hh"
3710930Sbrandon.potter@amd.com
3811856Sbrandon.potter@amd.com#include "sim/serialize.hh"
3910930Sbrandon.potter@amd.com
4010930Sbrandon.potter@amd.comvoid
4110930Sbrandon.potter@amd.comFDEntry::serialize(CheckpointOut &cp) const
4210930Sbrandon.potter@amd.com{
4311856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_closeOnExec);
4410930Sbrandon.potter@amd.com}
4510930Sbrandon.potter@amd.com
4610930Sbrandon.potter@amd.comvoid
4710930Sbrandon.potter@amd.comFDEntry::unserialize(CheckpointIn &cp)
4810930Sbrandon.potter@amd.com{
4911856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_closeOnExec);
5010930Sbrandon.potter@amd.com}
5110930Sbrandon.potter@amd.com
5210930Sbrandon.potter@amd.comvoid
5311856Sbrandon.potter@amd.comFileFDEntry::serialize(CheckpointOut &cp) const
5410930Sbrandon.potter@amd.com{
5511856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_closeOnExec);
5611856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_flags);
5711856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_fileName);
5811856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_fileOffset);
5910930Sbrandon.potter@amd.com}
6010930Sbrandon.potter@amd.com
6110930Sbrandon.potter@amd.comvoid
6211856Sbrandon.potter@amd.comFileFDEntry::unserialize(CheckpointIn &cp)
6310930Sbrandon.potter@amd.com{
6411856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_closeOnExec);
6511856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_flags);
6611856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_fileName);
6711856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_fileOffset);
6810930Sbrandon.potter@amd.com}
6911856Sbrandon.potter@amd.com
7011856Sbrandon.potter@amd.comvoid
7111856Sbrandon.potter@amd.comPipeFDEntry::serialize(CheckpointOut &cp) const
7211856Sbrandon.potter@amd.com{
7311856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_closeOnExec);
7411856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_flags);
7511856Sbrandon.potter@amd.com    //SERIALIZE_SCALAR(_pipeEndType);
7611856Sbrandon.potter@amd.com}
7711856Sbrandon.potter@amd.com
7811856Sbrandon.potter@amd.comvoid
7911856Sbrandon.potter@amd.comPipeFDEntry::unserialize(CheckpointIn &cp)
8011856Sbrandon.potter@amd.com{
8111856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_closeOnExec);
8211856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_flags);
8311856Sbrandon.potter@amd.com    //UNSERIALIZE_SCALAR(_pipeEndType);
8411856Sbrandon.potter@amd.com}
8511856Sbrandon.potter@amd.com
8611856Sbrandon.potter@amd.comvoid
8711856Sbrandon.potter@amd.comDeviceFDEntry::serialize(CheckpointOut &cp) const
8811856Sbrandon.potter@amd.com{
8911856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_closeOnExec);
9011856Sbrandon.potter@amd.com    //SERIALIZE_SCALAR(_driver);
9111856Sbrandon.potter@amd.com    SERIALIZE_SCALAR(_fileName);
9211856Sbrandon.potter@amd.com}
9311856Sbrandon.potter@amd.com
9411856Sbrandon.potter@amd.comvoid
9511856Sbrandon.potter@amd.comDeviceFDEntry::unserialize(CheckpointIn &cp)
9611856Sbrandon.potter@amd.com{
9711856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_closeOnExec);
9811856Sbrandon.potter@amd.com    //UNSERIALIZE_SCALAR(_driver);
9911856Sbrandon.potter@amd.com    UNSERIALIZE_SCALAR(_fileName);
10011856Sbrandon.potter@amd.com}
101