1 | /* |
---|
2 | * This program is free software; you can redistribute it and/or modify |
---|
3 | * it under the terms of the GNU General Public License as published by |
---|
4 | * the Free Software Foundation; either version 2 of the License, or |
---|
5 | * (at your option) any later version. |
---|
6 | * |
---|
7 | * This program is distributed in the hope that it will be useful, |
---|
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
10 | * GNU General Public License for more details. |
---|
11 | * |
---|
12 | * You should have received a copy of the GNU General Public License |
---|
13 | * along with this program; if not, write to the Free Software |
---|
14 | * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
15 | * |
---|
16 | * Copyright (C) IBM Corp. 2005 |
---|
17 | * |
---|
18 | * Authors: Jimi Xenidis <jimix@watson.ibm.com> |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef _TCE_H |
---|
22 | #define _TCE_H |
---|
23 | |
---|
24 | #include <xen/config.h> |
---|
25 | #include <xen/types.h> |
---|
26 | |
---|
27 | union tce { |
---|
28 | u64 tce_dword; |
---|
29 | struct tce_bits { |
---|
30 | /* the bits here reflect the definition in Linux */ |
---|
31 | /* the RPA considers all 52 bits to be the RPN */ |
---|
32 | u64 tce_cache : 6; |
---|
33 | u64 _tce_r0 : 6; /* reserved */ |
---|
34 | u64 tce_rpn :40; /* Real Page Number */ |
---|
35 | |
---|
36 | /* The RPA considers the next 10 bits reserved */ |
---|
37 | u64 tce_v : 1; /* Valid bit */ |
---|
38 | u64 tce_vlps : 1; /* Valid for LPs */ |
---|
39 | u64 tce_lpx : 8; /* LP index */ |
---|
40 | |
---|
41 | /* the RPA defines the following two bits as: |
---|
42 | * 00: no access |
---|
43 | * 01: System Address read only |
---|
44 | * 10: System Address write only |
---|
45 | * 11: read/write |
---|
46 | */ |
---|
47 | u64 tce_write : 1; |
---|
48 | u64 tce_read : 1; |
---|
49 | } tce_bits; |
---|
50 | }; |
---|
51 | |
---|
52 | union tce_bdesc { |
---|
53 | u64 lbd_dword; |
---|
54 | struct lbd_bits { |
---|
55 | u64 lbd_ctrl_v : 1; |
---|
56 | u64 lbd_ctrl_vtoggle : 1; |
---|
57 | u64 _lbd_ctrl_res0 : 6; |
---|
58 | u64 lbd_len :24; |
---|
59 | u64 lbd_addr :32; |
---|
60 | } lbd_bits; |
---|
61 | }; |
---|
62 | |
---|
63 | struct tce_data { |
---|
64 | ulong t_entries; |
---|
65 | ulong t_base; |
---|
66 | ulong t_alloc_size; |
---|
67 | union tce *t_tce; |
---|
68 | }; |
---|
69 | |
---|
70 | #endif /* _TCE_H */ |
---|
71 | |
---|