VirtIO9P.py revision 10391:4a501e0f7540
114039Sstacze01@arm.com# -*- mode:python -*-
214039Sstacze01@arm.com
314039Sstacze01@arm.com# Copyright (c) 2014 ARM Limited
414039Sstacze01@arm.com# All rights reserved.
514039Sstacze01@arm.com#
614039Sstacze01@arm.com# The license below extends only to copyright in the software and shall
714039Sstacze01@arm.com# not be construed as granting a license to any other intellectual
814039Sstacze01@arm.com# property including but not limited to intellectual property relating
914039Sstacze01@arm.com# to a hardware implementation of the functionality of the software
1014039Sstacze01@arm.com# licensed hereunder.  You may use the software subject to the license
1114039Sstacze01@arm.com# terms below provided that you ensure that this notice is replicated
1214039Sstacze01@arm.com# unmodified and in its entirety in all distributions of the software,
1314039Sstacze01@arm.com# modified or unmodified, in source code or in binary form.
1414039Sstacze01@arm.com#
1514039Sstacze01@arm.com# Redistribution and use in source and binary forms, with or without
1614039Sstacze01@arm.com# modification, are permitted provided that the following conditions are
1714039Sstacze01@arm.com# met: redistributions of source code must retain the above copyright
1814039Sstacze01@arm.com# notice, this list of conditions and the following disclaimer;
1914039Sstacze01@arm.com# redistributions in binary form must reproduce the above copyright
2014039Sstacze01@arm.com# notice, this list of conditions and the following disclaimer in the
2114039Sstacze01@arm.com# documentation and/or other materials provided with the distribution;
2214039Sstacze01@arm.com# neither the name of the copyright holders nor the names of its
2314039Sstacze01@arm.com# contributors may be used to endorse or promote products derived from
2414039Sstacze01@arm.com# this software without specific prior written permission.
2514039Sstacze01@arm.com#
2614039Sstacze01@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2714039Sstacze01@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2814039Sstacze01@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2914039Sstacze01@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3014039Sstacze01@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3114039Sstacze01@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3214039Sstacze01@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3314039Sstacze01@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3414039Sstacze01@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3514039Sstacze01@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3614039Sstacze01@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3714039Sstacze01@arm.com#
3814039Sstacze01@arm.com# Authors: Andreas Sandberg
3914039Sstacze01@arm.com
4014039Sstacze01@arm.comfrom m5.params import *
4114039Sstacze01@arm.comfrom m5.proxy import *
4214039Sstacze01@arm.comfrom VirtIO import VirtIODeviceBase
4314039Sstacze01@arm.com
4414039Sstacze01@arm.comclass VirtIO9PBase(VirtIODeviceBase):
4514039Sstacze01@arm.com    type = 'VirtIO9PBase'
4614039Sstacze01@arm.com    abstract = True
4714039Sstacze01@arm.com    cxx_header = 'dev/virtio/fs9p.hh'
4814039Sstacze01@arm.com
4914039Sstacze01@arm.com    queueSize = Param.Unsigned(32, "Output queue size (pages)")
5014039Sstacze01@arm.com    tag = Param.String("gem5", "Mount tag")
5114039Sstacze01@arm.com
5214039Sstacze01@arm.com
5314039Sstacze01@arm.comclass VirtIO9PProxy(VirtIO9PBase):
5414039Sstacze01@arm.com    type = 'VirtIO9PProxy'
5514039Sstacze01@arm.com    abstract = True
5614039Sstacze01@arm.com    cxx_header = 'dev/virtio/fs9p.hh'
5714039Sstacze01@arm.com
5814039Sstacze01@arm.comclass VirtIO9PDiod(VirtIO9PProxy):
5914039Sstacze01@arm.com    type = 'VirtIO9PDiod'
6014039Sstacze01@arm.com    cxx_header = 'dev/virtio/fs9p.hh'
6114039Sstacze01@arm.com
6214039Sstacze01@arm.com    diod = Param.String("/usr/sbin/diod", "Path to diod")
6314039Sstacze01@arm.com    root = Param.String("/tmp", "Path to export through diod")
6414039Sstacze01@arm.com
6514039Sstacze01@arm.comclass VirtIO9PSocket(VirtIO9PProxy):
6614039Sstacze01@arm.com    type = 'VirtIO9PSocket'
6714039Sstacze01@arm.com    cxx_header = 'dev/virtio/fs9p.hh'
6814039Sstacze01@arm.com
6914039Sstacze01@arm.com    server = Param.String("127.0.0.1", "9P server address or host name")
7014039Sstacze01@arm.com    port = Param.String("564", "9P server port")
7114039Sstacze01@arm.com