]> git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/Diagnostics.h
xnu-792.10.96.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 * Keep selectors in sync with the x86 version where possible.
33 */
34 #ifdef KERNEL_PRIVATE
35
36 #ifndef _DIAGNOSTICS_H_
37 #define _DIAGNOSTICS_H_
38
39 #ifndef __ppc__
40 #error This file is only useful on PowerPC.
41 #endif
42 #include <ppc/savearea.h>
43
44 int diagCall(struct savearea *save);
45
46 #define diagSCnum 0x00006000
47
48 #define dgAdjTB 0
49 #define dgLRA 1
50 #define dgpcpy 2
51 #define dgreset 3
52 #define dgtest 4
53 #define dgBMphys 5
54 #define dgUnMap 6
55 #define dgBootScreen 7
56 #define dgFlush 8
57 #define dgAlign 9
58 #define dgprw 10
59 #define dgmck 11
60 #define dg64 12
61 #define dgProbeRead 13
62 #define dgCPNull 14
63 #define dgPerfMon 15
64 #define dgMapPage 16
65 #define dgScom 17
66 #define dgBind 18
67 #define dgPproc 19
68 #define dgAcntg 20
69 #define dgKlra 21
70 #define dgKfree 22
71 #define dgWar 23
72
73
74 typedef struct diagWork { /* Diagnostic work area */
75
76 unsigned int dgLock; /* Lock if needed */
77 unsigned int dgFlags; /* Flags */
78 #define enaExpTrace 0x00000001
79 #define enaExpTraceb 31
80 #define enaUsrFCall 0x00000002
81 #define enaUsrFCallb 30
82 #define enaUsrPhyMp 0x00000004
83 #define enaUsrPhyMpb 29
84 #define enaDiagSCs 0x00000008
85 #define enaDiagSCsb 28
86 #define enaDiagDM 0x00000010
87 #define enaDiagSDMb 27
88 #define enaDiagEM 0x00000020
89 #define enaDiagEMb 26
90 #define enaDiagTrap 0x00000040
91 #define enaDiagTrapb 25
92 #define enaNotifyEM 0x00000080
93 #define enaNotifyEMb 24
94
95 unsigned int dgMisc0;
96 unsigned int dgMisc1;
97 unsigned int dgMisc2;
98 unsigned int dgMisc3;
99 unsigned int dgMisc4;
100 unsigned int dgMisc5;
101
102 } diagWork;
103
104 typedef struct scomcomm {
105 uint16_t scomcpu; /* CPU number */
106 uint16_t scomfunc; /* 0 = read; 1 = write */
107 uint32_t scomreg; /* SCOM register */
108 uint64_t scomstat; /* returned status */
109 uint64_t scomdata; /* input for write, output for read */
110 } scomcomm;
111
112 extern diagWork dgWork;
113 extern int diagTrap(struct savearea *, unsigned int);
114
115
116 #endif /* _DIAGNOSTICS_H_ */
117
118 #endif /* KERNEL_PRIVATE */