change the naming of MainBins. didn't check this in before because i had random...
[gem5.git] / kern / tru64 / mbuf.hh
1 /*
2 * Copyright (c) 2003 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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #ifndef __MBUF_HH__
30 #define __MBUF_HH__
31
32 #include "sim/host.hh"
33 #include "targetarch/isa_traits.hh"
34
35 struct m_hdr {
36 Addr mh_next; // 0x00
37 Addr mh_nextpkt; // 0x08
38 Addr mh_data; // 0x10
39 int32_t mh_len; // 0x18
40 int32_t mh_type; // 0x1C
41 int32_t mh_flags; // 0x20
42 int32_t mh_pad0; // 0x24
43 Addr mh_foo[4]; // 0x28, 0x30, 0x38, 0x40
44 };
45
46 struct pkthdr {
47 int32_t len;
48 int32_t protocolSum;
49 Addr rcvif;
50 };
51
52 struct m_ext {
53 Addr ext_buf; // 0x00
54 Addr ext_free; // 0x08
55 uint32_t ext_size; // 0x10
56 uint32_t ext_pad0; // 0x14
57 Addr ext_arg; // 0x18
58 struct ext_refq {
59 Addr forw, back; // 0x20, 0x28
60 } ext_ref;
61 Addr uiomove_f; // 0x30
62 int32_t protocolSum; // 0x38
63 int32_t bytesSummed; // 0x3C
64 Addr checksum; // 0x40
65 };
66
67 struct mbuf {
68 struct m_hdr m_hdr;
69 union {
70 struct {
71 struct pkthdr MH_pkthdr;
72 union {
73 struct m_ext MH_ext;
74 char MH_databuf[1];
75 } MH_dat;
76 } MH;
77 char M_databuf[1];
78 } M_dat;
79 };
80
81 #define m_attr m_hdr.mh_attr
82 #define m_next m_hdr.mh_next
83 #define m_len m_hdr.mh_len
84 #define m_data m_hdr.mh_data
85 #define m_type m_hdr.mh_type
86 #define m_flags m_hdr.mh_flags
87 #define m_nextpkt m_hdr.mh_nextpkt
88 #define m_act m_nextpkt
89 #define m_pkthdr M_dat.MH.MH_pkthdr
90 #define m_ext M_dat.MH.MH_dat.MH_ext
91 #define m_pktdat M_dat.MH.MH_dat.MH_databuf
92 #define m_dat M_dat.M_databuf
93
94 #endif // __MBUF_HH__