]> git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/Diagnostics.h
xnu-517.9.4.tar.gz
[apple/xnu.git] / osfmk / ppc / Diagnostics.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_FREE_COPYRIGHT@
24 */
25 /*
26 * @APPLE_FREE_COPYRIGHT@
27 */
28
29 /*
30 * Here are the Diagnostic interface interfaces
31 * Lovingly crafted by Bill Angell using traditional methods
32 */
33
34 #ifndef _DIAGNOSTICS_H_
35 #define _DIAGNOSTICS_H_
36
37 #ifndef __ppc__
38 #error This file is only useful on PowerPC.
39 #endif
40 #include <ppc/savearea.h>
41
42 int diagCall(struct savearea *save);
43
44 #define diagSCnum 0x00006000
45
46 #define dgAdjTB 0
47 #define dgLRA 1
48 #define dgpcpy 2
49 #define dgreset 3
50 #define dgtest 4
51 #define dgBMphys 5
52 #define dgUnMap 6
53 #define dgBootScreen 7
54 #define dgFlush 8
55 #define dgAlign 9
56 #define dgprw 10
57 #define dgmck 11
58 #define dg64 12
59 #define dgProbeRead 13
60 #define dgCPNull 14
61 #define dgPerfMon 15
62 #define dgMapPage 16
63 #define dgScom 17
64
65
66 typedef struct diagWork { /* Diagnostic work area */
67
68 unsigned int dgLock; /* Lock if needed */
69 unsigned int dgFlags; /* Flags */
70 #define enaExpTrace 0x00000001
71 #define enaExpTraceb 31
72 #define enaUsrFCall 0x00000002
73 #define enaUsrFCallb 30
74 #define enaUsrPhyMp 0x00000004
75 #define enaUsrPhyMpb 29
76 #define enaDiagSCs 0x00000008
77 #define enaDiagSCsb 28
78 #define enaDiagDM 0x00000010
79 #define enaDiagSDMb 27
80 #define enaDiagEM 0x00000020
81 #define enaDiagEMb 26
82 #define enaDiagTrap 0x00000040
83 #define enaDiagTrapb 25
84 #define enaNotifyEM 0x00000080
85 #define enaNotifyEMb 24
86 /* Suppress lock checks */
87 #define disLkType 0x80000000
88 #define disLktypeb 0
89 #define disLkThread 0x40000000
90 #define disLkThreadb 1
91 #define disLkNmSimp 0x20000000
92 #define disLkNmSimpb 2
93 #define disLkMyLck 0x10000000
94 #define disLkMyLckb 3
95
96 unsigned int dgMisc0;
97 unsigned int dgMisc1;
98 unsigned int dgMisc2;
99 unsigned int dgMisc3;
100 unsigned int dgMisc4;
101 unsigned int dgMisc5;
102
103 } diagWork;
104
105 typedef struct scomcomm {
106 uint16_t scomcpu; /* CPU number */
107 uint16_t scomfunc; /* 0 = read; 1 = write */
108 uint32_t scomreg; /* SCOM register */
109 uint64_t scomstat; /* returned status */
110 uint64_t scomdata; /* input for write, output for read */
111 } scomcomm;
112
113 extern diagWork dgWork;
114 extern int diagTrap(struct savearea *, unsigned int);
115
116
117 #endif /* _DIAGNOSTICS_H_ */