]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/ppc/Firmware.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * @OSF_FREE_COPYRIGHT@
32 * @APPLE_FREE_COPYRIGHT@
36 * Here be the firmware's public interfaces
37 * Lovingly crafted by Bill Angell using traditional methods
44 #error This file is only useful on PowerPC.
47 #include <mach/vm_types.h>
48 #include <ppc/Diagnostics.h>
51 * This routine is used to write debug output to either the modem or printer port.
52 * parm 1 is printer (0) or modem (1); parm 2 is ID (printed directly); parm 3 converted to hex
55 void dbgDisp(unsigned int port
, unsigned int id
, unsigned int data
);
56 void dbgLog(unsigned int d0
, unsigned int d1
, unsigned int d2
, unsigned int d3
);
57 void dbgLog2(unsigned int type
, unsigned int p1
, unsigned int p2
);
58 void dbgDispLL(unsigned int port
, unsigned int id
, unsigned int data
);
59 void fwSCCinit(unsigned int port
);
60 void fwEmMck(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); /* Start injecting */
61 void fwSCOM(scomcomm
*); /* Read/Write SCOM */
62 void setPmon(unsigned int, unsigned int); /* Set perf mon stuff */
64 extern void dbgTrace(unsigned int id
, unsigned int item1
, unsigned int item2
, unsigned int item3
, unsigned int item4
);
65 #if 0 /* (TEST/DEBUG) - eliminate inline */
66 extern __inline__
void dbgTrace(unsigned int id
, unsigned int item1
, unsigned int item2
, unsigned int item3
, unsigned int item4
) {
68 __asm__
volatile("mr r2,%0" : : "r" (id
) : "r2");
69 __asm__
volatile("mr r3,%0" : : "r" (item1
) : "r3");
70 __asm__
volatile("mr r4,%0" : : "r" (item2
) : "r4");
71 __asm__
volatile("mr r5,%0" : : "r" (item3
) : "r5");
72 __asm__
volatile("mr r6,%0" : : "r" (item3
) : "r6");
73 __asm__
volatile("lis r0,hi16(CutTrace)" : : : "r0");
74 __asm__
volatile("ori r0,r0,lo16(CutTrace)" : : : "r0");
75 __asm__
volatile("sc");
80 extern void DoPreempt(void);
81 extern __inline__
void DoPreempt(void) {
82 __asm__
volatile("lis r0,hi16(DoPreemptCall)" : : : "r0");
83 __asm__
volatile("ori r0,r0,lo16(DoPreemptCall)" : : : "r0");
84 __asm__
volatile("sc");
88 extern void CreateFakeIO(void);
89 extern __inline__
void CreateFakeIO(void) {
90 __asm__
volatile("lis r0,hi16(CreateFakeIOCall)" : : : "r0");
91 __asm__
volatile("ori r0,r0,lo16(CreateFakeIOCall)" : : : "r0");
92 __asm__
volatile("sc");
96 extern void CreateFakeDEC(void);
97 extern __inline__
void CreateFakeDEC(void) {
98 __asm__
volatile("lis r0,hi16(CreateFakeDECCall)" : : : "r0");
99 __asm__
volatile("ori r0,r0,lo16(CreateFakeDECCall)" : : : "r0");
100 __asm__
volatile("sc");
104 extern void CreateShutdownCTX(void);
105 extern __inline__
void CreateShutdownCTX(void) {
106 __asm__
volatile("lis r0,hi16(CreateShutdownCTXCall)" : : : "r0");
107 __asm__
volatile("ori r0,r0,lo16(CreateShutdownCTXCall)" : : : "r0");
108 __asm__
volatile("sc");
112 extern void ChokeSys(unsigned int ercd
);
113 extern __inline__
void ChokeSys(unsigned int ercd
) {
114 __asm__
volatile("mr r3,%0" : : "r" (ercd
) : "r3");
115 __asm__
volatile("lis r0,hi16(Choke)" : : : "r0");
116 __asm__
volatile("ori r0,r0,lo16(Choke)" : : : "r0");
117 __asm__
volatile("sc");
121 typedef struct Boot_Video bootBumbleC
;
123 extern void StoreReal(unsigned int val
, unsigned int addr
);
124 extern void ReadReal(addr64_t raddr
, unsigned int *vaddr
);
125 extern void ClearReal(unsigned int addr
, unsigned int lgn
);
126 extern void LoadDBATs(unsigned int *bat
);
127 extern void LoadIBATs(unsigned int *bat
);
128 extern void stFloat(unsigned int *addr
);
129 extern int stVectors(unsigned int *addr
);
130 extern int stSpecrs(unsigned int *addr
);
131 extern unsigned int LLTraceSet(unsigned int tflags
);
132 extern void GratefulDebInit(bootBumbleC
*boot_video_info
);
133 extern void GratefulDebDisp(unsigned int coord
, unsigned int data
);
134 extern void checkNMI(void);
136 #pragma pack(4) /* Make sure the structure stays as we defined it */
137 typedef struct GDWorkArea
{ /* Grateful Deb work area one per processor */
139 /* Note that a lot of info is duplicated for each processor */
141 unsigned int GDsave
[32]; /* Save area for registers */
143 unsigned int GDfp0
[2];
144 unsigned int GDfp1
[2];
145 unsigned int GDfp2
[2];
146 unsigned int GDfp3
[2];
148 unsigned int GDtop
; /* Top pixel of CPU's window */
149 unsigned int GDleft
; /* Left pixel of CPU's window */
150 unsigned int GDtopleft
; /* Physical address of top left in frame buffer */
151 unsigned int GDrowbytes
; /* Bytes per row */
152 unsigned int GDrowchar
; /* Bytes per row of characters plus leading */
153 unsigned int GDdepth
; /* Bits per pixel */
154 unsigned int GDcollgn
; /* Column width in bytes */
155 unsigned int GDready
; /* We are ready to go */
156 unsigned int GDfiller
[16]; /* Fill it up to a 256 byte boundary */
158 unsigned int GDrowbuf1
[128]; /* Buffer to an 8 character row */
159 unsigned int GDrowbuf2
[128]; /* Buffer to an 8 character row */
163 #define GDfontsize 16
166 #endif /* _FIRMWARE_H_ */