trace: reimplement the DTRACE function so it doesn't use a vector
[gem5.git] / src / kern / tru64 / mbuf.hh
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;
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 * Authors: Nathan Binkert
29 */
30
31 #ifndef __MBUF_HH__
32 #define __MBUF_HH__
33
34 #include "arch/isa_traits.hh"
35 #include "base/types.hh"
36
37 namespace tru64 {
38
39 struct m_hdr {
40 Addr mh_next; // 0x00
41 Addr mh_nextpkt; // 0x08
42 Addr mh_data; // 0x10
43 int32_t mh_len; // 0x18
44 int32_t mh_type; // 0x1C
45 int32_t mh_flags; // 0x20
46 int32_t mh_pad0; // 0x24
47 Addr mh_foo[4]; // 0x28, 0x30, 0x38, 0x40
48 };
49
50 struct pkthdr {
51 int32_t len;
52 int32_t protocolSum;
53 Addr rcvif;
54 };
55
56 struct m_ext {
57 Addr ext_buf; // 0x00
58 Addr ext_free; // 0x08
59 uint32_t ext_size; // 0x10
60 uint32_t ext_pad0; // 0x14
61 Addr ext_arg; // 0x18
62 struct ext_refq {
63 Addr forw, back; // 0x20, 0x28
64 } ext_ref;
65 Addr uiomove_f; // 0x30
66 int32_t protocolSum; // 0x38
67 int32_t bytesSummed; // 0x3C
68 Addr checksum; // 0x40
69 };
70
71 struct mbuf {
72 struct m_hdr m_hdr;
73 union {
74 struct {
75 struct pkthdr MH_pkthdr;
76 union {
77 struct m_ext MH_ext;
78 char MH_databuf[1];
79 } MH_dat;
80 } MH;
81 char M_databuf[1];
82 } M_dat;
83 };
84
85 #define m_attr m_hdr.mh_attr
86 #define m_next m_hdr.mh_next
87 #define m_len m_hdr.mh_len
88 #define m_data m_hdr.mh_data
89 #define m_type m_hdr.mh_type
90 #define m_flags m_hdr.mh_flags
91 #define m_nextpkt m_hdr.mh_nextpkt
92 #define m_act m_nextpkt
93 #define m_pkthdr M_dat.MH.MH_pkthdr
94 #define m_ext M_dat.MH.MH_dat.MH_ext
95 #define m_pktdat M_dat.MH.MH_dat.MH_databuf
96 #define m_dat M_dat.M_databuf
97
98 }
99
100 #endif // __MBUF_HH__